2.切割完成后,存在余料的,自动生成带来源图纸的余料信息 3.余料上料,自动同步余料库存,余料被哪个套料图使用 4.余料报工,切割完成,存在余料的,自动生成带来源图纸余料信息 5.调整技术准备,导出数据筛选从套料图号中获取 6.抛丸完成后自动设置光电为六区,进行切割报工 7.增加看板数据表显示看板图形对应数据master
parent
7123e501ec
commit
2f878afd46
@ -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<>(匹配成功的余料信息);
|
||||
}
|
||||
}
|
@ -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…
Reference in new issue