1.增加余料库存管理

2.切割完成后,存在余料的,自动生成带来源图纸的余料信息
3.余料上料,自动同步余料库存,余料被哪个套料图使用
4.余料报工,切割完成,存在余料的,自动生成带来源图纸余料信息
5.调整技术准备,导出数据筛选从套料图号中获取
6.抛丸完成后自动设置光电为六区,进行切割报工
7.增加看板数据表显示看板图形对应数据
master
董哲奇 1 month ago
parent 7123e501ec
commit 2f878afd46

@ -56,4 +56,8 @@ public class SpringContextHolder implements ApplicationContextAware {
public static void pushEvent(Object event) {
springContext.publishEvent(event);
}
public static String getActiveProfile() {
return springContext.getEnvironment().getActiveProfiles()[0];
}
}

@ -419,6 +419,9 @@ public class DmYdjh implements Serializable {
public void setForPwpg(){
this.zt=ZyjhzxEnum.PWPG.code;
}
public void setZtForPwfk(){
this.zt=ZyjhzxEnum.PWFK.code;
}
public void setZtForHXFK(){
this.zt=ZyjhzxEnum.HXFK.code;
}
@ -438,7 +441,9 @@ public class DmYdjh implements Serializable {
ZyjhzxEnum zyjhzxEnum = ZyjhzxEnum.valueOf(type);
//光电跳过划线,抛丸后直接进行切割流程
if ("17".equals(kw)&&zyjhzxEnum==ZyjhzxEnum.PWFK){
//this.zt=ZyjhzxEnum.HXFK.code;
// this.zt=ZyjhzxEnum.HXFK.code;
// this.zyq="FP6Q";
// this.zyq1="六区";
}else{
ZyjhzxEnum zt = ZyjhzxEnum.getEnumByCode(this.zt);
if (zyjhzxEnum==null){

@ -0,0 +1,126 @@
package com.dsic.gj_erp.bean.zyjh;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dsic.gj_erp.bean.jcsj.DmBchxylp;
import com.dsic.gj_erp.bean.jhgk.DmYdjh;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
@Getter
@Setter
@TableName("dm_yl_info")
public class DmYlInfo {
@TableId(value = "id", type = IdType.ASSIGN_UUID)
private String id;
private String ;//余料编号,套料图中存在编号时产生
private String ;//规格
private BigDecimal ;
private BigDecimal ;
private BigDecimal ;
private String ;
private String ;
private String ="1";
private String ;
private String ;
private String ;//来源船号
private String ;//来源批量
private String ;//来源图纸
private String ;
private String ;
private String ;
private String 使;//使用船号
private String 使;//使用批量
private String 使;//使用分段
private String 使;//使用图纸
private String 使;//同打印日期
private int 使;//0:未使用;1:已使用;2:已打印;3:已切割
public boolean (String ){
return StrUtil.isNotEmpty(this.) &&this..equals();
}
public boolean (DmYdjh ydjh){
if (使>0){
return false;
}
if (ydjh.getWpxh()==null||ydjh.getWpgg()==null){
return false;
}
String[] split = ydjh.getWpgg().split("\\*");
if (split.length<3){
return false;
}
//必须保证材质相同,厚度相同,宽和长要小于余料的宽和长才能使用
return ydjh.getWpxh().equals()
&&new BigDecimal(split[0]).compareTo()==0
&&new BigDecimal(split[1]).compareTo()<=0
&&new BigDecimal(split[1]).compareTo()<=0;
}
public void (DmYdjh ydjh){
使=ydjh.getDcCh();
使=ydjh.getDcPl();
使=ydjh.getDcFd();
使=ydjh.getTzbh();
使=UseStatus.使.ordinal();
}
public static DmYlInfo of(DmBchxylp bchxylp, DmYdjh ydjh){
DmYlInfo dmYlInfo = new DmYlInfo();
dmYlInfo.=bchxylp.getYlbh();
dmYlInfo.=bchxylp.getYlgg();
if (dmYlInfo.!=null){
String[] split = dmYlInfo..split("\\*");
if (split.length>=3){
dmYlInfo.=new BigDecimal(split[0]);
dmYlInfo.=new BigDecimal(split[1]);
dmYlInfo.=new BigDecimal(split[2]);
}
}
dmYlInfo.= ydjh.getSllph();
dmYlInfo.=ydjh.getBcylzl().toString();
dmYlInfo.=ydjh.getDcCh();
dmYlInfo.=ydjh.getDcPl();
dmYlInfo.=ydjh.getTzbh();
dmYlInfo.=bchxylp.getWpxh();
dmYlInfo.=ydjh.getWpgg();
dmYlInfo.= DateUtil.date().toString("yyyy/MM/dd");
dmYlInfo.使=UseStatus.使.ordinal();
return dmYlInfo;
}
public enum UseStatus{
使,使,,
}
}

@ -0,0 +1,121 @@
package com.dsic.gj_erp.controller.zyjh;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.bean.jhgk.DmYdjh;
import com.dsic.gj_erp.bean.zyjh.DmYlInfo;
import com.dsic.gj_erp.controller.zyjh.dto.YlSlDto;
import com.dsic.gj_erp.exception.ServiceException;
import com.dsic.gj_erp.service.jhgk.DmYdjhService;
import com.dsic.gj_erp.service.zyjh.DmYlInfoService;
import lombok.AllArgsConstructor;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
*
*/
@RestController
@RequestMapping("yl")
@AllArgsConstructor
public class YlController {
private final DmYlInfoService ylInfoService;
private final DmYdjhService ydjhService;
@PostMapping("list")
public ResultBean<?> list(@RequestBody YlSlDto dto){
return new ResultBean<>(
ylInfoService.list(Wrappers.<DmYlInfo>lambdaQuery()
.eq(DmYlInfo::get,dto.getDcCh())
.eq(DmYlInfo::get使,dto.getStatus())
)
);
}
/**
*
*/
@PostMapping("edit")
public ResultBean<?> edit(@RequestBody List<DmYlInfo> list){
ylInfoService.updateBatchById(list);
return new ResultBean<>();
}
/**
*
*/
@PostMapping("print")
@Transactional(rollbackFor = Exception.class)
public ResultBean<?> print(@RequestBody List<DmYlInfo> list){
ArrayList<DmYdjh> updateList = new ArrayList<>();
list.forEach(item->{
String date = DateUtil.date().toString("yyyy/MM/dd");
item.set使(date);
item.set使(2);//已打印
List<DmYdjh> ydjhList = ydjhService.list(Wrappers.<DmYdjh>lambdaQuery()
.eq(DmYdjh::getDcCh, item.get使())
.eq(DmYdjh::getTzbh,item.get使())
);
List<DmYdjh> collect = ydjhList.stream().map(it -> {
it.setSllph(item.get());
it.setSlfkrq(date);
//fixme 不确定是否还需要抛丸,先执行到上料
it.setZtForPwfk();
if ("17".equals(it.getKw())){//光电直接切割
it.setZtForHXFK();
}
return it;
}).collect(Collectors.toList());
updateList.addAll(collect);
});
ydjhService.updateBatchById(updateList);
ylInfoService.updateBatchById(list);
return new ResultBean<>();
}
/**
*
*
*/
@PostMapping("sl")
public ResultBean<?> sl(@RequestBody YlSlDto dto){
if (!dto.isAllow()){
throw new ServiceException(99999,"请填写需求船号和批次");
}
if (ObjectUtil.isEmpty(dto.getYlList())){
return new ResultBean<>(new ArrayList<>());
}
List<DmYdjh> list = ydjhService.list(Wrappers.<DmYdjh>lambdaQuery()
.eq(DmYdjh::getDcCh, dto.getDcCh())
.eq(DmYdjh::getDcPl, dto.getDcPl())
.eq(StrUtil.isNotEmpty(dto.getTzbh()),DmYdjh::getTzbh,dto.getTzbh())
);
List<DmYlInfo> =new ArrayList<>();
for (DmYdjh ydjh:list){
for (DmYlInfo ylInfo:dto.getYlList()){
if (ylInfo.("")){//暂时不支持,仅保留分支流程
break;
}
if (ylInfo.(ydjh)){
ylInfo.(ydjh);
.add(ylInfo);
break;
}
}
}
return new ResultBean<>();
}
}

@ -10,19 +10,19 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsic.gj_erp.annotation.AuthFunction;
import com.dsic.gj_erp.bean.ResultBean;
import com.dsic.gj_erp.bean.czzj.MpDhsj;
import com.dsic.gj_erp.bean.jcsj.DmBchxylp;
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.bean.zyjh.*;
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;
import com.dsic.gj_erp.service.jcsj.DmBchxylpService;
import com.dsic.gj_erp.service.kc.ImCkwpkwpService;
import com.dsic.gj_erp.service.zyjh.DmYlInfoService;
import com.dsic.gj_erp.service.zyjh.YcldwInfoService;
import com.dsic.gj_erp.service.zyjh.YcldwService;
import com.dsic.gj_erp.service.zyjh.ZyjhService;
@ -64,6 +64,10 @@ public class ZyjhController {
private final TransactionTemplate transactionTemplate;
private final DmBchxylpService bchxylpService;
private final DmYlInfoService ylInfoService;
@PostMapping("yppbg")
public ResultBean<?> yppbg(@RequestBody List<PPBGongDto> list){
List<DmYdjhLj> updateList=new ArrayList<>();
@ -345,10 +349,40 @@ public class ZyjhController {
wsHandler.sendQGComplete((JSONObject) JSONObject.toJSON(dto.getYcldwInfo()));
}
ArrayList<DmYlInfo> updateYlList = new ArrayList<>();
ArrayList<MpDhsj> MpDhsjSaveList = new ArrayList<>();
for (DmYdjh item : list) {
if ("Y".equalsIgnoreCase(item.getYlbs())){
List<DmYlInfo> ylList = ylInfoService.list(Wrappers.<DmYlInfo>lambdaQuery()
.eq(DmYlInfo::get使, item.getDcCh())
.eq(DmYlInfo::get使, item.getTzbh())
);
for (DmYlInfo dmYlInfo : ylList) {
dmYlInfo.set使(3);
dmYlInfo.set(item.getQgfkrq());
updateYlList.add(dmYlInfo);
}
}
//生成零件信息
List<DmYdjhLj> ljList = zyjhService.createLj(item.getDcCh(), item.getDcPl(), item.getTzbh());
//临时使用异常捕获,防止生产未更新余料库存表导致无法正常切割报工
try {
//生成余料信息
List<DmBchxylp> _list = bchxylpService.list(Wrappers.<DmBchxylp>lambdaQuery()
.eq(DmBchxylp::getDcCh, item.getDcCh())
.eq(DmBchxylp::getTzbh, item.getTzbh())
);
List<DmYlInfo> ylList = _list.stream()
.filter(it -> StrUtil.isNotEmpty(it.getYlbh()))
.map(it -> DmYlInfo.of(it,item))
.collect(Collectors.toList());
ylInfoService.saveBatch(ylList);
}catch (Exception e){
e.printStackTrace();
}
//兼容老系统回报的数据
int count = mpDhsjServcie.count(Wrappers.<MpDhsj>lambdaQuery()
.eq(MpDhsj::getDcCh,item.getDcCh())
@ -375,11 +409,15 @@ public class ZyjhController {
mpDhsj.setGysbh("BZGY-"+mpsycljljbp.get("gzzx3"));
}
collect.add(mpDhsj);
MpDhsjSaveList.add(mpDhsj);
}
}
mpDhsjServcie.saveBatch(collect);
// mpDhsjServcie.saveBatch(collect);
}
mpDhsjServcie.saveBatch(MpDhsjSaveList);
ylInfoService.updateBatchById(updateYlList);
}
zyjhService.updateBatchById(list);
if (dto.getAudioFlag()){

@ -0,0 +1,27 @@
package com.dsic.gj_erp.controller.zyjh.dto;
import cn.hutool.core.util.StrUtil;
import com.dsic.gj_erp.bean.zyjh.DmYlInfo;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
public class YlSlDto {
private String dcCh;
private String dcPl;
private String tzbh;
private String dw;
private String gg;
private String lph;
private int status;
private List<DmYlInfo> ylList;
public boolean isAllow(){
return StrUtil.isAllNotEmpty(dcCh,dcPl);
}
}

@ -0,0 +1,7 @@
package com.dsic.gj_erp.mapper.zyjh;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsic.gj_erp.bean.zyjh.DmYlInfo;
public interface DmYlInfoMapper extends BaseMapper<DmYlInfo> {
}

@ -0,0 +1,10 @@
package com.dsic.gj_erp.service.zyjh;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsic.gj_erp.bean.zyjh.DmYlInfo;
import com.dsic.gj_erp.mapper.zyjh.DmYlInfoMapper;
import org.springframework.stereotype.Service;
@Service
public class DmYlInfoService extends ServiceImpl<DmYlInfoMapper, DmYlInfo> {
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!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.DmYlInfoMapper">
</mapper>
Loading…
Cancel
Save