diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquRepairOrderMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquRepairOrderMapper.xml index 40c7bc48f..fdaac173e 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquRepairOrderMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquRepairOrderMapper.xml @@ -348,7 +348,7 @@ sn.notice_type noticeType, sn.notice_content noticeContent, btu.user_name userCode, - btu.wx_id wxId + case when btu.wx_id is null then btu.user_name else btu.wx_id end wxId from sys_notice_group sng left join sys_notice sn on sng.notice_id = sn.notice_id left join base_team_user btu on sng.group_code = btu.team_code diff --git a/op-modules/op-energy/src/main/java/com/op/energy/record/mapper/RecordDnbInstantMapper.java b/op-modules/op-energy/src/main/java/com/op/energy/record/mapper/RecordDnbInstantMapper.java index 3a68283b1..bfa610d61 100644 --- a/op-modules/op-energy/src/main/java/com/op/energy/record/mapper/RecordDnbInstantMapper.java +++ b/op-modules/op-energy/src/main/java/com/op/energy/record/mapper/RecordDnbInstantMapper.java @@ -3,6 +3,7 @@ package com.op.energy.record.mapper; import com.op.energy.record.domain.RecordDnbInstant; import java.util.List; +import java.util.Map; /** @@ -75,4 +76,11 @@ public interface RecordDnbInstantMapper { * @return */ List selectRealTimeParentList(RecordDnbInstant baseDnbInstant); + + /** + * 实时数据 + * @param paramMap + * @return + */ + List tablewareDetailsInfo(Map paramMap); } diff --git a/op-modules/op-energy/src/main/java/com/op/energy/report/controller/BoardController.java b/op-modules/op-energy/src/main/java/com/op/energy/report/controller/BoardController.java index ff295eec4..6973796e9 100644 --- a/op-modules/op-energy/src/main/java/com/op/energy/report/controller/BoardController.java +++ b/op-modules/op-energy/src/main/java/com/op/energy/report/controller/BoardController.java @@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -271,4 +272,30 @@ public class BoardController extends BaseController { return AjaxResult.success(result); } + /** + * new表具状态-线路配置信息 + * @param paramMap + * @return + */ + @ResponseBody + @GetMapping("/fixtureStatus") + public AjaxResult fixtureStatus(@RequestParam(required = false) Map paramMap){ + Map result = boardService.fixtureStatus(paramMap); + return AjaxResult.success(result); + } + + /** + * 表具实时状态 + * @param paramMap + * @return + */ + @GetMapping( "/tablewareDetailsInfo") + @ResponseBody + public AjaxResult tablewareDetailsInfo(@RequestParam(required = false) Map paramMap){ + Map result = boardService.tablewareDetailsInfo(paramMap); + return AjaxResult.success(result); + } + + + } diff --git a/op-modules/op-energy/src/main/java/com/op/energy/report/service/IBoardService.java b/op-modules/op-energy/src/main/java/com/op/energy/report/service/IBoardService.java index 3a496ea72..9a6da6218 100644 --- a/op-modules/op-energy/src/main/java/com/op/energy/report/service/IBoardService.java +++ b/op-modules/op-energy/src/main/java/com/op/energy/report/service/IBoardService.java @@ -2,6 +2,7 @@ package com.op.energy.report.service; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -53,4 +54,19 @@ public interface IBoardService { * @return */ ArrayList> parkEnergyRanking(Map paramMap); + + /** + * new表具状态信息 + * @param paramMap + * @return + */ + Map fixtureStatus(Map paramMap); + + /** + * 表具实时状态 + * @param paramMap + * @return + */ + Map tablewareDetailsInfo(Map paramMap); + } diff --git a/op-modules/op-energy/src/main/java/com/op/energy/report/service/impl/BoardServiceImpl.java b/op-modules/op-energy/src/main/java/com/op/energy/report/service/impl/BoardServiceImpl.java index 17a645825..03fc033f8 100644 --- a/op-modules/op-energy/src/main/java/com/op/energy/report/service/impl/BoardServiceImpl.java +++ b/op-modules/op-energy/src/main/java/com/op/energy/report/service/impl/BoardServiceImpl.java @@ -2,10 +2,7 @@ package com.op.energy.report.service.impl; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; -import com.op.energy.base.domain.BaseCollectDeviceInfo; -import com.op.energy.base.domain.BaseLineMonitor; -import com.op.energy.base.domain.BaseTypeRelation; -import com.op.energy.base.domain.SysDatasource; +import com.op.energy.base.domain.*; import com.op.energy.base.mapper.BaseCollectDeviceInfoMapper; import com.op.energy.base.mapper.BaseLineMonitorMapper; import com.op.energy.base.mapper.BaseTypeRelationMapper; @@ -26,10 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; import static com.op.energy.base.service.impl.BaseLineMonitorServiceImpl.getNextLevelLineMonitorList; @@ -348,4 +342,67 @@ public class BoardServiceImpl implements IBoardService { } return result; } + + /** + * new表具状态信息 + * @param paramMap + * @return + */ + @Override + @DS("#header.poolName") + public Map fixtureStatus(Map paramMap) { + HashMap result = new HashMap<>(); + if (String.valueOf(paramMap.get("energyType")).equals("")) { + return result; + } + BaseLineMonitor lineMonitor = new BaseLineMonitor(); + lineMonitor.setMonitorType(Long.valueOf(String.valueOf(paramMap.get("energyType")))); + List list = baseLineMonitorService.selectBaseLineMonitorList(lineMonitor); + + if(paramMap.containsKey("objId")){ + Long objId = Long.valueOf(String.valueOf(paramMap.get("objId"))); + List arrayList = new ArrayList<>(); + lineMonitor.setParentId(objId); + List array2List = baseLineMonitorService.selectBaseLineMonitorList(lineMonitor); + for (BaseLineMonitor monitor : list) { + if (monitor.getObjid().equals(objId)){ + monitor.setParentId(0L); + arrayList.add(monitor); + } + } + list = new ArrayList<>(); + list.addAll(arrayList); + list.addAll(array2List); + } + + List ztrees = new ArrayList<>(); + for (BaseLineMonitor baseLineMonitor : list) { + Ztree ztree = new Ztree(); + ztree.setId(baseLineMonitor.getObjid()); + ztree.setpId(baseLineMonitor.getParentId()); + ztree.setName(baseLineMonitor.getMonitorName()); + ztree.setTitle(baseLineMonitor.getMonitorId()); + ztrees.add(ztree); + } + result.put("result", ztrees); + return result; + } + + + /** + * 表具实时状态 + * @param paramMap + * @return + */ + @Override + @DS("#header.poolName") + public Map tablewareDetailsInfo(Map paramMap) { + HashMap result = new HashMap<>(); + if (paramMap.containsKey("energyType") && String.valueOf(paramMap.get("energyType")).equals("2")){ + List recordDnbInstants = recordDnbInstantMapper.tablewareDetailsInfo(paramMap); + result.put("result", recordDnbInstants.get(0)); + } + return result; + } + } diff --git a/op-modules/op-energy/src/main/resources/mapper/base/BaseMonitorInfo1Mapper.xml b/op-modules/op-energy/src/main/resources/mapper/base/BaseMonitorInfo1Mapper.xml index 0c05a275b..bc5534481 100644 --- a/op-modules/op-energy/src/main/resources/mapper/base/BaseMonitorInfo1Mapper.xml +++ b/op-modules/op-energy/src/main/resources/mapper/base/BaseMonitorInfo1Mapper.xml @@ -92,7 +92,7 @@ + select d.monitor_id, + m.monitor_name, + m.monitor_addr address, + d.collect_time, + d.vA, + d.vB, + d.vC, + d.iA, + d.iB, + d.iC, + d.record_time, + d.glys, + d.zxyg, + d.active_power, + d.reactive_power, + d.collect_type, + bcdi.online_state onlineState, + isnull(pd.consumption,0) consumption + from record_dnb_instant d + join (select rdi.monitor_id, max(rdi.collect_time) collect_time + from record_dnb_instant rdi + where 1=1 + and rdi.monitor_id = #{monitorId} + group by rdi.monitor_id) md on md.collect_time = d.collect_time and md.monitor_id = d.monitor_id + left join base_monitor_info m on m.monitor_id = d.monitor_id + left join (select rpd.monitor_id, isnull(sum(rpd.expend), 0) consumption + from report_point_dnb rpd + where 1=1 + + and rpd.begin_time between #{params.beginCollectTime} and #{params.endCollectTime} + + group by rpd.monitor_id) pd on pd.monitor_id = m.monitor_id + left join base_collect_device_info bcdi on bcdi.collect_device_id = m.collect_device_id + + diff --git a/op-modules/op-energy/src/main/resources/mapper/report/ReportPointDnbMapper.xml b/op-modules/op-energy/src/main/resources/mapper/report/ReportPointDnbMapper.xml index 05a1204ed..ed81c996c 100644 --- a/op-modules/op-energy/src/main/resources/mapper/report/ReportPointDnbMapper.xml +++ b/op-modules/op-energy/src/main/resources/mapper/report/ReportPointDnbMapper.xml @@ -72,7 +72,7 @@ and point_time = #{pointTime} and (report_point_dnb.monitor_id = #{monitorSubset} OR report_point_dnb.monitor_id IN - (SELECT t.monitor_id FROM base_monitor_info t WHERE FIND_IN_SET(#{monitorSubset}, ancestors))) + (SELECT t.monitor_id FROM base_monitor_info t WHERE dbo.FIND_IN_SET(#{monitorSubset}, ancestors) > 0)) and begin_time between #{params.beginBeginTime} and #{params.endBeginTime} @@ -106,7 +106,7 @@ where report_point_dnb.objid = #{objid} diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml index 7ebd9c154..0fbd69669 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml @@ -687,16 +687,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from base_equipment be left join pro_order_workorder pow on be.equipment_code = pow.workorder_name left join mes_line ml on be.equipment_code = ml.line_code - where be.del_flag = '0' and be.sap_code is not null and pow.status = 'w3' + left join mes_line_product mlp on mlp.belong_to = ml.id and pow.product_code = mlp.product_code + where be.del_flag = '0' and be.sap_code is not null and pow.status = 'w3' and mlp.del_flag='0' and pow.parent_order = '0' and pow.del_flag='0' and ml.del_flag='0' and be.sap_name like concat('%', #{sapName}, '%') and be.workshop_code = #{workCenter} and be.equipment_type_code = #{equipmentTypeCode} - and CONVERT(varchar(10),pow.product_date, 23) > CONVERT(varchar(10), #{productDateStart}, 23) + and CONVERT(varchar(10),pow.product_date, 23) >= CONVERT(varchar(10), #{productDateStart}, 23) - and CONVERT(varchar(10), #{productDateEnd}, 23) > CONVERT(varchar(10),pow.product_date, 23) + and CONVERT(varchar(10), #{productDateEnd}, 23) >= CONVERT(varchar(10),pow.product_date, 23) order by be.equipment_code diff --git a/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml b/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml index c6e8efcb0..fb3d6d09b 100644 --- a/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml +++ b/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml @@ -392,7 +392,7 @@ sn.notice_type noticeType, sn.notice_content noticeContent, btu.user_name userCode, - btu.wx_id wxId + case when btu.wx_id is null then btu.user_name else btu.wx_id end wxId from sys_notice_group sng left join sys_notice sn on sng.notice_id = sn.notice_id left join base_team_user btu on sng.group_code = btu.team_code diff --git a/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrderWorkorder.java b/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrderWorkorder.java index 23134b663..37b807902 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrderWorkorder.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrderWorkorder.java @@ -1,5 +1,6 @@ package com.op.plan.domain; +import java.math.BigDecimal; import java.util.Date; import java.util.List; @@ -231,6 +232,7 @@ public class ProOrderWorkorder extends TreeEntity { // 车数 private Integer carNum; private Integer sortNo; + private BigDecimal umrez; public Integer getCarNum() { return carNum; @@ -267,6 +269,14 @@ public class ProOrderWorkorder extends TreeEntity { // 供湿料计划使用 private String bucketName1; + public BigDecimal getUmrez() { + return umrez; + } + + public void setUmrez(BigDecimal umrez) { + this.umrez = umrez; + } + public String getMaterialName1() { return materialName1; } diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java index fcf98e0ee..1a28b5a3b 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java @@ -1155,21 +1155,6 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService { String username = SecurityUtils.getUsername(); List workOrders = proOrderWorkorderMapper.selectWorkOrderIdByBatch(workOrderCode); - // 系数 - Long coefficient = 1L; - if(workOrders.size()==2){ - // 获取子母工单数量 - Optional pQuantity = workOrders.stream().filter(item -> "0".equals(item.getParentOrder())) - .findFirst().map(ProOrderWorkorder::getQuantitySplit); - Optional cQuantity = workOrders.stream().filter(item -> !"0".equals(item.getParentOrder())) - .findFirst().map(ProOrderWorkorder::getQuantitySplit); - - if (pQuantity.isPresent() && cQuantity.isPresent()) { - coefficient = cQuantity.get() / pQuantity.get(); - } - }else if(workOrders.size()==3){ - //TODO; - } int count = 0; for (int m=0;m diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcSampleRuleAqlController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcSampleRuleAqlController.java new file mode 100644 index 000000000..f0faa1d0d --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcSampleRuleAqlController.java @@ -0,0 +1,98 @@ +package com.op.quality.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +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.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.quality.domain.QcSampleRuleAql; +import com.op.quality.service.IQcSampleRuleAqlService; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.page.TableDataInfo; + +/** + * 抽样规则-接收质量限Controller + * + * @author Open Platform + * @date 2024-06-05 + */ +@RestController +@RequestMapping("/aql") +public class QcSampleRuleAqlController extends BaseController { + @Autowired + private IQcSampleRuleAqlService qcSampleRuleAqlService; + +/** + * 查询抽样规则-接收质量限列表 + */ +@RequiresPermissions("quality:aql:list") +@GetMapping("/list") + public TableDataInfo list(QcSampleRuleAql qcSampleRuleAql) { + startPage(); + List list = qcSampleRuleAqlService.selectQcSampleRuleAqlList(qcSampleRuleAql); + return getDataTable(list); + } + + /** + * 导出抽样规则-接收质量限列表 + */ + @RequiresPermissions("quality:aql:export") + @Log(title = "抽样规则-接收质量限", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, QcSampleRuleAql qcSampleRuleAql) { + List list = qcSampleRuleAqlService.selectQcSampleRuleAqlList(qcSampleRuleAql); + ExcelUtil util = new ExcelUtil(QcSampleRuleAql. class); + util.exportExcel(response, list, "抽样规则-接收质量限数据"); + } + + /** + * 获取抽样规则-接收质量限详细信息 + */ + @RequiresPermissions("quality:aql:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) { + return success(qcSampleRuleAqlService.selectQcSampleRuleAqlById(id)); + } + + /** + * 新增抽样规则-接收质量限 + */ + @RequiresPermissions("quality:aql:add") + @Log(title = "抽样规则-接收质量限", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody QcSampleRuleAql qcSampleRuleAql) { + return toAjax(qcSampleRuleAqlService.insertQcSampleRuleAql(qcSampleRuleAql)); + } + + /** + * 修改抽样规则-接收质量限 + */ + @RequiresPermissions("quality:aql:edit") + @Log(title = "抽样规则-接收质量限", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody QcSampleRuleAql qcSampleRuleAql) { + return toAjax(qcSampleRuleAqlService.updateQcSampleRuleAql(qcSampleRuleAql)); + } + + /** + * 删除抽样规则-接收质量限 + */ + @RequiresPermissions("quality:aql:remove") + @Log(title = "抽样规则-接收质量限", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) { + return toAjax(qcSampleRuleAqlService.deleteQcSampleRuleAqlByIds(ids)); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcSampleRuleCodeController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcSampleRuleCodeController.java new file mode 100644 index 000000000..5a46b4270 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcSampleRuleCodeController.java @@ -0,0 +1,98 @@ +package com.op.quality.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +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.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.quality.domain.QcSampleRuleCode; +import com.op.quality.service.IQcSampleRuleCodeService; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.page.TableDataInfo; + +/** + * 抽样规则-样品量字码Controller + * + * @author Open Platform + * @date 2024-06-05 + */ +@RestController +@RequestMapping("/code") +public class QcSampleRuleCodeController extends BaseController { + @Autowired + private IQcSampleRuleCodeService qcSampleRuleCodeService; + + /** + * 查询抽样规则-样品量字码列表 + */ + //@RequiresPermissions("quality:code:list") + @GetMapping("/list") + public TableDataInfo list(QcSampleRuleCode qcSampleRuleCode) { + startPage(); + List list = qcSampleRuleCodeService.selectQcSampleRuleCodeList(qcSampleRuleCode); + return getDataTable(list); + } + + /** + * 导出抽样规则-样品量字码列表 + */ + //@RequiresPermissions("quality:code:export") + @Log(title = "抽样规则-样品量字码", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, QcSampleRuleCode qcSampleRuleCode) { + List list = qcSampleRuleCodeService.selectQcSampleRuleCodeList(qcSampleRuleCode); + ExcelUtil util = new ExcelUtil(QcSampleRuleCode. class); + util.exportExcel(response, list, "抽样规则-样品量字码数据"); + } + + /** + * 获取抽样规则-样品量字码详细信息 + */ + //@RequiresPermissions("quality:code:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) { + return success(qcSampleRuleCodeService.selectQcSampleRuleCodeById(id)); + } + + /** + * 新增抽样规则-样品量字码 + */ + //@RequiresPermissions("quality:code:add") + @Log(title = "抽样规则-样品量字码", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody QcSampleRuleCode qcSampleRuleCode) { + return toAjax(qcSampleRuleCodeService.insertQcSampleRuleCode(qcSampleRuleCode)); + } + + /** + * 修改抽样规则-样品量字码 + */ + //@RequiresPermissions("quality:code:edit") + @Log(title = "抽样规则-样品量字码", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody QcSampleRuleCode qcSampleRuleCode) { + return toAjax(qcSampleRuleCodeService.updateQcSampleRuleCode(qcSampleRuleCode)); + } + + /** + * 删除抽样规则-样品量字码 + */ + //@RequiresPermissions("quality:code:remove") + @Log(title = "抽样规则-样品量字码", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) { + return toAjax(qcSampleRuleCodeService.deleteQcSampleRuleCodeByIds(ids)); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcSampleRuleAql.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcSampleRuleAql.java new file mode 100644 index 000000000..b58141247 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcSampleRuleAql.java @@ -0,0 +1,445 @@ +package com.op.quality.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; + +/** + * 抽样规则-接收质量限对象 qc_sample_rule_aql + * + * @author Open Platform + * @date 2024-06-05 + */ +public class QcSampleRuleAql extends BaseEntity { +private static final long serialVersionUID=1L; + + /** id */ + private String id; + + /** 样品量字码开始 */ + @Excel(name = "样品量字码开始") + private String sampleCode; + + /** 样品量字码结束 */ + @Excel(name = "样品量字码结束") + private String sampleAql; + + /** 预留字段1 */ + @Excel(name = "预留字段1") + private String attr1; + + /** 工厂编码 */ + @Excel(name = "工厂编码") + private String factoryCode; + + /** 删除标识1删除0正常 */ + private String delFlag; + + /** 最大坏量 */ + @Excel(name = "最大坏量") + private Long maxBadQuality; + + /** 小节点 */ + @Excel(name = "小节点") + private String checkType; + + /** 大节点 */ + @Excel(name = "大节点") + private String typeCode; + + /** 0.010 */ + @Excel(name = "0.010") + private Long aql1; + + /** 0.015 */ + @Excel(name = "0.015") + private Long aql2; + + /** 0.025 */ + @Excel(name = "0.025") + private Long aql3; + + /** 0.040 */ + @Excel(name = "0.040") + private Long aql4; + + /** 0.065 */ + @Excel(name = "0.065") + private Long aql5; + + /** 0.10 */ + @Excel(name = "0.10") + private Long aql6; + + /** 0.15 */ + @Excel(name = "0.15") + private Long aql7; + + /** 0.25 */ + @Excel(name = "0.25") + private Long aql8; + + /** 0.40 */ + @Excel(name = "0.40") + private Long aql9; + + /** 0.65 */ + @Excel(name = "0.65") + private Long aql10; + + /** 1.0 */ + @Excel(name = "1.0") + private Long aql11; + + /** 1.5 */ + @Excel(name = "1.5") + private Long aql12; + + /** 2.5 */ + @Excel(name = "2.5") + private Long aql13; + + /** 4.0 */ + @Excel(name = "4.0") + private Long aql14; + + /** 6.5 */ + @Excel(name = "6.5") + private Long aql15; + + /** 10 */ + @Excel(name = "10") + private Long aql16; + + /** 15 */ + @Excel(name = "15") + private Long aql17; + + /** 25 */ + @Excel(name = "25") + private Long aql18; + + /** 40 */ + @Excel(name = "40") + private Long aql19; + + /** 65 */ + @Excel(name = "65") + private Long aql20; + + /** 100 */ + @Excel(name = "100") + private Long aql21; + + /** 150 */ + @Excel(name = "150") + private Long aql22; + + /** 250 */ + @Excel(name = "250") + private Long aql23; + + /** 400 */ + @Excel(name = "400") + private Long aql24; + + /** 650 */ + @Excel(name = "650") + private Long aql25; + + /** 1000 */ + @Excel(name = "1000") + private Long aql26; + + public void setId(String id){ + this.id = id; + } + + public String getId(){ + return id; + } + public void setSampleCode(String sampleCode){ + this.sampleCode = sampleCode; + } + + public String getSampleCode(){ + return sampleCode; + } + public void setSampleAql(String sampleAql){ + this.sampleAql = sampleAql; + } + + public String getSampleAql(){ + return sampleAql; + } + public void setAttr1(String attr1){ + this.attr1 = attr1; + } + + public String getAttr1(){ + return attr1; + } + public void setFactoryCode(String factoryCode){ + this.factoryCode = factoryCode; + } + + public String getFactoryCode(){ + return factoryCode; + } + public void setDelFlag(String delFlag){ + this.delFlag = delFlag; + } + + public String getDelFlag(){ + return delFlag; + } + public void setMaxBadQuality(Long maxBadQuality){ + this.maxBadQuality = maxBadQuality; + } + + public Long getMaxBadQuality(){ + return maxBadQuality; + } + public void setCheckType(String checkType){ + this.checkType = checkType; + } + + public String getCheckType(){ + return checkType; + } + public void setTypeCode(String typeCode){ + this.typeCode = typeCode; + } + + public String getTypeCode(){ + return typeCode; + } + public void setAql1(Long aql1){ + this.aql1 = aql1; + } + + public Long getAql1(){ + return aql1; + } + public void setAql2(Long aql2){ + this.aql2 = aql2; + } + + public Long getAql2(){ + return aql2; + } + public void setAql3(Long aql3){ + this.aql3 = aql3; + } + + public Long getAql3(){ + return aql3; + } + public void setAql4(Long aql4){ + this.aql4 = aql4; + } + + public Long getAql4(){ + return aql4; + } + public void setAql5(Long aql5){ + this.aql5 = aql5; + } + + public Long getAql5(){ + return aql5; + } + public void setAql6(Long aql6){ + this.aql6 = aql6; + } + + public Long getAql6(){ + return aql6; + } + public void setAql7(Long aql7){ + this.aql7 = aql7; + } + + public Long getAql7(){ + return aql7; + } + public void setAql8(Long aql8){ + this.aql8 = aql8; + } + + public Long getAql8(){ + return aql8; + } + public void setAql9(Long aql9){ + this.aql9 = aql9; + } + + public Long getAql9(){ + return aql9; + } + public void setAql10(Long aql10){ + this.aql10 = aql10; + } + + public Long getAql10(){ + return aql10; + } + public void setAql11(Long aql11){ + this.aql11 = aql11; + } + + public Long getAql11(){ + return aql11; + } + public void setAql12(Long aql12){ + this.aql12 = aql12; + } + + public Long getAql12(){ + return aql12; + } + public void setAql13(Long aql13){ + this.aql13 = aql13; + } + + public Long getAql13(){ + return aql13; + } + public void setAql14(Long aql14){ + this.aql14 = aql14; + } + + public Long getAql14(){ + return aql14; + } + public void setAql15(Long aql15){ + this.aql15 = aql15; + } + + public Long getAql15(){ + return aql15; + } + public void setAql16(Long aql16){ + this.aql16 = aql16; + } + + public Long getAql16(){ + return aql16; + } + public void setAql17(Long aql17){ + this.aql17 = aql17; + } + + public Long getAql17(){ + return aql17; + } + public void setAql18(Long aql18){ + this.aql18 = aql18; + } + + public Long getAql18(){ + return aql18; + } + public void setAql19(Long aql19){ + this.aql19 = aql19; + } + + public Long getAql19(){ + return aql19; + } + public void setAql20(Long aql20){ + this.aql20 = aql20; + } + + public Long getAql20(){ + return aql20; + } + public void setAql21(Long aql21){ + this.aql21 = aql21; + } + + public Long getAql21(){ + return aql21; + } + public void setAql22(Long aql22){ + this.aql22 = aql22; + } + + public Long getAql22(){ + return aql22; + } + public void setAql23(Long aql23){ + this.aql23 = aql23; + } + + public Long getAql23(){ + return aql23; + } + public void setAql24(Long aql24){ + this.aql24 = aql24; + } + + public Long getAql24(){ + return aql24; + } + public void setAql25(Long aql25){ + this.aql25 = aql25; + } + + public Long getAql25(){ + return aql25; + } + public void setAql26(Long aql26){ + this.aql26 = aql26; + } + + public Long getAql26(){ + return aql26; + } + +@Override +public String toString(){ + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id",getId()) + .append("sampleCode",getSampleCode()) + .append("sampleAql",getSampleAql()) + .append("attr1",getAttr1()) + .append("createBy",getCreateBy()) + .append("createTime",getCreateTime()) + .append("updateBy",getUpdateBy()) + .append("updateTime",getUpdateTime()) + .append("factoryCode",getFactoryCode()) + .append("delFlag",getDelFlag()) + .append("maxBadQuality",getMaxBadQuality()) + .append("checkType",getCheckType()) + .append("typeCode",getTypeCode()) + .append("aql1",getAql1()) + .append("aql2",getAql2()) + .append("aql3",getAql3()) + .append("aql4",getAql4()) + .append("aql5",getAql5()) + .append("aql6",getAql6()) + .append("aql7",getAql7()) + .append("aql8",getAql8()) + .append("aql9",getAql9()) + .append("aql10",getAql10()) + .append("aql11",getAql11()) + .append("aql12",getAql12()) + .append("aql13",getAql13()) + .append("aql14",getAql14()) + .append("aql15",getAql15()) + .append("aql16",getAql16()) + .append("aql17",getAql17()) + .append("aql18",getAql18()) + .append("aql19",getAql19()) + .append("aql20",getAql20()) + .append("aql21",getAql21()) + .append("aql22",getAql22()) + .append("aql23",getAql23()) + .append("aql24",getAql24()) + .append("aql25",getAql25()) + .append("aql26",getAql26()) + .toString(); + } + } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcSampleRuleCode.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcSampleRuleCode.java new file mode 100644 index 000000000..cdd19ea25 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcSampleRuleCode.java @@ -0,0 +1,145 @@ +package com.op.quality.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; + +/** + * 抽样规则-样品量字码对象 qc_sample_rule_code + * + * @author Open Platform + * @date 2024-06-05 + */ +public class QcSampleRuleCode extends BaseEntity { +private static final long serialVersionUID=1L; + + /** id */ + private String id; + + /** 开始值 */ + @Excel(name = "开始值") + private Long startValue; + + /** 结束值 */ + @Excel(name = "结束值") + private Long endValue; + + /** 预留字段1 */ + @Excel(name = "预留字段1") + private String attr1; + + /** 工厂编码 */ + @Excel(name = "工厂编码") + private String factoryCode; + + /** 删除标识1删除0正常 */ + private String delFlag; + + /** 样品量字码 */ + @Excel(name = "样品量字码") + private String sampleCode; + + /** 小节点 */ + @Excel(name = "小节点") + private String checkType; + + /** 大节点 */ + @Excel(name = "大节点") + private String typeCode; + + /** 检测水平 */ + @Excel(name = "检测水平") + private String checkLevel; + + public void setId(String id){ + this.id = id; + } + + public String getId(){ + return id; + } + public void setStartValue(Long startValue){ + this.startValue = startValue; + } + + public Long getStartValue(){ + return startValue; + } + public void setEndValue(Long endValue){ + this.endValue = endValue; + } + + public Long getEndValue(){ + return endValue; + } + public void setAttr1(String attr1){ + this.attr1 = attr1; + } + + public String getAttr1(){ + return attr1; + } + public void setFactoryCode(String factoryCode){ + this.factoryCode = factoryCode; + } + + public String getFactoryCode(){ + return factoryCode; + } + public void setDelFlag(String delFlag){ + this.delFlag = delFlag; + } + + public String getDelFlag(){ + return delFlag; + } + public void setSampleCode(String sampleCode){ + this.sampleCode = sampleCode; + } + + public String getSampleCode(){ + return sampleCode; + } + public void setCheckType(String checkType){ + this.checkType = checkType; + } + + public String getCheckType(){ + return checkType; + } + public void setTypeCode(String typeCode){ + this.typeCode = typeCode; + } + + public String getTypeCode(){ + return typeCode; + } + public void setCheckLevel(String checkLevel){ + this.checkLevel = checkLevel; + } + + public String getCheckLevel(){ + return checkLevel; + } + +@Override +public String toString(){ + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id",getId()) + .append("startValue",getStartValue()) + .append("endValue",getEndValue()) + .append("attr1",getAttr1()) + .append("createBy",getCreateBy()) + .append("createTime",getCreateTime()) + .append("updateBy",getUpdateBy()) + .append("updateTime",getUpdateTime()) + .append("factoryCode",getFactoryCode()) + .append("delFlag",getDelFlag()) + .append("sampleCode",getSampleCode()) + .append("checkType",getCheckType()) + .append("typeCode",getTypeCode()) + .append("checkLevel",getCheckLevel()) + .toString(); + } + } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcSampleRuleAqlMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcSampleRuleAqlMapper.java new file mode 100644 index 000000000..fe0391cb3 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcSampleRuleAqlMapper.java @@ -0,0 +1,61 @@ +package com.op.quality.mapper; + +import java.util.List; + +import com.op.quality.domain.QcSampleRuleAql; + +/** + * 抽样规则-接收质量限Mapper接口 + * + * @author Open Platform + * @date 2024-06-05 + */ +public interface QcSampleRuleAqlMapper { + /** + * 查询抽样规则-接收质量限 + * + * @param id 抽样规则-接收质量限主键 + * @return 抽样规则-接收质量限 + */ + public QcSampleRuleAql selectQcSampleRuleAqlById(String id); + + /** + * 查询抽样规则-接收质量限列表 + * + * @param qcSampleRuleAql 抽样规则-接收质量限 + * @return 抽样规则-接收质量限集合 + */ + public List selectQcSampleRuleAqlList(QcSampleRuleAql qcSampleRuleAql); + + /** + * 新增抽样规则-接收质量限 + * + * @param qcSampleRuleAql 抽样规则-接收质量限 + * @return 结果 + */ + public int insertQcSampleRuleAql(QcSampleRuleAql qcSampleRuleAql); + + /** + * 修改抽样规则-接收质量限 + * + * @param qcSampleRuleAql 抽样规则-接收质量限 + * @return 结果 + */ + public int updateQcSampleRuleAql(QcSampleRuleAql qcSampleRuleAql); + + /** + * 删除抽样规则-接收质量限 + * + * @param id 抽样规则-接收质量限主键 + * @return 结果 + */ + public int deleteQcSampleRuleAqlById(String id); + + /** + * 批量删除抽样规则-接收质量限 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQcSampleRuleAqlByIds(String[] ids); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcSampleRuleCodeMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcSampleRuleCodeMapper.java new file mode 100644 index 000000000..5650981df --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcSampleRuleCodeMapper.java @@ -0,0 +1,61 @@ +package com.op.quality.mapper; + +import java.util.List; + +import com.op.quality.domain.QcSampleRuleCode; + +/** + * 抽样规则-样品量字码Mapper接口 + * + * @author Open Platform + * @date 2024-06-05 + */ +public interface QcSampleRuleCodeMapper { + /** + * 查询抽样规则-样品量字码 + * + * @param id 抽样规则-样品量字码主键 + * @return 抽样规则-样品量字码 + */ + public QcSampleRuleCode selectQcSampleRuleCodeById(String id); + + /** + * 查询抽样规则-样品量字码列表 + * + * @param qcSampleRuleCode 抽样规则-样品量字码 + * @return 抽样规则-样品量字码集合 + */ + public List selectQcSampleRuleCodeList(QcSampleRuleCode qcSampleRuleCode); + + /** + * 新增抽样规则-样品量字码 + * + * @param qcSampleRuleCode 抽样规则-样品量字码 + * @return 结果 + */ + public int insertQcSampleRuleCode(QcSampleRuleCode qcSampleRuleCode); + + /** + * 修改抽样规则-样品量字码 + * + * @param qcSampleRuleCode 抽样规则-样品量字码 + * @return 结果 + */ + public int updateQcSampleRuleCode(QcSampleRuleCode qcSampleRuleCode); + + /** + * 删除抽样规则-样品量字码 + * + * @param id 抽样规则-样品量字码主键 + * @return 结果 + */ + public int deleteQcSampleRuleCodeById(String id); + + /** + * 批量删除抽样规则-样品量字码 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteQcSampleRuleCodeByIds(String[] ids); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcSampleRuleAqlService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcSampleRuleAqlService.java new file mode 100644 index 000000000..71efc1c08 --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcSampleRuleAqlService.java @@ -0,0 +1,61 @@ +package com.op.quality.service; + +import java.util.List; + +import com.op.quality.domain.QcSampleRuleAql; + +/** + * 抽样规则-接收质量限Service接口 + * + * @author Open Platform + * @date 2024-06-05 + */ +public interface IQcSampleRuleAqlService { + /** + * 查询抽样规则-接收质量限 + * + * @param id 抽样规则-接收质量限主键 + * @return 抽样规则-接收质量限 + */ + public QcSampleRuleAql selectQcSampleRuleAqlById(String id); + + /** + * 查询抽样规则-接收质量限列表 + * + * @param qcSampleRuleAql 抽样规则-接收质量限 + * @return 抽样规则-接收质量限集合 + */ + public List selectQcSampleRuleAqlList(QcSampleRuleAql qcSampleRuleAql); + + /** + * 新增抽样规则-接收质量限 + * + * @param qcSampleRuleAql 抽样规则-接收质量限 + * @return 结果 + */ + public int insertQcSampleRuleAql(QcSampleRuleAql qcSampleRuleAql); + + /** + * 修改抽样规则-接收质量限 + * + * @param qcSampleRuleAql 抽样规则-接收质量限 + * @return 结果 + */ + public int updateQcSampleRuleAql(QcSampleRuleAql qcSampleRuleAql); + + /** + * 批量删除抽样规则-接收质量限 + * + * @param ids 需要删除的抽样规则-接收质量限主键集合 + * @return 结果 + */ + public int deleteQcSampleRuleAqlByIds(String[] ids); + + /** + * 删除抽样规则-接收质量限信息 + * + * @param id 抽样规则-接收质量限主键 + * @return 结果 + */ + public int deleteQcSampleRuleAqlById(String id); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcSampleRuleCodeService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcSampleRuleCodeService.java new file mode 100644 index 000000000..ff60457cd --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcSampleRuleCodeService.java @@ -0,0 +1,61 @@ +package com.op.quality.service; + +import java.util.List; + +import com.op.quality.domain.QcSampleRuleCode; + +/** + * 抽样规则-样品量字码Service接口 + * + * @author Open Platform + * @date 2024-06-05 + */ +public interface IQcSampleRuleCodeService { + /** + * 查询抽样规则-样品量字码 + * + * @param id 抽样规则-样品量字码主键 + * @return 抽样规则-样品量字码 + */ + public QcSampleRuleCode selectQcSampleRuleCodeById(String id); + + /** + * 查询抽样规则-样品量字码列表 + * + * @param qcSampleRuleCode 抽样规则-样品量字码 + * @return 抽样规则-样品量字码集合 + */ + public List selectQcSampleRuleCodeList(QcSampleRuleCode qcSampleRuleCode); + + /** + * 新增抽样规则-样品量字码 + * + * @param qcSampleRuleCode 抽样规则-样品量字码 + * @return 结果 + */ + public int insertQcSampleRuleCode(QcSampleRuleCode qcSampleRuleCode); + + /** + * 修改抽样规则-样品量字码 + * + * @param qcSampleRuleCode 抽样规则-样品量字码 + * @return 结果 + */ + public int updateQcSampleRuleCode(QcSampleRuleCode qcSampleRuleCode); + + /** + * 批量删除抽样规则-样品量字码 + * + * @param ids 需要删除的抽样规则-样品量字码主键集合 + * @return 结果 + */ + public int deleteQcSampleRuleCodeByIds(String[] ids); + + /** + * 删除抽样规则-样品量字码信息 + * + * @param id 抽样规则-样品量字码主键 + * @return 结果 + */ + public int deleteQcSampleRuleCodeById(String id); +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java index 2eeb607a9..1dcf1598b 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java @@ -281,24 +281,18 @@ public class QcCheckTaskIncomeServiceImpl implements } int s = qcCheckTaskDetailMapper.addBatch(items); - //发企业微信--------------------开始(跟班组无关) + //发企业微信--------------------开始 SysNoticeGroup noticeQo = new SysNoticeGroup(); noticeQo.setNoticeId(6L); List notices = qcCheckTaskIncomeMapper.getNoticesGroup(noticeQo); if(!CollectionUtils.isEmpty(notices)) { List wecharts = new ArrayList<>(); - //去主库查微信id - DynamicDataSourceContextHolder.push("master");// 这是数据源的key - List userCodes = users.stream() - .map(QcUserMaterialDTO::getUserCode) - .collect(Collectors.toList()); - List wxids = qcCheckTaskIncomeMapper.getWxId(userCodes); - for (String wxid : wxids) { + for (SysNoticeGroup noticedto : notices) { WechartDTO wechart0 = new WechartDTO(); - wechart0.setUserId(wxid); + wechart0.setUserId(noticedto.getWxId()); String contentInfo = notices.get(0).getNoticeContent(); - contentInfo = contentInfo.replace("${checkNo}", qcCheckTaskIncome.getCheckNo()+"\n"); + contentInfo = contentInfo.replace("${checkNo}", qcCheckTaskIncome.getCheckNo() + "\n"); Matcher m = p2.matcher(contentInfo); contentInfo = m.replaceAll(""); wechart0.setText(contentInfo); diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskProduceServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskProduceServiceImpl.java index a2e3fddc5..5b93e9268 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskProduceServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskProduceServiceImpl.java @@ -11,9 +11,13 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; import cn.hutool.core.date.DateUnit; import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson2.JSONObject; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.domain.R; @@ -26,8 +30,11 @@ import com.op.quality.domain.*; import com.op.quality.mapper.*; import com.op.quality.service.IQcCheckTaskDefectService; import com.op.quality.service.IQcCheckTaskUserService; +import com.op.system.api.RemoteOpenService; import com.op.system.api.RemoteUserService; +import com.op.system.api.domain.SysNoticeGroup; import com.op.system.api.domain.SysUser; +import com.op.system.api.domain.dto.WechartDTO; import com.op.system.api.domain.mes.ProOrderWorkorderDTO; import com.op.system.api.domain.quality.QcMaterialGroupDetailDTO; import com.op.system.api.domain.quality.QcUserMaterialDTO; @@ -88,6 +95,11 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService @Autowired private QcCheckTaskUserMapper qcCheckTaskUserMapper; + @Autowired + private RemoteOpenService remoteOpenService; + + private static Pattern p2= Pattern.compile("<[^>]+>"); + /** * 查询生产过程检验任务 * @@ -189,6 +201,7 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService qcCheckTaskProduce.setCreateTime(nowDate); qcCheckTaskProduce.setTypeCode("produce");//大检验节点 /**qc_task_user start**/ + List users = null; if(StringUtils.isNotBlank(qcCheckTaskProduce.getCheckManName())){ String checkManName = qcCheckTaskProduce.getCheckManName(); String checkManCode = qcCheckTaskProduce.getCheckManCode(); @@ -211,7 +224,7 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService qcCheckTaskProduce.setCheckManName(""); qcCheckTaskProduce.setCheckManCode(""); /**qc_user_material取默认检查人**/ - List users = qcCheckTaskIncomeMapper.getUserByCheckType(qcCheckTaskProduce.getCheckType()); + users = qcCheckTaskIncomeMapper.getUserByCheckType(qcCheckTaskProduce.getCheckType()); if(!CollectionUtils.isEmpty(users)){ for(QcUserMaterialDTO user:users){ user.setId(IdUtils.fastSimpleUUID()); @@ -269,7 +282,41 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService item.setFactoryCode(factoryCode); item.setStatus("Y"); } - return qcCheckTaskDetailMapper.addBatch(items); + int bn = qcCheckTaskDetailMapper.addBatch(items); + + //发企业微信--------------------开始 + SysNoticeGroup noticeQo = new SysNoticeGroup(); + if(qcCheckTaskProduce.getCheckType().equals("checkTypeSC")){ + noticeQo.setNoticeId(19L); + }else if(qcCheckTaskProduce.getCheckType().equals("checkTypeSCXJ")){ + noticeQo.setNoticeId(20L); + } + + List notices = qcCheckTaskIncomeMapper.getNoticesGroup(noticeQo); + if(!CollectionUtils.isEmpty(notices)) { + + List wecharts = new ArrayList<>(); + for (SysNoticeGroup noticedto : notices) { + WechartDTO wechart0 = new WechartDTO(); + wechart0.setUserId(noticedto.getWxId()); + String contentInfo = notices.get(0).getNoticeContent(); + contentInfo = contentInfo.replace("${checkNo}", qcCheckTaskProduce.getCheckNo() + "\n"); + Matcher m = p2.matcher(contentInfo); + contentInfo = m.replaceAll(""); + wechart0.setText(contentInfo); + wecharts.add(wechart0); + } + logger.info("质检检验企业微信提醒请求:" + JSONObject.toJSONString(wecharts)); + if (!CollectionUtils.isEmpty(wecharts)) { + new Thread(() -> { + AjaxResult result = remoteOpenService.sendWeChartMessage(wecharts); + logger.info("质检检验企业微信提醒结果:" + JSONObject.toJSONString(result)); + + }).start(); + } + //发企业微信--------------------结束 + } + return bn; } /** diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcSampleRuleAqlServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcSampleRuleAqlServiceImpl.java new file mode 100644 index 000000000..a1ebd35bf --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcSampleRuleAqlServiceImpl.java @@ -0,0 +1,99 @@ +package com.op.quality.service.impl; + +import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.uuid.IdUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.op.quality.mapper.QcSampleRuleAqlMapper; +import com.op.quality.domain.QcSampleRuleAql; +import com.op.quality.service.IQcSampleRuleAqlService; + +/** + * 抽样规则-接收质量限Service业务层处理 + * + * @author Open Platform + * @date 2024-06-05 + */ +@Service +public class QcSampleRuleAqlServiceImpl implements IQcSampleRuleAqlService { + @Autowired + private QcSampleRuleAqlMapper qcSampleRuleAqlMapper; + + /** + * 查询抽样规则-接收质量限 + * + * @param id 抽样规则-接收质量限主键 + * @return 抽样规则-接收质量限 + */ + @Override + @DS("#header.poolName") + public QcSampleRuleAql selectQcSampleRuleAqlById(String id) { + return qcSampleRuleAqlMapper.selectQcSampleRuleAqlById(id); + } + + /** + * 查询抽样规则-接收质量限列表 + * + * @param qcSampleRuleAql 抽样规则-接收质量限 + * @return 抽样规则-接收质量限 + */ + @Override + @DS("#header.poolName") + public List selectQcSampleRuleAqlList(QcSampleRuleAql qcSampleRuleAql) { + return qcSampleRuleAqlMapper.selectQcSampleRuleAqlList(qcSampleRuleAql); + } + + /** + * 新增抽样规则-接收质量限 + * + * @param qcSampleRuleAql 抽样规则-接收质量限 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertQcSampleRuleAql(QcSampleRuleAql qcSampleRuleAql) { + qcSampleRuleAql.setCreateTime(DateUtils.getNowDate()); + qcSampleRuleAql.setId(IdUtils.fastSimpleUUID()); + return qcSampleRuleAqlMapper.insertQcSampleRuleAql(qcSampleRuleAql); + } + + /** + * 修改抽样规则-接收质量限 + * + * @param qcSampleRuleAql 抽样规则-接收质量限 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateQcSampleRuleAql(QcSampleRuleAql qcSampleRuleAql) { + qcSampleRuleAql.setUpdateTime(DateUtils.getNowDate()); + return qcSampleRuleAqlMapper.updateQcSampleRuleAql(qcSampleRuleAql); + } + + /** + * 批量删除抽样规则-接收质量限 + * + * @param ids 需要删除的抽样规则-接收质量限主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteQcSampleRuleAqlByIds(String[] ids) { + return qcSampleRuleAqlMapper.deleteQcSampleRuleAqlByIds(ids); + } + + /** + * 删除抽样规则-接收质量限信息 + * + * @param id 抽样规则-接收质量限主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteQcSampleRuleAqlById(String id) { + return qcSampleRuleAqlMapper.deleteQcSampleRuleAqlById(id); + } +} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcSampleRuleCodeServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcSampleRuleCodeServiceImpl.java new file mode 100644 index 000000000..95a142bbc --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcSampleRuleCodeServiceImpl.java @@ -0,0 +1,99 @@ +package com.op.quality.service.impl; + +import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.uuid.IdUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.op.quality.mapper.QcSampleRuleCodeMapper; +import com.op.quality.domain.QcSampleRuleCode; +import com.op.quality.service.IQcSampleRuleCodeService; + +/** + * 抽样规则-样品量字码Service业务层处理 + * + * @author Open Platform + * @date 2024-06-05 + */ +@Service +public class QcSampleRuleCodeServiceImpl implements IQcSampleRuleCodeService { + @Autowired + private QcSampleRuleCodeMapper qcSampleRuleCodeMapper; + + /** + * 查询抽样规则-样品量字码 + * + * @param id 抽样规则-样品量字码主键 + * @return 抽样规则-样品量字码 + */ + @Override + @DS("#header.poolName") + public QcSampleRuleCode selectQcSampleRuleCodeById(String id) { + return qcSampleRuleCodeMapper.selectQcSampleRuleCodeById(id); + } + + /** + * 查询抽样规则-样品量字码列表 + * + * @param qcSampleRuleCode 抽样规则-样品量字码 + * @return 抽样规则-样品量字码 + */ + @Override + @DS("#header.poolName") + public List selectQcSampleRuleCodeList(QcSampleRuleCode qcSampleRuleCode) { + return qcSampleRuleCodeMapper.selectQcSampleRuleCodeList(qcSampleRuleCode); + } + + /** + * 新增抽样规则-样品量字码 + * + * @param qcSampleRuleCode 抽样规则-样品量字码 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertQcSampleRuleCode(QcSampleRuleCode qcSampleRuleCode) { + qcSampleRuleCode.setId(IdUtils.fastSimpleUUID()); + qcSampleRuleCode.setCreateTime(DateUtils.getNowDate()); + return qcSampleRuleCodeMapper.insertQcSampleRuleCode(qcSampleRuleCode); + } + + /** + * 修改抽样规则-样品量字码 + * + * @param qcSampleRuleCode 抽样规则-样品量字码 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateQcSampleRuleCode(QcSampleRuleCode qcSampleRuleCode) { + qcSampleRuleCode.setUpdateTime(DateUtils.getNowDate()); + return qcSampleRuleCodeMapper.updateQcSampleRuleCode(qcSampleRuleCode); + } + + /** + * 批量删除抽样规则-样品量字码 + * + * @param ids 需要删除的抽样规则-样品量字码主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteQcSampleRuleCodeByIds(String[] ids) { + return qcSampleRuleCodeMapper.deleteQcSampleRuleCodeByIds(ids); + } + + /** + * 删除抽样规则-样品量字码信息 + * + * @param id 抽样规则-样品量字码主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteQcSampleRuleCodeById(String id) { + return qcSampleRuleCodeMapper.deleteQcSampleRuleCodeById(id); + } +} diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml index f30ebd2a1..bb9b10931 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml @@ -492,7 +492,7 @@ sn.notice_type noticeType, sn.notice_content noticeContent, btu.user_name userCode, - btu.wx_id wxId + case when btu.wx_id is null then btu.user_name else btu.wx_id end wxId from sys_notice_group sng left join sys_notice sn on sng.notice_id = sn.notice_id left join base_team_user btu on sng.group_code = btu.team_code diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcSampleRuleAqlMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcSampleRuleAqlMapper.xml new file mode 100644 index 000000000..a329b18bd --- /dev/null +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcSampleRuleAqlMapper.xml @@ -0,0 +1,459 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, sample_code, sample_aql, attr1, create_by, create_time, update_by, update_time, factory_code, del_flag, max_bad_quality, check_type, type_code, aql1, aql2, aql3, aql4, aql5, aql6, aql7, aql8, aql9, aql10, aql11, aql12, aql13, aql14, aql15, aql16, aql17, aql18, aql19, aql20, aql21, aql22, aql23, aql24, aql25, aql26 from qc_sample_rule_aql + + + + + + + + insert into qc_sample_rule_aql + + id, + + sample_code, + + sample_aql, + + attr1, + + create_by, + + create_time, + + update_by, + + update_time, + + factory_code, + + del_flag, + + max_bad_quality, + + check_type, + + type_code, + + aql1, + + aql2, + + aql3, + + aql4, + + aql5, + + aql6, + + aql7, + + aql8, + + aql9, + + aql10, + + aql11, + + aql12, + + aql13, + + aql14, + + aql15, + + aql16, + + aql17, + + aql18, + + aql19, + + aql20, + + aql21, + + aql22, + + aql23, + + aql24, + + aql25, + + aql26, + + + + #{id}, + + #{sampleCode}, + + #{sampleAql}, + + #{attr1}, + + #{createBy}, + + #{createTime}, + + #{updateBy}, + + #{updateTime}, + + #{factoryCode}, + + #{delFlag}, + + #{maxBadQuality}, + + #{checkType}, + + #{typeCode}, + + #{aql1}, + + #{aql2}, + + #{aql3}, + + #{aql4}, + + #{aql5}, + + #{aql6}, + + #{aql7}, + + #{aql8}, + + #{aql9}, + + #{aql10}, + + #{aql11}, + + #{aql12}, + + #{aql13}, + + #{aql14}, + + #{aql15}, + + #{aql16}, + + #{aql17}, + + #{aql18}, + + #{aql19}, + + #{aql20}, + + #{aql21}, + + #{aql22}, + + #{aql23}, + + #{aql24}, + + #{aql25}, + + #{aql26}, + + + + + + update qc_sample_rule_aql + + sample_code = + #{sampleCode}, + + sample_aql = + #{sampleAql}, + + attr1 = + #{attr1}, + + create_by = + #{createBy}, + + create_time = + #{createTime}, + + update_by = + #{updateBy}, + + update_time = + #{updateTime}, + + factory_code = + #{factoryCode}, + + del_flag = + #{delFlag}, + + max_bad_quality = + #{maxBadQuality}, + + check_type = + #{checkType}, + + type_code = + #{typeCode}, + + aql1 = + #{aql1}, + + aql2 = + #{aql2}, + + aql3 = + #{aql3}, + + aql4 = + #{aql4}, + + aql5 = + #{aql5}, + + aql6 = + #{aql6}, + + aql7 = + #{aql7}, + + aql8 = + #{aql8}, + + aql9 = + #{aql9}, + + aql10 = + #{aql10}, + + aql11 = + #{aql11}, + + aql12 = + #{aql12}, + + aql13 = + #{aql13}, + + aql14 = + #{aql14}, + + aql15 = + #{aql15}, + + aql16 = + #{aql16}, + + aql17 = + #{aql17}, + + aql18 = + #{aql18}, + + aql19 = + #{aql19}, + + aql20 = + #{aql20}, + + aql21 = + #{aql21}, + + aql22 = + #{aql22}, + + aql23 = + #{aql23}, + + aql24 = + #{aql24}, + + aql25 = + #{aql25}, + + aql26 = + #{aql26}, + + + where id = #{id} + + + + delete from qc_sample_rule_aql where id = #{id} + + + + delete from qc_sample_rule_aql where id in + + #{id} + + + diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcSampleRuleCodeMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcSampleRuleCodeMapper.xml new file mode 100644 index 000000000..f4d938e4b --- /dev/null +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcSampleRuleCodeMapper.xml @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + select id, start_value, end_value, attr1, create_by, create_time, update_by, update_time, factory_code, del_flag, sample_code, check_type, type_code, check_level from qc_sample_rule_code + + + + + + + + insert into qc_sample_rule_code + + id, + + start_value, + + end_value, + + attr1, + + create_by, + + create_time, + + update_by, + + update_time, + + factory_code, + + del_flag, + + sample_code, + + check_type, + + type_code, + + check_level, + + + + #{id}, + + #{startValue}, + + #{endValue}, + + #{attr1}, + + #{createBy}, + + #{createTime}, + + #{updateBy}, + + #{updateTime}, + + #{factoryCode}, + + #{delFlag}, + + #{sampleCode}, + + #{checkType}, + + #{typeCode}, + + #{checkLevel}, + + + + + + update qc_sample_rule_code + + start_value = + #{startValue}, + + end_value = + #{endValue}, + + attr1 = + #{attr1}, + + create_by = + #{createBy}, + + create_time = + #{createTime}, + + update_by = + #{updateBy}, + + update_time = + #{updateTime}, + + factory_code = + #{factoryCode}, + + del_flag = + #{delFlag}, + + sample_code = + #{sampleCode}, + + check_type = + #{checkType}, + + type_code = + #{typeCode}, + + check_level = + #{checkLevel}, + + + where id = #{id} + + + + delete from qc_sample_rule_code where id = #{id} + + + + delete from qc_sample_rule_code where id in + + #{id} + + +