1、新增部门校验问题修复;2、自定义板编号跨单导入问题修复;

This commit is contained in:
gaoqr
2024-12-02 17:44:23 +08:00
parent 73d31dbf8c
commit 0effec4479
7 changed files with 33 additions and 17 deletions
@@ -3,10 +3,13 @@ package com.cf.imes.module.executor.service.customplateno;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.cf.imes.framework.common.exception.ServiceException;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.framework.common.util.json.JsonUtils;
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
import com.cf.imes.module.executor.dal.mysql.order.OrderMapper;
import com.cf.imes.module.executor.enums.ErrorCodeConstants;
import com.cf.imes.module.executor.service.customplateno.vo.CustomPlateNoGenerateConfigVO;
import com.cf.imes.module.executor.service.customplateno.vo.CustomPlateNoRuleVO;
@@ -49,6 +52,9 @@ public class CustomPlateNoGenerateServiceImpl implements CustomPlateNoGenerateSe
@Resource
private List<CustomPlateNoGenerateRuleService> ruleServices;
@Resource
private OrderMapper orderMapper;
private static final DateTimeFormatter YEAR_FORMATTER = DateTimeFormatter.ofPattern("yyyy");
private static final DateTimeFormatter MONTH_FORMATTER = DateTimeFormatter.ofPattern("yyyyMM");
private static final DateTimeFormatter DAY_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMdd");
@@ -77,8 +83,14 @@ public class CustomPlateNoGenerateServiceImpl implements CustomPlateNoGenerateSe
}
// 3、保存生产单序号json、设置生产单所用配置id
orderDO.setCustomPlatenoSeq(JSON.toJSONString(generateConfig.getOrderCustomPlateNoSeqVO()));
orderDO.setCustomPlatenoConfigId(orgCustomPlateNoConfigId);
OrderCustomPlateNoSeqVO orderCustomPlateNoSeqVO = generateConfig.getOrderCustomPlateNoSeqVO();
if (ObjectUtil.isNotNull(orderDO)) {
// 已有生产单更新序号
orderMapper.update(new LambdaUpdateWrapper<OrderDO>().eq(OrderDO::getId, orderId).set(OrderDO::getCustomPlatenoSeq, JsonUtils.zipString(JSON.toJSONString(orderCustomPlateNoSeqVO))));
} else {
orderDO.setCustomPlatenoSeq(JSON.toJSONString(orderCustomPlateNoSeqVO));
orderDO.setCustomPlatenoConfigId(orgCustomPlateNoConfigId);
}
// 机构下序号配置同步
CustomPlateNoSeqDTO orgCustomPlateNoSeqRespDTO = generateConfig.getOrgCustomPlateNoSeqRespDTO();
orgCustomPlateNoSeqRespDTO.setLastOrderNo(orderId);