xiongchao 3 年之前
父节点
当前提交
b4a6e0303b

+ 11 - 11
platform-common/src/main/java/com/platform/common/util/SendSms.java

@@ -41,11 +41,11 @@ public class SendSms {
     private static final String url = "https://rtcsms.cn-north-1.myhuaweicloud.com:10743/sms/batchSendSms/v1"; //APP接入地址+接口访问URI
     private static final String appKey = "4yw8cHqho8EAVi5R3GAcewA6NTwt"; //APP_Key
     private static final String appSecret = "98vxBHJWZWE5326n5da6LY5X8T8g"; //APP_Secret
-    private static final String sender = "99200620888880005063"; //国内短信签名通道号或国际/港澳台短信通道号
-    private static final String templateId = "e29c115bd9f64ffab2d297035c1b9ba4"; //模板ID
-    private static final String signature = "华为云短信测试"; //签名名称
+    private static final String sender = "8821091641123"; //国内短信签名通道号或国际/港澳台短信通道号
+    // private static final String templateId = "e29c115bd9f64ffab2d297035c1b9ba4"; //模板ID
+    private static final String signature = "乾元坤和"; //签名名称
 
-    private static final String templateId_repair = "dc556371ed4a48dda9a148a7dc050875"; //模板ID
+    private static final String templateId_repair = "cd8e5c02f42e470290dc6f4b4554bfb5"; //模板ID
 
     public static void main(String[] args) throws Exception {
         //必填,全局号码格式(包含国家码),示例:+8615123456789,多个号码之间用英文逗号分隔
@@ -58,21 +58,21 @@ public class SendSms {
          * 模板中的每个变量都必须赋值,且取值不能为空
          * 查看更多模板和变量规范:产品介绍>模板和变量规范
          */
-        String templateParas = "[\"369751\"]"; //模板变量,此处以单变量验证码短信为例,请客户自行生成6位验证码,并定义为字符串类型,以杜绝首位0丢失的问题(例如:002569变成了2569)。
-        sendCodeSms(receiver, templateParas);
+        //String templateParas = "[\"369751\"]"; //模板变量,此处以单变量验证码短信为例,请客户自行生成6位验证码,并定义为字符串类型,以杜绝首位0丢失的问题(例如:002569变成了2569)。
+        //sendCodeSms(receiver, templateParas);
 
         /**
          * 选填,使用无变量模板时请赋空值 String templateParas = "";
          * 单变量模板示例:模板内容为"您的验证码是${1}"时,templateParas可填写为"[\"369751\"]"
-         * 双变量模板示例:模板内容为"设备${1}发生报修,设备位置${2},报修人${3}"时,templateParas可填写为"[\"3\",\"人民公园正门\"]"
+         * 双变量模板示例:模板内容为"${1}报修,位置${2},报修人${3}"时,templateParas可填写为"[\"3\",\"人民公园正门\"]"
          * 模板中的每个变量都必须赋值,且取值不能为空
          * 查看更多模板和变量规范:产品介绍>模板和变量规范
          */
-        // String templateParas_repair = "[\"C-001\",\"1号车间\",\"熊超\"]";
-        // sendRepairSms(receiver, templateParas_repair);
+        String templateParas_repair = "[\"C-001\",\"1号车间\",\"熊超\"]";
+        sendRepairSms(receiver, templateParas_repair);
     }
 
-    public static void sendCodeSms(String receiver, String templateParas)  throws Exception {
+    /*public static void sendCodeSms(String receiver, String templateParas)  throws Exception {
         //选填,短信状态报告接收地址,推荐使用域名,为空或者不填表示不接收状态报告
         String statusCallBack = "";
 
@@ -153,7 +153,7 @@ public class SendSms {
                 e.printStackTrace();
             }
         }
-    }
+    }*/
 
     public static void sendRepairSms(String receiver, String templateParas)  throws Exception {
         //选填,短信状态报告接收地址,推荐使用域名,为空或者不填表示不接收状态报告

+ 14 - 4
platform-dao/src/main/java/com/platform/dao/util/CustomExcelImportUtil.java

@@ -18,7 +18,9 @@ import com.platform.office.poi.excel.ExcelImportUtil;
 import com.platform.office.poi.excel.entity.ImportParams;
 import com.platform.office.poi.excel.imports.CellValueServer;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.time.DateFormatUtils;
 import org.apache.poi.POIXMLDocument;
+import org.apache.poi.hssf.usermodel.HSSFDateUtil;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.openxml4j.opc.OPCPackage;
@@ -33,6 +35,7 @@ import org.slf4j.LoggerFactory;
 
 import java.io.*;
 import java.math.BigDecimal;
+import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
@@ -457,7 +460,7 @@ public class CustomExcelImportUtil {
     public static void main(String[] args) throws IOException, InvalidFormatException {
         //String path = "C:\\Users\\cyz\\Downloads\\老版维保计划\\noperson";
         //File dirFile = new File("C:\\Users\\cyz\\Downloads\\老版维保计划\\noperson");
-        String[] files = {"C:\\Users\\cyz\\\\Downloads\\2021.9.14 保养标准 保养时间 去除指定.xls"};
+        String[] files = {"C:\\Users\\cyz\\\\Downloads\\2021.9.14 保养标准 保养时间 去除指定 (1).xls"};
         for(String fileStr:files){
             System.out.println(fileStr);
             InputStream inputstream = new FileInputStream(fileStr);
@@ -555,8 +558,14 @@ public class CustomExcelImportUtil {
         // 判断数据的类型
         switch (cell.getCellType()) {
             case Cell.CELL_TYPE_NUMERIC: // 数字
-                cellValue = String.valueOf(cell.getNumericCellValue());
-                cellValue = cellValue.trim().replaceAll(",", "");
+                if (HSSFDateUtil.isCellDateFormatted(cell)) {
+                    Date date = cell.getDateCellValue();
+                    cellValue = DateFormatUtils.format(date, "yyyy-MM-dd");
+                } else {
+                    double value = cell.getNumericCellValue();
+                    DecimalFormat df = new DecimalFormat("0");
+                    cellValue = df.format(value);
+                }
                 break;
             case Cell.CELL_TYPE_STRING: // 字符串
                 cellValue = String.valueOf(cell.getStringCellValue());
@@ -1052,13 +1061,14 @@ public class CustomExcelImportUtil {
                 }
                 String lastDate = getCellValue(row.getCell(11));
                 String nextDate = getCellValue(row.getCell(12));
+
                 if(StringUtils.isNotBlank(lastDate)){
                     record.setLastDate(DateUtils.strToLocalDate(lastDate, DateUtils.PATTERN_YMD));
                 }
                 if(StringUtils.isNotBlank(nextDate)){
                     record.setNextDate(DateUtils.strToLocalDate(nextDate, DateUtils.PATTERN_YMD));
                 }
-                String checkUserType = row.getCell(11).getStringCellValue().trim();
+                String checkUserType = row.getCell(13).getStringCellValue().trim();
                 if(StringUtils.isBlank(checkUserType)){
                     if(record.getPeriodType()>1){
                         record.setCheckUserType(CheckUserTypeEnum.REPAIR_USER.getValue());

+ 0 - 3
platform-service/src/main/java/com/platform/service/check/impl/CheckJobServiceImpl.java

@@ -92,9 +92,6 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
         } else if (model.getSearchType() != null && 3 == model.getSearchType()) {
             model.setSearchStartTime(DateUtils.getFirstDayOfThisMonth());
             model.setSearchEndTime(DateUtils.getLastDayOfThisMonth());
-        } else{
-            model.setSearchStartTime(DateUtils.getTodayStartTime());
-            model.setSearchEndTime(DateUtils.getTodayEndTime());
         }
         PageHelper.startPage(pageNum, pageSize);
         return new MyPage(mapper.selectList(model));

+ 10 - 2
platform-service/src/main/java/com/platform/service/repair/impl/RepairApplicationFormServiceImpl.java

@@ -301,7 +301,15 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
         // 发送短信通知给第一维修人,省钱,其他人不发短信
         if(StringUtils.isNotBlank(receiver)){
             // String templateParas_repair = "[\"C-001\",\"1号车间\",\"熊超\"]";
-            String templateParas_repair = "[\"" + sb.getNo() + "\",\"" + model.getSbCph()  + "\",\""+ model.getActualUser()+ "\"]";
+            String sbCph = model.getSbCph();
+            String actualUser = model.getActualUser();
+            if(StringUtils.isBlank(sbCph)){
+                sbCph = "未知";
+            }
+            if(StringUtils.isBlank(actualUser)){
+                actualUser = "未知";
+            }
+            String templateParas_repair = "[\"" + sb.getNo() + "\",\"" + sbCph  + "\",\""+ actualUser + "\"]";
             try {
                 String numStr = RedisUtils.getString(RedisKeyConstants.HW_SMS);
                 boolean isSend = false;
@@ -315,7 +323,7 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
                 if(isSend){
                     System.out.println("templateParas_repair: " + templateParas_repair);
                     String template = "[\"369751\"]";
-                    SendSms.sendCodeSms(receiver, template);
+                    //SendSms.sendCodeSms(receiver, template);
                     // SendSms.sendRepairSms(receiver, templateParas);
                 }
             } catch (Exception e) {