日志记录修改

main
BKGY_MYT 3 weeks ago
parent d9548802b5
commit 2bff90935a

@ -129,7 +129,7 @@ public interface SubService {
List<PmThickAddvBt> getPmThickAddvBt(); List<PmThickAddvBt> getPmThickAddvBt();
void SaveData(SlabInfoDO p, List<PmPdSlab> pmPdSlabDOList, List<PmPdPlateCut> pmPdPlateCutDOList, List<PmPdBlockPos> pmPdBlockPosDOList, List<PmPdContSum> pmPdContSumDOList, List<PmSmallPltPos> pmSmallPltPosDOList, List<PmCmdSlab> pmCmdSlabDOList, List<PmCmdLargePlt> pmCmdLargePltDOList, List<PmCmdCont> pmCmdContDOList, List<PmCmdSmallPlt> pmCmdSmallPltDOList, List<PmSubHis> plistpmSubHisDO, List<PmSubOrd> plistpmSubOrdDO, List<PmPdRecDTO> pmPdRecDTOList, Long organizationId); String SaveData(SlabInfoDO p, List<PmPdSlab> pmPdSlabDOList, List<PmPdPlateCut> pmPdPlateCutDOList, List<PmPdBlockPos> pmPdBlockPosDOList, List<PmPdContSum> pmPdContSumDOList, List<PmSmallPltPos> pmSmallPltPosDOList, List<PmCmdSlab> pmCmdSlabDOList, List<PmCmdLargePlt> pmCmdLargePltDOList, List<PmCmdCont> pmCmdContDOList, List<PmCmdSmallPlt> pmCmdSmallPltDOList, List<PmSubHis> plistpmSubHisDO, List<PmSubOrd> plistpmSubOrdDO, List<PmPdRecDTO> pmPdRecDTOList, Long organizationId);
void saveSubLog(String slabNo, long subMode, String subRslt, String subLog, Long organizationId); void saveSubLog(String slabNo, long subMode, String subRslt, String subLog, Long organizationId);

@ -7,6 +7,8 @@ import com.xisc.pm.api.dto.*;
import com.xisc.pm.api.dto.ctevent.ProContBoardEndDTO; import com.xisc.pm.api.dto.ctevent.ProContBoardEndDTO;
import com.xisc.pm.api.dto.model.*; import com.xisc.pm.api.dto.model.*;
import com.xisc.pm.app.service.PmPdRecService; import com.xisc.pm.app.service.PmPdRecService;
import com.xisc.pm.app.service.strategy.PdMatTypeStrategyFactory;
import com.xisc.pm.app.service.strategy.pdmattype.PdMatTypeStrategy;
import com.xisc.pm.domain.entity.*; import com.xisc.pm.domain.entity.*;
import com.xisc.pm.domain.repository.*; import com.xisc.pm.domain.repository.*;
import com.xisc.pm.domain.vo.MatStatusModifyVO; import com.xisc.pm.domain.vo.MatStatusModifyVO;
@ -17,10 +19,12 @@ import com.xisc.pm.infra.client.QdOrderClient;
import com.xisc.pm.infra.constant.Constants; import com.xisc.pm.infra.constant.Constants;
import com.xisc.pm.infra.constant.CtEventConstants; import com.xisc.pm.infra.constant.CtEventConstants;
import com.xisc.pm.infra.constant.PmPlateConstants; import com.xisc.pm.infra.constant.PmPlateConstants;
import com.xisc.pm.infra.enums.PdEventType;
import com.xisc.pm.infra.enums.PdProdFlag; import com.xisc.pm.infra.enums.PdProdFlag;
import com.xisc.pm.infra.mapper.SubMapper; import com.xisc.pm.infra.mapper.SubMapper;
import com.xisc.pm.app.service.SubService; import com.xisc.pm.app.service.SubService;
import com.xisc.pm.infra.util.BeanUtils; import com.xisc.pm.infra.util.BeanUtils;
import io.choerodon.core.exception.CommonException;
import io.choerodon.core.oauth.CustomUserDetails; import io.choerodon.core.oauth.CustomUserDetails;
import io.choerodon.core.oauth.DetailsHelper; import io.choerodon.core.oauth.DetailsHelper;
import org.apache.commons.lang3.math.NumberUtils; import org.apache.commons.lang3.math.NumberUtils;
@ -54,6 +58,63 @@ public class SubServiceImpl implements SubService {
@Autowired @Autowired
private QdOrderClient qdOrderClient; private QdOrderClient qdOrderClient;
@Autowired
private SubMapper subMapper;
@Autowired
private PmPdSlabRepository pmPdSlabRepository;
@Autowired
private PmCmdSlabRepository pmCmdSlabRepository;
@Autowired
private PmCmdLargePltRepository pmCmdLargePltRepository;
@Autowired
private PmPdContSumRepository pmPdContSumRepository;
@Autowired
private PmPdBlockPosRepository pmPdBlockPosRepository;
@Autowired
private PmPdPlateCutRepository pmPdPlateCutRepository;
@Autowired
private PmSmallPltPosRepository pmSmallPltPosRepository;
@Autowired
private PmCmdSmallPltRepository pmCmdSmallPltRepository;
@Autowired
private PmCmdContRepository pmCmdContRepository;
@Autowired
private PmSubHisRepository pmSubHisRepository;
@Autowired
private PmSubOrdRepository pmSubOrdRepository;
@Autowired
private PmPdSlabInfoRepository pmPdSlabInfoRepository;
@Autowired
private MmEventClient mmEventClient;
@Autowired
private RedisHelper redisHelper;
@Autowired
private PmPdRecService pmPdRecService;
@Autowired
private PmProContRepository pmProContRepository;
@Autowired
private PmSubLogRepository pmSubLogRepository;
@Autowired
protected EventClient eventClient;
// @Autowired // @Autowired
// private TransactionService transactionService; // private TransactionService transactionService;
@ -4134,65 +4195,13 @@ public class SubServiceImpl implements SubService {
// batchInsertPmCmdCont(pmCmdContDOList); // batchInsertPmCmdCont(pmCmdContDOList);
// System.out.println("PmCmdCont 命令参数 保存成功"); // System.out.println("PmCmdCont 命令参数 保存成功");
SaveData(p,pmPdSlabDOList, pmPdPlateCutDOList, pmPdBlockPosDOList, pmPdContSumDOList, pmSmallPltPosDOList, pmCmdSlabDOList, pmCmdLargePltDOList, pmCmdContDOList, pmCmdSmallPltDOList,plistpmSubHisDO,plistpmSubOrdDO,pmPdRecs,organizationId); String strSubLog = SaveData(p,pmPdSlabDOList, pmPdPlateCutDOList, pmPdBlockPosDOList, pmPdContSumDOList, pmSmallPltPosDOList, pmCmdSlabDOList, pmCmdLargePltDOList, pmCmdContDOList, pmCmdSmallPltDOList,plistpmSubHisDO,plistpmSubOrdDO,pmPdRecs,organizationId);
subLog.setSubDate(now);
subLog.setSubLog(subLog.getSubLog() + strSubLog);
pmSubLogRepository.insertSelective(subLog);
} }
@Autowired
private SubMapper subMapper;
@Autowired
private PmPdSlabRepository pmPdSlabRepository;
@Autowired
private PmCmdSlabRepository pmCmdSlabRepository;
@Autowired
private PmCmdLargePltRepository pmCmdLargePltRepository;
@Autowired
private PmPdContSumRepository pmPdContSumRepository;
@Autowired
private PmPdBlockPosRepository pmPdBlockPosRepository;
@Autowired
private PmPdPlateCutRepository pmPdPlateCutRepository;
@Autowired
private PmSmallPltPosRepository pmSmallPltPosRepository;
@Autowired
private PmCmdSmallPltRepository pmCmdSmallPltRepository;
@Autowired
private PmCmdContRepository pmCmdContRepository;
@Autowired
private PmSubHisRepository pmSubHisRepository;
@Autowired
private PmSubOrdRepository pmSubOrdRepository;
@Autowired
private PmPdSlabInfoRepository pmPdSlabInfoRepository;
@Autowired
private MmEventClient mmEventClient;
@Autowired
private RedisHelper redisHelper;
@Autowired
private PmPdRecService pmPdRecService;
@Autowired
private PmProContRepository pmProContRepository;
@Autowired
private PmSubLogRepository pmSubLogRepository;
@Autowired
protected EventClient eventClient;
// 获取板坯信息 // 获取板坯信息
@Override @Override
@ -4541,114 +4550,132 @@ public class SubServiceImpl implements SubService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void SaveData(SlabInfoDO p, List<PmPdSlab> pmPdSlabDOList, List<PmPdPlateCut> pmPdPlateCutDOList, List<PmPdBlockPos> pmPdBlockPosDOList, List<PmPdContSum> pmPdContSumDOList, List<PmSmallPltPos> pmSmallPltPosDOList, List<PmCmdSlab> pmCmdSlabDOList, List<PmCmdLargePlt> pmCmdLargePltDOList, List<PmCmdCont> pmCmdContDOList, List<PmCmdSmallPlt> pmCmdSmallPltDOList, List<PmSubHis> plistpmSubHisDO, List<PmSubOrd> plistpmSubOrdDO, List<PmPdRecDTO> pmPdRecDTOList, Long organizationId) { public String SaveData(SlabInfoDO p, List<PmPdSlab> pmPdSlabDOList, List<PmPdPlateCut> pmPdPlateCutDOList, List<PmPdBlockPos> pmPdBlockPosDOList, List<PmPdContSum> pmPdContSumDOList, List<PmSmallPltPos> pmSmallPltPosDOList, List<PmCmdSlab> pmCmdSlabDOList, List<PmCmdLargePlt> pmCmdLargePltDOList, List<PmCmdCont> pmCmdContDOList, List<PmCmdSmallPlt> pmCmdSmallPltDOList, List<PmSubHis> plistpmSubHisDO, List<PmSubOrd> plistpmSubOrdDO, List<PmPdRecDTO> pmPdRecDTOList, Long organizationId) {
String strSubLog = "";
//抛合同事件
String bizId = pmPdRecDTOList.get(0).getKeyvalue1();
String key = String.format(PmPlateConstants.YIELD_EXEC_LOCK_KEY, organizationId.toString(), bizId);
if (redisHelper.hasKey(key)) {
throw new CommonException("pm.pm_pro_cont_043", bizId);
}
// //抛合同事件 PdMatTypeStrategy pdMatTypeStrategy = PdMatTypeStrategyFactory.matchStrategy("S");
// String bizId = pmPdRecDTOList.get(0).getKeyvalue1(); try {
// String key = String.format(PmPlateConstants.YIELD_EXEC_LOCK_KEY, organizationId.toString(), bizId); // 抛合同组板事件
// if (redisHelper.hasKey(key)) { pmPdRecService.createEvent(organizationId, pmPdRecDTOList
// throw new CommonException("pm.pm_pro_cont_043", bizId); , PdEventType.HP04, Constants.SYSTEM_PD_CODE, pdMatTypeStrategy.pdProgram());
// } redisHelper.strSet(key, "1", 30L, TimeUnit.SECONDS);
// // 抛组板履历事件
// PdMatTypeStrategy pdMatTypeStrategy = PdMatTypeStrategyFactory.matchStrategy("S"); List<PmPdRecDTO> pmPdRecs = new ArrayList<>();
// try { CustomUserDetails userDetails = DetailsHelper.getUserDetails();
// // 抛合同组板事件 for (PmPdContSum contSum : pmPdContSumDOList) {
// pmPdRecService.createEvent(organizationId, pmPdRecDTOList PmPdRecDTO pmPdRecDTO = new PmPdRecDTO();
// , PdEventType.HP04, Constants.SYSTEM_PD_CODE, pdMatTypeStrategy.pdProgram()); pmPdRecDTO.setOrderNo(contSum.getOrderNo());
// redisHelper.strSet(key, "1", 30L, TimeUnit.SECONDS); pmPdRecDTO.setEventMaker(userDetails == null ? "" : userDetails.getUserId().toString());
// // 抛组板履历事件 pmPdRecDTO.setMscLineNo(pmPdRecDTOList.get(0).getMscLineNo());
// List<PmPdRecDTO> pmPdRecs = new ArrayList<>(); pmPdRecDTO.setKeyvalue1(bizId);
// CustomUserDetails userDetails = DetailsHelper.getUserDetails(); pmPdRecDTO.setKeyvalue1Desc(PmPdRecDTO.DESC_VIRTUAL_SLAB_NO);
// for (PmPdContSum contSum : pmPdContSumDOList) { pmPdRecDTO.setMatNo(bizId);
// PmPdRecDTO pmPdRecDTO = new PmPdRecDTO(); pmPdRecDTO.setQty(contSum.getOrderPlateNum());
// pmPdRecDTO.setOrderNo(contSum.getOrderNo()); pmPdRecs.add(pmPdRecDTO);
// pmPdRecDTO.setEventMaker(userDetails == null ? "" : userDetails.getUserId().toString()); }
// pmPdRecDTO.setMscLineNo(pmPdRecDTOList.get(0).getMscLineNo()); pmPdRecService.createEvent(organizationId, pmPdRecs, PdEventType.HP10,
// pmPdRecDTO.setKeyvalue1(bizId); Constants.SYSTEM_PD_CODE, "余材板坯组板");
// pmPdRecDTO.setKeyvalue1Desc(PmPdRecDTO.DESC_VIRTUAL_SLAB_NO); System.out.println("抛合同组板事件 执行成功");
// pmPdRecDTO.setMatNo(bizId); strSubLog = "-----抛合同组板事件 执行成功";
// pmPdRecDTO.setQty(contSum.getOrderPlateNum()); // 抛合同
// pmPdRecs.add(pmPdRecDTO);
// }
// pmPdRecService.createEvent(organizationId, pmPdRecs, PdEventType.HP10, } finally {
// Constants.SYSTEM_PD_CODE, "余材板坯组板"); // 抛合同组板释放事件
// System.out.println("抛合同组板事件 执行成功"); pmPdRecService.createEvent(organizationId, pmPdRecDTOList
// // 抛合同 , PdEventType.HP05, Constants.SYSTEM_PD_CODE, pdMatTypeStrategy.pdProgram());
// redisHelper.delKey(key);
// }
// } finally {
// // 抛合同组板释放事件
// pmPdRecService.createEvent(organizationId, pmPdRecDTOList
// , PdEventType.HP05, Constants.SYSTEM_PD_CODE, pdMatTypeStrategy.pdProgram());
// redisHelper.delKey(key);
// }
if (plistpmSubHisDO.size() > 0) { if (plistpmSubHisDO.size() > 0) {
pmSubHisRepository.batchInsertSelective(plistpmSubHisDO); pmSubHisRepository.batchInsertSelective(plistpmSubHisDO);
System.out.println("pmSubHis表 保存成功"); System.out.println("pmSubHis表 保存成功");
strSubLog += "-----pmSubHis表 保存成功";
} }
if (plistpmSubOrdDO.size() > 0) { if (plistpmSubOrdDO.size() > 0) {
pmSubOrdRepository.batchInsertSelective(plistpmSubOrdDO); pmSubOrdRepository.batchInsertSelective(plistpmSubOrdDO);
System.out.println("pmSubOrd表 保存成功"); System.out.println("pmSubOrd表 保存成功");
strSubLog += "-----pmSubOrd表 保存成功";
} }
//// ////
// if (pmPdSlabDOList.size() > 0) { if (pmPdSlabDOList.size() > 0) {
// pmPdSlabRepository.batchInsertSelective(pmPdSlabDOList); pmPdSlabRepository.batchInsertSelective(pmPdSlabDOList);
// System.out.println("PmPdSlab表 保存成功"); System.out.println("PmPdSlab表 保存成功");
// } strSubLog += "-----PmPdSlab表 保存成功";
// if (pmPdPlateCutDOList.size() > 0) { }
// pmPdPlateCutRepository.batchInsertSelective(pmPdPlateCutDOList); if (pmPdPlateCutDOList.size() > 0) {
// System.out.println("PmPdPlateCut 大板粗切位置 保存成功"); pmPdPlateCutRepository.batchInsertSelective(pmPdPlateCutDOList);
// } System.out.println("PmPdPlateCut 大板粗切位置 保存成功");
// if (pmPdBlockPosDOList.size() > 0) { strSubLog += "-----PmPdPlateCut 大板粗切位置 保存成功";
// pmPdBlockPosRepository.batchInsertSelective(pmPdBlockPosDOList); }
// System.out.println("PmPdBlockPos 组合子板位置表 保存成功"); if (pmPdBlockPosDOList.size() > 0) {
// } pmPdBlockPosRepository.batchInsertSelective(pmPdBlockPosDOList);
// if (pmPdContSumDOList.size() > 0) { System.out.println("PmPdBlockPos 组合子板位置表 保存成功");
// pmPdContSumRepository.batchInsertSelective(pmPdContSumDOList); strSubLog += "-----PmPdBlockPos 组合子板位置表 保存成功";
// System.out.println("PmPdContSum 合同总量表 保存成功"); }
// } if (pmPdContSumDOList.size() > 0) {
// if (pmSmallPltPosDOList.size() > 0) { pmPdContSumRepository.batchInsertSelective(pmPdContSumDOList);
// pmSmallPltPosRepository.batchInsertSelective(pmSmallPltPosDOList); System.out.println("PmPdContSum 合同总量表 保存成功");
// System.out.println("PmSmallPltPos 命令小板位置表 保存成功"); strSubLog += "-----PmPdContSum 合同总量表 保存成功";
// } }
// if (pmCmdSlabDOList.size() > 0) { if (pmSmallPltPosDOList.size() > 0) {
// pmCmdSlabRepository.batchInsertSelective(pmCmdSlabDOList); pmSmallPltPosRepository.batchInsertSelective(pmSmallPltPosDOList);
// System.out.println("PmCmdSlab 保存成功"); System.out.println("PmSmallPltPos 命令小板位置表 保存成功");
// } strSubLog += "-----PmSmallPltPos 命令小板位置表 保存成功";
// if (pmCmdLargePltDOList.size() > 0) { }
// pmCmdLargePltRepository.batchInsertSelective(pmCmdLargePltDOList); if (pmCmdSlabDOList.size() > 0) {
// System.out.println("pmCmdLargePltDO 命令大板 保存成功"); pmCmdSlabRepository.batchInsertSelective(pmCmdSlabDOList);
// } System.out.println("PmCmdSlab 保存成功");
// if (pmCmdContDOList.size() > 0) { strSubLog += "-----PmCmdSlab 保存成功";
// pmCmdContRepository.batchInsertSelective(pmCmdContDOList); }
// System.out.println("PmCmdCont 命令参数 保存成功"); if (pmCmdLargePltDOList.size() > 0) {
// } pmCmdLargePltRepository.batchInsertSelective(pmCmdLargePltDOList);
// if (pmCmdSmallPltDOList.size() > 0) { System.out.println("pmCmdLargePltDO 命令大板 保存成功");
// pmCmdSmallPltRepository.batchInsertSelective(pmCmdSmallPltDOList); strSubLog += "-----pmCmdLargePltDO 命令大板 保存成功";
// System.out.println("PmCmdSmallPlt 命令小板表 保存成功"); }
// } if (pmCmdContDOList.size() > 0) {
// pmCmdContRepository.batchInsertSelective(pmCmdContDOList);
// // 调用mm接口 System.out.println("PmCmdCont 命令参数 保存成功");
// // 查询MM_SLAB 信息获取板坯信息 strSubLog += "-----PmCmdCont 命令参数 保存成功";
// PmPdSlabSplitDTO pmPdSlabSplitDTO = pmPdSlabRepository.selectMmSlabBySlabId(p.getSlabId(), p.getTenantId()); }
// // 查询板坯信息表。第一次查询可能无值 if (pmCmdSmallPltDOList.size() > 0) {
// PmPdSlabInfo pmPdSlabInfo = pmPdSlabInfoRepository.selectBySlabNo(p.getSlabNo(), p.getTenantId()); pmCmdSmallPltRepository.batchInsertSelective(pmCmdSmallPltDOList);
// System.out.println("PmCmdSmallPlt 命令小板表 保存成功");
// pmPdSlabInfo = buildPmPdSlabInfo(pmPdSlabSplitDTO, p.getSlabNo(), p.getMscLineNo(), p.getTenantId()); strSubLog += "-----PmCmdSmallPlt 命令小板表 保存成功";
// pmPdSlabInfoRepository.insertSelective(pmPdSlabInfo); }
// System.out.println("pmPdSlabInfo表 保存成功");
// // 调用mm接口
// // 轧钢模块“在制品材料管理封锁事件接口" // 查询MM_SLAB 信息获取板坯信息
// callMatStatusModify(pmPdSlabInfo); PmPdSlabSplitDTO pmPdSlabSplitDTO = pmPdSlabRepository.selectMmSlabBySlabId(p.getSlabId(), p.getTenantId());
// System.out.println("mm模块接口 调用成功"); // 查询板坯信息表。第一次查询可能无值
// System.out.println("程序执行完成!"); PmPdSlabInfo pmPdSlabInfo = pmPdSlabInfoRepository.selectBySlabNo(p.getSlabNo(), p.getTenantId());
//
// //抛合同 pmPdSlabInfo = buildPmPdSlabInfo(pmPdSlabSplitDTO, p.getSlabNo(), p.getMscLineNo(), p.getTenantId());
// zbCtEventRec(organizationId, pmPdSlabDOList, pmCmdLargePltDOList, pmCmdSlabDOList, pmSmallPltPosDOList); pmPdSlabInfoRepository.insertSelective(pmPdSlabInfo);
// System.out.println("抛合同事件完成"); System.out.println("pmPdSlabInfo表 保存成功");
strSubLog += "-----pmPdSlabInfo表 保存成功";
// 轧钢模块“在制品材料管理封锁事件接口"
callMatStatusModify(pmPdSlabInfo);
System.out.println("mm模块接口 调用成功");
strSubLog += "-----mm模块接口 调用成功";
//抛合同
zbCtEventRec(organizationId, pmPdSlabDOList, pmCmdLargePltDOList, pmCmdSlabDOList, pmSmallPltPosDOList);
System.out.println("抛合同事件完成");
System.out.println("程序执行完成!");
strSubLog += "-----抛合同事件完成 -----程序执行完成!";
return strSubLog;
// //

Loading…
Cancel
Save