1.看板相关接口

master
董哲奇 6 months ago
parent 7be4c960ba
commit dab452d1d9

@ -0,0 +1,49 @@
package com.dsic.gj_erp.bean.sy;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.Table;
@Getter
@Setter
@Table
public class SyMsg {
private String id;
//消息类型,41:月度计划下发;其他待定
//根据消息类型,属性为subDataX的字段分别代表不同含义
private String msgType;
private String subId;//发起人id
private String subName;//发起人姓名
private String subTime;//发起时间
private String subText;//发起内容
private String subData1;
private String subData2;
private String subData3;
private String subData4;
private String subData5;
private String handResult;//处理结果
private String handTime;//处理时间
private String handId;//处理人id
private String handName;//处理人
private String handAdv;//处理意见
private String zt;//状态,待定
private String memo;//备注
}

@ -1,27 +1,42 @@
package com.dsic.gj_erp.controller.kban;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsic.gj_erp.annotation.AuthFunction;
import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.bean.jcsj.DmBzry;
import com.dsic.gj_erp.bean.jhgk.DmSygdMx;
import com.dsic.gj_erp.bean.jhgk.DmYdjh;
import com.dsic.gj_erp.bean.jhgk.DmYdjhxf;
import com.dsic.gj_erp.exception.ServiceException;
import com.dsic.gj_erp.service.KbanService;
import com.dsic.gj_erp.service.jcsj.DmBzryService;
import com.dsic.gj_erp.service.jhgk.DmSygdMxService;
import com.dsic.gj_erp.service.sy.impl.SyMsgService;
import com.dsic.gj_erp.service.zyjh.ZyjhService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/**
*
* :
* :,
* :
* :
* :
* :,
* :
*/
@RestController
@RequestMapping("kban")
@AllArgsConstructor
@ -30,6 +45,137 @@ public class KbanController {
private final ZyjhService zyjhService;
private final DmBzryService cqService;
private final KbanService kbanService;
private final SyMsgService msgService;
private final DmSygdMxService service;
/**
*
*/
@GetMapping("/zxqwcqk")
public ResultBean<?> getZxqwcqk(){
List<DmYdjh> list=zyjhService.list(Wrappers.<DmYdjh>lambdaQuery().ge(DmYdjh::getZt,2));
AtomicInteger = new AtomicInteger(0);
AtomicInteger = new AtomicInteger(0);
HashMap<String, Object> = new HashMap<>();
AtomicInteger = new AtomicInteger(0);
AtomicInteger = new AtomicInteger(0);
HashMap<String, Object> = new HashMap<>();
AtomicInteger = new AtomicInteger(0);
AtomicInteger = new AtomicInteger(0);
HashMap<String, Object> = new HashMap<>();
AtomicInteger = new AtomicInteger(0);
AtomicInteger = new AtomicInteger(0);
HashMap<String, Object> = new HashMap<>();
list.forEach(item->{
String subStr=item.getTzbh().substring(6,7);
int zt=0;
try {
zt = Integer.parseInt(subStr);
}catch (Exception e){
e.printStackTrace();
}
if (zt==11){
.incrementAndGet();
}
if (zt>11){
.incrementAndGet();
}
//二区
if ("1".equals(subStr)||"3".equals(subStr)){
if (zt>=2){
.incrementAndGet();
}
if (zt>=62){
.incrementAndGet();
}
}
//三区
if ("2".equals(subStr)){
if (zt>=2){
.incrementAndGet();
}
if (zt>=62){
.incrementAndGet();
}
}
//四区
if ("4".equals(subStr)){
if (zt>=2){
.incrementAndGet();
}
if (zt>=62){
.incrementAndGet();
}
}
});
ArrayList<Object> result = new ArrayList<>();
.put("zyq","一区");
.put("wcl",.get()-.get());
.put("wc",.get());
result.add();
.put("zyq","二区");
.put("wcl",.get()-.get());
.put("wc",.get());
result.add();
.put("zyq","三区");
.put("wcl",.get()-.get());
.put("wc",.get());
result.add();
.put("zyq","四区");
.put("wcl",.get()-.get());
.put("wc",.get());
result.add();
return new ResultBean<>(list);
}
/**
*
*/
@GetMapping("/zxqZxDetail")
public ResultBean<?> zxqZxDetail(){
return new ResultBean<>(this.kbanService.zxqZxDetail());
}
/**
*
*/
@GetMapping("/zyjh")
public ResultBean<?> getZyjhtj(String zyq){
return new ResultBean<>(this.kbanService.getZyjhtj(zyq));
}
@GetMapping("/ydjh")
public ResultBean<?> getList(){
DateTime date = DateUtil.date();
String from = DateUtil.beginOfMonth(date).toString("yyyy/MM/dd");
String to = DateUtil.endOfMonth(date).toString("yyyy/MM/dd");
List<DmYdjhxf> list= this.service.tqSygd1(from,to);
return new ResultBean<>(list);
}
/**
*
*/
@GetMapping("msg")
public ResultBean<?> getMsg(){
return new ResultBean<>(msgService.list());
}
/**
*
@ -53,7 +199,7 @@ public class KbanController {
HashMap<Object, Object> map = new HashMap<>();
map.put("xbjh", xbjh);
map.put("comp", comp);
map.put("ydjh", comp);
return new ResultBean<>(map);
}

@ -0,0 +1,10 @@
package com.dsic.gj_erp.controller.sy;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("msg")
public class SyMsgController {
}

@ -25,4 +25,10 @@ public interface KbanMapper {
List<DmYdjh> getZyjhDetailBySbCode(String code);
List<Map<String,Object>> getJhgz(String from, String to);
List<Map<String,Object>> getZyjhtj(String from, String to,String zyq);
List<Map<String,Object>> zxqZxDetail();
List<Map<String,Object>> getZxqwcqk();
}

@ -0,0 +1,10 @@
package com.dsic.gj_erp.mapper.sy;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsic.gj_erp.bean.sy.SyMsg;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SyMsgMapper extends BaseMapper<SyMsg> {
}

@ -4,6 +4,7 @@ import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.bean.jhgk.DmYdjh;
import com.dsic.gj_erp.mapper.KbanMapper;
import com.dsic.gj_erp.pc.Constant;
@ -19,6 +20,21 @@ public class KbanService {
private final KbanMapper kbanMapper;
public List<Map<String,Object>> getZxqwcqk(){
return kbanMapper.getZxqwcqk();
}
public List<Map<String,Object>> zxqZxDetail(){
return kbanMapper.zxqZxDetail();
}
public List<Map<String,Object>> getZyjhtj(String zyq){
DateTime date = DateUtil.date();
String from= DateUtil.beginOfMonth(date).toString("yyyy/MM/dd");
String to =DateUtil.endOfMonth(date).toString("yyyy/MM/dd");
return kbanMapper.getZyjhtj(from,to,zyq);
}
public List<Map<String,Object>> getJhgz(){
DateTime date = DateUtil.date();
String from = DateUtil.beginOfMonth(date).toString("yyyy/MM/dd");

@ -0,0 +1,11 @@
package com.dsic.gj_erp.service.sy.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsic.gj_erp.bean.sy.SyMsg;
import com.dsic.gj_erp.mapper.sy.SyMsgMapper;
import org.springframework.stereotype.Service;
@Service
public class SyMsgService extends ServiceImpl<SyMsgMapper, SyMsg> {
}

@ -57,4 +57,50 @@
dc_ch ,dc_pl ,qgfkrq
order by dc_ch ,dc_pl
</select>
<select id="getZyjhtj" resultType="java.util.Map">
SELECT
DISTINCT dc_ch ,dc_pl ,
sum(case when zt>=2 then 1 else 0 end ) OVER(PARTITION by dc_ch,dc_pl) jhsl,
sum(case when zt>11 then 1 else 0 end ) OVER(PARTITION by dc_ch,dc_pl) 一区,
sum(case when zt>=62 and (SUBSTRING(tzbh,6,1)=1 or SUBSTRING(tzbh,6,1)=3) then 1 else 0 end ) OVER(PARTITION by dc_ch,dc_pl) 二区,
sum(case when zt>=62 and SUBSTRING(tzbh,6,1)=2 then 1 else 0 end ) OVER(PARTITION by dc_ch,dc_pl) 三区,
sum(case when zt>=62 and SUBSTRING(tzbh,6,1)=4 then 1 else 0 end ) OVER(PARTITION by dc_ch,dc_pl) 四区
from
dm_ydjh
WHERE
zt>=2 and jssj BETWEEN #{form} and #{to}
<choose>
<when test="zyq!=null and zyq!='' and zyq='2'">
and (SUBSTRING(tzbh,6,1)=1 or SUBSTRING(tzbh,6,1)=3)
</when>
<when test="zyq=null or zyq=''">
</when>
<otherwise>
and (SUBSTRING(tzbh,6,1)=#{zyq}
</otherwise>
</choose>
order by dc_ch ,dc_pl
</select>
<select id="zxqZxDetail" resultType="java.util.Map">
SELECT
dc_ch dcCh,
dc_pl dcPl,
dc_fd dcFd,
tzbh,
case when zt='21' then '上料' when zt='32' then '抛丸' when zt='42' then '理料' when zt='52' then '划线' when zt='62' then '切割' end gx,
case when zt='21' then slfkrq when zt='32' then pwfkrq when zt='42' then llfkrq when zt='52' then hxfkrq when zt='62' then qgfkrq end compAt,
case when substring(tzbh,6,1)=1 or substring(tzbh,6,1)=3 then '二区' when substring(tzbh,6,1)=2 then '三区' when substring(tzbh,6,1)=4 then '四区' end zyq ,
case when zt='21' then slfkry when zt='32' then pwfkry when zt='42' then llfkry when zt='52' then hxfkry when zt='62' then qgfkry end name
from
dm_ydjh
WHERE
slfkrq = #{today} or hxfkrq = #{today} or qgfkrq = #{today}
</select>
<select id="getZxqwcqk" resultType="java.util.Map">
</select>
</mapper>

Loading…
Cancel
Save