Browse Source

2025-09-18 生产订单接口调试

master
fengyuan_yang 1 year ago
parent
commit
7332619f12
  1. 27
      src/main/java/com/gaotao/modules/inboundNotification/service/impl/InboundNotificationServiceImpl.java
  2. 3
      src/main/java/com/gaotao/modules/oa/service/impl/ProductionOrderServiceImpl.java
  3. 4
      src/main/java/com/gaotao/modules/shopOrder/dao/ShopOrderMapper.java
  4. 9
      src/main/java/com/gaotao/modules/shopOrder/entity/ShopOrderData.java
  5. 8
      src/main/java/com/gaotao/modules/sop/service/impl/SopFileServiceImpl.java
  6. 13
      src/main/resources/mapper/shopOrder/ShopOrderMapper.xml

27
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.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gaotao.common.exception.XJException;
import com.gaotao.common.utils.PageUtils; import com.gaotao.common.utils.PageUtils;
import com.gaotao.modules.inboundNotification.dao.InboundNotificationDetailMapper; import com.gaotao.modules.inboundNotification.dao.InboundNotificationDetailMapper;
import com.gaotao.modules.inboundNotification.dao.InboundNotificationHeadMapper; 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.PartDefectTrackingVo;
import com.gaotao.modules.pms.entity.vo.PartInformationVo; import com.gaotao.modules.pms.entity.vo.PartInformationVo;
import com.gaotao.modules.pms.entity.vo.PartLabelTemplateVo; 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.sys.entity.SysUserEntity;
import com.gaotao.modules.trans.dao.TransNoControlMapper; import com.gaotao.modules.trans.dao.TransNoControlMapper;
import com.gaotao.modules.trans.entity.*; import com.gaotao.modules.trans.entity.*;
@ -63,6 +65,9 @@ public class InboundNotificationServiceImpl implements InboundNotificationServic
@Autowired @Autowired
private InventoryStockMapper inventoryStockMapper; private InventoryStockMapper inventoryStockMapper;
@Autowired
private ProcedureMapper procedureMapper;
@Override @Override
public List<Map<String, Object>> getQualifiedInboundList(String site, String warehouseId, String searchCode, String status) { public List<Map<String, Object>> getQualifiedInboundList(String site, String warehouseId, String searchCode, String status) {
@ -653,17 +658,33 @@ public class InboundNotificationServiceImpl implements InboundNotificationServic
// 下达前校验 // 下达前校验
validateIssueData(data); validateIssueData(data);
// 收获入库单状态改为"待入库" 赋值下达人和下达时间
// 收获入库单状态改为"待检验" 赋值下达人和下达时间
SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
data.setAssignedBy(sysUserEntity.getUsername()); data.setAssignedBy(sysUserEntity.getUsername());
data.setOrderStatus("待入库");
data.setOrderStatus("待检验");
headMapper.issueInboundNotification(data); headMapper.issueInboundNotification(data);
logger.info("入库单下达成功,入库单号: {}", data.getOrderNo()); logger.info("入库单下达成功,入库单号: {}", data.getOrderNo());
} catch (Exception e) { } catch (Exception e) {
logger.error("入库单下达失败,入库单号: {}, 错误信息: {}", data.getOrderNo(), e.getMessage(), e); logger.error("入库单下达失败,入库单号: {}, 错误信息: {}", data.getOrderNo(), e.getMessage(), e);
throw new RuntimeException("入库单下达失败: " + e.getMessage(), e); throw new RuntimeException("入库单下达失败: " + e.getMessage(), e);
} }
// 调用存储过程 getInspectionTaskAutomatically
// List<Object> 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<Map<String, Object>> 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);
// }
} }
/** /**

3
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.setEnterDate(item.getEnterDate() != null ? item.getEnterDate() : new Date());
shopOrder.setUserName("OA_SYSTEM"); shopOrder.setUserName("OA_SYSTEM");
shopOrderMapper.saveShopOrderData(shopOrder);
shopOrderMapper.saveShopOrderData2(shopOrder);
log.debug("新增生产订单: {}", item.getOrderNo()); log.debug("新增生产订单: {}", item.getOrderNo());
} }
@ -166,6 +166,7 @@ public class ProductionOrderServiceImpl implements ProductionOrderService {
shopOrder.setBatchNo(item.getBatchNo()); shopOrder.setBatchNo(item.getBatchNo());
shopOrder.setOrderRef1(item.getOrderref1()); shopOrder.setOrderRef1(item.getOrderref1());
shopOrder.setOrderRef2(item.getOrderref2()); shopOrder.setOrderRef2(item.getOrderref2());
shopOrder.setBuNo(item.getBuNo());
} }
/** /**

4
src/main/java/com/gaotao/modules/shopOrder/dao/ShopOrderMapper.java

@ -201,7 +201,7 @@ public interface ShopOrderMapper {
* @return * @return
* @throw * @throw
*/ */
ResponseData deleteShopOrderData(ShopOrderData inData);
void deleteShopOrderData(ShopOrderData inData);
/** /**
* @Description 保存修改生产订单 * @Description 保存修改生产订单
* @Title saveShopOrderData * @Title saveShopOrderData
@ -403,4 +403,6 @@ public interface ShopOrderMapper {
SopViewData getOrderSopInfo(ShopOrderData shopOrderData); SopViewData getOrderSopInfo(ShopOrderData shopOrderData);
List<SysOssEntity> getFileData(Integer id); List<SysOssEntity> getFileData(Integer id);
void saveShopOrderData2(ShopOrderData shopOrder);
} }

9
src/main/java/com/gaotao/modules/shopOrder/entity/ShopOrderData.java

@ -276,6 +276,15 @@ public class ShopOrderData {
private String itemNo; private String itemNo;
private String itemDesc; private String itemDesc;
private String batchNo; private String batchNo;
private String buNo;
public String getBuNo() {
return buNo;
}
public void setBuNo(String buNo) {
this.buNo = buNo;
}
public String getItemDesc() { public String getItemDesc() {
return itemDesc; return itemDesc;

8
src/main/java/com/gaotao/modules/sop/service/impl/SopFileServiceImpl.java

@ -31,7 +31,7 @@ public class SopFileServiceImpl implements SopFileService {
/** /**
* SOP文件存储的根目录 * SOP文件存储的根目录
*/ */
private static final String SOP_ROOT_DIR = "D:\\sop_test";
private static final String SOP_ROOT_DIR = "D:\\sop_files";
@Override @Override
@Transactional @Transactional
@ -49,7 +49,7 @@ public class SopFileServiceImpl implements SopFileService {
request.getSite(), request.getBuNo(), request.getFileNo()); request.getSite(), request.getBuNo(), request.getFileNo());
FileManagementEntity entity = new FileManagementEntity(); FileManagementEntity entity = new FileManagementEntity();
if (existingEntity != null && "Y".equals(request.getUpdateFlag())) {
if (existingEntity != null ) {
// 更新现有记录 - 确保所有NOT NULL字段都有值 // 更新现有记录 - 确保所有NOT NULL字段都有值
entity = existingEntity; entity = existingEntity;
// 手动映射字段,避免使用BeanUtils.copyProperties // 手动映射字段,避免使用BeanUtils.copyProperties
@ -81,7 +81,7 @@ public class SopFileServiceImpl implements SopFileService {
entity.setCreateDate(new Date()); // NOT NULL entity.setCreateDate(new Date()); // NOT NULL
} }
log.info("更新现有文件记录,ID: {}", entity.getId()); log.info("更新现有文件记录,ID: {}", entity.getId());
} else if (existingEntity == null && "N".equals(request.getUpdateFlag())) {
} else if (existingEntity == null) {
// 新增记录 - 确保所有NOT NULL字段都有值 // 新增记录 - 确保所有NOT NULL字段都有值
entity.setSite(request.getSite()); // NOT NULL entity.setSite(request.getSite()); // NOT NULL
entity.setBuNo(request.getBuNo()); // 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.setFileName("temp_file.pdf"); // NOT NULL,临时值
entity.setFileSuffix("pdf"); // NOT NULL,默认值 entity.setFileSuffix("pdf"); // NOT NULL,默认值
log.info("创建新文件记录"); log.info("创建新文件记录");
} else {
return SopFileResponseDto.failure("更新标识与数据库状态不匹配");
} }
// 3. 下载文件到本地(统一使用Base64文件下载方法) // 3. 下载文件到本地(统一使用Base64文件下载方法)

