Bladeren bron

Merge branch 'master' of https://gitee.com/antai-wuliu/ANTAI-API

dengpan 1 jaar geleden
bovenliggende
commit
76ea5766d6

+ 1 - 1
src/main/java/com/steerinfo/dil/controller/SystemFileController.java

@@ -372,7 +372,7 @@ public class SystemFileController extends BaseRESTfulController {
                 //}
             }
             SimpleDateFormat simpleDateFormat = new SimpleDateFormat("/yyyy/MM/dd");
-            String filePath = simpleDateFormat.format(new Date()) + "/" + fileType;
+            String filePath = "/" + fileType  + simpleDateFormat.format(new Date());
             boolean result = ftpFileUtil.uploadToFtp(inputStream, filePath, newName, false);
             inputStream.close();
             if (result) {

+ 8 - 0
src/main/java/com/steerinfo/dil/mapper/CommonMapper.java

@@ -0,0 +1,8 @@
+package com.steerinfo.dil.mapper;
+
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface CommonMapper {
+
+}

+ 1 - 1
src/main/resources/bootstrap.yml

@@ -1,7 +1,7 @@
 api.version: api/v1
 spring:
   profiles:
-    include: ${SPRING_PROFILES:prod}
+    include: ${SPRING_PROFILES:dev}
   jackson:
     date-format: yyyy-MM-dd HH:mm:ss
     time-zone: GMT+8

+ 88 - 0
src/main/resources/com/steerinfo/dil/mapper/CommonMapper.xml

@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.steerinfo.dil.mapper.CommonMapper">
+    <sql id="orderBy">
+        <if test="orderField != null and orderField != ''">
+            order by "${orderField}"
+            <if test="orderType != null and orderType != ''">
+                ${orderType}
+            </if>
+        </if>
+    </sql>
+    <sql id="timeFilter">
+        <if test="oneDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= ${timeFilterProp}
+        </if>
+        <if test="startDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= ${timeFilterProp}
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= ${timeFilterProp}
+        </if>
+    </sql>
+    <sql id="companyFilter">
+        <if test="${companyType} != null">
+            <if test="!roleCodes.contains('admin') and dilCompanyList != null and dilCompanyList.size > 0">
+                AND ${prop}
+                in
+                <foreach collection="dilCompanyList" item="item" open="(" close=")" separator=",">
+                    <if test="item.companyType == ${companyType}">
+                        #{item.companyId}
+                    </if>
+                </foreach>
+            </if>
+        </if>
+        <if test="${companyType} == null">
+            <if test="!roleCodes.contains('admin') and dilCompanyList != null and dilCompanyList.size > 0">
+                AND ${prop}
+                in
+                <foreach collection="dilCompanyList" item="item" open="(" close=")" separator=",">
+                    #{item.companyId}
+                </foreach>
+            </if>
+        </if>
+    </sql>
+    <sql id="rootCompanyFilter">
+        <if test="rootCompanyMap != null and (rootCompanyMap.rootCompanyName.contains('安泰') or rootCompanyMap.rootCompanyName.contains('新泰'))">
+            AND "rootCompanyId" = #{rootCompanyMap.rootCompanyId}
+        </if>
+    </sql>
+    <sql id="filterCompanyData">
+        <if test="roleCodes != null and roleCodes.size > 0  and dilCompanyList != null and dilCompanyList.size > 0" >
+        AND
+            <foreach collection="roleCodes" index="index" item="item" separator="or" close=")" open="(">
+                <choose>
+                    <when test="item == 'chengYunShang'">
+                        "carrierId"
+                        in
+                        <foreach collection="dilCompanyList" open="(" close=")" separator="," item="item" index="index">
+                            #{item.companyId}
+                        </foreach>
+                    </when>
+                    <when test="item == 'shippingCompany'">
+                        "shippingCompanyId"
+                        in
+                        <foreach collection="dilCompanyList" open="(" close=")" separator="," item="item" index="index">
+                            #{item.companyId}
+                        </foreach>
+                    </when>
+                    <when test="item == 'receivingCompany'">
+                        "receivingCompanyId"
+                        in
+                        <foreach collection="dilCompanyList" open="(" close=")" separator="," item="item" index="index">
+                            #{item.companyId}
+                        </foreach>
+                    </when>
+                    <when test="item == 'businessCompany'">
+                        "businessCompanyId"
+                        in
+                        <foreach collection="dilCompanyList" open="(" close=")" separator="," item="item" index="index">
+                            #{item.companyId}
+                        </foreach>
+                    </when>
+                    <otherwise>
+                         1 = 1
+                    </otherwise>
+                </choose>
+            </foreach>
+        </if>
+    </sql>
+</mapper>

+ 9 - 8
src/main/resources/com/steerinfo/dil/mapper/UniversalMapper.xml

@@ -264,11 +264,14 @@
         <if test="id!=null and id.size>0">
         UNION
             select
+            MATERIAL_TYPE_ID "operationsNameId",
+            MATERIAL_TYPE_NAME "operationsName",
             MATERIAL_TYPE_ID "id",
             MATERIAL_TYPE_ID "value",
             MATERIAL_TYPE_NAME "label",
             MATERIAL_TYPE_NAME "text",
-            REMARK "remark"
+            REMARK "remark",
+            'operationsName' "prop"
             from RMS_MATERIAL_TYPE
             where MATERIAL_TYPE_ID in
             <foreach collection="id" item="item"  open="(" close=")" separator="," >
@@ -572,7 +575,8 @@
             RCT.CAPACITY_TYPE_NAME "text",
             RCT .CAPACITY_MAX_LOAD "capacityMaxLoad",
             '[' || listagg (RCFT .FUEL_TYPE_ID, ',') WITHIN GROUP (ORDER BY RCT .CAPACITY_TYPE_ID) || ']'  "fuelTypeIds",
-            listagg (RFT .FUEL_TYPE_NAME, '/') WITHIN GROUP (ORDER BY RCT .CAPACITY_TYPE_ID)  "fuelTypes"
+            listagg (RFT .FUEL_TYPE_NAME, '/') WITHIN GROUP (ORDER BY RCT .CAPACITY_TYPE_ID)  "fuelTypes",
+            'capacityTypeName' "prop"
             from RMS_CAPACITY_TYPE RCT
             LEFT JOIN RMS_CAPACITY_FUEL_TYPE RCFT ON RCFT.CAPACITY_TYPE_ID = RCT .CAPACITY_TYPE_ID
             LEFT JOIN RMS_FUEL_TYPE RFT ON RFT .FUEL_TYPE_ID = RCFT.FUEL_TYPE_ID
@@ -636,7 +640,8 @@
             RL.LINE_NAME "label",
             RL.LINE_NAME "text",
             NVL(RL_TEMP."points",'无') "points",
-            RL.LINE_TYPE    "lineType"
+            RL.LINE_TYPE    "lineType",
+            'lineName' "prop"
             from RMS_LINE RL
             LEFT JOIN
             (
@@ -896,11 +901,6 @@
         ON ROP.OPERATION_POINT_ID = RTR.START_POINT_ID
         LEFT JOIN RMS_OPERATION_POINT ROP2
         ON ROP2.OPERATION_POINT_ID = RTR.END_POINT_ID
-        <where>
-            <include refid="companyFilter" >
-                <property name="prop" value="rdb.COMPANY_ID"/>
-            </include>
-        </where>
         )
         <where>
             <if test="index!=null and index!=''">
@@ -909,6 +909,7 @@
             <if test="businessCompanyId!=null and businessCompanyId!=''">
                 AND REGEXP_LIKE("businessCompanyId", #{businessCompanyId})
             </if>
+            <include refid="com.steerinfo.dil.mapper.CommonMapper.filterCompanyData"></include>
         </where>
     </select>
     <select id="getIdCardCode" resultType="java.lang.String">

+ 1 - 1
src/main/resources/log4j.properties

@@ -1,5 +1,5 @@
 ## LOG4J配置
-log4j.rootCategory=INFO,RUNNING,stdout
+log4j.rootCategory=DEBUG, stdout,file, RUNNING,errorfile
 ## 控制台输出
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout