春风项目四线(合箱线、总装线)
wujian
2024-04-28 9bc5106810d7c0e6f27e904b584c9bbfb3725a19
提交 | 用户 | 时间
3e03af 1 package com.jcdm.main.plcserver.sub;
C 2
3
9e6d86 4 import cn.hutool.core.collection.CollUtil;
W 5 import cn.hutool.core.util.ObjectUtil;
6 import cn.hutool.core.util.StrUtil;
7 import com.jcdm.main.bs.domain.BsTechnologyRouteChildInfo;
8 import com.jcdm.main.bs.orderScheduling.domain.BsOrderScheduling;
9 import com.jcdm.main.bs.orderScheduling.service.IBsOrderSchedulingService;
10 import com.jcdm.main.bs.technologyRouteChild.service.IBsTechnologyRouteChildInfoService;
3e03af 11 import com.jcdm.main.da.collectionParamConf.domain.DaCollectionParamConf;
C 12 import com.jcdm.main.da.collectionParamConf.service.IDaCollectionParamConfService;
059083 13 import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig;
3e03af 14 import com.jcdm.main.da.paramCollection.domain.DaParamCollection;
C 15 import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService;
059083 16 import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection;
W 17 import com.jcdm.main.da.passingStationCollection.service.impl.DaPassingStationCollectionServiceImpl;
3e03af 18 import com.jcdm.main.plcserver.conf.OPCElement;
9e6d86 19 import com.jcdm.main.rm.repairRecord.domain.RmRepairRecord;
W 20 import com.jcdm.main.rm.repairRecord.service.IRmRepairRecordService;
3e03af 21 import com.kangaroohy.milo.model.ReadWriteEntity;
C 22 import com.kangaroohy.milo.runner.subscription.SubscriptionCallback;
23 import com.kangaroohy.milo.service.MiloService;
059083 24 import lombok.extern.slf4j.Slf4j;
3e03af 25 import org.springframework.stereotype.Component;
C 26
9f6314 27 import java.math.BigDecimal;
c76a3f 28 import java.sql.Time;
9e6d86 29 import java.time.LocalDateTime;
c76a3f 30 import java.util.*;
W 31 import java.util.concurrent.TimeUnit;
3e03af 32 import java.util.stream.Collectors;
C 33
34
059083 35 @Slf4j
3e03af 36 @Component
C 37 public class OPCUaSubscription implements SubscriptionCallback {
38
39     public static MiloService miloService;
40
41     public IDaCollectionParamConfService collectionParamConfService;
42
43     public IDaParamCollectionService daParamCollectionService;
44
059083 45     public DaPassingStationCollectionServiceImpl passingStationCollectionServiceImpl;
W 46
47     public List<DaOpcuaConfig> lists;
48
49     public static final HashMap<String,Integer> map = new HashMap<>();
50
9e6d86 51     public IBsOrderSchedulingService bsOrderSchedulingService;
W 52
53     public IRmRepairRecordService rmRepairRecordService;
54
55     public IBsTechnologyRouteChildInfoService bsTechnologyRouteChildInfoService;
56
c76a3f 57     public HashMap<String,List<DaCollectionParamConf>> allCollectParamList = new HashMap<>();
W 58
3e03af 59     public OPCUaSubscription(MiloService miloService,
C 60                              IDaCollectionParamConfService collectionParamConfService,
059083 61                              IDaParamCollectionService daParamCollectionService,
W 62                              DaPassingStationCollectionServiceImpl passingStationCollectionServiceImpl,
9e6d86 63                              IBsOrderSchedulingService bsOrderSchedulingService,
W 64                              List<DaOpcuaConfig> lists,
65                              IRmRepairRecordService rmRepairRecordService,
66                              IBsTechnologyRouteChildInfoService bsTechnologyRouteChildInfoService) {
3e03af 67         OPCUaSubscription.miloService = miloService;
C 68         this.collectionParamConfService = collectionParamConfService;
69         this.daParamCollectionService = daParamCollectionService;
059083 70         this.passingStationCollectionServiceImpl = passingStationCollectionServiceImpl;
9e6d86 71         this.bsOrderSchedulingService = bsOrderSchedulingService;
059083 72         this.lists = lists;
9e6d86 73         this.rmRepairRecordService = rmRepairRecordService;
W 74         this.bsTechnologyRouteChildInfoService = bsTechnologyRouteChildInfoService;
c76a3f 75
W 76
3e03af 77     }
C 78     @Override
79     public void onSubscribe(String identifier, Object value) {
80         String ecpStr = "";//异常记录标记
81         try {
9e6d86 82             if(null != value && "1".equals(value.toString())) {
c76a3f 83 //                if (OPCElement.OP121_ZZ_CODE_CHECK.equals(identifier)){
W 84 //                    rework("2V91Y RD25D080",identifier);
85 //                }
059083 86                 //1、检索SN号
W 87                 //2、过站参数采集
88                 //3、扫码枪数据回传
89                 List<String> collect1 = lists.stream().filter(x -> OPCElement.SN_CHECK.equals(x.getrFunction()))
90                         .map(DaOpcuaConfig::getNode).collect(Collectors.toList());
91                 List<String> collect2 = lists.stream().filter(x -> OPCElement.SAVE_DATA.equals(x.getrFunction()))
92                         .map(DaOpcuaConfig::getNode).collect(Collectors.toList());
93                 if (collect1.contains(identifier)){
c76a3f 94                     log.info("-------监听到,{}的CODE_CHECK的信号",identifier);
W 95                     log.info("-------time--------------,{}",LocalDateTime.now());
059083 96                     //sn
W 97                     this.SNRetrieval(identifier,value.toString());
98                     if (identifier.equals(OPCElement.OP120_ZZ_CODE_CHECK) && "1".equals(value.toString())){
99                         //总装上线扫码传输数据
100                         log.info("-------监听到,{}的扫码枪扫码的CODE_CHECK的信号",identifier);
9e6d86 101                         scannerGunMessage();
W 102                     }
103                 }
104                 if (collect2.contains(identifier)){
105                     if ("1".equals(value.toString())){
c76a3f 106                         log.info("-------监听到,{}的SAVE_REQUEST_LAST的信号",identifier);
W 107                         log.info("-------time--------------,{}",LocalDateTime.now());
9e6d86 108                         //save
W 109                         this.SaveData(identifier);
c76a3f 110
059083 111                     }
W 112                 }
113
3e03af 114             }
C 115         } catch (Exception e) {
9e6d86 116             System.out.println(e.getMessage());
3e03af 117         } finally {
C 118             if (!"".equals(ecpStr)) {
119                 System.out.println(ecpStr + "\r\n");
120             }
9e6d86 121         }
W 122     }
123
124     private void scannerGunMessage() throws Exception {
125         String[] parts = OPCElement.OP120_ZZ_CODE_CHECK.split("[.]");
126         Object SNCodeObject = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".Code1").getValue();
3946f8 127         if (null == SNCodeObject){
W 128             SNCodeObject = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".Code").getValue();
129         }
9e6d86 130         if (null != SNCodeObject){
W 131             String SNCode = SNCodeObject.toString();
132             passingStationCollectionServiceImpl.sendMessage(SNCode);
3e03af 133         }
C 134     }
135
059083 136     public void SNRetrieval(String Node, String value) throws Exception {
W 137         String[] parts = Node.split("[.]");
138         if(value.equals("1")) {
139             //SN号检索
140             Object SNCodeObject = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".Code").getValue();
141             if(null != SNCodeObject) {
142                 String SNCode=SNCodeObject.toString();
929bdc 143 //                String a=passingStationCollectionServiceImpl.SelectSN(SNCode,parts[1]);
W 144                 String a;
145                 BsOrderScheduling bsOrderSchedulingQuery = new BsOrderScheduling();
146                 bsOrderSchedulingQuery.setEngineNo(SNCode);
147                 List<BsOrderScheduling> queryOrderList = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderSchedulingQuery);
148                 if (CollUtil.isNotEmpty(queryOrderList)){
149                     a = "1";
150                 }else {
0e3cac 151                     a = "4";
929bdc 152                 }
W 153                 //如果是返修工位需要传输返修工位号
0e3cac 154                 List<DaPassingStationCollection> daPassingStationCollections = new ArrayList<>();
W 155                 List<RmRepairRecord> rmRepairRecords = new ArrayList<>();
929bdc 156                 if (OPCElement.OP465_ZZ_CODE_CHECK.equals(Node) || OPCElement.OP355_ZZ_CODE_CHECK.equals(Node)
W 157                         || OPCElement.OP695_ZZ_CODE_CHECK.equals(Node) || OPCElement.OP755_ZZ_CODE_CHECK.equals(Node)){
158                     //过站记录
159                     DaPassingStationCollection PassingStationCollection=new DaPassingStationCollection();
160                     PassingStationCollection.setSfcCode(SNCode);
0e3cac 161                     daPassingStationCollections = passingStationCollectionServiceImpl.selectDaPassingStationCollectionList(PassingStationCollection);
929bdc 162                     if (CollUtil.isNotEmpty(daPassingStationCollections)){
W 163                         DaPassingStationCollection lastOne = daPassingStationCollections.get(daPassingStationCollections.size() - 1);
164                         String outRsSign = lastOne.getOutRsSign();
165                         if ("合格".equals(outRsSign)){
166                             a = "1";
167                         }else {
168                             a = "2";
169                         }
170                     }
0e3cac 171                     RmRepairRecord rmRepairRecord = new RmRepairRecord();
W 172                     rmRepairRecord.setBoxCode(SNCode);
173                     rmRepairRecords = rmRepairRecordService.selectRmRepairRecordList(rmRepairRecord);
174                     if (CollUtil.isNotEmpty(rmRepairRecords)){
175                         a = "1";
176                     }
177
929bdc 178                 }
c76a3f 179                 log.info("-----返回codeCheckFeed-----,{}",a);
3946f8 180 //                String a="1";
059083 181                 // 1:OK可生产 2:NG不可生产 3:NG可返工 4:PC检索失败(无记录)5:PC检索失败(软件)
9e6d86 182                 if (StrUtil.isNotBlank(a)){
W 183                     int input = Integer.parseInt(a);
184                     ReadWriteEntity entity = new ReadWriteEntity(parts[0]+"."+parts[1]+".CodeCheckFeed", input);
185                     log.info("-------监听到,{}的CodeCheck的信号",Node);
cffac1 186                     miloService.writeToOpcByte(entity);
W 187                     log.info("监听到返回codecheckfeed信号,{}",entity);
9e6d86 188                     //首站传输订单号
W 189                     if (OPCElement.OP050_HX_CODE_CHECK.equals(Node)){
190                         //查询订单号
191                         BsOrderScheduling bsOrderScheduling = new BsOrderScheduling();
192                         bsOrderScheduling.setEngineNo(SNCode);
193                         List<BsOrderScheduling> tempList = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling);
194                         String orderNum = "";
195                         if (CollUtil.isNotEmpty(tempList)){
196                             BsOrderScheduling bsOrderScheduling1 = tempList.get(0);
197                             orderNum = bsOrderScheduling1.getOrderNo();
198                         }
199
200                         ReadWriteEntity entity2 = new ReadWriteEntity(parts[0]+"."+parts[1]+".OrderNumber", orderNum);
2b59de 201                         miloService.writeToOpcUa(entity2);
9e6d86 202                     }
W 203                     //如果是返修工位需要传输返修工位号
3946f8 204                     if (OPCElement.OP465_ZZ_CODE_CHECK.equals(Node) || OPCElement.OP355_ZZ_CODE_CHECK.equals(Node)
W 205                     || OPCElement.OP695_ZZ_CODE_CHECK.equals(Node) || OPCElement.OP755_ZZ_CODE_CHECK.equals(Node)){
929bdc 206
0e3cac 207                         rework(SNCode,Node,daPassingStationCollections,rmRepairRecords);
9e6d86 208                     }
3946f8 209                     System.out.println(entity);
cffac1 210
9e6d86 211                 }
W 212
059083 213             }
9e6d86 214         }
W 215     }
216
0e3cac 217     private void rework(String SNCode,String Node,List<DaPassingStationCollection> daPassingStationCollections,List<RmRepairRecord> rmRepairRecords)  throws Exception{
9e6d86 218         BsOrderScheduling bsOrderScheduling = new BsOrderScheduling();
W 219         bsOrderScheduling.setEngineNo(SNCode);
220         List<String> allProcessCoed = new ArrayList<>();
929bdc 221         List<BsTechnologyRouteChildInfo> bsTechnologyRouteChildInfos = new ArrayList<>();
9e6d86 222         List<String> collect = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling).stream().map(BsOrderScheduling::getModel).collect(Collectors.toList());
W 223         if (CollUtil.isNotEmpty(collect)){
224             String s = collect.get(0);
225             //查找次机型的完整工序
929bdc 226             bsTechnologyRouteChildInfos = bsTechnologyRouteChildInfoService.selectAllTechnologyRouteByProductCode(s);
9e6d86 227             if (CollUtil.isNotEmpty(bsTechnologyRouteChildInfos)){
W 228                 allProcessCoed = bsTechnologyRouteChildInfos.stream().map(BsTechnologyRouteChildInfo::getProcessesCode).collect(Collectors.toList());
229             }
230         }
0e3cac 231 //        RmRepairRecord rmRepairRecord = new RmRepairRecord();
W 232 //        rmRepairRecord.setBoxCode(SNCode);
9e6d86 233         List<ReadWriteEntity> writeList = new ArrayList<>();
0e3cac 234 //        List<RmRepairRecord> rmRepairRecords = rmRepairRecordService.selectRmRepairRecordList(rmRepairRecord);
3946f8 235         //过站记录
0e3cac 236 //        DaPassingStationCollection PassingStationCollection=new DaPassingStationCollection();
W 237 //        PassingStationCollection.setSfcCode(SNCode);
3946f8 238         //过站记录
0e3cac 239 //        List<DaPassingStationCollection> daPassingStationCollections = passingStationCollectionServiceImpl.selectDaPassingStationCollectionList(PassingStationCollection);
3946f8 240
9e6d86 241         //所有反工工位
W 242         List<String> collect1 = rmRepairRecords.stream().map(RmRepairRecord::getProcessesCode).collect(Collectors.toList());
3946f8 243         if (CollUtil.isNotEmpty(collect1)){
929bdc 244             //查询出所有需要返修工位的最小op块
W 245             Integer minOP = 0;
246             if (CollUtil.isNotEmpty(collect1)){
3946f8 247
929bdc 248                 List<Integer> sortList = new ArrayList<>();
W 249                 collect1.stream().forEach(x ->{
250                     String op = x.replace("OP", "");
251                     if (StrUtil.isNotBlank(op)){
252                         int i = Integer.parseInt(op);
253                         sortList.add(i);
254                     }
255                 });
256                 if (CollUtil.isNotEmpty(sortList)){
257                     List<Integer> collect2 = sortList.stream().filter(Objects::nonNull).sorted().collect(Collectors.toList());
258                     minOP = collect2.get(0);
3946f8 259                 }
W 260             }
929bdc 261             //获取过站记录的最大工位
W 262             String maxCode = null;
263             if (CollUtil.isNotEmpty(daPassingStationCollections)){
9bc510 264                 List<DaPassingStationCollection> collect2 = daPassingStationCollections.stream().filter(x -> "不合格".equals(x.getOutRsSign())).collect(Collectors.toList());
W 265                 if (CollUtil.isNotEmpty(collect2)){
266                     DaPassingStationCollection lastOne = collect2.get(collect2.size() - 1);
267                     maxCode = lastOne.getLocationCode();
268                 }else {
269                     DaPassingStationCollection lastOne = daPassingStationCollections.get(daPassingStationCollections.size() - 1);
270                     maxCode = lastOne.getLocationCode();
271                 }
272
28860f 273             }
W 274
275
929bdc 276             //所有放行工位
W 277             List<String> passStation = new ArrayList<>();
278             //所有生产工位
279             List<String> productStation = new ArrayList<>();
280             //最大工位编号
281             Integer maxCodeNum = 0;
282             if (StrUtil.isNotEmpty(maxCode)){
283                 String finalMaxCode = maxCode;
284                 //获取当前工位对应工步号
285                 List<String> collect2 = bsTechnologyRouteChildInfos.stream()
286                         .filter(x -> x.getProcessesCode().equals(finalMaxCode))
287                         .map(BsTechnologyRouteChildInfo::getStepNo).collect(Collectors.toList());
288                 if (CollUtil.isNotEmpty(collect2)){
289                     String s = collect2.get(0);
290                     if (StrUtil.isNotBlank(s)){
291                         maxCodeNum = Integer.parseInt(s);
292                     }
293                 }
294                 if (CollUtil.isNotEmpty(bsTechnologyRouteChildInfos)){
295                     bsTechnologyRouteChildInfos.forEach(x -> {
296                         x.setStepNoNum(Integer.parseInt(x.getStepNo()));
297                     });
298                     Integer finalMaxCodeNum = maxCodeNum;
299                     //勾选的返修工位中最大的工位之后的工位----1
300                     List<BsTechnologyRouteChildInfo> collect3 = bsTechnologyRouteChildInfos.stream()
301                             .filter(x -> x.getStepNoNum() >= finalMaxCodeNum).collect(Collectors.toList());
302                     if (CollUtil.isNotEmpty(collect3)){
303                         //需要生产
304                         productStation.addAll(collect3.stream().map(BsTechnologyRouteChildInfo::getProcessesCode).collect(Collectors.toList()));
305                     }
306                     //从第一个工位到返修的最大工位之间,
307                     //勾选了返修标记的需要生产---1,未勾选的不生产---2
308                     productStation.addAll(collect1);
309                 }
310             }
311             if (CollUtil.isNotEmpty(productStation)){
312                 List<String> collect2 = allProcessCoed.stream().filter(x -> !productStation.contains(x)).collect(Collectors.toList());
313                 passStation.addAll(collect2);
314             }
315             String[] parts = Node.split("[.]");
316             String par = parts[0]+"."+parts[1];
317             if (CollUtil.isNotEmpty(passStation)){
318                 passStation.forEach(x -> {
319                     ReadWriteEntity readWriteEntity = new ReadWriteEntity();
320                     readWriteEntity.setIdentifier(par+"."+x);
321                     readWriteEntity.setValue(2);
322                     writeList.add(readWriteEntity);
323                 });
324             }
325             if (CollUtil.isNotEmpty(productStation)){
326                 productStation.forEach(x -> {
327                     ReadWriteEntity readWriteEntity = new ReadWriteEntity();
328                     readWriteEntity.setIdentifier(par+"."+x);
329                     readWriteEntity.setValue(1);
330                     writeList.add(readWriteEntity);
331                 });
332             }
333             ReadWriteEntity readWriteEntity = new ReadWriteEntity();
334             readWriteEntity.setIdentifier(parts[0]+"."+parts[1]+".Repair_sign");
335             readWriteEntity.setValue(minOP);
336             miloService.writeToOpcShort(readWriteEntity);
337             miloService.writeToOpcByte(writeList);
338             log.info("返修写入:,{}",writeList);
339         }
340
059083 341     }
W 342
343
3e03af 344     public void SaveData(String Node) throws Exception {
28860f 345
059083 346         String[] parts = Node.split("[.]");
3e03af 347         Object SNCodeObject = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".Code1").getValue();
3946f8 348         if (null == SNCodeObject){
W 349             SNCodeObject = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".Code").getValue();
350         }
3e03af 351         if(null != SNCodeObject)
C 352         {
353             String SNCode = SNCodeObject.toString();
c76a3f 354             Object object = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".Runtime").getValue();
W 355             String gatherAddress = parts[0] + "." + parts[1];
356             List<DaCollectionParamConf> list = new ArrayList<>();
357             if (allCollectParamList.containsKey(gatherAddress)){
358                 list = allCollectParamList.get(gatherAddress);
359             }else {
360                 DaCollectionParamConf daCollectionParamConf = new DaCollectionParamConf();
361                 daCollectionParamConf.setGatherAddress(gatherAddress);
362                 daCollectionParamConf.setRemarks("1");
363                 list = collectionParamConfService.selectDaCollectionParamConfList(daCollectionParamConf);
364                 if (CollUtil.isNotEmpty(list)){
365                     //加入hashmap
366                     allCollectParamList.put(gatherAddress,list);
367                 }
368             }
3e03af 369
C 370             List<String> nodeIdList = list.stream().map(info -> {
371                 String nodeid = info.getGatherAddress();
372                 return nodeid;
373             }).collect(Collectors.toList());
374
f4cb4d 375             List<ReadWriteEntity> readWriteEntityList = new ArrayList<>();
W 376             if(CollUtil.isNotEmpty(nodeIdList)){
c76a3f 377                 long time1 = new Date().getTime();
f4cb4d 378                 readWriteEntityList = miloService.readFromOpcUa(nodeIdList);
c76a3f 379                 long time2 = new Date().getTime();
W 380                 log.info("读取点位花费时间:{},",time2-time1);
f4cb4d 381             }
c76a3f 382                 //返回plc保存成功
W 383                 if (parts.length==3){
384                     if ("SaveRequest".equals(parts[2])){
385                         ReadWriteEntity entity = new ReadWriteEntity(parts[0] + "." + parts[1] + ".SaveFeed", 1);
386                                 miloService.writeToOpcByte(entity);
387                     }else if ("SaveRequestLast".equals(parts[2])){
388                         ReadWriteEntity entity = new ReadWriteEntity(parts[0] + "." + parts[1] + ".SaveFeedLast", 1);
389                                 miloService.writeToOpcByte(entity);
390                     }
391                     log.info("-------请求返回,{}的SaveFeedLast的信号",Node);
392                     log.info("-------请求返回-----,{}",LocalDateTime.now());
393                 }
3e03af 394                 List<DaParamCollection> daParamCollectionlist = new ArrayList<>();
f4cb4d 395                 if (CollUtil.isNotEmpty(nodeIdList)){
W 396                     for(int i=0;i<nodeIdList.size();i++){
127f1b 397                         if(ObjectUtil.isNotEmpty(readWriteEntityList.get(i).getValue()) && !readWriteEntityList.get(i).getValue().toString().equals("0.0")){
f4cb4d 398                             DaParamCollection ParamCollection = new DaParamCollection();
W 399                             ParamCollection.setParamCode(readWriteEntityList.get(i).getIdentifier().toString().split("[.]")[2]);
400                             ParamCollection.setLocationCode(parts[1]);
401                             if (readWriteEntityList.get(i) == null){
402                                 ParamCollection.setParamValue("0");
403                             }else {
404                                 ParamCollection.setParamValue(readWriteEntityList.get(i).getValue().toString());
405                             }
406                             ParamCollection.setSfcCode(SNCode);
407                             ParamCollection.setParamName(list.get(i).getCollectParameterName());
408                             ParamCollection.setParamUpper(list.get(i).getParamUpper());
409                             ParamCollection.setParamLower(list.get(i).getParamLower());
410                             ParamCollection.setUnit(list.get(i).getCollectParameterUnit());
411                             ParamCollection.setState("合格");
412                             ParamCollection.setType(list.get(i).getCollectParameterType());
413                             ParamCollection.setCollectionTime(new Date());
414                             daParamCollectionlist.add(ParamCollection);
c6aaad 415                         }
3e03af 416                     }
f4cb4d 417                     daParamCollectionService.saveBeachDaParamCollection(daParamCollectionlist);
W 418                     log.info("-------保存数据完成---------");
3e03af 419                 }
f4cb4d 420
W 421
9e6d86 422
c76a3f 423
9e6d86 424             Long beatTime = 0L;
W 425             if (ObjectUtil.isNotEmpty(object)){
9f6314 426                 String str = object.toString();
W 427                 beatTime = Float.valueOf(str).longValue();
9e6d86 428             }
127f1b 429             Object ProductStatus = miloService.readFromOpcUa(parts[0] + "." + parts[1] + ".ProductStatus").getValue();
Y 430             log.info("ProductStatus,{}",ProductStatus.toString());
431             String str1="合格" ;
432             if (ObjectUtil.isNotEmpty(ProductStatus)){
433                 String productStatusString = ProductStatus.toString();
434                 if (productStatusString.contains("2") || productStatusString.contains("3")){
435                     str1="不合格";
436                 }else {
437                     str1="合格";
438                 }
439             }
9e6d86 440             DaPassingStationCollection PassingStationCollection=new DaPassingStationCollection();
W 441             PassingStationCollection.setSfcCode(SNCode);
442             PassingStationCollection.setLocationCode(parts[1]);
443             PassingStationCollection.setOutboundTime(new Date());
444             PassingStationCollection.setInboundTime(new Date(new Date().getTime()-beatTime*1000));
445             PassingStationCollection.setCollectionTime(new Date());
446             PassingStationCollection.setCreateTime(new Date());
447             PassingStationCollection.setBeatTime(beatTime.toString());
127f1b 448             PassingStationCollection.setOutRsSign(str1);
9e6d86 449             passingStationCollectionServiceImpl.insertDaPassingStationCollection(PassingStationCollection);
c76a3f 450             log.info("-------保存过站记录数据完成---------");
W 451
059083 452         }
3e03af 453     }
C 454 }