1.完善看板数据加载

master
董哲奇 8 months ago
parent 6727f02660
commit 585f330c22

@ -380,12 +380,13 @@ public class DmYdjh implements Serializable {
HXFK("52"),
QGPG("61"),
QGFK("62"),
//7预留其他工序
//坡口,曲面,打磨
PK("81"), QM("82"),DM("83"),
WC("99")//完成
;
@Getter
public String code;
}
public static void main(String[] args) {
}
}

@ -0,0 +1,65 @@
package com.dsic.gj_erp.controller.kban;
import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.service.zyjh.ZyjhService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("kban")
@AllArgsConstructor
public class KbanController {
private final ZyjhService zyjhService;
/**
*
*/
@GetMapping("gxjhwcqk")
public ResultBean<?> gxjhwcqk(){
List<Map<String, Object>> gxjhwcqk = zyjhService.gxjhwcqk();
return new ResultBean<>(gxjhwcqk);
}
/**
* ()
*/
@GetMapping("gyfcl")
public ResultBean<?> gyfcl(){
return new ResultBean<>(zyjhService.gyfcl());
}
/**
* ()
*/
@GetMapping("jhwcqk")
public ResultBean<?> jhwcqk(){
return new ResultBean<>(zyjhService.jhwcqk());
}
/**
*
*/
@GetMapping("gekuachaliang")
public ResultBean<?> gekuachaliang(){
return new ResultBean<>(zyjhService.gekuachaliang());
}
/**
*
*/
@GetMapping("kq")
public ResultBean<?> kq(){
Map<String,Object> map=new HashMap<>();
map.put("出勤",283);
map.put("请假",15);
map.put("缺勤",2);
return new ResultBean<>(map);
}
}

@ -0,0 +1,9 @@
package com.dsic.gj_erp.controller.kban;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class dto {
}

@ -0,0 +1,32 @@
package com.dsic.gj_erp.controller.yuyin;
import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.wsclient.WebSocketClientComponent;
import com.dsic.gj_erp.wsclient.WebSocketService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.socket.WebSocketSession;
@RestController
@RequestMapping("yuyin")
@RequiredArgsConstructor
public class YuyinController {
private final WebSocketService socketService;
private final WebSocketClientComponent clientComponent;
/**
* websocket
*/
@GetMapping("recon")
public ResultBean<?> recon(){
WebSocketSession session = socketService.getSession();
if (session==null){
clientComponent.init();
}
return new ResultBean<>();
}
}

@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsic.gj_erp.bean.jhgk.DmSygdMx;
import com.dsic.gj_erp.bean.jhgk.DmYdjh;
import com.dsic.gj_erp.bean.pgd.*;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* <p>
@ -36,4 +38,13 @@ public interface DmYdjhMapper extends BaseMapper<DmYdjh> {
List<PgdSljh> getSljh1(@Param("begin") String begin, @Param("end") String end);
List<PgdPwjh> getPwjh1(@Param("begin") String begin, @Param("end") String end);
List<PgdQgjh> getQgjh1(@Param("begin") String begin, @Param("end") String end);
@MapKey("kw")
Map<String,Object> gekuachaliang(String from,String to,String zt);
List<Map<String,Object>> jhwcqk(String from,String to);
List<Map<String,Object>> gyfcl();
List<Map<String,Object>> gxjhwcqk(String from,String to);
}

