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.TableId;
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.DmYdjhLj;
import lombok.Getter;
@ -50,6 +51,9 @@ public class DmYppyz extends Model<DmYppyz> {
@TableField(exist = false)
private List<DmYdjhLj> ljList;
@TableField(exist = false)
private List<DmBom> bomList;
public void (String name){
this.status=StatusEnum.valueOf(name);
}

@ -101,6 +101,12 @@ public class ZyjhController {
* ,
*/
@PostMapping("ppBGong")
public ResultBean<?> ppBGong0(@RequestBody List<DmYdjhLj> list){
zyjhService.ppBGong(list);
return new ResultBean<>();
}
public ResultBean<?> ppBGong(@RequestBody List<PPBGongDto> ppBGongDtoList){
ppBGongDtoList.forEach(dto->{
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){
ljService.updateBatchById(list);
}
@ -165,31 +169,32 @@ public class ZyjhService extends ServiceImpl<DmYdjhMapper,DmYdjh> {
ljService.saveBatch(ljInfo);
//自动生成无摆放位置的预配盘原则
Map<String, List<DmYdjhLj>> collect = ljInfo.stream()
.collect(Collectors
.groupingBy(item ->
item.getCzbh() + " "
+ item.getPl() + " "
+ item.getFd() + " "
+ item.getZl() + " "
+ (StrUtil.isNotEmpty(item.getLx())?item.getLx():"")
));
collect.keySet().forEach(item -> {
DmYppyz dmYppyz = DmYppyz.of(item);
if (dmYppyz!=null){
int count = yppyzService.count(Wrappers.<DmYppyz>lambdaQuery()
.eq(DmYppyz::getDcCh, dmYppyz.getDcCh())
.eq(DmYppyz::getDcPl, dmYppyz.getDcPl())
.eq(DmYppyz::getDcFd, dmYppyz.getDcFd())
.eq(DmYppyz::getZl, dmYppyz.getZl())
.eq(StrUtil.isNotEmpty(dmYppyz.getLx()),DmYppyz::getLx, dmYppyz.getLx())
);
if (count==0){
yppyzService.save(dmYppyz);
}
}
});
//2050401取消配盘原则自动生成功能,改为手动设置
// Map<String, List<DmYdjhLj>> collect = ljInfo.stream()
// .collect(Collectors
// .groupingBy(item ->
// item.getCzbh() + " "
// + item.getPl() + " "
// + item.getFd() + " "
// + item.getZl() + " "
// + (StrUtil.isNotEmpty(item.getLx())?item.getLx():"")
// ));
//
// collect.keySet().forEach(item -> {
// DmYppyz dmYppyz = DmYppyz.of(item);
// if (dmYppyz!=null){
// int count = yppyzService.count(Wrappers.<DmYppyz>lambdaQuery()
// .eq(DmYppyz::getDcCh, dmYppyz.getDcCh())
// .eq(DmYppyz::getDcPl, dmYppyz.getDcPl())
// .eq(DmYppyz::getDcFd, dmYppyz.getDcFd())
// .eq(DmYppyz::getZl, dmYppyz.getZl())
// .eq(StrUtil.isNotEmpty(dmYppyz.getLx()),DmYppyz::getLx, dmYppyz.getLx())
// );
// if (count==0){
// yppyzService.save(dmYppyz);
// }
// }
// });
return ljInfo;
}

@ -2,12 +2,14 @@
<!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">
<resultMap id="bgListResult" type="dmYppyz">
<id column="id" property="id"/>
<resultMap id="bgListResult" type="com.dsic.gj_erp.controller.zyjh.dto.YppDto">
<result column="dwxx_id" property="dwxxId" />
<result column="dc_ch" property="dcCh" />
<result column="dc_pl" property="dcPl" />
<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_">
<id column="id" property="id" />
<result column="czbh" property="czbh" />
@ -17,42 +19,49 @@
<result column="ljbh" property="ljbh" />
<result column="qq" property="qq" />
<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>
</resultMap>
<select id="bgList" resultMap="bgListResult">
select
a.id,a.dwxx_id,a.dc_ch,a.dc_pl,a.dc_fd,
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
SELECT
a.id,a.dc_ch ,a.dc_pl , c.zl ,c.kw,c.lx ,c.dwxx_id,
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
dm_yppyz a,
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
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
<if test="dcCh!=null and dcCh!=''">
and a.dc_ch=#{dcCh}
</if>
<if test="dcPl!=null and dcPl!=''">
and a.dc_pl=#{dcPl}
</if>
<if test="dcFd!=null and dcFd!=''">
and a.dc_fd=#{dcFd}
</if>
order by a.dc_ch,a.dc_pl
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
left join dm_yppyz c on b.lx=c.lx and b.zl =b.zl AND b.kw =c.kw
WHERE
a.zt>=62 and b.ppzt &lt;'04' and isnull(b.lx,'')!=''
<if test="dcCh!='' and dcCh!=''">
and a.dc_ch=#{dcCh}
</if>
<if test="zyq!='' and zyq!=''">
and a.zyq1=#{zyq}
</if>
order by a.dc_ch ,a.dc_pl
</select>
<select id="wbfList" resultMap="bgListResult">
select
a.id,a.dwxx_id,a.dc_ch,a.dc_pl,a.dc_fd,
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
SELECT
a.dc_ch ,a.dc_pl ,b.fd as dc_fd, b.zl ,b.kw,b.lx ,c.dwxx_id,
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
dm_yppyz a,
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
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
and a.status='设置垛位' and b.zt>=62
and b.zyq1=#{zyq} and a.dc_ch=#{dcCh}
and isnull(c.qq,'')='' and isnull(c.dw,'')=''
order by a.dc_ch,a.dc_pl
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
left join dm_yppyz c on b.lx=c.lx and b.zl =b.zl AND b.kw =c.kw
WHERE
a.zt>=62 and b.ppzt &lt;'04' and isnull(b.lx,'')!=''
<if test="dcCh!='' and dcCh!=''">
and a.dc_ch=#{dcCh}
</if>
<if test="zyq!='' and zyq!=''">
and a.zyq1=#{zyq}
</if>
order by a.dc_ch ,a.dc_pl
</select>
</mapper>

Loading…
Cancel
Save