Browse Source

修改锁定提醒内容,并修改分组类型合并

zk 4 days ago
parent
commit
9c5ec441ae

+ 10 - 5
ghjg-item-datashare-server/src/main/java/com/shanghaichengdi/ghjgitem/controller/SIPGDataTransportController.java

@@ -3,6 +3,7 @@ package com.shanghaichengdi.ghjgitem.controller;
 
 import cn.hutool.json.JSON;
 import cn.hutool.json.JSONUtil;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -89,7 +90,7 @@ public class SIPGDataTransportController extends CommonController  {
                             Map<List<Object>, List<TransportSgDwNzxBoat>> updata = transportSgDwNzxBoats.stream().collect(Collectors.groupingBy(compositeKey, Collectors.toList()));
 
                             Function<TransportSgBaseNumber, List<Object>> lockDataKey = boats ->
-                                    Arrays.asList(boats.getBaseType(), boats.getBaseLine(), boats.getBaseBoatName(), boats.getBaseCompyName());
+                                    Arrays.asList(boats.getBaseType(), boats.getBaseBoatName(), boats.getBaseCompyName());
                             Map<List<Object>, List<TransportSgBaseNumber>> lockData = islocks.stream().collect(Collectors.groupingBy(lockDataKey, Collectors.toList()));
 
                             if (updata != null && updata.keySet() != null && updata.keySet().size() > 0) {
@@ -99,7 +100,7 @@ public class SIPGDataTransportController extends CommonController  {
                                     if (lockData.keySet().contains(i))    //如果过滤数据一致
                                     {
                                         List<Long> stringsFilter = updata.get(i).stream().map(TransportSgDwNzxBoat::getNzxSchPkid).collect(Collectors.toList());
-                                        stringBuilder.append("" + stringsFilter.toString() + "]");
+                                        stringBuilder.append("[" + stringsFilter.toString() + "]");
                                     } else {
                                         needSaves.addAll(updata.get(i));
                                     }
@@ -110,9 +111,13 @@ public class SIPGDataTransportController extends CommonController  {
                                 });
                                 boolean a = boatService.saveOrUpdateBatch(needSaves);
                                 if (a) {
-                                    return ReturnMsg.success("存储成功,且部分数据已锁,无法修改,无法修改的pkId列表为:" + stringBuilder.toString());
+                                    String jsonString = JSONArray.toJSONString(stringBuilder.toString());
+                                    String encodedData = resultEncode(jsonString);
+                                    return ReturnMsg.success("存储成功,且部分数据已锁,无法修改,无法修改的pkId列表为data",encodedData);
                                 } else {
-                                    return ReturnMsg.error("存储失败且部分数据已锁,无法修改,无法修改的pkId列表为:" + stringBuilder.toString());
+                                    String jsonString = JSONArray.toJSONString(stringBuilder.toString());
+                                    String encodedData = resultEncode(jsonString);
+                                    return ReturnMsg.error("存储失败且部分数据已锁,无法修改,无法修改的pkId列表为data",encodedData);
                                 }
                             }
                         }
@@ -368,7 +373,7 @@ public class SIPGDataTransportController extends CommonController  {
         //先分组
         Map<Integer,List<TransportSgBaseNumber>> listMap=new HashMap<>();
         sgBaseNumberList.stream().forEach(i->{
-            String hashKey=i.getBaseBoatName()+i.getBaseCompyName()+i.getBaseLine()+i.getBaseType();
+            String hashKey=i.getBaseBoatName()+i.getBaseCompyName()+i.getBaseType();
             List<TransportSgBaseNumber> baseNumbers= listMap.get(hashKey.hashCode());
             if (baseNumbers!=null && baseNumbers.size()>0) {
                 baseNumbers.add(i);

+ 6 - 6
ghjg-item-datashare-server/src/main/resources/mapper/TransportSgBaseNumberMapper.xml

@@ -5,19 +5,19 @@
 
 
     <select id="getAllForCountData" resultType="com.shanghaichengdi.ghjgitem.domain.TransportSgBaseNumber">
-        select boat.nzx_agent baseCompyName,boat.nzx_vslcnname baseBoatName,boat.nzx_type baseType,boat.nzx_line baseLine,con.NZC_CSIZECD column1,con.nzc_effg column2,count(con.nzc_pkid) column3 from
+        select boat.nzx_agent baseCompyName,boat.nzx_vslcnname baseBoatName,boat.nzx_type baseType,con.NZC_CSIZECD column1,con.nzc_effg column2,count(con.nzc_pkid) column3 from
         ghjg_port_manage.TRANSPORT_SG_DW_NZX_CONTAINERS con
         left join  ghjg_port_manage.TRANSPORT_SG_DW_NZX_BOAT boat on boat.nzx_sch_pkid=con.NZC_NZX_SCH_PKID
         where
         boat.NZX_AENDTM &gt;= #{startTime}
         and
         boat.NZX_AENDTM &lt;= #{endTime}
-        group by boat.nzx_agent,boat.nzx_vslcnname,boat.nzx_type,boat.nzx_line,con.nzc_effg,con.NZC_CSIZECD
-        order by boat.nzx_vslcnname,boat.nzx_type,boat.nzx_line,con.nzc_effg,con.NZC_CSIZECD
+        group by boat.nzx_agent,boat.nzx_vslcnname,boat.nzx_type,con.nzc_effg,con.NZC_CSIZECD
+        order by boat.nzx_vslcnname,boat.nzx_type,con.nzc_effg,con.NZC_CSIZECD
     </select>
     <select id="getAllForCountDataForUpdate"
             resultType="com.shanghaichengdi.ghjgitem.domain.TransportSgBaseNumber">
-            select boat.nzx_agent baseCompyName,boat.nzx_vslcnname baseBoatName,boat.nzx_type baseType,boat.nzx_line baseLine,con.NZC_CSIZECD column1,con.nzc_effg column2,count(con.nzc_pkid) column3 from
+            select boat.nzx_agent baseCompyName,boat.nzx_vslcnname baseBoatName,boat.nzx_type baseType,con.NZC_CSIZECD column1,con.nzc_effg column2,count(con.nzc_pkid) column3 from
         ghjg_port_manage.TRANSPORT_SG_DW_NZX_CONTAINERS con
         left join  ghjg_port_manage.TRANSPORT_SG_DW_NZX_BOAT boat on boat.nzx_sch_pkid=con.NZC_NZX_SCH_PKID
         where
@@ -25,8 +25,8 @@
         and
         boat.NZX_AENDTM &lt;= #{endTime}
         and boat.trans_update=1
-        group by boat.nzx_agent,boat.nzx_vslcnname,boat.nzx_type,boat.nzx_line,con.nzc_effg,con.NZC_CSIZECD
-        order by boat.nzx_vslcnname,boat.nzx_type,boat.nzx_line,con.nzc_effg,con.NZC_CSIZECD
+        group by boat.nzx_agent,boat.nzx_vslcnname,boat.nzx_type,con.nzc_effg,con.NZC_CSIZECD
+        order by boat.nzx_vslcnname,boat.nzx_type,con.nzc_effg,con.NZC_CSIZECD
     </select>
 
 </mapper>