@ -1,5 +1,7 @@
package com.dsic.gj_erp.service.zyjh;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -8,9 +10,37 @@ import com.dsic.gj_erp.controller.zyjh.dto.ShangLiao;
import com.dsic.gj_erp.mapper.jhgk.DmYdjhMapper;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service
public class ZyjhService extends ServiceImpl<DmYdjhMapper,DmYdjh> {
public List<Map<String, Object>> gxjhwcqk(){
DateTime date = DateUtil.lastMonth();
String from= DateUtil.beginOfMonth(date).toString("yyyy/MM/dd");
String to =DateUtil.endOfMonth(date).toString("yyyy/MM/dd");
return baseMapper.gxjhwcqk(from,to);
}
public List<Map<String, Object>> gyfcl(){
return baseMapper.gyfcl();
}
public List<Map<String, Object>> jhwcqk(){
DateTime date = DateUtil.lastMonth();
String from= DateUtil.beginOfMonth(date).toString("yyyy/MM/dd");
String to =DateUtil.endOfMonth(date).toString("yyyy/MM/dd");
return baseMapper.jhwcqk(from,to);
}
public Map<String,Object> gekuachaliang(){
DateTime date = DateUtil.lastMonth();
String from= DateUtil.beginOfMonth(date).toString("yyyy/MM/dd");
String to =DateUtil.endOfMonth(date).toString("yyyy/MM/dd");
return baseMapper.gekuachaliang(from,to,"11");
}
public void updateForSl(ShangLiao sl){
LambdaUpdateWrapper<DmYdjh> wrapper = Wrappers.<DmYdjh>lambdaUpdate()
.set(DmYdjh::getSlycldw, sl.getYdjh().getSlycldw())

@ -17,6 +17,13 @@ public class Message {
@JSONField(serialize = false)
private Instructions instructions;
public CodeEnum getCodeEx(){
if (this.codeEx==null){
this.formatCodeToEnum();
}
return this.codeEx;
}
public static Message reg(String id){
Message message = new Message();
message.setCode(CodeEnum.REG.getCode());
@ -46,6 +53,10 @@ public class Message {
}
}
public void formatCodeToEnum(){
this.formatCodeToEnum(this.code);
}
public void formatCodeToEnum(@NonNull int code){
for (CodeEnum e:CodeEnum.values()){
if (e.getCode()==code){
@ -60,7 +71,7 @@ public class Message {
return e;
}
}
return null;
return CodeEnum.DEFAULT;
}
@Getter
@ -70,6 +81,9 @@ public class Message {
ZX(3000),
RESULT(9002),
HEART(9003),
ERROR(3001),
TIP(3002),
DEFAULT(0)
;
private final int code;

@ -1,6 +1,5 @@
package com.dsic.gj_erp.wsclient;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.dsic.gj_erp.wsclient.handler.ZxHandler;
import lombok.RequiredArgsConstructor;
@ -50,7 +49,7 @@ public class WebSocketService extends TextWebSocketHandler {
@Override
protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception {
System.out.println("Received: " + message.getPayload());
log.info("语音上报:{}",message.getPayload());
Message msg= JSONObject.parseObject(message.getPayload(),Message.class);
switch (msg.getCodeEx()){
case REG:
@ -59,9 +58,11 @@ public class WebSocketService extends TextWebSocketHandler {
case ZX:
zxHandler.execute(msg);
break;
}
}
public WebSocketSession getSession(){
return this.session;
}
}

@ -23,6 +23,7 @@ public class HeartHandler implements IHandlerService{
}
CronUtil.schedule("*/30 * * * * *", (Task) () -> {
try {
System.out.println("心跳");
webSocketService.sendMessage(message.toString());
} catch (Exception e) {
e.printStackTrace();

@ -9,5 +9,5 @@ ws:
maxHttpContentLength: 1048576
maxFramePayloadLength: 1048576
client:
url: ws://127.0.0.1:9000
url: ws://192.168.13.9:9000
id: abc

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dsic.gj_erp.mapper.jhgk.DmYdjhMapper">
@ -74,6 +75,38 @@
<result column="parent_id" property="parentId"/>
</resultMap>
<select id="gxjhwcqk" resultType="java.util.Map">
SELECT zt,bcshzl,slfkrq,pwfkrq,llfkrq,hxfkrq,qgfkrq
from dm_ydjh
WHERE
jssj BETWEEN #{from} and #{to}
</select>
<select id="gyfcl" resultType="map">
SELECT
DISTINCT CONVERT(VARCHAR, MONTH(CONVERT(DATE, jssj, 111))) month,
sum(1) over(PARTITION by CONVERT(VARCHAR, MONTH(CONVERT(DATE, jssj, 111))) ) n,
sum(isnull(bcshzl,0)/1000) over(PARTITION by CONVERT(VARCHAR, MONTH(CONVERT(DATE, jssj, 111))) ) t
from dm_ydjh WHERE zt='62'
</select>
<select id="jhwcqk" resultType="map">
SELECT
DISTINCT zt, sum(isnull(bcshzl,0)/1000) over(PARTITION by zt) as t
from
dm_ydjh
WHERE jssj BETWEEN #{from} and #{to}
</select>
<select id="gekuachaliang" resultType="java.util.Map">
SELECT
DISTINCT b.BMSM,a.kw ,sum(isnull(a.bcshzl,0)/1000) over(PARTITION by a.kw ) as t
from
dm_ydjh a,DM_ZHBMP b
WHERE
b.BMLB ='QGKW' and a.kw=b.bm and a.jssj BETWEEN #{from} and #{to} and zt>#{zt}
</select>
<select id="getSygdmx" resultType="com.dsic.gj_erp.bean.jhgk.DmSygdMx">
SELECT dm_sygd_mx.id,
@ -592,6 +625,7 @@
from dm_ydjh
where dm_ydjh.qgrq BETWEEN #{begin} and #{end}
</select>
<update id="xfbc" parameterType="arraylist">
update pgd_tzjh
set zt='01'

Loading…
Cancel
Save