diff --git a/src/main/java/com/dsic/gj_erp/bean/zyjh/DmYppyz.java b/src/main/java/com/dsic/gj_erp/bean/zyjh/DmYppyz.java index 056ef06..cebb94a 100644 --- a/src/main/java/com/dsic/gj_erp/bean/zyjh/DmYppyz.java +++ b/src/main/java/com/dsic/gj_erp/bean/zyjh/DmYppyz.java @@ -2,12 +2,16 @@ package com.dsic.gj_erp.bean.zyjh; import cn.hutool.core.bean.BeanUtil; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.extension.activerecord.Model; import com.dsic.gj_erp.bean.jhgk.DmYdjh; +import com.dsic.gj_erp.bean.jhgk.DmYdjhLj; import lombok.Getter; import lombok.Setter; +import java.util.List; + @Getter @Setter public class DmYppyz extends Model { @@ -39,6 +43,12 @@ public class DmYppyz extends Model { private StatusEnum status=StatusEnum.未设置垛位; + @TableField(exist = false) + private String zyq; + + @TableField(exist = false) + private List ljList; + public static StatusEnum 已设置垛位状态(){ return StatusEnum.设置垛位; } @@ -51,6 +61,6 @@ public class DmYppyz extends Model { } public enum StatusEnum{ - 未设置垛位,设置垛位,已配送 + 全部,未设置垛位,设置垛位,已摆放,已配送 } } diff --git a/src/main/java/com/dsic/gj_erp/controller/zyjh/DmYppyzController.java b/src/main/java/com/dsic/gj_erp/controller/zyjh/DmYppyzController.java index c77d1fe..b964be8 100644 --- a/src/main/java/com/dsic/gj_erp/controller/zyjh/DmYppyzController.java +++ b/src/main/java/com/dsic/gj_erp/controller/zyjh/DmYppyzController.java @@ -1,6 +1,7 @@ package com.dsic.gj_erp.controller.zyjh; +import cn.hutool.core.util.ObjUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.dsic.gj_erp.bean.ResultBean; @@ -24,6 +25,12 @@ public class DmYppyzController { private final DmYppyzService service; + @PostMapping("bgList") + public ResultBean bgList(@RequestBody DmYppyz entity){ + List list = service.bgList(entity); + return new ResultBean<>(list); + } + @PostMapping("submit") @Transactional(rollbackFor = Exception.class) public ResultBean list(@RequestBody Map> map){ @@ -45,9 +52,13 @@ public class DmYppyzController { @PostMapping("list") public ResultBean list(@RequestBody DmYppyz entity){ + if (entity.getStatus()==DmYppyz.StatusEnum.全部){ + entity.setStatus(null); + } List list = service.list(Wrappers.lambdaQuery() .eq(StrUtil.isNotEmpty(entity.getDcCh()), DmYppyz::getDcCh, entity.getDcCh()) .eq(StrUtil.isNotEmpty(entity.getDcPl()), DmYppyz::getDcPl, entity.getDcPl()) + .eq(ObjUtil.isNotEmpty(entity.getStatus()),DmYppyz::getStatus, entity.getStatus()) ); return new ResultBean<>(list); } 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 4beac21..50fea9a 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 @@ -13,11 +13,11 @@ import com.dsic.gj_erp.bean.czzj.MpDhsj; import com.dsic.gj_erp.bean.jhgk.DmYdjh; import com.dsic.gj_erp.bean.jhgk.DmYdjhLj; import com.dsic.gj_erp.bean.kc.ImCkwpkwp; -import com.dsic.gj_erp.bean.zyjh.DmYppyz; import com.dsic.gj_erp.bean.zyjh.PwExcel; import com.dsic.gj_erp.bean.zyjh.Ycldw; import com.dsic.gj_erp.bean.zyjh.YcldwInfo; import com.dsic.gj_erp.controller.zyjh.dto.*; +import com.dsic.gj_erp.dao.zyjh.PPBGongDto; import com.dsic.gj_erp.exception.ServiceException; import com.dsic.gj_erp.listeners.ExcelPwListener; import com.dsic.gj_erp.service.czzj.MpDhsjServcie; @@ -61,16 +61,30 @@ public class ZyjhController { private final MpDhsjServcie mpDhsjServcie; /** - * 零件摆放 - * @param list - * @return + * 预配盘完整性检查 + * 根据输入的船号、批次,分段,图号等信息检查已完工的作业计划零件是否已经摆放完全 */ - @PostMapping("ljbf") - public ResultBean ljbf(@RequestBody List list){ + @PostMapping("wzxjc") + public ResultBean wzxjc(@RequestBody DmYdjhLj lj){ return new ResultBean<>(); } + /** + * 零件摆放,预配盘报工 + */ + @PostMapping("ppBGong") + public ResultBean ppBGong(@RequestBody List ppbGongDtoList){ + ppbGongDtoList.forEach(dto->{ + if (ObjUtil.isNotEmpty(dto.getLjList())){ + List list=dto.getLjList(); + zyjhService.ppBGong(list,dto.getDcCh(),dto.getDcPl(),dto.getZyq()); + zyjhService.ppwc(dto.getId(),dto.getDcCh(),dto.getDcPl()); + } + }); + return new ResultBean<>(); + } + @GetMapping("getBzryByBz") public ResultBean getBzryByBz(String zyq, String zt){ return new ResultBean<>(zyjhService.getBzryByBz(zyq,zt)); @@ -179,7 +193,7 @@ public class ZyjhController { */ @GetMapping("getYdjhByZtOrForeman") public ResultBean getYdjhByZtOrForeman(Integer zt,String foreman,String zyq,String userCode){ - List list = zyjhService.getYdjhByZtOrForeman(zt, foreman,userCode,zyq); + List list = zyjhService.getYdjhByZtOrForeman(zt,zyq); return new ResultBean<>(list); } @@ -362,6 +376,7 @@ public class ZyjhController { throw new ServiceException(10001,"执行失败"); } } + @PostMapping("zxweb") @AuthFunction public ResultBean zxweb(@RequestBody PgDto dto,HttpServletRequest request) { diff --git a/src/main/java/com/dsic/gj_erp/dao/zyjh/PPBGongDto.java b/src/main/java/com/dsic/gj_erp/dao/zyjh/PPBGongDto.java new file mode 100644 index 0000000..7b223b8 --- /dev/null +++ b/src/main/java/com/dsic/gj_erp/dao/zyjh/PPBGongDto.java @@ -0,0 +1,17 @@ +package com.dsic.gj_erp.dao.zyjh; + +import com.dsic.gj_erp.bean.jhgk.DmYdjhLj; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Getter +@Setter +public class PPBGongDto { + Integer id; + String dcCh; + String dcPl; + String zyq; + List ljList; +} 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 2f881d6..6441b1a 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 @@ -22,6 +22,8 @@ import java.util.Map; */ public interface DmYdjhMapper extends BaseMapper { + List getWithDjh(Integer zt,String zyq); + List getWppljAndPpyz(String zyq1); List tqYppyzFromYdjh(DmYdjh dmYdjh); diff --git a/src/main/java/com/dsic/gj_erp/mapper/zyjh/DmYppyzMapper.java b/src/main/java/com/dsic/gj_erp/mapper/zyjh/DmYppyzMapper.java index 1b2b738..6e04171 100644 --- a/src/main/java/com/dsic/gj_erp/mapper/zyjh/DmYppyzMapper.java +++ b/src/main/java/com/dsic/gj_erp/mapper/zyjh/DmYppyzMapper.java @@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.dsic.gj_erp.bean.zyjh.DmYppyz; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + @Mapper public interface DmYppyzMapper extends BaseMapper { + List bgList(DmYppyz entity); } diff --git a/src/main/java/com/dsic/gj_erp/service/xiaochi/XiaoChiService.java b/src/main/java/com/dsic/gj_erp/service/xiaochi/XiaoChiService.java index 49282ba..51baa96 100644 --- a/src/main/java/com/dsic/gj_erp/service/xiaochi/XiaoChiService.java +++ b/src/main/java/com/dsic/gj_erp/service/xiaochi/XiaoChiService.java @@ -34,7 +34,7 @@ public class XiaoChiService{ * 小池同步,先使用手动拉取方式,让钢加人员进行检查 * 后续改为自动拉取 */ - @PostConstruct +// @PostConstruct public void handler(){ List users = new XiaochiUser().selectAll(); List devices=new Device().selectAll(); diff --git a/src/main/java/com/dsic/gj_erp/service/zyjh/DmYppyzService.java b/src/main/java/com/dsic/gj_erp/service/zyjh/DmYppyzService.java index 7d4610d..270dd88 100644 --- a/src/main/java/com/dsic/gj_erp/service/zyjh/DmYppyzService.java +++ b/src/main/java/com/dsic/gj_erp/service/zyjh/DmYppyzService.java @@ -5,6 +5,12 @@ import com.dsic.gj_erp.bean.zyjh.DmYppyz; import com.dsic.gj_erp.mapper.zyjh.DmYppyzMapper; import org.springframework.stereotype.Service; +import java.util.List; + @Service public class DmYppyzService extends ServiceImpl { + + public List bgList(DmYppyz entity) { + return baseMapper.bgList(entity); + } } 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 a5495af..866f9f6 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 @@ -6,14 +6,17 @@ import cn.hutool.core.util.ObjUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.dsic.gj_erp.bean.jcsj.DmBzry; import com.dsic.gj_erp.bean.jcsj.DmCbxxp; import com.dsic.gj_erp.bean.jhgk.DmYdjh; import com.dsic.gj_erp.bean.jhgk.DmYdjhLj; +import com.dsic.gj_erp.bean.zyjh.DmYppyz; import com.dsic.gj_erp.controller.zyjh.dto.PgWithPcDto; import com.dsic.gj_erp.controller.zyjh.dto.ShangLiao; +import com.dsic.gj_erp.dao.zyjh.PPBGongDto; import com.dsic.gj_erp.mapper.jhgk.DmYdjhMapper; import com.dsic.gj_erp.service.jcsj.DmBzryService; import com.dsic.gj_erp.service.jcsj.DmCbxxpService; @@ -36,9 +39,26 @@ public class ZyjhService extends ServiceImpl { private final DmCbxxpService dmCbxxpService; private final RedisTemplate redisTemplate; private final DmYdjhLjService ljService; + private final DmYppyzService yppyzService; private static final String MPDHSJ_KEY="MPDHSJ"; + public void ppwc(Integer id,String dcCh,String dcPl){ + int count = ljService.count(Wrappers.lambdaQuery() + .eq(DmYdjhLj::getCzbh, dcCh) + .eq(DmYdjhLj::getPl, dcPl) + .isNull(DmYdjhLj::getQq) + .isNull(DmYdjhLj::getDw) + ); + if (count==0){ + yppyzService.update(new UpdateWrapper().set("status","已摆放").eq("id",id)); + } + } + + public void ppBGong(List list,String dcCh,String dcPl,String zyq){ + ljService.updateBatchById(list); + } + /** * 获取预配盘原则和对应未配盘零件信息 */ @@ -60,8 +80,17 @@ public class ZyjhService extends ServiceImpl { return date+StrUtil.padPre(increment+"",3,"0"); } + public String getMpDhsjDhh(String date){ + Object xh = redisTemplate.opsForHash().get(MPDHSJ_KEY, date); + if(ObjUtil.isEmpty(xh)){ + redisTemplate.opsForHash().put(MPDHSJ_KEY, date,0); + } + Long increment = redisTemplate.opsForHash().increment(MPDHSJ_KEY, date, 1); + return date+StrUtil.padPre(increment+"",3,"0"); + } + @Transactional(rollbackFor = Exception.class) - public List createLj(String dcCh, String dcPl, String tzbh){ + public List createLj1(String dcCh, String dcPl, String tzbh){ ljService.remove(Wrappers.lambdaQuery() .eq(DmYdjhLj::getCzbh,dcCh) .eq(DmYdjhLj::getPl,dcPl) @@ -72,7 +101,21 @@ public class ZyjhService extends ServiceImpl { return ljInfo; } + @Transactional(rollbackFor = Exception.class) + public List createLj(String dcCh, String dcPl, String tzbh){ + ljService.remove(Wrappers.lambdaQuery() + .eq(DmYdjhLj::getCzbh,dcCh) + .eq(DmYdjhLj::getPl,dcPl) + .eq(DmYdjhLj::getTlth,tzbh) + ); + List ljInfo = baseMapper.getLjInfo(dcCh, dcPl, tzbh); + ljService.saveBatch(ljInfo); + return ljInfo; + } + public List getYdjhByZtOrForeman(Integer zt,String zyq){ + return baseMapper.getWithDjh(zt,zyq); + } public List getYdjhByZtOrForeman(Integer zt,String foreman,String userCode,String zyq){ QueryWrapper wrapper = new QueryWrapper() @@ -98,6 +141,7 @@ public class ZyjhService extends ServiceImpl { break; } wrapper.orderByDesc("dc_ch","dc_pl,tzbh"); + return list(wrapper); } diff --git a/src/main/resources/mappers/jhgk/DmYdjhMapper.xml b/src/main/resources/mappers/jhgk/DmYdjhMapper.xml index 82f6745..6b3f76a 100644 --- a/src/main/resources/mappers/jhgk/DmYdjhMapper.xml +++ b/src/main/resources/mappers/jhgk/DmYdjhMapper.xml @@ -1180,6 +1180,40 @@ where dc_ch=#{dcch} and dc_pl =#{dcpl} a.status='设置垛位' and b.ppzt='01' and c.zyq1=#{zyq1} + + UPDATE dm_ydjh set dm_ydjh.ylbs=dm_bchxylp.sfyl diff --git a/src/main/resources/mappers/pgd/PgdQmjhMapper.xml b/src/main/resources/mappers/pgd/PgdQmjhMapper.xml index 68f4a55..a570e03 100644 --- a/src/main/resources/mappers/pgd/PgdQmjhMapper.xml +++ b/src/main/resources/mappers/pgd/PgdQmjhMapper.xml @@ -529,7 +529,6 @@ dm_ydjh_lj.tz, dm_ydjh_lj.lx, dm_ydjh_lj.xj, - dm_ydjh.slfkry, dm_ydjh.slfkrq, dm_ydjh.pwfkry, @@ -566,14 +565,12 @@ dm_qfxq.xqzt, dm_qfxq.dzglxq, dm_qfxq.dzglxq_old - FROM - dm_ydjh_lj LEFT JOIN dm_ydjh on dm_ydjh.dc_ch=dm_ydjh_lj.czbh and dm_ydjh.dc_pl= dm_ydjh_lj.pl and dm_ydjh.tzbh =dm_ydjh_lj.tlth - and - - dm_ydjh.dc_pl= dm_ydjh_lj.fd left join dm_qfxq on dm_qfxq.dc_ch = dm_ydjh_lj.czbh and dm_qfxq.dc_pl=dm_ydjh_lj.pl and dm_qfxq.dc_fd=dm_ydjh_lj.fd - - where 1=1 + dm_ydjh_lj + LEFT JOIN dm_ydjh on dm_ydjh.dc_ch=dm_ydjh_lj.czbh and dm_ydjh.dc_pl= dm_ydjh_lj.pl and dm_ydjh.tzbh =dm_ydjh_lj.tlth + left join dm_qfxq on dm_qfxq.dc_ch = dm_ydjh_lj.czbh and dm_qfxq.dc_pl=dm_ydjh_lj.pl and dm_qfxq.dc_fd=dm_ydjh_lj.fd + where + 1=1 and dm_ydjh_lj.czbh=#{dcch} @@ -583,38 +580,18 @@ and dm_ydjh_lj.tlth=#{tlth} - and dm_ydjh_lj.kw=#{qgkw} - - - - - - - - and ISNULL(dm_ydjh_lj.ppzt,'')=#{zt} - and dm_ydjh_lj.dw=#{dwh} - and dm_ydjh_lj.qq=#{qy} - - - - - order by czbh,pl,fd - - - - diff --git a/src/main/resources/mappers/zyjh/YppyzMapper.xml b/src/main/resources/mappers/zyjh/YppyzMapper.xml new file mode 100644 index 0000000..ce889d0 --- /dev/null +++ b/src/main/resources/mappers/zyjh/YppyzMapper.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + +