diff --git a/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java b/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java index 5aeee74..6e76507 100644 --- a/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java +++ b/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java @@ -105,21 +105,28 @@ public class ZyjhController { dmYdjh.setZtByZyjhzx(dto.getZxZtName()); } } + YcldwInfo info = dto.getYcldwInfo(); if ("PWFK".equals(dto.getZxZtName())){ -// ycldwInfoService.updatePw(dto.getYcldwInfo()); - wsHandler.sendPwComplete((JSONObject) JSONObject.toJSON(dto.getYcldwInfo())); + if (ObjUtil.isNotEmpty(info)&&info.getId()!=null){ + ycldwInfoService.updatePw(info); + wsHandler.sendPwComplete((JSONObject) JSONObject.toJSON(info)); + } } if ("HXFK".equals(dto.getZxZtName())){ -// ycldwInfoService.updatePw(dto.getYcldwInfo()); - wsHandler.sendHXComplete((JSONObject) JSONObject.toJSON(dto.getYcldwInfo())); + if (ObjUtil.isNotEmpty(info)&&info.getId()!=null){ + ycldwInfoService.updatePw(dto.getYcldwInfo()); + wsHandler.sendHXComplete((JSONObject) JSONObject.toJSON(dto.getYcldwInfo())); + } } if ("QGFK".equals(dto.getZxZtName())){ //无需划线,从理料间获取时才更新垛位信息 - if ("42".equals(dto.getZt())){ -// ycldwInfoService.updatePw(dto.getYcldwInfo()); + if (ObjUtil.isNotEmpty(info)&&info.getId()!=null){ + if ("42".equals(dto.getZt())){ + ycldwInfoService.updatePw(dto.getYcldwInfo()); + } + wsHandler.sendHXComplete((JSONObject) JSONObject.toJSON(dto.getYcldwInfo())); + wsHandler.sendQGComplete((JSONObject) JSONObject.toJSON(dto.getYcldwInfo())); } - wsHandler.sendHXComplete((JSONObject) JSONObject.toJSON(dto.getYcldwInfo())); - wsHandler.sendQGComplete((JSONObject) JSONObject.toJSON(dto.getYcldwInfo())); } zyjhService.updateBatchById(list); diff --git a/src/main/java/com/dsic/gj_erp/mapper/jhgk/DmYdjhMapper.java b/src/main/java/com/dsic/gj_erp/mapper/jhgk/DmYdjhMapper.java index 3c05854..856c182 100644 --- a/src/main/java/com/dsic/gj_erp/mapper/jhgk/DmYdjhMapper.java +++ b/src/main/java/com/dsic/gj_erp/mapper/jhgk/DmYdjhMapper.java @@ -66,5 +66,5 @@ public interface DmYdjhMapper extends BaseMapper { List> getWcl(); - List> getYdjhByZt(String zt,String wgzt,String wclzt); + List> getYdjhByZt(String zt,String wgzt,String wclzt,String from, String to); } diff --git a/src/main/java/com/dsic/gj_erp/service/zyjh/YcldwInfoService.java b/src/main/java/com/dsic/gj_erp/service/zyjh/YcldwInfoService.java index 61a2279..8fde3a4 100644 --- a/src/main/java/com/dsic/gj_erp/service/zyjh/YcldwInfoService.java +++ b/src/main/java/com/dsic/gj_erp/service/zyjh/YcldwInfoService.java @@ -1,5 +1,6 @@ package com.dsic.gj_erp.service.zyjh; +import cn.hutool.core.util.ObjUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.dsic.gj_erp.bean.jhgk.DmYdjh; @@ -27,11 +28,8 @@ public class YcldwInfoService extends ServiceImpl { @Transactional(rollbackOn = Exception.class) public void updatePw(YcldwInfo info){ - - this.removeById(info.getId()); - baseMapper.pwfk(info.getCeng(),info.getDwId()); - - + this.removeById(info.getId()); + baseMapper.pwfk(info.getCeng(),info.getDwId()); } @Transactional(rollbackOn = Exception.class) diff --git a/src/main/java/com/dsic/gj_erp/service/zyjh/ZyjhService.java b/src/main/java/com/dsic/gj_erp/service/zyjh/ZyjhService.java index fb5529d..94d14fb 100644 --- a/src/main/java/com/dsic/gj_erp/service/zyjh/ZyjhService.java +++ b/src/main/java/com/dsic/gj_erp/service/zyjh/ZyjhService.java @@ -38,24 +38,28 @@ public class ZyjhService extends ServiceImpl { public List getYdjhByZtOrForeman(String zt,String foreman){ QueryWrapper wrapper = new QueryWrapper() - .lt("zt",62); + .ge("zt",11); switch (zt){ case "31": - wrapper.eq("pwpgry",foreman); + wrapper.eq("pwpgry",foreman).isNull("pwfkry"); break; case "51": - wrapper.eq("hxpgry",foreman); + wrapper.eq("hxpgry",foreman).isNull("hxfkry"); break; case "61": - wrapper.eq("qgpgry",foreman); + wrapper.eq("qgpgry",foreman).isNull("qgfkry"); break; } + wrapper.orderByDesc("dc_ch","dc_pl,dc_fd,tzbh"); return list(wrapper); } public List> getYdjhByZt(String zt,String wgzt,String wclzt){ - return baseMapper.getYdjhByZt(zt,wgzt,wclzt); + DateTime date = DateUtil.date(); + String from = DateUtil.beginOfMonth(date).toString("yyyy/MM/dd"); + String to = DateUtil.endOfMonth(date).toString("yyyy/MM/dd"); + return baseMapper.getYdjhByZt(zt,wgzt,wclzt,from,to); } diff --git a/src/main/resources/mappers/jhgk/DmYdjhMapper.xml b/src/main/resources/mappers/jhgk/DmYdjhMapper.xml index 268717e..5c7acdf 100644 --- a/src/main/resources/mappers/jhgk/DmYdjhMapper.xml +++ b/src/main/resources/mappers/jhgk/DmYdjhMapper.xml @@ -897,7 +897,7 @@ where dc_ch=#{dcch} and dc_pl =#{dcpl} from dm_ydjh where - zt>='2' and zt<'62' ) a + zt>=2 and zt<62 ) a where a.rn=1 order by dcCh asc ,dcPl desc ,zt @@ -906,32 +906,41 @@ where dc_ch=#{dcch} and dc_pl =#{dcpl} select dc_ch dcCh,dc_pl dcPl,count(1) total,plxh, - sum(case when isnull(qgfkry,'')='' then 1 else 0 end) wwg, - sum(case when isnull(qgfkry,'')!='' then 1 else 0 end) comp, + sum(case when isnull(qgfkrq,'')='' then 1 else 0 end) wwg, + sum(case when isnull(qgfkrq,'')!='' then 1 else 0 end) comp, - sum(case when isnull(hxfkry,'')='' then 1 else 0 end) wwg, - sum(case when isnull(hxfkry,'')!='' then 1 else 0 end) comp, + sum(case when isnull(hxfkrq,'')='' then 1 else 0 end) wwg, + sum(case when isnull(hxfkrq,'')!='' then 1 else 0 end) comp, - sum(case when isnull(pwfkry,'')='' then 1 else 0 end) wwg, - sum(case when isnull(pwfkry,'')!='' then 1 else 0 end) comp, + sum(case when isnull(pwfkrq,'')='' then 1 else 0 end) wwg, + sum(case when isnull(pwfkrq,'')!='' then 1 else 0 end) comp, - sum(case when zt=#{zt} then 1 else 0 end) compOnLastGx, + sum(case when zt>=#{zt} then 1 else 0 end) compOnLastGx, - sum(case when isnull(qgpgry,'')='' then 1 else 0 end) wpg + sum(case when isnull(qgpgrq,'')='' then 1 else 0 end) wpg - sum(case when isnull(hxpgry,'')='' then 1 else 0 end) wpg + sum(case when isnull(hxpgrq,'')='' then 1 else 0 end) wpg - sum(case when isnull(pwpgry,'')='' then 1 else 0 end) wpg + sum(case when isnull(pwpgrq,'')='' then 1 else 0 end) wpg from dm_ydjh - where zt>=11 and zt<=62 + where zt>=11 + + and isnull(qgfkrq,'')='' + + + and isnull(hxfkrq,'')='' + + + and isnull(pwfkrq,'')='' + group by dc_ch, dc_pl,plxh order by dc_ch,dc_pl