Selaa lähdekoodia

Merge branch 'master' of http://114.55.67.98:8070/Natural_p1/zjugis_OA

songxy 1 vuosi sitten
vanhempi
commit
6a9b073f2f

+ 24 - 12
zjugis-business/src/main/resources/mapper/oracle/ContractMapper.xml

@@ -16,7 +16,7 @@
     </select>
 
     <select id="page" resultType="com.zjugis.business.bean.entity.Contract">
-        SELECT c.*,PA.invoiceAmount,PA.returnAmount,(PA.invoiceAmount - PA.returnAmount) as receivableAmount,(c.CONTRACT_AMOUNT - pa.invoiceAmount) as contractBalance FROM CONTRACT c
+        SELECT c.*,COALESCE(PA.invoiceAmount,0),COALESCE(PA.returnAmount,0),(COALESCE(PA.invoiceAmount,0) - COALESCE(PA.returnAmount,0)) as receivableAmount,(COALESCE(c.CONTRACT_AMOUNT,0) - COALESCE(pa.invoiceAmount,0)) as contractBalance FROM CONTRACT c
         LEFT JOIN (
         SELECT CONTRACT_ID,
         COALESCE(SUM(COALESCE(INVOICE_AMOUNT,0)),0) as invoiceAmount,
@@ -138,13 +138,13 @@
     <select id="messageCountContract" resultType="com.zjugis.business.bean.response.ContractMessageCountResp">
 
         SELECT NVL(SUM(c.CONTRACT_AMOUNT), 0) as signAmount,
-            NVL(SUM(CASE WHEN c.SIGN_WAY = 3 then C.CONTRACT_AMOUNT ELSE 0 END), 0) AS newAmount
+            NVL(SUM(C.CONTRACT_AMOUNT), 0) AS newAmount
             FROM CONTRACT c
             RIGHT JOIN PROJECT pr ON pr.ID = c.PROJECT_ID
             <where>
                 c.ISVALID = 1 AND c.FLOW_STATUS = 90
                 <if test="params != null and params.year != null and params.year != ''">
-                    AND TO_CHAR(c.CONTRACT_OFF,'YYYY') = #{params.year,jdbcType=VARCHAR}
+                    AND TO_CHAR(c.CONTRACT_ON,'YYYY') = #{params.year,jdbcType=VARCHAR}
                 </if>
                 <if test="params != null and params.deptId != null and params.deptId != ''">
                     AND pr.ZRBM_ID = #{params.deptId}
@@ -167,7 +167,7 @@
         COALESCE(SUM(COALESCE(PA.invoiceAmount,0)),0) as invoiceAmount,
         COALESCE(SUM(COALESCE(PA.returnAmount,0)),0) as returnAmount,
         COALESCE(SUM(COALESCE(PA.invoiceAmount - PA.returnAmount,0)),0) as receivableAmount,
-        COALESCE(SUM(COALESCE(c.CONTRACT_AMOUNT - pa.invoiceAmount,0)),0) as contractBalance
+        COALESCE(SUM(COALESCE(c.CONTRACT_AMOUNT,0)),0) - COALESCE(SUM(COALESCE(PA.invoiceAmount,0)),0) as contractBalance
         FROM CONTRACT c
         LEFT JOIN (
             SELECT CONTRACT_ID,
@@ -349,11 +349,17 @@
             <if test="params != null and params.amountStatus != null">
                 AND c.AMOUNT_STATUS = #{params.amountStatus}
             </if>
-            <if test="params != null and params.contractOn != null">
-                AND c.CONTRACT_OFF &gt;= #{params.contractOn}
+            <if test="params != null and params.contractOnStart != null">
+                AND c.CONTRACT_ON &gt;= #{params.contractOnStart}
+            </if>
+            <if test="params != null and params.contractOnEnd != null">
+                AND c.CONTRACT_ON &lt;= #{params.contractOnEnd}
             </if>
-            <if test="params != null and params.contractOff != null">
-                AND c.CONTRACT_OFF &lt;= #{params.contractOff}
+            <if test="params != null and params.contractOffStart != null">
+                AND c.CONTRACT_OFF &gt;= #{params.contractOffStart}
+            </if>
+            <if test="params != null and params.contractOffEnd != null">
+                AND c.CONTRACT_OFF &lt;= #{params.contractOffEnd}
             </if>
             <if test="params != null and params.signTimeStart != null">
                 AND c.SIGN_TIME &gt;= #{params.signTimeStart}
@@ -430,11 +436,17 @@
             <if test="params != null and params.amountStatus != null">
                 AND c.AMOUNT_STATUS = #{params.amountStatus}
             </if>
-            <if test="params != null and params.contractOn != null">
-                AND c.CONTRACT_OFF &gt;= #{params.contractOn}
+            <if test="params != null and params.contractOnStart != null">
+                AND c.CONTRACT_ON &gt;= #{params.contractOnStart}
+            </if>
+            <if test="params != null and params.contractOnEnd != null">
+                AND c.CONTRACT_ON &lt;= #{params.contractOnEnd}
             </if>
-            <if test="params != null and params.contractOff != null">
-                AND c.CONTRACT_OFF &lt;= #{params.contractOff}
+            <if test="params != null and params.contractOffStart != null">
+                AND c.CONTRACT_OFF &gt;= #{params.contractOffStart}
+            </if>
+            <if test="params != null and params.contractOffEnd != null">
+                AND c.CONTRACT_OFF &lt;= #{params.contractOffEnd}
             </if>
             <if test="params != null and params.signTimeStart != null">
                 AND c.SIGN_TIME &gt;= #{params.signTimeStart}

+ 28 - 12
zjugis-business/src/main/resources/mapper/oracle/ProjectMapper.xml

@@ -9,6 +9,7 @@
         COALESCE(SUM(COALESCE(PA.PROJECT_COST, 0)), 0) as cost
         FROM PROJECT P
         LEFT JOIN PROJECT_AMOUNT PA on PA.PROJECT_ID = P.ID
+        LEFT JOIN (SELECT PROJECT_ID,MAX(ID) as ID FROM CONTRACT WHERE FLOW_STATUS = 90 AND ISVALID = 1 GROUP BY PROJECT_ID ) T1 ON T1.PROJECT_ID = P.ID
         <if test="params != null and params.userId != null  and params.userId != ''">
             LEFT JOIN PROJECT_WORKER_RELATION PW ON PW.PROJECT_ID = P.ID
         </if>
@@ -32,8 +33,11 @@
             <if test="params != null and params.lxsjOff != null">
                 AND P.LXSJ &lt;= #{params.lxsjOff}
             </if>
-            <if test="params != null and params.isSign != null">
-                AND P.IS_SIGN = #{params.isSign}
+            <if test="params != null and params.isSign == 1">
+                AND T1.ID is not null
+            </if>
+            <if test="params != null and params.isSign == 0">
+                AND T1.ID is null
             </if>
             <if test="params != null and params.xmmc != null and params.xmmc != ''">
                 <bind name="xmmc" value="'%'+params.xmmc+'%'"/>
@@ -76,6 +80,7 @@
         FROM PROJECT P
         LEFT JOIN PROJECT_AMOUNT PA ON PA.PROJECT_ID = P.ID
         LEFT JOIN ZJUGIS_OA.SYSTEM_DEPT D ON D.ID = P.ZRBM_ID
+        LEFT JOIN (SELECT PROJECT_ID,MAX(ID) as ID FROM CONTRACT WHERE FLOW_STATUS = 90 AND ISVALID = 1 GROUP BY PROJECT_ID ) T1 ON T1.PROJECT_ID = P.ID
         <if test="params != null and params.isRelContract != null and params.isRelContract == 1">
             LEFT JOIN (SELECT PID,count(1) as ccount FROM PROJECT WHERE FLOW_STATUS = 99 GROUP BY PID) CH ON CH.PID = P.ID
             LEFT JOIN (SELECT PROJECT_ID,max(CONTRACT_NUMBER) as contractNumber FROM  CONTRACT where FLOW_STATUS in (90,99) GROUP BY PROJECT_ID) C ON C.PROJECT_ID = P.ID
@@ -106,8 +111,11 @@
             <if test="params != null and params.lxsjOff != null">
                 AND P.LXSJ &lt;= #{params.lxsjOff}
             </if>
-            <if test="params != null and params.isSign != null">
-                AND P.IS_SIGN = #{params.isSign}
+            <if test="params != null and params.isSign == 1">
+                AND T1.ID is not null
+            </if>
+            <if test="params != null and params.isSign == 0">
+                AND T1.ID is null
             </if>
             <if test="params != null and params.xmmc != null and params.xmmc != ''">
                 <bind name="xmmc" value="'%'+params.xmmc+'%'"/>
@@ -183,6 +191,7 @@
         SUM(CASE WHEN P.XMZT = 3 THEN 1 ELSE 0 END) as terminated,
         SUM(CASE WHEN P.XMZT = 4 THEN 1 ELSE 0 END) as accepted
         FROM PROJECT P
+        LEFT JOIN (SELECT PROJECT_ID,MAX(ID) as ID FROM CONTRACT WHERE FLOW_STATUS = 90 AND ISVALID = 1 GROUP BY PROJECT_ID ) T1 ON T1.PROJECT_ID = P.ID
         <if test="params != null and params.userId != null  and params.userId != ''">
             LEFT JOIN PROJECT_WORKER_RELATION PW ON PW.PROJECT_ID = P.ID
         </if>
@@ -206,8 +215,11 @@
             <if test="params != null and params.lxsjOff != null">
                 AND P.LXSJ &lt;= #{params.lxsjOff}
             </if>
-            <if test="params != null and params.isSign != null">
-                AND P.IS_SIGN = #{params.isSign}
+            <if test="params != null and params.isSign == 1">
+                AND T1.ID is not null
+            </if>
+            <if test="params != null and params.isSign == 0">
+                AND T1.ID is null
             </if>
             <if test="params != null and params.xmmc != null and params.xmmc != ''">
                 <bind name="xmmc" value="'%'+params.xmmc+'%'"/>
@@ -234,12 +246,12 @@
         SELECT
             COALESCE(SUM(CASE WHEN T.LXSJ &gt;= #{start,jdbcType=DATE} THEN 1 ELSE 0 END),0) as xl,
             COALESCE(SUM(CASE WHEN T.LXSJ &lt;= #{end,jdbcType=DATE} AND XMZT = 1 THEN 1 ELSE 0 END),0) as jz,
-            COALESCE(SUM(CASE WHEN T1.ID IS NULL THEN 1 ELSE 0 END),0) as haveContract,
-            COALESCE(SUM(CASE WHEN T1.ID IS NOT NULL THEN 1 ELSE 0 END),0) as noContract,
+            COALESCE(SUM(CASE WHEN T.XMZT != 3 AND T.IS_SIGN = 1 AND T1.ID IS NOT NULL THEN 1 ELSE 0 END),0) as haveContract,
+            COALESCE(SUM(CASE WHEN T.XMZT != 3 AND T.IS_SIGN = 1 AND T1.ID IS NULL THEN 1 ELSE 0 END),0) as noContract,
             COALESCE(SUM(CASE WHEN T.XMZT = 4 THEN 1 ELSE 0 END),0) as accepted,
-            COALESCE(SUM(CASE WHEN T.XMZT = 1 THEN 1 ELSE 0 END),0) as unaccepted
+            COALESCE(SUM(CASE WHEN T.XMZT = 1 and T1.ID IS NOT NULL THEN 1 ELSE 0 END),0) as unaccepted
         FROM PROJECT T
-                 LEFT JOIN CONTRACT T1 ON T1.PROJECT_ID = T.ID AND T1.FLOW_STATUS = 90 AND T1.ISVALID = 1
+         LEFT JOIN (SELECT PROJECT_ID,MAX(ID) as ID FROM CONTRACT WHERE FLOW_STATUS = 90 AND ISVALID = 1 GROUP BY PROJECT_ID ) T1 ON T1.PROJECT_ID = T.ID
         WHERE T.ISVALID = 1 AND T.FLOW_STATUS = 90
         <if test="params != null  and params.deptIds != null  and params.deptIds.size > 0">
             AND T.ZRBM_ID in
@@ -372,6 +384,7 @@
     <select id="excelList" resultType="com.zjugis.business.bean.response.ProjectExcelResponse">
         SELECT P.*,D.NAME as zrbm,PA.PROJECT_COST,PA.REIMBURSEMENT_COST,PA.TRAVEL_COST,PA.SUBCONTRACT_COST,PA.OUTSOURCE_COST,PA.PAYMENT_COST
         FROM PROJECT P
+        LEFT JOIN (SELECT PROJECT_ID,MAX(ID) as ID FROM CONTRACT WHERE FLOW_STATUS = 90 AND ISVALID = 1 GROUP BY PROJECT_ID ) T1 ON T1.PROJECT_ID = P.ID
         LEFT JOIN PROJECT_AMOUNT PA ON PA.PROJECT_ID = P.ID
         LEFT JOIN ZJUGIS_OA.SYSTEM_DEPT D ON D.ID = P.ZRBM_ID
         <if test="params != null and params.userId != null  and params.userId != ''">
@@ -400,8 +413,11 @@
             <if test="params != null and params.lxsjOff != null">
                 AND P.LXSJ &lt;= #{params.lxsjOff}
             </if>
-            <if test="params != null and params.isSign != null">
-                AND P.IS_SIGN = #{params.isSign}
+            <if test="params != null and params.isSign == 1">
+                AND T1.ID is not null
+            </if>
+            <if test="params != null and params.isSign == 0">
+                AND T1.ID is null
             </if>
             <if test="params != null and params.xmmc != null and params.xmmc != ''">
                 <bind name="xmmc" value="'%'+params.xmmc+'%'"/>

+ 20 - 20
zjugis-gateway/src/main/java/com/zjugis/gateway/filter/logging/AccessLogFilter.java

@@ -74,26 +74,26 @@ public class AccessLogFilter implements GlobalFilter, Ordered {
         // TODO 芋艿:暂未实现
 
         // 方式三:打印到控制台,方便排查错误
-        Map<String, Object> values = MapUtil.newHashMap(15, true); // 手工拼接,保证排序;15 保证不用扩容
-        values.put("userId", gatewayLog.getUserId());
-        values.put("userType", gatewayLog.getUserType());
-        values.put("routeId", gatewayLog.getRoute() != null ? gatewayLog.getRoute().getId() : null);
-        values.put("schema", gatewayLog.getSchema());
-        values.put("requestUrl", gatewayLog.getRequestUrl());
-        values.put("queryParams", gatewayLog.getQueryParams().toSingleValueMap());
-        values.put("requestBody", JsonUtils.isJson(gatewayLog.getRequestBody()) ? // 保证 body 的展示好看
-                JSONUtil.parse(gatewayLog.getRequestBody()) : gatewayLog.getRequestBody());
-        values.put("requestHeaders", JsonUtils.toJsonString(gatewayLog.getRequestHeaders().toSingleValueMap()));
-        values.put("userIp", gatewayLog.getUserIp());
-        values.put("responseBody", JsonUtils.isJson(gatewayLog.getResponseBody()) ? // 保证 body 的展示好看
-                JSONUtil.parse(gatewayLog.getResponseBody()) : gatewayLog.getResponseBody());
-        values.put("responseHeaders", gatewayLog.getResponseHeaders() != null ?
-                JsonUtils.toJsonString(gatewayLog.getResponseHeaders().toSingleValueMap()) : null);
-        values.put("httpStatus", gatewayLog.getHttpStatus());
-        values.put("startTime", LocalDateTimeUtil.format(gatewayLog.getStartTime(), NORM_DATETIME_MS_FORMATTER));
-        values.put("endTime", LocalDateTimeUtil.format(gatewayLog.getEndTime(), NORM_DATETIME_MS_FORMATTER));
-        values.put("duration", gatewayLog.getDuration() != null ? gatewayLog.getDuration() + " ms" : null);
-        log.info("[writeAccessLog][网关日志:{}]", JsonUtils.toJsonPrettyString(values));
+//        Map<String, Object> values = MapUtil.newHashMap(15, true); // 手工拼接,保证排序;15 保证不用扩容
+//        values.put("userId", gatewayLog.getUserId());
+//        values.put("userType", gatewayLog.getUserType());
+//        values.put("routeId", gatewayLog.getRoute() != null ? gatewayLog.getRoute().getId() : null);
+//        values.put("schema", gatewayLog.getSchema());
+//        values.put("requestUrl", gatewayLog.getRequestUrl());
+//        values.put("queryParams", gatewayLog.getQueryParams().toSingleValueMap());
+//        values.put("requestBody", JsonUtils.isJson(gatewayLog.getRequestBody()) ? // 保证 body 的展示好看
+//                JSONUtil.parse(gatewayLog.getRequestBody()) : gatewayLog.getRequestBody());
+//        values.put("requestHeaders", JsonUtils.toJsonString(gatewayLog.getRequestHeaders().toSingleValueMap()));
+//        values.put("userIp", gatewayLog.getUserIp());
+//        values.put("responseBody", JsonUtils.isJson(gatewayLog.getResponseBody()) ? // 保证 body 的展示好看
+//                JSONUtil.parse(gatewayLog.getResponseBody()) : gatewayLog.getResponseBody());
+//        values.put("responseHeaders", gatewayLog.getResponseHeaders() != null ?
+//                JsonUtils.toJsonString(gatewayLog.getResponseHeaders().toSingleValueMap()) : null);
+//        values.put("httpStatus", gatewayLog.getHttpStatus());
+//        values.put("startTime", LocalDateTimeUtil.format(gatewayLog.getStartTime(), NORM_DATETIME_MS_FORMATTER));
+//        values.put("endTime", LocalDateTimeUtil.format(gatewayLog.getEndTime(), NORM_DATETIME_MS_FORMATTER));
+//        values.put("duration", gatewayLog.getDuration() != null ? gatewayLog.getDuration() + " ms" : null);
+//        log.info("[writeAccessLog][网关日志:{}]", JsonUtils.toJsonPrettyString(values));
     }
 
     @Override

+ 0 - 1
zjugis-module-infra/zjugis-module-infra-biz/src/main/java/com/zjugis/module/infra/controller/admin/file/FileController.java

@@ -74,7 +74,6 @@ public class FileController {
     @DeleteMapping("/delete")
     @Operation(summary = "删除文件")
     @Parameter(name = "id", description = "编号", required = true)
-    @PreAuthorize("@ss.hasPermission('infra:file:delete')")
     public CommonResult<Boolean> deleteFile(@RequestParam("id") Long id) throws Exception {
         fileService.deleteFile(id);
         return success(true);