Commit 74e56458 authored by chenzhao's avatar chenzhao

增加是使用信息表新加字段赋值

parent 3efafbff
...@@ -105,7 +105,7 @@ public class CommonController extends BaseController { ...@@ -105,7 +105,7 @@ public class CommonController extends BaseController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/test1") @GetMapping(value = "/test1")
@ApiOperation(httpMethod = "GET", value = "查询检验检测机构基本信息", notes = "查询检验检测机构基本信息") @ApiOperation(httpMethod = "GET", value = "查询检验检测机构基本信息", notes = "查询检验检测机构基本信息")
public ResponseModel sendReminderMessage() { public ResponseModel sendReminderMessage() {
......
...@@ -10,11 +10,14 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo; ...@@ -10,11 +10,14 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzsUserInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.TzsUserInfoMapper;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -68,4 +71,13 @@ public class CommonserviceImpl { ...@@ -68,4 +71,13 @@ public class CommonserviceImpl {
public TzBaseEnterpriseInfo getInspectionUnitBySequenceNbr(Long sequenceNbr) { public TzBaseEnterpriseInfo getInspectionUnitBySequenceNbr(Long sequenceNbr) {
return enterpriseInfoMapper.selectBySeq(sequenceNbr); return enterpriseInfoMapper.selectBySeq(sequenceNbr);
} }
@Async
public void sendMessage(HashMap<String,String> smsParams, List<String> phones){
for (String phone : phones) {
smsParams.put("mobile",phone);
Systemctl.smsClient.sendCommonSms(smsParams);
}
}
} }
...@@ -2,13 +2,16 @@ package com.yeejoin.amos.boot.module.jyjc.biz.service.impl; ...@@ -2,13 +2,16 @@ package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.jyjc.api.enums.BizTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.dto.UseInfoModel; import com.yeejoin.amos.boot.module.ymt.api.dto.UseInfoModel;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzsUserInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.TzsUserInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.UseInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.UseInfoMapper;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.MessageModel; import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -20,11 +23,14 @@ import java.util.stream.Collectors; ...@@ -20,11 +23,14 @@ import java.util.stream.Collectors;
@EnableScheduling @EnableScheduling
@Service @Service
@Slf4j
public class EquipRegularlyRemindServicelmpl { public class EquipRegularlyRemindServicelmpl {
@Autowired @Autowired
private UseInfoMapper useInfoMapper; private UseInfoMapper useInfoMapper;
@Autowired @Autowired
private TzsUserInfoMapper tzsUserInfoMapper; private TzsUserInfoMapper tzsUserInfoMapper;
@Autowired
CommonserviceImpl commonservice;
@Scheduled(cron = "0 0 8 * * ?") @Scheduled(cron = "0 0 8 * * ?")
public void sendReminderMessage(){ public void sendReminderMessage(){
...@@ -39,7 +45,8 @@ public void sendReminderMessage(){ ...@@ -39,7 +45,8 @@ public void sendReminderMessage(){
Date date = DateUtils.dateAddDays(curDate, 31); Date date = DateUtils.dateAddDays(curDate, 31);
List<String> types = new ArrayList<>(); List<String> types = new ArrayList<>();
List<String> status = new ArrayList<>(); List<String> status = new ArrayList<>();
types.add("DTJC");
types.add("DQJY");
//查询需要发送消息的设备 //查询需要发送消息的设备
// LambdaQueryWrapper<UseInfo> query = new LambdaQueryWrapper<>(); // LambdaQueryWrapper<UseInfo> query = new LambdaQueryWrapper<>();
// query.in(UseInfo::getLastInspectType,types); // query.in(UseInfo::getLastInspectType,types);
...@@ -81,11 +88,8 @@ public void sendReminderMessage(){ ...@@ -81,11 +88,8 @@ public void sendReminderMessage(){
smsParams.put("smsCode","EQU_TZS_001"); smsParams.put("smsCode","EQU_TZS_001");
smsParams.put("lq", String.valueOf(lq)); smsParams.put("lq", String.valueOf(lq));
smsParams.put("cq", String.valueOf(cq)); smsParams.put("cq", String.valueOf(cq));
for (String phone : phones) {
smsParams.put("mobile",phone);
Systemctl.smsClient.sendCommonSms(smsParams);
}
commonservice.sendMessage(smsParams,phones);
//发送平台消息 //发送平台消息
if ( lqEquips.containsKey(s)){ if ( lqEquips.containsKey(s)){
...@@ -112,16 +116,14 @@ public void sendReminderMessage(){ ...@@ -112,16 +116,14 @@ public void sendReminderMessage(){
messageModel.setMsgType("EQUIP_HINT"); messageModel.setMsgType("EQUIP_HINT");
messageModel.setMsgTypeLabel("设备检验"); messageModel.setMsgTypeLabel("设备检验");
Systemctl.messageClient.create(messageModel); Systemctl.messageClient.create(messageModel);
log.info("信息发送完成");
} catch (ParseException e) { } catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
} }
} }
} }
...@@ -28,10 +28,7 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.CategoryOtherInfo; ...@@ -28,10 +28,7 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.CategoryOtherInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo; import com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.CategoryOtherInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.*;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.InspectionDetectionInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
...@@ -81,7 +78,8 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR ...@@ -81,7 +78,8 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
JyjcInspectionResultAttachmentServiceImpl attachmentService; JyjcInspectionResultAttachmentServiceImpl attachmentService;
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
@Autowired
UseInfoMapper useInfoMapper;
@Autowired @Autowired
CategoryOtherInfoMapper categoryOtherInfoMapper; CategoryOtherInfoMapper categoryOtherInfoMapper;
...@@ -206,6 +204,8 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR ...@@ -206,6 +204,8 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
extracted(model, info, jybgFile); extracted(model, info, jybgFile);
inspectionDetectionInfoMapper.updateById(info); inspectionDetectionInfoMapper.updateById(info);
} }
//更新使用信息表
useInfoMapper.updateByRecord(model.getEquipUnicode(),model.getNextInspectionDate(),model.getInspectionType(),model.getApplicationNo());
return model; return model;
} }
......
...@@ -17,4 +17,5 @@ public interface UseInfoMapper extends BaseMapper<UseInfo> { ...@@ -17,4 +17,5 @@ public interface UseInfoMapper extends BaseMapper<UseInfo> {
List<UseInfoModel> selecEquipInfotList(List<String>types, List<String>statusList, Date date,Date curDate); List<UseInfoModel> selecEquipInfotList(List<String>types, List<String>statusList, Date date,Date curDate);
void updateByRecord(String record, Date nextInspectDate, String lastInspectType, String lastInspectReportNo);
} }
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.ymt.api.mapper.UseInfoMapper"> <mapper namespace="com.yeejoin.amos.boot.module.ymt.api.mapper.UseInfoMapper">
<update id="updateByRecord">
UPDATE
idx_biz_jg_use_info
SET
NEXT_INSPECT_DATE = #{nextInspectDate},
LAST_INSPECT_TYPE = #{lastInspectType},
LAST_INSPECT_REPORT_NO = #{lastInspectReportNo}
WHERE
RECORD = #{record}
</update>
<select id="selecEquipInfotList" resultType="com.yeejoin.amos.boot.module.ymt.api.dto.UseInfoModel"> <select id="selecEquipInfotList" resultType="com.yeejoin.amos.boot.module.ymt.api.dto.UseInfoModel">
SELECT SELECT
...@@ -8,6 +19,7 @@ ...@@ -8,6 +19,7 @@
use.USE_UNIT_CREDIT_CODE, use.USE_UNIT_CREDIT_CODE,
other.SUPERVISORY_CODE, other.SUPERVISORY_CODE,
register.PRODUCT_NAME, register.PRODUCT_NAME,
use.NEXT_INSPECT_DATE as nextInspectDate,
base.contact_phone as phone base.contact_phone as phone
FROM FROM
idx_biz_jg_use_info use idx_biz_jg_use_info use
...@@ -29,7 +41,7 @@ ...@@ -29,7 +41,7 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
and (NEXT_INSPECT_DATE > #{date} or #{curDate} > NEXT_INSPECT_DATE) and (#{date} >= NEXT_INSPECT_DATE or #{curDate} > NEXT_INSPECT_DATE)
</where> </where>
</select> </select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment