From dd44823b3c6cc003de21ea023cea7ea8d85a873c Mon Sep 17 00:00:00 2001 From: yyt <306727702@qq.com> Date: 星期三, 26 六月 2024 12:56:17 +0800 Subject: [PATCH] 配瓦 --- jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/service/IDaTileMatchCollectionService.java | 61 +++ jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/controller/BsOrderSchedulingController.java | 14 jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/controller/DaOpcuaConfigController.java | 13 jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/controller/DaTileMatchCollectionController.java | 104 ++++++ jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/service/impl/DaTileMatchCollectionServiceImpl.java | 95 +++++ jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/domain/DaTileMatchCollection.java | 123 +++++++ jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/controller/DaTileMatchRulesController.java | 17 jcdm-ui/src/views/main/da/tileMatchCollection/index.vue | 338 +++++++++++++++++++ jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/mapper/DaTileMatchCollectionMapper.java | 61 +++ jcdm-ui/src/api/main/da/tileMatchCollection/tileMatchCollection.js | 44 ++ jcdm-main/src/main/resources/mapper/da/tileMatchCollection/DaTileMatchCollectionMapper.xml | 86 +++++ jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java | 52 +- 12 files changed, 980 insertions(+), 28 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/controller/BsOrderSchedulingController.java b/jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/controller/BsOrderSchedulingController.java index e20f269..19369d9 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/controller/BsOrderSchedulingController.java +++ b/jcdm-main/src/main/java/com/jcdm/main/bs/orderScheduling/controller/BsOrderSchedulingController.java @@ -25,6 +25,8 @@ import com.jcdm.main.da.paramCollection.mapper.DaParamCollectionMapper; import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService; import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection; +import com.jcdm.main.da.tileMatchCollection.domain.DaTileMatchCollection; +import com.jcdm.main.da.tileMatchCollection.service.IDaTileMatchCollectionService; import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo; import com.jcdm.main.om.productionOrde.service.impl.OmProductionOrdeInfoServiceImpl; import com.jcdm.main.plcserver.conf.OPCElement; @@ -67,6 +69,8 @@ private OmProductionOrdeInfoServiceImpl productionOrdeInfoService; @Resource private DaParamCollectionMapper daParamCollectionService; + @Resource + private IDaTileMatchCollectionService daTileMatchCollectionService; @Autowired MiloService miloService; @@ -343,9 +347,17 @@ saveData.setParamValue(engineNo); saveData.setLocationCode("OP010"); saveData.setParamCode("XTM"); - saveData.setParamName("绠变綋鐮�"); + saveData.setParamName("绠变綋"); daParamCollectionService.insertDaParamCollection(saveData); + DaTileMatchCollection MatchCollection = new DaTileMatchCollection(); + MatchCollection.setSfcCode(OrderScheduling.getEngineNo()); + MatchCollection.setParamValue(engineNo); + MatchCollection.setLocationCode("OP010"); + MatchCollection.setParamCode("XTM"); + MatchCollection.setParamName("绠变綋"); + daTileMatchCollectionService.insertDaTileMatchCollection(MatchCollection); + //鏇存柊涓婄嚎鏁伴噺 int onlineNum = 0; List<BsOrderScheduling> onlineNumList = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling) diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/controller/DaOpcuaConfigController.java b/jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/controller/DaOpcuaConfigController.java index 8578039..6c300bd 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/controller/DaOpcuaConfigController.java +++ b/jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/controller/DaOpcuaConfigController.java @@ -2,6 +2,7 @@ import java.util.List; import java.util.stream.Collectors; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import cn.hutool.core.collection.CollUtil; @@ -11,6 +12,8 @@ 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 com.jcdm.main.da.tileMatchCollection.domain.DaTileMatchCollection; +import com.jcdm.main.da.tileMatchCollection.service.IDaTileMatchCollectionService; import com.jcdm.main.da.tileMatchMiddleware.domain.DaTileMatchMiddleware; import com.jcdm.main.da.tileMatchMiddleware.service.IDaTileMatchMiddlewareService; import com.jcdm.main.da.tileMatchRules.domain.DaTileMatchRules; @@ -54,6 +57,8 @@ private IDaTileMatchRulesService daTileMatchRulesService; @Autowired private IDaTileMatchMiddlewareService daTileMatchMiddlewareService; + @Resource + private IDaTileMatchCollectionService daTileMatchCollectionService; /** * 鏌ヨ浜や簰淇″彿閰嶇疆鍒楄〃 @@ -163,6 +168,14 @@ saveData.setParamName("鏇茶酱"); daParamCollectionService.insertDaParamCollection(saveData); + DaTileMatchCollection MatchCollection = new DaTileMatchCollection(); + MatchCollection.setSfcCode(SNCode); + MatchCollection.setParamValue(barcode); + MatchCollection.setLocationCode(locationCode); + MatchCollection.setParamCode("CZM"); + MatchCollection.setParamName("鏇茶酱"); + daTileMatchCollectionService.insertDaTileMatchCollection(MatchCollection); + DaTileMatchRules TileMatchRules = new DaTileMatchRules(); TileMatchRules.setProductSeries("380Y"); TileMatchRules.setScanObject1("杩炴潌"); diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/controller/DaTileMatchCollectionController.java b/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/controller/DaTileMatchCollectionController.java new file mode 100644 index 0000000..307ce80 --- /dev/null +++ b/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/controller/DaTileMatchCollectionController.java @@ -0,0 +1,104 @@ +package com.jcdm.main.da.tileMatchCollection.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.jcdm.common.annotation.Log; +import com.jcdm.common.core.controller.BaseController; +import com.jcdm.common.core.domain.AjaxResult; +import com.jcdm.common.enums.BusinessType; +import com.jcdm.main.da.tileMatchCollection.domain.DaTileMatchCollection; +import com.jcdm.main.da.tileMatchCollection.service.IDaTileMatchCollectionService; +import com.jcdm.common.utils.poi.ExcelUtil; +import com.jcdm.common.core.page.TableDataInfo; + +/** + * 鏉$爜閲囬泦Controller + * + * @author yyt + * @date 2024-06-06 + */ +@RestController +@RequestMapping("/da/tileMatchCollection") +public class DaTileMatchCollectionController extends BaseController +{ + @Autowired + private IDaTileMatchCollectionService daTileMatchCollectionService; + + /** + * 鏌ヨ鏉$爜閲囬泦鍒楄〃 + */ + @PreAuthorize("@ss.hasPermi('da:tileMatchCollection:list')") + @GetMapping("/list") + public TableDataInfo list(DaTileMatchCollection daTileMatchCollection) + { + startPage(); + List<DaTileMatchCollection> list = daTileMatchCollectionService.selectDaTileMatchCollectionList(daTileMatchCollection); + return getDataTable(list); + } + + /** + * 瀵煎嚭鏉$爜閲囬泦鍒楄〃 + */ + @PreAuthorize("@ss.hasPermi('da:tileMatchCollection:export')") + @Log(title = "鏉$爜閲囬泦", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DaTileMatchCollection daTileMatchCollection) + { + List<DaTileMatchCollection> list = daTileMatchCollectionService.selectDaTileMatchCollectionList(daTileMatchCollection); + ExcelUtil<DaTileMatchCollection> util = new ExcelUtil<DaTileMatchCollection>(DaTileMatchCollection.class); + util.exportExcel(response, list, "鏉$爜閲囬泦鏁版嵁"); + } + + /** + * 鑾峰彇鏉$爜閲囬泦璇︾粏淇℃伅 + */ + @PreAuthorize("@ss.hasPermi('da:tileMatchCollection:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(daTileMatchCollectionService.selectDaTileMatchCollectionById(id)); + } + + /** + * 鏂板鏉$爜閲囬泦 + */ + @PreAuthorize("@ss.hasPermi('da:tileMatchCollection:add')") + @Log(title = "鏉$爜閲囬泦", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DaTileMatchCollection daTileMatchCollection) + { + return toAjax(daTileMatchCollectionService.insertDaTileMatchCollection(daTileMatchCollection)); + } + + /** + * 淇敼鏉$爜閲囬泦 + */ + @PreAuthorize("@ss.hasPermi('da:tileMatchCollection:edit')") + @Log(title = "鏉$爜閲囬泦", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DaTileMatchCollection daTileMatchCollection) + { + return toAjax(daTileMatchCollectionService.updateDaTileMatchCollection(daTileMatchCollection)); + } + + /** + * 鍒犻櫎鏉$爜閲囬泦 + */ + @PreAuthorize("@ss.hasPermi('da:tileMatchCollection:remove')") + @Log(title = "鏉$爜閲囬泦", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(daTileMatchCollectionService.deleteDaTileMatchCollectionByIds(ids)); + } +} diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/domain/DaTileMatchCollection.java b/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/domain/DaTileMatchCollection.java new file mode 100644 index 0000000..80a9121 --- /dev/null +++ b/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/domain/DaTileMatchCollection.java @@ -0,0 +1,123 @@ +package com.jcdm.main.da.tileMatchCollection.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.jcdm.common.annotation.Excel; +import com.jcdm.common.core.domain.BaseEntity; + +/** + * 鏉$爜閲囬泦瀵硅薄 da_tile_match_collection + * + * @author yyt + * @date 2024-06-06 + */ +public class DaTileMatchCollection extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id */ + private Long id; + + /** 鍙戝姩鏈哄彿 */ + @Excel(name = "鍙戝姩鏈哄彿") + private String sfcCode; + + /** 闆朵欢缂栧彿 */ + @Excel(name = "闆朵欢缂栧彿") + private String paramCode; + + /** 闆朵欢鍚嶇О */ + @Excel(name = "闆朵欢鍚嶇О") + private String paramName; + + /** 澶囨敞 */ + @Excel(name = "澶囨敞") + private String remarks; + + /** 宸ュ簭缂栧彿 */ + @Excel(name = "宸ュ簭缂栧彿") + private String locationCode; + + /** 鏉$爜 */ + @Excel(name = "鏉$爜") + private String paramValue; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setSfcCode(String sfcCode) + { + this.sfcCode = sfcCode; + } + + public String getSfcCode() + { + return sfcCode; + } + public void setParamCode(String paramCode) + { + this.paramCode = paramCode; + } + + public String getParamCode() + { + return paramCode; + } + public void setParamName(String paramName) + { + this.paramName = paramName; + } + + public String getParamName() + { + return paramName; + } + public void setRemarks(String remarks) + { + this.remarks = remarks; + } + + public String getRemarks() + { + return remarks; + } + public void setLocationCode(String locationCode) + { + this.locationCode = locationCode; + } + + public String getLocationCode() + { + return locationCode; + } + + public void setParamValue(String paramValue) + { + this.paramValue = paramValue; + } + + public String getParamValue() + { + return paramValue; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("sfcCode", getSfcCode()) + .append("paramCode", getParamCode()) + .append("paramName", getParamName()) + .append("createTime", getCreateTime()) + .append("remarks", getRemarks()) + .append("locationCode", getLocationCode()) + .append("paramValue", getParamValue()) + .toString(); + } +} diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/mapper/DaTileMatchCollectionMapper.java b/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/mapper/DaTileMatchCollectionMapper.java new file mode 100644 index 0000000..c61806d --- /dev/null +++ b/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/mapper/DaTileMatchCollectionMapper.java @@ -0,0 +1,61 @@ +package com.jcdm.main.da.tileMatchCollection.mapper; + +import java.util.List; +import com.jcdm.main.da.tileMatchCollection.domain.DaTileMatchCollection; + +/** + * 鏉$爜閲囬泦Mapper鎺ュ彛 + * + * @author yyt + * @date 2024-06-06 + */ +public interface DaTileMatchCollectionMapper +{ + /** + * 鏌ヨ鏉$爜閲囬泦 + * + * @param id 鏉$爜閲囬泦涓婚敭 + * @return 鏉$爜閲囬泦 + */ + public DaTileMatchCollection selectDaTileMatchCollectionById(Long id); + + /** + * 鏌ヨ鏉$爜閲囬泦鍒楄〃 + * + * @param daTileMatchCollection 鏉$爜閲囬泦 + * @return 鏉$爜閲囬泦闆嗗悎 + */ + public List<DaTileMatchCollection> selectDaTileMatchCollectionList(DaTileMatchCollection daTileMatchCollection); + + /** + * 鏂板鏉$爜閲囬泦 + * + * @param daTileMatchCollection 鏉$爜閲囬泦 + * @return 缁撴灉 + */ + public int insertDaTileMatchCollection(DaTileMatchCollection daTileMatchCollection); + + /** + * 淇敼鏉$爜閲囬泦 + * + * @param daTileMatchCollection 鏉$爜閲囬泦 + * @return 缁撴灉 + */ + public int updateDaTileMatchCollection(DaTileMatchCollection daTileMatchCollection); + + /** + * 鍒犻櫎鏉$爜閲囬泦 + * + * @param id 鏉$爜閲囬泦涓婚敭 + * @return 缁撴灉 + */ + public int deleteDaTileMatchCollectionById(Long id); + + /** + * 鎵归噺鍒犻櫎鏉$爜閲囬泦 + * + * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteDaTileMatchCollectionByIds(Long[] ids); +} diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/service/IDaTileMatchCollectionService.java b/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/service/IDaTileMatchCollectionService.java new file mode 100644 index 0000000..19debf8 --- /dev/null +++ b/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/service/IDaTileMatchCollectionService.java @@ -0,0 +1,61 @@ +package com.jcdm.main.da.tileMatchCollection.service; + +import java.util.List; +import com.jcdm.main.da.tileMatchCollection.domain.DaTileMatchCollection; + +/** + * 鏉$爜閲囬泦Service鎺ュ彛 + * + * @author yyt + * @date 2024-06-06 + */ +public interface IDaTileMatchCollectionService +{ + /** + * 鏌ヨ鏉$爜閲囬泦 + * + * @param id 鏉$爜閲囬泦涓婚敭 + * @return 鏉$爜閲囬泦 + */ + public DaTileMatchCollection selectDaTileMatchCollectionById(Long id); + + /** + * 鏌ヨ鏉$爜閲囬泦鍒楄〃 + * + * @param daTileMatchCollection 鏉$爜閲囬泦 + * @return 鏉$爜閲囬泦闆嗗悎 + */ + public List<DaTileMatchCollection> selectDaTileMatchCollectionList(DaTileMatchCollection daTileMatchCollection); + + /** + * 鏂板鏉$爜閲囬泦 + * + * @param daTileMatchCollection 鏉$爜閲囬泦 + * @return 缁撴灉 + */ + public int insertDaTileMatchCollection(DaTileMatchCollection daTileMatchCollection); + + /** + * 淇敼鏉$爜閲囬泦 + * + * @param daTileMatchCollection 鏉$爜閲囬泦 + * @return 缁撴灉 + */ + public int updateDaTileMatchCollection(DaTileMatchCollection daTileMatchCollection); + + /** + * 鎵归噺鍒犻櫎鏉$爜閲囬泦 + * + * @param ids 闇�瑕佸垹闄ょ殑鏉$爜閲囬泦涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteDaTileMatchCollectionByIds(Long[] ids); + + /** + * 鍒犻櫎鏉$爜閲囬泦淇℃伅 + * + * @param id 鏉$爜閲囬泦涓婚敭 + * @return 缁撴灉 + */ + public int deleteDaTileMatchCollectionById(Long id); +} diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/service/impl/DaTileMatchCollectionServiceImpl.java b/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/service/impl/DaTileMatchCollectionServiceImpl.java new file mode 100644 index 0000000..e09e227 --- /dev/null +++ b/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchCollection/service/impl/DaTileMatchCollectionServiceImpl.java @@ -0,0 +1,95 @@ +package com.jcdm.main.da.tileMatchCollection.service.impl; + +import java.util.List; +import com.jcdm.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.jcdm.main.da.tileMatchCollection.mapper.DaTileMatchCollectionMapper; +import com.jcdm.main.da.tileMatchCollection.domain.DaTileMatchCollection; +import com.jcdm.main.da.tileMatchCollection.service.IDaTileMatchCollectionService; + +/** + * 鏉$爜閲囬泦Service涓氬姟灞傚鐞� + * + * @author yyt + * @date 2024-06-06 + */ +@Service +public class DaTileMatchCollectionServiceImpl implements IDaTileMatchCollectionService +{ + @Autowired + private DaTileMatchCollectionMapper daTileMatchCollectionMapper; + + /** + * 鏌ヨ鏉$爜閲囬泦 + * + * @param id 鏉$爜閲囬泦涓婚敭 + * @return 鏉$爜閲囬泦 + */ + @Override + public DaTileMatchCollection selectDaTileMatchCollectionById(Long id) + { + return daTileMatchCollectionMapper.selectDaTileMatchCollectionById(id); + } + + /** + * 鏌ヨ鏉$爜閲囬泦鍒楄〃 + * + * @param daTileMatchCollection 鏉$爜閲囬泦 + * @return 鏉$爜閲囬泦 + */ + @Override + public List<DaTileMatchCollection> selectDaTileMatchCollectionList(DaTileMatchCollection daTileMatchCollection) + { + return daTileMatchCollectionMapper.selectDaTileMatchCollectionList(daTileMatchCollection); + } + + /** + * 鏂板鏉$爜閲囬泦 + * + * @param daTileMatchCollection 鏉$爜閲囬泦 + * @return 缁撴灉 + */ + @Override + public int insertDaTileMatchCollection(DaTileMatchCollection daTileMatchCollection) + { + daTileMatchCollection.setCreateTime(DateUtils.getNowDate()); + return daTileMatchCollectionMapper.insertDaTileMatchCollection(daTileMatchCollection); + } + + /** + * 淇敼鏉$爜閲囬泦 + * + * @param daTileMatchCollection 鏉$爜閲囬泦 + * @return 缁撴灉 + */ + @Override + public int updateDaTileMatchCollection(DaTileMatchCollection daTileMatchCollection) + { + return daTileMatchCollectionMapper.updateDaTileMatchCollection(daTileMatchCollection); + } + + /** + * 鎵归噺鍒犻櫎鏉$爜閲囬泦 + * + * @param ids 闇�瑕佸垹闄ょ殑鏉$爜閲囬泦涓婚敭 + * @return 缁撴灉 + */ + @Override + public int deleteDaTileMatchCollectionByIds(Long[] ids) + { + return daTileMatchCollectionMapper.deleteDaTileMatchCollectionByIds(ids); + } + + /** + * 鍒犻櫎鏉$爜閲囬泦淇℃伅 + * + * @param id 鏉$爜閲囬泦涓婚敭 + * @return 缁撴灉 + */ + @Override + public int deleteDaTileMatchCollectionById(Long id) + { + return daTileMatchCollectionMapper.deleteDaTileMatchCollectionById(id); + } +} diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/controller/DaTileMatchRulesController.java b/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/controller/DaTileMatchRulesController.java index 8b410f7..6c4e283 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/controller/DaTileMatchRulesController.java +++ b/jcdm-main/src/main/java/com/jcdm/main/da/tileMatchRules/controller/DaTileMatchRulesController.java @@ -2,11 +2,14 @@ import java.util.List; import java.util.stream.Collectors; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import cn.hutool.core.collection.CollUtil; import com.jcdm.main.da.paramCollection.domain.DaParamCollection; import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService; +import com.jcdm.main.da.tileMatchCollection.domain.DaTileMatchCollection; +import com.jcdm.main.da.tileMatchCollection.service.IDaTileMatchCollectionService; import com.jcdm.main.da.tileMatchMiddleware.domain.DaTileMatchMiddleware; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; @@ -44,6 +47,8 @@ @Autowired public IDaParamCollectionService daParamCollectionService; + @Resource + private IDaTileMatchCollectionService daTileMatchCollectionService; /** * 鏌ヨ閰嶇摝瑙勫垯鍒楄〃() @@ -168,10 +173,18 @@ saveData.setSfcCode(SNCode); saveData.setParamValue(barcode); saveData.setLocationCode(locationCode); - saveData.setParamCode("CZM"); - saveData.setParamName("鏇茶酱"); + saveData.setParamCode("PHZ"); + saveData.setParamName("骞宠 杞�"); daParamCollectionService.insertDaParamCollection(saveData); + DaTileMatchCollection MatchCollection = new DaTileMatchCollection(); + MatchCollection.setSfcCode(SNCode); + MatchCollection.setParamValue(barcode); + MatchCollection.setLocationCode(locationCode); + MatchCollection.setParamCode("PHZ"); + MatchCollection.setParamName("骞宠 杞�"); + daTileMatchCollectionService.insertDaTileMatchCollection(MatchCollection); + DaParamCollection ParamCollection = new DaParamCollection(); ParamCollection.setSfcCode(SNCode); List<DaParamCollection> DaParamCollectionlist=daParamCollectionService.selectDaParamCollectionList(ParamCollection); diff --git a/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java b/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java index 3e1f834..0b7e813 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java +++ b/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java @@ -99,31 +99,33 @@ logger.info("-------鐩戝惉鍒�,{}鐨勬壂鐮佹灙鎵爜鐨凜ODE_CHECK鐨勪俊鍙�",identifier); scannerGunMessage(); } -// if (identifier.equals(OPCElement.OP060_HX_CODE_CHECK) && "1".equals(value.toString())){ -// Object SNCodeObject = miloService.readFromOpcUa("CFL4HX.OP060.Code1").getValue(); -// if (null == SNCodeObject){ -// SNCodeObject = miloService.readFromOpcUa("CFL4HX.OP060.Code").getValue(); -// } -// if (null != SNCodeObject){ -// String XT=""; -// String CZ=""; -// String SNCode = SNCodeObject.toString(); -// DaParamCollection ParamCollection = new DaParamCollection(); -// ParamCollection.setSfcCode(SNCode); -// List<DaParamCollection> DaParamCollectionlist=daParamCollectionService.selectDaParamCollectionList(ParamCollection); -// List<DaParamCollection> XTParamCollection = DaParamCollectionlist.stream().filter(x -> "绠变綋".equals(x.getParamName())).collect(Collectors.toList()); -// if (CollUtil.isNotEmpty(XTParamCollection)){ -// DaParamCollection lastOne = XTParamCollection.get(0); -// XT = lastOne.getParamValue(); -// } -// List<DaParamCollection> CZParamCollection = DaParamCollectionlist.stream().filter(x -> "鏇茶酱".equals(x.getParamName())).collect(Collectors.toList()); -// if (CollUtil.isNotEmpty(CZParamCollection)){ -// DaParamCollection lastOne = CZParamCollection.get(0); -// CZ = lastOne.getParamValue(); -// } -// passingStationCollectionServiceImpl.sendMessage(XT+"*"+CZ,"OP060"); -// } -// } + if (identifier.equals(OPCElement.OP060_HX_CODE_CHECK) && "1".equals(value.toString())){ + Object SNCodeObject = miloService.readFromOpcUa("CFL4HX.OP060.Code1").getValue(); + if (null == SNCodeObject){ + SNCodeObject = miloService.readFromOpcUa("CFL4HX.OP060.Code").getValue(); + } + if (null != SNCodeObject){ + String XT=null; + String CZ=null; + String SNCode = SNCodeObject.toString(); + DaParamCollection ParamCollection = new DaParamCollection(); + ParamCollection.setSfcCode(SNCode); + List<DaParamCollection> DaParamCollectionlist=daParamCollectionService.selectDaParamCollectionList(ParamCollection); + List<DaParamCollection> XTParamCollection = DaParamCollectionlist.stream().filter(x -> "绠变綋".equals(x.getParamName())).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(XTParamCollection)){ + DaParamCollection lastOne = XTParamCollection.get(0); + XT = lastOne.getParamValue(); + } + List<DaParamCollection> CZParamCollection = DaParamCollectionlist.stream().filter(x -> "鏇茶酱".equals(x.getParamName())).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(CZParamCollection)){ + DaParamCollection lastOne = CZParamCollection.get(0); + CZ = lastOne.getParamValue(); + } + if(null != XT&&null != CZ) { + passingStationCollectionServiceImpl.sendMessage(XT+"*"+CZ,"OP060"); + } + } + } } if (collect2.contains(identifier)){ if ("1".equals(value.toString())){ diff --git a/jcdm-main/src/main/resources/mapper/da/tileMatchCollection/DaTileMatchCollectionMapper.xml b/jcdm-main/src/main/resources/mapper/da/tileMatchCollection/DaTileMatchCollectionMapper.xml new file mode 100644 index 0000000..44077a4 --- /dev/null +++ b/jcdm-main/src/main/resources/mapper/da/tileMatchCollection/DaTileMatchCollectionMapper.xml @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.jcdm.main.da.tileMatchCollection.mapper.DaTileMatchCollectionMapper"> + + <resultMap type="DaTileMatchCollection" id="DaTileMatchCollectionResult"> + <result property="id" column="id" /> + <result property="sfcCode" column="sfc_code" /> + <result property="paramCode" column="param_code" /> + <result property="paramName" column="param_name" /> + <result property="createTime" column="create_time" /> + <result property="remarks" column="remarks" /> + <result property="locationCode" column="location_code" /> + </resultMap> + + <sql id="selectDaTileMatchCollectionVo"> + select id, sfc_code, param_code, param_name, create_time, remarks, location_code,param_value from da_tile_match_collection + </sql> + + <select id="selectDaTileMatchCollectionList" parameterType="DaTileMatchCollection" resultMap="DaTileMatchCollectionResult"> + <include refid="selectDaTileMatchCollectionVo"/> + <where> + <if test="sfcCode != null and sfcCode != ''"> and sfc_code = #{sfcCode}</if> + <if test="paramCode != null and paramCode != ''"> and param_code = #{paramCode}</if> + <if test="paramValue != null and paramValue != ''"> and param_value = #{paramValue}</if> + <if test="paramName != null and paramName != ''"> and param_name like concat('%', #{paramValue}, '%')</if> + <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if> + <if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if> + </where> + </select> + + <select id="selectDaTileMatchCollectionById" parameterType="Long" resultMap="DaTileMatchCollectionResult"> + <include refid="selectDaTileMatchCollectionVo"/> + where id = #{id} + </select> + + <insert id="insertDaTileMatchCollection" parameterType="DaTileMatchCollection"> + insert into da_tile_match_collection + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="id != null">id,</if> + <if test="sfcCode != null">sfc_code,</if> + <if test="paramCode != null">param_code,</if> + <if test="paramName != null">param_name,</if> + <if test="paramValue != null">param_value,</if> + <if test="createTime != null">create_time,</if> + <if test="remarks != null">remarks,</if> + <if test="locationCode != null">location_code,</if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="id != null">#{id},</if> + <if test="sfcCode != null">#{sfcCode},</if> + <if test="paramCode != null">#{paramCode},</if> + <if test="paramName != null">#{paramName},</if> + <if test="paramValue != null">#{paramValue},</if> + <if test="createTime != null">#{createTime},</if> + <if test="remarks != null">#{remarks},</if> + <if test="locationCode != null">#{locationCode},</if> + </trim> + </insert> + + <update id="updateDaTileMatchCollection" parameterType="DaTileMatchCollection"> + update da_tile_match_collection + <trim prefix="SET" suffixOverrides=","> + <if test="sfcCode != null">sfc_code = #{sfcCode},</if> + <if test="paramCode != null">param_code = #{paramCode},</if> + <if test="paramName != null">param_name = #{paramName},</if> + <if test="paramValue != null">param_value = #{paramValue},</if> + <if test="createTime != null">create_time = #{createTime},</if> + <if test="remarks != null">remarks = #{remarks},</if> + <if test="locationCode != null">location_code = #{locationCode},</if> + </trim> + where id = #{id} + </update> + + <delete id="deleteDaTileMatchCollectionById" parameterType="Long"> + delete from da_tile_match_collection where id = #{id} + </delete> + + <delete id="deleteDaTileMatchCollectionByIds" parameterType="String"> + delete from da_tile_match_collection where id in + <foreach item="id" collection="array" open="(" separator="," close=")"> + #{id} + </foreach> + </delete> +</mapper> \ No newline at end of file diff --git a/jcdm-ui/src/api/main/da/tileMatchCollection/tileMatchCollection.js b/jcdm-ui/src/api/main/da/tileMatchCollection/tileMatchCollection.js new file mode 100644 index 0000000..e1c6f4a --- /dev/null +++ b/jcdm-ui/src/api/main/da/tileMatchCollection/tileMatchCollection.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 鏌ヨ鏉$爜閲囬泦鍒楄〃 +export function listTileMatchCollection(query) { + return request({ + url: '/da/tileMatchCollection/list', + method: 'get', + params: query + }) +} + +// 鏌ヨ鏉$爜閲囬泦璇︾粏 +export function getTileMatchCollection(id) { + return request({ + url: '/da/tileMatchCollection/' + id, + method: 'get' + }) +} + +// 鏂板鏉$爜閲囬泦 +export function addTileMatchCollection(data) { + return request({ + url: '/da/tileMatchCollection', + method: 'post', + data: data + }) +} + +// 淇敼鏉$爜閲囬泦 +export function updateTileMatchCollection(data) { + return request({ + url: '/da/tileMatchCollection', + method: 'put', + data: data + }) +} + +// 鍒犻櫎鏉$爜閲囬泦 +export function delTileMatchCollection(id) { + return request({ + url: '/da/tileMatchCollection/' + id, + method: 'delete' + }) +} diff --git a/jcdm-ui/src/views/main/da/tileMatchCollection/index.vue b/jcdm-ui/src/views/main/da/tileMatchCollection/index.vue new file mode 100644 index 0000000..1968855 --- /dev/null +++ b/jcdm-ui/src/views/main/da/tileMatchCollection/index.vue @@ -0,0 +1,338 @@ +<template> + <div class="app-container"> + <el-card class="box-card"> + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> + <el-form-item label="鍙戝姩鏈哄彿" prop="sfcCode"> + <el-input + v-model="queryParams.sfcCode" + placeholder="璇疯緭鍏ュ彂鍔ㄦ満鍙�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="闆朵欢缂栧彿" prop="paramCode"> + <el-input + v-model="queryParams.paramCode" + placeholder="璇疯緭鍏ラ浂浠剁紪鍙�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="闆朵欢鍚嶇О" prop="paramName"> + <el-input + v-model="queryParams.paramName" + placeholder="璇疯緭鍏ラ浂浠跺悕绉�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="澶囨敞" prop="remarks"> + <el-input + v-model="queryParams.remarks" + placeholder="璇疯緭鍏ュ娉�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="宸ュ簭缂栧彿" prop="locationCode"> + <el-input + v-model="queryParams.locationCode" + placeholder="璇疯緭鍏ュ伐搴忕紪鍙�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item style="float: right"> + <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button> + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button> + </el-form-item> + </el-form> + </el-card> + + <el-card style="margin-top: 10px" class="box-card"> + <el-row :gutter="10" class="mb8"> + <el-col :span="1.5"> + <el-button + type="primary" + plain + icon="el-icon-plus" + size="mini" + @click="handleAdd" + v-hasPermi="['da:tileMatchCollection:add']" + >鏂板</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="success" + plain + icon="el-icon-edit" + size="mini" + :disabled="single" + @click="handleUpdate" + v-hasPermi="['da:tileMatchCollection:edit']" + >淇敼</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="danger" + plain + icon="el-icon-delete" + size="mini" + :disabled="multiple" + @click="handleDelete" + v-hasPermi="['da:tileMatchCollection:remove']" + >鍒犻櫎</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="warning" + plain + icon="el-icon-download" + size="mini" + @click="handleExport" + v-hasPermi="['da:tileMatchCollection:export']" + >瀵煎嚭</el-button> + </el-col> + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> + </el-row> + + <el-table border v-loading="loading" :data="tileMatchCollectionList" @selection-change="handleSelectionChange"> + <el-table-column type="selection" width="55" align="center" /> + <el-table-column label="id" align="center" prop="id" /> + <el-table-column label="鍙戝姩鏈哄彿" align="center" prop="sfcCode"> +<!-- <template slot-scope="scope">--> +<!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.sfcCode"/>--> +<!-- </template>--> + </el-table-column> + <el-table-column label="闆朵欢缂栧彿" align="center" prop="paramCode"> +<!-- <template slot-scope="scope">--> +<!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramCode"/>--> +<!-- </template>--> + </el-table-column> + <el-table-column label="闆朵欢鍚嶇О" align="center" prop="paramName"> +<!-- <template slot-scope="scope">--> +<!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramName"/>--> +<!-- </template>--> + </el-table-column> + <el-table-column label="澶囨敞" align="center" prop="remarks"> +<!-- <template slot-scope="scope">--> +<!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.remarks"/>--> +<!-- </template>--> + </el-table-column> + <el-table-column label="宸ュ簭缂栧彿" align="center" prop="locationCode"> +<!-- <template slot-scope="scope">--> +<!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.locationCode"/>--> +<!-- </template>--> + </el-table-column> + <el-table-column fixed="right" width="200" label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> + <template slot-scope="scope"> + <el-button + size="mini" + type="success" + plain + style="width: 72px" + icon="el-icon-edit" + @click="handleUpdate(scope.row)" + v-hasPermi="['da:tileMatchCollection:edit']" + >淇敼</el-button> + <el-button + size="mini" + type="danger" + plain + style="width: 72px" + icon="el-icon-delete" + @click="handleDelete(scope.row)" + v-hasPermi="['da:tileMatchCollection:remove']" + >鍒犻櫎</el-button> + </template> + </el-table-column> + </el-table> + </el-card> + + <pagination + v-show="total>0" + :total="total" + :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" + @pagination="getList" + /> + + <!-- 娣诲姞鎴栦慨鏀规潯鐮侀噰闆嗗璇濇 --> + <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="500px" append-to-body> + <span slot="title"> + <i class="el-icon-s-order"></i> + {{titleName}} + </span> + <el-form ref="form" :model="form" :rules="rules" label-width="80px"> + <el-form-item label="鍙戝姩鏈哄彿" prop="sfcCode"> + <el-input v-model="form.sfcCode" placeholder="璇疯緭鍏ュ彂鍔ㄦ満鍙�" /> + </el-form-item> + <el-form-item label="闆朵欢缂栧彿" prop="paramCode"> + <el-input v-model="form.paramCode" placeholder="璇疯緭鍏ラ浂浠剁紪鍙�" /> + </el-form-item> + <el-form-item label="闆朵欢鍚嶇О" prop="paramName"> + <el-input v-model="form.paramName" placeholder="璇疯緭鍏ラ浂浠跺悕绉�" /> + </el-form-item> + <el-form-item label="澶囨敞" prop="remarks"> + <el-input v-model="form.remarks" placeholder="璇疯緭鍏ュ娉�" /> + </el-form-item> + <el-form-item label="宸ュ簭缂栧彿" prop="locationCode"> + <el-input v-model="form.locationCode" placeholder="璇疯緭鍏ュ伐搴忕紪鍙�" /> + </el-form-item> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitForm">纭� 瀹�</el-button> + <el-button @click="cancel">鍙� 娑�</el-button> + </div> + </el-dialog> + </div> +</template> + +<script> +import { listTileMatchCollection, getTileMatchCollection, delTileMatchCollection, addTileMatchCollection, updateTileMatchCollection } from "@/api/main/da/tileMatchCollection/tileMatchCollection"; + +export default { + name: "TileMatchCollection", + data() { + return { + // 閬僵灞� + loading: true, + titleName: "", + // 閫変腑鏁扮粍 + ids: [], + // 闈炲崟涓鐢� + single: true, + // 闈炲涓鐢� + multiple: true, + // 鏄剧ず鎼滅储鏉′欢 + showSearch: true, + // 鎬绘潯鏁� + total: 0, + // 鏉$爜閲囬泦琛ㄦ牸鏁版嵁 + tileMatchCollectionList: [], + // 寮瑰嚭灞傛爣棰� + title: "", + // 鏄惁鏄剧ず寮瑰嚭灞� + open: false, + // 鏌ヨ鍙傛暟 + queryParams: { + pageNum: 1, + pageSize: 10, + sfcCode: null, + paramCode: null, + paramName: null, + remarks: null, + locationCode: null + }, + // 琛ㄥ崟鍙傛暟 + form: {}, + // 琛ㄥ崟鏍¢獙 + rules: { + id: [ + { required: true, message: "id涓嶈兘涓虹┖", trigger: "blur" } + ], + } + }; + }, + created() { + this.getList(); + }, + methods: { + /** 鏌ヨ鏉$爜閲囬泦鍒楄〃 */ + getList() { + this.loading = true; + listTileMatchCollection(this.queryParams).then(response => { + this.tileMatchCollectionList = response.rows; + this.total = response.total; + this.loading = false; + }); + }, + // 鍙栨秷鎸夐挳 + cancel() { + this.open = false; + this.reset(); + }, + // 琛ㄥ崟閲嶇疆 + reset() { + this.form = { + id: null, + sfcCode: null, + paramCode: null, + paramName: null, + createTime: null, + remarks: null, + locationCode: null + }; + this.resetForm("form"); + }, + /** 鎼滅储鎸夐挳鎿嶄綔 */ + handleQuery() { + this.queryParams.pageNum = 1; + this.getList(); + }, + /** 閲嶇疆鎸夐挳鎿嶄綔 */ + resetQuery() { + this.resetForm("queryForm"); + this.handleQuery(); + }, + // 澶氶�夋閫変腑鏁版嵁 + handleSelectionChange(selection) { + this.ids = selection.map(item => item.id) + this.single = selection.length!==1 + this.multiple = !selection.length + }, + /** 鏂板鎸夐挳鎿嶄綔 */ + handleAdd() { + this.reset(); + this.open = true; + this.titleName = "娣诲姞鏉$爜閲囬泦"; + }, + /** 淇敼鎸夐挳鎿嶄綔 */ + handleUpdate(row) { + this.reset(); + const id = row.id || this.ids + getTileMatchCollection(id).then(response => { + this.form = response.data; + this.open = true; + this.titleName = "淇敼鏉$爜閲囬泦"; + }); + }, + /** 鎻愪氦鎸夐挳 */ + submitForm() { + this.$refs["form"].validate(valid => { + if (valid) { + if (this.form.id != null) { + updateTileMatchCollection(this.form).then(response => { + this.$modal.msgSuccess("淇敼鎴愬姛"); + this.open = false; + this.getList(); + }); + } else { + addTileMatchCollection(this.form).then(response => { + this.$modal.msgSuccess("鏂板鎴愬姛"); + this.open = false; + this.getList(); + }); + } + } + }); + }, + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ + handleDelete(row) { + const ids = row.id || this.ids; + this.$modal.confirm('鏄惁纭鍒犻櫎鏉$爜閲囬泦缂栧彿涓�"' + ids + '"鐨勬暟鎹」锛�').then(function() { + return delTileMatchCollection(ids); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => {}); + }, + /** 瀵煎嚭鎸夐挳鎿嶄綔 */ + handleExport() { + this.download('da/tileMatchCollection/export', { + ...this.queryParams + }, `tileMatchCollection_${new Date().getTime()}.xlsx`) + } + } +}; +</script> -- Gitblit v1.9.3