Explorar el Código

解决企业云平台连接跳转楼宇经济平台的错误
添加短信发送日志
产业供地详情页面剩余时间bug

huZhiHao hace 5 años
padre
commit
a82933896b

+ 61 - 2
src/main/java/platform/common/util/AlibabaSMSUtil.java

@@ -11,6 +11,9 @@ import com.aliyuncs.exceptions.ClientException;
 import com.aliyuncs.profile.DefaultProfile;
 import com.aliyuncs.profile.IClientProfile;
 
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.HashMap;
@@ -34,6 +37,13 @@ public class AlibabaSMSUtil {
         this.profiles = param;
     }
 
+    private static String repositoryPath;
+
+    @Value("${repositoryPath}")
+    public void setRepositoryPath(String param) {
+        this.repositoryPath = param;
+    }
+
     //产品名称:云通信短信API产品,开发者无需替换
     static final String product = "Dysmsapi";
     //产品域名,开发者无需替换
@@ -44,7 +54,8 @@ public class AlibabaSMSUtil {
     private static final String accessKeySecret = "4s1Z46bQEXUCgwMXq6NEGTDfWbap47";
 
     public static void sendSMS(String phone, String templateCode, String signName, String templateParam) throws ClientException, InterruptedException {
-        if (!Constant.Environment.PROD_TEST.equals(profiles)) {
+        //test aliyun环境不发送短信
+        if (!Constant.Environment.PROD_TEST.equals(profiles) && !Constant.Environment.TEST.equals(profiles)) {
             SendSmsResponse response = sendSMSMessage(phone, templateCode, signName, templateParam);
             System.out.println("短信接口返回的数据----------------");
             System.out.println("Code=" + response.getCode());
@@ -78,6 +89,7 @@ public class AlibabaSMSUtil {
 
     public static SendSmsResponse sendSMSMessage(String phone, String templateCode, String signName, String templateParam) throws ClientException {
 
+        //test aliyun环境不发送短信
         //可自助调整超时时间
         System.setProperty("sun.net.client.defaultConnectTimeout", "10000");
         System.setProperty("sun.net.client.defaultReadTimeout", "10000");
@@ -107,8 +119,10 @@ public class AlibabaSMSUtil {
         //hint 此处可能会抛出异常,注意catch
         SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(sendRequest);
 
-        return sendSmsResponse;
+        //todo  输出发送记录到附件目录根目录下
+        smsLog(sendRequest,sendSmsResponse);
 
+        return sendSmsResponse;
     }
 
     public static QuerySendDetailsResponse querySendDetails(String bizId) throws ClientException {
@@ -182,4 +196,49 @@ public class AlibabaSMSUtil {
         }
 
     }
+
+    public static void smsLog(SendSmsRequest sendRequest,SendSmsResponse sendSmsResponse) {
+
+        String path = repositoryPath + File.separator + "smsLog" + File.separator + "log.txt";
+        String content = "  request>>>";
+        content += "  signName=" + sendRequest.getSignName();
+        content += "  phone=" + sendRequest.getPhoneNumbers();
+        content += "  templateCode=" + sendRequest.getTemplateCode();
+        content += "  templateParam=" + sendRequest.getTemplateParam();
+        content += "  response>>>";
+        content += "  code=" + sendSmsResponse.getCode();
+        content += "  message=" + sendSmsResponse.getMessage();
+        try {
+            writeErorToTxt(path, content);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void writeErorToTxt(String path, String content) throws IOException {
+
+//        path = "E:\\upload\\SmsLog\\log.txt";
+        File targetFile = new File(path);
+        //如果文件不存在,就动态创建文件
+        if (!targetFile.getParentFile().exists()) {
+            targetFile.getParentFile().mkdirs();
+        }
+        if (!targetFile.exists()) {
+            targetFile.createNewFile();
+        }
+        FileWriter fw = null;
+        String writeDate = "date=" + DateUtil.getCurrentDateString("yyyy-MM-dd hh:mm:ss") + content;
+        try {
+            //设置为:True,表示写入的时候追加数据
+            fw = new FileWriter(targetFile, true);
+            //回车并换行
+            fw.write(writeDate + "\r\n");
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            if (fw != null) {
+                fw.close();
+            }
+        }
+    }
 }

+ 11 - 8
src/main/java/platform/modules/government/service/IndustrialLandSupplyDetailService.java

@@ -482,7 +482,8 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
 
            /* if (Objects.equals(landSupplyConsultation.getConsultation(), CONSULTATION_MESSAGE)) {
                 landSupplyConsultation.setIsDefault(true);
-            } else */if (landSupplyConsultation.getIsDefault() == null) {
+            } else */
+            if (landSupplyConsultation.getIsDefault() == null) {
                 landSupplyConsultation.setIsDefault(false);
             }
             //文件
@@ -504,7 +505,7 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
 //            landSupplyConsultation.setRemain_time(DateUtil.getTimeDiffStr(landSupplyConsultation.getConsultation_time(), days));
             String dealTime = null;
             Approval approval = new Approval();
-            approval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_SUMMARY);
+            approval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.COMMERCE_PENDING_FEEDBACK);
             approval.setApply_id(Integer.parseInt(id));
             List<Approval> approvals = approvalService.findListByWhere(approval);
             if (!CollectionUtils.isEmpty(approvals)) {
@@ -519,7 +520,8 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
                     e.printStackTrace();
                 }
             }
-            landSupplyConsultation.setRemain_time(DateUtil.getTimeDiff(landSupplyConsultation.getCreate_time(), dealTime, days));
+//            landSupplyConsultation.setRemain_time(DateUtil.getTimeDiff(landSupplyConsultation.getCreate_time(), dealTime, days));
+            landSupplyConsultation.setRemain_time(DateUtil.getTimeDiff(landSupplyConsultation.getCreate_time(), landSupplyConsultation.getUpdate_time(), days));
         }
         entity.setConsultationList(industrialLandSupplyConsultationList);
         //分发列表
@@ -560,7 +562,7 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
 //            landSupplyDistribution.setRemain_time(DateUtil.getTimeDiffStr(landSupplyDistribution.getDistribute_time(), days));
             String dealTime = null;
             Approval approval = new Approval();
-            approval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_SUMMARY);
+            approval.setBefore_approvalstatus(Constant.LandSupplyApproveStatus.LAND_SUPPLY_PENDIND_FEEDBACK);
             approval.setApply_id(Integer.parseInt(id));
             List<Approval> approvals = approvalService.findListByWhere(approval);
             if (!CollectionUtils.isEmpty(approvals)) {
@@ -575,7 +577,8 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
                     e.printStackTrace();
                 }
             }
-            landSupplyDistribution.setRemain_time(DateUtil.getTimeDiff(landSupplyDistribution.getCreate_time(), dealTime, days));
+//            landSupplyDistribution.setRemain_time(DateUtil.getTimeDiff(landSupplyDistribution.getCreate_time(), dealTime, days));
+            landSupplyDistribution.setRemain_time(DateUtil.getTimeDiff(landSupplyDistribution.getCreate_time(), landSupplyDistribution.getUpdate_time(), days));
         }
         entity.setDistributionList(industrialLandSupplyDistributionList);
 
