瀏覽代碼

存量用地修改 简易流程修改 及测试代码修改

wangjiang988 6 年之前
父節點
當前提交
c8f54170c7

+ 1 - 1
src/main/java/platform/common/Constant.java

@@ -346,7 +346,7 @@ public final class Constant {
     public static final class LandApproveStatus {
         //存量用地审核状态1:属地初审,2 : 待分发,3:合规性审查,4:联合评议,5:二次联合评议,6:区政府审核,7:退回,8:通过(手续办理),9:不通过,10:简易流程通过11:合规性审查汇总 12:通过(手续办理通过),13: 通过(手续办理不通过),14:简易流程会签,15:简易流程汇总
         public static String LOCAL_AUDIT = "1"; //属地初审
-        public static String PENDING_DISTRIBUTE = "2"; //待分发s
+        public static String PENDING_DISTRIBUTE = "2"; //待分发
         public static String COMPLIANCE_AUDIT = "3"; //合规性审查
         public static String UNITED_AUDIT = "4"; //联合评议
         public static String TWICE_UNITED_AUDIT = "5"; //二次联合评议

+ 2 - 2
src/main/java/platform/common/base/controller/GlobalErrorController.java

@@ -14,8 +14,8 @@ public class GlobalErrorController implements ErrorController {
 
     private static final String ERROR_PATH = "/error";
 
-    @RequestMapping(value=ERROR_PATH)
-    public String handleError(){
+    @RequestMapping(value = ERROR_PATH)
+    public String handleError() {
         LOG.error("访问的页面不存在!");
         return "admin/common/404";
     }

+ 37 - 0
src/main/java/platform/modules/api/service/StockSqlService.java

@@ -0,0 +1,37 @@
+package platform.modules.api.service;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import platform.modules.company.dao.StockLandDao;
+import platform.modules.company.entity.StockLand;
+
+import java.util.List;
+
+/**
+ * @author wangjiang
+ * @since 2020/01/17 2:19 PM
+ * 做一些sql 插入的测试
+ */
+@Service
+public class StockSqlService {
+
+    @Autowired
+    private StockLandDao stockLandDao;
+
+    /**
+     * 添加自动化审批简易流程
+     * @param applyNoList
+  `   */
+    @Transactional(rollbackFor = Exception.class)
+    public void insertAutoEasyProcessDataToStockLand(List<String> applyNoList) {
+        stockLandDao.updateEasyProcessData(applyNoList);
+        for (String applyNo: applyNoList) {
+            StockLand qo = new StockLand();
+            qo.setApply_no(applyNo);
+            StockLand stockLand = stockLandDao.selectOne(qo);
+            stockLandDao.insertAutoEasyProcessDataToStockLand(stockLand.getId().toString());
+        }
+    }
+
+}

+ 5 - 0
src/main/java/platform/modules/company/dao/StockLandDao.java

@@ -52,4 +52,9 @@ public interface StockLandDao extends BaseMapper<StockLand>{
     List<StockLand> findListByCondition(@Param("condition") SearchCondition searchCondition);
 
 	List<StockLand> findListByStreetId(@Param("street_id") String street_id,@Param("apply_user_type") Integer applyUserType);
+
+	// 添加自动审批简易流程sql
+	Integer insertAutoEasyProcessDataToStockLand(@Param("applyid") String applyid);
+
+	Integer updateEasyProcessData(@Param("applyNoList") List<String> applyNoList);
 }

+ 13 - 9
src/main/java/platform/modules/company/service/StockLandApproveService.java

@@ -637,21 +637,24 @@ public class StockLandApproveService extends BaseService<StockLand> {
 
             if (Objects.equals(apply.getApprove_status(), Constant.LandApproveStatus.REJECT)) {
                 apply.setApply_status(Constant.LandApplyStatus.REJECT);
-            } else if (Objects.equals(apply.getApprove_status(), Constant.LandApproveStatus.APPROVED)
+            }
+            if (Objects.equals(apply.getApprove_status(), Constant.LandApproveStatus.APPROVED)
                     || Objects.equals(apply.getApprove_status(), Constant.LandApproveStatus.EASY_PROCESS_APPROVED)) {
                 apply.setApply_status(Constant.LandApplyStatus.APPROVED);
                 apply.setProcess_status(Constant.ProcessStatus.IN_PROGRESS);
-            } else if (Objects.equals(apply.getApprove_status(), Constant.LandApproveStatus.NOTAPPROVED)
+            }
+            if (Objects.equals(apply.getApprove_status(), Constant.LandApproveStatus.NOTAPPROVED)
                     || Objects.equals(apply.getApprove_status(), Constant.LandApproveStatus.EASY_PROCESS_DENY)) {
                 apply.setApply_status(Constant.LandApplyStatus.NOTAPPROVED);
-            } else {
-                logger.error("=====错误=====");
-                logger.error("单据的状态:{}", apply.getApprove_status());
-                logger.error("单据数据:{}", apply);
-                logger.error("消息数据:{}", message);
-                logger.error("============");
-                throw new RuntimeException("错误的单据状态:" + apply.getApprove_status());
             }
+//            else {
+            logger.info("===单据信息====");
+            logger.info("单据的状态:{}", apply.getApprove_status());
+            logger.info("单据数据:{}", apply);
+            logger.info("消息数据:{}", message);
+            logger.info("============");
+//                throw new RuntimeException("错误的单据状态:" + apply.getApprove_status());
+//            }
 
             stockLandService.updateSelective(apply);
             //置空临时状态
@@ -708,6 +711,7 @@ public class StockLandApproveService extends BaseService<StockLand> {
             if (StringUtils.isNotBlank(apply.getApply_type())) {
                 apply_type = dictionaryItemService.findNameByTypeAndValue(Constant.DictionaryType.STOCKLAND, apply.getApply_type());
             }
+
             String approve_status = dictionaryItemService.findNameByTypeAndValue(Constant.DictionaryType.STOCKLAND_APPROVE_STATUS, apply.getApprove_status());
 
             String street_name = ShiroUtils.getUserEntity().getStreet_name();

+ 2 - 3
src/main/java/platform/modules/company/service/StockLandService.java

@@ -62,6 +62,7 @@ public class StockLandService extends BaseService<StockLand> {
 
 	@Autowired
 	private StockLandDao stockLandDao;
+
 	@Autowired
 	private DepartmentService departmentService;
 
@@ -593,7 +594,7 @@ public class StockLandService extends BaseService<StockLand> {
 			condition.setApply_status(applyStatus);
 			condition.setUserId(ShiroUtils.getUserId());
 			PageHelper.startPage(pageNum, pageSize);
-			List<StockLand> stockLands = stockLandDao.findPageInfo(condition);
+				List<StockLand> stockLands = stockLandDao.findPageInfo(condition);
 			/*for (Integer usrId : userIdList) {
 				stockLands = stockLands.stream().filter(stockLand -> !(Arrays.asList(stockLand.getNextChecker().split(",")).contains(String.valueOf(usrId)))).collect(Collectors.toList());
 			}*/
@@ -608,8 +609,6 @@ public class StockLandService extends BaseService<StockLand> {
 					}
 				}
 
-
-
 				//超过五天
 				if ((stockLand.getOverTime() / 24) > 5) {
 					stockLand.setOverTimeStr("超出" + String.valueOf((int) Math.round(stockLand.getOverTime() / 24)) + "天");

+ 3 - 1
src/main/resources/application.yml

@@ -157,7 +157,8 @@ spring:
   profiles: dev
   #数据源
   datasource:
-    url: jdbc:mysql://222.92.16.3:33061/service_platform?useUnicode=true&characterEncoding=utf-8&useSSL=true&autoReconnect=true&allowMultiQueries=true
+#    url: jdbc:mysql://222.92.16.3:33061/service_platform?useUnicode=true&characterEncoding=utf-8&useSSL=true&autoReconnect=true&allowMultiQueries=true
+    url: jdbc:mysql://10.44.104.42:3306/service_platform?useUnicode=true&characterEncoding=utf-8&useSSL=true&autoReconnect=true&allowMultiQueries=true
     username: root
     password: ${password}
   #redis
@@ -323,6 +324,7 @@ spring:
 #日志
 logging:
   config: classpath:logback-jk.xml
+  level: debug
 #  path: /logs
 
 #数据库密码加密

+ 22 - 0
src/main/resources/mapper/company/StockLandDao.xml

@@ -460,4 +460,26 @@ order by a.create_time desc
 			AND zuser.user_type = #{apply_user_type}
 		</if>
 	</select>
+
+
+	<update id="updateEasyProcessData" >
+UPDATE c_stock_land_apply
+SET approve_status = "80",
+apply_status = 3,
+update_by = 0,
+update_name = "sql",
+update_time = CONCAT_WS( " ", CURRENT_DATE, CURRENT_TIME )
+WHERE
+	apply_no in
+		<foreach collection="applyNoList" index="index" item="item" open="(" separator="," close=")">
+			#{item}
+		</foreach>
+	</update>
+
+	<insert id="insertAutoEasyProcessDataToStockLand" >
+	INSERT INTO `z_approval`
+	(`APPLY_ID`,   `TYPE`,   `DEPARTMENT`, `BEFORE_APPROVALSTATUS`, `AFTER_APPROVALSTATUS`, `CHECKER`, `NEXTCHECKER`, `APPROVAL_COMMENT`, `APPROVAL_ROUND`,               `CREATE_TIME`,                         `CREATE_BY`,   `UPDATE_TIME`,                                  `UPDATE_BY`, `DEAL_TIME`,       `STATUS`,        `DEL_FLAG`, `ACTION_FLAG`, `TRANS_FLAG`, `REMARK`, `OPER_TYPE`,  `PRO_INSTANCE_ID`, `CREATE_NAME`, `UPDATE_NAME`, `IS_WITHDRAW`, `CAN_WITHDRAW`)
+	VALUES (#{applyid}, '存量用地', '企业服务处',     '2',                    '14',                    140,        '',         '做简易流程处理',        1,                CONCAT_WS( " ", CURRENT_DATE, CURRENT_TIME ),       140,         CONCAT_WS( " ", CURRENT_DATE, CURRENT_TIME ),            NULL,       NULL,       0,                   0,           NULL,       NULL,        '通过',     '通过',       null,            '张磊',         "sql",            null,       NULL)
+	,(#{applyid}, '存量用地',     '企业服务处',         '14',                      '80',                    140,         '',        '审核通过',             1,             CONCAT_WS( " ", CURRENT_DATE, CURRENT_TIME ), '140',     CONCAT_WS( " ", CURRENT_DATE, CURRENT_TIME ),       NULL,       NULL,               0,             0,                NULL,        NULL,     NULL,     '通过',       null,              '张磊',       "sql",          NULL,            NULL)
+	</insert>
 </mapper>

+ 11 - 1
src/main/resources/templates/admin/government/areaManager/index.html

@@ -20,6 +20,10 @@
 <form id="myForm" th:action="@{/areaManager/index}" th:method="post" >
 <div class="page-container">
     <div class="text-c">
+<!--            <span class="select-box" style="width:250px">-->
+<!--                <input th:type="hidden"  th:name="summary_procedure" id="summary_procedure" th:value="0"/>-->
+<!--                <button onclick="selectEasyProcess()">简易流程待分发</button>-->
+<!--			</span>-->
     		<span class="select-box" style="width:250px">
                 <select th:id="searchApplyUserType" class="select" th:name="applyUserType" onChange="$('#myForm').submit();">
                     <option value="">--全部--</option>
@@ -107,7 +111,13 @@
 <script type="text/javascript" th:src="@{/js/common/page.js}"></script>
 <script type="text/javascript" th:src="@{/js/government/areaManager/areaManager_list.js}"></script>
 <script th:inline="javascript">
-
+    // 简易流程待分发结果筛选
+    function selectEasyProcess() {
+        $("#searchApplyStatus").val(2)
+        $("#searchApplyType").val(2)
+        $("#summary_procedure").val(1)
+        $('#myForm').submit();
+    }
 </script>
 </body>
 </html>

+ 6 - 0
src/test/java/com/test.java

@@ -1,6 +1,9 @@
 package com;
 
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
 import platform.common.util.DateUtil;
 
 import java.text.ParseException;
@@ -10,6 +13,9 @@ import java.util.*;
 /**
  * Created by luohaifeng on 2017/10/31.
  */
+@RunWith(SpringRunner.class)
+
+@SpringBootTest()
 public class test {
     @Test
     public void propsTest() throws ParseException {

+ 63 - 0
src/test/java/platform/modules/test/test.java

@@ -0,0 +1,63 @@
+package platform.modules.test;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+import platform.RootApplication;
+import platform.modules.api.service.StockSqlService;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * wangjiang
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = RootApplication.class)
+public class test {
+    @Autowired
+    StockSqlService stockSqlService;
+
+    @Test
+    public void test() {
+        List applyNoList = new ArrayList();
+        applyNoList.add("20191224103535");
+        applyNoList.add("20191218094815");
+        applyNoList.add("20191206083744");
+        applyNoList.add("20191129180151");
+        applyNoList.add("20191127171934");
+        applyNoList.add("20191119101752");
+        applyNoList.add("20191107110714");
+        applyNoList.add("20190930144450");
+        applyNoList.add("20190911131347");
+        applyNoList.add("20190924170648");
+        applyNoList.add("20190919142951");
+        applyNoList.add("20190906102201");
+        applyNoList.add("20190828163122");
+        applyNoList.add("20190814101822");
+        applyNoList.add("20190804131015");
+        applyNoList.add("20190730163952");
+        applyNoList.add("20190725201231");
+        applyNoList.add("20190704140021");
+        applyNoList.add("20190530110839");
+        applyNoList.add("20190606164157");
+        applyNoList.add("20190418110007");
+        applyNoList.add("20190417142341");
+        applyNoList.add("20190313073942");
+        applyNoList.add("20190222155642");
+        applyNoList.add("20190107091017");
+        applyNoList.add("20190104094519");
+        applyNoList.add("20181212171104");
+        applyNoList.add("20181211094726");
+        applyNoList.add("20181204120344");
+        applyNoList.add("20181030103543");
+        applyNoList.add("20181019131638");
+
+
+
+        stockSqlService.insertAutoEasyProcessDataToStockLand(applyNoList);
+    }
+}