Parcourir la source

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU1/DAL-DAZHOU-BMSTRUCK-API

luobang il y a 2 ans
Parent
commit
58f420221d

+ 74 - 6
src/main/java/com/steerinfo/dil/controller/BmstruckDetailsOrderController.java

@@ -1,7 +1,9 @@
 package com.steerinfo.dil.controller;
 
 import com.github.pagehelper.PageHelper;
+import com.steerinfo.dil.feign.ColumnDataFeign;
 import com.steerinfo.dil.feign.ESFeign;
+import com.steerinfo.dil.mapper.BmstruckDetailsOrderMapper;
 import com.steerinfo.dil.service.impl.BmstruckDetailsOrderServiceImpl;
 import com.steerinfo.dil.util.BaseRESTfulController;
 import com.steerinfo.dil.util.ColumnDataUtil;
@@ -18,9 +20,7 @@ import org.springframework.web.bind.annotation.*;
 
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * @Description:
@@ -38,6 +38,10 @@ public class BmstruckDetailsOrderController extends BaseRESTfulController {
     ColumnDataUtil columnDataUtil;
     @Autowired
     ESFeign esFeign;
+    @Autowired
+    ColumnDataFeign columnDataFeign;
+    @Autowired
+    BmstruckDetailsOrderMapper bmstruckDetailsOrderMapper;
 
     private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
     /**
@@ -116,6 +120,20 @@ public class BmstruckDetailsOrderController extends BaseRESTfulController {
         PageHelper.startPage(pageNum, pageSize);
         //分页查询数据
         List<Map<String, Object>> columnList = bmstruckDetailsOrderService.getUnFinishedTruckDetailsOrderList(mapValue, orderType);
+        for (Map<String, Object> objectMap : columnList) {
+            String priceids = (String) objectMap.get("priceids");
+            if (priceids!=null&&"".equals(priceids)){
+                String[] split = priceids.split(",");
+                String address1="";
+                for (String s : split) {
+                    //查询出运输订单的行
+                    Map<String, Object> queryaddress = bmstruckDetailsOrderMapper.queryaddress(new BigDecimal(s));
+                    String address = bmstruckDetailsOrderMapper.queryaddress1((BigDecimal) queryaddress.get("placeid"));
+                    address1+=address+",";
+                }
+                objectMap.put("realAddress",address1);
+            }
+        }
         PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList);
         return success(data);
     }
@@ -385,12 +403,49 @@ public class BmstruckDetailsOrderController extends BaseRESTfulController {
             mapValue.put("carrierId",carrierId);
         }
         if (con != null && !"null".equals(con)){
-            mapValue.put("con","%" + "%");
+            mapValue.put("con","%" +con+ "%");
         }
         PageHelper.startPage(pageNum, pageSize);
         List<Map<String, Object>> columnList = bmstruckDetailsOrderService.getSteelTruckDetailsOrder(mapValue);
-        PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList);
-        return success(data);
+        //查询多条数据
+        for (Map<String, Object> objectMap : columnList) {
+            String priceids = (String) objectMap.get("priceids");
+            if (priceids!=null&&!("".equals(priceids))){
+                String[] split = priceids.split(",");
+                String address1="";
+                for (String s : split) {
+                    //查询出运输订单的行
+                    Map<String, Object> queryaddress = bmstruckDetailsOrderMapper.queryaddress(new BigDecimal(s));
+                    String address = bmstruckDetailsOrderMapper.queryaddress1((BigDecimal) queryaddress.get("placeid"));
+                    address1+=address+",";
+                }
+                objectMap.put("realAddress",address1);
+            }
+        }
+        List<Map<String, Object>> columnDataList = columnDataFeign.getColumnData(apiId);
+        int i=0;
+        for (Map<String, Object> columnData : columnDataList) {
+            //每个表头字段的过滤条件
+            columnData.put("filters", setListMap(columnList,columnData.get("prop").toString()));
+            if (i==1){
+                columnData.put("min-width","83px");
+            }else if (i==2){
+                columnData.put("min-width","207px");
+            }else if (i==5){
+                columnData.put("min-width","101px");
+            }else if (i==8){
+                columnData.put("min-width","184px");
+            }else if (i==10){
+                columnData.put("min-width","242px");
+            }else if (i==15){
+                columnData.put("min-width","228px");
+            }
+            i++;
+        }
+        PageListAdd pageList = new PageListAdd(columnList);
+        pageList.setColumnData(columnDataList);
+        //PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList);
+        return success(pageList);
     }
 
     @ApiOperation("根据运输订单ID查询计重结算需要的信息")
@@ -405,4 +460,17 @@ public class BmstruckDetailsOrderController extends BaseRESTfulController {
 
 
 
+    private Set<Map<String, Object>> setListMap(List<Map<String, Object>> list, String name) {
+        Set<Map<String, Object>> setString = new HashSet<>();
+        for (Map<String, Object> map : list) {//遍历每条数据
+            Map<String, Object> map1 = new HashMap<>();
+            //map.get(name)获取每条数据中对应表头字段的数据
+            map1.put("text", map.get(name));
+            if (map.get(name) != null) {
+                map1.put("value", map.get(name));
+                setString.add(map1);
+            }
+        }
+        return setString;
+    }
 }

+ 14 - 0
src/main/java/com/steerinfo/dil/mapper/BmstruckDetailsOrderMapper.java

@@ -154,6 +154,20 @@ public interface BmstruckDetailsOrderMapper extends IBaseMapper<BmstruckDetailsO
 
     List<Map<String, Object>> getSteelTruckDetailsOrder(Map<String, Object> mapValue);
 
+    /**
+     * @author:zyf
+     * @version:1.0
+     * @Date:
+     * @Description: 查找出priceID
+    */
+    Map<String,Object> queryaddress(BigDecimal s);
+    /**
+     * @author:zyf
+     * @version:1.0
+     * @Date:
+     * @Description:查询出收货地址
+    */
+    String queryaddress1(BigDecimal priceid);
     Integer selectDetailsByOrder(BigDecimal orderId);
 
     List<BigDecimal> getDetailsIdByOrderId(Integer orderId);

+ 2 - 0
src/main/java/com/steerinfo/dil/mapper/OmstruckOrderMapper.java

@@ -5,8 +5,10 @@ import com.steerinfo.framework.mapper.IBaseMapper;
 import org.apache.ibatis.annotations.Mapper;
 
 import java.math.BigDecimal;
+import java.util.Date;
 
 @Mapper
 public interface OmstruckOrderMapper extends IBaseMapper<OmstruckOrder, BigDecimal> {
 
+    public void modifyOldTime(BigDecimal bigDecimal, Date date);
 }

+ 14 - 0
src/main/java/com/steerinfo/dil/model/BmstruckDetailsOrder.java

@@ -99,6 +99,20 @@ public class BmstruckDetailsOrder implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="订单ID",required=false)
     private BigDecimal orderId;
 
+    /**
+     *单价IDS(用于保存多条数据)
+     */
+    @ApiModelProperty(value="单价IDS",required=false)
+    private String priceids;
+
+    public String getPriceids() {
+        return priceids;
+    }
+
+    public void setPriceids(String priceids) {
+        this.priceids = priceids;
+    }
+
     private static final long serialVersionUID = 1L;
 
     @Override

+ 10 - 0
src/main/java/com/steerinfo/dil/service/impl/BmstruckDetailsOrderServiceImpl.java

@@ -488,6 +488,8 @@ public class BmstruckDetailsOrderServiceImpl implements IBmstruckDetailsOrderSer
         BigDecimal detailsId = DataChange.dataToBigDecimal(mapValue.get("detailsId"));
         BmstruckDetailsOrder bmstruckDetailsOrder = bmstruckDetailsOrderMapper.selectByPrimaryKey(detailsId);
         // 重新设置单价
+        BigDecimal priceId1 = bmstruckDetailsOrder.getPriceId();
+        bmstruckDetailsOrder.setPriceids(priceId1+","+priceId);
         bmstruckDetailsOrder.setPriceId(priceId);
         BigDecimal weightTaskResultId = bmstruckDetailsOrder.getWeightTaskResultId();
         BigDecimal orderId = bmstruckDetailsOrderMapper.getOrderId(weightTaskResultId);
@@ -502,6 +504,12 @@ public class BmstruckDetailsOrderServiceImpl implements IBmstruckDetailsOrderSer
         } catch (Exception e) {
             e.printStackTrace();
         }
+        try{
+            //修改计量表的历史时间
+            omstruckOrderMapper.modifyOldTime(priceId,new Date());
+        }catch (Exception e){
+            System.out.println("更新历史时间失败");
+        }
         int result = bmstruckDetailsOrderMapper.updateByPrimaryKeySelective(bmstruckDetailsOrder);
         return result;
     }
@@ -790,4 +798,6 @@ public class BmstruckDetailsOrderServiceImpl implements IBmstruckDetailsOrderSer
         }
         return count;
     }
+
+
 }

+ 141 - 3
src/main/resources/com/steerinfo/dil/mapper/BmstruckDetailsOrderMapper.xml

@@ -17,6 +17,7 @@
         <result column="WETHER_TO_STATEMENT" jdbcType="DECIMAL" property="wetherToStatement" />
         <result column="EAS_AMOUNT" jdbcType="DECIMAL" property="easAmount" />
         <result column="ORDER_ID" jdbcType="DECIMAL" property="orderId" />
+        <result column="PRICEIDS" jdbcType="VARCHAR" property="priceids"/>
     </resultMap>
     <sql id="columns">
         DETAILS_ID, PURCHASE_ORDER_ID, WEIGHT_TASK_RESULT_ID, DETAILS_NO, DETAILS_TIME, PRICE_ID, 
@@ -356,6 +357,9 @@
             <if test="orderId != null">
                 ORDER_ID = #{orderId,jdbcType=DECIMAL},
             </if>
+            <if test="priceids !=null">
+                PRICEIDS = #{priceids,jdbcType=VARCHAR}
+            </if>
         </set>
         where DETAILS_ID = #{detailsId,jdbcType=DECIMAL}
     </update>
@@ -601,7 +605,8 @@
         rtcg.TRUCK_CALCULATE_NUMBER as "grossCalculateNumber",
         tlfr.RESULT_OUT_GATE_TIME as "resultOutGateTime",
         rgl.GATEPOST_NAME as "leaveGatepostName",
-        twr.RESULT_NET_WEIGHT as "resultNetWeight"
+        twr.RESULT_NET_WEIGHT as "resultNetWeight",
+        bdo.PRICEIDS as "priceids"
         FROM BMSTRUCK_DETAILS_ORDER bdo
         LEFT JOIN TMSTRUCK_WEIGHT_RESULT twr
         ON twr.WEIGHT_TASK_RESULT_ID = bdo.WEIGHT_TASK_RESULT_ID
@@ -1984,7 +1989,9 @@
                         ASM.MATERIAL_WEIGHT "theoryWeight",
                         rsa.area_name "areaName",
                         aso.sale_order_receive_customer "receiveMoneyCus",
-                        ASM.EAS_PRIMARY_ID "easPrimaryId"
+                        ASM.EAS_PRIMARY_ID "easPrimaryId",
+                        oo.ORDER_ISSUE_TIME "orderissuetime",
+                        bdo.PRICEIDS  "priceids"
                         FROM
                         BMSTRUCK_DETAILS_ORDER bdo
                         JOIN TMSTRUCK_WEIGHT_RESULT twr ON twr.WEIGHT_TASK_RESULT_ID = bdo.WEIGHT_TASK_RESULT_ID
@@ -2010,6 +2017,12 @@
                         WHERE
                         oo.ORDER_TYPE = 1
                         AND bdo.WETHER_TO_STATEMENT = 0
+                        <if test="con !=null">
+                            and rc.capacity_number||rco.consignee_company_name
+                            ||RC2.Carrier_Abbreviation||RRA.ADDRESS_PROVINCE
+                            || RRA.ADDRESS_DISTRICT ||RRA.ADDRESS_TOWN
+                            || RRP.ADDRESS_DELIVERY_ADDRESS||rsa.area_name like #{con}
+                        </if>
                          <if test="carrierId != null">
                              and RC2.CARRIER_ID = #{carrierId}
                          </if>
@@ -2022,6 +2035,117 @@
                         </if>
                         order by oo.order_id desc
             )
