提交 21bb9b4d authored 作者: 李瑞鑫's avatar 李瑞鑫

Merge branch 'v20.4_exception_report_20240802'

package com.clx.performance.feign; package com.clx.performance.feign;
import com.clx.open.sdk.request.action.GetOrderBreakContractOwnerRuleFileAction; import com.clx.open.sdk.request.action.GetOrderBreakContractOwnerRuleFileAction;
import com.clx.open.sdk.request.action.GetOwnerAccountInfoAction; import com.clx.open.sdk.request.action.QueryPerformanceProgressAction;
import com.clx.open.sdk.request.action.QueryPerformanceProgressLogAction;
import com.clx.open.sdk.request.dto.OwnerCancelResidueWeightDTO; import com.clx.open.sdk.request.dto.OwnerCancelResidueWeightDTO;
import com.clx.performance.param.pc.OrderCancelParam; import com.clx.performance.param.pc.OrderCancelParam;
import com.clx.performance.vo.pc.OwnerAccountAllVO; import com.clx.performance.vo.pc.OwnerAccountAllVO;
import com.clx.performance.vo.pc.PerformanceProgressOperationLogVO;
import com.clx.performance.vo.pc.PerformanceProgressVO;
import com.clx.performance.vo.pc.breakcontract.carrier.BreakContractOwnerRuleFileVO; import com.clx.performance.vo.pc.breakcontract.carrier.BreakContractOwnerRuleFileVO;
import com.msl.common.result.Result; import com.msl.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
...@@ -13,6 +16,8 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -13,6 +16,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(name = "clx-performance", configuration = PerformanceClientConfiguration.class) @FeignClient(name = "clx-performance", configuration = PerformanceClientConfiguration.class)
public interface PerformanceSDKFeign { public interface PerformanceSDKFeign {
...@@ -34,4 +39,9 @@ public interface PerformanceSDKFeign { ...@@ -34,4 +39,9 @@ public interface PerformanceSDKFeign {
@PostMapping("clx-performance/feign/sdk/getOwnerRuleFile") @PostMapping("clx-performance/feign/sdk/getOwnerRuleFile")
Result<BreakContractOwnerRuleFileVO> getOwnerRuleFile(@RequestBody GetOrderBreakContractOwnerRuleFileAction action); Result<BreakContractOwnerRuleFileVO> getOwnerRuleFile(@RequestBody GetOrderBreakContractOwnerRuleFileAction action);
@GetMapping("clx-performance/feign/sdk/queryPerformanceProgress")
Result<List<PerformanceProgressVO>> queryPerformanceProgress(@RequestBody QueryPerformanceProgressAction action);
@GetMapping("clx-performance/feign/sdk/queryPerformanceProgressLog")
Result<List<PerformanceProgressOperationLogVO>> queryPerformanceProgressLog(@RequestBody QueryPerformanceProgressLogAction action);
} }
...@@ -2,13 +2,18 @@ package com.clx.performance.controller.feign; ...@@ -2,13 +2,18 @@ package com.clx.performance.controller.feign;
import com.clx.open.sdk.request.action.GetOrderBreakContractOwnerRuleFileAction; import com.clx.open.sdk.request.action.GetOrderBreakContractOwnerRuleFileAction;
import com.clx.open.sdk.request.action.GetOwnerAccountInfoAction; import com.clx.open.sdk.request.action.GetOwnerAccountInfoAction;
import com.clx.open.sdk.request.action.QueryPerformanceProgressAction;
import com.clx.open.sdk.request.action.QueryPerformanceProgressLogAction;
import com.clx.open.sdk.request.dto.OwnerCancelResidueWeightDTO; import com.clx.open.sdk.request.dto.OwnerCancelResidueWeightDTO;
import com.clx.performance.param.pc.OrderCancelParam; import com.clx.performance.param.pc.OrderCancelParam;
import com.clx.performance.service.OrderCancelService; import com.clx.performance.service.OrderCancelService;
import com.clx.performance.service.OrderGoodsService; import com.clx.performance.service.OrderGoodsService;
import com.clx.performance.service.OwnerAccountService; import com.clx.performance.service.OwnerAccountService;
import com.clx.performance.service.PerformanceProgressService;
import com.clx.performance.service.breakcontract.BreakContractOwnerRuleService; import com.clx.performance.service.breakcontract.BreakContractOwnerRuleService;
import com.clx.performance.vo.pc.OwnerAccountAllVO; import com.clx.performance.vo.pc.OwnerAccountAllVO;
import com.clx.performance.vo.pc.PerformanceProgressOperationLogVO;
import com.clx.performance.vo.pc.PerformanceProgressVO;
import com.clx.performance.vo.pc.breakcontract.carrier.BreakContractOwnerRuleFileVO; import com.clx.performance.vo.pc.breakcontract.carrier.BreakContractOwnerRuleFileVO;
import com.msl.common.result.Result; import com.msl.common.result.Result;
import com.msl.user.utils.TokenUtil; import com.msl.user.utils.TokenUtil;
...@@ -20,6 +25,9 @@ import org.springframework.validation.annotation.Validated; ...@@ -20,6 +25,9 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
import static com.clx.performance.enums.PerformanceProgressEnum.LogType.PERFORMANCE_ABNORMAL_REASON;
@Slf4j @Slf4j
@RestController @RestController
...@@ -38,6 +46,8 @@ public class PerformanceSdkFeignController { ...@@ -38,6 +46,8 @@ public class PerformanceSdkFeignController {
private final BreakContractOwnerRuleService breakContractOwnerRuleService; private final BreakContractOwnerRuleService breakContractOwnerRuleService;
private final PerformanceProgressService performanceProgressService;
@ApiOperation(value = "货主端取消订单", notes = "<br>By:胡宇帆") @ApiOperation(value = "货主端取消订单", notes = "<br>By:胡宇帆")
@PostMapping("/ownCancelOrderPre") @PostMapping("/ownCancelOrderPre")
...@@ -67,4 +77,15 @@ public class PerformanceSdkFeignController { ...@@ -67,4 +77,15 @@ public class PerformanceSdkFeignController {
return Result.ok(breakContractOwnerRuleService.getRuleFile(action.getId())); return Result.ok(breakContractOwnerRuleService.getRuleFile(action.getId()));
} }
@ApiOperation(value = "查询履约进度", notes = "<br>By:杨启发")
@GetMapping("/queryPerformanceProgress")
Result<List<PerformanceProgressVO>> queryPerformanceProgress(@RequestBody QueryPerformanceProgressAction action){
return Result.ok(performanceProgressService.queryPerformanceProgress(action.getOrderNoList()));
}
@ApiOperation(value = "查询履约进度操作日志", notes = "<br>By:杨启发")
@GetMapping("/queryPerformanceProgressLog")
Result<List<PerformanceProgressOperationLogVO>> queryPerformanceProgressLog(@RequestBody QueryPerformanceProgressLogAction action){
return Result.ok(performanceProgressService.getOperationLog(action.getOrderNo(),PERFORMANCE_ABNORMAL_REASON.getCode()));
}
} }
...@@ -75,7 +75,7 @@ public class CarrierPerformanceProgressController { ...@@ -75,7 +75,7 @@ public class CarrierPerformanceProgressController {
@ApiOperation(value = "获取履约进度编辑日志列表",notes = "<br>By:刘海泉") @ApiOperation(value = "获取履约进度编辑日志列表",notes = "<br>By:刘海泉")
@GetMapping("/getOperationLog") @GetMapping("/getOperationLog")
public Result<List<PerformanceProgressOperationLogVO>> getOperationLog(@RequestParam("orderNo") @NotBlank(message = "订单编号不能为空") String orderNo) { public Result<List<PerformanceProgressOperationLogVO>> getOperationLog(@RequestParam("orderNo") @NotBlank(message = "订单编号不能为空") String orderNo) {
List<PerformanceProgressOperationLogVO> list = performanceProgressService.getOperationLog(orderNo); List<PerformanceProgressOperationLogVO> list = performanceProgressService.getOperationLog(orderNo,null);
return Result.ok(list); return Result.ok(list);
} }
......
...@@ -12,5 +12,5 @@ import java.util.List; ...@@ -12,5 +12,5 @@ import java.util.List;
* Time 16:02 * Time 16:02
*/ */
public interface PerformanceProgressLogDao extends BaseDao<PerformanceProgressLogMapper, PerformanceProgressLog, Integer> { public interface PerformanceProgressLogDao extends BaseDao<PerformanceProgressLogMapper, PerformanceProgressLog, Integer> {
List<PerformanceProgressLog> getOperationLog(String orderNo); List<PerformanceProgressLog> getOperationLog(String orderNo,Integer operateType);
} }
...@@ -8,6 +8,7 @@ import com.msl.common.dao.impl.BaseDaoImpl; ...@@ -8,6 +8,7 @@ import com.msl.common.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List; import java.util.List;
import java.util.Objects;
/** /**
* @author kavin * @author kavin
...@@ -17,9 +18,10 @@ import java.util.List; ...@@ -17,9 +18,10 @@ import java.util.List;
@Repository @Repository
public class PerformanceProgressLogDaoImpl extends BaseDaoImpl<PerformanceProgressLogMapper, PerformanceProgressLog, Integer> implements PerformanceProgressLogDao { public class PerformanceProgressLogDaoImpl extends BaseDaoImpl<PerformanceProgressLogMapper, PerformanceProgressLog, Integer> implements PerformanceProgressLogDao {
@Override @Override
public List<PerformanceProgressLog> getOperationLog(String orderNo) { public List<PerformanceProgressLog> getOperationLog(String orderNo,Integer operateType) {
LambdaQueryWrapper<PerformanceProgressLog> query = new LambdaQueryWrapper<>(); LambdaQueryWrapper<PerformanceProgressLog> query = new LambdaQueryWrapper<>();
query.eq(PerformanceProgressLog :: getOrderNo,orderNo); query.eq(PerformanceProgressLog :: getOrderNo,orderNo);
query.eq(Objects.nonNull(operateType),PerformanceProgressLog :: getOperateType,operateType);
query.orderByDesc(PerformanceProgressLog :: getId); query.orderByDesc(PerformanceProgressLog :: getId);
return baseMapper.selectList(query); return baseMapper.selectList(query);
} }
......
...@@ -30,11 +30,11 @@ public interface PerformanceProgressService { ...@@ -30,11 +30,11 @@ public interface PerformanceProgressService {
PerformanceProgressDetailVO getPerformanceProgressDetail(Integer id); PerformanceProgressDetailVO getPerformanceProgressDetail(Integer id);
List<PerformanceProgressOperationLogVO> getOperationLog(String orderNo); List<PerformanceProgressOperationLogVO> getOperationLog(String orderNo,Integer operateType);
void dealPerformanceProgress4OrderInfo(OrderInfoMessage data); void dealPerformanceProgress4OrderInfo(OrderInfoMessage data);
List<PerformanceProgressVO> queryPerformanceProgress(List<String> orderNoList);
void dealPerformanceProgress4OrderGoods(OrderGoods data); void dealPerformanceProgress4OrderGoods(OrderGoods data);
......
package com.clx.performance.service.impl; package com.clx.performance.service.impl;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.open.sdk.callback.OpenCallBackClient;
import com.clx.open.sdk.callback.message.OrderInfoMessage; import com.clx.open.sdk.callback.message.OrderInfoMessage;
import com.clx.open.sdk.callback.message.TransportExceptionReportMessage;
import com.clx.order.enums.SyncPlatformEnum;
import com.clx.order.feign.OrderFeign;
import com.clx.order.vo.feign.FeignAddressVO; import com.clx.order.vo.feign.FeignAddressVO;
import com.clx.order.vo.feign.FeignOrderInfoVO; import com.clx.order.vo.feign.FeignOrderInfoVO;
import com.clx.order.vo.feign.FeignOrderVO;
import com.clx.order.vo.feign.SystemAddressVO; import com.clx.order.vo.feign.SystemAddressVO;
import com.clx.performance.config.ThirdAppConfig;
import com.clx.performance.constant.BusinessConstants; import com.clx.performance.constant.BusinessConstants;
import com.clx.performance.dao.OrderChildDao; import com.clx.performance.dao.OrderChildDao;
import com.clx.performance.dao.OrderGoodsDao; import com.clx.performance.dao.OrderGoodsDao;
...@@ -36,7 +43,13 @@ import com.clx.performance.vo.pc.PerformanceProgressVO; ...@@ -36,7 +43,13 @@ import com.clx.performance.vo.pc.PerformanceProgressVO;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.msl.common.base.Optional; import com.msl.common.base.Optional;
import com.msl.common.exception.ServiceSystemException; import com.msl.common.exception.ServiceSystemException;
import com.msl.common.result.Result;
import com.msl.common.utils.DateUtils; import com.msl.common.utils.DateUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDateTime;
import java.util.*;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -45,10 +58,6 @@ import org.apache.commons.lang.exception.ExceptionUtils; ...@@ -45,10 +58,6 @@ import org.apache.commons.lang.exception.ExceptionUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDateTime;
import java.util.*;
/** /**
* @author kavin * @author kavin
...@@ -70,7 +79,8 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi ...@@ -70,7 +79,8 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi
private final OrderGoodsDao orderGoodsDao; private final OrderGoodsDao orderGoodsDao;
private final OrderChildDao orderChildDao; private final OrderChildDao orderChildDao;
private final OrderService orderService; private final OrderService orderService;
private final ThirdAppConfig thirdAppConfig;
private final OrderFeign orderFeign;
public static List<Integer> inProcessStatusList; public static List<Integer> inProcessStatusList;
public static List<Integer> endStatusList ; public static List<Integer> endStatusList ;
...@@ -271,11 +281,30 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi ...@@ -271,11 +281,30 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi
change = true; change = true;
} }
if(!StringUtils.equals(item.getPerformanceAbnormalReason(),param.getPerformanceAbnormalReason())){ if(!StringUtils.equals(item.getPerformanceAbnormalReason(),param.getPerformanceAbnormalReason())){
PerformanceProgressLog log = performanceProgressLogService.generateLog(item.getOrderNo(), PerformanceProgressLog progressLog = performanceProgressLogService.generateLog(item.getOrderNo(),
PerformanceProgressEnum.LogType.PERFORMANCE_ABNORMAL_REASON, PerformanceProgressEnum.LogType.PERFORMANCE_ABNORMAL_REASON,
param.getPerformanceAbnormalReason(),userNo,userName); param.getPerformanceAbnormalReason(),userNo,userName);
logs.add(log); logs.add(progressLog);
change = true; change = true;
//上报履约异常
if (StringUtils.isNotBlank(param.getPerformanceAbnormalReason())) {
FeignOrderVO orderVO = orderFeign.getOrderInfoFeign(item.getOrderNo());
if (orderVO != null && Objects.equals(orderVO.getOrderSource(), SyncPlatformEnum.Source.NEW_OWNER_CLIENT.getCode())) {
OpenCallBackClient openCallBackClient = thirdAppConfig.getOpenCallBackClient(SyncPlatformEnum.Source.NEW_OWNER_CLIENT.getCode().toString());
TransportExceptionReportMessage message = new TransportExceptionReportMessage();
message.setOrderNo(item.getOrderNo());
message.setCreateName(progressLog.getCreateName());
message.setOperateContent(param.getPerformanceAbnormalReason());
message.setReportTime(LocalDateTime.now());
Result<?> result = openCallBackClient.encryptPost(JSONUtil.parse(message).toString(), message.topic());
if (result.succeed()) {
log.info("上报履约异常成功,响应信息:{}", JSONUtil.parse(result));
} else {
log.info("上报履约异常失败,响应信息:{}", JSONUtil.parse(result));
}
}
}
} }
if(!StringUtils.equals(item.getDispatchFollow(),param.getDispatchFollow())){ if(!StringUtils.equals(item.getDispatchFollow(),param.getDispatchFollow())){
PerformanceProgressLog log = performanceProgressLogService.generateLog(item.getOrderNo(), PerformanceProgressLog log = performanceProgressLogService.generateLog(item.getOrderNo(),
...@@ -300,8 +329,8 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi ...@@ -300,8 +329,8 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi
} }
@Override @Override
public List<PerformanceProgressOperationLogVO> getOperationLog(String orderNo) { public List<PerformanceProgressOperationLogVO> getOperationLog(String orderNo,Integer operateType) {
List<PerformanceProgressLog> list = performanceProgressLogDao.getOperationLog(orderNo); List<PerformanceProgressLog> list = performanceProgressLogDao.getOperationLog(orderNo,operateType);
return performanceProgressLogStruct.convertList(list); return performanceProgressLogStruct.convertList(list);
} }
...@@ -495,6 +524,10 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi ...@@ -495,6 +524,10 @@ public class PerformanceProgressServiceImpl implements PerformanceProgressServi
performanceProgressDao.updateEntityByKey(update); performanceProgressDao.updateEntityByKey(update);
} }
@Override
public List<PerformanceProgressVO> queryPerformanceProgress(List<String> orderNoList) {
return performanceProgressStruct.convertList(performanceProgressDao.listInField(PerformanceProgress::getOrderNo, orderNoList));
}
// 计算接单率 // 计算接单率
public BigDecimal calcOrderedRate(BigDecimal orderedWeight,BigDecimal pendingWeight){ public BigDecimal calcOrderedRate(BigDecimal orderedWeight,BigDecimal pendingWeight){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论