13
src/main/resources/mapper/shopOrder/ShopOrderMapper.xml

@ -410,7 +410,7 @@
</where> </where>
</select> </select>
<delete id="deleteShopOrderData" parameterType="com.gaotao.modules.shopOrder.entity.ShopOrderData">
<delete id="deleteShopOrderData">
delete delete
from ShopOrder from ShopOrder
where site = #{site} where site = #{site}
@ -501,7 +501,7 @@
Planner=#{planner}, Planner=#{planner},
OriSOOrderNo=#{oriSOOrderNo}, OriSOOrderNo=#{oriSOOrderNo},
ProjectID=#{projectID}, ProjectID=#{projectID},
Leadtime=#{leadtime},
Leadtime=#{leadtime,jdbcType=FLOAT},
RepairSOFlag=#{repairSOFlag}, RepairSOFlag=#{repairSOFlag},
TechInfo=#{techInfo}, TechInfo=#{techInfo},
Remark=#{remark}, Remark=#{remark},
@ -831,4 +831,13 @@
<select id="getFileData" resultType="SysOssEntity"> <select id="getFileData" resultType="SysOssEntity">
select url,file_name,new_file_name from sys_oss where id = #{id} select url,file_name,new_file_name from sys_oss where id = #{id}
</select> </select>
<insert id="saveShopOrderData2">
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})
</insert>
</mapper> </mapper>
Loading…
Cancel
Save