Forráskód Böngészése

项目迭代,加入了订阅消息中对项目名称字段长度的限制,修复了导出表格接口是否授权那一行的显示问题

Astrid Wang 2 éve
szülő
commit
3dd3086443

+ 20 - 4
src/main/java/com/chuanghai/h3c_reporting/controller/WxController.java

@@ -88,12 +88,14 @@ public class WxController {
 
             HttpEntity<Map<String, String>> requestM = new HttpEntity<>(paramCardNumber, headers);
 
+            System.out.println("获取电话号码的access_token为:" + access_token);
+
             String userInfoUrl = "https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=" + access_token;
             ResponseEntity<String> responsem = restTemplate.postForEntity(userInfoUrl, requestM, String.class);
 
             JSONObject resPhoneInfo = JSON.parseObject(responsem.getBody());
 
-            System.out.println(resPhoneInfo);
+            System.out.println("调用获取电话号码接口的返回值:" + resPhoneInfo);
 
             JSONObject phoneInfo = resPhoneInfo.getJSONObject("phone_info");
             String phoneNumber = phoneInfo.get("phoneNumber").toString();
@@ -106,7 +108,8 @@ public class WxController {
     }
 
     // 获取access_token
-    @Scheduled(cron = "0 59 0/1 * * ?")   // 每1小时59分,执行一次刷新access_token
+//    @Scheduled(cron = "0 59 0/1 * * ?")   // 每1小时59分,执行一次刷新access_token
+    @Scheduled(cron = "0 0/30 * * * ?")
     public void getAccessToken() {
 //        Map<String, String> token = new HashMap<>();
 //        token.put("appid", appID);
@@ -124,7 +127,7 @@ public class WxController {
         ResponseEntity<String> responseEntity = restTemplate.getForEntity(url, String.class);
         JSONObject objParam = JSON.parseObject(responseEntity.getBody());
 
-        System.out.println(objParam);
+        System.out.println("刷新access_token的返回值:" + objParam);
 
         for (Map.Entry<String, Object> entry : objParam.entrySet()) {
             Object o = entry.getValue();
@@ -237,7 +240,20 @@ public class WxController {
 
         // 申请项目
         JSONObject thing6 = new JSONObject();
-        thing6.put("value", itemName);
+        if(itemName.length()>20){
+            // 截取前17位
+            int numChars = 17;
+            String cutitemName = itemName.substring(0,numChars);
+            // 前17位 + ... 共20字符,符合微信thing字段的要求
+            String enditemName = cutitemName + "...";
+
+            System.out.println("项目名称大于20字符,已切割,现为【" + enditemName + "】");
+
+            thing6.put("value", enditemName);
+
+        }else {
+            thing6.put("value", itemName);
+        }
 
         // 审核结果
         data.put("thing1", thing1);

+ 1 - 0
src/main/java/com/chuanghai/h3c_reporting/conver/StatusConverter.java

@@ -27,6 +27,7 @@ public class StatusConverter implements Converter<Integer> {
 
     @Override
     public Integer convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
+        //下面这句似乎有问题
         return cellData.getStringValue().equals("已提交") ? 2 : 0;
     }
 

+ 3 - 1
src/main/java/com/chuanghai/h3c_reporting/entity/InformationReporting.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.chuanghai.h3c_reporting.conver.LocalDateTimeConverter;
 import com.chuanghai.h3c_reporting.conver.StatusConverter;
+import com.chuanghai.h3c_reporting.conver.LicensingConverter;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.AllArgsConstructor;
 import lombok.Data;
@@ -102,8 +103,9 @@ public class InformationReporting implements Serializable {
     /**
      * 是否授权-----新需求
      */
-    @ExcelProperty(value = "是否授权", index = 8)
+    @ExcelProperty(value = "是否授权", converter = LicensingConverter.class, index = 8)
     @ColumnWidth(15)
+//    @Pattern(regexp = "[0-1]", message = "是否授权状态只能为0或1")
     private String licensing;
 
     /**

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 100 - 100
src/main/resources/static/doc/index.html


BIN
target/classes/com/chuanghai/h3c_reporting/controller/WxController.class


BIN
target/classes/com/chuanghai/h3c_reporting/conver/StatusConverter.class


BIN
target/classes/com/chuanghai/h3c_reporting/entity/InformationReporting.class


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 100 - 100
target/classes/static/doc/index.html


BIN
target/h3c_reporting-0.0.1-SNAPSHOT.jar.original


BIN
target/h3c_reporting-2.8.jar


+ 1 - 0
target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -14,6 +14,7 @@ com\chuanghai\h3c_reporting\bo\DeleteIds.class
 com\chuanghai\h3c_reporting\controller\WxController.class
 com\chuanghai\h3c_reporting\controller\request\UserQueryRequest.class
 com\chuanghai\h3c_reporting\controller\request\AdminPasswordUpdateRequest.class
+com\chuanghai\h3c_reporting\conver\LicensingConverter.class
 com\chuanghai\h3c_reporting\common\exception\RRException.class
 com\chuanghai\h3c_reporting\anno\ParamCheck.class
 com\chuanghai\h3c_reporting\common\exception\MyExceptionHandler.class

+ 1 - 0
target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@@ -12,6 +12,7 @@ C:\Users\yang'sheng\Desktop\华三\huasan-houtai\src\main\java\com\chuanghai\h3c
 C:\Users\yang'sheng\Desktop\华三\huasan-houtai\src\main\java\com\chuanghai\h3c_reporting\aop\LoginCheckAspect.java
 C:\Users\yang'sheng\Desktop\华三\huasan-houtai\src\main\java\com\chuanghai\h3c_reporting\vo\UserVO.java
 C:\Users\yang'sheng\Desktop\华三\huasan-houtai\src\main\java\com\chuanghai\h3c_reporting\common\exception\BizCodeEnume.java
+C:\Users\yang'sheng\Desktop\华三\huasan-houtai\src\main\java\com\chuanghai\h3c_reporting\conver\LicensingConverter.java
 C:\Users\yang'sheng\Desktop\华三\huasan-houtai\src\main\java\com\chuanghai\h3c_reporting\entity\InformationReporting.java
 C:\Users\yang'sheng\Desktop\华三\huasan-houtai\src\main\java\com\chuanghai\h3c_reporting\dto\InformationReportingDTO.java
 C:\Users\yang'sheng\Desktop\华三\huasan-houtai\src\main\java\com\chuanghai\h3c_reporting\bo\ValidReporting.java

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 4 - 4
target/surefire-reports/TEST-com.chuanghai.h3c_reporting.H3cReportingApplicationTests.xml


+ 1 - 1
target/surefire-reports/com.chuanghai.h3c_reporting.H3cReportingApplicationTests.txt

@@ -1,4 +1,4 @@
 -------------------------------------------------------------------------------
 Test set: com.chuanghai.h3c_reporting.H3cReportingApplicationTests
 -------------------------------------------------------------------------------
-Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.874 s - in com.chuanghai.h3c_reporting.H3cReportingApplicationTests
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.968 s - in com.chuanghai.h3c_reporting.H3cReportingApplicationTests