From b64ed2c784bde6dea9d18149ca706ebe532c857d Mon Sep 17 00:00:00 2001 From: 懒羊羊 <15939171744@163.com> Date: 星期三, 13 三月 2024 08:37:51 +0800 Subject: [PATCH] 操作看板 --- jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java | 38 +++++++++++++++++++++++++++++++++++++- 1 files changed, 37 insertions(+), 1 deletions(-) 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 54b40a6..68dda81 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 @@ -1,13 +1,16 @@ package com.jcdm.main.da.paramCollection.service.impl; +import cn.hutool.core.date.DateUtil; import com.jcdm.common.utils.DateUtils; +import com.jcdm.main.da.collectionParamConf.domain.DaCollectionParamConf; +import com.jcdm.main.da.collectionParamConf.mapper.DaCollectionParamConfMapper; import com.jcdm.main.da.paramCollection.domain.DaParamCollection; import com.jcdm.main.da.paramCollection.mapper.DaParamCollectionMapper; import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.List; +import java.util.*; /** * 璁惧浜у搧杩囩▼鍙傛暟閲囬泦Service涓氬姟灞傚鐞� @@ -20,6 +23,9 @@ { @Autowired private DaParamCollectionMapper daParamCollectionMapper; + + @Autowired + private DaCollectionParamConfMapper daCollectionParamConfMapper; /** * 鏌ヨ璁惧浜у搧杩囩▼鍙傛暟閲囬泦 @@ -94,4 +100,34 @@ { return daParamCollectionMapper.deleteDaParamCollectionById(id); } + + @Override + public void addBasicParameters(DaParamCollection daParamCollection) { + // 鍋囪杩欐槸浠庢暟鎹簱鎴栧叾浠栧湴鏂硅幏鍙栫殑鍙傛暟鏁版嵁 + Map<String, String> map = new HashMap<>(); + map.put("GC", "鍗楁禂宸ュ巶"); + map.put("CXBH", "Pack绾�"); + map.put("SBBH", "璁惧001"); + map.put("YGBH", "鍛樺伐001"); + map.put("GDBH", daParamCollection.getWorkOrderNo()); + map.put("CPXH", daParamCollection.getModel()); + map.put("INT", DateUtil.formatDateTime(new Date())); + + map.forEach((key, value) -> { + DaCollectionParamConf daCollectionParamConf = new DaCollectionParamConf(); + daCollectionParamConf.setProcessesCode(daParamCollection.getLocationCode()); + daCollectionParamConf.setCollectParameterId(key); + List<DaCollectionParamConf> daCollectionParamConfs = daCollectionParamConfMapper.selectDaCollectionParamConfList(daCollectionParamConf); + + DaParamCollection saveData = new DaParamCollection(); + saveData.setWorkOrderNo(daParamCollection.getWorkOrderNo()); + saveData.setProductCode(daParamCollection.getProductCode()); + saveData.setLocationCode(daParamCollection.getLocationCode()); + saveData.setParamCode(daCollectionParamConfs.get(0).getCollectParameterId()); + saveData.setParamName(daCollectionParamConfs.get(0).getCollectParameterName()); + saveData.setCollectionTime(new Date()); + saveData.setParamValue(value); + daParamCollectionMapper.insertDaParamCollection(saveData); + }); + } } -- Gitblit v1.9.3