Commit 74e56458 authored by chenzhao's avatar chenzhao

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

parent 3efafbff
......@@ -105,7 +105,7 @@ public class CommonController extends BaseController {
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/test1")
@ApiOperation(httpMethod = "GET", value = "查询检验检测机构基本信息", notes = "查询检验检测机构基本信息")
public ResponseModel sendReminderMessage() {
......
......@@ -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.mapper.TzBaseEnterpriseInfoMapper;
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.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.util.HashMap;
import java.util.List;
......@@ -68,4 +71,13 @@ public class CommonserviceImpl {
public TzBaseEnterpriseInfo getInspectionUnitBySequenceNbr(Long 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;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.entity.TzsUserInfo;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzsUserInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.UseInfoMapper;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
......@@ -20,11 +23,14 @@ import java.util.stream.Collectors;
@EnableScheduling
@Service
@Slf4j
public class EquipRegularlyRemindServicelmpl {
@Autowired
private UseInfoMapper useInfoMapper;
@Autowired
private TzsUserInfoMapper tzsUserInfoMapper;
@Autowired
CommonserviceImpl commonservice;
@Scheduled(cron = "0 0 8 * * ?")
public void sendReminderMessage(){
......@@ -39,7 +45,8 @@ public void sendReminderMessage(){
Date date = DateUtils.dateAddDays(curDate, 31);
List<String> types = new ArrayList<>();
List<String> status = new ArrayList<>();
types.add("DTJC");
types.add("DQJY");
//查询需要发送消息的设备
// LambdaQueryWrapper<UseInfo> query = new LambdaQueryWrapper<>();
// query.in(UseInfo::getLastInspectType,types);
......@@ -81,11 +88,8 @@ public void sendReminderMessage(){
smsParams.put("smsCode","EQU_TZS_001");
smsParams.put("lq", String.valueOf(lq));
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)){
......@@ -112,16 +116,14 @@ public void sendReminderMessage(){
messageModel.setMsgType("EQUIP_HINT");
messageModel.setMsgTypeLabel("设备检验");
Systemctl.messageClient.create(messageModel);
log.info("信息发送完成");
} catch (ParseException e) {
e.printStackTrace();
}
}
}
}
}
......@@ -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.TzBaseEnterpriseInfo;
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.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.InspectionDetectionInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.TzBaseEnterpriseInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
......@@ -81,7 +78,8 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
JyjcInspectionResultAttachmentServiceImpl attachmentService;
@Autowired
private RedisUtils redisUtils;
@Autowired
UseInfoMapper useInfoMapper;
@Autowired
CategoryOtherInfoMapper categoryOtherInfoMapper;
......@@ -206,6 +204,8 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
extracted(model, info, jybgFile);
inspectionDetectionInfoMapper.updateById(info);
}
//更新使用信息表
useInfoMapper.updateByRecord(model.getEquipUnicode(),model.getNextInspectionDate(),model.getInspectionType(),model.getApplicationNo());
return model;
}
......
......@@ -17,4 +17,5 @@ public interface UseInfoMapper extends BaseMapper<UseInfo> {
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"?>
<!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">
<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
......@@ -8,6 +19,7 @@
use.USE_UNIT_CREDIT_CODE,
other.SUPERVISORY_CODE,
register.PRODUCT_NAME,
use.NEXT_INSPECT_DATE as nextInspectDate,
base.contact_phone as phone
FROM
idx_biz_jg_use_info use
......@@ -29,7 +41,7 @@
#{item}
</foreach>
</if>
and (NEXT_INSPECT_DATE > #{date} or #{curDate} > NEXT_INSPECT_DATE)
and (#{date} >= NEXT_INSPECT_DATE or #{curDate} > NEXT_INSPECT_DATE)
</where>
</select>
</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