1.优化预配盘摆放

master
董哲奇 1 month ago
parent f705331f18
commit b86499121a

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model; import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.bean.jhgk.DmYdjh; import com.dsic.gj_erp.bean.jhgk.DmYdjh;
import com.dsic.gj_erp.bean.jhgk.DmYdjhLj; import com.dsic.gj_erp.bean.jhgk.DmYdjhLj;
import lombok.Getter; import lombok.Getter;
@ -50,6 +51,9 @@ public class DmYppyz extends Model<DmYppyz> {
@TableField(exist = false) @TableField(exist = false)
private List<DmYdjhLj> ljList; private List<DmYdjhLj> ljList;
@TableField(exist = false)
private List<DmBom> bomList;
public void (String name){ public void (String name){
this.status=StatusEnum.valueOf(name); this.status=StatusEnum.valueOf(name);
} }

@ -101,6 +101,12 @@ public class ZyjhController {
* , * ,
*/ */
@PostMapping("ppBGong") @PostMapping("ppBGong")
public ResultBean<?> ppBGong0(@RequestBody List<DmYdjhLj> list){
zyjhService.ppBGong(list);
return new ResultBean<>();
}
public ResultBean<?> ppBGong(@RequestBody List<PPBGongDto> ppBGongDtoList){ public ResultBean<?> ppBGong(@RequestBody List<PPBGongDto> ppBGongDtoList){
ppBGongDtoList.forEach(dto->{ ppBGongDtoList.forEach(dto->{
if (ObjUtil.isNotEmpty(dto.getLjList())){ if (ObjUtil.isNotEmpty(dto.getLjList())){

@ -0,0 +1,37 @@
package com.dsic.gj_erp.controller.zyjh.dto;
import com.dsic.gj_erp.bean.jcsj.DmBom;
import com.dsic.gj_erp.bean.jhgk.DmYdjhLj;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
public class YppDto {
private String id;
public String dcCh;
private String dcPl;
private String dcFd;
private String kw;
private String zl;
private String tz;
private String lx;
private String xj;
private Integer dwxxId;//配盘原则预设摆放位置信息
private List<DmYdjhLj> ljList;
private List<DmBom> bomList;
}

@ -69,6 +69,10 @@ public class ZyjhService extends ServiceImpl<DmYdjhMapper,DmYdjh> {
} }
} }
public void ppBGong(List<DmYdjhLj> list){
ljService.updateBatchById(list);
}
public void ppBGong(List<DmYdjhLj> list,String dcCh,String dcPl,String zyq){ public void ppBGong(List<DmYdjhLj> list,String dcCh,String dcPl,String zyq){
ljService.updateBatchById(list); ljService.updateBatchById(list);
} }
@ -165,31 +169,32 @@ public class ZyjhService extends ServiceImpl<DmYdjhMapper,DmYdjh> {
ljService.saveBatch(ljInfo); ljService.saveBatch(ljInfo);
//自动生成无摆放位置的预配盘原则 //自动生成无摆放位置的预配盘原则
Map<String, List<DmYdjhLj>> collect = ljInfo.stream() //2050401取消配盘原则自动生成功能,改为手动设置
.collect(Collectors // Map<String, List<DmYdjhLj>> collect = ljInfo.stream()
.groupingBy(item -> // .collect(Collectors
item.getCzbh() + " " // .groupingBy(item ->
+ item.getPl() + " " // item.getCzbh() + " "
+ item.getFd() + " " // + item.getPl() + " "
+ item.getZl() + " " // + item.getFd() + " "
+ (StrUtil.isNotEmpty(item.getLx())?item.getLx():"") // + item.getZl() + " "
)); // + (StrUtil.isNotEmpty(item.getLx())?item.getLx():"")
// ));
collect.keySet().forEach(item -> { //
DmYppyz dmYppyz = DmYppyz.of(item); // collect.keySet().forEach(item -> {
if (dmYppyz!=null){ // DmYppyz dmYppyz = DmYppyz.of(item);
int count = yppyzService.count(Wrappers.<DmYppyz>lambdaQuery() // if (dmYppyz!=null){
.eq(DmYppyz::getDcCh, dmYppyz.getDcCh()) // int count = yppyzService.count(Wrappers.<DmYppyz>lambdaQuery()
.eq(DmYppyz::getDcPl, dmYppyz.getDcPl()) // .eq(DmYppyz::getDcCh, dmYppyz.getDcCh())
.eq(DmYppyz::getDcFd, dmYppyz.getDcFd()) // .eq(DmYppyz::getDcPl, dmYppyz.getDcPl())
.eq(DmYppyz::getZl, dmYppyz.getZl()) // .eq(DmYppyz::getDcFd, dmYppyz.getDcFd())
.eq(StrUtil.isNotEmpty(dmYppyz.getLx()),DmYppyz::getLx, dmYppyz.getLx()) // .eq(DmYppyz::getZl, dmYppyz.getZl())
); // .eq(StrUtil.isNotEmpty(dmYppyz.getLx()),DmYppyz::getLx, dmYppyz.getLx())
if (count==0){ // );
yppyzService.save(dmYppyz); // if (count==0){
} // yppyzService.save(dmYppyz);
} // }
}); // }
// });
return ljInfo; return ljInfo;
} }

@ -2,12 +2,14 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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.zyjh.DmYppyzMapper"> <mapper namespace="com.dsic.gj_erp.mapper.zyjh.DmYppyzMapper">
<resultMap id="bgListResult" type="dmYppyz"> <resultMap id="bgListResult" type="com.dsic.gj_erp.controller.zyjh.dto.YppDto">
<id column="id" property="id"/>
<result column="dwxx_id" property="dwxxId" /> <result column="dwxx_id" property="dwxxId" />
<result column="dc_ch" property="dcCh" /> <result column="dc_ch" property="dcCh" />
<result column="dc_pl" property="dcPl" /> <result column="dc_pl" property="dcPl" />
<result column="dc_fd" property="dcFd" /> <result column="dc_fd" property="dcFd" />
<result column="zl" property="zl" />
<result column="kw" property="kw" />
<result column="lx" property="lx" />
<collection property="ljList" ofType="dmYdjhLj" columnPrefix="lj_"> <collection property="ljList" ofType="dmYdjhLj" columnPrefix="lj_">
<id column="id" property="id" /> <id column="id" property="id" />
<result column="czbh" property="czbh" /> <result column="czbh" property="czbh" />
@ -17,42 +19,49 @@
<result column="ljbh" property="ljbh" /> <result column="ljbh" property="ljbh" />
<result column="qq" property="qq" /> <result column="qq" property="qq" />
<result column="dw" property="dw" /> <result column="dw" property="dw" />
<result column="ppzt" property="ppzt" />
</collection>
<collection property="bomList" ofType="dmBom" columnPrefix="bom_">
<id column="id" property="id" />
<result column="ljbh" property="ljbh" />
<result column="ljsl" property="ljsl" />
</collection> </collection>
</resultMap> </resultMap>
<select id="bgList" resultMap="bgListResult"> <select id="bgList" resultMap="bgListResult">
select SELECT
a.id,a.dwxx_id,a.dc_ch,a.dc_pl,a.dc_fd, a.id,a.dc_ch ,a.dc_pl , c.zl ,c.kw,c.lx ,c.dwxx_id,
c.id lj_id,c.czbh lj_czbh,c.pl lj_pl,c.fd lj_fd,c.tlth lj_tlth,c.ljbh lj_ljbh,c.qq lj_qq,c.dw lj_dw b.id lj_id,b.czbh lj_czbh,b.pl lj_pl,b.fd lj_fd,b.tlth lj_tlth,b.ljbh lj_ljbh,b.qq lj_qq,b.dw lj_dw,b.lx lj_lx
from from
dm_yppyz a, dm_ydjh a left join dm_ydjh_lj b on a.dc_ch =b.czbh and a.dc_pl =b.pl and a.tzbh =b.tlth
dm_ydjh b left join dm_ydjh_lj c on b.dc_ch=c.czbh and b.dc_pl=c.pl and b.tzbh=c.tlth left join dm_yppyz c on b.lx=c.lx and b.zl =b.zl AND b.kw =c.kw
where WHERE
a.dc_ch=b.dc_ch and a.dc_pl=b.dc_pl and a.dc_fd =c.fd and a.status='已摆放' and a.lx=b.lx and b.lx='b' and b.zt>=62 a.zt>=62 and b.ppzt &lt;'04' and isnull(b.lx,'')!=''
<if test="dcCh!=null and dcCh!=''"> <if test="dcCh!='' and dcCh!=''">
and a.dc_ch=#{dcCh} and a.dc_ch=#{dcCh}
</if> </if>
<if test="dcPl!=null and dcPl!=''"> <if test="zyq!='' and zyq!=''">
and a.dc_pl=#{dcPl} and a.zyq1=#{zyq}
</if> </if>
<if test="dcFd!=null and dcFd!=''"> order by a.dc_ch ,a.dc_pl
and a.dc_fd=#{dcFd}
</if>
order by a.dc_ch,a.dc_pl
</select> </select>
<select id="wbfList" resultMap="bgListResult"> <select id="wbfList" resultMap="bgListResult">
select SELECT
a.id,a.dwxx_id,a.dc_ch,a.dc_pl,a.dc_fd, a.dc_ch ,a.dc_pl ,b.fd as dc_fd, b.zl ,b.kw,b.lx ,c.dwxx_id,
c.id lj_id,c.czbh lj_czbh,c.pl lj_pl,c.fd lj_fd,c.tlth lj_tlth,c.ljbh lj_ljbh,c.qq lj_qq,c.dw lj_dw b.id lj_id,b.czbh lj_czbh,b.pl lj_pl,b.fd lj_fd,b.tlth lj_tlth,b.ljbh lj_ljbh,b.qq lj_qq,b.dw lj_dw,b.lx lj_lx,
b.ppzt lj_ppzt
from from
dm_yppyz a, dm_ydjh a left join dm_ydjh_lj b on a.dc_ch =b.czbh and a.dc_pl =b.pl and a.tzbh =b.tlth
dm_ydjh b left join dm_ydjh_lj c on b.dc_ch=c.czbh and b.dc_pl=c.pl and b.tzbh=c.tlth left join dm_yppyz c on b.lx=c.lx and b.zl =b.zl AND b.kw =c.kw
where WHERE
a.dc_ch=b.dc_ch and a.dc_pl=b.dc_pl and a.dc_fd =c.fd and b.lx='b' and a.lx=c.lx a.zt>=62 and b.ppzt &lt;'04' and isnull(b.lx,'')!=''
and a.status='设置垛位' and b.zt>=62 <if test="dcCh!='' and dcCh!=''">
and b.zyq1=#{zyq} and a.dc_ch=#{dcCh} and a.dc_ch=#{dcCh}
and isnull(c.qq,'')='' and isnull(c.dw,'')='' </if>
order by a.dc_ch,a.dc_pl <if test="zyq!='' and zyq!=''">
and a.zyq1=#{zyq}
</if>
order by a.dc_ch ,a.dc_pl
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save