春风项目四线(合箱线、总装线)
wujian
2024-09-10 51b05b093fa15dd477981372f67ae7b3b2747733
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/service/impl/DaPassingStationCollectionServiceImpl.java
@@ -1,6 +1,7 @@
package com.jcdm.main.da.passingStationCollection.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson2.JSONObject;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.common.utils.StringUtils;
@@ -213,14 +214,28 @@
    @Override
    public void insertRepairRecordByIds(DaPassingStationCollection daPassingStationCollection) {
        Long[] conditions = daPassingStationCollection.getIds();
        String sfcCode = "";
        List<RmRepairRecord> save = new ArrayList<>();
        for (int i = 0; i < conditions.length; i++) {
            DaPassingStationCollection result = daPassingStationCollectionMapper.selectDaPassingStationCollectionById(conditions[i]);
            RmRepairRecord rmRepairRecord = new RmRepairRecord();
            rmRepairRecord.setBoxCode(result.getSfcCode());
            rmRepairRecord.setProcessesCode(result.getLocationCode());
            rmRepairRecord.setOriginalResult(result.getOutRsSign());
            rmRepairRecordMapper.insertRmRepairRecord(rmRepairRecord);
            if (i==0){
                if (ObjectUtil.isNotEmpty(result)){
                    sfcCode = result.getSfcCode();
                    rmRepairRecordMapper.deleteRmRepairRecordByCode(sfcCode);
                }
            }
            if (ObjectUtil.isNotEmpty(result)){
                RmRepairRecord rmRepairRecord = new RmRepairRecord();
                rmRepairRecord.setBoxCode(result.getSfcCode());
                rmRepairRecord.setProcessesCode(result.getLocationCode());
                rmRepairRecord.setOriginalResult(result.getOutRsSign());
                rmRepairRecord.setCreateTime(new Date());
                rmRepairRecordMapper.insertRmRepairRecord(rmRepairRecord);
                daPassingStationCollectionMapper.deleteDaPassingStationCollectionById(result.getId());
            }
        }
    }
    @Override
    public String SelectSN(String SNcode,String node) {