zk 2 лет назад
Родитель
Сommit
9a170a883e

+ 16 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckController.java

@@ -5,7 +5,9 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.sckw.core.common.enums.enums.DictTypeEnum;
 import com.sckw.core.exception.SystemException;
+import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
 import com.sckw.core.utils.CollectionUtils;
@@ -20,8 +22,11 @@ import com.sckw.fleet.model.dto.*;
 import com.sckw.fleet.model.vo.KwfDriverVo;
 import com.sckw.fleet.model.vo.KwfTruckVo;
 import com.sckw.fleet.service.KwfTruckService;
+import com.sckw.system.api.RemoteSystemService;
+import com.sckw.system.api.model.dto.res.SysDictResDto;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
@@ -38,6 +43,8 @@ public class KwfTruckController {
 
     @Autowired
     KwfTruckService truckService;
+    @DubboReference(version = "2.0.0", group = "design", check = false)
+    private RemoteSystemService remoteSystemService;
 
     /**
      * @param id 主键ID
@@ -59,12 +66,17 @@ public class KwfTruckController {
         //车队班组
         KwfFleet fleet = truckService.findByFleetTruck(id, LoginUserHolder.getEntId());
 
+        //字典
+        Map<String, SysDictResDto> dicts = remoteSystemService.queryDictMapByTypeValues(DictTypeEnum.COLOR_TYPE.getType() + Global.POUND + truck.getColor());
+        SysDictResDto color = dicts == null ? null : dicts.get(DictTypeEnum.COLOR_TYPE.getType() + Global.POUND + truck.getColor());
+
         //数据组装
         JSONObject truckJson = JSONObject.parseObject(JSON.toJSONString(truck));
         truckJson.put("truckLicense", truckLicense);
         truckJson.put("transportLicense", transportLicense);
         truckJson.put("fleetId", fleet.getId());
         truckJson.put("fleetName", fleet.getName());
+        truckJson.put("colorName", color != null ? color.getLabel() : null);
         return HttpResult.ok(truckJson);
     }
 
@@ -100,12 +112,16 @@ public class KwfTruckController {
         //车队班组
         KwfFleet fleet = truckService.findByFleetTruck(id, LoginUserHolder.getEntId());
 
+        //字典
+        Map<String, SysDictResDto> dicts = remoteSystemService.queryDictMapByTypeValues(DictTypeEnum.COLOR_TYPE.getType() + Global.POUND + truck.getColor());
+        SysDictResDto color = dicts == null ? null : dicts.get(DictTypeEnum.COLOR_TYPE.getType() + Global.POUND + truck.getColor());
         //数据组装
         JSONObject truckJson = JSONObject.parseObject(JSON.toJSONString(truck));
         truckJson.put("truckLicense", truckLicense);
         truckJson.put("transportLicense", transportLicense);
         truckJson.put("fleetId", fleet.getId());
         truckJson.put("fleetName", fleet.getName());
+        truckJson.put("colorName", color != null ? color.getLabel() : null);
         return HttpResult.ok(truckJson);
     }
 

+ 6 - 6
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckReportService.java

@@ -127,7 +127,7 @@ public class KwfTruckReportService {
         }
 
         /**获取查询数据**/
-        String prefix = Global.REDIS_SYS_DICT_PREFIX, pound = Global.POUND;
+        String pound = Global.POUND;
         List<Long> createBys = new ArrayList<>();
         List<Long> entIds = new ArrayList<>();
         List<String> dictKey = new ArrayList<>();
@@ -135,8 +135,8 @@ public class KwfTruckReportService {
             createBys.add(Long.parseLong(truck.getCreateBy()));
             entIds.add(Long.parseLong(truck.getDriverEntId()));
             entIds.add(Long.parseLong(truck.getTruckEntId()));
-            dictKey.add(prefix + DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getColor());
-            dictKey.add(prefix + DictTypeEnum.TRUCK_TYPE.getType() + pound + truck.getTruckType());
+            dictKey.add(DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getColor());
+            dictKey.add(DictTypeEnum.TRUCK_TYPE.getType() + pound + truck.getTruckType());
         }
         //用户数据集
         createBys = createBys.stream().distinct().collect(Collectors.toList());
@@ -146,14 +146,14 @@ public class KwfTruckReportService {
         Map<Long, EntCacheResDto> ents = remoteSystemService.queryEntCacheMapByIds(entIds);
         //数据字典
         dictKey = dictKey.stream().distinct().collect(Collectors.toList());
-        Map<Long, SysDictResDto> dicts = null;//remoteSystemService.queryDictByType(dictKey);
+        Map<String, SysDictResDto> dicts = remoteSystemService.queryDictMapByTypeValues(String.join(",", dictKey));
 
         /**数据组装**/
         for (KwfTruckReportVo truck:trucks) {
             UserCacheResDto user = users == null ? null : users.get(Long.parseLong(truck.getCreateBy()));
             EntCacheResDto ent = ents == null ? null : ents.get(Long.parseLong(truck.getDriverEntId()));
-            SysDictResDto color = dicts == null ? null : dicts.get(prefix + DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getColor());
-            SysDictResDto type = dicts == null ? null : dicts.get(prefix + DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getTruckType());
+            SysDictResDto color = dicts == null ? null : dicts.get(DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getColor());
+            SysDictResDto type = dicts == null ? null : dicts.get(DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getTruckType());
             truck.setCreateByName(user != null ? user.getName() : null);
             truck.setDriverFirmName(ent != null ? ent.getFirmName() : null);
             ent = ents == null ? null : ents.get(Long.parseLong(truck.getTruckEntId()));

+ 10 - 10
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfTruckService.java

@@ -118,7 +118,7 @@ public class KwfTruckService {
         }
 
         /**获取查询数据**/
-        String prefix = Global.REDIS_SYS_DICT_PREFIX, pound = Global.POUND;
+        String pound = Global.POUND;
         List<Long> createBys = new ArrayList<>();
         List<Long> entIds = new ArrayList<>();
         List<String> dictKey = new ArrayList<>();
@@ -126,10 +126,10 @@ public class KwfTruckService {
         for (KwfTruckVo truck:trucks) {
             createBys.add(Long.parseLong(truck.getCreateBy()));
             entIds.add(Long.parseLong(truck.getEntId()));
-            dictKey.add(prefix + DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getColor());
-            dictKey.add(prefix + DictTypeEnum.TRUCK_TYPE.getType() + pound + truck.getType());
-            dictKey.add(prefix + DictTypeEnum.USE_TYPE.getType() + pound + truck.getUseType());
-            dictKey.add(prefix + DictTypeEnum.ENERGY_TYPE.getType() + pound + truck.getEnergyType());
+            dictKey.add(DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getColor());
+            dictKey.add(DictTypeEnum.TRUCK_TYPE.getType() + pound + truck.getType());
+            dictKey.add(DictTypeEnum.USE_TYPE.getType() + pound + truck.getUseType());
+            dictKey.add(DictTypeEnum.ENERGY_TYPE.getType() + pound + truck.getEnergyType());
         }
         //用户数据集
         createBys = createBys.stream().distinct().collect(Collectors.toList());
@@ -139,16 +139,16 @@ public class KwfTruckService {
         Map<Long, EntCacheResDto> ents = remoteSystemService.queryEntCacheMapByIds(entIds);
         //数据字典
         dictKey = dictKey.stream().distinct().collect(Collectors.toList());
-        Map<Long, SysDictResDto> dicts = null;//remoteSystemService.queryDictByType(dictKey);
+        Map<String, SysDictResDto> dicts = remoteSystemService.queryDictMapByTypeValues(String.join(",", dictKey));
 
         /**数据组装**/
         for (KwfTruckVo truck:trucks) {
             UserCacheResDto user = users == null ? null : users.get(Long.parseLong(truck.getCreateBy()));
             EntCacheResDto ent = ents == null ? null : ents.get(Long.parseLong(truck.getEntId()));
-            SysDictResDto color = dicts == null ? null : dicts.get(prefix + DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getColor());
-            SysDictResDto type = dicts == null ? null : dicts.get(prefix + DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getType());
-            SysDictResDto useType = dicts == null ? null : dicts.get(prefix + DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getUseType());
-            SysDictResDto energyType = dicts == null ? null : dicts.get(prefix + DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getEnergyType());
+            SysDictResDto color = dicts == null ? null : dicts.get(DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getColor());
+            SysDictResDto type = dicts == null ? null : dicts.get(DictTypeEnum.TRUCK_TYPE.getType() + pound + truck.getType());
+            SysDictResDto useType = dicts == null ? null : dicts.get(DictTypeEnum.USE_TYPE.getType() + pound + truck.getUseType());
+            SysDictResDto energyType = dicts == null ? null : dicts.get(DictTypeEnum.ENERGY_TYPE.getType() + pound + truck.getEnergyType());
             truck.setCreateByName(user != null ? user.getName() : null);
             truck.setFirmName(ent != null ? ent.getFirmName() : null);
             truck.setColorName(color != null ? color.getLabel() : null);

+ 1 - 1
sckw-modules/sckw-system/src/main/resources/mapper/SysDictDao.xml

@@ -239,7 +239,7 @@
     from sys_dict
     where del_flag = 0
       and type = #{type}
-      and value = #{value}
+      and value = #{value} limit 1
   </select>
 
   <select id="selectAll" resultType="com.sckw.system.model.SysDict">

+ 61 - 19
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/KwtWaybillOrderController.java

@@ -4,9 +4,7 @@ import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.model.ValiList;
 import com.sckw.core.web.response.HttpResult;
-import com.sckw.transport.model.dto.ConfirmRefuseSendCarDto;
-import com.sckw.transport.model.dto.SendCarDto1;
-import com.sckw.transport.model.dto.UpdateDriverCarDTO;
+import com.sckw.transport.model.dto.*;
 import com.sckw.transport.service.DriverService;
 import com.sckw.transport.service.KwtWaybillOrderService;
 import jakarta.validation.Valid;
@@ -14,7 +12,6 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
-
 import java.util.List;
 
 /**
@@ -94,7 +91,7 @@ public class KwtWaybillOrderController {
 
     /**
      * @param params {}
-     * @description 派车-趟次/循环
+     * @desc 派车-趟次/循环
      * @author zk
      * @date 2023/5/30
      **/
@@ -108,7 +105,7 @@ public class KwtWaybillOrderController {
 
     /**
      * @param ids 车辆运单主键ID,多个已逗号隔开
-     * @description 取消派车
+     * @desc 取消派车
      * @author zk
      * @date 2023/7/24
      **/
@@ -119,46 +116,90 @@ public class KwtWaybillOrderController {
 
     /**
      * @param params {}
-     * @description 确认接单
+     * @desc 确认接单
      * @author zk
      * @date 2023/7/24
      **/
     @PostMapping("/confirmSendCar")
-    public HttpResult confirmSendCar(@RequestBody @Valid ConfirmRefuseSendCarDto params){
+    public HttpResult confirmSendCar(@RequestBody @Valid OperateSendCarDto params){
         return waybillOrderService.confirmSendCar(params);
     }
 
     /**
      * @param params {}
-     * @description 拒绝接单
+     * @desc 拒绝接单
      * @author zk
      * @date 2023/7/24
      **/
     @PostMapping("/refuseSendCar")
-    public HttpResult refuseSendCar(@RequestBody @Valid ConfirmRefuseSendCarDto params){
+    public HttpResult refuseSendCar(@RequestBody @Valid OperateSendCarDto params){
         return waybillOrderService.refuseSendCar(params);
     }
 
     /**
      * @param params {}
-     * @description 确认出车
+     * @desc 确认出车
      * @author zk
      * @date 2023/7/26
      **/
     @PostMapping("/confirmDeparture")
-    public HttpResult confirmDeparture(@RequestBody @Valid ConfirmRefuseSendCarDto params){
-        return waybillOrderService.confirmSendCar(params);
+    public HttpResult confirmDeparture(@RequestBody @Valid OperateWaybillDto params){
+        return waybillOrderService.confirmDeparture(params);
     }
 
     /**
      * @param params {}
-     * @description 拒绝出车
+     * @desc 拒绝出车
      * @author zk
      * @date 2023/7/26
      **/
     @PostMapping("/refuseDeparture")
-    public HttpResult refuseDeparture(@RequestBody @Valid ConfirmRefuseSendCarDto params){
-        return waybillOrderService.refuseSendCar(params);
+    public HttpResult refuseDeparture(@RequestBody @Valid OperateWaybillDto params){
+        return waybillOrderService.refuseDeparture(params);
+    }
+
+    /**
+     * @param params {}
+     * @desc 到达装货地点
+     * @author zk
+     * @date 2023/7/26
+     **/
+    @PostMapping("/arriveLoadLocation")
+    public HttpResult arriveLoadLocation(@RequestBody @Valid OperateWaybillDto params){
+        return waybillOrderService.arriveLoadLocation(params);
+    }
+
+    /**
+     * @param params {}
+     * @desc 装货
+     * @author zk
+     * @date 2023/7/26
+     **/
+    @PostMapping("/loading")
+    public HttpResult loading(@RequestBody @Valid WaybillOrderTicketDto params){
+        return waybillOrderService.loading(params);
+    }
+
+    /**
+     * @param params {}
+     * @desc 到达卸货地点
+     * @author zk
+     * @date 2023/7/26
+     **/
+    @PostMapping("/arriveUnloadLocation")
+    public HttpResult arriveUnloadLocation(@RequestBody @Valid OperateWaybillDto params){
+        return waybillOrderService.arriveUnloadLocation(params);
+    }
+
+    /**
+     * @param params {}
+     * @desc 卸货
+     * @author zk
+     * @date 2023/7/26
+     **/
+    @PostMapping("/unloading")
+    public HttpResult unloading(@RequestBody @Valid WaybillOrderTicketDto params){
+        return waybillOrderService.unloading(params);
     }
 
 
@@ -169,10 +210,11 @@ public class KwtWaybillOrderController {
     //确认接单-趟次/循环
     //拒绝接单-趟次/循环
     //确认/拒绝出车
-    //到达装货地点
+    //到达装货地点 arriveLoadLocation
     //确认装货
-    //到达卸货地点
+    //到达卸货地点 arriveUnloadLocation
     //确认卸货
-
+    //修改单证
+    //单证审核
 
 }

+ 0 - 10
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwtWaybillOrderTicketMapper.java

@@ -6,15 +6,5 @@ import org.apache.ibatis.annotations.Mapper;
 
 @Mapper
 public interface KwtWaybillOrderTicketMapper extends BaseMapper<KwtWaybillOrderTicket> {
-    int deleteByPrimaryKey(Long id);
 
-    int insert(KwtWaybillOrderTicket record);
-
-    int insertSelective(KwtWaybillOrderTicket record);
-
-    KwtWaybillOrderTicket selectByPrimaryKey(Long id);
-
-    int updateByPrimaryKeySelective(KwtWaybillOrderTicket record);
-
-    int updateByPrimaryKey(KwtWaybillOrderTicket record);
 }

+ 10 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwtLogisticsOrder.java

@@ -145,6 +145,16 @@ public class KwtLogisticsOrder implements Serializable {
      */
     private BigDecimal deficitPrice;
 
+    /**
+     * 实际开始时间(装货)
+     */
+    private Date loadTime;
+
+    /**
+     * 实际结束时间(卸货)
+     */
+    private Date unloadTime;
+
     /**
      * 付款方式(预付款、线下支付、第三方支付)
      */

+ 2 - 38
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/KwtWaybillOrderTicket.java

@@ -1,12 +1,9 @@
 package com.sckw.transport.model;
 
-import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.sckw.core.model.base.BaseModel;
 import lombok.Data;
-
-import java.io.Serializable;
 import java.math.BigDecimal;
-import java.util.Date;
 
 /**
  * @author lfdc
@@ -15,11 +12,7 @@ import java.util.Date;
  */
 @Data
 @TableName("kwt_waybill_order_ticket")
-public class KwtWaybillOrderTicket implements Serializable {
-    /**
-     * 主键
-     */
-    private Long id;
+public class KwtWaybillOrderTicket extends BaseModel {
 
     /**
      * 车辆运单id
@@ -51,33 +44,4 @@ public class KwtWaybillOrderTicket implements Serializable {
      */
     private String urls;
 
-    /**
-     * 备注
-     */
-    private String remark;
-
-    /**
-     * 用户状态(0正常、1已锁)
-     */
-    private Integer status;
-
-    private Long createBy;
-
-    private Date createTime;
-
-    private Long updateBy;
-
-    /**
-     * 更新时间
-     */
-    private Date updateTime;
-
-    /**
-     * 是否删除(0未删除,1删除)
-     */
-    @TableLogic("0")
-    private Integer delFlag;
-
-    private static final long serialVersionUID = 1L;
-
 }

+ 65 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/WaybillOrderTicketDto.java

@@ -0,0 +1,65 @@
+package com.sckw.transport.model.dto;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import jakarta.validation.constraints.DecimalMin;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Size;
+import lombok.Data;
+import java.math.BigDecimal;
+
+/**
+ * @author zk
+ * @desc 装卸货榜单信息
+ * @date 2023/7/26 0026
+ */
+@Data
+public class WaybillOrderTicketDto {
+
+    /**
+     * 车辆运单id
+     */
+    @JsonProperty("wOrderId")
+    @NotNull(message = "车辆运单ID不能为空")
+    private Long wOrderId;
+
+    /**
+     * 磅单类型(1装货单/2卸货单)
+
+    @JsonProperty("type")
+    @NotNull(message = "磅单类型不能为空")
+    private Integer type;*/
+
+    /**
+     * 装卸货数量
+     */
+    @JsonProperty("amount")
+    @NotNull(message = "装卸货净重不能为空")
+    @DecimalMin(value= "0", inclusive=false, message = "装卸货净重必须等于或大于0")
+    private BigDecimal amount;
+
+    /**
+     * 毛重
+     */
+    @JsonProperty("grossAmount")
+    private BigDecimal grossAmount;
+
+    /**
+     * 皮重
+     */
+    @JsonProperty("tareAmount")
+    private BigDecimal tareAmount;
+
+    /**
+     * 上传凭证地址,多个以英文逗号隔开
+     */
+    @JsonProperty("urls")
+    @NotBlank(message = "凭证不能为空")
+    private String urls;
+
+    /**
+     * 备注
+     */
+    @Size(max=100, message = "原因长度不能大于100个字符!")
+    private String remark;
+}

+ 210 - 13
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtWaybillOrderService.java

@@ -19,12 +19,14 @@ import com.sckw.transport.model.*;
 import com.sckw.transport.model.dto.OperateWaybillDto;
 import com.sckw.transport.model.dto.OperateSendCarDto;
 import com.sckw.transport.model.dto.SendCarDto1;
+import com.sckw.transport.model.dto.WaybillOrderTicketDto;
 import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cloud.stream.function.StreamBridge;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-
+import org.springframework.web.bind.annotation.RequestBody;
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.List;
@@ -50,6 +52,8 @@ public class KwtWaybillOrderService {
     @Autowired
     KwtWaybillOrderTrackMapper waybillOrderTrackDao;
     @Autowired
+    KwtWaybillOrderTicketMapper waybillOrderTicketDao;
+    @Autowired
     KwtLogisticsOrderUnitMapper logisticsOrderUnitDao;
     @Autowired
     KwtLogisticsOrderGoodsMapper logisticsOrderGoodsDao;
@@ -818,18 +822,11 @@ public class KwtWaybillOrderService {
             /**2Mongodb数据更新**/
             SckwWaybillOrder wOrder = new SckwWaybillOrder();
             wOrder.set_id(circulate.getId());
-            wOrder.setStatus(CarWaybillEnum.REJECT_ORDER.getCode());
-            wOrder.setUpdateTime(circulate.getUpdateTime());
-            wOrder.setUpdateBy(circulate.getUpdateBy());
-            //rabbitMq业务汇总数据发送/消费对象
-            SckwBusSum busSum = new SckwBusSum();
-            //业务汇总类型
-            busSum.setBusSumType(BusinessTypeEnum.WAYBILL_ORDER_TYPE.getName());
-            //操作对象(1新增/2修改/3替换数据)
-            busSum.setMethod(2);
-            //业务汇总数据对象
-            busSum.setObject(wOrder);
-            streamBridge.send("sckw-busSum", busSum);
+            KwtWaybillOrder waybillOrder = new KwtWaybillOrder();
+            waybillOrder.setStatus(CarWaybillEnum.REJECT_ORDER.getCode());
+            waybillOrder.setUpdateTime(circulate.getUpdateTime());
+            waybillOrder.setUpdateBy(circulate.getUpdateBy());
+            editSckwWaybillOrder(wOrder, waybillOrder, 2);
 
             /**3发送消息**/
         }
@@ -922,5 +919,205 @@ public class KwtWaybillOrderService {
         return HttpResult.ok("拒绝出车成功!");
     }
 
+    /**
+     * @param params {}
+     * @desc 到达装货地点
+     * @author zk
+     * @date 2023/7/26
+     **/
+    @Transactional(rollbackFor = Exception.class)
+    public HttpResult arriveLoadLocation(OperateWaybillDto params){
+        /**数据校验**/
+        KwtWaybillOrder waybillOrder = waybillOrderDao.selectById(params.getWOrderId());
+        if (waybillOrder == null) {
+            return HttpResult.error("车辆运单不存在!");
+        }
+        //已出车车辆运单才能到达装货地点
+        if (waybillOrder.getStatus() != CarWaybillEnum.EXIT_COMPLETED.getCode()) {
+            return HttpResult.error("车辆运单当前状态已不能到达装货地点!");
+        }
+
+        /**业务处理**/
+        /**1更新车辆运单**/
+        waybillOrder.setStatus(CarWaybillEnum.WAIT_LOADING.getCode());
+        waybillOrderDao.updateById(waybillOrder);
+
+        /**2新增运单状态记录**/
+        setWaybillOrderTrack(waybillOrder.getId(), waybillOrder.getStatus(), params.getRemark());
+
+        /**3Mongodb数据更新**/
+        //1车辆运单
+        SckwWaybillOrder wOrder = new SckwWaybillOrder();
+        wOrder.set_id(waybillOrder.getId());
+        editSckwWaybillOrder(wOrder, waybillOrder, 2);
+
+        /**4发送消息**/
+
+        return HttpResult.ok("到达装货地点成功!");
+    }
+
+    /**
+     * @param params {}
+     * @desc 装货
+     * @author zk
+     * @date 2023/7/26
+     **/
+    @Transactional(rollbackFor = Exception.class)
+    public HttpResult loading(WaybillOrderTicketDto params){
+        /**数据校验**/
+        KwtWaybillOrder waybillOrder = waybillOrderDao.selectById(params.getWOrderId());
+        if (waybillOrder == null) {
+            return HttpResult.error("车辆运单不存在!");
+        }
+        //到达装货地车辆运单才能装货
+        if (waybillOrder.getStatus() != CarWaybillEnum.WAIT_LOADING.getCode()) {
+            return HttpResult.error("车辆运单当前状态已不能装货!");
+        }
+
+        /**业务处理**/
+        /**1更新车辆运单**/
+        waybillOrder.setLoadAmount(params.getAmount());
+        waybillOrder.setStatus(CarWaybillEnum.COMPLETION_LOADING.getCode());
+        waybillOrderDao.updateById(waybillOrder);
+
+        /**2新增运单状态记录**/
+        setWaybillOrderTrack(waybillOrder.getId(), waybillOrder.getStatus(), params.getRemark());
+
+        /**3新增装卸货榜单信息**/
+        KwtWaybillOrderTicket ticket = new KwtWaybillOrderTicket();
+        ticket.setWOrderId(waybillOrder.getId());
+        ticket.setType(Global.NUMERICAL_ONE);
+        ticket.setAmount(waybillOrder.getLoadAmount());
+        ticket.setUrls(params.getUrls());
+        waybillOrderTicketDao.insert(ticket);
+
+        /**4更新承运订单entrustAmount**/
+        KwtLogisticsOrder logisticsOrder = logisticsOrderDao.selectById(waybillOrder.getLOrderId());
+        //承运订单已委派量=承运订单原委派量+当前车辆运单委派量
+        BigDecimal loadAmount = logisticsOrder.getLoadAmount() == null ? new BigDecimal(Global.AMOUNT) : logisticsOrder.getLoadAmount();
+        logisticsOrder.setLoadAmount(loadAmount.add(waybillOrder.getLoadAmount()));
+        logisticsOrder.setLoadTime(waybillOrder.getUpdateTime());
+        logisticsOrderDao.updateById(logisticsOrder);
+
+        /**5Mongodb数据更新**/
+        //1车辆运单
+        SckwWaybillOrder wOrder = new SckwWaybillOrder();
+        wOrder.set_id(waybillOrder.getId());
+        wOrder.setLoadAmount(waybillOrder.getLoadAmount());
+        wOrder.setLoadUrls(params.getUrls());
+        wOrder.setLoadTime(waybillOrder.getUpdateTime());
+        editSckwWaybillOrder(wOrder, waybillOrder, 2);
+
+        //2承运订单
+        SckwLogisticsOrder lOrder = new SckwLogisticsOrder();
+        lOrder.setLoadTime(logisticsOrder.getLoadTime());
+        lOrder.setLoadAmount(logisticsOrder.getLoadAmount());
+        editSckwLogisticsOrder(lOrder, logisticsOrder);
+
+        /**6发送消息**/
+
+        return HttpResult.ok("装货成功!");
+    }
+
+    /**
+     * @param params {}
+     * @desc 到达卸货地点
+     * @author zk
+     * @date 2023/7/26
+     **/
+    @Transactional(rollbackFor = Exception.class)
+    public HttpResult arriveUnloadLocation(OperateWaybillDto params){
+        /**数据校验**/
+        KwtWaybillOrder waybillOrder = waybillOrderDao.selectById(params.getWOrderId());
+        if (waybillOrder == null) {
+            return HttpResult.error("车辆运单不存在!");
+        }
+        //已装货车辆运单才能到达卸货地点
+        if (waybillOrder.getStatus() != CarWaybillEnum.COMPLETION_LOADING.getCode()) {
+            return HttpResult.error("车辆运单当前状态已不能到达卸货地点!");
+        }
+
+        /**业务处理**/
+        /**1更新车辆运单**/
+        waybillOrder.setStatus(CarWaybillEnum.WAIT_UNLOADING.getCode());
+        waybillOrderDao.updateById(waybillOrder);
+
+        /**2新增运单状态记录**/
+        setWaybillOrderTrack(waybillOrder.getId(), waybillOrder.getStatus(), params.getRemark());
+
+        /**3Mongodb数据更新**/
+        //1车辆运单
+        SckwWaybillOrder wOrder = new SckwWaybillOrder();
+        wOrder.set_id(waybillOrder.getId());
+        editSckwWaybillOrder(wOrder, waybillOrder, 2);
+
+        /**4发送消息**/
+
+        return HttpResult.ok("到达卸货地点成功!");
+    }
+
+    /**
+     * @param params {}
+     * @desc 卸货
+     * @author zk
+     * @date 2023/7/26
+     **/
+    @Transactional(rollbackFor = Exception.class)
+    public HttpResult unloading(@RequestBody @Valid WaybillOrderTicketDto params){
+        /**数据校验**/
+        KwtWaybillOrder waybillOrder = waybillOrderDao.selectById(params.getWOrderId());
+        if (waybillOrder == null) {
+            return HttpResult.error("车辆运单不存在!");
+        }
+        //到达卸货地车辆运单才能卸货
+        if (waybillOrder.getStatus() != CarWaybillEnum.WAIT_UNLOADING.getCode()) {
+            return HttpResult.error("车辆运单当前状态已不能装货!");
+        }
+
+        /**业务处理**/
+        /**1更新车辆运单**/
+        waybillOrder.setUnloadAmount(params.getAmount());
+        waybillOrder.setDeficitAmount(waybillOrder.getLoadAmount().subtract(waybillOrder.getUnloadAmount()));
+        waybillOrder.setStatus(CarWaybillEnum.COMPLETION_UNLOADING.getCode());
+        waybillOrderDao.updateById(waybillOrder);
+
+        /**2新增运单状态记录**/
+        setWaybillOrderTrack(waybillOrder.getId(), waybillOrder.getStatus(), params.getRemark());
+
+        /**3新增装卸货榜单信息**/
+        KwtWaybillOrderTicket ticket = new KwtWaybillOrderTicket();
+        ticket.setWOrderId(waybillOrder.getId());
+        ticket.setType(Global.NUMERICAL_TWO);
+        ticket.setAmount(waybillOrder.getUnloadAmount());
+        ticket.setUrls(params.getUrls());
+        waybillOrderTicketDao.insert(ticket);
+
+        /**4更新承运订单entrustAmount**/
+        KwtLogisticsOrder logisticsOrder = logisticsOrderDao.selectById(waybillOrder.getLOrderId());
+        //承运订单已委派量=承运订单原委派量+当前车辆运单委派量
+        BigDecimal loadAmount = logisticsOrder.getLoadAmount() == null ? new BigDecimal(Global.AMOUNT) : logisticsOrder.getLoadAmount();
+        logisticsOrder.setLoadAmount(loadAmount.add(waybillOrder.getLoadAmount()));
+        logisticsOrder.setLoadTime(waybillOrder.getUpdateTime());
+        logisticsOrderDao.updateById(logisticsOrder);
+
+        /**5Mongodb数据更新**/
+        //1车辆运单
+        SckwWaybillOrder wOrder = new SckwWaybillOrder();
+        wOrder.set_id(waybillOrder.getId());
+        wOrder.setLoadAmount(waybillOrder.getLoadAmount());
+        wOrder.setLoadUrls(params.getUrls());
+        wOrder.setLoadTime(waybillOrder.getUpdateTime());
+        editSckwWaybillOrder(wOrder, waybillOrder, 2);
+
+        //2承运订单
+        SckwLogisticsOrder lOrder = new SckwLogisticsOrder();
+        lOrder.setLoadTime(logisticsOrder.getLoadTime());
+        lOrder.setLoadAmount(logisticsOrder.getLoadAmount());
+        editSckwLogisticsOrder(lOrder, logisticsOrder);
+
+        /**6发送消息**/
+
+        return HttpResult.ok("装货成功!");
+    }
 
 }

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

@@ -230,14 +230,14 @@ public class WaybillManagementService {
         // 多条件模糊查询
         List<Criteria> orCriteria = new ArrayList<>();
         if (StringUtils.isNotBlank(query.getKeywords())) {
-            Pattern pattern = Pattern.compile("^.*" + query.getKeywords() + ".*$", Pattern.CASE_INSENSITIVE);
+            /*Pattern pattern = Pattern.compile("^.*" + query.getKeywords() + ".*$", Pattern.CASE_INSENSITIVE);
             orCriteria.add(Criteria.where("wOrderNo").regex(pattern));
             orCriteria.add(Criteria.where("truckNo").regex(pattern));
             orCriteria.add(Criteria.where("driverName").regex(pattern));
             orCriteria.add(Criteria.where("firmName").regex(pattern));
             orCriteria.add(Criteria.where("loadAddress").regex(pattern));
             orCriteria.add(Criteria.where("unloadAddress").regex(pattern));
-            criteria.orOperator(orCriteria);
+            criteria.orOperator(orCriteria);*/
         }
         Query queryFormat = new Query(criteria);
         long total = mongoTemplate.count(queryFormat, SckwWaybillOrder.class);

+ 2 - 1
sckw-modules/sckw-transport/src/main/resources/mapper/KwtWaybillOrderTicketMapper.xml

@@ -19,6 +19,7 @@
     </resultMap>
     <sql id="Base_Column_List">
         id, w_order_id, `type`, amount, gross_amount, tare_amount, urls, remark, `status`,
-    create_by, create_time, update_by, update_time, del_flag
+        create_by, create_time, update_by, update_time, del_flag
     </sql>
+
 </mapper>