ws 3 anos atrás
pai
commit
e2ccad234a

+ 16 - 15
nngkxxdp/src/main/java/com/example/nngkxxdp/service/impl/TjServiceImpl.java

@@ -302,22 +302,23 @@ public class TjServiceImpl implements TjService {
 			reDate = String.valueOf((Integer.valueOf(m) - 1)/3);
 			break;
 		case 2:
-			int month = cn.hutool.core.date.DateUtil.month(now);
-			if (Blank.isNotEmpty(childrenType)) {
-				if (childrenType == 0) {
-					month = 0;
-				} else if (childrenType == 1) {
-					month = 10;
-				}
-			}
-			if (month > 5) {
+			int month = cn.hutool.core.date.DateUtil.month(cn.hutool.core.date.DateUtil.offsetMonth(now, -5));
+//			if (Blank.isNotEmpty(childrenType)) {
+//				if (childrenType == 0) {
+//					month = 0;
+//				} else if (childrenType == 1) {
+//					month = 10;
+//				}
+//			}
+			System.out.println(month);
+			if (month < 6) {
 				reDate = "0";
-				startTime = cn.hutool.core.date.DateUtil.format(now, "yyyy") + "-01-01 00:00:00";
-				endTime = cn.hutool.core.date.DateUtil.format(now, "yyyy") + "-06-30 23:59:59";
+				startTime = cn.hutool.core.date.DateUtil.format(cn.hutool.core.date.DateUtil.offsetMonth(now, -5), "yyyy") + "-01-01 00:00:00";
+				endTime = cn.hutool.core.date.DateUtil.format(cn.hutool.core.date.DateUtil.offsetMonth(now, -5), "yyyy") + "-06-30 23:59:59";
 				
 			} else {
 				reDate = "1";
-				int year = Integer.valueOf(cn.hutool.core.date.DateUtil.format(now, "yyyy")) - 1;
+				int year = Integer.valueOf(cn.hutool.core.date.DateUtil.format(cn.hutool.core.date.DateUtil.offsetMonth(now, -5), "yyyy"));
 				startTime = year + "-07-01 00:00:00";
 				endTime = year + "-12-31 23:59:59";
 			}
@@ -367,7 +368,7 @@ public class TjServiceImpl implements TjService {
 			
 			BigDecimal sbd = new BigDecimal(score + bScore);
 			BigDecimal nbd = new BigDecimal(num + bNum);
-			double dScore = sbd.divide(nbd).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+			double dScore = sbd.divide(nbd, 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
 			Map<String, Object> bMap = new HashMap<>();
 			bMap.put("deptname", basic.get("deptname"));
 			bMap.put("score", dScore);
@@ -384,7 +385,7 @@ public class TjServiceImpl implements TjService {
 			
 			BigDecimal sbd = new BigDecimal(bScore);
 			BigDecimal nbd = new BigDecimal(bNum);
-			double dScore = sbd.divide(nbd).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+			double dScore = sbd.divide(nbd, 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
 			Map<String, Object> bMap = new HashMap<>();
 			bMap.put("deptname", val.get("deptname"));
 			bMap.put("score", dScore);
@@ -407,7 +408,7 @@ public class TjServiceImpl implements TjService {
 			
 			BigDecimal sbd = new BigDecimal(score);
 			BigDecimal nbd = new BigDecimal(bNum);
-			double dScore = sbd.divide(nbd).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
+			double dScore = sbd.divide(nbd, 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
 			deptMap.put("add", dScore);
 			change.put(String.valueOf(basic.get("deptid")), deptMap);
 		}

+ 18 - 23
nngkxxdp/src/main/java/com/example/nngkxxdp/util/WebsiteSmsUtil.java

@@ -2,6 +2,7 @@ package com.example.nngkxxdp.util;
 
 import java.util.Date;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import org.springframework.beans.factory.annotation.Autowired;
@@ -10,10 +11,9 @@ import org.springframework.context.annotation.Configuration;
 import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.scheduling.annotation.Scheduled;
 
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
 import com.example.nngkxxdp.service.TjService;
 
+import cn.hutool.core.convert.Convert;
 import cn.hutool.crypto.SecureUtil;
 import cn.hutool.http.HttpRequest;
 import cn.hutool.log.StaticLog;
@@ -54,34 +54,34 @@ public class WebsiteSmsUtil {
 		if (Blank.isEmpty(map)) {
 			return;
 		}
-		JSONObject upObj ;
-		JSONArray up = JSONArray.parseArray(String.valueOf(map.get("up")));
-		if (!up.isEmpty()) {
+		Map<String, Object> upObj ;
+		List<?> up = Convert.toList(map.get("up"));
+		if (Blank.notBlank(up)) {
 			String upMsg = UP_SMS;
 			Date date = new Date();
 			date = cn.hutool.core.date.DateUtil.offsetMonth(date, -1);
 			for (int i = 0; i < up.size(); i++) {
-				upObj = up.getJSONObject(i);
+				upObj = Convert.toMap(String.class, Object.class, up.get(i));
 				
-				String content = upMsg.replace("${name}", upObj.getString("name")).replace("${year}", String.valueOf(cn.hutool.core.date.DateUtil.year(date)))
-						.replace("${month}", String.valueOf(cn.hutool.core.date.DateUtil.month(date) + 1)).replace("${branch}", upObj.getString("score"))
-						.replace("${ranking}", upObj.getString("ranking")).replace("${ringRatio}", upObj.getString("ringRatio"))
-						.replace("${url}", upObj.getString("url"));
-				String phone = upObj.getString("phone");
+				String content = upMsg.replace("${name}", String.valueOf(upObj.get("name"))).replace("${year}", String.valueOf(cn.hutool.core.date.DateUtil.year(date)))
+						.replace("${month}", String.valueOf(cn.hutool.core.date.DateUtil.month(date) + 1)).replace("${branch}", String.valueOf(upObj.get("score")))
+						.replace("${ranking}", String.valueOf(upObj.get("ranking"))).replace("${ringRatio}", String.valueOf(upObj.get("ringRatio")))
+						.replace("${url}", String.valueOf(upObj.get("url")));
+				String phone = String.valueOf(upObj.get("phone"));
 				
 				sendSms(phone, content);
 			}
 		}
-		JSONArray down = JSONArray.parseArray(String.valueOf(map.get("down")));
-		if (!down.isEmpty()) {
+		List<?> down = Convert.toList(map.get("down"));
+		if (Blank.notBlank(down)) {
 			String downMsg = DOWN_SMS;
 			for (int i = 0; i < down.size(); i++) {
-				upObj = down.getJSONObject(i);
+				upObj = Convert.toMap(String.class, Object.class, down.get(i));
 				
-				String content = downMsg.replace("${name}", upObj.getString("name")).replace("${ranking}", upObj.getString("ranking"))
-						.replace("${branch}", upObj.getString("score")).replace("${ringRatio}", upObj.getString("ringRatio"))
-						.replace("${url}", upObj.getString("url"));
-				String phone = upObj.getString("phone");
+				String content = downMsg.replace("${name}", String.valueOf(upObj.get("name"))).replace("${ranking}", String.valueOf(upObj.get("ranking")))
+						.replace("${branch}", String.valueOf(upObj.get("score"))).replace("${ringRatio}", String.valueOf(upObj.get("ringRatio")))
+						.replace("${url}", String.valueOf(upObj.get("url")));
+				String phone = String.valueOf(upObj.get("phone"));
 				
 				sendSms(phone, content);
 			}
@@ -101,10 +101,5 @@ public class WebsiteSmsUtil {
 		System.err.println("body==========:"+result);
 	}
 	
-	public static void main(String[] args) {
-		Date date = new Date();
-		date = cn.hutool.core.date.DateUtil.offsetMonth(date, -1);
-		System.err.println(cn.hutool.core.date.DateUtil.year(date));
-	}
 
 }

+ 2 - 2
nngkxxdp/src/main/resources/static/page/js/base/guideSituation.item.js

@@ -17,7 +17,7 @@ function guide() {
                         title: '所属单位',
                     }, {
                     field: 'title',
-                    title: '项名称',
+                    title: '项名称',
 
                 }, {
                     field: 'problemurl',
@@ -68,7 +68,7 @@ function guide() {
                         title: '所属单位',
                     }, {
                     field: 'title',
-                    title: '项名称',
+                    title: '项名称',
 
                 }, {
                     field: 'problemurl',

+ 1 - 1
nngkxxdp/src/main/resources/static/page/js/base/happy_city.js

@@ -81,7 +81,7 @@ function guideState() {
 						title: '所属单位',
 					}, {
 					field: 'title',
-					title: '项名称',
+					title: '项名称',
 
 				}, {
 					field: 'problemurl',

+ 1 - 1
nngkxxdp/src/main/resources/static/page/js/base/wzkp.item.js

@@ -107,7 +107,7 @@ function initBarChartData(data, deptId, hasDept, type, dBasic) {
 	let rankSituation=[]  //用来存储部门排名情况
 	var total = [];
 	for (var i = 0; i < basic.length; i++) {
-		total.push(basic[i]+add[i]);
+		total.push((basic[i] * 100 + add[i] * 100)/100);
 	}
 	var totalRanking = {};
 	var deptNames = [];