2 files added
	
		
		10 files modified
	
	
 
	
	
	
	
	
	
	
	
|  |  |  | 
|---|
|  |  |  | import org.mybatis.spring.annotation.MapperScan; | 
|---|
|  |  |  | import org.springframework.boot.SpringApplication; | 
|---|
|  |  |  | import org.springframework.boot.autoconfigure.SpringBootApplication; | 
|---|
|  |  |  | import org.springframework.boot.builder.SpringApplicationBuilder; | 
|---|
|  |  |  | import org.springframework.boot.web.servlet.FilterRegistrationBean; | 
|---|
|  |  |  | import org.springframework.context.ApplicationContext; | 
|---|
|  |  |  | import org.springframework.context.annotation.Bean; | 
|---|
|  |  |  | 
|---|
|  |  |  | @EnableTransactionManagement | 
|---|
|  |  |  | public class ScreenApiBootstrap { | 
|---|
|  |  |  | public static void main(String[] args) { | 
|---|
|  |  |  | /*SpringApplicationBuilder builder = new SpringApplicationBuilder(ScreenApiBootstrap.class); | 
|---|
|  |  |  | builder.headless(false) | 
|---|
|  |  |  | // .web(WebApplicationType.NONE) | 
|---|
|  |  |  | // .bannerMode(Banner.Mode.OFF) | 
|---|
|  |  |  | .run(args);*/ | 
|---|
|  |  |  | ApplicationContext applicationContext = SpringApplication.run(ScreenApiBootstrap.class, args); | 
|---|
|  |  |  | SpringContextUtils.setApplicationContext(applicationContext); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | private Integer keyPoint; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private String latitude; | 
|---|
|  |  |  | private String longitude; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 省市区地址 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private String address; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 详细地址 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private String name; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "污染位置") | 
|---|
|  |  |  | private String pollutePosition; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "纬度") | 
|---|
|  |  |  | private String latitude; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "经度") | 
|---|
|  |  |  | private String longitude; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "省市区地址") | 
|---|
|  |  |  | private String address; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "详细地址") | 
|---|
|  |  |  | private String name; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "责任单位id") | 
|---|
|  |  |  | private Integer unitId; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @NotNull(message = "污染分类不能为空!") | 
|---|
|  |  |  | private Integer polluteType; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "纬度") | 
|---|
|  |  |  | private String latitude; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "经度") | 
|---|
|  |  |  | private String longitude; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "省市区地址") | 
|---|
|  |  |  | private String address; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "详细地址") | 
|---|
|  |  |  | private String name; | 
|---|
|  |  |  | @ApiModelProperty(value = "整改类型id") | 
|---|
|  |  |  | @NotNull(message = "整改类型不能为空!") | 
|---|
|  |  |  | private Integer changeType; | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "污染位置") | 
|---|
|  |  |  | private String pollutePosition; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "纬度") | 
|---|
|  |  |  | private String latitude; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "经度") | 
|---|
|  |  |  | private String longitude; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "省市区地址") | 
|---|
|  |  |  | private String address; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "详细地址") | 
|---|
|  |  |  | private String name; | 
|---|
|  |  |  | @ApiModelProperty(value = "期限天数") | 
|---|
|  |  |  | private Integer changeDay; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @TableField(exist = false) | 
|---|
|  |  |  | private String polluteTypeName; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "纬度") | 
|---|
|  |  |  | private String latitude; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "经度") | 
|---|
|  |  |  | private String longitude; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "省市区地址") | 
|---|
|  |  |  | private String address; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "详细地址") | 
|---|
|  |  |  | private String name; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static AllocationVo convert(AllocationExt allocationExt) { | 
|---|
|  |  |  | AllocationVo allocationVo = BeanConverts.convert(allocationExt, AllocationVo.class); | 
|---|
|  |  |  | 
|---|
|  |  |  | //上报单位名字 | 
|---|
|  |  |  | private String escalationUnitName; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "纬度") | 
|---|
|  |  |  | private String latitude; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "经度") | 
|---|
|  |  |  | private String longitude; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "省市区地址") | 
|---|
|  |  |  | private String address; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "详细地址") | 
|---|
|  |  |  | private String name; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public Integer getResidueDay() { | 
|---|
|  |  |  | int day=0; | 
|---|
|  |  |  | if (this.changeType==ChangeEnum.DEADLINE.value){ | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | /* | 
|---|
|  |  |  | package com.moral.api.task; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.moral.api.utils.WcharTest; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.scheduling.annotation.EnableScheduling; | 
|---|
|  |  |  | import org.springframework.scheduling.annotation.Scheduled; | 
|---|
|  |  |  | import org.springframework.stereotype.Component; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.awt.*; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @ClassName jobTask | 
|---|
|  |  |  | * @Description TODO | 
|---|
|  |  |  | * @Author @cjl | 
|---|
|  |  |  | * @Date 2023-12-07 15:08 | 
|---|
|  |  |  | * @Version 1.0 | 
|---|
|  |  |  | *//* | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Component | 
|---|
|  |  |  | @EnableScheduling | 
|---|
|  |  |  | @Slf4j | 
|---|
|  |  |  | public class jobTask { | 
|---|
|  |  |  | @Scheduled(cron = "0/20 * * * * ?") | 
|---|
|  |  |  | public void startTask(){ | 
|---|
|  |  |  | String friendNickName = "文件传输助手";// "文件传输助手"; | 
|---|
|  |  |  | String msg="系统正在定时播报,每二十秒播报一次"; | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | WcharTest.sendMsgforSp(friendNickName,msg); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | log.error("error result ",e); | 
|---|
|  |  |  | throw new RuntimeException(e); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | System.out.println("每隔20秒执行一次:" + new Date()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | */ | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | package com.moral.api.utils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import lombok.SneakyThrows; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.awt.*; | 
|---|
|  |  |  | import java.awt.datatransfer.Clipboard; | 
|---|
|  |  |  | import java.awt.datatransfer.StringSelection; | 
|---|
|  |  |  | import java.awt.datatransfer.Transferable; | 
|---|
|  |  |  | import java.awt.event.KeyEvent; | 
|---|
|  |  |  | import java.text.ParseException; | 
|---|
|  |  |  | import java.text.SimpleDateFormat; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  | import java.util.Timer; | 
|---|
|  |  |  | import java.util.TimerTask; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @ClassName WcharTest | 
|---|
|  |  |  | * @Description TODO | 
|---|
|  |  |  | * @Author @cjl | 
|---|
|  |  |  | * @Date 2023-12-07 14:27 | 
|---|
|  |  |  | * @Version 1.0 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public class WcharTest { | 
|---|
|  |  |  | public static void main(String[] args) throws ParseException { | 
|---|
|  |  |  | // 好友昵称 | 
|---|
|  |  |  | String friendNickName = "文件传输助手";// "文件传输助手"; | 
|---|
|  |  |  | String msg="测试发送消息00";//发送内容 | 
|---|
|  |  |  | Timer timer = new Timer(); | 
|---|
|  |  |  | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 
|---|
|  |  |  | Date date = format.parse("2023-07-03 14:43:00"); | 
|---|
|  |  |  | System.out.println("进入定时器"); | 
|---|
|  |  |  | timer.schedule(new TimerTask() { | 
|---|
|  |  |  | @SneakyThrows | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public void run() { | 
|---|
|  |  |  | sendMsgforSp(friendNickName, msg); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | },date); | 
|---|
|  |  |  | System.out.println("结束"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 发送消息给好友 | 
|---|
|  |  |  | * @param friendNickName 指定好友 | 
|---|
|  |  |  | * @param msg 消息内容 | 
|---|
|  |  |  | * @throws AWTException | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static void sendMsgforSp(String friendNickName, String msg) throws AWTException { | 
|---|
|  |  |  | //创建robot对象 | 
|---|
|  |  |  | Robot robot = new Robot(); | 
|---|
|  |  |  | //第一步:打开微信 control+alt+w | 
|---|
|  |  |  | robot.keyPress(KeyEvent.VK_CONTROL); | 
|---|
|  |  |  | robot.keyPress(KeyEvent.VK_ALT); | 
|---|
|  |  |  | robot.keyPress(KeyEvent.VK_W); | 
|---|
|  |  |  | //释放Ctrl按键,像Ctrl,退格键,删除键这样的功能性按键,在按下后一定要释放 | 
|---|
|  |  |  | robot.keyRelease(KeyEvent.VK_CONTROL); | 
|---|
|  |  |  | robot.keyRelease(KeyEvent.VK_ALT); | 
|---|
|  |  |  | // 该延迟不能少,否则无法搜索 | 
|---|
|  |  |  | robot.delay(2000); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //第二步搜索好友 | 
|---|
|  |  |  | // Ctrl + F 搜索指定好友 | 
|---|
|  |  |  | robot.keyPress(KeyEvent.VK_CONTROL); | 
|---|
|  |  |  | robot.keyPress(KeyEvent.VK_F); | 
|---|
|  |  |  | robot.keyRelease(KeyEvent.VK_CONTROL); | 
|---|
|  |  |  | // 将好友昵称发送到剪切板 | 
|---|
|  |  |  | Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard(); | 
|---|
|  |  |  | Transferable tText = new StringSelection(friendNickName); | 
|---|
|  |  |  | clip.setContents(tText, null); | 
|---|
|  |  |  | // 以下两行按下了ctrl+v,完成粘贴功能 | 
|---|
|  |  |  | robot.keyPress(KeyEvent.VK_CONTROL); | 
|---|
|  |  |  | robot.keyPress(KeyEvent.VK_V); | 
|---|
|  |  |  | robot.keyRelease(KeyEvent.VK_CONTROL); | 
|---|
|  |  |  | robot.delay(2000); | 
|---|
|  |  |  | robot.keyPress(KeyEvent.VK_ENTER); | 
|---|
|  |  |  | robot.delay(2000); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //第三步发送消息 | 
|---|
|  |  |  | //发送消息 | 
|---|
|  |  |  | // 将字符串复制到剪切板 | 
|---|
|  |  |  | Transferable tText1 = new StringSelection(msg); | 
|---|
|  |  |  | clip.setContents(tText1, null); | 
|---|
|  |  |  | // 以下两行按下了ctrl+v,完成粘贴功能 | 
|---|
|  |  |  | robot.keyPress(KeyEvent.VK_CONTROL); | 
|---|
|  |  |  | robot.keyPress(KeyEvent.VK_V); | 
|---|
|  |  |  | robot.keyRelease(KeyEvent.VK_CONTROL); | 
|---|
|  |  |  | // 回车发送 | 
|---|
|  |  |  | robot.keyPress(KeyEvent.VK_ENTER); | 
|---|
|  |  |  | robot.delay(2000); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | main: | 
|---|
|  |  |  | allow-bean-definition-overriding: true | 
|---|
|  |  |  | redis: | 
|---|
|  |  |  | host: r-bp1hez4g7rkqjswpay158.redis.rds.aliyuncs.com | 
|---|
|  |  |  | host: r-bp1hez4g7rkqjswpaypd159.redis.rds.aliyuncs.com | 
|---|
|  |  |  | port: 6379 | 
|---|
|  |  |  | password: moral_123456 | 
|---|
|  |  |  | timeout: 30000 | 
|---|
|  |  |  | 
|---|
|  |  |  | max-wait: 30000 | 
|---|
|  |  |  | min-idle: 32 | 
|---|
|  |  |  | tokenRedis: | 
|---|
|  |  |  | host: r-bp1hez4g7rkqjswpay158.redis.rds.aliyuncs.com | 
|---|
|  |  |  | host: r-bp1hez4g7rkqjswpaypd159.redis.rds.aliyuncs.com | 
|---|
|  |  |  | port: 6379 | 
|---|
|  |  |  | password: moral_123456 | 
|---|
|  |  |  | timeout: 30000 | 
|---|
|  |  |  | 
|---|
|  |  |  | <result column="state" property="state" /> | 
|---|
|  |  |  | <result column="invalid_reason" property="invalidReason" /> | 
|---|
|  |  |  | <result column="key_point" property="keyPoint" /> | 
|---|
|  |  |  | <result column="latitude" property="latitude" /> | 
|---|
|  |  |  | <result column="longitude" property="longitude" /> | 
|---|
|  |  |  | <result column="address" property="address" /> | 
|---|
|  |  |  | <result column="name" property="name" /> | 
|---|
|  |  |  | </resultMap> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 通用查询结果列 --> | 
|---|
|  |  |  | <sql id="Base_Column_List"> | 
|---|
|  |  |  | allocation_id, allocation_num, escalation_type, escalation_time, pollute_position, unit_id, pollute_type, change_type, change_day, escalation_unit_id, escalation_name, investigation_type, problem_describe, is_change, change_describe, change_name, change_time, check_score, check_describe, check_name, check_time, state, is_del, is_invalid, invalid_reason, create_id, create_name, create_time, update_id, update_name, update_time | 
|---|
|  |  |  | allocation_id, allocation_num, escalation_type, escalation_time, pollute_position, unit_id, pollute_type, change_type, change_day, escalation_unit_id, escalation_name, investigation_type, problem_describe, is_change, change_describe, change_name, change_time, check_score, check_describe, check_name, check_time, state, is_del, is_invalid, invalid_reason, create_id, create_name, create_time, update_id, update_name, update_time,latitude,longitude,address,name | 
|---|
|  |  |  | </sql> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 通用查询结果列 --> | 
|---|
|  |  |  | <sql id="Allocation_Column_List"> | 
|---|
|  |  |  | allocation.allocation_id, allocation.allocation_num, allocation.escalation_type, allocation.escalation_time, allocation.pollute_position, allocation.unit_id, allocation.pollute_type, allocation.change_type, allocation.change_day, allocation.escalation_unit_id, allocation.escalation_name, allocation.investigation_type, allocation.problem_describe, allocation.is_change, allocation.change_describe, allocation.change_name, allocation.change_time, allocation.check_score, allocation.check_describe, allocation.check_name, allocation.check_time, allocation.state, allocation.is_del, allocation.is_invalid, allocation.invalid_reason, allocation.create_id, allocation.create_name, allocation.create_time, allocation.update_id, allocation.update_name, allocation.update_time,allocation.key_point | 
|---|
|  |  |  | allocation.allocation_id, allocation.allocation_num, allocation.escalation_type, allocation.escalation_time, allocation.pollute_position, allocation.unit_id, allocation.pollute_type, allocation.change_type, allocation.change_day, allocation.escalation_unit_id, allocation.escalation_name, allocation.investigation_type, allocation.problem_describe, allocation.is_change, allocation.change_describe, allocation.change_name, allocation.change_time, allocation.check_score, allocation.check_describe, allocation.check_name, allocation.check_time, allocation.state, allocation.is_del, allocation.is_invalid, allocation.invalid_reason, allocation.create_id, allocation.create_name, allocation.create_time, allocation.update_id, allocation.update_name, allocation.update_time,allocation.key_point,allocation.latitude,allocation.longitude,allocation.address,allocation.name | 
|---|
|  |  |  | </sql> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|