Merge remote-tracking branch 'origin/master'

master
xhj 1 month ago
commit 08cb3ea60c

@ -345,16 +345,32 @@ public class DmYdjhLj implements Serializable {
private String ypph;
@TableField(exist = false)
private String yzkw;
@TableField(exist = false)
private String sllph;
public boolean checkZt(){
return !"03".equals(this.pkZt)||!"03".equals(this.qjgZt)||!"03".equals(this.dmZt);
}
//报工检测
public boolean checkZtBg(){
return "03".equals(this.pkZt)||"03".equals(this.qjgZt)||"03".equals(this.dmZt);
}
public void updateZtWithDb(DmYdjhLj dbLj){
this.setId(dbLj.getId());
this.setDmZt(dbLj.getDmZt());
this.setPkZt(dbLj.getPkZt());
this.setQjgZt(dbLj.getQjgZt());
this.setPpzt(dbLj.getPpzt());
}
public boolean tmpEq(DmYdjhLj lj){
return lj.getCzbh().equals(this.czbh)
&&lj.getPl().equals(this.pl)
&&lj.getTlth().equals(this.tlth)
&&lj.getLjbh()!=null
&&lj.getLjbh().equals(this.ljbh);
}
}

@ -110,7 +110,7 @@ public class DmYdjhController {
List<DmYdjh> list= service.list(new QueryWrapper<DmYdjh>()
.eq(StrUtil.isNotEmpty(map.get("dcCh")),"dc_ch",map.get("dcCh"))
.ge(StrUtil.isNotEmpty(map.get("zt")),"zt",map.get("zt"))
.lt("zt","61")
.lt("zt",11)//仅可下发未上料打印的计划
.ge(StrUtil.isNotEmpty(map.get("yf")), "jssj", DateUtil.beginOfMonth(DateUtil.parseDate(map.get("yf"))).toString("yyyy/MM/dd"))
.le(StrUtil.isNotEmpty(map.get("yf")), "jssj", DateUtil.endOfMonth(DateUtil.parseDate(map.get("yf"))).toString("yyyy/MM/dd"))
.orderByAsc("jssj,dc_ch,dc_pl,zl,lqlb")

@ -291,6 +291,43 @@ public class ZyjhController {
return new ResultBean<>();
}
@PostMapping("sdtbczzj")
public ResultBean<?> sdTbCzzj(@RequestBody List<DmYdjh> list){
ArrayList<MpDhsj> mpDhsjSaveList = new ArrayList<>();
list.forEach(item-> zlgzCreate(item,mpDhsjSaveList));
mpDhsjServcie.saveBatch(mpDhsjSaveList);
return new ResultBean<>();
}
private void zlgzCreate(DmYdjh item,ArrayList<MpDhsj> mpDhsjSaveList){
List<DmYdjhLj> ljList = zyjhService.createLj(item.getDcCh(), item.getDcPl(), item.getTzbh());
Map<String, Object> mpsycljljbp = zyjhService.getMPSYCLJLJBP(item.getDcCh(), item.getTzbh());
//兼容手动处理没有上料炉批号的问题
if (StrUtil.isEmpty(item.getSllph())&&!ljList.isEmpty()){
item.setSllph(ljList.get(0).getSllph());
}
mpDhsjServcie.remove(Wrappers.<MpDhsj>lambdaQuery()
.eq(MpDhsj::getDcCh,item.getDcCh())
.eq(MpDhsj::getDcPl,item.getDcPl())
.eq(MpDhsj::getDcTh,item.getTzbh())
);
//质量跟踪数据
String date = DateUtil.date().toString("yyyy/MM/dd");
String mpDhsjDhh = zyjhService.getMpDhsjDhh();
for (int j = 0; j < ljList.size(); j++) {
DmYdjhLj item2 = ljList.get(j);
if (StrUtil.isNotEmpty(item.getSllph())){//兼容没有炉批号的老数据用
MpDhsj mpDhsj = MpDhsj.of(item2, date, item.getSllph());
String xh = StrUtil.padPre(j + 1 + "", 3, "0");
mpDhsj.setDhh(mpDhsjDhh+"-"+xh);
if (ObjUtil.isNotEmpty(mpsycljljbp)) {
mpDhsj.setGysbh("BZGY-"+mpsycljljbp.get("gzzx3"));
}
mpDhsjSaveList.add(mpDhsj);
}
}
}
/**
* ,&
*/
@ -365,8 +402,6 @@ public class ZyjhController {
updateYlList.add(dmYlInfo);
}
}
//生成零件信息
List<DmYdjhLj> ljList = zyjhService.createLj(item.getDcCh(), item.getDcPl(), item.getTzbh());
//临时使用异常捕获,防止生产未更新余料库存表导致无法正常切割报工
try {
@ -396,24 +431,8 @@ public class ZyjhController {
continue;
}
Map<String, Object> mpsycljljbp = zyjhService.getMPSYCLJLJBP(item.getDcCh(), item.getTzbh());
//质量跟踪数据
List<MpDhsj> collect = new ArrayList<>();
String date = DateUtil.date().toString("yyyy/MM/dd");
String mpDhsjDhh = zyjhService.getMpDhsjDhh();
for (int j = 0; j < ljList.size(); j++) {
DmYdjhLj item2 = ljList.get(j);
if (StrUtil.isNotEmpty(item.getSllph())){//兼容没有炉批号的老数据用
MpDhsj mpDhsj = MpDhsj.of(item2, date, item.getSllph());
String xh = StrUtil.padPre(j + 1 + "", 3, "0");
mpDhsj.setDhh(mpDhsjDhh+"-"+xh);
if (ObjUtil.isNotEmpty(mpsycljljbp)) {
mpDhsj.setGysbh("BZGY-"+mpsycljljbp.get("gzzx3"));
}
collect.add(mpDhsj);
MpDhsjSaveList.add(mpDhsj);
}
}
zlgzCreate(item,MpDhsjSaveList);
}
mpDhsjServcie.saveBatch(MpDhsjSaveList);

@ -324,9 +324,9 @@ public class DmYdjhServiceImpl extends ServiceImpl<DmYdjhMapper, DmYdjh> impleme
DmYdjh dmYdjh = new DmYdjh();
dmYdjh.setId(item.getId());
dmYdjh.setZt("2");
String perfix=item.getSljhrq().replace("/","");
perfix=perfix.substring(2);
dmYdjh.setDjh(StrUtil.format("{}{}",perfix, String.format("%03d",djh)));
//String perfix=item.getSljhrq().replace("/","");
//perfix=perfix.substring(2);
//dmYdjh.setDjh(StrUtil.format("{}{}",perfix, String.format("%03d",djh)));
dmYdjh.setGxsj(gxsj);
dmYdjh.setPlxh(item.getPlxh());
return dmYdjh;

@ -33,7 +33,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.io.File;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@Service
@ -175,12 +174,35 @@ public class ZyjhService extends ServiceImpl<DmYdjhMapper,DmYdjh> {
}
});
ljService.remove(Wrappers.<DmYdjhLj>lambdaQuery()
.eq(DmYdjhLj::getCzbh,dcCh)
.eq(DmYdjhLj::getPl,dcPl)
.eq(DmYdjhLj::getTlth,tzbh)
//如果零件已报工,不可以删除,取消整图删除零件,改为修正
List<DmYdjhLj> list = ljService.list(Wrappers.<DmYdjhLj>lambdaQuery()
.eq(DmYdjhLj::getCzbh, dcCh)
.eq(DmYdjhLj::getPl, dcPl)
.eq(DmYdjhLj::getTlth, tzbh)
);
ljService.saveBatch(ljInfo);
if (!list.isEmpty()){
list.forEach(item->{
//清理错误数据
if (StrUtil.isEmpty(item.getLjbh())){
ljService.removeById(item);
return;
}
ljInfo.forEach(lj->{
if (lj.tmpEq(item)){
//修正零件状态信息
lj.updateZtWithDb(item);
}
});
});
ljService.saveOrUpdateBatch(ljInfo);
}else{
ljService.remove(Wrappers.<DmYdjhLj>lambdaQuery()
.eq(DmYdjhLj::getCzbh,dcCh)
.eq(DmYdjhLj::getPl,dcPl)
.eq(DmYdjhLj::getTlth,tzbh)
);
ljService.saveBatch(ljInfo);
}
return ljInfo;
}

@ -902,6 +902,7 @@
REPLACE(CAST(CAST(NEWID()AS BINARY(10)) + CAST(GETDATE() AS BINARY(6)) AS UNIQUEIDENTIFIER),'-','') as id,
dm_ydjh.dc_ch as czbh,
dm_ydjh.dc_pl as pl,
dm_ydjh.sllph as sllph,
dm_bom.fd as fd,
dm_ydjh.kw as kw,
dm_bom.zl as zl,

Loading…
Cancel
Save