zx 3 rokov pred
rodič
commit
545752e573

+ 9 - 5
src/main/java/com/steerinfo/dil/controller/RmsCapacityController.java

@@ -128,16 +128,12 @@ public class RmsCapacityController extends BaseRESTfulController {
                                                Integer pageSize,
                                                String con,
                                                String carrierSSOId) {
-        int count = 0;
-        if (mapValue==null){
-            mapValue=new HashMap<>();
-        }
         if(carrierSSOId != null){
             if(!"null".equals(carrierSSOId)) {
                 mapValue.put("carrierSSOId", carrierSSOId);
-                count++;
             }
         }
+<<<<<<< HEAD
         if (con != null && con.equals("")) {
             con = null;
         }
@@ -145,6 +141,14 @@ public class RmsCapacityController extends BaseRESTfulController {
             mapValue.put("con","%" + con +"%");
         }
         List<Map<String,Object>> listTotal = rmsCapacityService.getCapacityList(mapValue);
+=======
+        if(con != null){
+            if(!"".equals(con)){
+                mapValue.put("index", con);
+            }
+        }
+        List<Map<String, Object>> listTotal = rmsCapacityService.getCapacityList(mapValue);
+>>>>>>> 5b4d76552ee1dd5d49d5285fcaba63ce070322d7
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
         List<Map<String, Object>> columnList = rmsCapacityService.getCapacityList(mapValue);

+ 8 - 42
src/main/java/com/steerinfo/dil/controller/RmsLineController.java

@@ -10,6 +10,7 @@ import com.steerinfo.dil.service.IRmsLineService;
 
 import com.steerinfo.dil.util.BaseRESTfulController;
 import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.dil.util.DataChange;
 import com.steerinfo.dil.util.PageListAdd;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageHelper;
@@ -20,6 +21,7 @@ import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.models.auth.In;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import java.math.BigDecimal;
@@ -72,32 +74,13 @@ public class RmsLineController extends BaseRESTfulController {
                                         Integer pageSize,
                                         Integer apiId,
                                         String con){
-        //框计算
+
         if(con != null){
-            if(!"undefined".equals(con)){
-                String index="get_line_list";    //设置要查询的索引名称
-                return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));//获取查询结果
+            if(!"".equals(con)){
+                mapValue.put("index", con);
             }
         }
-        List<Map<String,Object>> list = null;
-        //如果有条件查询则跳过初始化,和创建索引
-        if(mapValue.size() == 0){
-            //将查询结果存入索引中
-            list = rmsLineMapper.getAllLineDesk(mapValue);
-            Map<String, Object> map = new HashMap<>();
-            //添加索引
-            map.put("index","get_line_list");
-            //添加id
-            map.put("indexId","lineId");
-            list.add(map);
-            //新建索引
-            esFeign.insertIndex(list);
-            //删除
-            list.remove(list.size()-1);
-        }
-        if(list == null) {
-            list = rmsLineMapper.getAllLineDesk(mapValue);
-        }
+        List<Map<String, Object>>  list = rmsLineMapper.getAllLineDesk(mapValue);
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
         List<Map<String, Object>> columnList = rmsLineMapper.getAllLineDesk(mapValue);
@@ -115,6 +98,7 @@ public class RmsLineController extends BaseRESTfulController {
             @ApiImplicitParam(name = "mapValue", value = "运输路线", required = false, dataType = "Map"),
     })
     @PostMapping("/insertSelective")
+    @Transactional
     public RESTfulResult insertSelective(@RequestBody(required = false) Map<String,Object> mapVal){
         // 创建运输路线主表实体
         RmsLine rmsLine = new RmsLine();
@@ -136,24 +120,7 @@ public class RmsLineController extends BaseRESTfulController {
         //存放到运输路线主表实体中
         rmsLine.setLineEndNodeId(new BigDecimal(lineEndNodeId));
         //生成运输线路编号
-        String lineNo = "";
-        if(lineId < 10){
-            lineNo = "YSXL0000000"+lineId;
-        }else if(lineId >= 10 || lineId <100){
-            lineNo = "YSXL000000"+lineId;
-        }else if(lineId >= 100 || lineId <1000){
-            lineNo = "YSXL00000"+lineId;
-        }else if(lineId >= 1000 || lineId <10000){
-            lineNo = "YSXL0000"+lineId;
-        }else if(lineId >= 10000 || lineId <100000){
-            lineNo = "YSXL000"+lineId;
-        }else if(lineId >= 100000 || lineId <1000000){
-            lineNo = "YSXL00"+lineId;
-        }else if(lineId >= 1000000 || lineId <10000000){
-            lineNo = "YSXL0"+lineId;
-        }else if(lineId >= 10000000 || lineId <100000000){
-            lineNo = "YSXL"+lineId;
-        }
+        String lineNo = DataChange.generateEightDigitsNumber("YSXL", lineId);
         //将运输线路存放进运输线路主表实体中
         rmsLine.setLineNo(lineNo);
         //逻辑删除(0为未删除,1为删除)
@@ -205,7 +172,6 @@ public class RmsLineController extends BaseRESTfulController {
     @ApiOperation(value = "修改运输线路信息")
     @PostMapping("/updateByPrimaryKeySelective")
     public RESTfulResult updateByPrimaryKeySelective(@RequestBody(required = false) Map<String,Object> mapVal) {
-        //创建一个运输线路主表实体
         RmsLine rmsLine = new RmsLine();
         //拿到前端传递的运输线路主表id
         Integer lineId = (Integer) mapVal.get("lineId");

+ 2 - 1
src/main/resources/application-dev.yml

@@ -18,4 +18,5 @@ openFeign:
 
   #测试端口
 server:
-    port: 8014
+    port: 8014
+

+ 1 - 0
src/main/resources/application-prod.yml

@@ -17,3 +17,4 @@ openFeign:
       url: ${AMSFEIGN_URL:172.16.33.166:8079}
 server:
     port: 8060
+

+ 0 - 3
src/main/resources/bootstrap.yml

@@ -45,13 +45,10 @@ redis:
   database: 0
 
 
-
-
 mybatis:
   type-aliases-package: com.steerinfo.dil.model
   mapper-locations: classpath:com/steerinfo/dil/mapper/*.xml
   configuration:
     #    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
     mapUnderscoreToCamelCase: true
-    call-setters-on-nulls: true
 

+ 3 - 0
src/main/resources/com/steerinfo/dil/mapper/RmsCapacityMapper.xml

@@ -725,6 +725,9 @@
     <if test="carrierSSOId != null">
         and RCA.CARRIER_SSO_ID = #{carrierSSOId}
       </if>
+      <if test="index != null">
+        and instr(RC.CAPACITY_NUMBER, #{index}) > 0
+      </if>
     ORDER BY RC.INSERT_TIME DESC
     )
     <if test="con != null">

+ 3 - 1
src/main/resources/com/steerinfo/dil/mapper/RmsLineMapper.xml

@@ -578,10 +578,12 @@
     FROM
       RMS_LINE RL
     WHERE RL.DELETED = 0
+        <if test="index != null">
+          and instr(RL.LINE_NAME, #{index}) > 0
+        </if>
         )
     <where>
       <if test="lineNo != null">
-        and
         <foreach collection="lineNo" item="item" open="(" separator="or" close=")">
           "lineNo" like '%${item}%'
         </foreach>