Ver Fonte

Merge remote-tracking branch 'origin/dev_20251130' into dev_20251130

# Conflicts:
#	sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dubbo/RemoteFleetServiceImpl.java
donglang há 1 mês atrás
pai
commit
c68d5ea8cb
36 ficheiros alterados com 344 adições e 128 exclusões
  1. 2 2
      sckw-modules-api/sckw-contract-api/src/main/java/com/sckw/contract/api/feign/LogisticsScoreFeignService.java
  2. 0 5
      sckw-modules-api/sckw-contract-api/src/main/java/com/sckw/contract/api/model/dto/req/LogisticsScoreDetailFeignDto.java
  3. 2 2
      sckw-modules-api/sckw-fleet-api/src/main/java/com/sckw/fleet/api/feign/DriverScoreFeignService.java
  4. 5 9
      sckw-modules-api/sckw-fleet-api/src/main/java/com/sckw/fleet/api/model/dto/UpdateDriverScoreDto.java
  5. 1 0
      sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/model/TradeOrderPara.java
  6. 1 0
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteSystemService.java
  7. 1 0
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteUserService.java
  8. 66 0
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/req/KwsUserReqDto.java
  9. 25 0
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/UserResDto.java
  10. 3 3
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/api/KwcContractLogisticsScoreApiController.java
  11. 0 5
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/dto/req/LogisticsScoreDetailAddDto.java
  12. 0 3
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/entity/KwcContractLogisticsScore.java
  13. 0 3
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/entity/KwcContractLogisticsScoreDetail.java
  14. 3 2
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/IKwcContractLogisticsScoreService.java
  15. 43 44
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/impl/KwcContractLogisticsScoreServiceImpl.java
  16. 7 2
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/operateService/KwcContractLogisticsService.java
  17. 1 4
      sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractLogisticsScoreDetailMapper.xml
  18. 1 4
      sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractLogisticsScoreMapper.xml
  19. 3 2
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfDriverScoreController.java
  20. 23 0
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dubbo/RemoteFleetServiceImpl.java
  21. 0 3
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/KwfDriverScore.java
  22. 0 7
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/KwfDriverScoreDetail.java
  23. 0 2
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverScoreService.java
  24. 30 1
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverService.java
  25. 1 7
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverScoreDetailMapper.xml
  26. 1 7
      sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverScoreMapper.xml
  27. 14 1
      sckw-modules/sckw-order/src/main/java/com/sckw/order/controller/KwoTradeOrderController.java
  28. 21 0
      sckw-modules/sckw-order/src/main/java/com/sckw/order/enums/OrderPara.java
  29. 10 0
      sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTradeOrderService.java
  30. 17 3
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteSystemServiceImpl.java
  31. 19 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteUserServiceImpl.java
  32. 3 1
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/handler/ComeIntoHandler.java
  33. 2 1
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtAcceptCarriageOrderService.java
  34. 1 1
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtWaybillOrderV1Service.java
  35. 2 1
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/app/WaybillOrderService.java
  36. 36 3
      sql/2025/12/09/2025_12_09_tys_creat.sql

+ 2 - 2
sckw-modules-api/sckw-contract-api/src/main/java/com/sckw/contract/api/feign/LogisticsScoreFeignService.java

@@ -1,7 +1,7 @@
 package com.sckw.contract.api.feign;
 
 import com.sckw.contract.api.model.dto.req.LogisticsScoreDetailFeignDto;
-import com.sckw.core.web.response.BaseResult;
+import com.sckw.core.web.response.HttpResult;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -12,5 +12,5 @@ public interface LogisticsScoreFeignService {
      * 系统修改物流企业评分
      */
     @PostMapping("/updateLogisticsScore")
-    public BaseResult<Boolean> updateLogisticsScore(@RequestBody LogisticsScoreDetailFeignDto detailDto);
+    public HttpResult updateLogisticsScore(@RequestBody LogisticsScoreDetailFeignDto detailDto);
 }

+ 0 - 5
sckw-modules-api/sckw-contract-api/src/main/java/com/sckw/contract/api/model/dto/req/LogisticsScoreDetailFeignDto.java

@@ -28,11 +28,6 @@ public class LogisticsScoreDetailFeignDto {
      */
     @NotNull(message = "影响人id不能为空")
     private Long influenceBy;
-    /**
-     * 评分行为影响人名称
-     */
-    @NotNull(message = "影响人名称不能为空")
-    private String influenceByName;
     /**
      * 评分行为
      */

+ 2 - 2
sckw-modules-api/sckw-fleet-api/src/main/java/com/sckw/fleet/api/feign/DriverScoreFeignService.java

@@ -1,6 +1,6 @@
 package com.sckw.fleet.api.feign;
 
-import com.sckw.core.web.response.BaseResult;
+import com.sckw.core.web.response.HttpResult;
 import com.sckw.fleet.api.model.dto.UpdateDriverScoreDto;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.validation.annotation.Validated;
@@ -13,5 +13,5 @@ public interface DriverScoreFeignService {
      * 更新司机评分
      */
     @PostMapping("/update")
-    public BaseResult<Boolean> update(@Validated @RequestBody UpdateDriverScoreDto updateDriverScoreDto);
+    public HttpResult update(@Validated @RequestBody UpdateDriverScoreDto updateDriverScoreDto);
 }

+ 5 - 9
sckw-modules-api/sckw-fleet-api/src/main/java/com/sckw/fleet/api/model/dto/UpdateDriverScoreDto.java

@@ -19,29 +19,25 @@ import java.math.BigDecimal;
 public class UpdateDriverScoreDto {
 
     /** 供应商企业id */
-    @NotNull
+    @NotNull(message = "供应商企业id不能为空")
     private Long providerEntId;
 
     /** 物流企业id */
-    @NotNull
+    @NotNull()
     private Long logisticsEntId;
 
-    /** 供应商企业名称 */
-    @NotBlank
-    private String providerEntName;
-
     /** 变动评分 */
     private BigDecimal scoreChange;
 
     /** 物流企业评分 */
-    @NotNull
+    @NotNull(message = "物流企业评分不能为空")
     private BigDecimal logisticsEntScore;
 
     /** 变动原因 */
-    @NotBlank
+    @NotBlank(message = "变动原因不能为空")
     private String action;
 
     /** 操作类型 1-初始化 2-修改评分 3-重置评分*/
-    @NotNull
+    @NotNull(message = "操作类型不能为空")
     private Integer operatorType;
 }

+ 1 - 0
sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/model/TradeOrderPara.java

@@ -23,4 +23,5 @@ public class TradeOrderPara implements Serializable {
     private LocalDateTime endTime;
 
     private List<Long> entId;
+    private Long userId;
 }

+ 1 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteSystemService.java

@@ -187,6 +187,7 @@ public interface RemoteSystemService {
      * @date: 2023/7/7
      */
     UserCacheResDto queryUserCacheById(Long userId);
+    UserResDto queryUserById(Long userId);
 
     /**
      * @desc: 从缓存查用户信息

+ 1 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteUserService.java

@@ -302,4 +302,5 @@ public interface RemoteUserService {
 
     List<Long> findEntListByUserId(Long userId);
 
+    void saveUser(KwsUserReqDto kwsUser);
 }

+ 66 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/req/KwsUserReqDto.java

@@ -0,0 +1,66 @@
+package com.sckw.system.api.model.dto.req;
+
+import com.sckw.core.model.base.BaseModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 用户
+ * @author zk
+ * @date 2023-05-31
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class KwsUserReqDto extends BaseModel {
+
+    /**
+     * 系统类型(1运营端、2企业开户)
+     */
+    private Integer systemType;
+    private Long entId;
+    /**
+     * 账号
+     */
+    private String account;
+
+    /**
+     * 密码
+     */
+    private String password;
+
+    /**
+     * 用户名
+     */
+    private String name;
+
+    /**
+     * 手机号
+     */
+    private String phone;
+
+    /**
+     * 头像
+     */
+    private String photo;
+
+    /**
+     * 邮箱
+     */
+    private String email;
+
+    /**
+     * 推送设备id
+     */
+    private String clientId;
+
+    /**
+     * 是否是企业管理(1是 0否)
+     */
+    private Integer isMain;
+
+    /**
+     * 盐
+     */
+    private String salt;
+
+}

+ 25 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/model/dto/res/UserResDto.java

@@ -0,0 +1,25 @@
+package com.sckw.system.api.model.dto.res;
+
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @author czh
+ * @desc 用户信息
+ * @date 2023/7/7
+ */
+@Data
+public class UserResDto implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 5711974940665217921L;
+
+
+    private Long id;
+    private Integer isMain;
+    private Integer systemType;
+    private Long entId;
+
+}

