diff --git a/src/main/java/com/gaotao/modules/inboundNotification/service/impl/InboundNotificationServiceImpl.java b/src/main/java/com/gaotao/modules/inboundNotification/service/impl/InboundNotificationServiceImpl.java index af3454e..1c6a1ab 100644 --- a/src/main/java/com/gaotao/modules/inboundNotification/service/impl/InboundNotificationServiceImpl.java +++ b/src/main/java/com/gaotao/modules/inboundNotification/service/impl/InboundNotificationServiceImpl.java @@ -2,6 +2,7 @@ package com.gaotao.modules.inboundNotification.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gaotao.common.exception.XJException; import com.gaotao.common.utils.PageUtils; import com.gaotao.modules.inboundNotification.dao.InboundNotificationDetailMapper; import com.gaotao.modules.inboundNotification.dao.InboundNotificationHeadMapper; @@ -17,6 +18,7 @@ import com.gaotao.modules.pms.data.QcTemplateData; import com.gaotao.modules.pms.entity.vo.PartDefectTrackingVo; import com.gaotao.modules.pms.entity.vo.PartInformationVo; import com.gaotao.modules.pms.entity.vo.PartLabelTemplateVo; +import com.gaotao.modules.schedule.mapper.ProcedureMapper; import com.gaotao.modules.sys.entity.SysUserEntity; import com.gaotao.modules.trans.dao.TransNoControlMapper; import com.gaotao.modules.trans.entity.*; @@ -63,6 +65,9 @@ public class InboundNotificationServiceImpl implements InboundNotificationServic @Autowired private InventoryStockMapper inventoryStockMapper; + @Autowired + private ProcedureMapper procedureMapper; + @Override public List> getQualifiedInboundList(String site, String warehouseId, String searchCode, String status) { @@ -653,17 +658,33 @@ public class InboundNotificationServiceImpl implements InboundNotificationServic // 下达前校验 validateIssueData(data); - // 收获入库单状态改为"待入库" 赋值下达人和下达时间 + // 收获入库单状态改为"待检验" 赋值下达人和下达时间 SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); data.setAssignedBy(sysUserEntity.getUsername()); - data.setOrderStatus("待入库"); + data.setOrderStatus("待检验"); headMapper.issueInboundNotification(data); - logger.info("入库单下达成功,入库单号: {}", data.getOrderNo()); } catch (Exception e) { logger.error("入库单下达失败,入库单号: {}, 错误信息: {}", data.getOrderNo(), e.getMessage(), e); throw new RuntimeException("入库单下达失败: " + e.getMessage(), e); } + + // 调用存储过程 getInspectionTaskAutomatically +// List params = new ArrayList<>(); +// params.add(data.getSite()); +// params.add(data.getBuNo()); +// params.add(data.getRelatedOrderNo()); +// params.add(inData.getPartNo()); +// params.add(inData.getRevNo()); +// params.add(inData.getUser()); +// //存储过程 调用存储过程 创建分卷 +// List> resultList = procedureMapper.getProcedureData("getInspectionTaskAutomatically", params); +// //判断是否检验成功 +// String code = String.valueOf(resultList.get(0).get("code")); +// if ("400".equalsIgnoreCase(code)) { +// String msg = String.valueOf(resultList.get(0).get("message")); +// throw new RuntimeException(msg); +// } } /** diff --git a/src/main/java/com/gaotao/modules/oa/service/impl/ProductionOrderServiceImpl.java b/src/main/java/com/gaotao/modules/oa/service/impl/ProductionOrderServiceImpl.java index 1385723..6d416ca 100644 --- a/src/main/java/com/gaotao/modules/oa/service/impl/ProductionOrderServiceImpl.java +++ b/src/main/java/com/gaotao/modules/oa/service/impl/ProductionOrderServiceImpl.java @@ -98,7 +98,7 @@ public class ProductionOrderServiceImpl implements ProductionOrderService { shopOrder.setEnterDate(item.getEnterDate() != null ? item.getEnterDate() : new Date()); shopOrder.setUserName("OA_SYSTEM"); - shopOrderMapper.saveShopOrderData(shopOrder); + shopOrderMapper.saveShopOrderData2(shopOrder); log.debug("新增生产订单: {}", item.getOrderNo()); } @@ -166,6 +166,7 @@ public class ProductionOrderServiceImpl implements ProductionOrderService { shopOrder.setBatchNo(item.getBatchNo()); shopOrder.setOrderRef1(item.getOrderref1()); shopOrder.setOrderRef2(item.getOrderref2()); + shopOrder.setBuNo(item.getBuNo()); } /** diff --git a/src/main/java/com/gaotao/modules/shopOrder/dao/ShopOrderMapper.java b/src/main/java/com/gaotao/modules/shopOrder/dao/ShopOrderMapper.java index f763013..0ce61a5 100644 --- a/src/main/java/com/gaotao/modules/shopOrder/dao/ShopOrderMapper.java +++ b/src/main/java/com/gaotao/modules/shopOrder/dao/ShopOrderMapper.java @@ -201,7 +201,7 @@ public interface ShopOrderMapper { * @return * @throw */ - ResponseData deleteShopOrderData(ShopOrderData inData); + void deleteShopOrderData(ShopOrderData inData); /** * @Description 保存修改生产订单 * @Title saveShopOrderData @@ -403,4 +403,6 @@ public interface ShopOrderMapper { SopViewData getOrderSopInfo(ShopOrderData shopOrderData); List getFileData(Integer id); + + void saveShopOrderData2(ShopOrderData shopOrder); } diff --git a/src/main/java/com/gaotao/modules/shopOrder/entity/ShopOrderData.java b/src/main/java/com/gaotao/modules/shopOrder/entity/ShopOrderData.java index 8ae8891..24add1a 100644 --- a/src/main/java/com/gaotao/modules/shopOrder/entity/ShopOrderData.java +++ b/src/main/java/com/gaotao/modules/shopOrder/entity/ShopOrderData.java @@ -276,6 +276,15 @@ public class ShopOrderData { private String itemNo; private String itemDesc; private String batchNo; + private String buNo; + + public String getBuNo() { + return buNo; + } + + public void setBuNo(String buNo) { + this.buNo = buNo; + } public String getItemDesc() { return itemDesc; diff --git a/src/main/java/com/gaotao/modules/sop/service/impl/SopFileServiceImpl.java b/src/main/java/com/gaotao/modules/sop/service/impl/SopFileServiceImpl.java index 3ee80a0..deab267 100644 --- a/src/main/java/com/gaotao/modules/sop/service/impl/SopFileServiceImpl.java +++ b/src/main/java/com/gaotao/modules/sop/service/impl/SopFileServiceImpl.java @@ -31,7 +31,7 @@ public class SopFileServiceImpl implements SopFileService { /** * SOP文件存储的根目录 */ - private static final String SOP_ROOT_DIR = "D:\\sop_test"; + private static final String SOP_ROOT_DIR = "D:\\sop_files"; @Override @Transactional @@ -49,7 +49,7 @@ public class SopFileServiceImpl implements SopFileService { request.getSite(), request.getBuNo(), request.getFileNo()); FileManagementEntity entity = new FileManagementEntity(); - if (existingEntity != null && "Y".equals(request.getUpdateFlag())) { + if (existingEntity != null ) { // 更新现有记录 - 确保所有NOT NULL字段都有值 entity = existingEntity; // 手动映射字段,避免使用BeanUtils.copyProperties @@ -81,7 +81,7 @@ public class SopFileServiceImpl implements SopFileService { entity.setCreateDate(new Date()); // NOT NULL } log.info("更新现有文件记录,ID: {}", entity.getId()); - } else if (existingEntity == null && "N".equals(request.getUpdateFlag())) { + } else if (existingEntity == null) { // 新增记录 - 确保所有NOT NULL字段都有值 entity.setSite(request.getSite()); // NOT NULL entity.setBuNo(request.getBuNo()); // NOT NULL @@ -104,8 +104,6 @@ public class SopFileServiceImpl implements SopFileService { entity.setFileName("temp_file.pdf"); // NOT NULL,临时值 entity.setFileSuffix("pdf"); // NOT NULL,默认值 log.info("创建新文件记录"); - } else { - return SopFileResponseDto.failure("更新标识与数据库状态不匹配"); } // 3. 下载文件到本地(统一使用Base64文件下载方法) diff --git a/src/main/resources/mapper/shopOrder/ShopOrderMapper.xml b/src/main/resources/mapper/shopOrder/ShopOrderMapper.xml index 87a24fa..64ec281 100644 --- a/src/main/resources/mapper/shopOrder/ShopOrderMapper.xml +++ b/src/main/resources/mapper/shopOrder/ShopOrderMapper.xml @@ -410,7 +410,7 @@ - + delete from ShopOrder where site = #{site} @@ -501,7 +501,7 @@ Planner=#{planner}, OriSOOrderNo=#{oriSOOrderNo}, ProjectID=#{projectID}, - Leadtime=#{leadtime}, + Leadtime=#{leadtime,jdbcType=FLOAT}, RepairSOFlag=#{repairSOFlag}, TechInfo=#{techInfo}, Remark=#{remark}, @@ -831,4 +831,13 @@ + + + insert into ShopOrder + (Site, bu_no, OrderNo, Status, Status_Tmp, EnterDate, NeedDate, PlanStartDate, + OrderType, PartNo, LotSize, BOMRevNo, RoutingRevNo, ProjectID, CustomerID, batch_no, OrderRef1, OrderRef2) + values + (#{site}, #{buNo}, #{orderNo}, #{status}, #{statusTmp}, #{enterDate}, #{needDate}, #{planStartDate}, + #{orderType}, #{partNo}, #{lotSize,jdbcType=FLOAT}, #{bOMRevNo}, #{routingRevNo}, #{projectID}, #{customerID}, #{batchNo}, #{orderRef1}, #{orderRef2}) + \ No newline at end of file