From 749c2cf67db9d36a48dc97641dcbda75896ada22 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Wed, 8 Nov 2023 11:27:48 +0800 Subject: [PATCH] =?UTF-8?q?mes=E4=B8=8A=E4=BD=8D=E6=9C=BA=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=BF=81=E7=A7=BBscada?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../QcCheckReportIncomeController.java | 12 +- .../QcCheckReportProduceController.java | 186 ++++++++++++++++ .../QcCheckReportProductController.java | 186 ++++++++++++++++ .../service/IQcCheckReportProduceService.java | 77 +++++++ .../service/IQcCheckReportProductService.java | 77 +++++++ .../QcCheckReportProduceServiceImpl.java | 203 ++++++++++++++++++ .../QcCheckReportProductServiceImpl.java | 203 ++++++++++++++++++ .../op/scada/controller/ScadaController.java | 50 +++++ .../java/com/op/scada/mapper/ScadaMapper.java | 27 +++ .../com/op/scada/service/ScadaService.java | 18 ++ .../scada/service/impl/ScadaServiceImpl.java | 147 +++++++++++++ .../op-scada/src/main/resources/bootstrap.yml | 8 +- .../resources/mapper/scada/ScadaMapper.xml | 49 +++++ 13 files changed, 1233 insertions(+), 10 deletions(-) create mode 100644 op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportProduceController.java create mode 100644 op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportProductController.java create mode 100644 op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckReportProduceService.java create mode 100644 op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckReportProductService.java create mode 100644 op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckReportProduceServiceImpl.java create mode 100644 op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckReportProductServiceImpl.java create mode 100644 op-modules/op-scada/src/main/java/com/op/scada/controller/ScadaController.java create mode 100644 op-modules/op-scada/src/main/java/com/op/scada/mapper/ScadaMapper.java create mode 100644 op-modules/op-scada/src/main/java/com/op/scada/service/ScadaService.java create mode 100644 op-modules/op-scada/src/main/java/com/op/scada/service/impl/ScadaServiceImpl.java create mode 100644 op-modules/op-scada/src/main/resources/mapper/scada/ScadaMapper.xml diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportIncomeController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportIncomeController.java index e428cd02..2117a864 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportIncomeController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportIncomeController.java @@ -39,7 +39,7 @@ public class QcCheckReportIncomeController extends BaseController { /** * 查询来料检验列表 */ - @RequiresPermissions("quality:qcIncomeReport:list") + @RequiresPermissions("quality:incomeReport:list") @GetMapping("/list") public TableDataInfo list(QcCheckReportIncome qcCheckReportIncome) { @@ -66,7 +66,7 @@ public class QcCheckReportIncomeController extends BaseController { /** * 导出来料检验列表 */ - @RequiresPermissions("quality:qcIncomeReport:export") + @RequiresPermissions("quality:incomeReport:export") @Log(title = "来料检验", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, QcCheckReportIncome qcCheckReportIncome) { @@ -94,7 +94,7 @@ public class QcCheckReportIncomeController extends BaseController { /** * 获取来料检验详细信息 */ - @RequiresPermissions("quality:qcIncomeReport:query") + @RequiresPermissions("quality:incomeReport:query") @GetMapping(value = "/{recordId}") public AjaxResult getInfo(@PathVariable("recordId") String recordId) { return success(qcCheckReportIncomeService.selectQcCheckReportIncomeByRecordId(recordId)); @@ -103,7 +103,7 @@ public class QcCheckReportIncomeController extends BaseController { /** * 新增来料检验 */ - @RequiresPermissions("quality:qcIncomeReport:add") + @RequiresPermissions("quality:incomeReport:add") @Log(title = "来料检验", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody QcCheckReportIncome qcCheckReportIncome) { @@ -117,7 +117,7 @@ public class QcCheckReportIncomeController extends BaseController { /** * 修改来料检验 */ - @RequiresPermissions("quality:qcIncomeReport:edit") + @RequiresPermissions("quality:incomeReport:edit") @Log(title = "来料检验", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody QcCheckReportIncome qcCheckReportIncome) { @@ -127,7 +127,7 @@ public class QcCheckReportIncomeController extends BaseController { /** * 删除来料检验 */ - @RequiresPermissions("quality:qcIncomeReport:remove") + @RequiresPermissions("quality:incomeReport:remove") @Log(title = "来料检验", businessType = BusinessType.DELETE) @DeleteMapping("/{recordIds}") public AjaxResult remove(@PathVariable String[] recordIds) { diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportProduceController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportProduceController.java new file mode 100644 index 00000000..c8996b40 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportProduceController.java @@ -0,0 +1,186 @@ +package com.op.quality.controller; + +import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.web.page.TableDataInfo; +import com.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.common.security.utils.SecurityUtils; +import com.op.quality.domain.QcBomComponent; +import com.op.quality.domain.QcCheckReportIncome; +import com.op.quality.domain.QcCheckTaskDetail; +import com.op.quality.domain.QcSupplier; +import com.op.quality.service.IQcCheckReportProduceService; +import com.op.system.api.domain.SysUser; +import org.apache.commons.lang.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * 来料检验Controller + * + * @author Open Platform + * @date 2023-10-19 + */ +@RestController +@RequestMapping("/qcProduceReport") +public class QcCheckReportProduceController extends BaseController { + @Autowired + private IQcCheckReportProduceService qcCheckReportProduceService; + + /** + * 查询来料检验列表 + */ + @RequiresPermissions("quality:produceReport:list") + @GetMapping("/list") + public TableDataInfo list(QcCheckReportIncome qcCheckReportIncome) { + + //默认时间范围T 00:00:00~T+1 00:00:00 + /*if(StringUtils.isEmpty(qcCheckReportIncome.getIncomeTimeStart())){ + qcCheckReportIncome.setIncomeTimeStart(DateUtils.getDate()+" 00:00:00");//start + LocalDate date = LocalDate.now(); + LocalDate dateEnd = date.plusDays(1); + DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + String dateEndStr = dtf.format(dateEnd)+" 00:00:00"; + qcCheckReportIncome.setIncomeTimeEnd(dateEndStr);//end + }*/ + +// if(StringUtils.isEmpty(qcCheckReportIncome.getCheckTimeStart())){ +// qcCheckReportIncome.setCheckTimeStart(qcCheckReportIncome.getIncomeTimeStart());//start +// qcCheckReportIncome.setCheckTimeEnd(qcCheckReportIncome.getIncomeTimeStart());//end +// } + + startPage(); + List list = qcCheckReportProduceService.selectQcCheckReportIncomeList(qcCheckReportIncome); + return getDataTable(list); + } + + /** + * 导出来料检验列表 + */ + @RequiresPermissions("quality:produceReport:export") + @Log(title = "来料检验", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, QcCheckReportIncome qcCheckReportIncome) { + + //默认时间范围T 00:00:00~T+1 00:00:00 + if(StringUtils.isEmpty(qcCheckReportIncome.getIncomeTimeStart())){ + qcCheckReportIncome.setIncomeTimeStart(DateUtils.getDate()+" 00:00:00");//start + LocalDate date = LocalDate.now(); + LocalDate dateEnd = date.plusDays(1); + DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + String dateEndStr = dtf.format(dateEnd)+" 00:00:00"; + qcCheckReportIncome.setIncomeTimeEnd(dateEndStr);//end + } + +// if(StringUtils.isEmpty(qcCheckReportIncome.getCheckTimeStart())){ +// qcCheckReportIncome.setCheckTimeStart(qcCheckReportIncome.getIncomeTimeStart());//start +// qcCheckReportIncome.setCheckTimeEnd(qcCheckReportIncome.getIncomeTimeStart());//end +// } + + List list = qcCheckReportProduceService.selectQcCheckReportIncomeList(qcCheckReportIncome); + ExcelUtil util = new ExcelUtil(QcCheckReportIncome.class); + util.exportExcel(response, list, "来料检验数据"); + } + + /** + * 获取来料检验详细信息 + */ + @RequiresPermissions("quality:produceReport:query") + @GetMapping(value = "/{recordId}") + public AjaxResult getInfo(@PathVariable("recordId") String recordId) { + return success(qcCheckReportProduceService.selectQcCheckReportIncomeByRecordId(recordId)); + } + + /** + * 新增来料检验 + */ + @RequiresPermissions("quality:produceReport:add") + @Log(title = "来料检验", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody QcCheckReportIncome qcCheckReportIncome) { + int r = qcCheckReportProduceService.insertQcCheckReportIncome(qcCheckReportIncome); + if(r>0){ + return toAjax(r); + } + return error("添加失败:请检查物料的关联检测项"); + } + + /** + * 修改来料检验 + */ + @RequiresPermissions("quality:produceReport:edit") + @Log(title = "来料检验", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody QcCheckReportIncome qcCheckReportIncome) { + return toAjax(qcCheckReportProduceService.updateQcCheckReportIncome(qcCheckReportIncome)); + } + + /** + * 删除来料检验 + */ + @RequiresPermissions("quality:produceReport:remove") + @Log(title = "来料检验", businessType = BusinessType.DELETE) + @DeleteMapping("/{recordIds}") + public AjaxResult remove(@PathVariable String[] recordIds) { + return toAjax(qcCheckReportProduceService.deleteQcCheckReportIncomeByRecordIds(recordIds)); + } + + /** + * 查询BOM物料管理列表 + */ + @GetMapping("/getQcListBom") + public TableDataInfo getQcListBom(QcBomComponent bomComponent) { + startPage(); + List list = qcCheckReportProduceService.getQcListBom(bomComponent); + return getDataTable(list); + } + /** + * 查询供应商列表 + */ + @GetMapping("/getQcListSupplier") + public TableDataInfo getQcListSupplier(QcSupplier qcSupplier) { + startPage(); + List list = qcCheckReportProduceService.getQcListSupplier(qcSupplier); + return getDataTable(list); + } + /** + * 查询人员列表 + */ + @GetMapping("/getQcListUser") + public TableDataInfo getQcListUser(SysUser sysUser) { + startPage(); + List list = qcCheckReportProduceService.getQcListUser(sysUser); + return getDataTable(list); + } + + /** + * 状态修改 + */ + @PutMapping("/changeIncomeStatus") + public AjaxResult changeIncomeStatus(@RequestBody QcCheckReportIncome qcCheckReportIncome) { + qcCheckReportIncome.setUpdateBy(SecurityUtils.getUsername()); + qcCheckReportIncome.setUpdateTime(DateUtils.getNowDate()); + return toAjax(qcCheckReportProduceService.updateIncomeStatus(qcCheckReportIncome)); + } + + /** + * 检验项目弹窗列表 + * @param + * @return + */ + @GetMapping("/getCkeckProjectList") + public TableDataInfo getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail) { + startPage(); + List list = qcCheckReportProduceService.getCkeckProjectList(qcCheckTaskDetail); + return getDataTable(list); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportProductController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportProductController.java new file mode 100644 index 00000000..1a8ac1e6 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckReportProductController.java @@ -0,0 +1,186 @@ +package com.op.quality.controller; + +import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.web.page.TableDataInfo; +import com.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.common.security.utils.SecurityUtils; +import com.op.quality.domain.QcBomComponent; +import com.op.quality.domain.QcCheckReportIncome; +import com.op.quality.domain.QcCheckTaskDetail; +import com.op.quality.domain.QcSupplier; +import com.op.quality.service.IQcCheckReportProductService; +import com.op.system.api.domain.SysUser; +import org.apache.commons.lang.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * 来料检验Controller + * + * @author Open Platform + * @date 2023-10-19 + */ +@RestController +@RequestMapping("/qcProductReport") +public class QcCheckReportProductController extends BaseController { + @Autowired + private IQcCheckReportProductService qcCheckReportProductService; + + /** + * 查询来料检验列表 + */ + @RequiresPermissions("quality:productReport:list") + @GetMapping("/list") + public TableDataInfo list(QcCheckReportIncome qcCheckReportIncome) { + + //默认时间范围T 00:00:00~T+1 00:00:00 + /*if(StringUtils.isEmpty(qcCheckReportIncome.getIncomeTimeStart())){ + qcCheckReportIncome.setIncomeTimeStart(DateUtils.getDate()+" 00:00:00");//start + LocalDate date = LocalDate.now(); + LocalDate dateEnd = date.plusDays(1); + DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + String dateEndStr = dtf.format(dateEnd)+" 00:00:00"; + qcCheckReportIncome.setIncomeTimeEnd(dateEndStr);//end + }*/ + +// if(StringUtils.isEmpty(qcCheckReportIncome.getCheckTimeStart())){ +// qcCheckReportIncome.setCheckTimeStart(qcCheckReportIncome.getIncomeTimeStart());//start +// qcCheckReportIncome.setCheckTimeEnd(qcCheckReportIncome.getIncomeTimeStart());//end +// } + + startPage(); + List list = qcCheckReportProductService.selectQcCheckReportIncomeList(qcCheckReportIncome); + return getDataTable(list); + } + + /** + * 导出来料检验列表 + */ + @RequiresPermissions("quality:productReport:export") + @Log(title = "来料检验", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, QcCheckReportIncome qcCheckReportIncome) { + + //默认时间范围T 00:00:00~T+1 00:00:00 + if(StringUtils.isEmpty(qcCheckReportIncome.getIncomeTimeStart())){ + qcCheckReportIncome.setIncomeTimeStart(DateUtils.getDate()+" 00:00:00");//start + LocalDate date = LocalDate.now(); + LocalDate dateEnd = date.plusDays(1); + DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + String dateEndStr = dtf.format(dateEnd)+" 00:00:00"; + qcCheckReportIncome.setIncomeTimeEnd(dateEndStr);//end + } + +// if(StringUtils.isEmpty(qcCheckReportIncome.getCheckTimeStart())){ +// qcCheckReportIncome.setCheckTimeStart(qcCheckReportIncome.getIncomeTimeStart());//start +// qcCheckReportIncome.setCheckTimeEnd(qcCheckReportIncome.getIncomeTimeStart());//end +// } + + List list = qcCheckReportProductService.selectQcCheckReportIncomeList(qcCheckReportIncome); + ExcelUtil util = new ExcelUtil(QcCheckReportIncome.class); + util.exportExcel(response, list, "来料检验数据"); + } + + /** + * 获取来料检验详细信息 + */ + @RequiresPermissions("quality:productReport:query") + @GetMapping(value = "/{recordId}") + public AjaxResult getInfo(@PathVariable("recordId") String recordId) { + return success(qcCheckReportProductService.selectQcCheckReportIncomeByRecordId(recordId)); + } + + /** + * 新增来料检验 + */ + @RequiresPermissions("quality:productReport:add") + @Log(title = "来料检验", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody QcCheckReportIncome qcCheckReportIncome) { + int r = qcCheckReportProductService.insertQcCheckReportIncome(qcCheckReportIncome); + if(r>0){ + return toAjax(r); + } + return error("添加失败:请检查物料的关联检测项"); + } + + /** + * 修改来料检验 + */ + @RequiresPermissions("quality:productReport:edit") + @Log(title = "来料检验", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody QcCheckReportIncome qcCheckReportIncome) { + return toAjax(qcCheckReportProductService.updateQcCheckReportIncome(qcCheckReportIncome)); + } + + /** + * 删除来料检验 + */ + @RequiresPermissions("quality:productReport:remove") + @Log(title = "来料检验", businessType = BusinessType.DELETE) + @DeleteMapping("/{recordIds}") + public AjaxResult remove(@PathVariable String[] recordIds) { + return toAjax(qcCheckReportProductService.deleteQcCheckReportIncomeByRecordIds(recordIds)); + } + + /** + * 查询BOM物料管理列表 + */ + @GetMapping("/getQcListBom") + public TableDataInfo getQcListBom(QcBomComponent bomComponent) { + startPage(); + List list = qcCheckReportProductService.getQcListBom(bomComponent); + return getDataTable(list); + } + /** + * 查询供应商列表 + */ + @GetMapping("/getQcListSupplier") + public TableDataInfo getQcListSupplier(QcSupplier qcSupplier) { + startPage(); + List list = qcCheckReportProductService.getQcListSupplier(qcSupplier); + return getDataTable(list); + } + /** + * 查询人员列表 + */ + @GetMapping("/getQcListUser") + public TableDataInfo getQcListUser(SysUser sysUser) { + startPage(); + List list = qcCheckReportProductService.getQcListUser(sysUser); + return getDataTable(list); + } + + /** + * 状态修改 + */ + @PutMapping("/changeIncomeStatus") + public AjaxResult changeIncomeStatus(@RequestBody QcCheckReportIncome qcCheckReportIncome) { + qcCheckReportIncome.setUpdateBy(SecurityUtils.getUsername()); + qcCheckReportIncome.setUpdateTime(DateUtils.getNowDate()); + return toAjax(qcCheckReportProductService.updateIncomeStatus(qcCheckReportIncome)); + } + + /** + * 检验项目弹窗列表 + * @param + * @return + */ + @GetMapping("/getCkeckProjectList") + public TableDataInfo getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail) { + startPage(); + List list = qcCheckReportProductService.getCkeckProjectList(qcCheckTaskDetail); + return getDataTable(list); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckReportProduceService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckReportProduceService.java new file mode 100644 index 00000000..d3adf69a --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckReportProduceService.java @@ -0,0 +1,77 @@ +package com.op.quality.service; + +import com.op.quality.domain.QcBomComponent; +import com.op.quality.domain.QcCheckReportIncome; +import com.op.quality.domain.QcCheckTaskDetail; +import com.op.quality.domain.QcSupplier; +import com.op.system.api.domain.SysUser; + +import java.util.List; + +/** + * 生产过程报告Service接口 + * + * @author Open Platform + * @date 2023-10-19 + */ +public interface IQcCheckReportProduceService { + /** + * 查询生产过程报告 + * + * @param recordId 生产过程报告主键 + * @return 生产过程检验 + */ + public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId); + + /** + * 查询生产过程报告列表 + * + * @param qcCheckReportIncome 生产过程报告 + * @return 生产过程检验集合 + */ + public List selectQcCheckReportIncomeList(QcCheckReportIncome qcCheckReportIncome); + + /** + * 新增生产过程报告 + * + * @param qcCheckReportIncome 生产过程报告 + * @return 结果 + */ + public int insertQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome); + + /** + * 修改生产过程报告 + * + * @param qcCheckReportIncome 生产过程报告 + * @return 结果 + */ + public int updateQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome); + + /** + * 批量删除生产过程报告 + * + * @param recordIds 需要删除的生产过程报告主键集合 + * @return 结果 + */ + public int deleteQcCheckReportIncomeByRecordIds(String[] recordIds); + + /** + * 删除生产过程报告信息 + * + * @param recordId 生产过程报告主键 + * @return 结果 + */ + public int deleteQcCheckReportIncomeByRecordId(String recordId); + + public List getQcListBom(QcBomComponent bomComponent); + + public List getQcListSupplier(QcSupplier qcSupplier); + + public List getQcListUser(SysUser sysUser); + + int updateIncomeStatus(QcCheckReportIncome qcCheckReportIncome); + + List getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail); + + public List getPrintData(QcCheckReportIncome qcCheckReportIncome); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckReportProductService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckReportProductService.java new file mode 100644 index 00000000..136def0c --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckReportProductService.java @@ -0,0 +1,77 @@ +package com.op.quality.service; + +import com.op.quality.domain.QcBomComponent; +import com.op.quality.domain.QcCheckReportIncome; +import com.op.quality.domain.QcCheckTaskDetail; +import com.op.quality.domain.QcSupplier; +import com.op.system.api.domain.SysUser; + +import java.util.List; + +/** + * 成品入库报告Service接口 + * + * @author Open Platform + * @date 2023-10-19 + */ +public interface IQcCheckReportProductService { + /** + * 查询成品入库报告 + * + * @param recordId 成品入库报告主键 + * @return 成品入库检验 + */ + public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId); + + /** + * 查询成品入库报告列表 + * + * @param qcCheckReportIncome 成品入库报告 + * @return 成品入库检验集合 + */ + public List selectQcCheckReportIncomeList(QcCheckReportIncome qcCheckReportIncome); + + /** + * 新增成品入库报告 + * + * @param qcCheckReportIncome 成品入库报告 + * @return 结果 + */ + public int insertQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome); + + /** + * 修改成品入库报告 + * + * @param qcCheckReportIncome 成品入库报告 + * @return 结果 + */ + public int updateQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome); + + /** + * 批量删除成品入库报告 + * + * @param recordIds 需要删除的成品入库报告主键集合 + * @return 结果 + */ + public int deleteQcCheckReportIncomeByRecordIds(String[] recordIds); + + /** + * 删除成品入库报告信息 + * + * @param recordId 成品入库报告主键 + * @return 结果 + */ + public int deleteQcCheckReportIncomeByRecordId(String recordId); + + public List getQcListBom(QcBomComponent bomComponent); + + public List getQcListSupplier(QcSupplier qcSupplier); + + public List getQcListUser(SysUser sysUser); + + int updateIncomeStatus(QcCheckReportIncome qcCheckReportIncome); + + List getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail); + + public List getPrintData(QcCheckReportIncome qcCheckReportIncome); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckReportProduceServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckReportProduceServiceImpl.java new file mode 100644 index 00000000..6dc406d3 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckReportProduceServiceImpl.java @@ -0,0 +1,203 @@ +package com.op.quality.service.serviceImpl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.uuid.IdUtils; +import com.op.common.security.utils.SecurityUtils; +import com.op.quality.domain.*; +import com.op.quality.mapper.QcCheckReportIncomeMapper; +import com.op.quality.mapper.QcCheckTaskDetailMapper; +import com.op.quality.mapper.QcCheckTypeProjectMapper; +import com.op.quality.mapper.QcMaterialGroupDetailMapper; +import com.op.quality.service.IQcCheckReportProduceService; +import com.op.system.api.domain.SysUser; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.List; + +/** + * 来料检验Service业务层处理 + * + * @author Open Platform + * @date 2023-10-19 + */ +@Service +public class QcCheckReportProduceServiceImpl implements IQcCheckReportProduceService { + @Autowired + private QcCheckReportIncomeMapper qcCheckReportIncomeMapper; + + @Autowired + private QcCheckTypeProjectMapper qcCheckTypeProjectMapper; + + @Autowired + private QcMaterialGroupDetailMapper qcMaterialGroupDetailMapper; + + @Autowired + private QcCheckTaskDetailMapper qcCheckTaskDetailMapper; + + /** + * 查询来料检验 + * + * @param recordId 来料检验主键 + * @return 来料检验 + */ + @Override + @DS("#header.poolName") + public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId) { + return qcCheckReportIncomeMapper.selectQcCheckReportIncomeByRecordId(recordId); + } + + /** + * 查询来料检验列表 + * + * @param qcCheckReportIncome 来料检验 + * @return 来料检验 + */ + @Override + @DS("#header.poolName") + public List selectQcCheckReportIncomeList(QcCheckReportIncome qcCheckReportIncome) { + qcCheckReportIncome.setDelFlag("0"); + return qcCheckReportIncomeMapper.selectQcCheckReportIncomeList(qcCheckReportIncome); + } + + /** + * 新增来料检验 + * + * @param qcCheckReportIncome 来料检验 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome) { + + String bpDD = DateUtils.parseDateToStr(DateUtils.YYYYMMDD, DateUtils.getNowDate()); + int liushuiNum = qcCheckReportIncomeMapper.getTodayMaxNum(qcCheckReportIncome); + String liushuiStr = String.format("%04d", liushuiNum); + + String createBy = SecurityUtils.getUsername(); + Date nowDate= DateUtils.getNowDate(); + //获取当前所选工厂 + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; + String factoryCode = request.getHeader(key.substring(8)).replace("ds_",""); + + qcCheckReportIncome.setCheckNo(bpDD+liushuiStr); + + /**qc_check_task_income**/ + String beLongId = IdUtils.fastSimpleUUID(); + qcCheckReportIncome.setRecordId(beLongId); + qcCheckReportIncome.setFactoryCode(factoryCode); + qcCheckReportIncome.setCreateTime(nowDate); + qcCheckReportIncomeMapper.insertQcCheckReportIncome(qcCheckReportIncome); + + /**取检测项**/ + QcCheckTypeProject qctp= new QcCheckTypeProject(); + qctp.setTypeId(qcCheckReportIncome.getCheckType());//生产过程检验 + qctp.setMaterialCode(qcCheckReportIncome.getMaterialCode());//特性 + /**qc_check_type_project**/ + List items = qcCheckTypeProjectMapper.getTPByTypeMaterial(qctp); + if(CollectionUtils.isEmpty(items)){ + /**qc_material_group_detail**/ + QcMaterialGroupDetail group = qcMaterialGroupDetailMapper.getGroupByMaterial(qcCheckReportIncome.getMaterialCode()); + if(group == null){ + return 0;//没有找到检测项目 + } + qctp.setGroupId(group.getGroupId());//共性 + items = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp); + } + + /**qc_check_task_detail**/ + if(CollectionUtils.isEmpty(items)){ + return 0;//没有找到检测项目 + } + + for(QcCheckTaskDetail item:items){ + item.setRecordId(IdUtils.fastSimpleUUID()); + item.setBelongTo(beLongId); + item.setCreateTime(nowDate); + item.setCreateBy(createBy); + item.setFactoryCode(factoryCode); + item.setStatus("N"); + } + return qcCheckTaskDetailMapper.addBatch(items); + } + + /** + * 修改来料检验 + * + * @param qcCheckReportIncome 来料检验 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome) { + qcCheckReportIncome.setUpdateTime(DateUtils.getNowDate()); + return qcCheckReportIncomeMapper.updateQcCheckReportIncome(qcCheckReportIncome); + } + + /** + * 批量删除来料检验 + * + * @param recordIds 需要删除的来料检验主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteQcCheckReportIncomeByRecordIds(String[] recordIds) { + return qcCheckReportIncomeMapper.deleteQcCheckReportIncomeByRecordIds(recordIds); + } + + /** + * 删除来料检验信息 + * + * @param recordId 来料检验主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteQcCheckReportIncomeByRecordId(String recordId) { + return qcCheckReportIncomeMapper.deleteQcCheckReportIncomeByRecordId(recordId); + } + + @Override + @DS("#header.poolName") + public List getQcListBom(QcBomComponent bomComponent) { + return qcCheckReportIncomeMapper.getQcListBom(bomComponent); + } + + @Override + @DS("#header.poolName") + public List getQcListSupplier(QcSupplier qcSupplier) { + return qcCheckReportIncomeMapper.getQcListSupplier(qcSupplier); + } + + //在公共库里不需要切库 + @Override + public List getQcListUser(SysUser sysUser) { + return qcCheckReportIncomeMapper.getQcListUser(sysUser); + } + + @Override + @DS("#header.poolName") + public int updateIncomeStatus(QcCheckReportIncome qcCheckReportIncome) { + return qcCheckReportIncomeMapper.updateQcCheckReportIncome(qcCheckReportIncome); + } + + @Override + @DS("#header.poolName") + public List getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail) { + return qcCheckReportIncomeMapper.getCkeckProjectList(qcCheckTaskDetail); + } + + @Override + public List getPrintData(QcCheckReportIncome qcCheckReportIncome) { + return null; + } + +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckReportProductServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckReportProductServiceImpl.java new file mode 100644 index 00000000..230b35eb --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcCheckReportProductServiceImpl.java @@ -0,0 +1,203 @@ +package com.op.quality.service.serviceImpl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.uuid.IdUtils; +import com.op.common.security.utils.SecurityUtils; +import com.op.quality.domain.*; +import com.op.quality.mapper.QcCheckReportIncomeMapper; +import com.op.quality.mapper.QcCheckTaskDetailMapper; +import com.op.quality.mapper.QcCheckTypeProjectMapper; +import com.op.quality.mapper.QcMaterialGroupDetailMapper; +import com.op.quality.service.IQcCheckReportProductService; +import com.op.system.api.domain.SysUser; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.List; + +/** + * 来料检验Service业务层处理 + * + * @author Open Platform + * @date 2023-10-19 + */ +@Service +public class QcCheckReportProductServiceImpl implements IQcCheckReportProductService { + @Autowired + private QcCheckReportIncomeMapper qcCheckReportIncomeMapper; + + @Autowired + private QcCheckTypeProjectMapper qcCheckTypeProjectMapper; + + @Autowired + private QcMaterialGroupDetailMapper qcMaterialGroupDetailMapper; + + @Autowired + private QcCheckTaskDetailMapper qcCheckTaskDetailMapper; + + /** + * 查询来料检验 + * + * @param recordId 来料检验主键 + * @return 来料检验 + */ + @Override + @DS("#header.poolName") + public QcCheckReportIncome selectQcCheckReportIncomeByRecordId(String recordId) { + return qcCheckReportIncomeMapper.selectQcCheckReportIncomeByRecordId(recordId); + } + + /** + * 查询来料检验列表 + * + * @param qcCheckReportIncome 来料检验 + * @return 来料检验 + */ + @Override + @DS("#header.poolName") + public List selectQcCheckReportIncomeList(QcCheckReportIncome qcCheckReportIncome) { + qcCheckReportIncome.setDelFlag("0"); + return qcCheckReportIncomeMapper.selectQcCheckReportIncomeList(qcCheckReportIncome); + } + + /** + * 新增来料检验 + * + * @param qcCheckReportIncome 来料检验 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome) { + + String bpDD = DateUtils.parseDateToStr(DateUtils.YYYYMMDD, DateUtils.getNowDate()); + int liushuiNum = qcCheckReportIncomeMapper.getTodayMaxNum(qcCheckReportIncome); + String liushuiStr = String.format("%04d", liushuiNum); + + String createBy = SecurityUtils.getUsername(); + Date nowDate= DateUtils.getNowDate(); + //获取当前所选工厂 + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; + String factoryCode = request.getHeader(key.substring(8)).replace("ds_",""); + + qcCheckReportIncome.setCheckNo(bpDD+liushuiStr); + + /**qc_check_task_income**/ + String beLongId = IdUtils.fastSimpleUUID(); + qcCheckReportIncome.setRecordId(beLongId); + qcCheckReportIncome.setFactoryCode(factoryCode); + qcCheckReportIncome.setCreateTime(nowDate); + qcCheckReportIncomeMapper.insertQcCheckReportIncome(qcCheckReportIncome); + + /**取检测项**/ + QcCheckTypeProject qctp= new QcCheckTypeProject(); + qctp.setTypeId(qcCheckReportIncome.getCheckType());//生产过程检验 + qctp.setMaterialCode(qcCheckReportIncome.getMaterialCode());//特性 + /**qc_check_type_project**/ + List items = qcCheckTypeProjectMapper.getTPByTypeMaterial(qctp); + if(CollectionUtils.isEmpty(items)){ + /**qc_material_group_detail**/ + QcMaterialGroupDetail group = qcMaterialGroupDetailMapper.getGroupByMaterial(qcCheckReportIncome.getMaterialCode()); + if(group == null){ + return 0;//没有找到检测项目 + } + qctp.setGroupId(group.getGroupId());//共性 + items = qcCheckTypeProjectMapper.getTPByTypeGroup(qctp); + } + + /**qc_check_task_detail**/ + if(CollectionUtils.isEmpty(items)){ + return 0;//没有找到检测项目 + } + + for(QcCheckTaskDetail item:items){ + item.setRecordId(IdUtils.fastSimpleUUID()); + item.setBelongTo(beLongId); + item.setCreateTime(nowDate); + item.setCreateBy(createBy); + item.setFactoryCode(factoryCode); + item.setStatus("N"); + } + return qcCheckTaskDetailMapper.addBatch(items); + } + + /** + * 修改来料检验 + * + * @param qcCheckReportIncome 来料检验 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateQcCheckReportIncome(QcCheckReportIncome qcCheckReportIncome) { + qcCheckReportIncome.setUpdateTime(DateUtils.getNowDate()); + return qcCheckReportIncomeMapper.updateQcCheckReportIncome(qcCheckReportIncome); + } + + /** + * 批量删除来料检验 + * + * @param recordIds 需要删除的来料检验主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteQcCheckReportIncomeByRecordIds(String[] recordIds) { + return qcCheckReportIncomeMapper.deleteQcCheckReportIncomeByRecordIds(recordIds); + } + + /** + * 删除来料检验信息 + * + * @param recordId 来料检验主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteQcCheckReportIncomeByRecordId(String recordId) { + return qcCheckReportIncomeMapper.deleteQcCheckReportIncomeByRecordId(recordId); + } + + @Override + @DS("#header.poolName") + public List getQcListBom(QcBomComponent bomComponent) { + return qcCheckReportIncomeMapper.getQcListBom(bomComponent); + } + + @Override + @DS("#header.poolName") + public List getQcListSupplier(QcSupplier qcSupplier) { + return qcCheckReportIncomeMapper.getQcListSupplier(qcSupplier); + } + + //在公共库里不需要切库 + @Override + public List getQcListUser(SysUser sysUser) { + return qcCheckReportIncomeMapper.getQcListUser(sysUser); + } + + @Override + @DS("#header.poolName") + public int updateIncomeStatus(QcCheckReportIncome qcCheckReportIncome) { + return qcCheckReportIncomeMapper.updateQcCheckReportIncome(qcCheckReportIncome); + } + + @Override + @DS("#header.poolName") + public List getCkeckProjectList(QcCheckTaskDetail qcCheckTaskDetail) { + return qcCheckReportIncomeMapper.getCkeckProjectList(qcCheckTaskDetail); + } + + @Override + public List getPrintData(QcCheckReportIncome qcCheckReportIncome) { + return null; + } + +} diff --git a/op-modules/op-scada/src/main/java/com/op/scada/controller/ScadaController.java b/op-modules/op-scada/src/main/java/com/op/scada/controller/ScadaController.java new file mode 100644 index 00000000..65df0839 --- /dev/null +++ b/op-modules/op-scada/src/main/java/com/op/scada/controller/ScadaController.java @@ -0,0 +1,50 @@ +package com.op.scada.controller; + +import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.StringUtils; +import com.op.common.core.web.controller.BaseController; +import com.op.scada.service.ScadaService; +import com.op.system.api.domain.dto.WCSDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * mes上位机专属 + * + * @author sf + * @date 2023-05-18 + */ +@RestController +@RequestMapping("/scadaInterface") +public class ScadaController extends BaseController { + + @Autowired + private ScadaService scadaService; + + + /** + * 下一工序机台集合获取 + * •接口描述:成型机码垛完、暂存区、WCS 请求 MES 获取目的地集合 + * •触发时机:托盘到达 AGV 接驳口 + * @param + * @return + */ + //"下一工序机台集合获取" + @PostMapping("/requestDestinationStations") + public WCSDTO requestDestinationStations(@RequestBody WCSDTO wcsdto) { + if(StringUtils.isBlank(wcsdto.getFactory())){ + wcsdto.setCode("1"); + wcsdto.setMessage("factory is not null"); + return wcsdto; + } + return scadaService.requestDestinationStations(wcsdto); + } + + + public static void main(String args[]){ + System.out.println(DateUtils.getDate()); + } +} diff --git a/op-modules/op-scada/src/main/java/com/op/scada/mapper/ScadaMapper.java b/op-modules/op-scada/src/main/java/com/op/scada/mapper/ScadaMapper.java new file mode 100644 index 00000000..1775385b --- /dev/null +++ b/op-modules/op-scada/src/main/java/com/op/scada/mapper/ScadaMapper.java @@ -0,0 +1,27 @@ +package com.op.scada.mapper; + +import com.op.system.api.domain.mes.ProRfidProcessDetail; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 生产rfid流程Mapper接口 + * + * @author Open Platform + * @date 2023-08-18 + */ +@Mapper +public interface ScadaMapper { + + public ProRfidProcessDetail getRfidInfo(String rfidNo); + + public String getStationType(String equipmentCode); + + Integer getEquipNum(String machineCode); + + String getEquipStatus(String machineCode); + + String getEquipMode(String machineCode); +} + diff --git a/op-modules/op-scada/src/main/java/com/op/scada/service/ScadaService.java b/op-modules/op-scada/src/main/java/com/op/scada/service/ScadaService.java new file mode 100644 index 00000000..49f07204 --- /dev/null +++ b/op-modules/op-scada/src/main/java/com/op/scada/service/ScadaService.java @@ -0,0 +1,18 @@ +package com.op.scada.service; + +import com.op.system.api.domain.dto.WCSDTO; + +import java.util.List; +import java.util.Map; + +/** + * 订单Service接口 + * + * @author Open Platform + * @date 2023-07-13 + */ +public interface ScadaService { + + WCSDTO requestDestinationStations(WCSDTO wcsdto); + +} diff --git a/op-modules/op-scada/src/main/java/com/op/scada/service/impl/ScadaServiceImpl.java b/op-modules/op-scada/src/main/java/com/op/scada/service/impl/ScadaServiceImpl.java new file mode 100644 index 00000000..f1756488 --- /dev/null +++ b/op-modules/op-scada/src/main/java/com/op/scada/service/impl/ScadaServiceImpl.java @@ -0,0 +1,147 @@ +package com.op.scada.service.impl; + +import com.alibaba.fastjson2.JSONArray; +import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; +import com.op.common.core.utils.bean.BeanUtils; +import com.op.scada.mapper.ScadaMapper; +import com.op.scada.service.ScadaService; +import com.op.system.api.domain.dto.WCSDTO; +import com.op.system.api.domain.dto.WCSDataDTO; +import com.op.system.api.domain.mes.ProRfidProcessDetail; +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.time.temporal.ChronoUnit; +import java.util.*; +import java.util.stream.Collectors; + +/** + * wcs接口业务层处理 + * + * @author Open Platform + * @date 2023-07-13 + */ +@Service +public class ScadaServiceImpl implements ScadaService { + protected Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private ScadaMapper scadaMapper; + + + /**下一工序机台集合获取 + * JSON + * { + * "reqCode": "eb7f8e9f-d1e8-499e-9bcb-e72d3ac195b0", //请求ID + * "reqTime": "2023-06-30 21:24:04", //请求时间, + * "rfidNo": "r12345" //rfid编号 + * "factory" + * } + * + * JSON + * { + * "reqCode": "eb7f8e9f-d1e8-499e-9bcb-e72d3ac195b0", //请求ID + * "code": 0, //返回代码 + * "message": "OK", //返回信息 + * "stationType": "2", //目的机台类型 2烘房 3收坯机 + * "sku": "sku01", //物料编码 + * "spec": "150", //规格 + * "productionState": "K01", //当前工艺状态 + * "stationNos": [ + * { + * "stationNo": "F1", //目的站台编号 + * "qty": 2 //针对于烘房前面的当前筛盘车的数量,如果数量大于2就不会往改烘房分配 + * }, + * { + * "stationNo": "F3", //目的站台编号 + * "qty": 2 //针对于烘房前面的当前筛盘车的数量,如果数量大于2就不会往改烘房分配 + * }, + * { + * "stationNo": "F3", //目的站台编号 + * "qty": 2 //针对于烘房前面的当前筛盘车的数量,如果数量大于2就不会往改烘房分配 + * } + * ], + * } + * @param wcsdto + * @return + */ + @Override + public WCSDTO requestDestinationStations(WCSDTO wcsdto) { + + DynamicDataSourceContextHolder.push("ds_" + wcsdto.getFactory()); + WCSDTO dto = new WCSDTO();//最终结果 + try { + BeanUtils.copyBeanProp(dto, wcsdto); + //根据rfid跟工单绑定,成型机跟工单绑定,获取对应工艺。 + ProRfidProcessDetail rfidInfo = scadaMapper.getRfidInfo(wcsdto.getRfidNo()); + //获取设备类型 + if (rfidInfo != null && StringUtils.isNotBlank(rfidInfo.getMachineCode())) { + //设备-工艺路线的设备大范围 + String[] machineCodes0 = rfidInfo.getMachineCode().split(","); + String stationType = scadaMapper.getStationType(machineCodes0[0]); + if (StringUtils.isNotBlank(stationType)) { + dto.setStationType(stationType); + } + //设备-根据工单获取实际规划设备路线 + String machinecode = rfidInfo.getProdLineCode();//scadaMapper.getActuaEquips(rfidInfo); + JSONArray codeArray = JSONArray.parseArray(machinecode); + List list2 = new ArrayList<>(); + for (int c1 = 0; c1 < codeArray.size(); c1++) { + String equipCode0 = codeArray.getJSONArray(c1).getString(1); + list2.add(equipCode0); + } + + //取交集 + List list1 = Arrays.asList(machineCodes0); + List machineArray = list1.stream() + .filter(u1 -> list2.contains(u1)) + .collect(Collectors.toList()); + + dto.setSku(rfidInfo.getProductCode()); + dto.setSpec(rfidInfo.getProductModel()); + dto.setProductionState(rfidInfo.getNowProcessId()); + List stationNos = new ArrayList<>(); + WCSDataDTO wCSDataDTO = null; + for (String machineCode : machineArray) { + wCSDataDTO = new WCSDataDTO(); + if (StringUtils.isNotBlank(machineCode)) { + //设备是否正常 + String status = scadaMapper.getEquipStatus(machineCode); + if(StringUtils.isNotBlank(status) && "1".equals(status)){//正常设备且没被删除 + wCSDataDTO.setStationNo(machineCode); + if ("2".equals(stationType)) { + Integer qty = scadaMapper.getEquipNum(machineCode); + wCSDataDTO.setQty(qty == null ? 0 : qty); + String mode = scadaMapper.getEquipMode(machineCode); + wCSDataDTO.setFlag(mode); + } + stationNos.add(wCSDataDTO); + } + } + } + dto.setStationNos(stationNos); + dto.setCode("0"); + }else{ + dto.setCode("1"); + dto.setMessage("MES管理系统接口调用异常:数据缺失"); + } + }catch (Exception e){ + dto.setCode("1"); + dto.setMessage("MES管理系统接口调用失败"); + } + return dto; + } + + public static void main(String args[]){ + DateTimeFormatter ymdhms = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + LocalDate today = LocalDate.now(); + LocalDate lastMonth3 = today.plus(-3, ChronoUnit.MONTHS); + + System.out.println("7天之前的日期为:"+lastMonth3.getYear()); + } +} diff --git a/op-modules/op-scada/src/main/resources/bootstrap.yml b/op-modules/op-scada/src/main/resources/bootstrap.yml index 72888f58..196b279b 100644 --- a/op-modules/op-scada/src/main/resources/bootstrap.yml +++ b/op-modules/op-scada/src/main/resources/bootstrap.yml @@ -14,16 +14,16 @@ spring: nacos: discovery: namespace: lanju-op - group: prod-new + group: zxl # 服务注册地址 - server-addr: 192.168.202.20:8848 + server-addr: 175.27.215.92:8848 config: namespace: lanju-op - group: prod-new + group: zxl #命名空间 #group: local # 配置中心地址 - server-addr: 192.168.202.20:8848 + server-addr: 175.27.215.92:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/op-modules/op-scada/src/main/resources/mapper/scada/ScadaMapper.xml b/op-modules/op-scada/src/main/resources/mapper/scada/ScadaMapper.xml new file mode 100644 index 00000000..b30a2f5b --- /dev/null +++ b/op-modules/op-scada/src/main/resources/mapper/scada/ScadaMapper.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + +