Просмотр исходного кода

承运订单-分包托运列表查询-多条件查询
承运订单/托运订单-自建订单根据原型说明修改接口设计

lengfaqiang 2 лет назад
Родитель
Сommit
c555e74776

+ 95 - 2
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/utils/DateUtil.java

@@ -1,6 +1,7 @@
 package com.sckw.excel.utils;
 
 
+import com.sckw.core.exception.BusinessException;
 import com.sckw.core.utils.StringUtils;
 
 import java.text.ParseException;
@@ -42,6 +43,7 @@ public class DateUtil {
 
     /**
      * 2023-07-14T09:43:40.511+00:00 -> 2023-07-14 09:13:40
+     *
      * @param date
      * @return
      */
@@ -54,11 +56,12 @@ public class DateUtil {
 
     /**
      * data
-     * @param date  Date 时间
+     *
+     * @param date Date 时间
      * @return
      * @throws ParseException
      */
-    public static String dateTimeFormatter(Date date){
+    public static String dateTimeFormatter(Date date) {
         String format = new SimpleDateFormat(DEFAULT_DATE_PATTERN).format(date);
         return format;
     }
@@ -120,6 +123,80 @@ public class DateUtil {
         return LocalDate.parse(str, DateTimeFormatter.ofPattern("yyyyMMdd"));
     }
 
+
+    /**
+     * @param time yyyy-MM-dd
+     * @return String yyyy-MM-dd HH:mm:ss
+     * @throws RuntimeException
+     */
+    public static String fillStart(String time) {
+        formatCheck(time);
+        return time + " 00:00:00";
+    }
+
+    @SuppressWarnings("all")
+    private static void formatCheck(String time) {
+        try {
+            LocalDate.parse(time, YYYY_MM_DD);
+        } catch (Exception e) {
+            throw new BusinessException("时间格式化错误!");
+        }
+    }
+
+    /**
+     * yyyy-MM-dd 转换成 Date
+     *
+     * @param str
+     * @return
+     */
+    public static Date stringToDateTime(String str) {
+        SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat(DEFAULT_DATE_PATTERN);
+        Date date = null;
+        try {
+            date = simpleDateFormat1.parse(str);
+        } catch (ParseException e) {
+            throw new RuntimeException(e);
+        }
+        return date;
+    }
+
+    /**
+     * yyyy-MM-dd 转换成 Date
+     *
+     * @param str
+     * @return
+     */
+    public static Date stringPatchingStartToDateTime(String str) {
+        str = str + " 00:00:00";
+        SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat(DEFAULT_DATE_PATTERN);
+        Date date = null;
+        try {
+            date = simpleDateFormat1.parse(str);
+        } catch (ParseException e) {
+            throw new RuntimeException(e);
+        }
+        return date;
+    }
+
+    /**
+     * yyyy-MM-dd 转换成 Date
+     *
+     * @param str
+     * @return
+     */
+    public static Date stringPatchingEndToDateTime(String str) {
+        str = str + " 23:59:59";
+        SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat(DEFAULT_DATE_PATTERN);
+        Date date = null;
+        try {
+            date = simpleDateFormat1.parse(str);
+        } catch (ParseException e) {
+            throw new RuntimeException(e);
+        }
+        return date;
+    }
+
+
     /**
      * 日期字符串转换为LocalDateTime方法
      *
@@ -266,6 +343,14 @@ public class DateUtil {
         return Duration.between(startDateLocalDateTime, endDateLocalDateTime);
     }
 
+    /**
+     * 自定义 字符串转date
+     *
+     * @param dateStr
+     * @param pattern
+     * @return
+     * @throws ParseException
+     */
     public static Date strToDate(String dateStr, String pattern) throws ParseException {
         SimpleDateFormat dateFormat = new SimpleDateFormat();
         if (pattern != null && !pattern.isEmpty()) {
@@ -276,6 +361,14 @@ public class DateUtil {
         return date;
     }
 
+    public static void main(String[] args) {
+        String s = "2023-12-12";
+        Date date = DateUtil.stringPatchingStartToDateTime(s);
+        Date date1 = DateUtil.stringPatchingEndToDateTime(s);
+        System.out.println(date);
+        System.out.println(date1);
+    }
+
     public static int getCurrentMonthDays() {
         Calendar calendar = Calendar.getInstance();
         calendar.set(5, 1);

+ 3 - 3
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/AcceptCarriageOrderController.java

@@ -152,17 +152,17 @@ public class AcceptCarriageOrderController {
     /**
      * 承运订单-获取分包托运列表
      *
-     * @param lOrderId 单据id
+     * @param lOrderIds 单据id
      * @param page
      * @param pageSize
      * @return
      */
     @RequestMapping(value = "/getSubcontractConsignment", method = RequestMethod.GET)
-    public HttpResult getSubcontractConsignment(@RequestParam("lOrderId") @NotBlank(message = "单据id不能为空") String lOrderId,
+    public HttpResult getSubcontractConsignment(@RequestParam("lOrderIds") @NotBlank(message = "单据id不能为空") String lOrderIds,
                                                 @RequestParam("page") @NotNull(message = "分页不能为空") int page,
                                                 @RequestParam("pageSize") @NotNull(message = "分页条数不能为空") int pageSize) {
         try {
-            return acceptCarriageOrderService.getSubcontractConsignment(lOrderId, page, pageSize);
+            return acceptCarriageOrderService.getSubcontractConsignment(lOrderIds, page, pageSize);
         } catch (Exception e) {
             log.error("承运订单-获取分包托运列表 error:{}", e.getMessage(), e);
             return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());

+ 5 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwtLogisticsOrderMapper.java

@@ -107,6 +107,11 @@ public interface KwtLogisticsOrderMapper extends BaseMapper<KwtLogisticsOrder> {
      */
     List<SubcontractConsignmentVO> getSubcontractConsignmentNotPage(@Param("lOrderId") String lOrderId);
 
+    /**
+     *
+     * @param lOrderId
+     * @return
+     */
     List<Map> countSubcontractConsignmentById(@Param("lOrderId") String lOrderId);
 
     /**

+ 4 - 12
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/AddOrderDTO.java

@@ -1,5 +1,6 @@
 package com.sckw.transport.model.dto;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import jakarta.validation.constraints.*;
 import lombok.Data;
 import org.hibernate.validator.constraints.Length;
@@ -66,17 +67,6 @@ public class AddOrderDTO {
     @NotNull(message = "货物名称不能为空")
     private String goodsName;
 
-    /**
-     * 货物id
-     */
-    @NotNull(message = "货物id不能为空")
-    private String goodsId;
-
-    /**
-     * skuId
-     */
-    private String skuId;
-
     /**
      * 计费方式
      */
@@ -102,7 +92,7 @@ public class AddOrderDTO {
      */
     @NotNull(message = "运价方式不能为空")
     @Min(value = 0, message = "必须大于等于{value}")
-    @Max(value = 4, message = "必须小于等于{value}")
+    @Max(value = 6, message = "必须小于等于{value}")
     private Long priceType;
 
     /**
@@ -162,12 +152,14 @@ public class AddOrderDTO {
      * 计划卸货时间
      */
     @NotBlank(message = "计划卸货时间不能为空")
+    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
     private String endTime;
 
     /**
      * 计划发货时间
      */
     @NotBlank(message = "计划发货时间不能为空")
+    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
     private String startTime;
 
     /**

+ 6 - 9
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/param/LogisticsConsignmentParam.java

@@ -8,9 +8,6 @@ import jakarta.validation.constraints.NotNull;
 import lombok.Data;
 import lombok.experimental.Accessors;
 import org.hibernate.validator.constraints.Length;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.util.Date;
 
 /**
  * @author lfdc
@@ -187,16 +184,16 @@ public class LogisticsConsignmentParam {
      * 计划卸货时间
      */
     @NotNull(message = "计划卸货时间不能为空")
-    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date receiveGoodsDateTime;
+    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
+//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private String receiveGoodsDateTime;
     /**
      * 计划发货时间
      */
     @NotNull(message = "计划发货时间不能为空")
-    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date shipmentsDateTime;
+    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
+//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private String shipmentsDateTime;
     /**
      * 税率
      */

+ 48 - 41
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/AcceptCarriageOrderService.java

@@ -657,7 +657,7 @@ public class AcceptCarriageOrderService {
             orderTrack.setUpdateBy(LoginUserHolder.getUserId());
             orderTrack.setUpdateTime(new Date());
             logisticsOrderTrackMapper.insert(orderTrack);
-        }else {
+        } else {
             track.setRemark(orderDTO.getRemark());
             track.setUpdateTime(new Date());
             track.setUpdateBy(LoginUserHolder.getUserId());
@@ -699,15 +699,16 @@ public class AcceptCarriageOrderService {
     /**
      * 获取承运订单-分包托运列表数据
      *
-     * @param lOrderId
-     * @param page
-     * @param pageSize
+     * @param lOrderIds 物流订单主键id
+     * @param page      当前页
+     * @param pageSize  每页条数
      * @return
      */
-    public HttpResult getSubcontractConsignment(String lOrderId, Integer page, Integer pageSize) {
-        Integer newPage = page - 1;
-        List<SubcontractConsignmentVO> list = logisticsOrderMapper.getSubcontractConsignment(lOrderId, newPage, pageSize);
-        //联查数据
+    public HttpResult getSubcontractConsignment(String lOrderIds, Integer page, Integer pageSize) {
+        List<String> stringList = StringUtils.splitStrToList(lOrderIds, String.class);
+        if (CollectionUtils.isEmpty(stringList)) {
+            return HttpResult.ok();
+        }
         /**运价方式*/
         Map<String, String> priceDictData = getDictData(DictTypeEnum.PRICE_TYPE.getType());
         /**车载计算方式*/
@@ -718,19 +719,26 @@ public class AcceptCarriageOrderService {
         Map<String, String> chargingDictData = getDictData(DictTypeEnum.CHARGING_TYPE.getType());
         /**结算周期*/
         Map<String, String> settlementDictData = getDictData(DictTypeEnum.SETTLEMENT_CYCLE.getType());
-        if (CollectionUtils.isNotEmpty(list)) {
-            for (SubcontractConsignmentVO subcontractConsignmentVO : list) {
-                subcontractConsignmentVO.setStatusLabel(CarWaybillEnum.getWaybillOrderDestination(subcontractConsignmentVO.getStatus()));
-                subcontractConsignmentVO.setPriceType(priceDictData == null ? null : priceDictData.get(subcontractConsignmentVO.getPriceType()));
-                subcontractConsignmentVO.setLossUnit(weightDictData == null ? null : weightDictData.get(subcontractConsignmentVO.getLossUnit()));
-                subcontractConsignmentVO.setGoodsPriceUnit(priceDictData == null ? null : priceDictData.get(subcontractConsignmentVO.getGoodsPriceUnit()));
-                //分包托运不需要展示签约方式
+        List<SubcontractConsignmentVO> allList = new ArrayList<>();
+        for (String lOrderId : stringList) {
+            List<SubcontractConsignmentVO> list = logisticsOrderMapper.getSubcontractConsignmentNotPage(lOrderId);
+            //联查数据
+            if (CollectionUtils.isNotEmpty(list)) {
+                for (SubcontractConsignmentVO subcontractConsignmentVO : list) {
+                    subcontractConsignmentVO.setStatusLabel(CarWaybillEnum.getWaybillOrderDestination(subcontractConsignmentVO.getStatus()));
+                    subcontractConsignmentVO.setPriceType(priceDictData == null ? null : priceDictData.get(subcontractConsignmentVO.getPriceType()));
+                    subcontractConsignmentVO.setLossUnit(weightDictData == null ? null : weightDictData.get(subcontractConsignmentVO.getLossUnit()));
+                    subcontractConsignmentVO.setGoodsPriceUnit(priceDictData == null ? null : priceDictData.get(subcontractConsignmentVO.getGoodsPriceUnit()));
+                    //分包托运不需要展示签约方式
 //                subcontractConsignmentVO.setContractSigningWay(singDictData == null ? null : singDictData.get(subcontractConsignmentVO.getContractSigningWay()));
-                subcontractConsignmentVO.setBillingMode(chargingDictData == null ? null : chargingDictData.get(subcontractConsignmentVO.getBillingMode()));
-                subcontractConsignmentVO.setSettlementCycle(settlementDictData == null ? null : settlementDictData.get(subcontractConsignmentVO.getSettlementCycle()));
+                    subcontractConsignmentVO.setBillingMode(chargingDictData == null ? null : chargingDictData.get(subcontractConsignmentVO.getBillingMode()));
+                    subcontractConsignmentVO.setSettlementCycle(settlementDictData == null ? null : settlementDictData.get(subcontractConsignmentVO.getSettlementCycle()));
+                }
+                allList.addAll(list);
             }
         }
-        PageResult build = PageResult.build(page, pageSize, list.stream().count(), list);
+        List<SubcontractConsignmentVO> returnList = allList.stream().skip((page - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
+        PageResult build = PageResult.build(page, pageSize, allList.stream().count(), returnList);
         return HttpResult.ok(build);
     }
 
@@ -1230,19 +1238,20 @@ public class AcceptCarriageOrderService {
             log.info("承运订单创建订单异常");
             throw new RuntimeException("自建订单异常");
         }
-        /**获取商品信息*/
-        KwpGoods goods = goodsInfoService.getGoodsById(Long.parseLong(orderDTO.getGoodsId()));
-        if (goods == null) {
-            log.info("自建订单获取商品信息失败 商品id:{},商品名称:{}", orderDTO.getGoodsId(), orderDTO.getGoodsName());
-            throw new BusinessException("商品信息获取失败");
-        }
+        /**2023-08-04 自建订单商品可以不需要关联查询*/
+//        /**获取商品信息*/
+//        KwpGoods goods = goodsInfoService.getGoodsById(Long.parseLong(orderDTO.getGoodsId()));
+//        if (goods == null) {
+//            log.info("自建订单获取商品信息失败 商品id:{},商品名称:{}", orderDTO.getGoodsId(), orderDTO.getGoodsName());
+//            throw new BusinessException("商品信息获取失败");
+//        }
         saveLogisticsOrder(orderDTO, lOrderId, orderStatus, lOrderNo);
         saveLogisticsOrderAddress(orderDTO, lOrderId);
-        saveLogisticsOrderGoods(orderDTO, lOrderId, lOrderNo, goods);
+        saveLogisticsOrderGoods(orderDTO, lOrderId, lOrderNo);
         saveLogisticsOrderContract(orderDTO, lOrderId);
         saveLogisticsOrderTrack(lOrderId, orderStatus);
         saveLogisticsOrderUnit(orderDTO, lOrderId);
-        saveMongoDb(orderDTO, orderStatus, lOrderId, lOrderNo, infoResDto, goods);
+        saveMongoDb(orderDTO, orderStatus, lOrderId, lOrderNo, infoResDto);
         return HttpResult.ok();
     }
 
@@ -1252,16 +1261,15 @@ public class AcceptCarriageOrderService {
      * @param orderDTO 页面参数
      * @param lOrderId 订单id
      * @param lOrderNo 订单编号
-     * @param kwpGoods 商品信息
      */
-    private void saveLogisticsOrderGoods(AddOrderDTO orderDTO, Long lOrderId, String lOrderNo, KwpGoods kwpGoods) {
+    private void saveLogisticsOrderGoods(AddOrderDTO orderDTO, Long lOrderId, String lOrderNo) {
         KwtLogisticsOrderGoods goods = new KwtLogisticsOrderGoods();
         goods.setId(new IdWorker(NumberConstant.ONE).nextId());
         goods.setLOrderId(lOrderId);
         goods.setLOrderNo(lOrderNo);
-        goods.setGoodsId(Long.parseLong(orderDTO.getGoodsId()));
-        goods.setGoodsName(kwpGoods.getName());
-        goods.setStatus(kwpGoods.getStatus());
+//        goods.setGoodsId();
+        goods.setGoodsName(orderDTO.getGoodsName());
+        goods.setStatus(NumberConstant.ZERO);
         goods.setCreateBy(LoginUserHolder.getUserId());
         goods.setCreateTime(new Date());
         goods.setUpdateBy(LoginUserHolder.getUserId());
@@ -1300,9 +1308,8 @@ public class AcceptCarriageOrderService {
      * @param lOrderId    主体订单id
      * @param lOrderNo    主体订单编号
      * @param infoResDto  合同信息
-     * @param goods       商品信息
      */
-    private void saveMongoDb(AddOrderDTO orderDTO, Integer orderStatus, Long lOrderId, String lOrderNo, ContractCommonInfoResDto infoResDto, KwpGoods goods) {
+    private void saveMongoDb(AddOrderDTO orderDTO, Integer orderStatus, Long lOrderId, String lOrderNo, ContractCommonInfoResDto infoResDto) {
         SckwLogisticsOrder order = new SckwLogisticsOrder();
         order.set_id(lOrderId);
         order.setLOrderId(lOrderId);
@@ -1333,12 +1340,12 @@ public class AcceptCarriageOrderService {
         order.setStatus(String.valueOf(orderStatus));
         order.setEntId(LoginUserHolder.getEntId());
         order.setFirmName(LoginUserHolder.getEntName());
-        order.setGoodsId(Long.parseLong(orderDTO.getGoodsId()));
-        order.setGoodsCode(goods == null ? null : goods.getCode());
-        order.setGoodsName(goods == null ? null : goods.getName());
-        order.setGoodsType(goods == null ? null : goods.getGoodsType());
-//        order.setGoodsIndustry(goods == null ? null : goods.get);
-        order.setGoodsSpec(goods == null ? null : goods.getSpec());
+//        order.setGoodsId(Long.parseLong(orderDTO.getGoodsId()));
+//        order.setGoodsCode(goods == null ? null : goods.getCode());
+        order.setGoodsName(orderDTO.getGoodsName());
+//        order.setGoodsType(goods == null ? null : goods.getGoodsType());
+////        order.setGoodsIndustry(goods == null ? null : goods.get);
+//        order.setGoodsSpec(goods == null ? null : goods.getSpec());
         order.setContractId(orderDTO.getContractId());
         order.setContractNo(infoResDto.getContractCode());
         order.setContractName(infoResDto.getContactName());
@@ -1541,9 +1548,9 @@ public class AcceptCarriageOrderService {
         order.setGoodsPrice(orderDTO.getGoodsPrice() == null ? null : orderDTO.getGoodsPrice());
         order.setGoodsPriceUnit(orderDTO.getGoodsPriceUnit());
         order.setStartTime(org.apache.commons.lang3.StringUtils.isBlank(orderDTO.getStartTime()) ?
-                null : DateUtil.strToDate(StringTimeUtil.fillStart(orderDTO.getStartTime()), StringConstant.DEFAULT_DATE_PATTERN));
+                null : DateUtil.stringPatchingStartToDateTime(orderDTO.getStartTime()));
         order.setEndTime(org.apache.commons.lang3.StringUtils.isBlank(orderDTO.getEndTime()) ?
-                null : DateUtil.strToDate(StringTimeUtil.fillStart(orderDTO.getEndTime()), StringConstant.DEFAULT_DATE_PATTERN));
+                null : DateUtil.stringPatchingEndToDateTime(orderDTO.getEndTime()));
         BigDecimal decimal = new BigDecimal(NumberConstant.ZERO);
         order.setSubcontractAmount(decimal);
         order.setEntrustAmount(decimal);

+ 14 - 23
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/ConsignOrderService.java

@@ -12,7 +12,6 @@ import com.sckw.core.model.enums.LogisticsOrderEnum;
 import com.sckw.core.model.page.PageResult;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.IdWorker;
-import com.sckw.core.utils.StringTimeUtil;
 import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
@@ -23,7 +22,6 @@ import com.sckw.fleet.api.RemoteFleetService;
 import com.sckw.mongo.enums.BusinessTypeEnum;
 import com.sckw.mongo.model.SckwLogisticsOrder;
 import com.sckw.product.api.dubbo.GoodsInfoService;
-import com.sckw.product.api.model.KwpGoods;
 import com.sckw.stream.model.SckwBusSum;
 import com.sckw.system.api.RemoteSystemService;
 import com.sckw.system.api.model.dto.res.AreaTreeFrontResDto;
@@ -729,19 +727,13 @@ public class ConsignOrderService {
             log.info("托运订单创建订单异常");
             throw new RuntimeException("自建订单异常");
         }
-        /**获取商品信息*/
-        KwpGoods goods = goodsInfoService.getGoodsById(Long.parseLong(addOrderDTO.getGoodsId()));
-        if (goods == null) {
-            log.info("自建订单获取商品信息失败 商品id:{},商品名称:{}", addOrderDTO.getGoodsId(), addOrderDTO.getGoodsName());
-            throw new BusinessException("商品信息获取失败");
-        }
         saveConsignLogisticsOrder(addOrderDTO, lOrderId, orderStatus, lOrderNo);
         saveConsignLogisticsOrderAddress(addOrderDTO, lOrderId);
-        saveConsignLogisticsOrderGoods(addOrderDTO, lOrderId, lOrderNo, goods);
+        saveConsignLogisticsOrderGoods(addOrderDTO, lOrderId, lOrderNo);
         saveConsignLogisticsOrderContract(addOrderDTO, lOrderId);
         saveConsignLogisticsOrderTrack(lOrderId, orderStatus);
         saveConsignLogisticsOrderUnit(addOrderDTO, lOrderId);
-        saveMongoDb(addOrderDTO, orderStatus, lOrderId, lOrderNo, infoResDto, goods);
+        saveMongoDb(addOrderDTO, orderStatus, lOrderId, lOrderNo, infoResDto);
         return HttpResult.ok();
     }
 
@@ -775,14 +767,14 @@ public class ConsignOrderService {
      * @param lOrderId    订单id
      * @param lOrderNo    订单编号
      */
-    private void saveConsignLogisticsOrderGoods(AddOrderDTO addOrderDTO, Long lOrderId, String lOrderNo, KwpGoods kwpGoods) {
+    private void saveConsignLogisticsOrderGoods(AddOrderDTO addOrderDTO, Long lOrderId, String lOrderNo) {
         KwtLogisticsOrderGoods goods = new KwtLogisticsOrderGoods();
         goods.setId(new IdWorker(NumberConstant.ONE).nextId());
         goods.setLOrderId(lOrderId);
         goods.setLOrderNo(lOrderNo);
-        goods.setGoodsId(Long.parseLong(addOrderDTO.getGoodsId()));
-        goods.setGoodsName(kwpGoods.getName());
-        goods.setStatus(kwpGoods.getStatus());
+//        goods.setGoodsId(Long.parseLong(addOrderDTO.getGoodsId()));
+        goods.setGoodsName(addOrderDTO.getGoodsName());
+        goods.setStatus(NumberConstant.ZERO);
         goods.setCreateBy(LoginUserHolder.getUserId());
         goods.setCreateTime(new Date());
         goods.setUpdateBy(LoginUserHolder.getUserId());
@@ -817,9 +809,9 @@ public class ConsignOrderService {
         order.setGoodsPrice(addOrderDTO.getGoodsPrice() == null ? null : addOrderDTO.getGoodsPrice());
         order.setGoodsPriceUnit(addOrderDTO.getGoodsPriceUnit());
         order.setStartTime(org.apache.commons.lang3.StringUtils.isBlank(addOrderDTO.getStartTime()) ?
-                null : DateUtil.strToDate(StringTimeUtil.fillStart(addOrderDTO.getStartTime()), StringConstant.DEFAULT_DATE_PATTERN));
+                null : DateUtil.stringPatchingStartToDateTime(addOrderDTO.getStartTime()));
         order.setEndTime(org.apache.commons.lang3.StringUtils.isBlank(addOrderDTO.getEndTime()) ?
-                null : DateUtil.strToDate(StringTimeUtil.fillStart(addOrderDTO.getEndTime()), StringConstant.DEFAULT_DATE_PATTERN));
+                null : DateUtil.stringPatchingEndToDateTime(addOrderDTO.getEndTime()));
         BigDecimal decimal = new BigDecimal(NumberConstant.ZERO);
         order.setSubcontractAmount(decimal);
         order.setEntrustAmount(decimal);
@@ -976,9 +968,8 @@ public class ConsignOrderService {
      * @param lOrderId    主体订单id
      * @param lOrderNo    主体订单编号
      * @param infoResDto  合同信息
-     * @param goods       商品信息
      */
-    private void saveMongoDb(AddOrderDTO addOrderDTO, Integer orderStatus, Long lOrderId, String lOrderNo, ContractCommonInfoResDto infoResDto, KwpGoods goods) {
+    private void saveMongoDb(AddOrderDTO addOrderDTO, Integer orderStatus, Long lOrderId, String lOrderNo, ContractCommonInfoResDto infoResDto) {
         SckwLogisticsOrder order = new SckwLogisticsOrder();
         order.set_id(lOrderId);
         order.setLOrderId(lOrderId);
@@ -1009,12 +1000,12 @@ public class ConsignOrderService {
         order.setStatus(String.valueOf(orderStatus));
         order.setEntId(LoginUserHolder.getEntId());
         order.setFirmName(LoginUserHolder.getEntName());
-        order.setGoodsId(Long.parseLong(addOrderDTO.getGoodsId()));
-        order.setGoodsCode(goods == null ? null : goods.getCode());
-        order.setGoodsName(goods == null ? null : goods.getName());
-        order.setGoodsType(goods == null ? null : goods.getGoodsType());
+//        order.setGoodsId(Long.parseLong(addOrderDTO.getGoodsId()));
+//        order.setGoodsCode(goods == null ? null : goods.getCode());
+        order.setGoodsName(addOrderDTO.getGoodsName());
+//        order.setGoodsType(goods == null ? null : goods.getGoodsType());
 //        order.setGoodsIndustry(goods == null ? null : goods.get);
-        order.setGoodsSpec(goods == null ? null : goods.getSpec());
+//        order.setGoodsSpec(goods == null ? null : goods.getSpec());
         order.setContractId(addOrderDTO.getContractId());
         order.setContractNo(infoResDto.getContractCode());
         order.setContractName(infoResDto.getContactName());

+ 3 - 2
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/LogisticsConsignmentService.java

@@ -19,6 +19,7 @@ import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
+import com.sckw.excel.utils.DateUtil;
 import com.sckw.excel.utils.ValidUtil;
 import com.sckw.fleet.api.RemoteFleetService;
 import com.sckw.fleet.api.model.vo.RTruckVo;
@@ -408,8 +409,8 @@ public class LogisticsConsignmentService {
         order.setGoodsPriceUnit(remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.PRICE_TYPE.getType(), bo.getGoodsPriceUnit()) == null ?
                 null : remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.PRICE_TYPE.getType(), bo.getGoodsPriceUnit()).getValue());
         order.setGoodsPriceUnit(bo.getGoodsPriceUnit());
-        order.setStartTime(bo.getShipmentsDateTime());
-        order.setEndTime(bo.getReceiveGoodsDateTime());
+        order.setStartTime(DateUtil.stringPatchingStartToDateTime(bo.getShipmentsDateTime()));
+        order.setEndTime(DateUtil.stringPatchingStartToDateTime(bo.getReceiveGoodsDateTime()));
         order.setRemark(bo.getRemark());
         order.setPayment(Long.parseLong(bo.getPayment()));
         order.setTaxRate(new BigDecimal(bo.getTaxRate()));