+            <where>
+                <if test="preparationDate!= null">
+                    and
+                    <foreach collection="preparationDate" item="item" open="(" separator="or" close=")">
+                        to_char("preparationDate",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
+                    </foreach>
+                </if>
+            <if test="carrierName!= null">
+                and
+                <foreach collection="carrierName" item="item" open="(" separator="or" close=")">
+                "carrierName" like '%${item}%'
+                </foreach>
+            </if>
+                <if test="capacityNumber!= null">
+                    and
+                    <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
+                        "capacityNumber" like '%${item}%'
+                    </foreach>
+                </if>
+                <if test="realAddress!= null">
+                    and
+                    <foreach collection="realAddress" item="item" open="(" separator="or" close=")">
+                        "realAddress" like '%${item}%'
+                    </foreach>
+                </if>
+                <if test="companyName!= null">
+                    and
+                    <foreach collection="companyName" item="item" open="(" separator="or" close=")">
+                        "companyName" like '%${item}%'
+                    </foreach>
+                </if>
+                <if test="priceValue!= null">
+                    and
+                    <foreach collection="priceValue" item="item" open="(" separator="or" close=")">
+                        "priceValue" like '%${item}%'
+                    </foreach>
+                </if>
+                <if test="detailsAmount!= null">
+                    and
+                    <foreach collection="detailsAmount" item="item" open="(" separator="or" close=")">
+                        "detailsAmount" like '%${item}%'
+                    </foreach>
+                </if>
+                <if test="companyName!= null">
+                    and
+                    <foreach collection="companyName" item="item" open="(" separator="or" close=")">
+                        "companyName" like '%${item}%'
+                    </foreach>
+                </if>
+                <if test="materialName!= null">
+                    and
+                    <foreach collection="materialName" item="item" open="(" separator="or" close=")">
+                        "materialName" like '%${item}%'
+                    </foreach>
+                </if>
+                <if test="materialSpa!= null">
+                    and
+                    <foreach collection="materialSpa" item="item" open="(" separator="or" close=")">
+                        "materialSpa" like '%${item}%'
+                    </foreach>
+                </if>
+                <if test="materialNum!= null">
+                    and
+                    <foreach collection="materialNum" item="item" open="(" separator="or" close=")">
+                        "materialNum" like '%${item}%'
+                    </foreach>
+                </if>
+                <if test="theoryWeight!= null">
+                    and
+                    <foreach collection="theoryWeight" item="item" open="(" separator="or" close=")">
+                        "theoryWeight" like '%${item}%'
+                    </foreach>
+                </if>
+                <if test="resultNetWeight!= null">
+                    and
+                    <foreach collection="resultNetWeight" item="item" open="(" separator="or" close=")">
+                        "resultNetWeight" like '%${item}%'
+                    </foreach>
+                </if>
+                <if test="saleRemark!= null">
+                    and
+                    <foreach collection="saleRemark" item="item" open="(" separator="or" close=")">
+                        "saleRemark" like '%${item}%'
+                    </foreach>
+                </if>
+                <if test="areaName!= null">
+                and
+                <foreach collection="areaName" item="item" open="(" separator="or" close=")">
+                    "areaName" like '%${item}%'
+                </foreach>
+                </if>
+                <if test="easPrimaryId!= null">
+                    and
+                    <foreach collection="easPrimaryId" item="item" open="(" separator="or" close=")">
+                        "easPrimaryId" like '%${item}%'
+                    </foreach>
+                </if>
+                <if test="receiveMoneyCus!= null">
+                    and
+                    <foreach collection="receiveMoneyCus" item="item" open="(" separator="or" close=")">
+                        "receiveMoneyCus" like '%${item}%'
+                    </foreach>
+                </if>
+                <if test="orderissuetime!= null">
+                    and
+                    <foreach collection="orderissuetime" item="item" open="(" separator="or" close=")">
+                        "orderissuetime" like '%${item}%'
+                    </foreach>
+                </if>
+            </where>
+        <include refid="orderBy"></include>
     </select>
     <select id="selectDetailsByOrder" resultType="java.lang.Integer" parameterType="decimal">
         SELECT count(BDO.DETAILS_ID) FROM BMSTRUCK_DETAILS_ORDER BDO
@@ -2030,7 +2154,6 @@
     <select id="getDetailsIdByOrderId" resultType="java.math.BigDecimal" parameterType="java.lang.Integer">
         SELECT BDO.DETAILS_ID FROM BMSTRUCK_DETAILS_ORDER BDO
         WHERE
-
         BDO.ORDER_ID = #{orderId}
     </select>
     <select id="selectNetWeight" resultType="java.math.BigDecimal" parameterType="decimal">
@@ -2040,4 +2163,19 @@
         WHERE TTR.ORDER_ID = #{orderId}
     </select>
 
+    <select id="queryaddress" resultType="java.util.Map">
+        select t.place_id "placeid"
+        from AMS_CONTRACT_TRANSPORT_PRICE t
+        where t.price_id=#{s}
+    </select>
+    <select id="queryaddress1" resultType="String">
+        select distinct
+        RRA.ADDRESS_PROVINCE || RRA.ADDRESS_DISTRICT ||
+        RRA.ADDRESS_TOWN || RRP.ADDRESS_DELIVERY_ADDRESS AS "realAddress"
+        from AMS_CONTRACT_TRANSPORT_PRICE t
+        left join RMS_RECEIVE_PLACE RRP
+        on RRP.PLACE_ID=#{priceid}
+        left join RMS_RECEIVE_ADDRESS RRA
+        on RRA.ADDRESS_ID=RRP.ADDRESS_ID
+    </select>
 </mapper>

+ 6 - 0
src/main/resources/com/steerinfo/dil/mapper/OmstruckOrderMapper.xml

@@ -679,5 +679,11 @@
     <!-- 友情提示!!!-->
     <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
 
+    <!--修改单价的历史时间-->
+    <update id="modifyOldTime">
+        update AMS_CONTRACT_TRANSPORT_PRICE t
+        set t.OLD_DATE=#{date}
+        where t.PRICE_ID=#{bigDecimal}
+    </update>
 
 </mapper>