fix: 优化
This commit is contained in:
@@ -89,8 +89,19 @@ public class AutoSplitTrussTask {
|
||||
}
|
||||
|
||||
//获取任意一条分切计划
|
||||
PdmBiSlittingproductionplan plan = slittingproductionplanService.getOne(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
List<PdmBiSlittingproductionplan> plans = slittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.eq(PdmBiSlittingproductionplan::getQzzno,collect.get(0)));
|
||||
if (plans.isEmpty()) {
|
||||
cutPoint.setRemark("点位数据与状态不符合,架子虚拟计划不存在!");
|
||||
cutPoint.setIs_used("0");
|
||||
cutPoint.setUpdate_time(DateUtil.now());
|
||||
bcutpointivtService.updateById(cutPoint);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
PdmBiSlittingproductionplan plan = plans.get(0);
|
||||
|
||||
|
||||
AreaBCachePointDto build = AreaBCachePointDto.builder()
|
||||
.area(cutPoint.getProduct_area())
|
||||
|
||||
@@ -1804,12 +1804,81 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
|
||||
@Override
|
||||
public JSONObject toShaftBinding(JSONObject param) {
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("status", HttpStatus.HTTP_OK);
|
||||
res.put("message", "气胀轴绑定成功!");
|
||||
log.info("用户{} 操作气胀轴绑定:{}", SecurityUtils.getCurrentNickName(), param);
|
||||
// param : container_name, point_code
|
||||
String containerName = param.getString("container_name");
|
||||
String pointCode1 = param.getString("point_code");
|
||||
BstIvtCutpointivt pointCode = bcutpointivtService.getPintByTrussCode(pointCode1, false);
|
||||
if (ObjectUtil.isEmpty(pointCode)) {
|
||||
String[] split = containerName.split("-");
|
||||
String resourceName = split[0] + "0FQ0000" + split[1];
|
||||
|
||||
Deliverycachepointivt deliverycachepointivt = deliverycachepointivtService.getPintByCode(pointCode1, false);
|
||||
if (ObjectUtil.isNotEmpty(deliverycachepointivt)) {
|
||||
String parentContainer = "临时" + TaskUtils.getDateTime("yyMMddHHmmSSS") + "*";
|
||||
String qzzNo = resourceName.substring(0, 2)
|
||||
+ resourceName.substring(resourceName.length() - 2)
|
||||
+ "A"
|
||||
+ TaskUtils.getDateTime("yyMMddHHmmss") + "-"
|
||||
+ "1";
|
||||
PdmBiSlittingproductionplan plan = new PdmBiSlittingproductionplan();
|
||||
plan.setWorkorder_id(IdUtil.getStringId());
|
||||
// 公共部分插入
|
||||
plan.setOrder_type("1");
|
||||
plan.setContainer_name(parentContainer);
|
||||
plan.setProduct_name("220890200000001");
|
||||
plan.setDescription("临时虚拟卷");
|
||||
plan.setParent_container_name(parentContainer);
|
||||
plan.setRestruct_container_name("");
|
||||
plan.setWare_house("1");
|
||||
plan.setResource_name(resourceName);
|
||||
plan.setSplit_group("A");
|
||||
plan.setManufacture_sort("P1");
|
||||
plan.setMfg_order_name("-");
|
||||
plan.setManufacture_date(DateUtil.format(DateUtil.date(), "yyyy-MM-dd"));
|
||||
plan.setSplit_breadth(new BigDecimal("999"));
|
||||
plan.setSplit_height(new BigDecimal("999"));
|
||||
plan.setSplit_weight(new BigDecimal("999"));
|
||||
plan.setStart_time(DateUtil.now());
|
||||
plan.setEnd_time("");
|
||||
plan.setStatus("02");
|
||||
plan.setIs_parent_ok("0");
|
||||
plan.setIs_child_tz_ok("0");
|
||||
plan.setIs_child_ps_ok("0");
|
||||
plan.setPaper_weight("0");
|
||||
plan.setQzzno("");
|
||||
plan.setIs_delete("0");
|
||||
plan.setSale_order_name("-");
|
||||
plan.setIs_call("1");
|
||||
plan.setCall_time(DateUtil.now());
|
||||
plan.setIs_paper_ok("2");
|
||||
plan.setFRP_model("");
|
||||
plan.setFRP_material("");
|
||||
plan.setFRP_description("");
|
||||
plan.setPaper_tube_model("");
|
||||
plan.setPaper_tube_material("");
|
||||
plan.setPaper_tube_description("");
|
||||
plan.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
plan.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
plan.setUpdate_time(DateUtil.now());
|
||||
plan.setQzzno(qzzNo);
|
||||
plan.setQzz_generation("4");
|
||||
// 区分位置创建
|
||||
plan.setPaper_tube_or_FRP("2");
|
||||
plan.setFRP_material("10475293");
|
||||
plan.setFRP_model("平包树脂管\\3''\\750mm*15mm\\");
|
||||
plan.setFRP_description("平包树脂管\\3''\\750mm*15mm\\");
|
||||
plan.setUp_or_down("1");
|
||||
plan.setLeft_or_right("1");
|
||||
slittingproductionplanService.save(plan);
|
||||
deliverycachepointivt.setQzzno(qzzNo);
|
||||
deliverycachepointivt.setPoint_status("05");
|
||||
deliverycachepointivtService.updateById(deliverycachepointivt);
|
||||
return res;
|
||||
}
|
||||
throw new BadRequestException("点位" + pointCode1 + "不存在,请确认点位编码是否正确!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(containerName)) {
|
||||
@@ -1851,9 +1920,6 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
slittingproductionplanService.updateBatchById(plans);
|
||||
TaskUtils.updateOptMessageByBCutPoint(pointCode);
|
||||
bcutpointivtService.updateById(pointCode);
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("status", HttpStatus.HTTP_OK);
|
||||
res.put("message", "气胀轴绑定成功!");
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -3919,6 +3985,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
String area = param.getString("area");
|
||||
String device_code = param.getString("location");
|
||||
Integer number = param.getInteger("qqz_num");
|
||||
String qzz_size = param.getString("qzz_size");
|
||||
String qzz_generation = param.getString("qzz_generation");
|
||||
StIvtCutpointivt xnDevice = cutpointivtService.getPintByPointCode(device_code, true);
|
||||
if (ObjectUtil.isEmpty(xnDevice)) {
|
||||
@@ -3933,11 +4000,17 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
.eq(Deliverycachepointivt::getIs_used, "1")
|
||||
.eq(Deliverycachepointivt::getPoint_status, "01"));
|
||||
// 获取当前区域、位置的分切计划
|
||||
int planCount = slittingproductionplanService.count(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
List<PdmBiSlittingproductionplan> planSize = slittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.eq(PdmBiSlittingproductionplan::getResource_name, xnDevice.getExt_code())
|
||||
.eq(PdmBiSlittingproductionplan::getIs_delete, "0"));
|
||||
int planCount = (int) planSize.stream()
|
||||
.map(PdmBiSlittingproductionplan::getParent_container_name)
|
||||
.filter(ObjectUtil::isNotEmpty)
|
||||
.distinct()
|
||||
.count();
|
||||
|
||||
if (canUsePoint.size() < (number + planCount)) {
|
||||
throw new BadRequestException("该区域的位置不够,只剩" + canUsePoint.size() + "个空位可用");
|
||||
throw new BadRequestException("该区域的位置不够,只剩" + (canUsePoint.size() - planCount) + "个空位可用");
|
||||
}
|
||||
// 当前轴需要的管芯名称 ...
|
||||
String upLeftSizeK = param.getString("up_left_size_k");
|
||||
@@ -3946,6 +4019,12 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
String upRightSizeV = param.getString("up_right_size_v");
|
||||
String upLeftQzzSize = MdmDescriptionParseUtils.extractCommonTubeSize(upLeftSizeK);
|
||||
String upRightQzzSize = MdmDescriptionParseUtils.extractCommonTubeSize(upRightSizeK);
|
||||
if ("0".equals(upLeftQzzSize)) {
|
||||
upLeftQzzSize = qzz_size;
|
||||
}
|
||||
if ("0".equals(upRightQzzSize)) {
|
||||
upRightQzzSize = qzz_size;
|
||||
}
|
||||
// 判断管芯的长度是否超出
|
||||
if (ObjectUtil.isNotEmpty(upLeftSizeK) && ObjectUtil.isNotEmpty(upRightSizeK)) {
|
||||
// 判断是否超过长度
|
||||
@@ -3965,7 +4044,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
// 虚拟计划
|
||||
// 轴数量
|
||||
for (int i = 0; i < number; i++) {
|
||||
String parentContainer = area + "M虚拟" + i + TaskUtils.getDateTime("yyMMddHHmmss");
|
||||
String parentContainer = "M虚拟" + area + i + TaskUtils.getDateTime("yyMMddHHmmSSS");
|
||||
String now = DateUtil.now();
|
||||
// 没根轴有多少管芯
|
||||
for (int j = 0; j < paperNum; j++) {
|
||||
@@ -3973,7 +4052,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
plan.setWorkorder_id(IdUtil.getStringId());
|
||||
// 公共部分插入
|
||||
plan.setOrder_type("1");
|
||||
plan.setContainer_name("Z虚拟" + area + i + TaskUtils.getDateTime("yyMMddHHmmss") + j);
|
||||
plan.setContainer_name("Z虚拟" + area + i + TaskUtils.getDateTime("yyMMddHHmmSSS") + j);
|
||||
plan.setProduct_name("220890200000001");
|
||||
plan.setDescription("虚拟卷");
|
||||
plan.setParent_container_name(parentContainer);
|
||||
@@ -4158,11 +4237,16 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
}
|
||||
}
|
||||
String resourceName = planOne.getResource_name();
|
||||
List<PdmBiSlittingproductionplan> list = slittingproductionplanService.list(new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.eq(PdmBiSlittingproductionplan::getParent_container_name, planOne.getParent_container_name())
|
||||
LambdaQueryWrapper<PdmBiSlittingproductionplan> lam = new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.eq(PdmBiSlittingproductionplan::getResource_name, resourceName)
|
||||
.eq(PdmBiSlittingproductionplan::getSplit_group, planOne.getSplit_group())
|
||||
.eq(PdmBiSlittingproductionplan::getUp_or_down, planOne.getUp_or_down()));
|
||||
.eq(PdmBiSlittingproductionplan::getUp_or_down, planOne.getUp_or_down());
|
||||
if ("1".equals(planOne.getPaper_tube_or_FRP())) {
|
||||
lam.eq(PdmBiSlittingproductionplan::getParent_container_name, planOne.getParent_container_name());
|
||||
} else {
|
||||
lam.eq(PdmBiSlittingproductionplan::getRestruct_container_name, planOne.getRestruct_container_name());
|
||||
}
|
||||
List<PdmBiSlittingproductionplan> list = slittingproductionplanService.list(lam);
|
||||
if (!"1".equals(force)) {
|
||||
// 如果不强制绑定,就需要判断轴的规格对不对
|
||||
if (qzzs.size() != list.size()) {
|
||||
|
||||
Reference in New Issue
Block a user