| | |
| | | <artifactId>kotlin-stdlib</artifactId> |
| | | <version>1.8.21</version> |
| | | </dependency> |
| | | |
| | | <!--md5è§£å¯--> |
| | | <dependency> |
| | | <groupId>commons-codec</groupId> |
| | | <artifactId>commons-codec</artifactId> |
| | | <version>1.14</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | return Result.success(list); |
| | | } |
| | | |
| | | /*åå
¥ç¨æ·çå
¨å±é
ç½®*/ |
| | | @PostMapping("setting") |
| | | public Result setting(@RequestBody DustDataAccessSetting dustDataAccessSetting){ |
| | | fugitiveDustService.setting(dustDataAccessSetting); |
| | | return Result.success(); |
| | | } |
| | | |
| | | |
| | | /*æ ¹æ®å¼å¸¸ç±»ååæ¶æ®µ è¿åç«ç¹åå*/ |
| | | @GetMapping("/exceptionsSiteName") |
| | | public Result getSiteNameByTimeAndExceptionType(String [] exceptionType,String beginTime, String endTime){ |
| | | List<DustExceptionData> list = fugitiveDustService.getSiteNameByTimeAndExceptionType(exceptionType,beginTime,endTime); |
| | | return Result.success(list); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/analysisdataByType") |
| | | public Result analysisdataByType( String month,String type){ |
| | | List<AnalysisDustData> list = fugitiveDustService.analysisdataByType(month,type); |
| | | return Result.success(list); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/analysisdataByTimeAndType") |
| | | public Result analysisdataByTimeAndType( String beginTime,String endTime,String type){ |
| | | List<AnalysisDustData> list = fugitiveDustService.analysisdataByTimeAndType(beginTime,endTime,type); |
| | | return Result.success(list); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | //夿ï¼ç»å½ç¨æ·æ¯å¦åå¨ |
| | | if(login !=null ){ |
| | | |
| | | return Result.success("ç»éæå"); |
| | | } |
| | | return Result.error("ç¨æ·åæå¯ç é误"); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.job.zsc.controller.dustexception; |
| | | |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.CrossOrigin; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @Slf4j |
| | | @RequestMapping("/dustAnalisys") |
| | | @CrossOrigin |
| | | @RestController |
| | | public class onlineAnalysisController { |
| | | |
| | | @Autowired |
| | | private com.job.zsc.service.dustexception.onlineAnalysisService onlineAnalysisService; |
| | | |
| | | @GetMapping("/analysisData") |
| | | public void get(){ |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | @Insert("insert into dust_global_setting(user,create_time,begin_time,end_time,region,is_regular_time) values( #{user},#{createTime},#{beginTime},#{endTime},#{region},#{isRegularTime})") |
| | | void setting(DustDataAccessSetting dustDataAccessSetting); |
| | | |
| | | |
| | | List<DustExceptionData> getSiteNameByTimeAndExceptionType(@Param("exceptionType")String[] exceptionType, String beginTime, String endTime); |
| | | |
| | | List<AnalysisDustData> analysisdataByType(String month,String type); |
| | | |
| | | |
| | | List<AnalysisDustData> analysisdataByTimeAndType(String beginTime, String endTime, String type); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.job.zsc.mapper.dustexception; |
| | | |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public class onlineAnalysisMapper { |
| | | } |
| | |
| | | private String dayOnline; |
| | | private String dayValid; |
| | | private String dayExceeding; |
| | | private String type; |
| | | } |
| | |
| | | |
| | | |
| | | void setting(DustDataAccessSetting dustDataAccessSetting); |
| | | |
| | | List<DustExceptionData> getSiteNameByTimeAndExceptionType(String[] exceptionType, String beginTime, String endTime); |
| | | |
| | | List<AnalysisDustData> analysisdataByType(String month,String type); |
| | | |
| | | List<AnalysisDustData> analysisdataByTimeAndType(String beginTime, String endTime, String type); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.job.zsc.service.dustexception; |
| | | |
| | | public interface onlineAnalysisService { |
| | | } |
| | |
| | | fugitiveDustMapper.setting(dustDataAccessSetting); |
| | | } |
| | | |
| | | @Override |
| | | public List<DustExceptionData> getSiteNameByTimeAndExceptionType(String[] exceptionType, String beginTime, String endTime) { |
| | | List<DustExceptionData> list = fugitiveDustMapper.getSiteNameByTimeAndExceptionType(exceptionType,beginTime,endTime); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<AnalysisDustData> analysisdataByType(String month,String type) { |
| | | List<AnalysisDustData> list = fugitiveDustMapper.analysisdataByType(month,type); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<AnalysisDustData> analysisdataByTimeAndType(String beginTime, String endTime, String type) { |
| | | List<AnalysisDustData> list = fugitiveDustMapper.analysisdataByTimeAndType(beginTime,endTime,type); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.job.zsc.service.impl.dustexception; |
| | | |
| | | import com.job.zsc.service.dustexception.onlineAnalysisService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class onlineAnalysisImpl implements onlineAnalysisService { |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.job.zsc.utils; |
| | | |
| | | import java.math.BigInteger; |
| | | import java.security.MessageDigest; |
| | | import java.security.NoSuchAlgorithmException; |
| | | |
| | | /** |
| | | * MD5å å¯è§£å¯å·¥å
·ç±» |
| | | * @author admin |
| | | * |
| | | */ |
| | | public class MD5Util { |
| | | |
| | | /** |
| | | * @param args |
| | | */ |
| | | public static void main(String[] args) { |
| | | |
| | | String s = "admin123"; |
| | | System.out.println("åå§ï¼" + s); |
| | | System.out.println("MD5åï¼" + string2MD5(s)); |
| | | |
| | | System.out.println("å¯è§£å¯çå å¯ç®æ³ï¼å å¯åï¼" + convertMD5(s)); |
| | | System.out.println("è§£å¯åï¼" + convertMD5(convertMD5(s))); |
| | | } |
| | | |
| | | /** |
| | | * ä½¿ç¨ MD5ç®æ³å å¯çæ32ä½md5ç |
| | | * @param str |
| | | * @return |
| | | */ |
| | | public static String string2MD5(String str) { |
| | | byte[] secretBytes = null; |
| | | try { |
| | | secretBytes = MessageDigest.getInstance("md5").digest( |
| | | str.getBytes()); |
| | | } catch (NoSuchAlgorithmException e) { |
| | | throw new RuntimeException("没æmd5è¿ä¸ªç®æ³ï¼"); |
| | | } |
| | | String md5code = new BigInteger(1, secretBytes).toString(16);// 16è¿å¶æ°å |
| | | // å¦æçææ°åæªæ»¡32ä½ï¼éè¦åé¢è¡¥0 |
| | | for (int i = 0; i < 32 - md5code.length(); i++) { |
| | | md5code = "0" + md5code; |
| | | } |
| | | return md5code; |
| | | } |
| | | |
| | | /** |
| | | * å¯éçå å¯è§£å¯ç®æ³,æ§è¡ä¸æ¬¡å å¯,ä¸¤æ¬¡è§£å¯ |
| | | * @param str |
| | | * @return |
| | | */ |
| | | public static String convertMD5(String str){ |
| | | |
| | | char[] a = str.toCharArray(); |
| | | for (int i = 0; i < a.length; i++){ |
| | | a[i] = (char) (a[i] ^ 't'); |
| | | } |
| | | String s = new String(a); |
| | | return s; |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | order by lst asc ) as d on c.mn_code = d.mn_code |
| | | </select> |
| | | |
| | | <!--æ¡ä»¶æ¥è¯¢å¼å¸¸æ°æ®--> |
| | | <!--æ¡ä»¶æ¥è¯¢å¼å¸¸æ°æ® å ä¸äºå®¡è®¡ä¿¡æ¯--> |
| | | <select id="getExceptionData" resultType="com.job.zsc.pojo.DustExceptionData"> |
| | | select * |
| | | from (select a.* ,b.name,b.typename,b.address,b.duty_company |
| | |
| | | </foreach> |
| | | </if> |
| | | |
| | | |
| | | <if test="beginTime != null and endTime != null"> |
| | | and (a.begin_time between #{beginTime} and #{endTime} or a.end_time between #{beginTime} and #{endTime}) |
| | | </if> |
| | |
| | | </select> |
| | | |
| | | |
| | | |
| | | <!-- æ ¹æ®ææ®µæ¶é´å
æä¸ªå¼å¸¸ç±»åæ¥è¯¢å¯¹åºçåºéºåç§°å设å¤ç¼å·--> |
| | | <select id="getExceptionSitenameAndCode" resultType="com.job.zsc.pojo.DustExceptionData"> |
| | | select DISTINCT b.name,a.mn_code |
| | | from dust_exception_data as a join ja_t_dust_site_info as b on a.mn_code = b.mn_code |
| | | |
| | | <where> |
| | | <if test="exceptionType !=null and exceptionType != ''"> |
| | | a.exception_type = #{exceptionType} |
| | |
| | | </where> |
| | | order by a.lst asc |
| | | </select> |
| | | |
| | | <select id="getHasAuditedData" resultType="com.job.zsc.pojo.DustExceptionData"> |
| | | select * |
| | | from dust_exception_data as a left join audit_info as b on a.id = b.exception_id |
| | |
| | | </where> |
| | | |
| | | </select> |
| | | <select id="getSiteNameByTimeAndExceptionType" resultType="com.job.zsc.pojo.DustExceptionData"> |
| | | select DISTINCT b.name |
| | | from dust_exception_data as a join ja_t_dust_site_info as b on a.mn_code = b.mn_code |
| | | <where> |
| | | <if test="exceptionType != null and exceptionType != '' "> |
| | | a.exception_type in |
| | | <foreach item="item" collection="exceptionType" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="beginTime != null and endTime != null"> |
| | | and (a.begin_time between #{beginTime} and #{endTime} or a.end_time between #{beginTime} and #{endTime}) |
| | | </if> |
| | | </where> |
| | | |
| | | </select> |
| | | <select id="analysisdataByType" resultType="com.job.zsc.pojo.AnalysisDustData"> |
| | | select a.*,b.name,b.duty_company from dust_statistics_value as a join ja_t_dust_site_info as b on a.mn_code = b. mn_code |
| | | <where> |
| | | <if test="month != null and month != null"> |
| | | a.lst = #{month} |
| | | </if> |
| | | |
| | | <if test="type != null and type != ''"> |
| | | and a.type = #{type} |
| | | </if> |
| | | </where> |
| | | |
| | | </select> |
| | | <select id="analysisdataByTimeAndType" resultType="com.job.zsc.pojo.AnalysisDustData"> |
| | | select a.*,b.name,b.duty_company from dust_statistics_value as a join ja_t_dust_site_info as b on a.mn_code = b. mn_code |
| | | <where> |
| | | <if test="beginTime != null and endTime != null"> |
| | | a.Lst between #{beginTime} and #{endTime} |
| | | </if> |
| | | |
| | | <if test="type != null and type != ''"> |
| | | and a.type = #{type} |
| | | </if> |
| | | </where> |
| | | |
| | | |
| | | </select> |
| | | </mapper> |