设备异常描述与设备类型绑定修改
parent
ff3c880528
commit
e587614c3f
@ -0,0 +1,22 @@
|
||||
package com.op.device.domain;
|
||||
|
||||
public class EquFaultdesDict {
|
||||
private String faultId;
|
||||
private String dictValue;
|
||||
|
||||
public String getFaultId() {
|
||||
return faultId;
|
||||
}
|
||||
|
||||
public void setFaultId(String faultId) {
|
||||
this.faultId = faultId;
|
||||
}
|
||||
|
||||
public String getDictValue() {
|
||||
return dictValue;
|
||||
}
|
||||
|
||||
public void setDictValue(String dictValue) {
|
||||
this.dictValue = dictValue;
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>op-modules</artifactId>
|
||||
<groupId>com.op</groupId>
|
||||
<version>0.0.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>op-printservice</artifactId>
|
||||
|
||||
|
||||
</project>
|
@ -0,0 +1,29 @@
|
||||
package com.op.quality.controller;
|
||||
|
||||
import com.op.common.core.web.controller.BaseController;
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.quality.service.QcCheckWechartService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* 质检信息企业微信推送
|
||||
* @author YangWANLI
|
||||
* @date 2025-04-19
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/qualityWechart")
|
||||
public class QcCheckWechartController extends BaseController {
|
||||
@Autowired
|
||||
private QcCheckWechartService qcCheckWechartService;
|
||||
//查询前一天包材、成品质检信息
|
||||
@GetMapping("/qualityCheckInfoByday")
|
||||
public AjaxResult qualityCheckInfoByday() {
|
||||
return AjaxResult.success(qcCheckWechartService.qualityCheckInfoByday());
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.op.quality.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface QcCheckWechartMapper {
|
||||
Map qualityCheckInfoByday();
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package com.op.quality.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface QcCheckWechartService {
|
||||
|
||||
Map qualityCheckInfoByday();
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.op.quality.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.op.common.core.utils.StringUtils;
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.quality.mapper.QcCheckTaskIncomeMapper;
|
||||
import com.op.quality.mapper.QcCheckWechartMapper;
|
||||
import com.op.quality.service.QcCheckWechartService;
|
||||
import com.op.system.api.RemoteOpenService;
|
||||
import com.op.system.api.domain.SysNoticeGroup;
|
||||
import com.op.system.api.domain.dto.WechartDTO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class QcCheckWechartServiceImpl implements QcCheckWechartService {
|
||||
|
||||
protected Logger logger = LoggerFactory.getLogger(getClass());
|
||||
@Autowired
|
||||
private QcCheckWechartMapper qcCheckWechartMapper;
|
||||
@Autowired
|
||||
private QcCheckTaskIncomeMapper qcCheckTaskIncomeMapper;
|
||||
|
||||
@Autowired
|
||||
private RemoteOpenService remoteOpenService;
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public Map qualityCheckInfoByday() {
|
||||
// Map<String,String> map=qcCheckWechartMapper.qualityCheckInfoByday();
|
||||
Map<String, Object> map = qcCheckWechartMapper.qualityCheckInfoByday();
|
||||
map.replaceAll((key, value) -> {
|
||||
if (value instanceof Number) {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
return value; // 非数字类型保留原值
|
||||
});
|
||||
SysNoticeGroup noticeQo = new SysNoticeGroup();
|
||||
if(map != null){
|
||||
noticeQo.setNoticeId(25L);
|
||||
List<SysNoticeGroup> notices = qcCheckTaskIncomeMapper.getNoticesGroup(noticeQo);
|
||||
System.out.println(notices);
|
||||
sendWeChartMessage(noticeQo,map);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private void sendWeChartMessage(SysNoticeGroup noticeQo,Map map){
|
||||
|
||||
List<SysNoticeGroup> notices = qcCheckTaskIncomeMapper.getNoticesGroup(noticeQo);
|
||||
if(!CollectionUtils.isEmpty(notices) && notices.size() > 0) {
|
||||
List<WechartDTO> wecharts = new ArrayList<>();
|
||||
for (SysNoticeGroup noticedto : notices) {
|
||||
WechartDTO wechart0 = new WechartDTO();
|
||||
wechart0.setUserId(noticedto.getWxId());
|
||||
String contentInfo = notices.get(0).getNoticeContent();
|
||||
String message=StringUtils.format(contentInfo,map);
|
||||
wechart0.setText(message);
|
||||
wecharts.add(wechart0);
|
||||
}
|
||||
// logger.info("任务编号为:"+ checkNoList + "的"+ message + ",企业微信二次提醒请求:" + JSONObject.toJSONString(wecharts));
|
||||
if (!CollectionUtils.isEmpty(wecharts)) {
|
||||
new Thread(() -> {
|
||||
AjaxResult result = remoteOpenService.sendWeChartMessage(wecharts);
|
||||
logger.info("企业微信发送质检情况:" + JSONObject.toJSONString(result));
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.op.quality.mapper.QcCheckWechartMapper">
|
||||
|
||||
<select id="qualityCheckInfoByday" resultType="java.util.Map">
|
||||
SELECT * FROM check_view
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue