From 7bee802c37d290a38be32012d84a3e5bc8b4ea92 Mon Sep 17 00:00:00 2001 From: 懒羊羊 <15939171744@163.com> Date: 星期二, 09 四月 2024 08:50:46 +0800 Subject: [PATCH] - --- jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/domain/OmProductionOrdeInfoExcelImport.java | 38 +++++++++++++++++++ jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java | 14 ++++++ jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java | 21 ++++++++++ 3 files changed, 71 insertions(+), 2 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java index 1023a88..7f64c48 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java +++ b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java @@ -3,7 +3,10 @@ import java.util.Date; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jcdm.common.core.domain.AjaxResult; import com.jcdm.common.utils.DateUtils; @@ -184,9 +187,18 @@ @Override public AjaxResult updateTighteningFormula(BsFormulaChildInfo bsFormulaChildInfo) { + BsFormulaChildInfo getMaterTwo = new BsFormulaChildInfo(); + getMaterTwo.setProcessesCode(bsFormulaChildInfo.getLocationCode()); + getMaterTwo.setOperationType("2"); + List<BsFormulaChildInfo> operationType = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(getMaterTwo); + List<String> collect = operationType.stream().map(BsFormulaChildInfo::getResults).collect(Collectors.toList()); + for (String s : collect) { + if(s.equals("")){ + return AjaxResult.error("鎵弿鏈畬鎴愶紝绂佹鎷х揣鎿嶄綔锛�"); + } + } BsFormulaChildInfo listQuery = new BsFormulaChildInfo(); listQuery.setParamCode(bsFormulaChildInfo.getParamCode()); - listQuery.setOperationType("1"); String paramCode = bsFormulaChildInfo.getTightenTheArray(); if(paramCode.contains("N")){ List<BsFormulaChildInfo> bsFormulaChildInfos = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(listQuery); diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java index 99c3ce0..3652b6a 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java +++ b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java @@ -2,10 +2,14 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.db.Db; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jcdm.common.utils.DateUtils; +import com.jcdm.main.bs.formula.service.IBsFormulaInfoService; +import com.jcdm.main.bs.formula.service.impl.BsFormulaInfoServiceImpl; import com.jcdm.main.bs.formulaChild.domain.BsFormulaChildInfo; import com.jcdm.main.bs.formulaChild.mapper.BsFormulaChildInfoMapper; +import com.jcdm.main.bs.formulaChild.service.IBsFormulaChildInfoService; import com.jcdm.main.da.collectionParamConf.domain.DaCollectionParamConf; import com.jcdm.main.da.collectionParamConf.mapper.DaCollectionParamConfMapper; import com.jcdm.main.da.paramCollection.domain.DaParamCollection; @@ -43,6 +47,9 @@ @Autowired private BsFormulaChildInfoMapper bsFormulaChildInfoMapper; + + @Autowired + private IBsFormulaChildInfoService bsFormulaChildInfoService; @Autowired private MiloService miloService; @@ -196,6 +203,18 @@ @Override public void saveCampaignTimeParameters(DaParamCollection daParamCollection) { + List<BsFormulaChildInfo> list = bsFormulaChildInfoService.list(new LambdaQueryWrapper<BsFormulaChildInfo>() + .eq(BsFormulaChildInfo::getProcessesCode, daParamCollection.getLocationCode()) + .eq(BsFormulaChildInfo::getSpareField4, "1") + ); + if(!list.get(0).getResults().equals("OK")){ + try { + miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+daParamCollection.getLocationCode()+".RecordDataDone").value(22).build()); + } catch (Exception e) { + throw new RuntimeException(e); + } + return; + } BsFormulaChildInfo bsFormulaChildInfo = new BsFormulaChildInfo(); bsFormulaChildInfo.setProcessesCode(daParamCollection.getLocationCode()); bsFormulaChildInfo.setProductCode(daParamCollection.getProductCode()); @@ -231,7 +250,7 @@ // OPCUaSubscription.SaveParamData(daParamCollection.getProductBarcode(),"OP",daParamCollection.getLocationCode(),daParamCollection.getWorkOrderNo(),daParamCollection.getProductCode()); //缁檕pc鍙�21 - miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("OP."+daParamCollection.getLocationCode()+".RecordDataDone").value(21).build()); + miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+daParamCollection.getLocationCode()+".RecordDataDone").value(21).build()); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/domain/OmProductionOrdeInfoExcelImport.java b/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/domain/OmProductionOrdeInfoExcelImport.java new file mode 100644 index 0000000..9761ca8 --- /dev/null +++ b/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/domain/OmProductionOrdeInfoExcelImport.java @@ -0,0 +1,38 @@ +package com.jcdm.main.om.productionOrde.domain; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.jcdm.common.annotation.Excel; +import com.jcdm.common.core.domain.BaseEntity; +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.Date; + +/** + * 鐢熶骇宸ュ崟瀵硅薄 om_production_orde_info + * + * @author ruimin + * @date 2023-12-11 + */ +@Data +public class OmProductionOrdeInfoExcelImport extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 鐢熶骇宸ュ崟鍙� */ + @Excel(name = "鐢熶骇璁㈠崟鍙�") + private String workOrderNo; + + @Excel(name = "宸ョ珯缂栧彿") + private String stationCode; + + @Excel(name = "浜у搧搴忓垪鍙�") + private String productNum; + + /** 浜у搧缂栧彿 */ + @Excel(name = "浜у搧缂栧彿") + private String productCode; + +} -- Gitblit v1.9.3