Merge remote-tracking branch 'origin/master'
正在显示
13 个修改的文件
包含
309 行增加
和
40 行删除
... | @@ -17,6 +17,12 @@ | ... | @@ -17,6 +17,12 @@ |
17 | <artifactId>javassist</artifactId> | 17 | <artifactId>javassist</artifactId> |
18 | <version>3.21.0-GA</version> | 18 | <version>3.21.0-GA</version> |
19 | </dependency> | 19 | </dependency> |
20 | <!-- 汉字转拼音 --> | ||
21 | <dependency> | ||
22 | <groupId>com.belerweb</groupId> | ||
23 | <artifactId>pinyin4j</artifactId> | ||
24 | <version>2.5.1</version> | ||
25 | </dependency> | ||
20 | </dependencies> | 26 | </dependencies> |
21 | 27 | ||
22 | <repositories> | 28 | <repositories> | ... | ... |
... | @@ -30,7 +30,7 @@ | ... | @@ -30,7 +30,7 @@ |
30 | inner join sys_factory_device sfd on sfi.depart_id = sfd.depart_id | 30 | inner join sys_factory_device sfd on sfi.depart_id = sfd.depart_id |
31 | WHERE | 31 | WHERE |
32 | 1=1 | 32 | 1=1 |
33 | and sd.depart_type in(3,4,5) | 33 | and sd.depart_type in(1,3,4,5) |
34 | <if test="departId!=null and departId!='' "> | 34 | <if test="departId!=null and departId!='' "> |
35 | and sfi.depart_id = #{departId} | 35 | and sfi.depart_id = #{departId} |
36 | </if> | 36 | </if> | ... | ... |
1 | package com.skua.tool.util; | ||
2 | |||
3 | import net.sourceforge.pinyin4j.PinyinHelper; | ||
4 | import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; | ||
5 | import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; | ||
6 | import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; | ||
7 | import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; | ||
8 | |||
9 | public class ChineseToPinyin { | ||
10 | public static String toPinyin(String chinese) { | ||
11 | HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat(); | ||
12 | format.setCaseType(HanyuPinyinCaseType.LOWERCASE); | ||
13 | format.setToneType(HanyuPinyinToneType.WITHOUT_TONE); | ||
14 | |||
15 | StringBuilder sb = new StringBuilder(); | ||
16 | char[] chars = chinese.toCharArray(); | ||
17 | for (char ch : chars) { | ||
18 | if (Character.isWhitespace(ch)) { | ||
19 | continue; | ||
20 | } | ||
21 | if (ch > 128) { | ||
22 | try { | ||
23 | String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(ch, format); | ||
24 | if (pinyinArray != null) { | ||
25 | sb.append(pinyinArray[0]); | ||
26 | } else { | ||
27 | sb.append(ch); | ||
28 | } | ||
29 | } catch (BadHanyuPinyinOutputFormatCombination e) { | ||
30 | e.printStackTrace(); | ||
31 | } | ||
32 | } else { | ||
33 | sb.append(ch); | ||
34 | } | ||
35 | } | ||
36 | return sb.toString(); | ||
37 | } | ||
38 | |||
39 | public static void main(String[] args) { | ||
40 | String chinese = "中文"; | ||
41 | String pinyin = toPinyin(chinese); | ||
42 | System.out.println(pinyin); // zhongwen 或者 zhong wen 取决于HanyuPinyinToneType设置 | ||
43 | } | ||
44 | } |
... | @@ -37,7 +37,6 @@ import com.google.common.collect.Sets; | ... | @@ -37,7 +37,6 @@ import com.google.common.collect.Sets; |
37 | import com.skua.core.context.SpringContextUtils; | 37 | import com.skua.core.context.SpringContextUtils; |
38 | import com.skua.core.util.ConvertUtils; | 38 | import com.skua.core.util.ConvertUtils; |
39 | import com.skua.core.util.DateUtils; | 39 | import com.skua.core.util.DateUtils; |
40 | import com.skua.core.util.chuanglan.HttpSenderMsg; | ||
41 | import com.skua.core.util.push.IPushService; | 40 | import com.skua.core.util.push.IPushService; |
42 | import com.skua.core.util.push.MessageEntity; | 41 | import com.skua.core.util.push.MessageEntity; |
43 | import com.skua.core.util.push.PushMessageFactory; | 42 | import com.skua.core.util.push.PushMessageFactory; |
... | @@ -581,7 +580,7 @@ public class RealTimeAlarmJob implements Job { | ... | @@ -581,7 +580,7 @@ public class RealTimeAlarmJob implements Job { |
581 | aliAlarm.setTime(date); | 580 | aliAlarm.setTime(date); |
582 | aliAlarm.setPhone(phone1); | 581 | aliAlarm.setPhone(phone1); |
583 | //发送短信 | 582 | //发送短信 |
584 | HttpSenderMsg.sendMsg(prefix + date + "时" + departName + "采集数据" + content + suffix, phone1); | 583 | // HttpSenderMsg.sendMsg(prefix + date + "时" + departName + "采集数据" + content + suffix, phone1); |
585 | AliSmsUtil.sendLimitAlarmMsg(aliAlarm);//新版短息发送工具 | 584 | AliSmsUtil.sendLimitAlarmMsg(aliAlarm);//新版短息发送工具 |
586 | log.info("短信发送成功手机号:" + phone1 + ",内容:" + content); | 585 | log.info("短信发送成功手机号:" + phone1 + ",内容:" + content); |
587 | } | 586 | } | ... | ... |
sk-module-biz/src/main/java/com/skua/modules/dataAnalysis/service/impl/CustomConsumeServiceImpl.java
... | @@ -141,25 +141,42 @@ public class CustomConsumeServiceImpl implements ICustomConsumeService { | ... | @@ -141,25 +141,42 @@ public class CustomConsumeServiceImpl implements ICustomConsumeService { |
141 | //获取当天同比数据map | 141 | //获取当天同比数据map |
142 | Map<String,Object> tb = tbMap.get(DateUtils.formatAddTime(time,formatPattern,Calendar.YEAR,-1)); | 142 | Map<String,Object> tb = tbMap.get(DateUtils.formatAddTime(time,formatPattern,Calendar.YEAR,-1)); |
143 | if(tb!=null&&tb.size()>0) { | 143 | if(tb!=null&&tb.size()>0) { |
144 | double value = ConvertUtils.getDouble(map.get(index), 0); | ||
145 | double tb_value = 0; | ||
144 | if(index.contains("JSLL")||index.contains("CSLL")) { | 146 | if(index.contains("JSLL")||index.contains("CSLL")) { |
145 | tempMap.put(index+"_tb", DoubleOperaUtils.bigDecimalRound(ConvertUtils.getDouble(tb.get(realKey), 0.0), 2)); | 147 | tb_value = DoubleOperaUtils.bigDecimalRound(ConvertUtils.getDouble(tb.get(realKey), 0.0), 2); |
146 | }else { | 148 | }else { |
147 | tempMap.put(index+"_tb", DoubleOperaUtils.bigDecimalRound(ConvertUtils.getDouble(tb.get(realKey), 0.0)/ConvertUtils.getDouble(tb.get(realKey+"_tag"), 1.0), 2)); | 149 | tb_value = DoubleOperaUtils.bigDecimalRound(ConvertUtils.getDouble(tb.get(realKey), 0.0)/ConvertUtils.getDouble(tb.get(realKey+"_tag"), 1.0), 2); |
150 | } | ||
151 | tempMap.put(index+"_tb", tb_value); | ||
152 | //添加同比比例 | ||
153 | if(tb_value==0) { | ||
154 | map.put(index+"_tb_rate", 0); | ||
155 | }else { | ||
156 | map.put(index+"_tb_rate", DoubleOperaUtils.bigDecimalRound((value - tb_value)/tb_value*100, 2)); | ||
148 | } | 157 | } |
149 | } | 158 | } |
150 | } | 159 | } |
151 | if(!StringUtils.isEmpty(contrastType)&&contrastType.contains("hb")) { | 160 | if(!StringUtils.isEmpty(contrastType)&&contrastType.contains("hb")) { |
152 | //获取当天同比数据map | 161 | //获取当天同比数据map |
153 | |||
154 | Map<String,Object> hb = hbMap.get(DateUtils.formatAddTime(time,formatPattern,Calendar.MONTH,-1)); | 162 | Map<String,Object> hb = hbMap.get(DateUtils.formatAddTime(time,formatPattern,Calendar.MONTH,-1)); |
155 | if("hour".equals(granularity)) { | 163 | if("hour".equals(granularity)) { |
156 | hb = hbMap.get(DateUtils.formatAddTime(time,formatPattern,Calendar.DAY_OF_YEAR,-1)); | 164 | hb = hbMap.get(DateUtils.formatAddTime(time,formatPattern,Calendar.DAY_OF_YEAR,-1)); |
157 | } | 165 | } |
158 | if(hb!=null&&hb.size()>0) { | 166 | if(hb!=null&&hb.size()>0) { |
167 | double value = ConvertUtils.getDouble(map.get(index), 0); | ||
168 | double hb_value = 0; | ||
159 | if(index.contains("JSLL")||index.contains("CSLL")) { | 169 | if(index.contains("JSLL")||index.contains("CSLL")) { |
160 | tempMap.put(index+"_hb", DoubleOperaUtils.bigDecimalRound(ConvertUtils.getDouble(hb.get(realKey), 0.0), 2)); | 170 | hb_value = DoubleOperaUtils.bigDecimalRound(ConvertUtils.getDouble(hb.get(realKey), 0.0), 2); |
171 | }else { | ||
172 | hb_value = DoubleOperaUtils.bigDecimalRound(ConvertUtils.getDouble(hb.get(realKey), 0.0)/ConvertUtils.getDouble(hb.get(realKey+"_tag"), 1.0), 2); | ||
173 | } | ||
174 | tempMap.put(index+"_hb", hb_value); | ||
175 | //添加同比比例 | ||
176 | if(hb_value==0) { | ||
177 | map.put(index+"_hb_rate", 0); | ||
161 | }else { | 178 | }else { |
162 | tempMap.put(index+"_hb", DoubleOperaUtils.bigDecimalRound(ConvertUtils.getDouble(hb.get(realKey), 0.0)/ConvertUtils.getDouble(hb.get(realKey+"_tag"), 1.0), 2)); | 179 | map.put(index+"_hb_rate", DoubleOperaUtils.bigDecimalRound((value - hb_value)/hb_value*100, 2)); |
163 | } | 180 | } |
164 | } | 181 | } |
165 | } | 182 | } |
... | @@ -385,7 +402,15 @@ public class CustomConsumeServiceImpl implements ICustomConsumeService { | ... | @@ -385,7 +402,15 @@ public class CustomConsumeServiceImpl implements ICustomConsumeService { |
385 | Map<String,Object> tb = tbMap.get(DateUtils.formatAddTime(time,pattern,Calendar.YEAR,-1)+""+map.get("departId")); | 402 | Map<String,Object> tb = tbMap.get(DateUtils.formatAddTime(time,pattern,Calendar.YEAR,-1)+""+map.get("departId")); |
386 | if(tb!=null&&tb.size()>0) { | 403 | if(tb!=null&&tb.size()>0) { |
387 | for(String key : indexArray) { | 404 | for(String key : indexArray) { |
388 | map.put(key+"_tb", tb.get(key)); | 405 | double value = ConvertUtils.getDouble(map.get(key), 0); |
406 | double tb_value = ConvertUtils.getDouble(tb.get(key), 0); | ||
407 | map.put(key+"_tb", String.valueOf(tb_value)); | ||
408 | //添加同比比例 | ||
409 | if(tb_value==0) { | ||
410 | map.put(key+"_tb_rate", 0); | ||
411 | }else { | ||
412 | map.put(key+"_tb_rate", DoubleOperaUtils.bigDecimalRound((value - tb_value)/tb_value*100, 2)); | ||
413 | } | ||
389 | } | 414 | } |
390 | } | 415 | } |
391 | } | 416 | } |
... | @@ -393,7 +418,15 @@ public class CustomConsumeServiceImpl implements ICustomConsumeService { | ... | @@ -393,7 +418,15 @@ public class CustomConsumeServiceImpl implements ICustomConsumeService { |
393 | Map<String,Object> hb = hbMap.get(DateUtils.formatAddTime(time,pattern,Calendar.MONTH,-1)+""+map.get("departId")); | 418 | Map<String,Object> hb = hbMap.get(DateUtils.formatAddTime(time,pattern,Calendar.MONTH,-1)+""+map.get("departId")); |
394 | if(hb!=null&&hb.size()>0) { | 419 | if(hb!=null&&hb.size()>0) { |
395 | for(String key : indexArray) { | 420 | for(String key : indexArray) { |
396 | map.put(key+"_hb", hb.get(key)); | 421 | double value = ConvertUtils.getDouble(map.get(key), 0); |
422 | double hb_value = ConvertUtils.getDouble(hb.get(key), 0); | ||
423 | map.put(key+"_hb", String.valueOf(hb_value)); | ||
424 | //添加同比比例 | ||
425 | if(hb_value==0) { | ||
426 | map.put(key+"_hb_rate", 0); | ||
427 | }else { | ||
428 | map.put(key+"_hb_rate", DoubleOperaUtils.bigDecimalRound((value - hb_value)/hb_value*100, 2)); | ||
429 | } | ||
397 | } | 430 | } |
398 | } | 431 | } |
399 | } | 432 | } | ... | ... |
... | @@ -17,7 +17,7 @@ | ... | @@ -17,7 +17,7 @@ |
17 | ifnull(a.cou,0) count, | 17 | ifnull(a.cou,0) count, |
18 | b.item_text NAME | 18 | b.item_text NAME |
19 | FROM | 19 | FROM |
20 | ( SELECT item_text, item_value FROM sys_dict_item | 20 | ( SELECT item_text, item_value, sort_order FROM sys_dict_item |
21 | WHERE dict_id = ( SELECT id FROM sys_dict WHERE dict_code = 'information_type' ) | 21 | WHERE dict_id = ( SELECT id FROM sys_dict WHERE dict_code = 'information_type' ) |
22 | ) b | 22 | ) b |
23 | left join | 23 | left join |
... | @@ -31,7 +31,7 @@ | ... | @@ -31,7 +31,7 @@ |
31 | GROUP BY fac_informationtype | 31 | GROUP BY fac_informationtype |
32 | ) a | 32 | ) a |
33 | ON a.fac_informationtype = b.item_value | 33 | ON a.fac_informationtype = b.item_value |
34 | 34 | ORDER BY b.sort_order | |
35 | </select> | 35 | </select> |
36 | <select id="flowStatistics" resultType="java.util.Map"> | 36 | <select id="flowStatistics" resultType="java.util.Map"> |
37 | SELECT | 37 | SELECT | ... | ... |
... | @@ -351,7 +351,15 @@ | ... | @@ -351,7 +351,15 @@ |
351 | ROUND( SUM( v.GFCZL ), 2 ) AS ybagfczl, | 351 | ROUND( SUM( v.GFCZL ), 2 ) AS ybagfczl, |
352 | ROUND( SUM( v.WNL )*(1-AVG( v.WNHSL ))) AS jgnl, | 352 | ROUND( SUM( v.WNL )*(1-AVG( v.WNHSL ))) AS jgnl, |
353 | ROUND( SUM( v.WFCSL ), 2 ) AS wxfwcsl, | 353 | ROUND( SUM( v.WFCSL ), 2 ) AS wxfwcsl, |
354 | ROUND( SUM( v.WFCZL ), 2 ) AS wxfwczl | 354 | ROUND( SUM( v.WFCZL ), 2 ) AS wxfwczl, |
355 | v2.jscodl, | ||
356 | v2.cscodl, | ||
357 | v2.jsadl, | ||
358 | v2.csadl, | ||
359 | v2.jstpl, | ||
360 | v2.cstpl, | ||
361 | v2.jstnl, | ||
362 | v2.cstnl | ||
355 | FROM | 363 | FROM |
356 | ${dataViewName3} v | 364 | ${dataViewName3} v |
357 | LEFT JOIN ( | 365 | LEFT JOIN ( |
... | @@ -359,6 +367,14 @@ | ... | @@ -359,6 +367,14 @@ |
359 | LEFT ( v.time, 7 ) AS time, | 367 | LEFT ( v.time, 7 ) AS time, |
360 | ROUND( SUM( v.CSL )/10000, 2 ) AS sjwscll, | 368 | ROUND( SUM( v.CSL )/10000, 2 ) AS sjwscll, |
361 | ROUND( AVG( v.CSL )/10000, 2 ) AS rwscll, | 369 | ROUND( AVG( v.CSL )/10000, 2 ) AS rwscll, |
370 | ROUND( SUM( IFNULL(v.JSCOD*v.JSL,0)/1000000 ), 2 ) AS jscodl, | ||
371 | ROUND( SUM( IFNULL(v.CSCOD*v.CSL,0)/1000000 ), 2 ) AS cscodl, | ||
372 | ROUND( SUM( IFNULL(v.CSTN*v.CSL,0)/1000000 ), 2 ) AS cstnl, | ||
373 | ROUND( SUM( IFNULL(v.JSZD*v.JSL,0)/1000000 ), 2 ) AS jstnl, | ||
374 | ROUND( SUM( IFNULL(v.JSZL*v.JSL,0)/1000000 ), 2 ) AS jstpl, | ||
375 | ROUND( SUM( IFNULL(v.CSZL*v.CSL,0)/1000000 ), 2 ) AS cstpl, | ||
376 | ROUND( SUM( IFNULL(v.JSAD*v.JSL,0)/1000000 ), 2 ) AS jsadl, | ||
377 | ROUND( SUM( IFNULL(v.CSAD*v.CSL,0)/1000000 ), 2 ) AS csadl, | ||
362 | count( v.id ) AS scsj | 378 | count( v.id ) AS scsj |
363 | FROM | 379 | FROM |
364 | ${dataViewName2} v | 380 | ${dataViewName2} v |
... | @@ -396,7 +412,11 @@ | ... | @@ -396,7 +412,11 @@ |
396 | ROUND( SUM( v.GFCZL ), 2 ) AS ybagfczl, | 412 | ROUND( SUM( v.GFCZL ), 2 ) AS ybagfczl, |
397 | ROUND( SUM( v.WNL )*(1-AVG( v.WNHSL ))) AS jgnl, | 413 | ROUND( SUM( v.WNL )*(1-AVG( v.WNHSL ))) AS jgnl, |
398 | ROUND( SUM( v.WFCSL ), 2 ) AS wxfwcsl, | 414 | ROUND( SUM( v.WFCSL ), 2 ) AS wxfwcsl, |
399 | ROUND( SUM( v.WFCZL ), 2 ) AS wxfwczl | 415 | ROUND( SUM( v.WFCZL ), 2 ) AS wxfwczl, |
416 | IFNULL(v2.jscodl-v2.cscodl,0) AS codxjl, | ||
417 | IFNULL(v2.jsadl-v2.csadl,0) AS adxjl, | ||
418 | IFNULL(v2.jstpl-v2.cstpl,0) AS tpxjl, | ||
419 | IFNULL(v2.jstnl-v2.cstnl,0) AS tnxjl | ||
400 | FROM | 420 | FROM |
401 | ${dataViewName3} v | 421 | ${dataViewName3} v |
402 | LEFT JOIN ( | 422 | LEFT JOIN ( |
... | @@ -404,6 +424,14 @@ | ... | @@ -404,6 +424,14 @@ |
404 | LEFT ( v.time, 7 ) AS time, | 424 | LEFT ( v.time, 7 ) AS time, |
405 | ROUND( SUM( v.CSL )/10000, 2 ) AS sjwscll, | 425 | ROUND( SUM( v.CSL )/10000, 2 ) AS sjwscll, |
406 | ROUND( AVG( v.CSL )/10000, 2 ) AS rwscll, | 426 | ROUND( AVG( v.CSL )/10000, 2 ) AS rwscll, |
427 | ROUND( SUM( IFNULL(v.JSCOD*v.JSL,0)/1000000 ), 2 ) AS jscodl, | ||
428 | ROUND( SUM( IFNULL(v.CSCOD*v.CSL,0)/1000000 ), 2 ) AS cscodl, | ||
429 | ROUND( SUM( IFNULL(v.CSTN*v.CSL,0)/1000000 ), 2 ) AS cstnl, | ||
430 | ROUND( SUM( IFNULL(v.JSZD*v.JSL,0)/1000000 ), 2 ) AS jstnl, | ||
431 | ROUND( SUM( IFNULL(v.JSZL*v.JSL,0)/1000000 ), 2 ) AS jstpl, | ||
432 | ROUND( SUM( IFNULL(v.CSZL*v.CSL,0)/1000000 ), 2 ) AS cstpl, | ||
433 | ROUND( SUM( IFNULL(v.JSAD*v.JSL,0)/1000000 ), 2 ) AS jsadl, | ||
434 | ROUND( SUM( IFNULL(v.CSAD*v.CSL,0)/1000000 ), 2 ) AS csadl, | ||
407 | count( v.id ) AS scsj | 435 | count( v.id ) AS scsj |
408 | FROM | 436 | FROM |
409 | ${dataViewName2} v | 437 | ${dataViewName2} v |
... | @@ -423,25 +451,34 @@ | ... | @@ -423,25 +451,34 @@ |
423 | <select id="getHjList" resultType="com.skua.modules.report.vo.JnhbReportDetailsHj"> | 451 | <select id="getHjList" resultType="com.skua.modules.report.vo.JnhbReportDetailsHj"> |
424 | SELECT | 452 | SELECT |
425 | RIGHT(LEFT( v.time, 7 ),2) AS time, | 453 | RIGHT(LEFT( v.time, 7 ),2) AS time, |
426 | v2.sjwscll, | 454 | IFNULL(v2.sjwscll,0) AS sjwscll, |
427 | v2.rwscll, | 455 | IFNULL(v2.rwscll,0) AS rwscll, |
428 | v2.scsj, | 456 | IFNULL(v2.scsj,0) AS scsj, |
429 | ROUND(v2.scsj*f.pro_scale,2) AS wsclnl, | 457 | IFNULL(ROUND(v2.scsj*f.pro_scale,2),0) AS wsclnl, |
430 | ROUND( SUM( v.DLHJ ) / 10000, 2 ) AS dl, | 458 | IFNULL(ROUND( SUM( v.DLHJ ) / 10000, 2 ),0) AS dl, |
431 | ROUND( SUM( v.GFFDL ), 2 ) AS gffdl, | 459 | IFNULL(ROUND( SUM( v.GFFDL ), 2 ),0) AS gffdl, |
432 | ROUND( SUM( v.QY ), 2 ) AS qy, | 460 | IFNULL(ROUND( SUM( v.QY ), 2 ),0) AS qy, |
433 | ROUND( SUM( v.HXT ), 2 ) AS hxtsyl, | 461 | IFNULL(ROUND( SUM( v.HXT ), 2 ),0) AS hxtsyl, |
434 | ROUND( SUM( v.SH ), 2 ) AS shsyl, | 462 | IFNULL(ROUND( SUM( v.SH ), 2 ),0) AS shsyl, |
435 | ROUND( SUM( v.PAMRJ ), 2 ) AS xnjpam, | 463 | IFNULL(ROUND( SUM( v.PAMRJ ), 2 ),0) AS xnjpam, |
436 | ROUND( SUM( v.PACGT ), 2 ) AS xnjpac, | 464 | IFNULL(ROUND( SUM( v.PACGT ), 2 ),0) AS xnjpac, |
437 | ROUND( SUM( v.SCLPAMF+v.SCLPAMZ+v.PAMF+v.PAMZ ), 2 ) AS xnjqt, | 465 | IFNULL(ROUND( SUM( v.SCLPAMF+v.SCLPAMZ+v.PAMF+v.PAMZ ), 2 ),0) AS xnjqt, |
438 | ROUND( SUM( v.YSL ), 2 ) AS xssyl, | 466 | IFNULL(ROUND( SUM( v.YSL ), 2 ),0) AS xssyl, |
439 | ROUND( SUM( v.WNL ), 2 ) AS ybgfcsl, | 467 | IFNULL(ROUND( SUM( v.WNL ), 2 ),0) AS ybgfcsl, |
440 | ROUND( AVG( v.WNHSL ), 2 ) AS wnhsl, | 468 | IFNULL(ROUND( AVG( v.WNHSL ), 2 ),0) AS wnhsl, |
441 | ROUND( SUM( v.GFCZL ), 2 ) AS ybagfczl, | 469 | IFNULL(ROUND( SUM( v.GFCZL ), 2 ),0) AS ybagfczl, |
442 | ROUND( SUM( v.WNL )*(1-AVG( v.WNHSL ))) AS jgnl, | 470 | IFNULL(ROUND( SUM( v.WNL )*(1-AVG( v.WNHSL ))),0) AS jgnl, |
443 | ROUND( SUM( v.WFCSL ), 2 ) AS wxfwcsl, | 471 | IFNULL(ROUND( SUM( v.WFCSL ), 2 ),0) AS wxfwcsl, |
444 | ROUND( SUM( v.WFCZL ), 2 ) AS wxfwczl | 472 | IFNULL(ROUND( SUM( v.WFCZL ), 2 ),0) AS wxfwczl, |
473 | '0' wsclsjnl, | ||
474 | '0' xnjhj, | ||
475 | '0' zhnyxfl, | ||
476 | '0' eyhtpfl, | ||
477 | '0' ybgfczl, | ||
478 | IFNULL(v2.jscodl-v2.cscodl,0) AS codxjl, | ||
479 | IFNULL(v2.jsadl-v2.csadl,0) AS adxjl, | ||
480 | IFNULL(v2.jstpl-v2.cstpl,0) AS tpxjl, | ||
481 | IFNULL(v2.jstnl-v2.cstnl,0) AS tnxjl | ||
445 | FROM | 482 | FROM |
446 | ${dataViewName3} v | 483 | ${dataViewName3} v |
447 | LEFT JOIN ( | 484 | LEFT JOIN ( |
... | @@ -449,6 +486,14 @@ | ... | @@ -449,6 +486,14 @@ |
449 | LEFT ( v.time, 7 ) AS time, | 486 | LEFT ( v.time, 7 ) AS time, |
450 | ROUND( SUM( v.CSL )/10000, 2 ) AS sjwscll, | 487 | ROUND( SUM( v.CSL )/10000, 2 ) AS sjwscll, |
451 | ROUND( AVG( v.CSL )/10000, 2 ) AS rwscll, | 488 | ROUND( AVG( v.CSL )/10000, 2 ) AS rwscll, |
489 | ROUND( SUM( IFNULL(v.JSCOD*v.JSL,0)/1000000 ), 2 ) AS jscodl, | ||
490 | ROUND( SUM( IFNULL(v.CSCOD*v.CSL,0)/1000000 ), 2 ) AS cscodl, | ||
491 | ROUND( SUM( IFNULL(v.CSTN*v.CSL,0)/1000000 ), 2 ) AS cstnl, | ||
492 | ROUND( SUM( IFNULL(v.JSZD*v.JSL,0)/1000000 ), 2 ) AS jstnl, | ||
493 | ROUND( SUM( IFNULL(v.JSZL*v.JSL,0)/1000000 ), 2 ) AS jstpl, | ||
494 | ROUND( SUM( IFNULL(v.CSZL*v.CSL,0)/1000000 ), 2 ) AS cstpl, | ||
495 | ROUND( SUM( IFNULL(v.JSAD*v.JSL,0)/1000000 ), 2 ) AS jsadl, | ||
496 | ROUND( SUM( IFNULL(v.CSAD*v.CSL,0)/1000000 ), 2 ) AS csadl, | ||
452 | count( v.id ) AS scsj | 497 | count( v.id ) AS scsj |
453 | FROM | 498 | FROM |
454 | ${dataViewName2} v | 499 | ${dataViewName2} v | ... | ... |
... | @@ -11,6 +11,8 @@ import com.skua.modules.custom.mapper.FCustomReportDatasetMapper; | ... | @@ -11,6 +11,8 @@ import com.skua.modules.custom.mapper.FCustomReportDatasetMapper; |
11 | import com.skua.modules.custom.service.IFCustomReportDatasetService; | 11 | import com.skua.modules.custom.service.IFCustomReportDatasetService; |
12 | import com.skua.modules.custom.vo.DepartWeekReportVO; | 12 | import com.skua.modules.custom.vo.DepartWeekReportVO; |
13 | import com.skua.modules.custom.vo.FCustomReportDatasetVO; | 13 | import com.skua.modules.custom.vo.FCustomReportDatasetVO; |
14 | |||
15 | import java.text.DecimalFormat; | ||
14 | import java.time.LocalDate; | 16 | import java.time.LocalDate; |
15 | import java.time.format.DateTimeFormatter; | 17 | import java.time.format.DateTimeFormatter; |
16 | import java.time.temporal.TemporalAdjusters; | 18 | import java.time.temporal.TemporalAdjusters; |
... | @@ -20,6 +22,7 @@ import com.skua.modules.report.vo.*; | ... | @@ -20,6 +22,7 @@ import com.skua.modules.report.vo.*; |
20 | import com.skua.modules.report.vo.largeScreen.*; | 22 | import com.skua.modules.report.vo.largeScreen.*; |
21 | import com.skua.tool.util.DateUtils; | 23 | import com.skua.tool.util.DateUtils; |
22 | import com.skua.tool.util.JSUtils; | 24 | import com.skua.tool.util.JSUtils; |
25 | import io.swagger.annotations.ApiModelProperty; | ||
23 | import org.apache.commons.lang.StringUtils; | 26 | import org.apache.commons.lang.StringUtils; |
24 | import org.springframework.beans.factory.annotation.Autowired; | 27 | import org.springframework.beans.factory.annotation.Autowired; |
25 | import org.springframework.jdbc.core.BeanPropertyRowMapper; | 28 | import org.springframework.jdbc.core.BeanPropertyRowMapper; |
... | @@ -235,16 +238,46 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa | ... | @@ -235,16 +238,46 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa |
235 | 238 | ||
236 | @Override | 239 | @Override |
237 | public Map<String, Object> jnhbReportDetails(String departId, String month) { | 240 | public Map<String, Object> jnhbReportDetails(String departId, String month) { |
241 | DecimalFormat df = new DecimalFormat("#.##"); | ||
238 | Map<String, Object> map = new HashMap<>(); | 242 | Map<String, Object> map = new HashMap<>(); |
239 | List<JnhbReportDetailsDy> dyList = new ArrayList<>(); | 243 | List<JnhbReportDetailsDy> dyList = new ArrayList<>(); |
240 | List<JnhbReportDetailsJs> jsList = new ArrayList<>(); | 244 | List<JnhbReportDetailsJs> jsList = new ArrayList<>(); |
241 | List<JnhbReportDetailsHj> hjList = new ArrayList<>(); | 245 | List<JnhbReportDetailsHj> hjList = new ArrayList<>(); |
242 | String year = month.substring(0,4); | 246 | String year = month.substring(0,4); |
243 | String dataViewName2 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL,JSZL,CSZL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN", departId, year); | 247 | String dataViewName2 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL,JSL,JSZL,CSZL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN", departId, year); |
244 | String dataViewName3 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"", departId, year); | 248 | String dataViewName3 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"", departId, year); |
245 | dyList = mapper.getDyList(dataViewName2, dataViewName3, departId, year); | 249 | dyList = mapper.getDyList(dataViewName2, dataViewName3, departId, year); |
246 | jsList = mapper.getJsList(dataViewName2, dataViewName3, departId, year); | 250 | jsList = mapper.getJsList(dataViewName2, dataViewName3, departId, year); |
247 | hjList = mapper.getHjList(dataViewName2, dataViewName3, departId, year); | 251 | hjList = mapper.getHjList(dataViewName2, dataViewName3, departId, year); |
252 | for (int i = 0; i < hjList.size(); i++) { | ||
253 | if(i > 0){ | ||
254 | JnhbReportDetailsHj jnhbHj1 = hjList.get(i); | ||
255 | JnhbReportDetailsHj jnhbHj0 = hjList.get(i-1); | ||
256 | jnhbHj1.setWsclsjnl(df.format(Double.parseDouble(jnhbHj0.getWsclsjnl())+Double.parseDouble(jnhbHj1.getWsclsjnl()))); | ||
257 | jnhbHj1.setScsj(df.format(Double.parseDouble(jnhbHj0.getScsj())+Double.parseDouble(jnhbHj1.getScsj()))); | ||
258 | jnhbHj1.setDl(df.format(Double.parseDouble(jnhbHj0.getDl())+Double.parseDouble(jnhbHj1.getDl()))); | ||
259 | jnhbHj1.setGffdl(df.format(Double.parseDouble(jnhbHj0.getGffdl())+Double.parseDouble(jnhbHj1.getGffdl()))); | ||
260 | jnhbHj1.setQy(df.format(Double.parseDouble(jnhbHj0.getQy())+Double.parseDouble(jnhbHj1.getQy()))); | ||
261 | jnhbHj1.setHxtsyl(df.format(Double.parseDouble(jnhbHj0.getHxtsyl())+Double.parseDouble(jnhbHj1.getHxtsyl()))); | ||
262 | jnhbHj1.setShsyl(df.format(Double.parseDouble(jnhbHj0.getShsyl())+Double.parseDouble(jnhbHj1.getShsyl()))); | ||
263 | jnhbHj1.setXnjpam(df.format(Double.parseDouble(jnhbHj0.getXnjpam())+Double.parseDouble(jnhbHj1.getXnjpam()))); | ||
264 | jnhbHj1.setXnjpac(df.format(Double.parseDouble(jnhbHj0.getXnjpac())+Double.parseDouble(jnhbHj1.getXnjpac()))); | ||
265 | jnhbHj1.setXnjqt(df.format(Double.parseDouble(jnhbHj0.getXnjqt())+Double.parseDouble(jnhbHj1.getXnjqt()))); | ||
266 | jnhbHj1.setXnjhj(df.format(Double.parseDouble(jnhbHj0.getXnjhj())+Double.parseDouble(jnhbHj1.getXnjhj()))); | ||
267 | jnhbHj1.setXssyl(df.format(Double.parseDouble(jnhbHj0.getXssyl())+Double.parseDouble(jnhbHj1.getXssyl()))); | ||
268 | jnhbHj1.setJgnl(df.format(Double.parseDouble(jnhbHj0.getJgnl())+Double.parseDouble(jnhbHj1.getJgnl()))); | ||
269 | jnhbHj1.setWxfwcsl(df.format(Double.parseDouble(jnhbHj0.getWxfwcsl())+Double.parseDouble(jnhbHj1.getWxfwcsl()))); | ||
270 | jnhbHj1.setWxfwczl(df.format(Double.parseDouble(jnhbHj0.getWxfwczl())+Double.parseDouble(jnhbHj1.getWxfwczl()))); | ||
271 | jnhbHj1.setZhnyxfl(df.format(Double.parseDouble(jnhbHj0.getZhnyxfl())+Double.parseDouble(jnhbHj1.getZhnyxfl()))); | ||
272 | jnhbHj1.setEyhtpfl(df.format(Double.parseDouble(jnhbHj0.getEyhtpfl())+Double.parseDouble(jnhbHj1.getEyhtpfl()))); | ||
273 | jnhbHj1.setYbgfcsl(df.format(Double.parseDouble(jnhbHj0.getYbgfcsl())+Double.parseDouble(jnhbHj1.getYbgfcsl()))); | ||
274 | jnhbHj1.setYbgfczl(df.format(Double.parseDouble(jnhbHj0.getYbgfczl())+Double.parseDouble(jnhbHj1.getYbgfczl()))); | ||
275 | jnhbHj1.setCodxjl(df.format(Double.parseDouble(jnhbHj0.getCodxjl())+Double.parseDouble(jnhbHj1.getCodxjl()))); | ||
276 | jnhbHj1.setAdxjl(df.format(Double.parseDouble(jnhbHj0.getAdxjl())+Double.parseDouble(jnhbHj1.getAdxjl()))); | ||
277 | jnhbHj1.setTpxjl(df.format(Double.parseDouble(jnhbHj0.getTpxjl())+Double.parseDouble(jnhbHj1.getTpxjl()))); | ||
278 | jnhbHj1.setTnxjl(df.format(Double.parseDouble(jnhbHj0.getTnxjl())+Double.parseDouble(jnhbHj1.getTnxjl()))); | ||
279 | } | ||
280 | } | ||
248 | map.put("zbtj",dyList); | 281 | map.put("zbtj",dyList); |
249 | map.put("zbfx",jsList); | 282 | map.put("zbfx",jsList); |
250 | map.put("zblj",hjList); | 283 | map.put("zblj",hjList); | ... | ... |
... | @@ -56,7 +56,7 @@ public class ShiroConfig { | ... | @@ -56,7 +56,7 @@ public class ShiroConfig { |
56 | filterChainDefinitionMap.put("/sys/user/register", "anon");//用户注册 | 56 | filterChainDefinitionMap.put("/sys/user/register", "anon");//用户注册 |
57 | filterChainDefinitionMap.put("/sys/user/querySysUser", "anon");//根据手机号获取用户信息 | 57 | filterChainDefinitionMap.put("/sys/user/querySysUser", "anon");//根据手机号获取用户信息 |
58 | filterChainDefinitionMap.put("/sys/user/phoneVerification", "anon");//用户忘记密码验证手机号 | 58 | filterChainDefinitionMap.put("/sys/user/phoneVerification", "anon");//用户忘记密码验证手机号 |
59 | filterChainDefinitionMap.put("/sys/user/passwordChange", "anon");//用户更改密码 | 59 | // filterChainDefinitionMap.put("/sys/user/passwordChange", "anon");//用户更改密码 |
60 | filterChainDefinitionMap.put("/auth/2step-code", "anon");//登录验证码 | 60 | filterChainDefinitionMap.put("/auth/2step-code", "anon");//登录验证码 |
61 | filterChainDefinitionMap.put("/sys/common/view/**", "anon");//图片预览不限制token | 61 | filterChainDefinitionMap.put("/sys/common/view/**", "anon");//图片预览不限制token |
62 | filterChainDefinitionMap.put("/sys/common/download/**", "anon");//文件下载不限制token | 62 | filterChainDefinitionMap.put("/sys/common/download/**", "anon");//文件下载不限制token |
... | @@ -87,6 +87,7 @@ public class ShiroConfig { | ... | @@ -87,6 +87,7 @@ public class ShiroConfig { |
87 | filterChainDefinitionMap.put("/swagger**/**", "anon"); | 87 | filterChainDefinitionMap.put("/swagger**/**", "anon"); |
88 | filterChainDefinitionMap.put("/webjars/**", "anon"); | 88 | filterChainDefinitionMap.put("/webjars/**", "anon"); |
89 | filterChainDefinitionMap.put("/v2/**", "anon"); | 89 | filterChainDefinitionMap.put("/v2/**", "anon"); |
90 | filterChainDefinitionMap.put("/sys/init/**", "anon"); | ||
90 | 91 | ||
91 | //暂时放开表维护的shiro权限 | 92 | //暂时放开表维护的shiro权限 |
92 | filterChainDefinitionMap.put("/v1/expert/expertInitConfig/**", "anon"); | 93 | filterChainDefinitionMap.put("/v1/expert/expertInitConfig/**", "anon"); | ... | ... |
... | @@ -38,7 +38,6 @@ import com.skua.core.util.ConvertUtils; | ... | @@ -38,7 +38,6 @@ import com.skua.core.util.ConvertUtils; |
38 | import com.skua.core.util.DateUtils; | 38 | import com.skua.core.util.DateUtils; |
39 | import com.skua.core.util.JwtUtil; | 39 | import com.skua.core.util.JwtUtil; |
40 | import com.skua.core.util.PasswordUtil; | 40 | import com.skua.core.util.PasswordUtil; |
41 | import com.skua.core.util.chuanglan.HttpSenderMsg; | ||
42 | import com.skua.core.util.encryption.AesEncryptUtil; | 41 | import com.skua.core.util.encryption.AesEncryptUtil; |
43 | import com.skua.core.util.encryption.EncryptedString; | 42 | import com.skua.core.util.encryption.EncryptedString; |
44 | import com.skua.modules.shiro.vo.DefContants; | 43 | import com.skua.modules.shiro.vo.DefContants; |
... | @@ -494,7 +493,6 @@ public class LoginController { | ... | @@ -494,7 +493,6 @@ public class LoginController { |
494 | return result; | 493 | return result; |
495 | } | 494 | } |
496 | aliCode.setType("register"); | 495 | aliCode.setType("register"); |
497 | // b = HttpSenderMsg.sendMsg("注册验证码为:" + captcha, mobile); | ||
498 | } else { | 496 | } else { |
499 | //登录模式,校验用户有效性 | 497 | //登录模式,校验用户有效性 |
500 | SysUser sysUser = sysUserService.getUserByPhone(mobile); | 498 | SysUser sysUser = sysUserService.getUserByPhone(mobile); |
... | @@ -509,11 +507,9 @@ public class LoginController { | ... | @@ -509,11 +507,9 @@ public class LoginController { |
509 | if (CommonConstant.SMS_TPL_TYPE_0.equals(smsmode)) { | 507 | if (CommonConstant.SMS_TPL_TYPE_0.equals(smsmode)) { |
510 | //登录模板 | 508 | //登录模板 |
511 | aliCode.setType("login"); | 509 | aliCode.setType("login"); |
512 | // b = HttpSenderMsg.sendMsg("登录验证码为:" + captcha, mobile); | ||
513 | } else if (CommonConstant.SMS_TPL_TYPE_2.equals(smsmode)) { | 510 | } else if (CommonConstant.SMS_TPL_TYPE_2.equals(smsmode)) { |
514 | aliCode.setType("update"); | ||
515 | //忘记密码模板 | 511 | //忘记密码模板 |
516 | // b = HttpSenderMsg.sendMsg("验证码为:" + captcha, mobile); | 512 | aliCode.setType("update"); |
517 | } | 513 | } |
518 | } | 514 | } |
519 | b = AliSmsUtil.sendCodeMsg(aliCode); | 515 | b = AliSmsUtil.sendCodeMsg(aliCode); | ... | ... |
1 | package com.skua.modules.system.controller; | ||
2 | |||
3 | import com.skua.core.api.vo.Result; | ||
4 | import com.skua.modules.system.service.ITestService; | ||
5 | import io.swagger.annotations.Api; | ||
6 | import io.swagger.annotations.ApiOperation; | ||
7 | import lombok.extern.slf4j.Slf4j; | ||
8 | import org.springframework.web.bind.annotation.*; | ||
9 | |||
10 | import javax.annotation.Resource; | ||
11 | |||
12 | @Api(tags = "初始化用户") | ||
13 | @Slf4j | ||
14 | @RestController | ||
15 | @RequestMapping("/sys/init") | ||
16 | public class TestController { | ||
17 | |||
18 | @Resource | ||
19 | private ITestService testService; | ||
20 | |||
21 | @GetMapping("/user") | ||
22 | @ApiOperation(value = "初始化用户") | ||
23 | public Result<?> batchInitUser(){ | ||
24 | Result<?> result = new Result<>(); | ||
25 | boolean ok = testService.batchInitUser(); | ||
26 | result.setSuccess(ok); | ||
27 | return result; | ||
28 | } | ||
29 | } |
1 | package com.skua.modules.system.service.impl; | ||
2 | |||
3 | import com.skua.core.context.SpringContextUtils; | ||
4 | import com.skua.core.util.ConvertUtils; | ||
5 | import com.skua.core.util.DateUtils; | ||
6 | import com.skua.core.util.PasswordUtil; | ||
7 | import com.skua.modules.system.service.ITestService; | ||
8 | import com.skua.tool.util.ChineseToPinyin; | ||
9 | import lombok.extern.slf4j.Slf4j; | ||
10 | import org.springframework.jdbc.core.JdbcTemplate; | ||
11 | import org.springframework.stereotype.Service; | ||
12 | |||
13 | import java.util.Arrays; | ||
14 | import java.util.List; | ||
15 | import java.util.Map; | ||
16 | import java.util.UUID; | ||
17 | |||
18 | @Service | ||
19 | @Slf4j | ||
20 | public class TestServiceImpl implements ITestService { | ||
21 | |||
22 | @Override | ||
23 | public boolean batchInitUser() { | ||
24 | JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtils.getBean("master"); | ||
25 | String sql = "select * from sys_user_init "; | ||
26 | List<Map<String,Object>> list = jdbcTemplate.queryForList(sql); | ||
27 | if(list.size() > 0){ | ||
28 | for (Map<String,Object> map : list) { | ||
29 | String departId = map.get("depart_id").toString(); | ||
30 | String realName = map.get("user_name").toString(); | ||
31 | String userName = ChineseToPinyin.toPinyin(realName); | ||
32 | String phone = map.get("user_phone").toString(); | ||
33 | String role = map.get("roles").toString(); | ||
34 | String roles = ""; | ||
35 | if(map.get("remark")!=null){ | ||
36 | roles = map.get("remark").toString(); | ||
37 | role = role +","+ roles; | ||
38 | } | ||
39 | role = "8cc3cf58677fc68e42e9e46ae2462a17," + role; | ||
40 | String userId = UUID.randomUUID().toString().replaceAll("-", ""); | ||
41 | |||
42 | String salt = ConvertUtils.randomGen(8); | ||
43 | String password = PasswordUtil.encrypt(userName, "zhongye123.", salt); | ||
44 | |||
45 | String insertUserSql = "INSERT INTO sys_user_bak " + | ||
46 | "(id, username, realname, password, salt, phone, status, " + | ||
47 | "del_flag, activiti_sync, create_by, create_time, is_system_user,user_type) " + | ||
48 | "VALUES " + | ||
49 | "('"+userId+"', '"+userName+"', '"+realName+"', '"+password+"', '"+salt+"', '"+phone+"', 1, " + | ||
50 | "1, 1, 'admin', '"+ DateUtils.getDate("yyyy-MM-dd HH:mm:ss")+"', '0', '2')"; | ||
51 | jdbcTemplate.execute(insertUserSql); | ||
52 | |||
53 | List<String> roleIdArray = Arrays.asList(role.split(",")); | ||
54 | for (String roleId : roleIdArray) { | ||
55 | String uuid = UUID.randomUUID().toString().replaceAll("-", ""); | ||
56 | String insertRoleSql = "INSERT INTO sys_user_role " + | ||
57 | "(id, user_id, role_id) " + | ||
58 | "VALUES " + | ||
59 | "('"+uuid+"', '"+userId+"', '"+roleId+"')"; | ||
60 | jdbcTemplate.execute(insertRoleSql); | ||
61 | } | ||
62 | |||
63 | String departUuid = UUID.randomUUID().toString().replaceAll("-", ""); | ||
64 | String insertDepartSql = "INSERT INTO sys_user_depart " + | ||
65 | "(id, user_id, dep_id, dep_ids) " + | ||
66 | "VALUES " + | ||
67 | "('"+departUuid+"', '"+userId+"', '"+departId+"', '"+departId+"')"; | ||
68 | jdbcTemplate.execute(insertDepartSql); | ||
69 | } | ||
70 | |||
71 | } | ||
72 | |||
73 | |||
74 | return false; | ||
75 | } | ||
76 | } |
-
请 注册 或 登录 后发表评论