+ 3 - 3
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/api/KwcContractLogisticsScoreApiController.java

@@ -2,7 +2,7 @@ package com.sckw.contract.api;
 
 import com.sckw.contract.api.model.dto.req.LogisticsScoreDetailFeignDto;
 import com.sckw.contract.service.IKwcContractLogisticsScoreService;
-import com.sckw.core.web.response.BaseResult;
+import com.sckw.core.web.response.HttpResult;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -25,7 +25,7 @@ public class KwcContractLogisticsScoreApiController {
      * 系统修改物流企业评分
      */
     @PostMapping("/updateLogisticsScore")
-    public BaseResult<Boolean> updateLogisticsScore(@Validated @RequestBody LogisticsScoreDetailFeignDto detailDto) {
-        return BaseResult.success(kwcContractLogisticsScoreService.updateLogisticsScoreBySystem(detailDto));
+    public HttpResult updateLogisticsScore(@Validated @RequestBody LogisticsScoreDetailFeignDto detailDto) {
+        return HttpResult.ok(kwcContractLogisticsScoreService.updateLogisticsScoreBySystem(detailDto));
     }
 }

+ 0 - 5
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/dto/req/LogisticsScoreDetailAddDto.java

@@ -24,11 +24,6 @@ public class LogisticsScoreDetailAddDto {
      */
     @Schema(hidden = true)
     private Long influenceBy;
-    /**
-     * 评分行为影响人名称
-     */
-    @Schema(hidden = true)
-    private String influenceByName;
     /**
      * 评分行为
      */

+ 0 - 3
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/entity/KwcContractLogisticsScore.java

@@ -29,9 +29,6 @@ public class KwcContractLogisticsScore extends BaseModel
     /** 物流企业id */
     private Long logisticsEntId;
 
-    /** 物流企业名称 */
-    private String logisticsEntName;
-
     /** 物流企业评分 */
     private BigDecimal score;
 

+ 0 - 3
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/model/entity/KwcContractLogisticsScoreDetail.java

@@ -28,9 +28,6 @@ public class KwcContractLogisticsScoreDetail extends BaseModel
     /** 影响人id */
     private Long influenceBy;
 
-    /** 影响人名字 */
-    private String influenceByName;
-
     /** 行为 */
     private String action;
 

+ 3 - 2
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/IKwcContractLogisticsScoreService.java

@@ -7,6 +7,7 @@ import com.sckw.contract.api.model.dto.req.LogisticsScoreDetailFeignDto;
 import com.sckw.contract.model.dto.req.LogisticsScoreApprovalDto;
 import com.sckw.contract.model.dto.req.LogisticsScoreDetailAddDto;
 import com.sckw.contract.model.dto.req.LogisticsScoreDetailQueryDto;
+import com.sckw.contract.model.entity.KwcContractLogisticsScoreDetail;
 import com.sckw.contract.model.vo.req.LogisticListReq;
 import com.sckw.contract.model.vo.res.LogisticsScoreDetailResVo;
 import com.sckw.contract.model.vo.res.LogisticsScoreResVo;
@@ -52,13 +53,13 @@ public interface IKwcContractLogisticsScoreService
      * 初始化物流企业评分
      * @param baseInfo
      */
-    void initLogisticsScore(LogisticListReq.TradeBaseInfo baseInfo, Map<Long, EntCacheResDto> entCacheResDtoMap);
+    void initLogisticsScore(LogisticListReq.TradeBaseInfo baseInfo);
 
     /**
      * 初始化物流企业评分明细
      * @param detailDto
      */
-    void initLogisticsScoreDetail(LogisticsScoreDetailAddDto detailDto);
+    KwcContractLogisticsScoreDetail initLogisticsScoreDetail(LogisticsScoreDetailAddDto detailDto);
 
 
     /**

+ 43 - 44
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/impl/KwcContractLogisticsScoreServiceImpl.java

@@ -29,13 +29,18 @@ import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.IdWorker;
 import com.sckw.core.utils.PageUtils;
 import com.sckw.core.web.config.CustomConfig;
+import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
+import com.sckw.core.web.response.HttpResult;
 import com.sckw.fleet.api.feign.DriverScoreFeignService;
 import com.sckw.fleet.api.model.dto.UpdateDriverScoreDto;
 import com.sckw.redis.constant.RedisConstant;
 import com.sckw.redis.utils.RedissonUtils;
+import com.sckw.system.api.RemoteSystemService;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.MapUtils;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.sckw.contract.dao.KwcContractLogisticsScoreMapper;
@@ -49,9 +54,12 @@ import org.springframework.transaction.annotation.Transactional;
  * @author tangyishan
  * @date 2025-12-05
  */
+@Slf4j
 @Service
 public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisticsScoreService 
 {
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteSystemService remoteSystemService;
     @Autowired
     private KwcContractLogisticsScoreMapper kwcContractLogisticsScoreMapper;
     @Autowired
@@ -90,9 +98,14 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
                     logisticsScore.setPendingScore(scoreChangeMap.getOrDefault(logisticsScore.getId(), null));
                 }
             }
+            Map<Long, EntCacheResDto> entCacheResDtoMap = remoteSystemService.queryEntCacheMapByIds(logisticsScores.stream().map(KwcContractLogisticsScore::getLogisticsEntId).toList());
             pageInfo = ((Page<KwcContractLogisticsScore>) logisticsScores).toPageInfo(e -> {
                 LogisticsScoreResVo logisticsScoreResVo = new LogisticsScoreResVo();
                 BeanUtils.copyProperties(e, logisticsScoreResVo);
+                EntCacheResDto entCacheResDto = entCacheResDtoMap.get(e.getLogisticsEntId());
+                if(entCacheResDto!=null){
+                    logisticsScoreResVo.setLogisticsEntName(entCacheResDto.getFirmName());
+                }
                 if(e.getPendingScore()!=null && e.getPendingScore().compareTo(BigDecimal.ZERO) > 0){
                     logisticsScoreResVo.setPendingScore("+"+e.getPendingScore());
                 }else if(e.getPendingScore()==null){
@@ -118,6 +131,7 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
     {
         //校验评分权限
         KwcContractLogisticsScore logisticsScore = checkLogisticsScoreAuth(providerEntId, detailReqDto.getScoreId());
+        EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(logisticsScore.getLogisticsEntId());
         PageInfo<LogisticsScoreDetailResVo> pageInfo = new PageInfo<>(new ArrayList<>());
         PageUtils.startPage();
         detailReqDto.setScoreIds(Collections.singletonList(detailReqDto.getScoreId()));
@@ -134,7 +148,7 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
                 if(e.getScore() == null){
                     logisticsScoreDetailResVo.setScore("");
                 }
-                logisticsScoreDetailResVo.setLogisticsEntName(logisticsScore.getLogisticsEntName());
+                logisticsScoreDetailResVo.setLogisticsEntName(entCacheResDto.getFirmName());
                 return logisticsScoreDetailResVo;
             });
         }
@@ -157,7 +171,8 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
         if(logisticsScoreDetail == null){
             return null;
         }
-        logisticsScoreDetail.setLogisticsEntName(logisticsScore.getLogisticsEntName());
+        EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(logisticsScore.getLogisticsEntId());
+        logisticsScoreDetail.setLogisticsEntName(entCacheResDto.getFirmName());
         LogisticsScoreDetailResVo logisticsScoreDetailResVo = new LogisticsScoreDetailResVo();
         BeanUtils.copyProperties(logisticsScoreDetail,logisticsScoreDetailResVo);
         logisticsScoreDetailResVo.setScore(logisticsScore.getScore().toString());
@@ -215,7 +230,7 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
 
     @Transactional(rollbackFor = Exception.class)
     @Override
-    public void initLogisticsScore(LogisticListReq.TradeBaseInfo baseInfo,Map<Long, EntCacheResDto> entCacheResDtoMap) {
+    public void initLogisticsScore(LogisticListReq.TradeBaseInfo baseInfo) {
         KwcContractLogisticsScore logisticsScore = new KwcContractLogisticsScore();
 
         long scoreId = new IdWorker(1L).nextId();
@@ -223,8 +238,6 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
         //自动派单合同的托运单位等于当前登陆企业
         logisticsScore.setProviderEntId(baseInfo.getProvideEntId());
         logisticsScore.setLogisticsEntId(baseInfo.getPurchaseEntId());
-        EntCacheResDto logisticsEnt = entCacheResDtoMap.get(baseInfo.getPurchaseEntId());
-        logisticsScore.setLogisticsEntName(logisticsEnt != null ? logisticsEnt.getFirmName() : null);
         logisticsScore.setScore(new BigDecimal(customConfig.getLogisticsInitScore()));
         logisticsScore.setCreateBy(LoginUserHolder.getUserId());
         Date date = new Date();
@@ -244,23 +257,14 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
                 LogisticsScoreDetailAddDto detailDto  = new LogisticsScoreDetailAddDto();
                 detailDto.setScoreId(scoreId);
                 detailDto.setInfluenceBy(LoginUserHolder.getUserId());
-                detailDto.setInfluenceByName(LoginUserHolder.getUserName());
                 detailDto.setAction("物流企业评分初始化");
                 detailDto.setScoreChange(logisticsScore.getScore());
                 detailDto.setScore(logisticsScore.getScore());
                 detailDto.setStatus(NumberConstant.ONE);
-                initLogisticsScoreDetail(detailDto);
-
-                //初始化司机评分,需要传参供应企业id,物流企业id,供应企业名称,评分变动,当前物流企业评分,变动原因
-                UpdateDriverScoreDto updateDriverScoreDto = new UpdateDriverScoreDto();
-                updateDriverScoreDto.setProviderEntId(logisticsScore.getProviderEntId());
-                updateDriverScoreDto.setLogisticsEntId(logisticsScore.getLogisticsEntId());
-                updateDriverScoreDto.setProviderEntName(LoginUserHolder.getEntName());
-                updateDriverScoreDto.setScoreChange(logisticsScore.getScore());
-                updateDriverScoreDto.setLogisticsEntScore(logisticsScore.getScore());
-                updateDriverScoreDto.setAction(detailDto.getAction());
-                updateDriverScoreDto.setOperatorType(1);
-                driverScoreFeignService.update(updateDriverScoreDto);
+                KwcContractLogisticsScoreDetail logisticsScoreDetail = initLogisticsScoreDetail(detailDto);
+
+                //初始化司机评分
+                updateDriverScore(logisticsScore,logisticsScoreDetail,1);
             }
         } finally {
             RedissonUtils.unlock(lockKey);
@@ -269,10 +273,11 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
 
 
     @Override
-    public void initLogisticsScoreDetail(LogisticsScoreDetailAddDto detailDto) {
+    public KwcContractLogisticsScoreDetail initLogisticsScoreDetail(LogisticsScoreDetailAddDto detailDto) {
         KwcContractLogisticsScoreDetail logisticsScoreDetail = buildLogisticsScoreDetail(detailDto);
         logisticsScoreDetail.setScore(logisticsScoreDetail.getScoreChange());
         kwcContractLogisticsScoreDetailMapper.insertKwcContractLogisticsScoreDetail(logisticsScoreDetail);
+        return logisticsScoreDetail;
     }
 
 
@@ -319,16 +324,8 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
                     logisticsScoreDetail.setUpdateBy(LoginUserHolder.getUserId());
                     logisticsScoreDetail.setUpdateTime(new Date());
                     kwcContractLogisticsScoreDetailMapper.updateKwcContractLogisticsScoreDetail(logisticsScoreDetail);
-                    //修改司机评分,需要传参供应企业id,物流企业id,供应企业名称,评分变动,当前物流企业评分,变动原因
-                    UpdateDriverScoreDto updateDriverScoreDto = new UpdateDriverScoreDto();
-                    updateDriverScoreDto.setProviderEntId(logisticsScore.getProviderEntId());
-                    updateDriverScoreDto.setLogisticsEntId(logisticsScore.getLogisticsEntId());
-                    updateDriverScoreDto.setProviderEntName(LoginUserHolder.getEntName());
-                    updateDriverScoreDto.setScoreChange(logisticsScoreDetail.getScoreChange());
-                    updateDriverScoreDto.setLogisticsEntScore(logisticsScore.getScore());
-                    updateDriverScoreDto.setAction(logisticsScoreDetail.getAction());
-                    updateDriverScoreDto.setOperatorType(2);
-                    driverScoreFeignService.update(updateDriverScoreDto);
+                    //修改司机评分
+                    updateDriverScore(logisticsScore,logisticsScoreDetail,2);
                 }
             }else{
                 throw new BusinessException("该评分已审批完成");
@@ -368,7 +365,6 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
             }
             //用户修改评分
             detailDto.setInfluenceBy(LoginUserHolder.getUserId());
-            detailDto.setInfluenceByName(LoginUserHolder.getUserName());
             detailDto.setStatus(NumberConstant.ZERO);
             detailDto.setAction("修改企业评分,原因:"+detailDto.getAction());
             KwcContractLogisticsScoreDetail logisticsScoreDetail = buildLogisticsScoreDetail(detailDto);
@@ -401,7 +397,6 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
         LogisticsScoreDetailAddDto detailAddDto = new LogisticsScoreDetailAddDto();
         detailAddDto.setScoreId(logisticsScore.getId());
         detailAddDto.setInfluenceBy(detailDto.getInfluenceBy());
-        detailAddDto.setInfluenceByName(detailDto.getInfluenceByName());
         detailAddDto.setAction(detailDto.getAction());
         detailAddDto.setScoreChange(detailDto.getScoreChange());
         detailAddDto.setScore(resultScore);
@@ -435,17 +430,8 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
             kwcContractLogisticsScoreDetailMapper.insertKwcContractLogisticsScoreDetail(resetLogisticsScoreDetail);
             //4.清除待审核评分
             kwcContractLogisticsScoreDetailMapper.deleteKwcContractLogisticsScoreDetailByScoreId(logisticsScore.getId(),NumberConstant.ZERO);
-            //重置司机评分,需要传参供应企业id,物流企业id,供应企业名称,评分变动,当前物流企业评分,变动原因
-            UpdateDriverScoreDto updateDriverScoreDto = new UpdateDriverScoreDto();
-            updateDriverScoreDto.setProviderEntId(logisticsScore.getProviderEntId());
-            updateDriverScoreDto.setLogisticsEntId(logisticsScore.getLogisticsEntId());
-            updateDriverScoreDto.setProviderEntName(LoginUserHolder.getEntName());
-            updateDriverScoreDto.setScoreChange(resetLogisticsScoreDetail.getScoreChange());
-            updateDriverScoreDto.setLogisticsEntScore(logisticsScore.getScore());
-            updateDriverScoreDto.setAction(resetLogisticsScoreDetail.getAction());
-            updateDriverScoreDto.setOperatorType(3);
-            driverScoreFeignService.update(updateDriverScoreDto);
-
+            //重置司机评分
+            updateDriverScore(logisticsScore,resetLogisticsScoreDetail,3);
 
         } finally {
             RedissonUtils.unlock(lockKey);
@@ -453,6 +439,21 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
     }
 
 
+    private void updateDriverScore(KwcContractLogisticsScore logisticsScore,KwcContractLogisticsScoreDetail logisticsScoreDetail,Integer operatorType){
+        UpdateDriverScoreDto updateDriverScoreDto = new UpdateDriverScoreDto();
+        updateDriverScoreDto.setProviderEntId(logisticsScore.getProviderEntId());
+        updateDriverScoreDto.setLogisticsEntId(logisticsScore.getLogisticsEntId());
+        updateDriverScoreDto.setScoreChange(logisticsScoreDetail.getScoreChange());
+        updateDriverScoreDto.setLogisticsEntScore(logisticsScore.getScore());
+        updateDriverScoreDto.setAction(logisticsScoreDetail.getAction());
+        updateDriverScoreDto.setOperatorType(operatorType);
+        HttpResult result = driverScoreFeignService.update(updateDriverScoreDto);
+        if(result.getCode()!= HttpStatus.SUCCESS_CODE){
+            log.error("更新司机评分失败,原因:{}",result.getMsg());
+            throw new BusinessException("更新司机评分失败,原因:"+result.getMsg());
+        }
+    }
+
     /**
      * 构建重置评分记录明细
      *
@@ -465,7 +466,6 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
         logisticsScoreDetail.setId(scoreDetailId);
         logisticsScoreDetail.setScoreId(scoreId);
         logisticsScoreDetail.setInfluenceBy(LoginUserHolder.getUserId());
-        logisticsScoreDetail.setInfluenceByName(LoginUserHolder.getUserName());
         logisticsScoreDetail.setAction("重置企业评分");
         logisticsScoreDetail.setScore(new BigDecimal(customConfig.getLogisticsInitScore()));
         logisticsScoreDetail.setScoreChange(null);
@@ -484,7 +484,6 @@ public class KwcContractLogisticsScoreServiceImpl implements IKwcContractLogisti
         logisticsScoreDetail.setId(scoreDetailId);
         logisticsScoreDetail.setScoreId(detailDto.getScoreId());
         logisticsScoreDetail.setInfluenceBy(detailDto.getInfluenceBy());
-        logisticsScoreDetail.setInfluenceByName(detailDto.getInfluenceByName());
         logisticsScoreDetail.setAction(detailDto.getAction());
         logisticsScoreDetail.setScoreChange(detailDto.getScoreChange());
         logisticsScoreDetail.setScore(detailDto.getScore());

+ 7 - 2
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/service/operateService/KwcContractLogisticsService.java

@@ -1284,7 +1284,12 @@ public class KwcContractLogisticsService {
 
         saveContractLogistics.setStatus(ContractStatusEnum.SUBMIT.getCode());
         saveContractLogistics.setCreateBy(LoginUserHolder.getUserId());
-        saveContractLogistics.setCreateTime(date);
+        if (Objects.nonNull(req.getId())){
+            saveContractLogistics.setCreateTime(null);
+        }else {
+            saveContractLogistics.setCreateTime(date);
+        }
+
         saveContractLogistics.setUpdateBy(LoginUserHolder.getUserId());
         saveContractLogistics.setUpdateTime(date);
         saveContractLogistics.setCommonPrice(baseInfo.getCommonPrice());
@@ -1301,7 +1306,7 @@ public class KwcContractLogisticsService {
 
         //如果是自动派单合同需要初始化物流企业评分记录和评分记录明细
         if(DispatchingTypeEnum.AUTO.getValue().equals(baseInfo.getDispatching())){
-            logisticsScoreService.initLogisticsScore(baseInfo,entCacheResDtoMap);
+            logisticsScoreService.initLogisticsScore(baseInfo);
         }
         return Boolean.TRUE;
     }

+ 1 - 4
sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractLogisticsScoreDetailMapper.xml

@@ -8,7 +8,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id"    column="id"    />
         <result property="scoreId"    column="score_id"    />
         <result property="influenceBy"    column="influence_by"    />
-        <result property="influenceByName"    column="influence_by_name"    />
         <result property="action"    column="action"    />
         <result property="scoreChange"    column="score_change"    />
         <result property="score"    column="score"    />
@@ -20,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectKwcContractLogisticsScoreDetailVo">
-        select id, score_id, influence_by, influence_by_name, action, score_change, score, status, create_by, create_time, update_by, update_time from kwc_contract_logistics_score_detail
+        select id, score_id, influence_by, action, score_change, score, status, create_by, create_time, update_by, update_time from kwc_contract_logistics_score_detail
     </sql>
 
     <select id="selectKwcContractLogisticsScoreDetailList" parameterType="com.sckw.contract.model.dto.req.LogisticsScoreDetailQueryDto" resultMap="KwcContractLogisticsScoreDetailResult">
@@ -56,7 +55,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="id != null">id,</if>
             <if test="scoreId != null">score_id,</if>
             <if test="influenceBy != null">influence_by,</if>
-            <if test="influenceByName != null and influenceByName != ''">influence_by_name,</if>
             <if test="action != null and action != ''">action,</if>
             <if test="scoreChange != null">score_change,</if>
             <if test="score != null">score,</if>
@@ -70,7 +68,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="id != null">#{id},</if>
             <if test="scoreId != null">#{scoreId},</if>
             <if test="influenceBy != null">#{influenceBy},</if>
-            <if test="influenceByName != null and influenceByName != ''">#{influenceByName},</if>
             <if test="action != null and action != ''">#{action},</if>
             <if test="scoreChange != null">#{scoreChange},</if>
             <if test="score != null">#{score},</if>

+ 1 - 4
sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractLogisticsScoreMapper.xml

@@ -8,7 +8,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id"    column="id"    />
         <result property="providerEntId"    column="provider_ent_id"    />
         <result property="logisticsEntId"    column="logistics_ent_id"    />
-        <result property="logisticsEntName"    column="logistics_ent_name"    />
         <result property="score"    column="score"    />
         <result property="createBy"    column="create_by"    />
         <result property="createTime"    column="create_time"    />
@@ -17,7 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectKwcContractLogisticsScoreVo">
-        select id, provider_ent_id, logistics_ent_id, logistics_ent_name, score, create_by, create_time, update_by, update_time from kwc_contract_logistics_score
+        select id, provider_ent_id, logistics_ent_id, score, create_by, create_time, update_by, update_time from kwc_contract_logistics_score
     </sql>
 
     <select id="selectKwcContractLogisticsScoreList" parameterType="com.sckw.contract.model.dto.req.LogisticsScoreQueryDto" resultMap="KwcContractLogisticsScoreResult">
@@ -52,7 +51,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="id != null">id,</if>
             <if test="providerEntId != null">provider_ent_id,</if>
             <if test="logisticsEntId != null">logistics_ent_id,</if>
-            <if test="logisticsEntName != null and logisticsEntName != ''">logistics_ent_name,</if>
             <if test="score != null">score,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
@@ -63,7 +61,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="id != null">#{id},</if>
             <if test="providerEntId != null">#{providerEntId},</if>
             <if test="logisticsEntId != null">#{logisticsEntId},</if>
-            <if test="logisticsEntName != null and logisticsEntName != ''">#{logisticsEntName},</if>
             <if test="score != null">#{score},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>

+ 3 - 2
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfDriverScoreController.java

@@ -1,6 +1,7 @@
 package com.sckw.fleet.controller;
 
 import com.sckw.core.web.response.BaseResult;
+import com.sckw.core.web.response.HttpResult;
 import com.sckw.fleet.api.model.dto.UpdateDriverScoreDto;
 import com.sckw.fleet.service.KwfDriverScoreService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -26,8 +27,8 @@ public class KwfDriverScoreController {
      * 更新司机评分
      */
     @PostMapping("/update")
-    public BaseResult<Boolean> update(@Validated @RequestBody UpdateDriverScoreDto updateDriverScoreDto) {
+    public HttpResult update(@Validated @RequestBody UpdateDriverScoreDto updateDriverScoreDto) {
         kwfDriverScoreService.update(updateDriverScoreDto);
-        return BaseResult.success();
+        return HttpResult.ok();
     }
 }

+ 23 - 0
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/dubbo/RemoteFleetServiceImpl.java

@@ -16,7 +16,10 @@ import com.sckw.fleet.dao.KwfDriverMapper;
 import com.sckw.fleet.dao.KwfTruckMapper;
 import com.sckw.fleet.model.*;
 import com.sckw.fleet.repository.*;
+import com.sckw.system.api.RemoteSystemService;
+import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import lombok.RequiredArgsConstructor;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.apache.dubbo.config.annotation.DubboService;
 import org.jetbrains.annotations.NotNull;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -41,6 +44,8 @@ public class RemoteFleetServiceImpl implements RemoteFleetService {
     @Autowired
     KwfDriverMapper driverDao;
     private final KwfFleetRepository fleetRepository;
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteSystemService remoteSystemService;
 
     private final KwfTruckRepository kwfTruckRepository;
     private final KwfDriverRepository driverRepository;
@@ -647,6 +652,24 @@ public class RemoteFleetServiceImpl implements RemoteFleetService {
 
         return vo;
     }
+
+    /**
+     *  获取司机评分数据
+     * @param driverScore 车辆对象
+     * @return 车辆数据
+     */
+    private RDriverScoreVo getDriverScoreVo(KwfDriverScore driverScore) {
+        EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(driverScore.getProviderEntId());
+        RDriverScoreVo vo = new RDriverScoreVo();
+        vo.setProviderEntId(driverScore.getProviderEntId());
+        vo.setLogisticsEntId(driverScore.getLogisticsEntId());
+        vo.setDriverId(driverScore.getDriverId());
+        vo.setProviderEntName(entCacheResDto.getFirmName());
+        vo.setScore(driverScore.getScore());
+        return vo;
+    }
+
+
     public void updateDriverScoreIdByEntIds(RUpdateDriverScoreDto score) {
         KwfDriverScore driverScore = new KwfDriverScore();
         driverScore.setId(score.getId());

+ 0 - 3
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/KwfDriverScore.java

@@ -29,9 +29,6 @@ public class KwfDriverScore extends BaseModel
     /** 司机id */
     private Long driverId;
 
-    /** 供应商企业名称 */
-    private String providerEntName;
-
     /** 司机评分 */
     private BigDecimal score;
 }

+ 0 - 7
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/KwfDriverScoreDetail.java

@@ -25,9 +25,6 @@ public class KwfDriverScoreDetail extends BaseModel {
     /** 司机id */
     private Long driverId;
 
-    /** 司机名字 */
-    private String driverName;
-
     /** 行为 */
     private String action;
 
@@ -36,8 +33,4 @@ public class KwfDriverScoreDetail extends BaseModel {
 
     /** 变动后评分 */
     private BigDecimal score;
-
-    /** 物流企业名称 */
-    @TableField(exist = false)
-    private String logisticsEntName;
 }

+ 0 - 2
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverScoreService.java

@@ -179,7 +179,6 @@ public class KwfDriverScoreService {
             driverScore.setProviderEntId(updateDriverScoreDto.getProviderEntId());
             driverScore.setLogisticsEntId(updateDriverScoreDto.getLogisticsEntId());
             driverScore.setDriverId(driver.getId());
-            driverScore.setProviderEntName(updateDriverScoreDto.getProviderEntName());
             driverScore.setScore(updateDriverScoreDto.getLogisticsEntScore());
             driverScore.setCreateBy(LoginUserHolder.getUserId());
             driverScore.setCreateTime(now);
@@ -240,7 +239,6 @@ public class KwfDriverScoreService {
         scoreDetail.setScoreId(driverScore.getId());
         if(driver != null){
             scoreDetail.setDriverId(driver.getId());
-            scoreDetail.setDriverName(driver.getName());
         }
         scoreDetail.setAction(updateDriverScoreDto.getAction());
         BigDecimal scoreChange = driverScore.getScore().subtract(originDriverScore);

+ 30 - 1
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverService.java

@@ -38,6 +38,7 @@ import com.sckw.redis.constant.RedisConstant;
 import com.sckw.redis.utils.RedissonUtils;
 import com.sckw.system.api.RemoteSystemService;
 import com.sckw.system.api.RemoteUserService;
+import com.sckw.system.api.model.dto.req.KwsUserReqDto;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import com.sckw.system.api.model.dto.res.SysDictResDto;
 import com.sckw.system.api.model.dto.res.UserCacheResDto;
@@ -465,10 +466,38 @@ public class KwfDriverService {
 
         /**车队班组绑定**/
         driverFleetEdit(driver.getId(), params.getFleetId());
-
+        //同步信息到员工列表
+        userEdit(params);
         return HttpResult.ok(result.getMsg(), driver);
     }
 
+    private void userEdit(KwfDriverDto params) {
+        KwsUserReqDto kwsUserReqDto = new KwsUserReqDto();
+        //密码为空时,以登录名作为密码
+        String salt = PasswordUtils.generateSalt();
+        kwsUserReqDto.setSystemType(LoginUserHolder.getSystemType());
+        kwsUserReqDto.setEntId(LoginUserHolder.getEntId());
+        kwsUserReqDto.setAccount(params.getPhone());
+        String password  =  PasswordUtils.entryptPassword(params.getPhone() + PasswordUtils.md5(params.getPhone()), salt);
+        kwsUserReqDto.setPassword(password);
+        kwsUserReqDto.setName(params.getName());
+        kwsUserReqDto.setPhone(params.getPhone());
+        kwsUserReqDto.setPhoto("");
+        kwsUserReqDto.setEmail("");
+        kwsUserReqDto.setClientId("");
+        kwsUserReqDto.setIsMain(0);
+        kwsUserReqDto.setSalt(salt);
+        kwsUserReqDto.setRemark("司机管理");
+        kwsUserReqDto.setStatus(0);
+        kwsUserReqDto.setCreateBy(LoginUserHolder.getUserId());
+        Date date = new Date();
+        kwsUserReqDto.setCreateTime(date);
+        kwsUserReqDto.setUpdateBy(LoginUserHolder.getUserId());
+        kwsUserReqDto.setUpdateTime(date);
+        kwsUserReqDto.setDelFlag(0);
+        remoteUserService.saveUser(kwsUserReqDto);
+    }
+
     /**
      * @param params 参数
      * @desc 修改司机

+ 1 - 7
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverScoreDetailMapper.xml

@@ -8,7 +8,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id"    column="id"    />
         <result property="scoreId"    column="score_id"    />
         <result property="driverId"    column="driver_id"    />
-        <result property="driverName"    column="driver_name"    />
         <result property="action"    column="action"    />
         <result property="scoreChange"    column="score_change"    />
         <result property="score"    column="score"    />
@@ -19,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectKwfDriverScoreDetailVo">
-        select id, score_id, driver_id, driver_name, action, score_change, score, create_by, create_time, update_by, update_time from kwf_driver_score_detail
+        select id, score_id, driver_id, action, score_change, score, create_by, create_time, update_by, update_time from kwf_driver_score_detail
     </sql>
 
     <select id="selectKwfDriverScoreDetailList" parameterType="com.sckw.fleet.model.KwfDriverScoreDetail" resultMap="KwfDriverScoreDetailResult">
@@ -42,7 +41,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="id != null">id,</if>
             <if test="scoreId != null">score_id,</if>
             <if test="driverId != null">driver_id,</if>
-            <if test="driverName != null and driverName != ''">driver_name,</if>
             <if test="action != null and action != ''">action,</if>
             <if test="scoreChange != null">score_change,</if>
             <if test="score != null">score,</if>
@@ -55,7 +53,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="id != null">#{id},</if>
             <if test="scoreId != null">#{scoreId},</if>
             <if test="driverId != null">#{driverId},</if>
-            <if test="driverName != null and driverName != ''">#{driverName},</if>
             <if test="action != null and action != ''">#{action},</if>
             <if test="scoreChange != null">#{scoreChange},</if>
             <if test="score != null">#{score},</if>
@@ -72,7 +69,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="id != null">id,</if>
             <if test="scoreId != null">score_id,</if>
             <if test="driverId != null">driver_id,</if>
-            <if test="driverName != null and driverName != ''">driver_name,</if>
             <if test="action != null and action != ''">action,</if>
             <if test="scoreChange != null">score_change,</if>
             <if test="score != null">score,</if>
@@ -87,7 +83,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 <if test="id != null">#{scoreDetail.id},</if>
                 <if test="scoreId != null">#{scoreDetail.scoreId},</if>
                 <if test="driverId != null">#{scoreDetail.driverId},</if>
-                <if test="driverName != null and driverName != ''">#{scoreDetail.driverName},</if>
                 <if test="action != null and action != ''">#{scoreDetail.action},</if>
                 <if test="scoreChange != null">#{scoreDetail.scoreChange},</if>
                 <if test="score != null">#{scoreDetail.score},</if>
@@ -104,7 +99,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="SET" suffixOverrides=",">
             <if test="scoreId != null">score_id = #{scoreId},</if>
             <if test="driverId != null">driver_id = #{driverId},</if>
-            <if test="driverName != null and driverName != ''">driver_name = #{driverName},</if>
             <if test="action != null and action != ''">action = #{action},</if>
             <if test="scoreChange != null">score_change = #{scoreChange},</if>
             <if test="score != null">score = #{score},</if>

+ 1 - 7
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverScoreMapper.xml

@@ -9,7 +9,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="providerEntId"    column="provider_ent_id"    />
         <result property="logisticsEntId"    column="logistics_ent_id"    />
         <result property="driverId"    column="driver_id"    />
-        <result property="providerEntName"    column="provider_ent_name"    />
         <result property="score"    column="score"    />
         <result property="createBy"    column="create_by"    />
         <result property="createTime"    column="create_time"    />
@@ -18,7 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectKwfDriverScoreVo">
-        select id, provider_ent_id, logistics_ent_id, driver_id, provider_ent_name, score, create_by, create_time, update_by, update_time from kwf_driver_score
+        select id, provider_ent_id, logistics_ent_id, driver_id, score, create_by, create_time, update_by, update_time from kwf_driver_score
     </sql>
 
     <select id="selectKwfDriverScoreList" parameterType="com.sckw.fleet.model.KwfDriverScore" resultMap="KwfDriverScoreResult">
@@ -42,7 +41,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="providerEntId != null">provider_ent_id,</if>
             <if test="logisticsEntId != null">logistics_ent_id,</if>
             <if test="driverId != null">driver_id,</if>
-            <if test="providerEntName != null and providerEntName != ''">provider_ent_name,</if>
             <if test="score != null">score,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
@@ -54,7 +52,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="providerEntId != null">#{providerEntId},</if>
             <if test="logisticsEntId != null">#{logisticsEntId},</if>
             <if test="driverId != null">#{driverId},</if>
-            <if test="providerEntName != null and providerEntName != ''">#{providerEntName},</if>
             <if test="score != null">#{score},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
@@ -70,7 +67,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="providerEntId != null">provider_ent_id,</if>
             <if test="logisticsEntId != null">logistics_ent_id,</if>
             <if test="driverId != null">driver_id,</if>
-            <if test="providerEntName != null and providerEntName != ''">provider_ent_name,</if>
             <if test="score != null">score,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
@@ -84,7 +80,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 <if test="providerEntId != null">#{driverScore.providerEntId},</if>
                 <if test="logisticsEntId != null">#{driverScore.logisticsEntId},</if>
                 <if test="driverId != null">#{driverScore.driverId},</if>
-                <if test="providerEntName != null and providerEntName != ''">#{driverScore.providerEntName},</if>
                 <if test="score != null">#{driverScore.score},</if>
                 <if test="createBy != null">#{driverScore.createBy},</if>
                 <if test="createTime != null">#{driverScore.createTime},</if>
@@ -100,7 +95,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="providerEntId != null">provider_ent_id = #{providerEntId},</if>
             <if test="logisticsEntId != null">logistics_ent_id = #{logisticsEntId},</if>
             <if test="driverId != null">driver_id = #{driverId},</if>
-            <if test="providerEntName != null and providerEntName != ''">provider_ent_name = #{providerEntName},</if>
             <if test="score != null">score = #{score},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>

+ 14 - 1
sckw-modules/sckw-order/src/main/java/com/sckw/order/controller/KwoTradeOrderController.java

@@ -1,11 +1,14 @@
 package com.sckw.order.controller;
 
+import cn.hutool.core.date.LocalDateTimeUtil;
 import com.sckw.core.annotation.RepeatSubmit;
 import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.utils.ExcelUtil;
+import com.sckw.order.api.model.TradeOrderPara;
+import com.sckw.order.enums.OrderPara;
 import com.sckw.order.model.vo.req.*;
 import com.sckw.order.serivce.KwoTradeOrderService;
 import io.seata.spring.annotation.GlobalTransactional;
@@ -13,6 +16,7 @@ import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import jakarta.servlet.http.HttpServletResponse;
 import lombok.RequiredArgsConstructor;
+import org.springdoc.core.annotations.ParameterObject;
 import org.springframework.http.MediaType;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -32,7 +36,7 @@ public class KwoTradeOrderController {
 
     private final KwoTradeOrderService kwoTradeOrderService;
 
-//    /**
+    //    /**
 //     * @desc: 采购下单草稿
 //     * @author: yzc
 //     * @date: 2023-07-07 15:29
@@ -46,6 +50,15 @@ public class KwoTradeOrderController {
 //        kwoTradeOrderService.addPurchaseOrderDraft(param);
 //        return HttpResult.ok("采购下单草稿保存成功");
 //    }
+    @RequestMapping(value = "/trade", method = RequestMethod.GET)
+    @Operation(summary = "查询贸易订单", description = "查询贸易订单")
+    public HttpResult selectAll(@ParameterObject OrderPara orderPara) {
+        TradeOrderPara tradeOrderPara = new TradeOrderPara();
+        tradeOrderPara.setStartTime(LocalDateTimeUtil.parse(orderPara.getStartTime(), "yyyy-MM-dd HH:mm:ss"));
+        tradeOrderPara.setEndTime(LocalDateTimeUtil.parse(orderPara.getEndTime(), "yyyy-MM-dd HH:mm:ss"));
+        orderPara.setUserId(orderPara.getUserId());
+        return HttpResult.ok("查询成功", kwoTradeOrderService.queryOrder(tradeOrderPara));
+    }
 
     /**
      * @desc: 采购下单提交

+ 21 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/enums/OrderPara.java

@@ -0,0 +1,21 @@
+package com.sckw.order.enums;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author xucaiqin
+ * @date 2025-12-02 19:41:55
+ */
+@Getter
+@Setter
+@Schema(description = "贸易订单查询参数")
+public class OrderPara {
+    @Schema(description = "开始时间")
+    private String startTime;
+    @Schema(description = "结束时间")
+    private String endTime;
+    @Schema(description = "用户id")
+    private Long userId;
+}

+ 10 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTradeOrderService.java

@@ -74,6 +74,7 @@ import com.sckw.stream.model.SckwMessage;
 import com.sckw.stream.model.UserInfo;
 import com.sckw.system.api.RemoteSystemService;
 import com.sckw.system.api.model.dto.req.ActualDisPatchDto;
+import com.sckw.system.api.RemoteUserService;
 import com.sckw.system.api.model.dto.res.*;
 import com.sckw.transport.api.dubbo.TransportRemoteService;
 import com.sckw.transport.api.model.param.AddLogisticOrderParam;
@@ -108,6 +109,8 @@ public class KwoTradeOrderService {
 
     @DubboReference(version = "1.0.0", group = "design", check = false)
     private RemoteSystemService remoteSystemService;
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteUserService remoteUserService;
 
     @DubboReference(version = "1.0.0", group = "design", check = false)
     private RemoteManageService remoteManageService;
@@ -2487,6 +2490,13 @@ public class KwoTradeOrderService {
     }
 
     public List<TradeOrderVo> queryOrder(TradeOrderPara tradeOrderPara) {
+        UserResDto userResDto = remoteSystemService.queryUserById(tradeOrderPara.getUserId());
+        if (Objects.nonNull(userResDto)) {
+            Integer systemType = userResDto.getSystemType();
+            if (!Objects.equals(systemType, SystemTypeEnum.MANAGE.getCode())) {
+                tradeOrderPara.setEntId(remoteUserService.findChildEntList(userResDto.getEntId()));
+            }
+        }
         List<TradeOrderVo> tradeOrderVos = kwoTradeOrderMapper.selectData(tradeOrderPara);
         if (CollUtil.isNotEmpty(tradeOrderVos)) {
             Map<String, Map<String, String>> dict = remoteSystemService.queryDictByType(List.of(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), DictTypeEnum.UNIT_TYPE.getType(), DictTypeEnum.CHARGING_TYPE.getType()));

+ 17 - 3
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteSystemServiceImpl.java

@@ -1,5 +1,6 @@
 package com.sckw.system.dubbo;
 
+import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
@@ -9,6 +10,10 @@ import com.sckw.core.exception.BusinessPlatfromException;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.enums.EntTypeEnum;
 import com.sckw.core.utils.*;
+import com.sckw.core.utils.BeanUtils;
+import com.sckw.core.utils.CollectionUtils;
+import com.sckw.core.utils.FileUtils;
+import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.response.result.PageDataResult;
 import com.sckw.redis.utils.RedissonUtils;
 import com.sckw.system.api.RemoteSystemService;
@@ -590,7 +595,7 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
 //                return userCacheResDto;
 //            }
 
-           // Long entId = kwsDeptResDtos.get(0).getEntId();
+            // Long entId = kwsDeptResDtos.get(0).getEntId();
             KwsEnterpriseResDto kwsEnterpriseResDto = remoteBaseService.queryEnterpriseById(kwsUser.getEntId());
             if (Objects.isNull(kwsEnterpriseResDto)) {
                 return userCacheResDto;
@@ -608,6 +613,15 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
         return JSONObject.parseObject(dictCache, UserCacheResDto.class);
     }
 
+    @Override
+    public UserResDto queryUserById(Long userId) {
+        KwsUser kwsUser = kwsUserService.selectByKey(userId);
+        if (Objects.nonNull(kwsUser)) {
+            return BeanUtil.toBean(kwsUser, UserResDto.class);
+        }
+        return null;
+    }
+
     @Override
     public List<UserCacheResDto> queryUserCacheByIds(List<Long> userIds) {
         if (CollectionUtils.isEmpty(userIds)) {
@@ -930,7 +944,7 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
     @Override
     public KwsRoleDto queryByRoleIdAndEntId(Long currentRoleId) {
         KwsRole kwsRole = kwsRoleDao.selectByKey(currentRoleId);
-        if (Objects.isNull(kwsRole)){
+        if (Objects.isNull(kwsRole)) {
             return new KwsRoleDto();
         }
         KwsRoleDto kwsRoleDto = new KwsRoleDto();
@@ -944,7 +958,7 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
     @Override
     public List<EntTypeResDto> queryEntTypeByIds(Set<Long> entIds) {
         List<KwsEntType> kwsEnterprises = kwsEntTypeRepository.queryByEntIds(entIds);
-        if (org.apache.commons.collections4.CollectionUtils.isEmpty(kwsEnterprises)){
+        if (org.apache.commons.collections4.CollectionUtils.isEmpty(kwsEnterprises)) {
             return List.of();
         }
         return kwsEnterprises.stream()

+ 19 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteUserServiceImpl.java

@@ -1,9 +1,11 @@
 package com.sckw.system.dubbo;
 
 import cn.hutool.core.collection.CollUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.SystemException;
+import com.sckw.core.model.base.BaseModel;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
@@ -468,6 +470,23 @@ public class RemoteUserServiceImpl implements RemoteUserService {
         return enterpriseIds;
     }
 
+    @Override
+    public void saveUser(KwsUserReqDto kwsUserReqDto) {
+        KwsUser kwsUser = new KwsUser();
+        BeanUtils.copyProperties(kwsUserReqDto, kwsUser);
+        KwsUser kwsUser1 = userDao.selectOne(Wrappers.<KwsUser>lambdaQuery()
+                .eq(KwsUser::getPhone, kwsUser.getPhone())
+                .eq(BaseModel::getDelFlag, 0)
+                .last("limit 1"));
+        if (Objects.isNull(kwsUser1)){
+            userDao.insert(kwsUser);
+        }else {
+            kwsUser.setId(kwsUser1.getId());
+            kwsUser.setCreateTime(null);
+            userDao.updateById(kwsUser);
+        }
+    }
+
     /**
      * 根据用户名查用户信息
      *

+ 3 - 1
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/handler/ComeIntoHandler.java

@@ -97,10 +97,12 @@ public class ComeIntoHandler extends AbstractWaybillOrderHandler<WaybillOrderCme
         node1.setRemark("车辆[" + waybillOrder.getTruckNo() + "]已到达装货点");
         waybillOrderNodeRepository.save(node1);
         log.info("记录【已装货】节点轨迹成功,节点ID:{}", node1.getId());
-
+        // 间隔5秒钟,防止时间相同
+        Date fiveSecondsLater = new Date(System.currentTimeMillis() + 5000);
         // 第二条:称重信息
         KwtWaybillOrderNode node2 = getWaybillOrderNode(param, waybillOrder);
         node2.setRemark("[" + param.getWeighbridgeName() + "]称重[" + param.getTareAmount() + "吨]");
+        node2.setCreateTime(fiveSecondsLater);
         waybillOrderNodeRepository.save(node2);
         log.info("记录【称重】节点轨迹成功,节点ID:{}", node2.getId());
     }

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

@@ -3288,7 +3288,7 @@ public class KwtAcceptCarriageOrderService {
             // 3.1 核心告警:记录未派足的情况
             log.error("派车未完成!实际需派{}辆,仅派{}辆,缺{}辆无可用车辆", actualDisPatch, dispatched, unDispatched);
         }
-        
+
         // 批量保存并检查结果
         saveBatch(saveLogisticsOrderList, saveAddressList, savelogOrderGoodsList, saveContractList, savelogOrderUnitList, lOrderNo);
     }
@@ -3440,6 +3440,7 @@ public class KwtAcceptCarriageOrderService {
         List<Long> entIds = new ArrayList<>();
         entIds.add(orderDTO.getConsignCompanyId());
         entIds.add(x.getAcceptCompanyId());
+        entIds.add(orderDTO.getNonConsignCompanyId());
         Map<Long, EntCacheResDto> entMap = remoteSystemService.queryEntTreeByIds(entIds);
         EntCacheResDto ent = entMap.get(orderDTO.getConsignCompanyId());
         if (Objects.isNull(ent)) {

+ 1 - 1
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtWaybillOrderV1Service.java

@@ -3496,7 +3496,7 @@ public class KwtWaybillOrderV1Service {
         waybillOrderDetailResp.setDriverPhone(billOrder.getDriverPhone());
         waybillOrderDetailResp.setDriverIdCard(billOrder.getDriverIdcard());
         if (Objects.nonNull(kwpGoods)){
-            SysDictResDto sysDictResDto = dictValueAndDictResDtoMap.getOrDefault(goods.getGoodsType(), new SysDictResDto());
+            SysDictResDto sysDictResDto = dictValueAndDictResDtoMap.getOrDefault(kwpGoods.getGoodsType(), new SysDictResDto());
             waybillOrderDetailResp.setGoodsName(kwpGoods.getName()+ "/" +sysDictResDto.getLabel()+"/"+ kwpGoods.getSpec());
         }
         KwtWaybillOrderAddress loadAdd = keyAndAddressMap.getOrDefault(billOrder.getId() + "-" + AddressTypeEnum.SHIPMENT.getCode(), new KwtWaybillOrderAddress());

+ 2 - 1
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/app/WaybillOrderService.java

@@ -124,7 +124,8 @@ public class WaybillOrderService {
             CarWaybillV1Enum.PENDING_VEHICLE.getCode(),
             CarWaybillV1Enum.REFUSE_TRAFFIC.getCode(),
             CarWaybillV1Enum.EXIT_COMPLETED.getCode(),
-            CarWaybillV1Enum.WAIT_LOADING.getCode());
+            CarWaybillV1Enum.WAIT_LOADING.getCode(),
+            CarWaybillV1Enum.WEIGHT_TRAFFIC.getCode());
 
     // 定义审核的状态集合
     private static final List<Integer> REVIEW = Arrays.asList(

+ 36 - 3
sql/2025/12/09/2025_12_09_tys_creat.sql

@@ -2,12 +2,12 @@ CREATE TABLE `kwc_contract_logistics_score` (
     `id` bigint NOT NULL COMMENT '主键',
     `provider_ent_id` bigint NOT NULL COMMENT '供应商企业id',
     `logistics_ent_id` bigint NOT NULL COMMENT '物流企业id',
-    `logistics_ent_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '物流企业名称',
     `score` decimal(10,2) NOT NULL COMMENT '物流企业评分',
     `create_by` bigint NOT NULL,
     `create_time` datetime NOT NULL,
     `update_by` bigint NOT NULL,
     `update_time` datetime NOT NULL COMMENT '更新时间',
+    `del_flag` int NOT NULL DEFAULT '0' COMMENT '是否删除(0未删除,1删除)',
     PRIMARY KEY (`id`) USING BTREE,
     UNIQUE KEY `provider_logistics_id_index` (`provider_ent_id`,`logistics_ent_id`) USING BTREE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='物流企业评分表';
@@ -17,7 +17,6 @@ CREATE TABLE `kwc_contract_logistics_score_detail` (
    `id` bigint NOT NULL COMMENT '主键',
    `score_id` bigint NOT NULL COMMENT '评分主键id',
    `influence_by` bigint NOT NULL COMMENT '影响人id',
-   `influence_by_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '影响人名字',
    `action` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '行为',
    `score_change` decimal(10,2) DEFAULT NULL COMMENT '评分变动',
    `score` decimal(10,2) DEFAULT NULL COMMENT '变动后评分',
@@ -26,6 +25,40 @@ CREATE TABLE `kwc_contract_logistics_score_detail` (
    `create_time` datetime NOT NULL,
    `update_by` bigint NOT NULL,
    `update_time` datetime NOT NULL,
+   `del_flag` int NOT NULL DEFAULT '0' COMMENT '是否删除(0未删除,1删除)',
    PRIMARY KEY (`id`) USING BTREE,
    KEY `score_id_index` (`score_id`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='物流企业评分明细表';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='物流企业评分明细表';
+
+
+CREATE TABLE `kwf_driver_score` (
+    `id` bigint NOT NULL COMMENT '主键',
+    `provider_ent_id` bigint NOT NULL COMMENT '供应商企业id',
+    `logistics_ent_id` bigint NOT NULL COMMENT '物流企业id',
+    `driver_id` bigint NOT NULL COMMENT '司机id',
+    `score` decimal(10,2) NOT NULL DEFAULT '60.00' COMMENT '司机评分',
+    `create_by` bigint NOT NULL,
+    `create_time` datetime NOT NULL,
+    `update_by` bigint NOT NULL,
+    `update_time` datetime NOT NULL COMMENT '更新时间',
+    `del_flag` int NOT NULL DEFAULT '0' COMMENT '是否删除(0未删除,1删除)',
+    PRIMARY KEY (`id`) USING BTREE,
+    UNIQUE KEY `provider_logistics_driver_id_index` (`provider_ent_id`,`logistics_ent_id`,`driver_id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='司机评分表';
+
+
+CREATE TABLE `kwf_driver_score_detail` (
+   `id` bigint NOT NULL COMMENT '主键',
+   `score_id` bigint NOT NULL COMMENT '评分主键id',
+   `driver_id` bigint NOT NULL COMMENT '司机id',
+   `action` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '行为',
+   `score_change` decimal(10,2) DEFAULT NULL COMMENT '评分变动',
+   `score` decimal(10,2) DEFAULT NULL COMMENT '变动后评分',
+   `create_by` bigint NOT NULL,
+   `create_time` datetime NOT NULL,
+   `update_by` bigint NOT NULL,
+   `update_time` datetime NOT NULL,
+   `del_flag` int NOT NULL DEFAULT '0' COMMENT '是否删除(0未删除,1删除)',
+   PRIMARY KEY (`id`) USING BTREE,
+   KEY `driver_score_id_index` (`score_id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='司机评分明细表';