diff --git a/src/main/java/com/zcloud/mapper/datasource/inspectAnnually/InspectAnnuallyMapper.java b/src/main/java/com/zcloud/mapper/datasource/inspectAnnually/InspectAnnuallyMapper.java new file mode 100644 index 0000000..f7dd30c --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/inspectAnnually/InspectAnnuallyMapper.java @@ -0,0 +1,29 @@ +package com.zcloud.mapper.datasource.inspectAnnually; + +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:特种设备管理 + * 作者:luoxiaobao + * 时间:2021-06-19 + * 官网:www.zcloudchina.com + */ +public interface InspectAnnuallyMapper { + + /**修改 + * @param pd + * @throws Exception + */ + void edit(PageData pd); + + /**列表(全部) + * @param pd + * @throws Exception + */ + List listAll(PageData pd); + + List getYestoday(PageData pd); +} + diff --git a/src/main/java/com/zcloud/mapper/datasource/inspectAnnually/InspectAnnuallyWxMapper.java b/src/main/java/com/zcloud/mapper/datasource/inspectAnnually/InspectAnnuallyWxMapper.java new file mode 100644 index 0000000..7997f29 --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/inspectAnnually/InspectAnnuallyWxMapper.java @@ -0,0 +1,19 @@ +package com.zcloud.mapper.datasource.inspectAnnually; + +import com.zcloud.entity.PageData; + +/** + * 说明:特种设备安全巡检管理 + * 作者:luoxiaobao + * 时间:2021-06-19 + * 官网:www.zcloudchina.com + */ +public interface InspectAnnuallyWxMapper { + + /**新增 + * @param pd + * @throws Exception + */ + void save(PageData pd); +} + diff --git a/src/main/java/com/zcloud/scheduled/trafficRemind/TrafficRemindScheduled.java b/src/main/java/com/zcloud/scheduled/trafficRemind/TrafficRemindScheduled.java new file mode 100644 index 0000000..1435518 --- /dev/null +++ b/src/main/java/com/zcloud/scheduled/trafficRemind/TrafficRemindScheduled.java @@ -0,0 +1,69 @@ +package com.zcloud.scheduled.trafficRemind; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.service.hiddenDangerCheckStandard.CustomHiddenService; +import com.zcloud.service.inspectAnnually.InspectAnnuallyService; +import com.zcloud.service.notice.NoticeManagementService; +import com.zcloud.service.system.UsersService; +import com.zcloud.util.SendMessageUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +@Component +public class TrafficRemindScheduled { + @Autowired + private InspectAnnuallyService inspectAnnuallyService; + + @Autowired + private SendMessageUtil sendMessageUtil; + + @Autowired + private NoticeManagementService noticeManagementService; + + + //@Scheduled(cron ="0 0 8 * * ?") // 每天8点 + @Scheduled(cron ="0/10 * * * * ?") + public void scheduled(){ + try { + System.out.println( "============定时发送今日年检到期提醒=========="); + PageData pd = new PageData(); + pd.put("NOTICE_MANAGEMENT_ID", "a2c54741cbc24f2aba85943ec628eeab"); + PageData annualNotice = noticeManagementService.findById(pd); + List notifierId = Arrays.asList(annualNotice.getString("ADDRESSEE").split(",")); + List varList = inspectAnnuallyService.getYestoday(pd); + if(varList != null && varList.size() > 0) { + for (String userId : notifierId){ + for(PageData h : varList) { + // 发送年检到期通知 + PageData mes = new PageData(); + mes.put("RECEIVER_ID", userId);// 收信人 userid + mes.put("templateCode", "TRAFFIC_NJ_N01");// 通知模板编码 + mes.put("CORPINFO_ID", h.get("CORPINFO_ID"));// 企业id + // 参数集合 + List paramsList = new ArrayList(); + // 第1个参数 + PageData params1 = new PageData(); + params1.put("name", "plate_number");// 存入短信模板中的参数名称 + params1.put("value", h.get("PLATE_NUMBER").toString());// 存入上面参数名称所传递的值 + paramsList.add(params1); + + // 第2个参数 + PageData params2 = new PageData(); + params2.put("name", "vehicle_model");// 存入短信模板中的参数名称 + params2.put("value", h.get("VEHICLEMODEL").toString());// 存入上面参数名称所传递的值 + paramsList.add(params2); + sendMessageUtil.sendTrafficNotice(mes, paramsList); + } + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/zcloud/service/inspectAnnually/InspectAnnuallyService.java b/src/main/java/com/zcloud/service/inspectAnnually/InspectAnnuallyService.java new file mode 100644 index 0000000..ad45f41 --- /dev/null +++ b/src/main/java/com/zcloud/service/inspectAnnually/InspectAnnuallyService.java @@ -0,0 +1,34 @@ +package com.zcloud.service.inspectAnnually; + +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:特种设备管理 + * 作者:luoxiaobao + * 时间:2021-06-19 + * 官网:www.zcloudchina.com + */ +public interface InspectAnnuallyService { + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd)throws Exception; + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception; + + /** + * 年检到期 发通知 + * @param pd + * @return + */ + List getYestoday(PageData pd); +} + diff --git a/src/main/java/com/zcloud/service/inspectAnnually/InspectAnnuallyWxService.java b/src/main/java/com/zcloud/service/inspectAnnually/InspectAnnuallyWxService.java new file mode 100644 index 0000000..64abbaa --- /dev/null +++ b/src/main/java/com/zcloud/service/inspectAnnually/InspectAnnuallyWxService.java @@ -0,0 +1,20 @@ +package com.zcloud.service.inspectAnnually; + +import com.zcloud.entity.PageData; + +/** + * 说明:特种设备安全巡检管理 + * 作者:luoxiaobao + * 时间:2021-06-19 + * 官网:www.zcloudchina.com + */ +public interface InspectAnnuallyWxService { + + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd)throws Exception; + +} + diff --git a/src/main/java/com/zcloud/service/inspectAnnually/impl/InspectAnnuallyServiceImpl.java b/src/main/java/com/zcloud/service/inspectAnnually/impl/InspectAnnuallyServiceImpl.java new file mode 100644 index 0000000..5797a6b --- /dev/null +++ b/src/main/java/com/zcloud/service/inspectAnnually/impl/InspectAnnuallyServiceImpl.java @@ -0,0 +1,49 @@ +package com.zcloud.service.inspectAnnually.impl; + +import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.inspectAnnually.InspectAnnuallyMapper; +import com.zcloud.mapper.datasource.speEquip.SpecialEquipmentMapper; +import com.zcloud.service.inspectAnnually.InspectAnnuallyService; +import com.zcloud.service.speEquip.SpecialEquipmentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 说明:特种设备管理 + * 作者:luoxiaobao + * 时间:2021-06-19 + * 官网:www.zcloudchina.com + */ +@Service +@Transactional //开启事物 +public class InspectAnnuallyServiceImpl implements InspectAnnuallyService { + + @Autowired + private InspectAnnuallyMapper inspectAnnuallyMapper; + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd)throws Exception{ + inspectAnnuallyMapper.edit(pd); + } + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception{ + return inspectAnnuallyMapper.listAll(pd); + } + + @Override + public List getYestoday(PageData pd) { + return inspectAnnuallyMapper.getYestoday(pd); + } + +} + diff --git a/src/main/java/com/zcloud/service/inspectAnnually/impl/InspectAnnuallyWxServiceImpl.java b/src/main/java/com/zcloud/service/inspectAnnually/impl/InspectAnnuallyWxServiceImpl.java new file mode 100644 index 0000000..cc03ad8 --- /dev/null +++ b/src/main/java/com/zcloud/service/inspectAnnually/impl/InspectAnnuallyWxServiceImpl.java @@ -0,0 +1,32 @@ +package com.zcloud.service.inspectAnnually.impl; + +import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.speEquip.SpecialEquipmentWxjMapper; +import com.zcloud.service.inspectAnnually.InspectAnnuallyWxService; +import com.zcloud.service.speEquip.SpecialEquipmentWxjService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * 说明:特种设备安全巡检管理 + * 作者:luoxiaobao + * 时间:2021-06-19 + * 官网:www.zcloudchina.com + */ +@Service +@Transactional //开启事物 +public class InspectAnnuallyWxServiceImpl implements InspectAnnuallyWxService { + + @Autowired + private SpecialEquipmentWxjMapper specialequipmentwxjMapper; + + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd)throws Exception{ + specialequipmentwxjMapper.save(pd); + } +} + diff --git a/src/main/java/com/zcloud/util/SendMessageUtil.java b/src/main/java/com/zcloud/util/SendMessageUtil.java index b11aaa4..a420ee9 100644 --- a/src/main/java/com/zcloud/util/SendMessageUtil.java +++ b/src/main/java/com/zcloud/util/SendMessageUtil.java @@ -159,7 +159,7 @@ public class SendMessageUtil { * @return * @throws Exception */ - private void sendNotice(PageData pd, List paramsList) throws Exception{ + public void sendNotice(PageData pd, List paramsList) throws Exception{ PageData nm = new PageData(); nm.put("CORPINFO_ID", pd.getString("CORPINFO_ID")); nm.put("ISENABLE", "1"); @@ -229,6 +229,46 @@ public class SendMessageUtil { } } + public void sendTrafficNotice(PageData pd, List paramsList) throws Exception{ + PageData nm = new PageData(); + nm.put("CORPINFO_ID", pd.getString("CORPINFO_ID")); + nm.put("ISENABLE", "1"); + nm.put("SMSCODE", pd.get("templateCode")); + List nmList =noticemanagementService.listAll(nm); + if(nmList==null || nmList.size()==0){//未开启该提醒 + return; + } + PageData template = new PageData(); + template.put("TEMPLATE_CODE",pd.get("templateCode")); + template = this.noticeTemplateService.findByCode(template); + + String content = template.getString("TEMPLATE_STR"); + if(paramsList != null && paramsList.size() > 0) { + StringBuffer parStr = new StringBuffer(); + for(PageData par: paramsList) { + content = content.replace(("${" + par.getString("name") + "}"),par.getString("value")); + } + } + PageData pd1 = new PageData(); + pd1.put("NOTICECORP_ID", UuidUtil.get32UUID()); + pd1.put("USERNAME","秦安双控"); + pd1.put("CREATOR", "秦安双控"); //添加人 + pd1.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 + pd1.put("SYNOPSIS",template.getString("NAME")); + pd1.put("CONTENT","

"+content+"

"); + pd1.put("ISALL","yes"); + pd1.put("ISREPLY",0); + pd1.put("ISDELETE",0); + pd1.put("ISTOP",0); + pd1.put("STATUS",1); + pd1.put("CORP_INFO_ID",pd.getString("CORPINFO_ID")); + noticeCorpService.save(pd1); + pd1.put("NOTICECORPUSERID_ID",UuidUtil.get32UUID()); + pd1.put("USER_ID",pd.getString("RECEIVER_ID")); + pd1.put("TYPE",0); + noticeCorpUserService.save(pd1); + } + /* * 微信推送新消息 * */ diff --git a/src/main/resources/mybatis/datasource/inspectAnnually/InspectAnnuallyMapper.xml b/src/main/resources/mybatis/datasource/inspectAnnually/InspectAnnuallyMapper.xml new file mode 100644 index 0000000..e658fd7 --- /dev/null +++ b/src/main/resources/mybatis/datasource/inspectAnnually/InspectAnnuallyMapper.xml @@ -0,0 +1,262 @@ + + + + + + + BUS_TRAFFIC_MECHANICAL_INSPECT_ANNUALLY + + + + + + INSPECTANNUALLY_ID, + CORPINFO_ID, + NUM, + VEHICLE_MODEL, + VEHICLE, + CAR_OWNERS, + TELEPHONE, + REGISTRANT, + PROCESSING_DATE, + ANNUAL_INSPECTION_CYCLE, + DUE_DATE, + INSPECTFEES, + ACTUAL_COLLECTION, + ADDRESS, + REMINDER_DAYS, + REMINDER_DATE, + REMINDER_STATUS, + INSPECTINFO, + NOTES, + ARCHIVES_TYPE, + ISDELETE, + CREATOR, + CREATORNAME, + CREATTIME + + + + + #{INSPECTANNUALLY_ID}, + #{CORPINFO_ID}, + #{NUM}, + #{VEHICLE_MODEL}, + #{VEHICLE}, + #{CAR_OWNERS}, + #{TELEPHONE}, + #{REGISTRANT}, + #{PROCESSING_DATE}, + #{ANNUAL_INSPECTION_CYCLE}, + #{DUE_DATE}, + #{INSPECTFEES}, + #{ACTUAL_COLLECTION}, + #{ADDRESS}, + #{REMINDER_DAYS}, + #{REMINDER_DATE}, + #{REMINDER_STATUS}, + #{INSPECTINFO}, + #{NOTES}, + #{ARCHIVES_TYPE}, + #{ISDELETE}, + #{CREATOR}, + #{CREATORNAME}, + #{CREATTIME} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + ISDELETE = '1', + DELETEOR = #{DELETEOR}, + DELETEORNAME = #{DELETEORNAME}, + DELETTIME = #{DELETTIME} + where + INSPECTANNUALLY_ID = #{INSPECTANNUALLY_ID} + + + + + update + + set + NUM = #{NUM}, + VEHICLE_MODEL = #{VEHICLE_MODEL}, + VEHICLE = #{VEHICLE}, + CAR_OWNERS = #{CAR_OWNERS}, + TELEPHONE = #{TELEPHONE}, + REGISTRANT = #{REGISTRANT}, + PROCESSING_DATE = #{PROCESSING_DATE}, + ANNUAL_INSPECTION_CYCLE = #{ANNUAL_INSPECTION_CYCLE}, + DUE_DATE = #{DUE_DATE}, + INSPECTFEES = #{INSPECTFEES}, + ACTUAL_COLLECTION = #{ACTUAL_COLLECTION}, + ADDRESS = #{ADDRESS}, + REMINDER_DAYS = #{REMINDER_DAYS}, + REMINDER_DATE = #{REMINDER_DATE}, + REMINDER_STATUS = #{REMINDER_STATUS}, + INSPECTINFO = #{INSPECTINFO}, + NOTES = #{NOTES}, + ARCHIVES_TYPE = #{ARCHIVES_TYPE}, + OPERATOR = #{OPERATOR}, + OPERATORNAME = #{OPERATORNAME}, + OPERATTIME = #{OPERATTIME} + where + INSPECTANNUALLY_ID = #{INSPECTANNUALLY_ID} + + + + + update + + set + + REMINDER_STATUS = #{REMINDER_STATUS}, + + OPERATOR = #{OPERATOR}, + OPERATORNAME = #{OPERATORNAME}, + OPERATTIME = #{OPERATTIME} + where + INSPECTANNUALLY_ID = #{INSPECTANNUALLY_ID} + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/mybatis/datasource/inspectAnnually/InspectAnnuallyWxjMapper.xml b/src/main/resources/mybatis/datasource/inspectAnnually/InspectAnnuallyWxjMapper.xml new file mode 100644 index 0000000..84ccf51 --- /dev/null +++ b/src/main/resources/mybatis/datasource/inspectAnnually/InspectAnnuallyWxjMapper.xml @@ -0,0 +1,80 @@ + + + + + + + BUS_SPECIALEQUIPMENTWXJ + + + + + SYS_DICTIONARIES + + + + + f.SPECIALEQUIPMENT_ID, + f.INSPECTOR, + f.INSPECTIONTIME, + f.INSPECTIONCONTENT, + f.ISFAULT, + f.PERIOD_START_DATE, + f.PERIOD_END_DATE, + f.CREATOR, + f.CREATTIME, + f.OPERATOR, + f.OPERATTIME, + f.ISDELETE, + f.CORPINFO_ID, + f.SPECIALEQUIPMENTWXJ_ID + + + + + SPECIALEQUIPMENT_ID, + INSPECTOR, + INSPECTIONTIME, + INSPECTIONCONTENT, + ISFAULT, + PERIOD_START_DATE, + PERIOD_END_DATE, + CREATOR, + CREATTIME, + OPERATOR, + OPERATTIME, + ISDELETE, + CORPINFO_ID, + SPECIALEQUIPMENTWXJ_ID + + + + + #{SPECIALEQUIPMENT_ID}, + #{INSPECTOR}, + #{INSPECTIONTIME}, + #{INSPECTIONCONTENT}, + #{ISFAULT}, + #{PERIOD_START_DATE}, + #{PERIOD_END_DATE}, + #{CREATOR}, + #{CREATTIME}, + #{OPERATOR}, + #{OPERATTIME}, + #{ISDELETE}, + #{CORPINFO_ID}, + #{SPECIALEQUIPMENTWXJ_ID} + + + + + insert into + + ( + + ) values ( + + ) + + + diff --git a/src/main/resources/mybatis/datasource/system/UsersMapper.xml b/src/main/resources/mybatis/datasource/system/UsersMapper.xml index 5388d48..3f240d2 100644 --- a/src/main/resources/mybatis/datasource/system/UsersMapper.xml +++ b/src/main/resources/mybatis/datasource/system/UsersMapper.xml @@ -18,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" p.NAME AS POST_NAME, d.NAME AS DEPARTMENT_NAME from - sys_suer f + sys_user f left join OA_DEPARTMENT d on d.DEPARTMENT_ID=f.DEPARTMENT_ID left join SYS_POST p on p.POST_ID=f.POST_ID where