@@ -607,7 +610,7 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
                     e.printStackTrace();
                 }
             }
-            entity.setSummary_remain_time(DateUtil.getTimeDiff(industrialLandSupplyConsultation.getConsultation_time(), dealTime, days));
+            entity.setSummary_remain_time(DateUtil.getTimeDiff(approve.getCreate_time(), dealTime, days));
         }
 
         //会审剩余时间
@@ -636,7 +639,7 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
                     e.printStackTrace();
                 }
             }
-            entity.setSummary_remain_time(DateUtil.getTimeDiff(industrialLandSupplyConsultation.getConsultation_time(), dealTime, days));
+            entity.setSummary_remain_time(DateUtil.getTimeDiff(approve.getCreate_time(), dealTime, days));
         }
         List<DepartmentDto> consulDepartmentList = new ArrayList<>();
         List<Department> departmentList = consulDepartmentList();
@@ -3081,7 +3084,7 @@ public class IndustrialLandSupplyDetailService extends BaseService<IndustrialLan
                 query.setDel_flag(false);
                 List<IndustrialLandSupplyConsultation> oldList = industrialLandSupplyConsultationService.findListByWhere(query);
                 for (String departmentId : defaultList) {
-                    if(departmentId!=null){
+                    if (departmentId != null) {
                         boolean flag = true;
                         for (IndustrialLandSupplyConsultation industrialLandSupplyConsultation : oldList) {
                             if (industrialLandSupplyConsultation.getIsDefault() &&

+ 19 - 15
src/main/resources/templates/admin/common/header.html

@@ -32,14 +32,18 @@
                                                                                     shiro:hasPermission="G_INDUSTRIAL_CARRIER"
                                                                                     onclick="redirectToIndustrialCarrier()">工业载体</a>
                 </li>
-                <li class="dropDown dropDown_hover"><a href="#" class="dropDown_A">应用中心<i class="Hui-iconfont">&#xe6d5;</i></a>
+                <li class="dropDown dropDown_hover"><a href="#" class="dropDown_A">应用中心<i
+                        class="Hui-iconfont">&#xe6d5;</i></a>
                     <ul class="dropDown-menu menu radius box-shadow">
-                        <li><a href="https://xsg.tq.geostsapp.cn/xgkfq/infoCollect/#/index" data-title="工业资源" target="_blank">工业资源</a></li>
-                        <li><a href="http://escloud.snd.gov.cn/szgxqjj/" data-title="企业运行监测" target="_blank">企业运行监测</a></li>
+                        <li><a href="https://xsg.tq.geostsapp.cn/xgkfq/infoCollect/#/index" data-title="工业资源"
+                               target="_blank">工业资源</a></li>
+                        <li><a href="http://escloud.snd.gov.cn/szgxqjj/" data-title="企业运行监测" target="_blank">企业运行监测</a>
+                        </li>
                         <li><a onclick="checkLogin1('azw')" data-title="安专委平台">安专委平台</a></li>
                         <li><a onclick="checkLogin1('dljk')" data-title="电炉监控系统">电炉监控系统</a></li>
                         <li><a onclick="checkLogin1('lyjj')" data-title="楼宇经济管理平台">楼宇经济管理平台</a></li>
-                        <li><a href="http://escloud.snd.gov.cn/home/serverDetail/78" data-title="境外投资项目备案系统" target="_blank">境外投资项目备案系统</a></li>
+                        <li><a href="http://escloud.snd.gov.cn/home/serverDetail/78" data-title="境外投资项目备案系统"
+                               target="_blank">境外投资项目备案系统</a></li>
                     </ul>
                 </li>
                 <li class=" navbar-levelone " data-module="G_EPIDEMIC_SERVICE"><a href="#"
@@ -279,25 +283,25 @@
                 url: pagePath + "/home/checkLogin/",
                 type: "get",
                 dataType: "json",
-                data:{
+                data: {
                     timeStamp: new Date()
                 },
                 success: function (result) {
                     if (result.success) {
                         var obj = result.obj;
                         if (obj.isLogin) {
-                            if(e == 'azw') {
-                                window.open("http://202.102.20.60:8008/xq/#/login?username="+obj.userName)
-                            } else if(e='dljk') {
-                                window.open("http://202.102.20.60:8008/ly/#/login?username="+obj.userName)
-                            } else if(e='lyjj') {
-                                window.open("http://112.4.85.47:8000/lyzf/#/login?username="+obj.userName)
+                            if (e == 'azw') {
+                                window.open("http://202.102.20.60:8008/xq/#/login?username=" + obj.userName)
+                            } else if (e == 'dljk') {
+                                window.open("http://202.102.20.60:8008/ly/#/login?username=" + obj.userName)
+                            } else if (e == 'lyjj') {
+                                window.open("http://112.4.85.47:8000/lyzf/#/login?username=" + obj.userName)
                             } else if (e == 'jwtz') {
                                 if (obj.userType == 3) {
                                     window.open('http://112.4.85.50:9300/irsweb/?id=' + loginUserId)
                                 }
-                            } else if(e == 'gycf') {
-                                window.open(pagePath.substring(0,pagePath.lastIndexOf("/")) + '/industry/home/#/home');
+                            } else if (e == 'gycf') {
+                                window.open(pagePath.substring(0, pagePath.lastIndexOf("/")) + '/industry/home/#/home');
                                 $.ajax({
                                     url: pagePath + "/token/create",
                                     type: "get",
@@ -315,11 +319,11 @@
                             }
                         } else {
                             location.href = pagePath + "/home/login";
-                            if(e == 'azw') {
+                            if (e == 'azw') {
                                 localStorage.setItem("safetySupervision", "1");
                                 localStorage.setItem("errorMsg", "用户不存在!");
                             }
-                            if(e == 'gycf') {
+                            if (e == 'gycf') {
                                 localStorage.setItem("industrialCarrier", "1");
                             }
                         }

+ 35 - 23
src/main/resources/templates/home/common/common.html

@@ -4,14 +4,16 @@
 <head>
     <title layout:title-pattern="$LAYOUT_TITLE - $CONTENT_TITLE"></title>
     <meta name="renderer" content="webkit">
-    <meta name="keywords" content="中小企业服务中心,苏州中小企业服务中心,苏州高新区中小企业服务中心,企业服务中心,苏州高新区,企业服务平台,企业服务云,企业发展服务,ESCP,ESCloud,存量工业用地,工业用地,存量用地,活动,政策解读,项目申报,工业小区,智慧政务,智慧工业产业园,互联网+政务">
-    <meta name="description" content="苏州高新区企业服务云平台,旨在落实高新区发改局对区内企业的服务政策,及时了解苏州高新区内企业的运行情况数据和发展趋势,加强指标监测,以助力高新区内企业的发展和提升,进而总体把握苏州高新区整体工业及经济形势。同时高新区发改局可以通过平台不断了解企业的真实诉求,运用平台的企业需求反馈咨询跟踪办理机制,针对各企业发展过程中急需解决的问题,利用平台的云计算大数据技术分析技术,为企业提供有效的解决方案支持。并且以苏州高新区内各工业产业园为抓手,通过平台构建苏州高新区智慧工业产业园,提高各工业产业园信息化、智慧化水平,优化工业产业园内企业结构,以全面提升园内企业整体经济效益和经营实力。借助平台动态分析区内行业产业结构、产业生态环境,指导区内经济布局,大力促进及加快企业发展,以信息化手段推动政府职能“互联网+”模式的转变,为苏州高新区企业转型升级提供坚实的科技支撑。最终以平台为技术基础,进行企业运行监控,存量工业用地管理,整合区内资源,聚集企业服务功能,推进产学研结合发展创新方式,打造苏州高新区特色智慧政务模式。">
+    <meta name="keywords"
+          content="中小企业服务中心,苏州中小企业服务中心,苏州高新区中小企业服务中心,企业服务中心,苏州高新区,企业服务平台,企业服务云,企业发展服务,ESCP,ESCloud,存量工业用地,工业用地,存量用地,活动,政策解读,项目申报,工业小区,智慧政务,智慧工业产业园,互联网+政务">
+    <meta name="description"
+          content="苏州高新区企业服务云平台,旨在落实高新区发改局对区内企业的服务政策,及时了解苏州高新区内企业的运行情况数据和发展趋势,加强指标监测,以助力高新区内企业的发展和提升,进而总体把握苏州高新区整体工业及经济形势。同时高新区发改局可以通过平台不断了解企业的真实诉求,运用平台的企业需求反馈咨询跟踪办理机制,针对各企业发展过程中急需解决的问题,利用平台的云计算大数据技术分析技术,为企业提供有效的解决方案支持。并且以苏州高新区内各工业产业园为抓手,通过平台构建苏州高新区智慧工业产业园,提高各工业产业园信息化、智慧化水平,优化工业产业园内企业结构,以全面提升园内企业整体经济效益和经营实力。借助平台动态分析区内行业产业结构、产业生态环境,指导区内经济布局,大力促进及加快企业发展,以信息化手段推动政府职能“互联网+”模式的转变,为苏州高新区企业转型升级提供坚实的科技支撑。最终以平台为技术基础,进行企业运行监控,存量工业用地管理,整合区内资源,聚集企业服务功能,推进产学研结合发展创新方式,打造苏州高新区特色智慧政务模式。">
     <meta charset="utf-8"/>
     <meta name="_ctx" th:content="@{/}"/>
     <meta name="viewport" content="width=device-width, initial-scale=1">
-    <link rel="icon" th:href="@{/assets/favicon.ico}" type="image/x-icon" />
-    <link rel="shortcut icon" th:href="@{/assets/favicon.ico}" type="image/x-icon" />
-    <link rel="bookmark" th:href="@{/assets/favicon.ico}" type="image/x-icon" />
+    <link rel="icon" th:href="@{/assets/favicon.ico}" type="image/x-icon"/>
+    <link rel="shortcut icon" th:href="@{/assets/favicon.ico}" type="image/x-icon"/>
+    <link rel="bookmark" th:href="@{/assets/favicon.ico}" type="image/x-icon"/>
     <link rel="stylesheet" type="text/css" th:href="@{/home/plugin/bootstrap/css/bootstrap.min.css}">
 
     <link rel="stylesheet" type="text/css" th:href="@{/home/css/index.css}">
@@ -76,7 +78,7 @@
 
         function logOut() {
             localStorage.clear()
-            window.location.href = 'http://' + window.location.host +  '/admin/logout'
+            window.location.href = 'http://' + window.location.host + '/admin/logout'
         }
 
         function showDT() {
@@ -118,34 +120,36 @@
             //     }
             // });
         }
+
         function toIndustrial() {
-            window.open(pagePath.substring(0,pagePath.lastIndexOf("/")) + '/industry/home/#/industrialReserve');
+            window.open(pagePath.substring(0, pagePath.lastIndexOf("/")) + '/industry/home/#/industrialReserve');
         }
+
         function checkLogin1(e) {
             $.ajax({
                 url: pagePath + "/home/checkLogin/",
                 type: "get",
                 dataType: "json",
-                data:{
+                data: {
                     timeStamp: new Date()
                 },
                 success: function (result) {
                     if (result.success) {
                         var obj = result.obj;
                         if (obj.isLogin) {
-                            if(e == 'azw') {
-                                window.open("http://202.102.20.60:8008/xq/#/login?username="+obj.userName)
-                            } else if(e='dljk') {
-                                window.open("http://202.102.20.60:8008/ly/#/login?username="+obj.userName)
-                            } else if(e='lyjj') {
-                                window.open("http://112.4.85.47:8000/lyzf/#/login?username="+obj.userName)
+                            if (e == 'azw') {
+                                window.open("http://202.102.20.60:8008/xq/#/login?username=" + obj.userName)
+                            } else if (e == 'dljk') {
+                                window.open("http://202.102.20.60:8008/ly/#/login?username=" + obj.userName)
+                            } else if (e == 'lyjj') {
+                                window.open("http://112.4.85.47:8000/lyzf/#/login?username=" + obj.userName)
                             } else if (e == 'jwtz') {
                                 if (obj.userType == 3) {
                                     window.open('http://112.4.85.50:9300/irsweb/?id=' + loginUserId)
                                 }
-                            } else if(e == 'gycf') {
+                            } else if (e == 'gycf') {
                                 // window.location.href = pagePath.substring(0,pagePath.lastIndexOf("/")) + '/industry/home';
-                                window.open(pagePath.substring(0,pagePath.lastIndexOf("/")) + '/industry/home/#/home');
+                                window.open(pagePath.substring(0, pagePath.lastIndexOf("/")) + '/industry/home/#/home');
                                 $.ajax({
                                     url: pagePath + "/token/create",
                                     type: "get",
@@ -167,11 +171,11 @@
                             // localStorage.setItem("activityUrl", 'http://202.102.20.60:8008/xq/#/login');
                             // localStorage.setItem("returnUrl", 'http://202.102.20.60:8008/xq/#/login');
                             // localStorage.setItem("requiredUserType", "0");
-                            if(e == 'azw') {
+                            if (e == 'azw') {
                                 localStorage.setItem("safetySupervision", "1");
                                 localStorage.setItem("errorMsg", "用户不存在!");
                             }
-                            if(e == 'gycf') {
+                            if (e == 'gycf') {
                                 localStorage.setItem("industrialCarrier", "1");
                             }
                         }
@@ -184,7 +188,8 @@
                 }
             });
         }
-        function checkTel (tel) {
+
+        function checkTel(tel) {
             var telObj = {}
             if (/^1(3|4|5|7|8)\d{9}$/.test(tel)) {
                 telObj.type = '移动电话'
@@ -201,16 +206,18 @@
             }
             return telObj
         }
-        function checkEmail (email) {
+
+        function checkEmail(email) {
             return (/^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-.])+[A-Za-z\d]{2,5}$/.test(email))
         }
+
         function changeContact() {
             var contractValue = $(".feedback_right input[dataValue='contact']").val()
             if (contractValue == '') {
                 $(".feedback_right input[dataValue='contact']").addClass("is_error")
                 $(".feedback_error[dataValue='contact']").text('请输入联系人')
                 return false
-            } else if (contractValue.length >10 || contractValue.length < 2) {
+            } else if (contractValue.length > 10 || contractValue.length < 2) {
                 $(".feedback_right input[dataValue='contact']").addClass("is_error")
                 $(".feedback_error[dataValue='contact']").text('长度在2-10个字符')
                 return false
@@ -220,6 +227,7 @@
                 return true
             }
         }
+
         function changeTel() {
             var teltValue = $(".feedback_right input[dataValue='tel']").val()
             if (teltValue == '') {
@@ -239,6 +247,7 @@
                 }
             }
         }
+
         function changeEmail() {
             var emailValue = $(".feedback_right input[dataValue='email']").val()
             if (emailValue == '') {
@@ -258,6 +267,7 @@
                 }
             }
         }
+
         function changeContent() {
             var contentValue = $(".feedback_right textarea[dataValue='content']").val()
             if (contentValue == '') {
@@ -274,9 +284,11 @@
                 return true
             }
         }
+
         function feedbackCancel() {
             $(".tips-popup").hide();
         }
+
         function feedbackSubmit() {
             changeContact()
             changeTel()
@@ -285,10 +297,10 @@
             var submitResult = changeContact() && changeTel() && changeEmail() && changeContent()
             if (submitResult) {
                 $.ajax({
-                    url: 'http://' +  window.location.host+ '/api/serviceleague/f/v1/feedback',
+                    url: 'http://' + window.location.host + '/api/serviceleague/f/v1/feedback',
                     type: "post",
                     dataType: "json",
-                    data:{
+                    data: {
                         "applyContent": $(".feedback_right textarea[dataValue='content']").val(),
                         "applyEmail": $(".feedback_right input[dataValue='email']").val(),
                         "applyName": $(".feedback_right input[dataValue='contact']").val(),