提交 3d0450bb authored 作者: liuhaiquan's avatar liuhaiquan

Merge remote-tracking branch 'origin/master' into v6.5_transport_open_20231115

# Conflicts: # performance-api/src/main/java/com/clx/performance/enums/PerformanceResultEnum.java # performance-web/src/main/java/com/clx/performance/service/impl/OrderCancelServiceImpl.java # performance-web/src/main/java/com/clx/performance/service/impl/OrderChildServiceImpl.java # performance-web/src/main/java/com/clx/performance/service/impl/OwnerAccountServiceImpl.java # performance-web/src/test/java/com/clx/performance/JobTest.java
...@@ -12,6 +12,8 @@ public enum OrderGoodsLogsEnum { ...@@ -12,6 +12,8 @@ public enum OrderGoodsLogsEnum {
EDIT("编辑"), EDIT("编辑"),
CANCEL( "取消"), CANCEL( "取消"),
ADJUST_PRICE("调价"), ADJUST_PRICE("调价"),
SYSTEM_RELEASE("释放吨数"),
SYSTEM_INCREASE("提量吨数"),
; ;
private final String name; private final String name;
......
...@@ -86,7 +86,7 @@ public enum OwnerAccountEnum { ...@@ -86,7 +86,7 @@ public enum OwnerAccountEnum {
THAW(30, "解冻"), THAW(30, "解冻"),
CASE_OUT_FROZEN(40, "提现冻结"), CASE_OUT_FROZEN(40, "提现冻结"),
CASE_OUT_SUCCESS(50, "提现成功"), CASE_OUT_SUCCESS(50, "提现成功"),
TAKE_OUT(60, "扣"), TAKE_OUT(60, "扣"),
CASE_OUT_FAIL(70, "提现失败"), CASE_OUT_FAIL(70, "提现失败"),
; ;
......
...@@ -99,7 +99,20 @@ public enum PerformanceResultEnum implements ResultEnum { ...@@ -99,7 +99,20 @@ public enum PerformanceResultEnum implements ResultEnum {
ORDER_GOODS_SAVE_FAIL(1801, "保存货单失败,请稍后再试"), ORDER_GOODS_SAVE_FAIL(1801, "保存货单失败,请稍后再试"),
ORDER_CHILD_SYNC_ERROR(1901, "承运同步网络货运异常"), USER_ID_IS_EMPTY(1900, "用户ID不能为空"),
MOBILE_IS_EMPTY(1901, "用户手机号不能为空"),
CAPTCHA_IS_EMPTY(1902, "验证码不能为空"),
USER_ACCOUNT_NOT_FOUND(1903, "用户账号未找到"),
CAPTCHA_IS_EXPIRE(1904, "短信验证码已失效,请重新发送"),
CAPTCHA_MORE_COUNT(1905, "验证码发送过于频繁,请稍后再发"),
CAPTCHA_IS_FAIL(1906, "验证码错误"),
BUSINESS_NO_FAIL(1907, "营业执照校验不一致,请重新输入"),
TOKEN_IS_FAIL(1908, "token失效,请重新获取token"),
PASSWORD_RESET_IS_FAIL(1909, "重置密码出现异常"),
PASSWORD_CHECK_FAIL(1910, "交易密码填写错误,请重新输入"),
SLIDER_CHECK_FAIL(1911, "滑块验证错误"),
ORDER_CHILD_SYNC_ERROR(1912, "承运同步网络货运异常"),
; ;
private final int code; private final int code;
private final String msg; private final String msg;
......
package com.clx.performance.param.app;
import com.msl.common.base.PageParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.validation.constraints.NotBlank;
@Getter
@Setter
@NoArgsConstructor
public class AppGoodsOrderSearchParam extends PageParam {
@ApiModelProperty(value = "1:货源地 2: 目的地", example = "1")
@NotBlank(message = "查询类型")
private Integer searchType;
@ApiModelProperty(value = "搜索条件", example = "1")
private String searchName;
}
package com.clx.performance.param.app;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Data
public class CheckMobileParam {
@ApiModelProperty(value = "手机号", example = "1")
@NotBlank(message = "手机号")
private String mobile;
@ApiModelProperty(value = "验证码", example = "1")
@NotBlank(message = "验证码")
private String captcha;
@ApiModelProperty(value = "调用发送短信接口返回的token", example = "1")
private String token;
}
package com.clx.performance.param.app;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class InformationParam {
@ApiModelProperty(value = "营业执照编号", example = "1")
@NotBlank(message = "营业执照编号")
private String businessLicenseNumber;
@ApiModelProperty(value = "验证手机号通过后Token", example = "1")
@NotBlank(message = "验证手机号通过后Token")
private String token;
@ApiModelProperty(value = "手机号", example = "1")
@NotBlank(message = "手机号")
private String mobile;
}
package com.clx.performance.param.app;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class ResetPasswordParam {
@ApiModelProperty(value = "交易密码", example = "1")
@NotBlank(message = "交易密码")
private String password;
@ApiModelProperty(value = "验证营业执照后通过后Token", example = "1")
@NotBlank(message = "验证营业执照后通过后Token")
private String token;
@ApiModelProperty(value = "手机号", example = "1")
@NotBlank(message = "手机号")
private String mobile;
}
package com.clx.performance.param.app;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Data
public class SendMobileCaptchaParam {
@ApiModelProperty(value = "手机号", example = "1")
@NotBlank(message = "手机号")
private String mobile;
@ApiModelProperty(value = "会话ID", required = true, example = "XXX", dataType = "String")
private String sessionId;
@ApiModelProperty(value = "签名串", required = true, example = "XXX", dataType = "String")
private String sig;
@ApiModelProperty(value = "请求唯一标识", required = true, example = "XXX", dataType = "String")
private String token;
@ApiModelProperty(value = "场景标识", required = true, example = "XXX", dataType = "String")
private String scene;
}
...@@ -25,4 +25,7 @@ public class OwnerBindCardParam { ...@@ -25,4 +25,7 @@ public class OwnerBindCardParam {
@ApiModelProperty(value = "银行账户") @ApiModelProperty(value = "银行账户")
private String ownerBankAccount; private String ownerBankAccount;
@ApiModelProperty(value = "交易密码")
private String accountPassword;
} }
...@@ -35,4 +35,7 @@ public class OwnerCaseOutParam { ...@@ -35,4 +35,7 @@ public class OwnerCaseOutParam {
@ApiModelProperty(value = "提现银行卡号", example = "62213545878787") @ApiModelProperty(value = "提现银行卡号", example = "62213545878787")
private String ownerBankAccount; private String ownerBankAccount;
@ApiModelProperty(value = "交易密码")
private String accountPassword;
} }
\ No newline at end of file
...@@ -38,6 +38,19 @@ public class OwnerTopUpParam { ...@@ -38,6 +38,19 @@ public class OwnerTopUpParam {
@ApiModelProperty(value = "打款凭证", example = "/a.png") @ApiModelProperty(value = "打款凭证", example = "/a.png")
private String drawingProof; private String drawingProof;
@ApiModelProperty(value = "收款人企业信息", example = "收款人企业信息")
private String enterpriseName;
@ApiModelProperty(value = "收款人开户行", example = "62213545878787")
private String openAccountBank;
@ApiModelProperty(value = "收款人开户行银行代码", example = "收款人开户行银行代码")
private String openAccountBankNumber;
@ApiModelProperty(value = "收款人账户账号", example = "")
private String accountNumber;
@ApiModelProperty(value = "交易密码")
private String accountPassword;
} }
\ No newline at end of file
package com.clx.performance.param.pc;
import com.msl.common.base.PageParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
/**
* @Author huyufan
* @create 2023-09-19 13:33
*/
@Getter
@Setter
@NoArgsConstructor
@ToString
public class PageAppPrepaidFreightAccountParam extends PageParam {
@ApiModelProperty(value="货主编码",example = "20145787812312312")
private Long ownerUserNo;
@ApiModelProperty(value="1: 全部 2:收入 3:支出",example = "1")
private Integer queryWaterType;
@ApiModelProperty(value="1: 保证金 2:预付运费",example = "1")
private Integer accountType;
@ApiModelProperty(value="操作开始时间",example = "2020-01-01 10:10:10")
private String beginTime;
@ApiModelProperty(value = "操作结束时间",example = "2020-01-01 10:10:10")
private String endTime;
@ApiModelProperty(value="货主编号",example = "1")
private Long userNo;
}
package com.clx.performance.param.pc.customer;
import com.msl.common.base.PageParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class PageCustomerComplaintDetailParam extends PageParam {
@ApiModelProperty("司机姓名")
private String driverName; //司机姓名
@ApiModelProperty("联系方式")
private String driverMobile; //司机手机号
@ApiModelProperty("运单编号")
private String childNo; //运单编号
@ApiModelProperty("投诉类型id")
private Integer complaintTypeId; //投诉类型id
@ApiModelProperty(value = "开始时间", example = "")
private String beginTime;
@ApiModelProperty(value = "结束时间", example = "")
private String endTime;
}
package com.clx.performance.param.pc.customer;
import com.msl.common.base.PageParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class PageCustomerComplaintTypeParam extends PageParam {
@ApiModelProperty("名称")
private String name;
}
package com.clx.performance.param.pc.customer;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
/**
* @ClassName SaveComplaintTypeParam
* @Description
* @Author kavin
* @Date 2023/12/7 10:46
* @Version 1.0
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class SaveComplaintTypeParam {
private Integer id;
@Size(min=1 ,max = 10)
@NotBlank(message = "分类名称不能为空")
@ApiModelProperty(value = "分类名称")
private String name;
}
package com.clx.performance.param.pc.customer;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;
/**
* @ClassName saveCustomerComplaintDetailParam
* @Description
* @Author kavin
* @Date 2023/12/8 13:52
* @Version 1.0
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class SaveCustomerComplaintDetailParam {
@NotNull(message = "投诉类型ID不能为空")
@ApiModelProperty("投诉类型ID")
private Integer complaintTypeId; //投诉类型id
@ApiModelProperty("运单编号")
private String childNo; //运单编号
@Size(min=1 ,max = 1000)
@ApiModelProperty("运单编号")
private String content; //问题描述
@ApiModelProperty("图片")
private List<String> picture; //图片
}
package com.clx.performance.vo.app;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
/**
* @ClassName CustomerComplaintOrderChildVO
* @Description
* @Author kavin
* @Date 2023/12/7 17:55
* @Version 1.0
*/
@Getter
@Setter
@ToString
@NoArgsConstructor
public class CustomerComplaintOrderChildVO {
@ApiModelProperty(value = "id", example = "1")
private Integer id;
@ApiModelProperty(value = "运单编号", example = "100000000")
private String childNo;
@ApiModelProperty(value = "货单编号", example = "100000000")
private String orderGoodsNo;
@ApiModelProperty(value = "订单编号", example = "10000000000")
private String orderNo;
@ApiModelProperty(value = "发货地址", example = "朝阳")
private String sendAddress;
@ApiModelProperty(value = "收货地址", example = "西城")
private String receiveAddress;
@ApiModelProperty(value = "车牌号", example = "京A12345")
private String truckNo;
@ApiModelProperty(value = "司机姓名", example = "张三")
private String driverName;
@ApiModelProperty(value = "接单时间", example = "2023-12-12 12:12:12")
private String createTime; //创建时间
@ApiModelProperty(value = "状态", example = "10")
private Integer status; //状态
@ApiModelProperty(value = "状态信息", example = "接单")
private String statusMsg;
}
...@@ -64,8 +64,8 @@ public class IntegralTruckVO { ...@@ -64,8 +64,8 @@ public class IntegralTruckVO {
return Arrays.asList( return Arrays.asList(
new IntegralItem("运单完成积分", orderChildCompleteIntegral), new IntegralItem("运单完成积分", orderChildCompleteIntegral),
new IntegralItem("平台补偿积分", platformCompensationIntegral), new IntegralItem("平台补偿积分", platformCompensationIntegral),
new IntegralItem("运单取消积分", orderChildCancelIntegral), new IntegralItem("运单取消扣减", orderChildCancelIntegral),
new IntegralItem("运单超时积分", orderChildTimeoutIntegral), new IntegralItem("运单超时扣减", orderChildTimeoutIntegral),
new IntegralItem("信息上报积分", reportIntegral) new IntegralItem("信息上报积分", reportIntegral)
); );
} }
......
package com.clx.performance.vo.pc; package com.clx.performance.vo.pc;
import com.msl.common.convertor.field.Converted; import com.msl.common.convertor.field.Converted;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@Data @Data
public class OwnerAccountAllVO { public class OwnerAccountAllVO {
@ApiModelProperty("保证金账户")
@Converted(isDynamic = true) @Converted(isDynamic = true)
private OwnerAccountVO marginAccount; private OwnerAccountVO marginAccount;
@ApiModelProperty("预付运费账户")
@Converted(isDynamic = true) @Converted(isDynamic = true)
private OwnerAccountVO prepaidFreightAccount; private OwnerAccountVO prepaidFreightAccount;
@ApiModelProperty("0:没有交易密码 1:有交易密码")
private Integer ownerAccountPassword;
} }
...@@ -91,4 +91,10 @@ public class OwnerTopUpVO { ...@@ -91,4 +91,10 @@ public class OwnerTopUpVO {
@ApiModelProperty(value = "审批拒绝") @ApiModelProperty(value = "审批拒绝")
private String approvalTurnDown; private String approvalTurnDown;
@ApiModelProperty(value = "收款人企业信息")
private String enterpriseName;
@ApiModelProperty(value = "收款人账户账号")
private String accountNumber;
} }
\ No newline at end of file
package com.clx.performance.vo.pc.customer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
/**
* @ClassName CustomerComplaintTypeVO
* @Description
* @Author kavin
* @Date 2023/12/7 11:42
* @Version 1.0
*/
@Getter
@Setter
public class CustomerComplaintDetailVO {
@ApiModelProperty("id")
private Integer id;
@ApiModelProperty("司机用户编号")
private Long driverUserNo; //司机用户编号
@ApiModelProperty("司机姓名")
private String driverName; //司机姓名
@ApiModelProperty("司机手机号")
private String driverMobile; //司机手机号
@ApiModelProperty("运单编号")
private String childNo; //运单编号
@ApiModelProperty("投诉类型id")
private Integer complaintTypeId; //投诉类型id
@ApiModelProperty("投诉类型名称")
private String name; //投诉类型名称
@ApiModelProperty("问题描述")
private String content; //问题描述
@ApiModelProperty("图片字符串")
private String picture; //图片
@ApiModelProperty("图片集合")
private List<String> pictureList; //图片集合
@ApiModelProperty("创建时间")
private String createTime; //创建时间
}
package com.clx.performance.vo.pc.customer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
/**
* @ClassName CustomerComplaintTypeVO
* @Description
* @Author kavin
* @Date 2023/12/7 11:42
* @Version 1.0
*/
@Getter
@Setter
public class CustomerComplaintTypeVO {
@ApiModelProperty("id")
private Integer id;
@ApiModelProperty("投诉类型名称")
private String name; //投诉类型名称
@ApiModelProperty("创建时间")
private String createTime; //创建时间
@ApiModelProperty("最后编辑时间")
private String modifiedTime; //修改时间
}
...@@ -45,6 +45,12 @@ ...@@ -45,6 +45,12 @@
<artifactId>user-api</artifactId> <artifactId>user-api</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.clx.cy</groupId>
<artifactId>message-api</artifactId>
</dependency>
<dependency> <dependency>
<groupId>com.clx.cy</groupId> <groupId>com.clx.cy</groupId>
<artifactId>open-sdk</artifactId> <artifactId>open-sdk</artifactId>
...@@ -233,6 +239,22 @@ ...@@ -233,6 +239,22 @@
<artifactId>log-spring-boot-starter</artifactId> <artifactId>log-spring-boot-starter</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>com.aliyun.core</groupId>
<artifactId>machineCheckCore</artifactId>
<version>3.0.6</version>
</dependency>
<dependency>
<groupId>com.aliyun.afs</groupId>
<artifactId>machineCheckAfs</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies> </dependencies>
......
...@@ -16,7 +16,7 @@ import org.springframework.scheduling.annotation.EnableAsync; ...@@ -16,7 +16,7 @@ import org.springframework.scheduling.annotation.EnableAsync;
// @ComponentScan("com.msl.common.utils.*"), // @ComponentScan("com.msl.common.utils.*"),
//}) //})
@ComponentScan({"com.clx.performance.*", "com.msl.*"}) @ComponentScan({"com.clx.performance.*", "com.msl.*"})
@EnableFeignClients(basePackages = {"com.msl.*", "com.clx.performance.*", "com.clx.order.*", "com.clx.user.*"}) @EnableFeignClients(basePackages = {"com.msl.*", "com.clx.performance.*", "com.clx.order.*", "com.clx.user.*", "com.clx.message.*"})
@ViewScan(basePackage = "com.clx.user.view") @ViewScan(basePackage = "com.clx.user.view")
public class PerformanceApplication { public class PerformanceApplication {
......
package com.clx.performance.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface ResetPassword {
//接口名称
String name() default "";
}
package com.clx.performance.aspect;
import cn.hutool.json.JSONUtil;
import com.clx.performance.annotation.ResetPassword;
import com.clx.performance.component.SendMessageMachineCheckComponent;
import com.clx.performance.constant.RedisConstants;
import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.param.app.CheckMobileParam;
import com.clx.performance.param.app.InformationParam;
import com.clx.performance.param.app.ResetPasswordParam;
import com.clx.performance.param.app.SendMobileCaptchaParam;
import com.msl.common.exception.ServiceSystemException;
import com.msl.common.result.Result;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
@Component
@Aspect
public class ResetPasswordAnnotationAop {
@Autowired
private RedisTemplate<String, String> redisTemplate;
@Autowired
private SendMessageMachineCheckComponent sendMessageMachineCheckComponent;
@Pointcut("@annotation(com.clx.performance.annotation.ResetPassword)")
private void annotationPointCut() {
}
@Around("annotationPointCut()")
public Object annotationAround(ProceedingJoinPoint jp) throws Throwable {
//获取方法
Method method = ((MethodSignature) jp.getSignature()).getMethod();
// 获取AspectAnnotation注解
ResetPassword aspectAnnotation = method.getAnnotation(ResetPassword.class);
String mobile = "";
String token = "";
String redisVal = "";
switch (aspectAnnotation.name()) {
case "checkMobile":
CheckMobileParam checkMobileParam = JSONUtil.toBean(JSONUtil.parse(jp.getArgs()[0]).toString(), CheckMobileParam.class);
mobile = checkMobileParam.getMobile();
token = checkMobileParam.getToken();
redisVal = redisTemplate.opsForValue().get(RedisConstants.MESSAGE_RESET_PASSWORD_TOKEN + mobile);
if (!StringUtils.equals(token, redisVal)) {
throw new ServiceSystemException(PerformanceResultEnum.TOKEN_IS_FAIL);
}
break;
case "sendMobileCaptcha":
SendMobileCaptchaParam sendMobileCaptchaParam = JSONUtil.toBean(JSONUtil.parse(jp.getArgs()[0]).toString(), SendMobileCaptchaParam.class);
ServletRequestAttributes sra = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = sra.getRequest();
sendMessageMachineCheckComponent.sendMessageMachineSelectCheck(request, sendMobileCaptchaParam);
mobile = sendMobileCaptchaParam.getMobile();
String content = redisTemplate.opsForValue().get(RedisConstants.MESSAGE_MOBILE_CAPTCHA + mobile);
if (StringUtils.isNoneBlank(content)) {
token = UUID.randomUUID().toString();
redisTemplate.opsForValue().set(RedisConstants.MESSAGE_RESET_PASSWORD_TOKEN + mobile, token);
redisTemplate.expire(RedisConstants.MESSAGE_RESET_PASSWORD_TOKEN + mobile, 60, TimeUnit.SECONDS);
return Result.ok(token);
}
break;
case "checkBusinessLicenseNumber":
InformationParam informationParam = JSONUtil.toBean(JSONUtil.parse(jp.getArgs()[0]).toString(), InformationParam.class);
mobile = informationParam.getMobile();
token = informationParam.getToken();
redisVal = redisTemplate.opsForValue().get(RedisConstants.MESSAGE_RESET_PASSWORD_TOKEN + mobile);
if (!StringUtils.equals(token, redisVal)) {
throw new ServiceSystemException(PerformanceResultEnum.TOKEN_IS_FAIL);
}
break;
case "resetPassword":
ResetPasswordParam resetPasswordParam = JSONUtil.toBean(JSONUtil.parse(jp.getArgs()[0]).toString(), ResetPasswordParam.class);
mobile = resetPasswordParam.getMobile();
token = resetPasswordParam.getToken();
redisVal = redisTemplate.opsForValue().get(RedisConstants.MESSAGE_RESET_PASSWORD_TOKEN + mobile);
if (!StringUtils.equals(token, redisVal)) {
throw new ServiceSystemException(PerformanceResultEnum.TOKEN_IS_FAIL);
}
break;
default:
throw new RuntimeException();
}
//执行方法前
Object returnVal = null;
returnVal = jp.proceed();
if (!StringUtils.equals(aspectAnnotation.name(), "resetPassword")) {
Result result = JSONUtil.toBean(JSONUtil.parse(returnVal).toString(), Result.class);
redisTemplate.opsForValue().set(RedisConstants.MESSAGE_RESET_PASSWORD_TOKEN + mobile, result.getData().toString());
redisTemplate.expire(RedisConstants.MESSAGE_RESET_PASSWORD_TOKEN + mobile, 60, TimeUnit.SECONDS);
}
return returnVal;
}
}
package com.clx.performance.component; package com.clx.performance.component;
import cn.hutool.core.util.StrUtil;
import com.clx.performance.constant.RedisConstants; import com.clx.performance.constant.RedisConstants;
import com.clx.performance.dao.OrderGoodsDriverTruckDao; import com.clx.performance.dao.OrderGoodsDriverTruckDao;
import com.clx.performance.dao.OrderGoodsTruckBindDao; import com.clx.performance.dao.OrderGoodsTruckBindDao;
...@@ -10,11 +9,15 @@ import com.clx.performance.model.OrderGoodsTruckBind; ...@@ -10,11 +9,15 @@ import com.clx.performance.model.OrderGoodsTruckBind;
import com.msl.common.base.Optional; import com.msl.common.base.Optional;
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.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.*; import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -95,4 +98,22 @@ public class GoodsOrderTruckRecordComponent { ...@@ -95,4 +98,22 @@ public class GoodsOrderTruckRecordComponent {
orderGoodsTruckBindDao.updateOrderGoodsBindStatusExpire(orderGoodsNo, truckNo); orderGoodsTruckBindDao.updateOrderGoodsBindStatusExpire(orderGoodsNo, truckNo);
} }
//货单剩余吨数低于35吨时,自动恢复到订单,并释放未接单车辆
public void releaseOrderGoodsDriverAndTruck(String orderGoodsNo) {
List<OrderGoodsTruckBind> truckBindList = orderGoodsTruckBindDao.selectListByOrderGoodsNo(orderGoodsNo);
List<Integer> ids = new ArrayList<>();
for (OrderGoodsTruckBind bind : truckBindList) {
if (Objects.equals(OrderGoodsTruckBindEnum.Status.NORMAL.getCode(),bind.getStatus())) {
ids.add(bind.getId());
this.deleteTruckRecord(orderGoodsNo, bind.getTruckNo());
}
}
//释放车辆bind
if(CollectionUtils.isNotEmpty(ids)){
log.info("定向单进行车辆释放,货单编号:{},释放的绑定车辆的id集合:{}",orderGoodsNo,ids);
orderGoodsTruckBindDao.updateTruckBindExpire(ids);
}
}
} }
...@@ -3,68 +3,85 @@ package com.clx.performance.component; ...@@ -3,68 +3,85 @@ package com.clx.performance.component;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.clx.order.enums.OrderEnum; import com.clx.order.enums.OrderEnum;
import com.clx.order.enums.UpdateEnum;
import com.clx.order.enums.VehicleUsageEnum; import com.clx.order.enums.VehicleUsageEnum;
import com.clx.order.feign.OrderFeign; import com.clx.order.feign.OrderFeign;
import com.clx.order.param.feign.RollbackOrderWeightParam; import com.clx.order.param.feign.RollbackOrderWeightParam;
import com.clx.order.vo.feign.FeignOrderInfoVO;
import com.clx.order.vo.feign.FeignOrderVO; import com.clx.order.vo.feign.FeignOrderVO;
import com.clx.performance.dao.OrderChildDao; import com.clx.performance.dao.OrderChildDao;
import com.clx.performance.dao.OrderGoodsDao; import com.clx.performance.dao.OrderGoodsDao;
import com.clx.performance.dao.settle.SettlementOwnerDetailDao; import com.clx.performance.dao.settle.SettlementOwnerDetailDao;
import com.clx.performance.enums.*; import com.clx.performance.enums.*;
import com.clx.performance.extranal.user.DriverService; import com.clx.performance.extranal.user.DriverService;
import com.clx.performance.extranal.user.OrderService;
import com.clx.performance.model.OrderChild; import com.clx.performance.model.OrderChild;
import com.clx.performance.model.OrderGoods; import com.clx.performance.model.OrderGoods;
import com.clx.performance.param.pc.OrderCancelParam; import com.clx.performance.param.pc.OrderCancelParam;
import com.clx.performance.param.pc.owner.ThawAccountParam; import com.clx.performance.param.pc.owner.ThawAccountParam;
import com.clx.performance.service.IntegralMqService; import com.clx.performance.service.IntegralMqService;
import com.clx.performance.service.OrderChildLogService; import com.clx.performance.service.OrderChildLogService;
import com.clx.performance.service.OrderGoodsService;
import com.clx.performance.service.OrderGoodsTruckBindService; import com.clx.performance.service.OrderGoodsTruckBindService;
import com.clx.performance.service.OwnerAccountService; import com.clx.performance.service.OwnerAccountService;
import com.clx.performance.service.breakcontract.BreakContractSettlementOwnerService; import com.clx.performance.service.breakcontract.BreakContractSettlementOwnerService;
import com.clx.performance.service.child.OrderChildPostService; import com.clx.performance.service.child.OrderChildPostService;
import com.clx.user.enums.driver.DriverInfoEnum; import com.clx.user.enums.driver.DriverInfoEnum;
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.result.Result;
import com.msl.common.utils.DateUtils; import com.msl.common.utils.DateUtils;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.HashMap; import java.util.*;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Component @Component
@Slf4j @Slf4j
@AllArgsConstructor
public class OrderCancelComponent implements InitializingBean { public class OrderCancelComponent implements InitializingBean {
private final OrderChildDao orderChildDao; @Autowired
private OrderChildDao orderChildDao;
private final OrderGoodsDao orderGoodsDao; @Autowired
private OrderGoodsDao orderGoodsDao;
private final OrderGoodsTruckBindService orderGoodsTruckBindService; @Autowired
private OrderGoodsTruckBindService orderGoodsTruckBindService;
private final GoodsOrderTruckRecordComponent goodsOrderTruckRecordComponent; @Autowired
private GoodsOrderTruckRecordComponent goodsOrderTruckRecordComponent;
private final OrderFeign orderFeign; @Autowired
private OrderFeign orderFeign;
private final DriverService driverService; @Autowired
private DriverService driverService;
private final BreakContractSettlementOwnerService breakContractSettlementOwnerService; @Autowired
private BreakContractSettlementOwnerService breakContractSettlementOwnerService;
public static Map<Integer, String> statusCodeMap = new HashMap<>(); public static Map<Integer, String> statusCodeMap = new HashMap<>();
private final IntegralMqService integralMqService; @Autowired
private IntegralMqService integralMqService;
private final OrderChildLogService orderChildLogService; @Autowired
private OrderChildLogService orderChildLogService;
private final OrderChildPostService orderChildPostService; @Autowired
private OrderChildPostService orderChildPostService;
@Autowired
private OrderService orderService;
@Autowired
private OrderGoodsService orderGoodsService;
private final SettlementOwnerDetailDao settlementOwnerDetailDao; private final SettlementOwnerDetailDao settlementOwnerDetailDao;
...@@ -251,6 +268,83 @@ public class OrderCancelComponent implements InitializingBean { ...@@ -251,6 +268,83 @@ public class OrderCancelComponent implements InitializingBean {
} }
} }
/**
* @Author kavin
* @Description 货单低于35吨自动归还吨数到订单/货单吨数不够扣减,从订单上借吨数
* @Param [orderGoods, weight,updateType(1: 增加 2:减少)]
* @return
**/
public void backFillOrderWeight(OrderGoods orderGoods, BigDecimal weight, Integer updateType) {
Integer truckDemand = orderGoods.getTruckDemand();
java.util.Optional<UpdateEnum> byCode1 = UpdateEnum.getByCode(updateType);
String updateTypeMsg = byCode1.isPresent()?byCode1.get().getMsg():"未知调整类型";
java.util.Optional<TruckDemandEnum.TruckType> byCode = TruckDemandEnum.TruckType.getByCode(truckDemand);
String truckDemandValue = byCode.isPresent()?byCode.get().getMsg():"未知用车需求";
log.info("订单号:{},货单号:{},用车需求:{},进行订单剩余吨数{} ,调整吨数:{}",
orderGoods.getOrderNo(),orderGoods.getOrderGoodsNo(),truckDemandValue,updateTypeMsg,weight);
String orderNo = orderGoods.getOrderNo();
Optional<FeignOrderInfoVO> optional = orderService.getOrderInfo(orderNo);
if(!optional.isPresent()){
log.warn("通过订单号未查询到对应的订单信息,订单号:{}",orderNo);
throw new ServiceSystemException(PerformanceResultEnum.DATA_NOT_FIND);
}
FeignOrderInfoVO orderInfo = optional.get();
boolean isSub = Objects.equals(UpdateEnum.SUB.getCode(), updateType);
RollbackOrderWeightParam rollbackOrderWeightParam = new RollbackOrderWeightParam();
rollbackOrderWeightParam.setOrderNo(orderGoods.getOrderNo());
rollbackOrderWeightParam.setResidueWeight(weight);
rollbackOrderWeightParam.setUpdateType(updateType);
//归还吨数
if (!truckDemand.equals(TruckDemandEnum.TruckType.PLATFORM_ANY_CAR.getCode())) {
if (truckDemand.equals(TruckDemandEnum.TruckType.PLATFORM_CAR.getCode())) {
if(isSub && weight.compareTo(orderInfo.getResidueWeight()) > 0 ){
log.warn("货单用车需求: {},订单号:{},货单号:{},平台剩余吨数:{},需要扣减吨数:{},不足扣减",
truckDemandValue,orderNo,orderGoods.getOrderGoodsNo(),orderInfo.getPlatformResidueCarryWeight()
,weight);
throw new ServiceSystemException(PerformanceResultEnum.ORDER_WEIGHT_LACK);
}
} else if (truckDemand.equals(TruckDemandEnum.TruckType.OWNER_CAR.getCode())) {
if(isSub && weight.compareTo(orderInfo.getResidueWeight()) > 0 ){
log.warn("货单用车需求: {},订单号:{},货单号:{},自有剩余吨数:{},需要扣减吨数:{},不足扣减",
truckDemandValue,orderNo,orderGoods.getOrderGoodsNo(),orderInfo.getOwnResidueCarryWeight()
,weight);
throw new ServiceSystemException(PerformanceResultEnum.ORDER_WEIGHT_LACK);
}
}
rollbackOrderWeightParam.setOwnResidueCarryWeight(BigDecimal.ZERO);
rollbackOrderWeightParam.setPlatformResidueCarryWeight(BigDecimal.ZERO);
} else {
if (Objects.equals(orderGoods.getVehicleUsage(),VehicleUsageEnum.Status.OWN.getCode())) {
if(isSub && weight.compareTo(orderInfo.getOwnResidueCarryWeight()) > 0 ){
log.warn("货单用车需求: {},订单号:{},货单号:{},自有剩余吨数:{},需要扣减吨数:{},不足扣减",
TruckDemandEnum.TruckType.PLATFORM_ANY_CAR.getMsg(),orderNo,orderGoods.getOrderGoodsNo(),
orderInfo.getOwnResidueCarryWeight(),weight);
throw new ServiceSystemException(PerformanceResultEnum.ORDER_WEIGHT_LACK);
}
rollbackOrderWeightParam.setPlatformResidueCarryWeight(BigDecimal.ZERO);
rollbackOrderWeightParam.setOwnResidueCarryWeight(weight);
} else {
if(isSub && weight.compareTo(orderInfo.getPlatformResidueCarryWeight()) > 0 ){
log.warn("货单用车需求: {},订单号:{},货单号:{},平台剩余吨数:{},需要扣减吨数:{},不足扣减",
truckDemandValue,orderNo,orderGoods.getOrderGoodsNo(),
orderInfo.getPlatformResidueCarryWeight(),weight);
throw new ServiceSystemException(PerformanceResultEnum.ORDER_WEIGHT_LACK);
}
rollbackOrderWeightParam.setPlatformResidueCarryWeight(weight);
rollbackOrderWeightParam.setOwnResidueCarryWeight(BigDecimal.ZERO);
}
}
Result<Object> result = orderFeign.rollbackOrderWeight(rollbackOrderWeightParam);
if (!result.succeed()) {
log.warn("订单号:{} 的订单做吨数调整,对应货单号:{} 调整失败,调整吨数:{},调整类型:{}",
orderNo,orderGoods.getOrderGoodsNo(),weight,updateTypeMsg);
throw new ServiceSystemException(PerformanceResultEnum.HTTP_ERROR, "远程调用更新订单余量失败");
}
}
/** /**
* 客服取消归还吨数 * 客服取消归还吨数
* *
...@@ -293,6 +387,9 @@ public class OrderCancelComponent implements InitializingBean { ...@@ -293,6 +387,9 @@ public class OrderCancelComponent implements InitializingBean {
if (!result.succeed()) { if (!result.succeed()) {
throw new ServiceSystemException(PerformanceResultEnum.HTTP_ERROR, "远程调用更新订单余量失败"); throw new ServiceSystemException(PerformanceResultEnum.HTTP_ERROR, "远程调用更新订单余量失败");
} }
ArrayList<OrderGoods> list = new ArrayList<>();
list.add(orderGoods);
orderGoodsService.batchUpdateResidueWeight(list);
} else { } else {
//返回到货单 //返回到货单
orderGoodsDao.updateOrderGoodsSetResidueWeightAndAlreadyWeight(weight, weight, orderGoods.getId()); orderGoodsDao.updateOrderGoodsSetResidueWeightAndAlreadyWeight(weight, weight, orderGoods.getId());
......
...@@ -136,6 +136,8 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean { ...@@ -136,6 +136,8 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean {
} else { } else {
//大于35吨的归还吨数在这里处理
if(orderGoods.getResidueTransportWeight().compareTo(new BigDecimal("35")) >= 0){
RollbackOrderWeightParam param = new RollbackOrderWeightParam(); RollbackOrderWeightParam param = new RollbackOrderWeightParam();
param.setOrderNo(orderGoods.getOrderNo()); param.setOrderNo(orderGoods.getOrderNo());
param.setResidueWeight(orderGoods.getResidueTransportWeight()); param.setResidueWeight(orderGoods.getResidueTransportWeight());
...@@ -153,6 +155,7 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean { ...@@ -153,6 +155,7 @@ public class OrderGoodsStatusLazyComponent implements InitializingBean {
} }
} }
orderFeign.rollbackOrderWeight(param); orderFeign.rollbackOrderWeight(param);
}
//更新已完结 //更新已完结
orderGoodsDao.updateOrderGoodsStatusByOrderGoodsNo(orderGoodsNo, OrderGoodsStatusEnum.Status.COMPLETED.getCode()); orderGoodsDao.updateOrderGoodsStatusByOrderGoodsNo(orderGoodsNo, OrderGoodsStatusEnum.Status.COMPLETED.getCode());
......
package com.clx.performance.component;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.afs.model.v20180112.AuthenticateSigRequest;
import com.aliyuncs.afs.model.v20180112.AuthenticateSigResponse;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.profile.IClientProfile;
import com.clx.performance.config.AliSliderConfig;
import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.param.app.SendMobileCaptchaParam;
import com.msl.common.exception.ServiceSystemException;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.net.InetAddress;
/**
* @author cuiwanzhe
* @description
* @date 2020/9/1 4:58 下午
*/
@Service
@Slf4j
@AllArgsConstructor
public class SendMessageMachineCheckComponent {
private final AliSliderConfig aliSliderConfig;
/**
* 滑动验证
*
* @throws
*/
public void sendMessageMachineSelectCheck(HttpServletRequest request, SendMobileCaptchaParam param) throws ServiceSystemException {
if (StringUtils.isBlank(param.getSessionId())) {
throw new ServiceSystemException(PerformanceResultEnum.SLIDER_CHECK_FAIL);
}
if (StringUtils.isBlank(param.getSig())) {
throw new ServiceSystemException(PerformanceResultEnum.SLIDER_CHECK_FAIL);
}
if (StringUtils.isBlank(param.getToken())) {
throw new ServiceSystemException(PerformanceResultEnum.SLIDER_CHECK_FAIL);
}
if (StringUtils.isBlank(param.getScene())) {
throw new ServiceSystemException(PerformanceResultEnum.SLIDER_CHECK_FAIL);
}
Integer responseCode = machineCheckSelect(request, param);
if (responseCode >= 400) {
throw new ServiceSystemException(PerformanceResultEnum.SLIDER_CHECK_FAIL);
}
}
private Integer machineCheckSelect(HttpServletRequest req, SendMobileCaptchaParam param) {
Integer resultCode = null;
IClientProfile profile = DefaultProfile.getProfile(aliSliderConfig.getRegionId(), aliSliderConfig.getAccessKeyId(), aliSliderConfig.getAccessKeySecret());
IAcsClient client = new DefaultAcsClient(profile);
try {
DefaultProfile.addEndpoint(aliSliderConfig.getRegionId(), aliSliderConfig.getRegionId(), aliSliderConfig.getProduct(), aliSliderConfig.getDomain());
} catch (ClientException e) {
e.printStackTrace();
}
String ip = getIpAddress(req);
log.info("=滑动验证=mobile==========>>" + param.getMobile() + "==sessionId========>>" + param.getSessionId() + "==sig=====>>>" + param.getSig() +
"==token=====>>>" + param.getToken() + "==scene=====>>>" + param.getScene() + "==ip=====>>>" + ip);
AuthenticateSigRequest request = new AuthenticateSigRequest();
request.setSessionId(param.getSessionId());// 会话ID。必填参数,从前端获取,不可更改。
request.setSig(param.getSig());// 签名串。必填参数,从前端获取,不可更改。
request.setToken(param.getToken());// 请求唯一标识。必填参数,从前端获取,不可更改。
request.setScene(param.getScene());// 场景标识。必填参数,从前端获取,不可更改。
request.setAppKey("FFFF0N00000000009691");// 应用类型标识。必填参数,后端填写。
request.setRemoteIp(ip);// 客户端IP。必填参数,后端填写。
try {
//response的code枚举:100验签通过,900验签失败
AuthenticateSigResponse response = client.getAcsResponse(request);
resultCode = response.getCode();
// TODO
} catch (Exception e) {
e.printStackTrace();
}
return resultCode;
}
/**
* 获取客户端IP地址
*
* @param request
* @return
*/
private String getIpAddress(HttpServletRequest request) {
String ip = request.getHeader("x-forwarded-for");
if (ip == null || ip.length() == 0 || "unknow".equalsIgnoreCase(ip)) {
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getRemoteAddr();
if (ip.equals("127.0.0.1")) {
//根据网卡取本机配置的IP
InetAddress inet = null;
try {
inet = InetAddress.getLocalHost();
} catch (Exception e) {
e.printStackTrace();
}
ip = inet.getHostAddress();
}
}
// 多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割
if (ip != null && ip.length() > 15) {
if (ip.indexOf(",") > 0) {
ip = ip.substring(0, ip.indexOf(","));
}
}
return ip;
}
}
package com.clx.performance.config;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Configuration
@Getter
@Setter
@ConfigurationProperties(prefix = "ali.slider")
public class AliSliderConfig {
private String accessKeyId;
private String accessKeySecret;
private String regionId;
private String product;
private String domain;
}
package com.clx.performance.config;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Configuration
@Getter
@Setter
@ConfigurationProperties(prefix = "clx.message")
public class ClxMessageConfig {
//应用ID
private Long appId;
//渠道ID
private Integer channelId;
//短信验证码模板
private String captchaTemplateCode;
}
...@@ -42,84 +42,31 @@ public class RabbitBeanConfig { ...@@ -42,84 +42,31 @@ public class RabbitBeanConfig {
@Bean @Bean
public Queue orderOnQueue() { public Queue orderOnQueue() {
Map<String, Object> params = new HashMap<>(6); return new Queue(RabbitKeyConstants.ORDER_ON_QUEUE, true, false, false);
params.put("x-dead-letter-exchange", RabbitKeyConstants.ORDER_ON_DEAD_EXCHANGE);
params.put("x-dead-letter-routing-key", RabbitKeyConstants.ORDER_ON_DEAD_ROUTE_KEY);
return new Queue(RabbitKeyConstants.ORDER_ON_QUEUE, true, false, false, params);
} }
/** /**
* 订单挂单中交换机 * 订单挂单中交换机
**/ **/
@Bean @Bean
public DirectExchange orderOnExchange() { public CustomExchange orderOnExchange() {
return new DirectExchange(RabbitKeyConstants.ORDER_ON_EXCHANGE); Map<String, Object> arguments = new HashMap<>();
//设置路由模式 direct模式
arguments.put("x-delayed-type", "direct");
return new CustomExchange(RabbitKeyConstants.ORDER_ON_EXCHANGE,"x-delayed-message", true, false, arguments);
} }
/** /**
* 订单挂单中绑定 * 订单挂单中绑定
*/ */
@Bean @Bean
public Binding orderOnExchangeBind() { public Binding orderOnExchangeBind(@Qualifier("orderOnQueue")Queue queue,@Qualifier("orderOnExchange")CustomExchange customExchange) {
return BindingBuilder.bind(orderOnQueue()).to(orderOnExchange()).with(RabbitKeyConstants.ORDER_ON_ROUTE_KEY); return BindingBuilder.bind(queue).to(customExchange).with(RabbitKeyConstants.ORDER_ON_ROUTE_KEY).noargs();
} }
/**
* 死信队列:死信队列处理延迟消息
* @return
*/
@Bean
public Queue orderOnDeadQueue() {
return new Queue(RabbitKeyConstants.ORDER_ON_DEAD_QUEUE, true, false, false);
}
/** /**
* 订单挂单中交换机:死信队列处理延迟消息 * 处理延迟消息货单挂单
**/
@Bean
public DirectExchange orderOnDeadExchange() {
return new DirectExchange(RabbitKeyConstants.ORDER_ON_DEAD_EXCHANGE);
}
/**
* 订单挂单中绑定:死信队列处理延迟消息
*/
@Bean
public Binding orderDeadExchangeBind() {
return BindingBuilder.bind(orderOnDeadQueue()).to(orderOnDeadExchange()).with(RabbitKeyConstants.ORDER_ON_DEAD_ROUTE_KEY);
}
/**
// * 货单挂单队列
// * @return
// */
// @Bean
// public Queue orderGoodsOnQueue() {
// Map<String, Object> params = new HashMap<>(6);
// params.put("x-dead-letter-exchange", RabbitKeyConstants.ORDER_GOODS_ON_DEAD_EXCHANGE);
// params.put("x-dead-letter-routing-key", RabbitKeyConstants.ORDER_GOODS_ON_DEAD_ROUTE_KEY);
// return new Queue(RabbitKeyConstants.ORDER_GOODS_ON_QUEUE, true, false, false, params);
// }
//
// /**
// * 货单挂单中交换机
// **/
// @Bean
// public DirectExchange orderGoodsOnExchange() {
// return new DirectExchange(RabbitKeyConstants.ORDER_GOODS_ON_EXCHANGE);
// }
//
// /**
// * 货单挂单中绑定
// */
// @Bean
// public Binding orderGoodsOnExchangeBind() {
// return BindingBuilder.bind(orderGoodsOnQueue()).to(orderGoodsOnExchange()).with(RabbitKeyConstants.ORDER_GOODS_ON_ROUTE_KEY);
// }
/**
* 死信队列:死信队列处理延迟消息货单挂单
* @return * @return
*/ */
@Bean @Bean
...@@ -128,7 +75,7 @@ public class RabbitBeanConfig { ...@@ -128,7 +75,7 @@ public class RabbitBeanConfig {
} }
/** /**
* 货单挂单中交换机:死信队列处理延迟消息 * 货单挂单中交换机:处理延迟消息
**/ **/
@Bean @Bean
public CustomExchange orderGoodsOnDeadExchange() { public CustomExchange orderGoodsOnDeadExchange() {
...@@ -138,13 +85,6 @@ public class RabbitBeanConfig { ...@@ -138,13 +85,6 @@ public class RabbitBeanConfig {
return new CustomExchange(RabbitKeyConstants.ORDER_GOODS_ON_DEAD_EXCHANGE,"x-delayed-message", true, false, arguments); return new CustomExchange(RabbitKeyConstants.ORDER_GOODS_ON_DEAD_EXCHANGE,"x-delayed-message", true, false, arguments);
} }
/**
* 货单挂单中绑定:死信队列处理延迟消息
*/
// @Bean
// public Binding orderGoodsDeadExchangeBind() {
// return BindingBuilder.bind(orderGoodsOnDeadQueue()).to(orderGoodsOnDeadExchange()).with(RabbitKeyConstants.ORDER_GOODS_ON_DEAD_ROUTE_KEY);
// }
//绑定交换机,队列和routingKey //绑定交换机,队列和routingKey
@Bean @Bean
public Binding delayedQueueBindingDelayedExchange(@Qualifier("orderGoodsOnDeadQueue")Queue queue,@Qualifier("orderGoodsOnDeadExchange")CustomExchange customExchange) { public Binding delayedQueueBindingDelayedExchange(@Qualifier("orderGoodsOnDeadQueue")Queue queue,@Qualifier("orderGoodsOnDeadExchange")CustomExchange customExchange) {
......
...@@ -39,6 +39,9 @@ public class RabbitKeyConstants { ...@@ -39,6 +39,9 @@ public class RabbitKeyConstants {
//承运订单同步一部 需要手动创建对列交换机 //承运订单同步一部 需要手动创建对列交换机
public static final String CLX_PERFORMANCE_ORDER_CHILD_QUEUE = "clx_performance.order_child_queue"; public static final String CLX_PERFORMANCE_ORDER_CHILD_QUEUE = "clx_performance.order_child_queue";
//承运货单监听 需要手动创建对列交换机
public static final String CLX_PERFORMANCE_ORDER_GOODS_QUEUE = "clx_performance.order_goods_queue";
public static final String ORDER_GOODS_ON_QUEUE ="clx-order.order.goods.on.queue"; public static final String ORDER_GOODS_ON_QUEUE ="clx-order.order.goods.on.queue";
public static final String ORDER_GOODS_ON_EXCHANGE ="clx-order.order.goods.on.exchange"; public static final String ORDER_GOODS_ON_EXCHANGE ="clx-order.order.goods.on.exchange";
...@@ -58,4 +61,13 @@ public class RabbitKeyConstants { ...@@ -58,4 +61,13 @@ public class RabbitKeyConstants {
public static final String ORDER_CANCEL_ROUTE_KEY ="clx-order.order.cancel.route.key"; public static final String ORDER_CANCEL_ROUTE_KEY ="clx-order.order.cancel.route.key";
public static final String ORDER_LARGE_SCREEN_QUEUE ="clx-order.order.large.screen.queue";
// 预付运费和保证金 自动冻结 触发消息队列
public static final String FREEZE_TRIGGER_EXCHANGE = "clx-order.freeze.trigger.exchange";
public static final String FREEZE_TRIGGER_QUEUE = "clx-order.freeze.trigger.queue";
public static final String FREEZE_TRIGGER_ROUTING_KEY = "clx-order.freeze.trigger.routing.key";
} }
...@@ -31,4 +31,9 @@ public class RedisConstants { ...@@ -31,4 +31,9 @@ public class RedisConstants {
* 雪花 * 雪花
*/ */
public static final String ID_SNOWFLAKE = "clx-performance:idsnowflake"; public static final String ID_SNOWFLAKE = "clx-performance:idsnowflake";
public static final String MESSAGE_MOBILE_CAPTCHA = "message:mobile:captcha:";
public static final String MESSAGE_RESET_PASSWORD_TOKEN = "message:resetpassword:token:";
} }
...@@ -5,6 +5,7 @@ import com.clx.performance.param.app.*; ...@@ -5,6 +5,7 @@ import com.clx.performance.param.app.*;
import com.clx.performance.service.OrderChildService; import com.clx.performance.service.OrderChildService;
import com.clx.performance.vo.app.*; import com.clx.performance.vo.app.*;
import com.msl.common.base.PageData; import com.msl.common.base.PageData;
import com.msl.common.base.PageParam;
import com.msl.common.convertor.aspect.UnitCovert; import com.msl.common.convertor.aspect.UnitCovert;
import com.msl.common.result.Result; import com.msl.common.result.Result;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -174,4 +175,11 @@ public class AppDriverOrderChildController { ...@@ -174,4 +175,11 @@ public class AppDriverOrderChildController {
return Result.ok(orderChildService.getGoingLatestOrderChild()); return Result.ok(orderChildService.getGoingLatestOrderChild());
} }
@ApiOperation(value = "客诉运单列表", notes = "<br>By:刘海泉")
@PostMapping("/pageCustomerComplaintOrderChild")
public Result<PageData<CustomerComplaintOrderChildVO>> pageCustomerComplaintOrderChild(@RequestBody @Validated PageParam param) {
IPage<CustomerComplaintOrderChildVO> page = orderChildService.pageCustomerComplaintOrderChild(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
} }
...@@ -3,6 +3,7 @@ package com.clx.performance.controller.app; ...@@ -3,6 +3,7 @@ package com.clx.performance.controller.app;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.mapper.OrderGoodsMapper; import com.clx.performance.mapper.OrderGoodsMapper;
import com.clx.performance.model.OrderGoods; import com.clx.performance.model.OrderGoods;
import com.clx.performance.param.app.AppGoodsOrderSearchParam;
import com.clx.performance.param.app.OrderGoodsListPageParam; import com.clx.performance.param.app.OrderGoodsListPageParam;
import com.clx.performance.service.OrderGoodsService; import com.clx.performance.service.OrderGoodsService;
import com.clx.performance.service.OrderGoodsTruckBindService; import com.clx.performance.service.OrderGoodsTruckBindService;
...@@ -61,6 +62,15 @@ public class AppGoodsOrderController { ...@@ -61,6 +62,15 @@ public class AppGoodsOrderController {
} }
@ApiOperation(value = "APP首页搜索", notes = "<br>By:胡宇帆")
@PostMapping("/indexOrderGoodsListSearch")
@UnitCovert(param = false)
public Result<PageData<OrderGoodsAPPVO>> indexOrderGoodsListSearch(@RequestBody AppGoodsOrderSearchParam param) {
IPage<OrderGoodsAPPVO> page = orderGoodsService.indexOrderGoodsListSearch(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
@ApiOperation(value = "司机端无接单位置上报", notes = "<br>By:胡宇帆") @ApiOperation(value = "司机端无接单位置上报", notes = "<br>By:胡宇帆")
@GetMapping("/getCancelOrderGoods") @GetMapping("/getCancelOrderGoods")
public Result<List<OrderGoodsAPPVO>> getCancelOrderGoods(@RequestParam(value = "userNo") Long userNo) { public Result<List<OrderGoodsAPPVO>> getCancelOrderGoods(@RequestParam(value = "userNo") Long userNo) {
......
package com.clx.performance.controller.app;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.annotation.ResetPassword;
import com.clx.performance.param.app.CheckMobileParam;
import com.clx.performance.param.app.InformationParam;
import com.clx.performance.param.app.ResetPasswordParam;
import com.clx.performance.param.app.SendMobileCaptchaParam;
import com.clx.performance.param.pc.PageAppPrepaidFreightAccountParam;
import com.clx.performance.service.OwnerAccountService;
import com.clx.performance.vo.pc.OwnerAccountRunningWaterRecordVO;
import com.msl.common.base.PageData;
import com.msl.common.convertor.aspect.UnitCovert;
import com.msl.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("/app/owner")
@Validated
@AllArgsConstructor
@Api(tags = "APP-货主资金管理")
public class AppOwnerAccountController {
private final OwnerAccountService ownerAccountService;
@ApiOperation(value = "APP货主流水", notes = "<br>By:胡宇帆")
@PostMapping("/prepaidFreightOwnerAccountPageList")
@UnitCovert(param = false)
public Result<PageData<OwnerAccountRunningWaterRecordVO>> prepaidFreightOwnerAccountPageList(@RequestBody PageAppPrepaidFreightAccountParam param) {
IPage<OwnerAccountRunningWaterRecordVO> page = ownerAccountService.prepaidFreightOwnerAccountPageList(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
@ApiOperation(value = "发送手机验证码", notes = "<br>By:胡宇帆")
@PostMapping("/sendMobileCaptcha")
@ResetPassword(name = "sendMobileCaptcha")
public Result<String> sendMobileCaptcha(@RequestBody SendMobileCaptchaParam param) {
String token = ownerAccountService.sendMobileCaptcha(param);
return Result.ok(token);
}
@ApiOperation(value = "验证手机号验证码", notes = "<br>By:胡宇帆")
@PostMapping("/checkMobile")
@ResetPassword(name = "checkMobile")
public Result<String> checkMobile(@RequestBody CheckMobileParam param) {
String token = ownerAccountService.checkMobile(param);
return Result.ok(token);
}
@ApiOperation(value = "验证营业执照编号", notes = "<br>By:胡宇帆")
@PostMapping("/checkBusinessLicenseNumber")
@ResetPassword(name = "checkBusinessLicenseNumber")
public Result<String> checkBusinessLicenseNumber(@RequestBody InformationParam param) {
String token = ownerAccountService.checkBusinessLicenseNumber(param);
return Result.ok(token);
}
@ApiOperation(value = "修改交易密码", notes = "<br>By:胡宇帆")
@PostMapping("/resetPassword")
@ResetPassword(name = "resetPassword")
public Result<Object> resetPassword(@RequestBody ResetPasswordParam param) {
ownerAccountService.resetPassword(param);
return Result.ok();
}
}
package com.clx.performance.controller.pc;
import cn.hutool.json.JSONUtil;
import com.clx.performance.service.LargeScreenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.constraints.NotNull;
@Slf4j
@RestController
@RequestMapping("/pc/largescreen")
@Validated
@AllArgsConstructor
@Api(tags = "PC-大屏")
public class LargeScreenController {
private final LargeScreenService largeScreenService;
@ApiOperation(value = "空车列表", notes = "<br>By:胡宇帆")
@GetMapping("/emptyCarList")
public String emptyCarList() {
return JSONUtil.toJsonStr(largeScreenService.emptyCarList());
}
@ApiOperation(value = "重车列表", notes = "<br>By:胡宇帆")
@GetMapping("/weightCarList")
public String weightCarList() {
return JSONUtil.toJsonStr(largeScreenService.weightCarList());
}
@ApiOperation(value = "收货地址", notes = "<br>By:胡宇帆")
@GetMapping("/receiveAddress")
public String receiveAddress(@RequestParam(value = "addressId")@NotNull Integer addressId) {
return largeScreenService.receiveAddress(addressId);
}
@ApiOperation(value = "发货地址", notes = "<br>By:胡宇帆")
@GetMapping("/sendAddress")
public String sendAddress(@RequestParam(value = "addressId") @NotNull Integer addressId) {
return largeScreenService.sendAddress(addressId);
}
@ApiOperation(value = "线路", notes = "<br>By:胡宇帆")
@GetMapping("/lineString")
public String lineString(@RequestParam(value = "addressId")@NotNull Integer addressId) {
return largeScreenService.routeLine(addressId);
}
}
\ No newline at end of file
package com.clx.performance.controller.pc.customer;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.param.pc.customer.PageCustomerComplaintDetailParam;
import com.clx.performance.param.pc.customer.SaveCustomerComplaintDetailParam;
import com.clx.performance.service.customer.CustomerComplaintDetailService;
import com.clx.performance.vo.pc.customer.CustomerComplaintDetailVO;
import com.msl.common.base.PageData;
import com.msl.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @ClassName CustomerComplaintTypeController
* @Description
* @Author kavin
* @Date 2023/12/7 10:44
* @Version 1.0
*/
@Slf4j
@RestController
@RequestMapping(value="/pc/carrier/customer/complaint/type")
@Validated
@Api(tags = "客服-投诉详情")
@AllArgsConstructor
public class CustomerComplaintDetailController {
private final CustomerComplaintDetailService customerComplaintDetailService;
@ApiOperation(value = "保存客户投诉",notes = "<br>By:刘海泉")
@PostMapping("/saveCustomerComplaintDetail")
public Result<Object> saveCustomerComplaintDetail(@RequestBody @Validated SaveCustomerComplaintDetailParam param){
customerComplaintDetailService.saveCustomerComplaintDetail(param);
return Result.ok();
}
@ApiOperation(value = "投诉详情列表",notes = "<br>By:刘海泉")
@PostMapping("/pageCustomerComplaintDetail")
public Result<PageData<CustomerComplaintDetailVO>> pageCustomerComplaintDetail(@RequestBody @Validated PageCustomerComplaintDetailParam param){
IPage<CustomerComplaintDetailVO> page = customerComplaintDetailService.pageCustomerComplaintDetail(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
}
package com.clx.performance.controller.pc.customer;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.param.pc.customer.PageCustomerComplaintTypeParam;
import com.clx.performance.param.pc.customer.SaveComplaintTypeParam;
import com.clx.performance.service.customer.CustomerComplaintTypeService;
import com.clx.performance.vo.pc.customer.CustomerComplaintTypeVO;
import com.msl.common.base.PageData;
import com.msl.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @ClassName CustomerComplaintTypeController
* @Description
* @Author kavin
* @Date 2023/12/7 10:44
* @Version 1.0
*/
@Slf4j
@RestController
@RequestMapping(value="/pc/carrier/customer/complaint/type")
@Validated
@Api(tags = "客服-投诉分类")
@AllArgsConstructor
public class CustomerComplaintTypeController {
private final CustomerComplaintTypeService customerComplaintTypeService;
@ApiOperation(value = "保存/更新投诉分类",notes = "<br>By:刘海泉")
@PostMapping("/saveCustomerComplaintType")
public Result<Object> saveCustomerComplaintType(@RequestBody @Validated SaveComplaintTypeParam param){
customerComplaintTypeService.saveCustomerComplaintType(param);
return Result.ok();
}
@ApiOperation(value = "投诉分类列表",notes = "<br>By:刘海泉")
@PostMapping("/pageCustomerComplaintType")
public Result<PageData<CustomerComplaintTypeVO>> pageCustomerComplaintType(@RequestBody @Validated PageCustomerComplaintTypeParam param){
IPage<CustomerComplaintTypeVO> page = customerComplaintTypeService.pageCustomerComplaintType(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
@ApiOperation(value = "投诉分类下拉选",notes = "<br>By:刘海泉")
@PostMapping("/getCustomerComplaintTypeSelect")
public Result<List<CustomerComplaintTypeVO>> getCustomerComplaintTypeSelect(@RequestBody @Validated PageCustomerComplaintTypeParam param){
List<CustomerComplaintTypeVO> list = customerComplaintTypeService.getCustomerComplaintTypeSelect(param);
return Result.ok(list);
}
}
...@@ -166,4 +166,13 @@ public class OwnerAccountController { ...@@ -166,4 +166,13 @@ public class OwnerAccountController {
ownerAccountService.createAccount(param); ownerAccountService.createAccount(param);
return Result.ok(); return Result.ok();
} }
@ApiOperation(value = "APP货主流水", notes = "<br>By:胡宇帆")
@PostMapping("/prepaidFreightOwnerAccountPageList")
@UnitCovert(param = false)
public Result<PageData<OwnerAccountRunningWaterRecordVO>> prepaidFreightOwnerAccountPageList(@RequestBody PageAppPrepaidFreightAccountParam param) {
param.setUserNo(TokenUtil.getLoginUserInfo().getUserNo());
IPage<OwnerAccountRunningWaterRecordVO> page = ownerAccountService.prepaidFreightOwnerAccountPageList(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
} }
package com.clx.performance.dao;
import com.clx.performance.mapper.LargeScreenAddressRouteMapper;
import com.clx.performance.model.LargeScreenAddressRoute;
import com.msl.common.base.Optional;
import com.msl.common.dao.BaseDao;
import java.util.List;
/**
* @author kavin
* Date 2023-11-22
* Time 10:54
*/
public interface LargeScreenAddressRouteDao extends BaseDao<LargeScreenAddressRouteMapper, LargeScreenAddressRoute, Integer> {
List<LargeScreenAddressRoute> getEntityByReceiveAddressIdAndSendAddressId(Integer receiveAddressId, Integer sendAddressId);
List<LargeScreenAddressRoute> selectList();
}
...@@ -11,6 +11,7 @@ import com.clx.performance.vo.app.OrderChildVO; ...@@ -11,6 +11,7 @@ import com.clx.performance.vo.app.OrderChildVO;
import com.clx.performance.vo.pc.PageCarrierOrderChildVO; import com.clx.performance.vo.pc.PageCarrierOrderChildVO;
import com.clx.performance.vo.pc.PageOrderChildPoundAuditVO; import com.clx.performance.vo.pc.PageOrderChildPoundAuditVO;
import com.msl.common.base.Optional; import com.msl.common.base.Optional;
import com.msl.common.base.PageParam;
import com.msl.common.dao.BaseDao; import com.msl.common.dao.BaseDao;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -158,4 +159,8 @@ public interface OrderChildDao extends BaseDao<OrderChildMapper, OrderChild, Int ...@@ -158,4 +159,8 @@ public interface OrderChildDao extends BaseDao<OrderChildMapper, OrderChild, Int
Long haveArriveReceiveChild(String orderNo); Long haveArriveReceiveChild(String orderNo);
List<OrderChild> selectListWithEmptyCarList();
Page<OrderChild> getMonthAgoByUserNo(Long userNo, LocalDateTime monthAgo, PageParam param);
} }
package com.clx.performance.dao; package com.clx.performance.dao;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.param.app.AppGoodsOrderSearchParam;
import com.clx.performance.param.pc.OrderGoodsEditParams; import com.clx.performance.param.pc.OrderGoodsEditParams;
import com.clx.performance.param.pc.PageOrderGoodsListParam; import com.clx.performance.param.pc.PageOrderGoodsListParam;
import com.clx.performance.mapper.OrderGoodsMapper; import com.clx.performance.mapper.OrderGoodsMapper;
...@@ -93,5 +94,7 @@ public interface OrderGoodsDao extends BaseDao<OrderGoodsMapper, OrderGoods, Int ...@@ -93,5 +94,7 @@ public interface OrderGoodsDao extends BaseDao<OrderGoodsMapper, OrderGoods, Int
List<Double> getFreightPrice( Integer sendAddressId,Integer receiveAddressId,String orderNo); List<Double> getFreightPrice( Integer sendAddressId,Integer receiveAddressId,String orderNo);
IPage<OrderGoodsAPPVO> indexOrderGoodsListSearch(AppGoodsOrderSearchParam param);
void batchUpdateResidueWeight(List<Integer> list, BigDecimal residueWeight);
} }
...@@ -27,7 +27,7 @@ public interface OrderGoodsTruckBindDao extends BaseDao<OrderGoodsTruckBindMappe ...@@ -27,7 +27,7 @@ public interface OrderGoodsTruckBindDao extends BaseDao<OrderGoodsTruckBindMappe
Optional<OrderGoodsTruckBind> getValidByOrderGoodsNoAndTruckNo(String truckNo); Optional<OrderGoodsTruckBind> getValidByOrderGoodsNoAndTruckNo(String truckNo);
Optional<List<OrderGoodsTruckBind>> getValidByTruckNo(String truckNo); Optional<List<OrderGoodsTruckBind>> getValidByTruckNo(String truckNo);
Optional<List<OrderGoodsTruckBind>> selectListByTruckNo(List<String> truckList); List<String> selectListByTruckNo(List<String> truckList);
void updateOrderGoodsBindStatus(String orderGoodsNo, Integer code); void updateOrderGoodsBindStatus(String orderGoodsNo, Integer code);
...@@ -56,4 +56,7 @@ public interface OrderGoodsTruckBindDao extends BaseDao<OrderGoodsTruckBindMappe ...@@ -56,4 +56,7 @@ public interface OrderGoodsTruckBindDao extends BaseDao<OrderGoodsTruckBindMappe
void deleteByOrderGoods(String orderGoodsNo); void deleteByOrderGoods(String orderGoodsNo);
List<String> findUnreleasedTruck(); List<String> findUnreleasedTruck();
void updateTruckBindExpire(List<Integer> ids);
} }
package com.clx.performance.dao;
import com.clx.performance.mapper.OwnerAccountPasswordMapper;
import com.clx.performance.model.OwnerAccountPassword;
import com.msl.common.dao.BaseDao;
/**
* @author kavin
* Date 2023-11-28
* Time 17:42
*/
public interface OwnerAccountPasswordDao extends BaseDao<OwnerAccountPasswordMapper, OwnerAccountPassword, Integer> {
OwnerAccountPassword findEntityByUserNo(Long userNo);
}
...@@ -3,6 +3,7 @@ package com.clx.performance.dao; ...@@ -3,6 +3,7 @@ package com.clx.performance.dao;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.mapper.OwnerRunningWaterRecordMapper; import com.clx.performance.mapper.OwnerRunningWaterRecordMapper;
import com.clx.performance.model.OwnerRunningWaterRecord; import com.clx.performance.model.OwnerRunningWaterRecord;
import com.clx.performance.param.pc.PageAppPrepaidFreightAccountParam;
import com.clx.performance.param.pc.PageOwnerAccountRunningWaterParam; import com.clx.performance.param.pc.PageOwnerAccountRunningWaterParam;
import com.clx.performance.param.pc.PagePlatformMarginAccountParam; import com.clx.performance.param.pc.PagePlatformMarginAccountParam;
import com.clx.performance.param.pc.PagePlatformPrepaidFreightAccountParam; import com.clx.performance.param.pc.PagePlatformPrepaidFreightAccountParam;
...@@ -18,6 +19,9 @@ public interface OwnerRunningWaterRecordDao extends BaseDao<OwnerRunningWaterRec ...@@ -18,6 +19,9 @@ public interface OwnerRunningWaterRecordDao extends BaseDao<OwnerRunningWaterRec
IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountPageList(PagePlatformPrepaidFreightAccountParam param); IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountPageList(PagePlatformPrepaidFreightAccountParam param);
IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightOwnerAccountPageList(PageAppPrepaidFreightAccountParam param);
List<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountList(PagePlatformPrepaidFreightAccountParam param); List<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountList(PagePlatformPrepaidFreightAccountParam param);
......
package com.clx.performance.dao.customer;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.mapper.customer.CustomerComplaintDetailMapper;
import com.clx.performance.model.customer.CustomerComplaintDetail;
import com.clx.performance.param.pc.customer.PageCustomerComplaintDetailParam;
import com.clx.performance.vo.pc.customer.CustomerComplaintDetailVO;
import com.msl.common.dao.BaseDao;
public interface CustomerComplaintDetailDao extends BaseDao<CustomerComplaintDetailMapper, CustomerComplaintDetail, Integer> {
Page<CustomerComplaintDetailVO> pageCustomerComplaintDetail(PageCustomerComplaintDetailParam param);
}
package com.clx.performance.dao.customer;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.mapper.customer.CustomerComplaintTypeMapper;
import com.clx.performance.model.customer.CustomerComplaintType;
import com.clx.performance.param.pc.customer.PageCustomerComplaintTypeParam;
import com.msl.common.dao.BaseDao;
import java.util.List;
public interface CustomerComplaintTypeDao extends BaseDao<CustomerComplaintTypeMapper, CustomerComplaintType, Integer> {
long countByNameExcludeSelf(String name, Integer id);
Page<CustomerComplaintType> pageCustomerComplaintType(PageCustomerComplaintTypeParam param);
List<CustomerComplaintType> getCustomerComplaintTypeSelect(PageCustomerComplaintTypeParam param);
}
package com.clx.performance.dao.impl;
import com.clx.performance.dao.LargeScreenAddressRouteDao;
import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.mapper.LargeScreenAddressRouteMapper;
import com.clx.performance.model.LargeScreenAddressRoute;
import com.msl.common.base.Optional;
import com.msl.common.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author kavin
* Date 2023-11-22
* Time 10:54
*/
@Repository
public class LargeScreenAddressRouteDaoImpl extends BaseDaoImpl<LargeScreenAddressRouteMapper, LargeScreenAddressRoute, Integer> implements LargeScreenAddressRouteDao {
@Override
public List<LargeScreenAddressRoute> getEntityByReceiveAddressIdAndSendAddressId(Integer receiveAddressId, Integer sendAddressId) {
return baseMapper.selectList(lQrWrapper().eq(LargeScreenAddressRoute::getReceiveSystemAddressId, receiveAddressId)
.eq(LargeScreenAddressRoute::getSendSystemAddressId, sendAddressId)
);
}
@Override
public List<LargeScreenAddressRoute> selectList() {
return baseMapper.selectList(null);
}
}
...@@ -16,6 +16,7 @@ import com.clx.performance.vo.app.OrderChildVO; ...@@ -16,6 +16,7 @@ import com.clx.performance.vo.app.OrderChildVO;
import com.clx.performance.vo.pc.PageCarrierOrderChildVO; import com.clx.performance.vo.pc.PageCarrierOrderChildVO;
import com.clx.performance.vo.pc.PageOrderChildPoundAuditVO; import com.clx.performance.vo.pc.PageOrderChildPoundAuditVO;
import com.msl.common.base.Optional; import com.msl.common.base.Optional;
import com.msl.common.base.PageParam;
import com.msl.common.dao.impl.BaseDaoImpl; import com.msl.common.dao.impl.BaseDaoImpl;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -494,4 +495,25 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild, ...@@ -494,4 +495,25 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild,
return baseMapper.selectCount(query); return baseMapper.selectCount(query);
} }
@Override
public List<OrderChild> selectListWithEmptyCarList() {
return baseMapper.selectList(lQrWrapper()
.le(OrderChild :: getStatus,OrderChildEnum.Status.UNSETTLE.getCode())
.ge(OrderChild :: getStatus,OrderChildEnum.Status.CREATED.getCode())
);
}
@Override
public Page<OrderChild> getMonthAgoByUserNo(Long userNo, LocalDateTime monthAgo, PageParam param) {
LambdaQueryWrapper<OrderChild> query = new LambdaQueryWrapper<>();
query.and(i ->
i.eq(OrderChild :: getDriverUserNo,userNo).or()
.eq(OrderChild :: getTruckOwnUserNo,userNo)
);
query.ge(OrderChild :: getCreateTime,monthAgo);
query.orderByDesc(OrderChild :: getCreateTime);
return baseMapper.selectPage(Page.of(param.getPage(), param.getPageSize()),query);
}
} }
...@@ -3,14 +3,15 @@ package com.clx.performance.dao.impl; ...@@ -3,14 +3,15 @@ package com.clx.performance.dao.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.performance.param.pc.OrderGoodsEditParams;
import com.clx.performance.param.pc.PageOrderGoodsListParam;
import com.clx.performance.dao.OrderGoodsDao; import com.clx.performance.dao.OrderGoodsDao;
import com.clx.performance.enums.OrderGoodsStatusEnum; import com.clx.performance.enums.OrderGoodsStatusEnum;
import com.clx.performance.mapper.OrderGoodsMapper; import com.clx.performance.mapper.OrderGoodsMapper;
import com.clx.performance.model.OrderGoods; import com.clx.performance.model.OrderGoods;
import com.clx.performance.param.app.AppGoodsOrderSearchParam;
import com.clx.performance.param.app.OrderGoodsListPageParam; import com.clx.performance.param.app.OrderGoodsListPageParam;
import com.clx.performance.param.pc.GoodsOrderMapParam; import com.clx.performance.param.pc.GoodsOrderMapParam;
import com.clx.performance.param.pc.OrderGoodsEditParams;
import com.clx.performance.param.pc.PageOrderGoodsListParam;
import com.clx.performance.vo.app.OrderGoodsAPPVO; import com.clx.performance.vo.app.OrderGoodsAPPVO;
import com.clx.performance.vo.pc.OrderGoodsVO; import com.clx.performance.vo.pc.OrderGoodsVO;
import com.msl.common.base.Optional; import com.msl.common.base.Optional;
...@@ -254,4 +255,18 @@ public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods, ...@@ -254,4 +255,18 @@ public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods,
public List<Double> getFreightPrice( Integer sendAddressId,Integer receiveAddressId,String orderNo) { public List<Double> getFreightPrice( Integer sendAddressId,Integer receiveAddressId,String orderNo) {
return baseMapper.getFreightPrice(orderNo,sendAddressId,receiveAddressId); return baseMapper.getFreightPrice(orderNo,sendAddressId,receiveAddressId);
} }
@Override
public IPage<OrderGoodsAPPVO> indexOrderGoodsListSearch(AppGoodsOrderSearchParam param) {
Page<OrderGoodsAPPVO> page = Page.of(param.getPage(), param.getPageSize());
return baseMapper.indexOrderGoodsListSearch(page,param);
}
@Override
public void batchUpdateResidueWeight(List<Integer> list, BigDecimal residueWeight) {
update(lUdWrapper()
.in(OrderGoods::getId, list)
.set(OrderGoods::getResidueTransportWeight, residueWeight)
);
}
} }
...@@ -2,7 +2,6 @@ package com.clx.performance.dao.impl; ...@@ -2,7 +2,6 @@ package com.clx.performance.dao.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.clx.performance.dao.OrderGoodsTruckBindDao; import com.clx.performance.dao.OrderGoodsTruckBindDao;
import com.clx.performance.enums.OrderGoodsTruckBindEnum; import com.clx.performance.enums.OrderGoodsTruckBindEnum;
import com.clx.performance.mapper.OrderGoodsTruckBindMapper; import com.clx.performance.mapper.OrderGoodsTruckBindMapper;
...@@ -75,10 +74,8 @@ public class OrderGoodsTruckBindDaoImpl extends BaseDaoImpl<OrderGoodsTruckBindM ...@@ -75,10 +74,8 @@ public class OrderGoodsTruckBindDaoImpl extends BaseDaoImpl<OrderGoodsTruckBindM
@Override @Override
public Optional<List<OrderGoodsTruckBind>> selectListByTruckNo(List<String> truckList) { public List<String> selectListByTruckNo(List<String> truckList) {
return Optional.ofNullable(baseMapper.selectList(new QueryWrapper<OrderGoodsTruckBind>().lambda() return baseMapper.selectListByTruckNo(truckList);
.eq(OrderGoodsTruckBind::getStatus, OrderGoodsTruckBindEnum.Status.NORMAL.getCode())
.in(OrderGoodsTruckBind::getTruckNo,truckList).select(OrderGoodsTruckBind::getOrderGoodsNo)));
} }
@Override @Override
...@@ -194,4 +191,12 @@ public class OrderGoodsTruckBindDaoImpl extends BaseDaoImpl<OrderGoodsTruckBindM ...@@ -194,4 +191,12 @@ public class OrderGoodsTruckBindDaoImpl extends BaseDaoImpl<OrderGoodsTruckBindM
public List<String> findUnreleasedTruck() { public List<String> findUnreleasedTruck() {
return baseMapper.findUnreleasedTruck(); return baseMapper.findUnreleasedTruck();
} }
@Override
public void updateTruckBindExpire(List<Integer> ids) {
update(lUdWrapper()
.in(OrderGoodsTruckBind::getId, ids)
.set(OrderGoodsTruckBind::getStatus, OrderGoodsTruckBindEnum.Status.EXPIRE.getCode())
);
}
} }
package com.clx.performance.dao.impl;
import com.clx.performance.dao.OwnerAccountPasswordDao;
import com.clx.performance.mapper.OwnerAccountPasswordMapper;
import com.clx.performance.model.OwnerAccountPassword;
import com.msl.common.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Repository;
/**
* @author kavin
* Date 2023-11-28
* Time 17:42
*/
@Repository
public class OwnerAccountPasswordDaoImpl extends BaseDaoImpl<OwnerAccountPasswordMapper, OwnerAccountPassword, Integer> implements OwnerAccountPasswordDao {
@Override
public OwnerAccountPassword findEntityByUserNo(Long userNo) {
return baseMapper.selectOne(lQrWrapper().eq(OwnerAccountPassword::getUserNo, userNo));
}
}
...@@ -6,6 +6,7 @@ import com.clx.performance.dao.OwnerRunningWaterRecordDao; ...@@ -6,6 +6,7 @@ import com.clx.performance.dao.OwnerRunningWaterRecordDao;
import com.clx.performance.enums.OwnerAccountEnum; import com.clx.performance.enums.OwnerAccountEnum;
import com.clx.performance.mapper.OwnerRunningWaterRecordMapper; import com.clx.performance.mapper.OwnerRunningWaterRecordMapper;
import com.clx.performance.model.OwnerRunningWaterRecord; import com.clx.performance.model.OwnerRunningWaterRecord;
import com.clx.performance.param.pc.PageAppPrepaidFreightAccountParam;
import com.clx.performance.param.pc.PageOwnerAccountRunningWaterParam; import com.clx.performance.param.pc.PageOwnerAccountRunningWaterParam;
import com.clx.performance.param.pc.PagePlatformMarginAccountParam; import com.clx.performance.param.pc.PagePlatformMarginAccountParam;
import com.clx.performance.param.pc.PagePlatformPrepaidFreightAccountParam; import com.clx.performance.param.pc.PagePlatformPrepaidFreightAccountParam;
...@@ -30,6 +31,12 @@ public class OwnerRunningWaterRecordDaoImpl extends BaseDaoImpl<OwnerRunningWate ...@@ -30,6 +31,12 @@ public class OwnerRunningWaterRecordDaoImpl extends BaseDaoImpl<OwnerRunningWate
return baseMapper.prepaidFreightAccountPageList(page, param); return baseMapper.prepaidFreightAccountPageList(page, param);
} }
@Override
public IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightOwnerAccountPageList(PageAppPrepaidFreightAccountParam param) {
Page<OwnerAccountRunningWaterRecordVO> page = Page.of(param.getPage(), param.getPageSize());
return baseMapper.prepaidFreightOwnerAccountPageList(page, param);
}
@Override @Override
public List<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountList(PagePlatformPrepaidFreightAccountParam param) { public List<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountList(PagePlatformPrepaidFreightAccountParam param) {
return baseMapper.prepaidFreightAccountList(param); return baseMapper.prepaidFreightAccountList(param);
......
package com.clx.performance.dao.impl.customer;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.dao.customer.CustomerComplaintDetailDao;
import com.clx.performance.mapper.customer.CustomerComplaintDetailMapper;
import com.clx.performance.model.customer.CustomerComplaintDetail;
import com.clx.performance.param.pc.customer.PageCustomerComplaintDetailParam;
import com.clx.performance.vo.pc.customer.CustomerComplaintDetailVO;
import com.msl.common.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Repository;
/**
* @ClassName CustomerComplaintTypeDaoImpl
* @Description
* @Author kavin
* @Date 2023/12/7 11:25
* @Version 1.0
*/
@Repository
public class CustomerComplaintDetailDaoImpl extends BaseDaoImpl<CustomerComplaintDetailMapper, CustomerComplaintDetail, Integer> implements CustomerComplaintDetailDao {
@Override
public Page<CustomerComplaintDetailVO> pageCustomerComplaintDetail(PageCustomerComplaintDetailParam param) {
return baseMapper.pageCustomerComplaintDetail(Page.of(param.getPage(), param.getPageSize()),param);
}
}
package com.clx.performance.dao.impl.customer;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.dao.customer.CustomerComplaintTypeDao;
import com.clx.performance.mapper.customer.CustomerComplaintTypeMapper;
import com.clx.performance.model.customer.CustomerComplaintType;
import com.clx.performance.param.pc.customer.PageCustomerComplaintTypeParam;
import com.msl.common.dao.impl.BaseDaoImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Objects;
/**
* @ClassName CustomerComplaintTypeDaoImpl
* @Description
* @Author kavin
* @Date 2023/12/7 11:25
* @Version 1.0
*/
@Repository
public class CustomerComplaintTypeDaoImpl extends BaseDaoImpl<CustomerComplaintTypeMapper, CustomerComplaintType, Integer> implements CustomerComplaintTypeDao {
@Override
public long countByNameExcludeSelf(String name, Integer id) {
LambdaQueryWrapper<CustomerComplaintType> query = new LambdaQueryWrapper<>();
query.eq(CustomerComplaintType :: getName,name);
if(Objects.nonNull(id)){
query.ne(CustomerComplaintType :: getId,id);
}
return baseMapper.selectCount(query);
}
@Override
public Page<CustomerComplaintType> pageCustomerComplaintType(PageCustomerComplaintTypeParam param) {
LambdaQueryWrapper<CustomerComplaintType> query = new LambdaQueryWrapper<>();
if(StringUtils.isNotBlank(param.getName())){
query.eq(CustomerComplaintType :: getName,param.getName());
}
query.orderByDesc(CustomerComplaintType :: getModifiedTime);
return baseMapper.selectPage(Page.of(param.getPage(),param.getPageSize()),query);
}
@Override
public List<CustomerComplaintType> getCustomerComplaintTypeSelect(PageCustomerComplaintTypeParam param) {
LambdaQueryWrapper<CustomerComplaintType> query = new LambdaQueryWrapper<>();
if(StringUtils.isNotBlank(param.getName())){
query.eq(CustomerComplaintType :: getName,param.getName());
}
query.orderByDesc(CustomerComplaintType :: getModifiedTime);
return baseMapper.selectList(query);
}
}
...@@ -20,7 +20,7 @@ public class OwnerInfoServiceImpl implements OwnerInfoService { ...@@ -20,7 +20,7 @@ public class OwnerInfoServiceImpl implements OwnerInfoService {
@Override @Override
public OwnerInfoFeignVO getOwnerInfo(Long userNo) { public OwnerInfoFeignVO getOwnerInfo(Long userNo) {
return Optional.ofNullable(ownerInfoFeign.getOwnerInfo(userNo)) return Optional.ofNullable(ownerInfoFeign.getOwnerInfo(userNo))
.filter(Result::succeed).map(item->item.getData()).orElseThrow(ResultCodeEnum.FAIL); .filter(Result::succeed).map(Result::getData).orElseThrow(ResultCodeEnum.FAIL,"未查询到对应的货主信息");
} }
} }
package com.clx.performance.listener;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.clx.order.feign.AddressFeign;
import com.clx.order.vo.feign.FeignAddressVO;
import com.clx.order.vo.feign.FeignOrderVO;
import com.clx.order.vo.feign.ReceiveAndSendAddressVO;
import com.clx.performance.constant.RabbitKeyConstants;
import com.clx.performance.dao.LargeScreenAddressRouteDao;
import com.clx.performance.dto.gd.GdPosDTO;
import com.clx.performance.dto.gd.GdRouteDTO;
import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.model.Geometry;
import com.clx.performance.model.LargeScreenAddressRoute;
import com.clx.performance.model.MongoLargeScreenAddressRoute;
import com.clx.performance.utils.gd.GdService;
import com.msl.common.base.Optional;
import com.msl.common.result.Result;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.data.geo.Point;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.geo.GeoJsonLineString;
import org.springframework.data.mongodb.core.geo.GeoJsonPoint;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.LinkedList;
import java.util.List;
@Slf4j
@Component
@AllArgsConstructor
public class LargeScreenListener {
private final LargeScreenAddressRouteDao largeScreenAddressRouteDao;
private final GdService gdService;
private final AddressFeign addressFeign;
private final MongoTemplate mongoTemplate;
@Transactional(rollbackFor = Exception.class)
@RabbitListener(queues = RabbitKeyConstants.ORDER_LARGE_SCREEN_QUEUE)
public void onMessage(String message) {
try {
FeignOrderVO orderVO = JSONUtil.toBean(message, FeignOrderVO.class);
log.info("处理数据大屏标准地址路线监听器执行,订单Id为{},发货地标准地址ID为{},收货地标准地址ID为{}", orderVO.getOrderNo(), orderVO.getSendSystemAddressId(), orderVO.getReveiveSystemAddressId());
if (ObjectUtil.isNull(orderVO.getSendSystemAddressId()) || ObjectUtil.isNull(orderVO.getReveiveSystemAddressId())) {
log.info("当前订单标准地址相关为空,不予处理");
return;
}
Integer receiveAddressId = orderVO.getReveiveSystemAddressId();
Integer sendAddressId = orderVO.getSendSystemAddressId();
String receiveName = orderVO.getReveiveAddressShorter();
String sendName = orderVO.getSendAddressShorter();
List<LargeScreenAddressRoute> list = largeScreenAddressRouteDao.getEntityByReceiveAddressIdAndSendAddressId(receiveAddressId, sendAddressId);
if (CollectionUtil.isNotEmpty(list)) {
log.info("当前地址已经记录receiveAddressId{}, sendAddressId{}", receiveAddressId, sendAddressId);
} else {
ReceiveAndSendAddressVO feignAddressVO = Optional.of(addressFeign.getSendAndReceiveSystemAddress(sendAddressId, receiveAddressId)).filter(Result::succeed)
.map(Result::getData).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
log.info("查询出标准地址相关坐标经纬度:{}", JSONUtil.parse(feignAddressVO));
BigDecimal sendAddressLatitude = feignAddressVO.getSendAddressVo().getLatitude().setScale(4, RoundingMode.DOWN);
BigDecimal sendAddressLongitude = feignAddressVO.getSendAddressVo().getLongitude().setScale(4, RoundingMode.DOWN);
BigDecimal receiveAddressLatitude = feignAddressVO.getReceiveAddressVo().getLatitude().setScale(4, RoundingMode.DOWN);
BigDecimal receiveAddressLongitude = feignAddressVO.getReceiveAddressVo().getLongitude().setScale(4, RoundingMode.DOWN);
List<GdRouteDTO> route = gdService.getRoute(sendAddressLongitude, sendAddressLatitude, receiveAddressLongitude, receiveAddressLatitude);
MongoLargeScreenAddressRoute mongoEntity = new MongoLargeScreenAddressRoute();
mongoEntity.setName(sendName);
mongoEntity.setReceiveSystemAddressId(receiveAddressId);
mongoEntity.setSendSystemAddressId(sendAddressId);
mongoEntity.setValue(sendName);
mongoEntity.setColorField("3");
mongoEntity.setSizeField("3");
mongoEntity.setInfo(receiveName);
List<Point> points = new LinkedList<>();
List<GdPosDTO> posList = route.get(0).getPosList();
for (GdPosDTO gdPosDTO : posList) {
GeoJsonPoint geoJsonPoint = new GeoJsonPoint(new Point(gdPosDTO.getLongitude().doubleValue(), gdPosDTO.getLatitude().doubleValue()));
points.add(geoJsonPoint);
}
mongoEntity.setGeometry(new GeoJsonLineString(points));
mongoTemplate.insert(mongoEntity);
LargeScreenAddressRoute build = LargeScreenAddressRoute.builder().
receiveSystemAddressId(receiveAddressId)
.sendSystemAddressId(sendAddressId)
.receiveName(receiveName)
.sendName(sendName)
.build();
largeScreenAddressRouteDao.saveEntity(build);
}
} catch (Exception e) {
log.info("数据大屏监控订单轨迹线路异常:{}", e.getMessage());
}
}
}
package com.clx.performance.listener; package com.clx.performance.listener;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.clx.performance.constant.RabbitKeyConstants; import com.clx.performance.constant.RabbitKeyConstants;
import com.clx.performance.enums.RoleEnum;
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.breakcontract.BreakContractSettlementOwnerService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Objects;
/** /**
* 处理货单取消吨数回填 * 处理货单取消吨数回填
*/ */
@Slf4j @Slf4j
@Component @Component
@AllArgsConstructor @AllArgsConstructor
public class OrderCancelHandler { public class OrderCancelListener {
private final OrderCancelService orderCancelService; private final OrderCancelService orderCancelService;
......
package com.clx.performance.listener;
import com.alibaba.fastjson.JSON;
import com.clx.order.enums.UpdateEnum;
import com.clx.order.enums.VehicleUsageEnum;
import com.clx.performance.component.GoodsOrderTruckRecordComponent;
import com.clx.performance.component.OrderCancelComponent;
import com.clx.performance.constant.RabbitKeyConstants;
import com.clx.performance.dao.OrderGoodsDao;
import com.clx.performance.dto.dts.DataTransportDTO;
import com.clx.performance.enums.DtsOperationTypeEnum;
import com.clx.performance.enums.OrderGoodsLogsEnum;
import com.clx.performance.enums.OrderGoodsPendingOrderWayStatusEnum;
import com.clx.performance.model.OrderGoods;
import com.clx.performance.service.OrderGoodsLogService;
import com.msl.common.utils.DtsMapConvertUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.Objects;
@Slf4j
@Component
@AllArgsConstructor
public class OrderGoodsDtsListener {
private final OrderCancelComponent orderCancelComponent;
private final GoodsOrderTruckRecordComponent goodsOrderTruckRecordComponent;
private final OrderGoodsDao orderGoodsDao;
private final OrderGoodsLogService orderGoodsLogService;
@RabbitListener(queues = RabbitKeyConstants.CLX_PERFORMANCE_ORDER_GOODS_QUEUE)
public void onMessage(Message message) {
try {
String msg = new String(message.getBody());
log.info("DTS消息同步开始, database:clx_performance.order_goods, msg:{}", msg);
DataTransportDTO dataTransportDTO = JSON.parseObject(msg, DataTransportDTO.class);
OrderGoods before = DtsMapConvertUtil.convert(dataTransportDTO.getBeforeMap(), new OrderGoods());
OrderGoods after = DtsMapConvertUtil.convert(dataTransportDTO.getAfterMap(), new OrderGoods());
if(Objects.equals(DtsOperationTypeEnum.INSERT.getCode(),dataTransportDTO.getOperationType().getCode())){
//同步after数据
log.info("新增:{}",JSON.toJSONString(after));
}else if(Objects.equals(DtsOperationTypeEnum.UPDATE.getCode(),dataTransportDTO.getOperationType().getCode())){
log.info("修改:{}",JSON.toJSONString(after));
backFillOrderWeight(after);
}else if(Objects.equals(DtsOperationTypeEnum.DELETE.getCode(),dataTransportDTO.getOperationType().getCode())){
//数据删除
log.info("删除:{}",JSON.toJSONString(before));
}
} catch (Exception e) {
log.info("DTS消息同步失败, database:clx_performance.order_goods, error:{}", e.getMessage());
}
}
//货单剩余吨数不足35吨,自动恢复吨数到订单上
public void backFillOrderWeight(OrderGoods after){
//剩余吨数小于35吨并且大于0,自动归还订单上
if(new BigDecimal("35").compareTo(after.getResidueTransportWeight()) > 0 &&
after.getResidueTransportWeight().compareTo(BigDecimal.ZERO) > 0){
log.info("开始自动恢复吨数到订单,订单号:{},货单号:{},货单剩余吨数:{}",
after.getOrderNo(),after.getOrderGoodsNo(),after.getResidueTransportWeight());
orderCancelComponent.backFillOrderWeight(after,after.getResidueTransportWeight(), UpdateEnum.ADD.getCode());
OrderGoods orderGoods = new OrderGoods();
orderGoods.setId(after.getId());
orderGoods.setResidueTransportWeight(BigDecimal.ZERO);
orderGoodsDao.updateEntityByKey(orderGoods);
orderGoodsLogService.saveLog(after.getOrderGoodsNo(), 0L, "系统", OrderGoodsLogsEnum.Type.SYSTEM_RELEASE.getName(),
String.format("系统自动释放:%s吨", after.getResidueTransportWeight()));
//释放定向单(非自由车辆)对应的定向车辆
if(Objects.equals(after.getPendingOrderWay(), OrderGoodsPendingOrderWayStatusEnum.Status.EXCLUSIVE.getCode())
&& !Objects.equals(after.getVehicleUsage(), VehicleUsageEnum.Status.OWN.getCode())){
goodsOrderTruckRecordComponent.releaseOrderGoodsDriverAndTruck(after.getOrderGoodsNo());
}
log.info("结束自动恢复吨数到订单,订单号:{},货单号:{},货单剩余吨数:{}",
after.getOrderNo(),after.getOrderGoodsNo(),after.getResidueTransportWeight());
}
}
}
package com.clx.performance.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.clx.performance.model.LargeScreenAddressRoute;
/**
* @author kavin
* Date 2023-11-22
* Time 10:54
*/
public interface LargeScreenAddressRouteMapper extends BaseMapper<LargeScreenAddressRoute> {
}
...@@ -3,6 +3,7 @@ package com.clx.performance.mapper; ...@@ -3,6 +3,7 @@ package com.clx.performance.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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.performance.param.app.AppGoodsOrderSearchParam;
import com.clx.performance.param.pc.OrderGoodsEditParams; import com.clx.performance.param.pc.OrderGoodsEditParams;
import com.clx.performance.param.pc.PageOrderGoodsListParam; import com.clx.performance.param.pc.PageOrderGoodsListParam;
import com.clx.performance.model.OrderGoods; import com.clx.performance.model.OrderGoods;
...@@ -92,4 +93,7 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> { ...@@ -92,4 +93,7 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
@Param("sendAddressId") Integer sendAddressId, @Param("sendAddressId") Integer sendAddressId,
@Param("receiveAddressId") Integer receiveAddressId); @Param("receiveAddressId") Integer receiveAddressId);
@SelectProvider(type = OrderGoodsSqlProvider.class, method = "indexOrderGoodsListSearch")
IPage<OrderGoodsAPPVO> indexOrderGoodsListSearch(@Param("page")Page<OrderGoodsAPPVO> page, @Param("param")AppGoodsOrderSearchParam param);
} }
package com.clx.performance.mapper; package com.clx.performance.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.clx.performance.model.OrderGoodsDriverTruck;
import com.clx.performance.model.OrderGoodsTruckBind; import com.clx.performance.model.OrderGoodsTruckBind;
import com.clx.performance.sqlProvider.OrderGoodsTruckBindSqlProvider; import com.clx.performance.sqlProvider.OrderGoodsTruckBindSqlProvider;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
...@@ -27,7 +26,8 @@ public interface OrderGoodsTruckBindMapper extends BaseMapper<OrderGoodsTruckBin ...@@ -27,7 +26,8 @@ public interface OrderGoodsTruckBindMapper extends BaseMapper<OrderGoodsTruckBin
@Select("select truck_no from order_goods_truck_bind where order_goods_no=#{orderGoodsNo}") @Select("select truck_no from order_goods_truck_bind where order_goods_no=#{orderGoodsNo}")
List<Integer> getTrucksByOrderGoodsNo(@Param("orderGoodsNo") String orderGoodsNo); List<Integer> getTrucksByOrderGoodsNo(@Param("orderGoodsNo") String orderGoodsNo);
List<OrderGoodsDriverTruck> selectListByTruckNo(List<OrderGoodsDriverTruck> truckList); @SelectProvider(type = OrderGoodsTruckBindSqlProvider.class, method = "selectListByTruckNo")
List<String> selectListByTruckNo(List<String> truckList);
@SelectProvider(type = OrderGoodsTruckBindSqlProvider.class, method = "findUnreleasedTruck") @SelectProvider(type = OrderGoodsTruckBindSqlProvider.class, method = "findUnreleasedTruck")
......
package com.clx.performance.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.clx.performance.model.OwnerAccountPassword;
/**
* @author kavin
* Date 2023-11-28
* Time 17:42
*/
public interface OwnerAccountPasswordMapper extends BaseMapper<OwnerAccountPassword> {
}
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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.performance.model.OwnerRunningWaterRecord; import com.clx.performance.model.OwnerRunningWaterRecord;
import com.clx.performance.param.pc.PageAppPrepaidFreightAccountParam;
import com.clx.performance.param.pc.PageOwnerAccountRunningWaterParam; import com.clx.performance.param.pc.PageOwnerAccountRunningWaterParam;
import com.clx.performance.param.pc.PagePlatformMarginAccountParam; import com.clx.performance.param.pc.PagePlatformMarginAccountParam;
import com.clx.performance.param.pc.PagePlatformPrepaidFreightAccountParam; import com.clx.performance.param.pc.PagePlatformPrepaidFreightAccountParam;
...@@ -27,6 +28,10 @@ public interface OwnerRunningWaterRecordMapper extends BaseMapper<OwnerRunningWa ...@@ -27,6 +28,10 @@ public interface OwnerRunningWaterRecordMapper extends BaseMapper<OwnerRunningWa
@SelectProvider(type = OwnerRunningWaterRecordSqlProvider.class, method = "prepaidFreightAccountPageList") @SelectProvider(type = OwnerRunningWaterRecordSqlProvider.class, method = "prepaidFreightAccountPageList")
IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountPageList(Page<OwnerAccountRunningWaterRecordVO> page, PagePlatformPrepaidFreightAccountParam param); IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountPageList(Page<OwnerAccountRunningWaterRecordVO> page, PagePlatformPrepaidFreightAccountParam param);
@SelectProvider(type = OwnerRunningWaterRecordSqlProvider.class, method = "prepaidFreightOwnerAccountPageList")
IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightOwnerAccountPageList(@Param(value = "page")Page<OwnerAccountRunningWaterRecordVO> page, @Param(value = "param")PageAppPrepaidFreightAccountParam param);
@SelectProvider(type = OwnerRunningWaterRecordSqlProvider.class, method = "ownerAccountRunningWaterPageList") @SelectProvider(type = OwnerRunningWaterRecordSqlProvider.class, method = "ownerAccountRunningWaterPageList")
IPage<OwnerAccountRunningWaterRecordVO> ownerAccountRunningWaterPageList(Page<OwnerAccountRunningWaterRecordVO> page, PageOwnerAccountRunningWaterParam param); IPage<OwnerAccountRunningWaterRecordVO> ownerAccountRunningWaterPageList(Page<OwnerAccountRunningWaterRecordVO> page, PageOwnerAccountRunningWaterParam param);
......
package com.clx.performance.mapper.customer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.model.customer.CustomerComplaintDetail;
import com.clx.performance.param.pc.customer.PageCustomerComplaintDetailParam;
import com.clx.performance.sqlProvider.customer.CustomerComplaintDetailSqlProvider;
import com.clx.performance.vo.pc.customer.CustomerComplaintDetailVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;
public interface CustomerComplaintDetailMapper extends BaseMapper<CustomerComplaintDetail> {
@SelectProvider(type = CustomerComplaintDetailSqlProvider.class, method = "pageCustomerComplaintDetail")
Page<CustomerComplaintDetailVO> pageCustomerComplaintDetail(@Param("page") Page<CustomerComplaintDetailVO> page , @Param("param") PageCustomerComplaintDetailParam param);
}
package com.clx.performance.mapper.customer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.clx.performance.model.customer.CustomerComplaintType;
public interface CustomerComplaintTypeMapper extends BaseMapper<CustomerComplaintType> {
}
package com.clx.performance.model;
import lombok.Data;
import org.springframework.data.mongodb.core.geo.GeoJsonLineString;
import java.util.List;
@Data
public class Geometry {
private String type;
private GeoJsonLineString coordinates;
}
package com.clx.performance.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.msl.common.config.KeyColumn;
import com.msl.common.model.HasKey;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
/**
* @author kavin
* Date 2023-11-22
* Time 10:54
*/
@Accessors(chain = true)
@TableName("large_screen_address_route")
@Data
@Builder
public class LargeScreenAddressRoute implements HasKey<Integer> {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@TableField("receive_name")
@ApiModelProperty("收货地址")
private String receiveName;
@TableField("send_name")
@ApiModelProperty("发货地址")
private String sendName;
@TableField("receive_system_address_id")
@ApiModelProperty("收货标准地址id")
private Integer receiveSystemAddressId;
@TableField("send_system_address_id")
@ApiModelProperty("发货标准地址id")
private Integer sendSystemAddressId;
@Override
@KeyColumn("id")
public Integer gainKey() {
return this.id;
}
}
package com.clx.performance.model;
import lombok.Data;
import org.springframework.data.mongodb.core.geo.GeoJsonLineString;
import org.springframework.data.mongodb.core.mapping.Document;
@Data
@Document(collection = "large_screen_address_route")
public class MongoLargeScreenAddressRoute {
// private Integer id;
private Integer sendSystemAddressId;
private Integer receiveSystemAddressId;
private String name;
private String value;
private String sizeField;
private String colorField;
private String info;
private GeoJsonLineString geometry;
}
package com.clx.performance.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.msl.common.config.KeyColumn;
import com.msl.common.model.HasKey;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
/**
* @author kavin
* Date 2023-11-28
* Time 17:42
*/
@Getter
@Setter
@Accessors(chain = true)
@TableName("owner_account_password")
@Builder
public class OwnerAccountPassword implements HasKey<Integer> {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@TableField("user_no")
@ApiModelProperty("")
private Long userNo;
@TableField("password")
@ApiModelProperty("交易密码")
private String password;
@TableField("create_time")
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
@TableField("modified_time")
@ApiModelProperty("修改时间")
private LocalDateTime modifiedTime;
@Override
@KeyColumn("id")
public Integer gainKey() {
return this.id;
}
}
...@@ -100,6 +100,31 @@ public class OwnerTopUp implements HasKey<Integer> { ...@@ -100,6 +100,31 @@ public class OwnerTopUp implements HasKey<Integer> {
*/ */
@TableField("modified_time") @TableField("modified_time")
private LocalDateTime modifiedTime; private LocalDateTime modifiedTime;
/**
* 收款人企业信息
*/
@TableField("enterprise_name")
private String enterpriseName;
/**
*收款人开户行
*/
@TableField("open_account_bank")
private String openAccountBank;
/**
* 收款人开户行银行代码
*/
@TableField("open_account_bank_number")
private String openAccountBankNumber;
/**
* 收款人账户账号
*/
@TableField("account_number")
private String accountNumber;
@KeyColumn("id") @KeyColumn("id")
@Override @Override
public Integer gainKey() { public Integer gainKey() {
......
package com.clx.performance.model.customer;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.msl.common.config.KeyColumn;
import com.msl.common.model.HasKey;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
/**
* @ClassName CustomerComplaintType
* @Description
* @Author kavin
* @Date 2023/12/7 10:54
* @Version 1.0
*/
@Getter
@Setter
@NoArgsConstructor
@TableName(autoResultMap = true)
public class CustomerComplaintDetail implements HasKey<Integer> {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Long driverUserNo; //司机用户编号
private String driverName; //司机姓名
private String driverMobile; //司机手机号
private String childNo; //运单编号
private Integer complaintTypeId; //投诉类型id
private String content; //问题描述
private String picture; //图片
private String createTime; //创建时间
private String modifiedTime; //修改时间
@KeyColumn("id")
@Override
public Integer gainKey() {
return id;
}
}
package com.clx.performance.model.customer;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.msl.common.config.KeyColumn;
import com.msl.common.model.HasKey;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
/**
* @ClassName CustomerComplaintType
* @Description
* @Author kavin
* @Date 2023/12/7 10:54
* @Version 1.0
*/
@Getter
@Setter
@NoArgsConstructor
@TableName(autoResultMap = true)
public class CustomerComplaintType implements HasKey<Integer> {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private String name; //投诉类型名称
private LocalDateTime createTime; //创建时间
private LocalDateTime modifiedTime; //修改时间
@KeyColumn("id")
@Override
public Integer gainKey() {
return id;
}
}
package com.clx.performance.service;
import cn.hutool.json.JSONObject;
import java.util.List;
public interface LargeScreenService {
List<JSONObject> weightCarList();
List<JSONObject> emptyCarList();
String receiveAddress(Integer addressId);
String sendAddress(Integer addressId);
String routeLine(Integer addressId);
}
package com.clx.performance.service; package com.clx.performance.service;
import cn.hutool.json.JSON;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.model.OrderChild; import com.clx.performance.model.OrderChild;
import com.clx.performance.model.OrderGoods;
import com.clx.performance.param.app.*; import com.clx.performance.param.app.*;
import com.clx.performance.param.pc.OrderChildCarrierCancelParam; import com.clx.performance.param.pc.OrderChildCarrierCancelParam;
import com.clx.performance.param.pc.PageCarrierOrderChildParam; import com.clx.performance.param.pc.PageCarrierOrderChildParam;
...@@ -11,10 +10,10 @@ import com.clx.performance.param.pc.PageMonitorOrderChildQCParam; ...@@ -11,10 +10,10 @@ import com.clx.performance.param.pc.PageMonitorOrderChildQCParam;
import com.clx.performance.param.pc.PagePoundAuditParam; import com.clx.performance.param.pc.PagePoundAuditParam;
import com.clx.performance.vo.app.*; import com.clx.performance.vo.app.*;
import com.clx.performance.vo.pc.*; import com.clx.performance.vo.pc.*;
import com.clx.user.vo.pc.driver.truck.DriverTruckVo; import com.msl.common.base.PageParam;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Objects;
/** /**
...@@ -85,4 +84,8 @@ public interface OrderChildService { ...@@ -85,4 +84,8 @@ public interface OrderChildService {
List<OrderChild> selectInTransitOrderChildLtUnsettle(String orderNo); List<OrderChild> selectInTransitOrderChildLtUnsettle(String orderNo);
DriverCancelOrderChildInfo driverCancelOrderChildInfo(String orderChildNo); DriverCancelOrderChildInfo driverCancelOrderChildInfo(String orderChildNo);
void updateOrderGoodsAmountLoad(OrderGoods orderGoods,String childNo, BigDecimal dif, Integer orderGoodsStatus);
IPage<CustomerComplaintOrderChildVO> pageCustomerComplaintOrderChild(PageParam param);
} }
package com.clx.performance.service; package com.clx.performance.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.model.OrderChild; import com.clx.performance.model.OrderChild;
import com.clx.performance.param.pc.*;
import com.clx.performance.model.OrderGoods; import com.clx.performance.model.OrderGoods;
import com.clx.performance.param.app.AppGoodsOrderSearchParam;
import com.clx.performance.param.app.OrderGoodsListPageParam; import com.clx.performance.param.app.OrderGoodsListPageParam;
import com.clx.performance.param.pc.*;
import com.clx.performance.vo.app.OrderGoodsAPPVO; import com.clx.performance.vo.app.OrderGoodsAPPVO;
import com.clx.performance.vo.feign.FreightEstimateVO; import com.clx.performance.vo.feign.FreightEstimateVO;
import com.clx.performance.vo.feign.OrderGoodsFeignVO; import com.clx.performance.vo.feign.OrderGoodsFeignVO;
import com.clx.performance.vo.pc.OrderGoodsEditVO; import com.clx.performance.vo.pc.OrderGoodsEditVO;
import com.clx.performance.vo.pc.OrderGoodsVO; import com.clx.performance.vo.pc.OrderGoodsVO;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
...@@ -32,6 +29,11 @@ public interface OrderGoodsService { ...@@ -32,6 +29,11 @@ public interface OrderGoodsService {
IPage<OrderGoodsVO> pageOrderGoodsList(PageOrderGoodsListParam param); IPage<OrderGoodsVO> pageOrderGoodsList(PageOrderGoodsListParam param);
void updateOrderGoodsReduceWeightAndStatusAmountLoad(OrderGoods orderGoods, BigDecimal orderChildWeight, Integer orderGoodsStatus); void updateOrderGoodsReduceWeightAndStatusAmountLoad(OrderGoods orderGoods, BigDecimal orderChildWeight, Integer orderGoodsStatus);
void borrowWeight(OrderGoods orderGoods,String orderChildNo,BigDecimal subOrderGoodsResidue, BigDecimal addAlready,BigDecimal borrowOrderWeight,
Integer orderGoodsStatus);
void updateOrderGoodsReduceWeightAndStatus(OrderGoods orderGoods, OrderChild orderChild, Integer orderGoodsStatus); void updateOrderGoodsReduceWeightAndStatus(OrderGoods orderGoods, OrderChild orderChild, Integer orderGoodsStatus);
IPage<OrderGoodsAPPVO> indexOrderGoodsList(OrderGoodsListPageParam orderGoodsListParam); IPage<OrderGoodsAPPVO> indexOrderGoodsList(OrderGoodsListPageParam orderGoodsListParam);
...@@ -93,4 +95,8 @@ public interface OrderGoodsService { ...@@ -93,4 +95,8 @@ public interface OrderGoodsService {
Boolean updateSystemAddressId( Integer ownerAddressId, Integer systemAddressId); Boolean updateSystemAddressId( Integer ownerAddressId, Integer systemAddressId);
FreightEstimateVO listFreightEstimate(OrderChildReportParam param); FreightEstimateVO listFreightEstimate(OrderChildReportParam param);
IPage<OrderGoodsAPPVO> indexOrderGoodsListSearch(AppGoodsOrderSearchParam param);
void batchUpdateResidueWeight(List<OrderGoods> list);
} }
...@@ -2,6 +2,10 @@ package com.clx.performance.service; ...@@ -2,6 +2,10 @@ package com.clx.performance.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.model.OwnerTransferInfo; import com.clx.performance.model.OwnerTransferInfo;
import com.clx.performance.param.app.CheckMobileParam;
import com.clx.performance.param.app.InformationParam;
import com.clx.performance.param.app.ResetPasswordParam;
import com.clx.performance.param.app.SendMobileCaptchaParam;
import com.clx.performance.param.open.OpenOwnerBindCardParam; import com.clx.performance.param.open.OpenOwnerBindCardParam;
import com.clx.performance.param.open.OpenOwnerCaseOutParam; import com.clx.performance.param.open.OpenOwnerCaseOutParam;
import com.clx.performance.param.open.OpenOwnerTopUpParam; import com.clx.performance.param.open.OpenOwnerTopUpParam;
...@@ -26,6 +30,9 @@ public interface OwnerAccountService { ...@@ -26,6 +30,9 @@ public interface OwnerAccountService {
IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountPageList(PagePlatformPrepaidFreightAccountParam param); IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountPageList(PagePlatformPrepaidFreightAccountParam param);
IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightOwnerAccountPageList(PageAppPrepaidFreightAccountParam param);
OwnerAccountAllVO accountInfo(Long ownerUserNo); OwnerAccountAllVO accountInfo(Long ownerUserNo);
Long accountTopUp(OwnerTopUpParam param); Long accountTopUp(OwnerTopUpParam param);
...@@ -86,4 +93,12 @@ public interface OwnerAccountService { ...@@ -86,4 +93,12 @@ public interface OwnerAccountService {
void createAccount(CreteAccountParam param); void createAccount(CreteAccountParam param);
void ownerAccountThaw(ThawAccountParam param); void ownerAccountThaw(ThawAccountParam param);
String checkMobile(CheckMobileParam param);
String sendMobileCaptcha(SendMobileCaptchaParam param);
String checkBusinessLicenseNumber(InformationParam param);
void resetPassword(ResetPasswordParam param);
} }
package com.clx.performance.service.customer;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.param.pc.customer.PageCustomerComplaintDetailParam;
import com.clx.performance.param.pc.customer.SaveCustomerComplaintDetailParam;
import com.clx.performance.vo.pc.customer.CustomerComplaintDetailVO;
public interface CustomerComplaintDetailService {
void saveCustomerComplaintDetail(SaveCustomerComplaintDetailParam param);
IPage<CustomerComplaintDetailVO> pageCustomerComplaintDetail(PageCustomerComplaintDetailParam param);
}
package com.clx.performance.service.customer;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.param.pc.customer.PageCustomerComplaintTypeParam;
import com.clx.performance.param.pc.customer.SaveComplaintTypeParam;
import com.clx.performance.vo.pc.customer.CustomerComplaintTypeVO;
import java.util.List;
public interface CustomerComplaintTypeService {
void saveCustomerComplaintType(SaveComplaintTypeParam param);
Page<CustomerComplaintTypeVO> pageCustomerComplaintType(PageCustomerComplaintTypeParam param);
List<CustomerComplaintTypeVO> getCustomerComplaintTypeSelect(PageCustomerComplaintTypeParam param);
}
package com.clx.performance.service.customer.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.dao.customer.CustomerComplaintDetailDao;
import com.clx.performance.model.customer.CustomerComplaintDetail;
import com.clx.performance.param.pc.customer.PageCustomerComplaintDetailParam;
import com.clx.performance.param.pc.customer.SaveCustomerComplaintDetailParam;
import com.clx.performance.service.customer.CustomerComplaintDetailService;
import com.clx.performance.struct.customer.CustomerComplaintDetailStruct;
import com.clx.performance.vo.pc.customer.CustomerComplaintDetailVO;
import com.msl.user.data.UserSessionData;
import com.msl.user.utils.TokenUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Arrays;
/**
* @ClassName CustomerComplaintTypeServiceImpl
* @Description
* @Author kavin
* @Date 2023/12/7 10:51
* @Version 1.0
*/
@Slf4j
@Service
@AllArgsConstructor
public class CustomerComplaintDetailServiceImpl implements CustomerComplaintDetailService {
private final CustomerComplaintDetailDao customerComplaintDetailDao;
private final CustomerComplaintDetailStruct customerComplaintDetailStruct;
@Override
public void saveCustomerComplaintDetail(SaveCustomerComplaintDetailParam param) {
UserSessionData loginUserInfo = TokenUtil.getLoginUserInfo();
CustomerComplaintDetail detail = new CustomerComplaintDetail();
detail.setDriverUserNo(loginUserInfo.getUserNo());
detail.setDriverName(loginUserInfo.getUserName());
detail.setDriverMobile(loginUserInfo.getUserMobile());
detail.setChildNo(param.getChildNo());
detail.setComplaintTypeId(param.getComplaintTypeId());
detail.setContent(param.getContent());
if(CollectionUtil.isNotEmpty(param.getPicture())){
detail.setPicture(String.join(",",param.getPicture()));
}
customerComplaintDetailDao.saveEntity(detail);
}
@Override
public IPage<CustomerComplaintDetailVO> pageCustomerComplaintDetail(PageCustomerComplaintDetailParam param) {
Page<CustomerComplaintDetailVO> page = customerComplaintDetailDao.pageCustomerComplaintDetail(param);
if(CollectionUtil.isNotEmpty(page.getRecords())){
page.getRecords().forEach(item->{
if(StringUtils.isNotBlank(item.getPicture())){
item.setPictureList(Arrays.asList(item.getPicture().split(",")));
}
});
}
return page;
}
}
package com.clx.performance.service.customer.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.dao.customer.CustomerComplaintTypeDao;
import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.model.customer.CustomerComplaintType;
import com.clx.performance.param.pc.customer.PageCustomerComplaintTypeParam;
import com.clx.performance.param.pc.customer.SaveComplaintTypeParam;
import com.clx.performance.service.customer.CustomerComplaintTypeService;
import com.clx.performance.struct.customer.CustomerComplaintTypeStruct;
import com.clx.performance.vo.pc.customer.CustomerComplaintTypeVO;
import com.msl.common.exception.ServiceSystemException;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
* @ClassName CustomerComplaintTypeServiceImpl
* @Description
* @Author kavin
* @Date 2023/12/7 10:51
* @Version 1.0
*/
@Slf4j
@Service
@AllArgsConstructor
public class CustomerComplaintTypeServiceImpl implements CustomerComplaintTypeService {
private final CustomerComplaintTypeDao customerComplaintTypeDao;
private final CustomerComplaintTypeStruct customerComplaintTypeStruct;
@Override
public void saveCustomerComplaintType(SaveComplaintTypeParam param) {
long count = customerComplaintTypeDao.countByNameExcludeSelf(param.getName(),param.getId());
if(count > 0 ){
throw new ServiceSystemException(PerformanceResultEnum.DATA_NOT_FIND,"分类名称重复");
}
if(Objects.isNull(param.getId())){ // 新增
CustomerComplaintType insert = new CustomerComplaintType();
insert.setName(param.getName());
customerComplaintTypeDao.saveEntity(insert);
}else{ //更新
CustomerComplaintType update = new CustomerComplaintType();
update.setId(param.getId());
update.setName(param.getName());
customerComplaintTypeDao.updateEntityByKey(update);
}
}
@Override
public Page<CustomerComplaintTypeVO> pageCustomerComplaintType(PageCustomerComplaintTypeParam param) {
Page<CustomerComplaintType> page = customerComplaintTypeDao.pageCustomerComplaintType(param);
Page<CustomerComplaintTypeVO> result = new Page<>();
if(CollectionUtil.isNotEmpty(page.getRecords())){
result.setRecords(customerComplaintTypeStruct.convertList(page.getRecords()));
result.setTotal(page.getTotal());
result.setPages(page.getPages());
}
return result;
}
@Override
public List<CustomerComplaintTypeVO> getCustomerComplaintTypeSelect(PageCustomerComplaintTypeParam param) {
List<CustomerComplaintType> list = customerComplaintTypeDao.getCustomerComplaintTypeSelect(param);
return customerComplaintTypeStruct.convertList(list);
}
}
...@@ -177,9 +177,11 @@ public class IntegralTruckServiceImpl implements IntegralTruckService { ...@@ -177,9 +177,11 @@ public class IntegralTruckServiceImpl implements IntegralTruckService {
if (!truckNoList.isEmpty()) { if (!truckNoList.isEmpty()) {
List<IntegralStatistics> statisticsList = integralStatisticsDao.selectListByStatisticsDateAndTruckNoList(time, truckNoList); List<IntegralStatistics> statisticsList = integralStatisticsDao.selectListByStatisticsDateAndTruckNoList(time, truckNoList);
Map<String, Integer> rankMap = statisticsList.stream().collect(Collectors.toMap(item -> item.getTruckNo(), item -> item.getRank())); Map<String, Integer> rankMap = statisticsList.stream().collect(Collectors.toMap(item -> item.getTruckNo(), item -> item.getRank()));
Map<String, Integer> integralMap = statisticsList.stream().collect(Collectors.toMap(item -> item.getTruckNo(), item -> item.getIntegral()));
for (IntegralTruckVO item : page.getRecords()) { for (IntegralTruckVO item : page.getRecords()) {
item.setRank(rankMap.get(item.getTruckNo())); item.setRank(rankMap.get(item.getTruckNo()));
item.setIntegral(integralMap.get(item.getTruckNo()));
} }
Map<String, IntegralTruckVO> truckMap = page.getRecords().stream().collect(Collectors.toMap(item -> item.getTruckNo(), item -> item)); Map<String, IntegralTruckVO> truckMap = page.getRecords().stream().collect(Collectors.toMap(item -> item.getTruckNo(), item -> item));
......
package com.clx.performance.service.impl;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.clx.order.feign.AddressFeign;
import com.clx.order.feign.OrderFeign;
import com.clx.order.vo.feign.FeignAddressVO;
import com.clx.order.vo.feign.FeignOrderInfoVO;
import com.clx.order.vo.feign.SystemAddressVO;
import com.clx.performance.dao.OrderChildDao;
import com.clx.performance.dto.zjxl.TruckTraceDTO;
import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.model.MongoLargeScreenAddressRoute;
import com.clx.performance.model.OrderChild;
import com.clx.performance.service.LargeScreenService;
import com.clx.performance.utils.zjxl.ZjxlGpsService;
import com.clx.user.feign.DriverFeign;
import com.msl.common.base.Optional;
import com.msl.common.enums.ResultEnum;
import com.msl.common.result.Result;
import com.msl.common.utils.DateUtils;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.geo.GeoJsonLineString;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDateTime;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
@Service
@Slf4j
@AllArgsConstructor
public class LargeScreenServiceImpl implements LargeScreenService {
private final ZjxlGpsService zjxlGpsService;
private final DriverFeign driverFeign;
private final AddressFeign addressFeign;
private final OrderChildDao orderChildDao;
private final OrderFeign orderFeign;
private final MongoTemplate mongoTemplate;
@Override
public List<JSONObject> emptyCarList() {
List<String> data = driverFeign.driverTruckList().getData();
String now = DateUtils.formatDateTime(LocalDateTime.now()).get();
List<OrderChild> orderChildList = orderChildDao.selectListWithEmptyCarList();
if (CollectionUtils.isEmpty(orderChildList)) {
return null;
}
List<String> list = orderChildList.stream().map(OrderChild::getTruckNo).collect(Collectors.toList());
List<JSONObject> result = new LinkedList<>();
int index = 0;
String s = "<div><div><spanstyle='color:#999;display:inline-block;width:96px;text-align:right;'>车牌号:</span><spanstyle='color:#000;'>truckNo</span></div><div></div></div>";
for (String truckNo : data) {
if (list.contains(truckNo)) {
continue;
}
List<TruckTraceDTO> truckTrace = zjxlGpsService.getTruckTrace(truckNo, now,
now);
if (CollectionUtils.isNotEmpty(truckTrace)) {
JSONObject jsonObject = new JSONObject();
BigDecimal[] location = truckTrace.get(truckTrace.size() - 1).getLocation();
BigDecimal longitude = location[0].setScale(4, BigDecimal.ROUND_DOWN);
BigDecimal latitude = location[1].setScale(4, BigDecimal.ROUND_DOWN);
jsonObject.set("id", ++index);
jsonObject.set("lng", longitude);
jsonObject.set("lat", latitude);
jsonObject.set("info", s.replace("truckNo", truckNo));
jsonObject.set("value", "");
jsonObject.set("iconField", "ok");
result.add(jsonObject);
}
}
return result;
}
@Override
public List<JSONObject> weightCarList() {
List<String> data = driverFeign.driverTruckList().getData();
String now = DateUtils.formatDateTime(LocalDateTime.now()).get();
List<OrderChild> orderChildList = orderChildDao.selectListWithEmptyCarList();
if (CollectionUtils.isEmpty(orderChildList)) {
return null;
}
List<String> list = orderChildList.stream().map(OrderChild::getTruckNo).collect(Collectors.toList());
List<JSONObject> result = new LinkedList<>();
int index = 0;
String s = "<div><div><spanstyle='color:#999;display:inline-block;width:96px;text-align:right;'>车牌号:</span><spanstyle='color:#000;'>truckNo</span></div><div></div></div>";
for (String truckNo : data) {
if (!list.contains(truckNo)) {
continue;
}
List<TruckTraceDTO> truckTrace = zjxlGpsService.getTruckTrace(truckNo, now,
now);
if (CollectionUtils.isNotEmpty(truckTrace)) {
JSONObject jsonObject = new JSONObject();
BigDecimal[] location = truckTrace.get(truckTrace.size() - 1).getLocation();
BigDecimal longitude = location[0].setScale(4, BigDecimal.ROUND_DOWN);
BigDecimal latitude = location[1].setScale(4, BigDecimal.ROUND_DOWN);
jsonObject.set("id", ++index);
jsonObject.set("lng", longitude);
jsonObject.set("lat", latitude);
jsonObject.set("info", s.replace("truckNo", truckNo));
jsonObject.set("value", "");
jsonObject.set("iconField", "ok");
result.add(jsonObject);
}
}
return result;
}
@Override
public String receiveAddress(Integer addressId) {
SystemAddressVO vo = Optional.of(addressFeign.getSystemReceiveAddress(addressId)).filter(Result::succeed)
.map(Result::getData).orElseThrow(PerformanceResultEnum.HTTP_ERROR);
JSONArray jsonArray = new JSONArray();
String name = vo.getAddressShorter();
String s = "<div style='max-width:180px;'><div style='display:flex;flex-direction:column;width:fit-content;margin:0auto;'><div style='text-align:center;'>name</div></div></div>";
BigDecimal longitude = vo.getLongitude().setScale(4, RoundingMode.DOWN);
BigDecimal latitude = vo.getLatitude().setScale(4, RoundingMode.DOWN);
JSONObject jsonObject = new JSONObject();
jsonObject.set("id", addressId);
jsonObject.set("lng", longitude);
jsonObject.set("lat", latitude);
jsonObject.set("name", name);
jsonObject.set("info", s.replace("name", name));
jsonObject.set("iconField", "ok");
jsonArray.add(jsonObject);
return jsonArray.toString();
}
@Override
public String sendAddress(Integer addressId) {
List<SystemAddressVO> list = Optional.of(orderFeign.getOrderListByReceiveAddressId(addressId)).filter(Result::succeed)
.map(Result::getData).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
JSONArray jsonArray = new JSONArray();
String s = "<div style='max-width:180px;'><div style='display:flex;flex-direction:column;width:fit-content;margin:0auto;'><div style='text-align:center;'>name</div></div></div>";
for (SystemAddressVO vo : list) {
String name = vo.getAddressShorter();
BigDecimal longitude = vo.getLongitude().setScale(4, RoundingMode.DOWN);
BigDecimal latitude = vo.getLatitude().setScale(4, RoundingMode.DOWN);
JSONObject jsonObject = new JSONObject();
jsonObject.set("id", addressId);
jsonObject.set("lng", longitude);
jsonObject.set("lat", latitude);
jsonObject.set("name", name);
jsonObject.set("info", s.replace("name", name));
jsonObject.set("iconField", "ok");
jsonArray.add(jsonObject);
}
return jsonArray.toString();
}
@Override
public String routeLine(Integer addressId) {
List<SystemAddressVO> list = Optional.of(orderFeign.getOrderListByReceiveAddressId(addressId)).filter(Result::succeed)
.map(Result::getData).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
List<Integer> addressIds = list.stream().map(SystemAddressVO::getId).collect(Collectors.toList());
JSONArray jsonArray = new JSONArray();
JSONObject jsonObject = new JSONObject();
Query query = new Query();
query.addCriteria(Criteria.where("sendSystemAddressId").in(addressIds));
List<MongoLargeScreenAddressRoute> routes = mongoTemplate.find(query, MongoLargeScreenAddressRoute.class);
if (CollectionUtils.isEmpty(routes)) {
log.info("当前addressId查询mongodb轨迹数据为空,发货地集合为{}", JSONUtil.parse(addressIds));
return null;
}
int randomNum = (int)(Math.random() * routes.size());
MongoLargeScreenAddressRoute route = routes.get(randomNum);
GeoJsonLineString geometry = route.getGeometry();
jsonObject.set("id", "1");
jsonObject.set("sendSystemAddressId", route.getSendSystemAddressId());
jsonObject.set("receiveSystemAddressId", route.getReceiveSystemAddressId());
jsonObject.set("name", route.getName());
jsonObject.set("value", route.getValue());
jsonObject.set("sizeField", "3");
jsonObject.set("sizeField", "3");
jsonObject.set("info", "info");
jsonObject.set("geometry", JSONUtil.parse(geometry.getCoordinates()));
jsonArray.add(jsonObject);
return jsonArray.toString();
}
}
...@@ -21,10 +21,7 @@ import com.clx.performance.model.OrderGoods; ...@@ -21,10 +21,7 @@ import com.clx.performance.model.OrderGoods;
import com.clx.performance.param.pc.OrderCancelParam; import com.clx.performance.param.pc.OrderCancelParam;
import com.clx.performance.param.pc.OrderChildCancelRecordParam; import com.clx.performance.param.pc.OrderChildCancelRecordParam;
import com.clx.performance.param.pc.owner.ThawAccountParam; import com.clx.performance.param.pc.owner.ThawAccountParam;
import com.clx.performance.service.OrderCancelService; import com.clx.performance.service.*;
import com.clx.performance.service.OrderChildLogService;
import com.clx.performance.service.OrderGoodsTruckBindService;
import com.clx.performance.service.OwnerAccountService;
import com.clx.performance.service.child.OrderChildPostService; import com.clx.performance.service.child.OrderChildPostService;
import com.clx.performance.vo.app.OrderChildVO; import com.clx.performance.vo.app.OrderChildVO;
import com.clx.user.enums.driver.DriverInfoEnum; import com.clx.user.enums.driver.DriverInfoEnum;
...@@ -77,6 +74,8 @@ public class OrderCancelServiceImpl implements OrderCancelService { ...@@ -77,6 +74,8 @@ public class OrderCancelServiceImpl implements OrderCancelService {
private final OrderChildPostService orderChildPostService; private final OrderChildPostService orderChildPostService;
private final OrderGoodsService orderGoodsService;
private final SettlementOwnerDetailDao settlementOwnerDetailDao; private final SettlementOwnerDetailDao settlementOwnerDetailDao;
...@@ -334,7 +333,8 @@ public class OrderCancelServiceImpl implements OrderCancelService { ...@@ -334,7 +333,8 @@ public class OrderCancelServiceImpl implements OrderCancelService {
} }
} }
//取消订单更新货单剩余吨数
orderGoodsService.batchUpdateResidueWeight(orderGoodsList);
} }
...@@ -688,6 +688,8 @@ public class OrderCancelServiceImpl implements OrderCancelService { ...@@ -688,6 +688,8 @@ public class OrderCancelServiceImpl implements OrderCancelService {
if (!orderFeign.saveOrderSettlementJobRecord(orderNo).succeed()) { if (!orderFeign.saveOrderSettlementJobRecord(orderNo).succeed()) {
throw new ServiceSystemException(PerformanceResultEnum.HTTP_ERROR, "货主取消订单失败,原因:远程调用结算单锁定失败"); throw new ServiceSystemException(PerformanceResultEnum.HTTP_ERROR, "货主取消订单失败,原因:远程调用结算单锁定失败");
} }
//订单取消恢复货单的剩余吨数为0
orderGoodsService.batchUpdateResidueWeight(orderGoodsList);
} }
......
package com.clx.performance.service.impl; package com.clx.performance.service.impl;
import com.clx.performance.dao.*; import com.clx.performance.dao.*;
import com.clx.performance.enums.*; import com.clx.performance.enums.*;
import com.clx.performance.model.*; import com.clx.performance.model.*;
import com.clx.performance.param.pc.PoundAuditParam; import com.clx.performance.param.pc.PoundAuditParam;
import com.clx.performance.service.OrderChildLogService; import com.clx.performance.service.OrderChildLogService;
import com.clx.performance.service.OrderChildPoundAuditService; import com.clx.performance.service.OrderChildPoundAuditService;
import com.clx.performance.service.OrderChildService;
import com.clx.performance.service.OrderGoodsService; import com.clx.performance.service.OrderGoodsService;
import com.clx.performance.vo.pc.OrderChildPoundAuditDetailVO; import com.clx.performance.vo.pc.OrderChildPoundAuditDetailVO;
import com.msl.common.exception.ServiceSystemException; import com.msl.common.exception.ServiceSystemException;
...@@ -47,6 +47,7 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer ...@@ -47,6 +47,7 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
private final OrderGoodsService orderGoodsService; private final OrderGoodsService orderGoodsService;
private final OrderChildLogService orderChildLogService; private final OrderChildLogService orderChildLogService;
private final OrderChildService orderChildService;
@Override @Override
...@@ -95,7 +96,7 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer ...@@ -95,7 +96,7 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
BigDecimal dif = param.getLoadNet().subtract(orderChild.getLoadNet()); BigDecimal dif = param.getLoadNet().subtract(orderChild.getLoadNet());
Integer type = OrderChildLogEnum.Type.POUND_AUDIT.getCode(); int type = OrderChildLogEnum.Type.POUND_AUDIT.getCode();
if(Objects.equals(param.getStatus(), OrderChildPoundAuditEnum.Status.REJECT.getCode())){ if(Objects.equals(param.getStatus(), OrderChildPoundAuditEnum.Status.REJECT.getCode())){
type = OrderChildLogEnum.Type.POUND_AUDIT_REJECT.getCode(); type = OrderChildLogEnum.Type.POUND_AUDIT_REJECT.getCode();
}else{ }else{
...@@ -113,7 +114,7 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer ...@@ -113,7 +114,7 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
orderChild.setFreight(orderChildFreightCalc(orderChild)); orderChild.setFreight(orderChildFreightCalc(orderChild));
// 更新装车净重 // 更新装车净重
updateOrderGoodsAmountLoad(orderGoods, dif); updateOrderGoodsAmountLoad(orderGoods,orderChild.getChildNo(), dif);
//更新运单数据 //更新运单数据
orderChild.setPoundStatus(param.getStatus()); orderChild.setPoundStatus(param.getStatus());
...@@ -138,34 +139,15 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer ...@@ -138,34 +139,15 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
/** /**
* 装车补偿 * 装车补偿
*/ */
private void updateOrderGoodsAmountLoad(OrderGoods orderGoods, BigDecimal dif){ private void updateOrderGoodsAmountLoad(OrderGoods orderGoods,String childNo, BigDecimal dif){
int i = dif.compareTo(BigDecimal.ZERO);
if (i == 0){
return;
} else if (i > 0) {
if (orderGoods.getOrderGoodsStatus().equals(OrderGoodsStatusEnum.Status.CANCEL.getCode())
|| orderGoods.getOrderGoodsStatus().equals(OrderGoodsStatusEnum.Status.COMPLETED.getCode())
|| orderGoods.getOrderGoodsStatus().equals(OrderGoodsStatusEnum.Status.SUCCESS.getCode())
) {
throw new ServiceSystemException(PerformanceResultEnum.ORDER_GOODS_STATUS_NOT_GET);
}
if (orderGoods.getResidueTransportWeight().compareTo(dif) < 0) {
throw new ServiceSystemException(PerformanceResultEnum.ORDER_GOODS_WEIGHT_NOT_HAVE);
}
}
int count = orderChildDao.countValidByOrderGoodsNo(orderGoods.getOrderGoodsNo())-1; int count = orderChildDao.countValidByOrderGoodsNo(orderGoods.getOrderGoodsNo())-1;
Integer status; Integer status;
if (count == 0){ if (count == 0){
status = OrderGoodsStatusEnum.Status.PAYING.getCode(); status = OrderGoodsStatusEnum.Status.PAYING.getCode();
} }else{
else {
status = OrderGoodsStatusEnum.Status.GO_TO_SEND.getCode(); status = OrderGoodsStatusEnum.Status.GO_TO_SEND.getCode();
} }
orderChildService.updateOrderGoodsAmountLoad(orderGoods,childNo,dif,status);
orderGoodsService.updateOrderGoodsReduceWeightAndStatusAmountLoad(orderGoods, dif, status);
} }
/** /**
......
package com.clx.performance.sqlProvider; package com.clx.performance.sqlProvider;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.param.app.AppGoodsOrderSearchParam;
import com.clx.performance.param.pc.OrderGoodsEditParams; import com.clx.performance.param.pc.OrderGoodsEditParams;
import com.clx.performance.param.pc.PageOrderGoodsListParam; import com.clx.performance.param.pc.PageOrderGoodsListParam;
import com.clx.performance.enums.OrderGoodsStatusEnum; import com.clx.performance.enums.OrderGoodsStatusEnum;
...@@ -295,4 +297,35 @@ public class OrderGoodsSqlProvider { ...@@ -295,4 +297,35 @@ public class OrderGoodsSqlProvider {
return sql; return sql;
} }
public String indexOrderGoodsListSearch(@Param("page") Page<OrderGoodsAPPVO> page, @Param("param") AppGoodsOrderSearchParam param) {
String sql = new SQL() {{
SELECT("a.id, a.order_no," +
" a.order_goods_no, a.order_goods_status, a.extract_weight, " +
" a.residue_transport_weight,a.already_transport_weight, a.send_address_id, a.send_address_shorter,a.send_longitude," +
" a.send_latitude,a.receive_address_id, a.receive_address_shorter,a.receive_longitude,a.receive_latitude," +
"a.goods_id, a.goods_name, a.pending_order_way," +
" date_format(a.directional_expire_time, '%Y-%m-%d %H:%i:%s') as directional_expire_time ," +
" date_format(a.last_arrive_send_time, '%Y-%m-%d %H:%i:%s') as last_arrive_send_time ," +
" date_format(a.pending_order_time, '%Y-%m-%d %H:%i:%s') as pending_order_time," +
" date_format(a.create_time, '%Y-%m-%d %H:%i:%s') as create_time," +
" date_format(a.modified_time, '%Y-%m-%d %H:%i:%s') as modified_time," +
"a.extract_way,a.need_truck_num,a.senior_logistics_manager_id,a.senior_logistics_manager_name,a.pending_order_freight," +
"a.user_no,a.user_name");
FROM("order_goods a");
WHERE("a.stop_flag = "+ OrderGoodsStopEnum.Status.NO.getCode());
WHERE("a.last_arrive_send_time >= now()");
WHERE("(a.order_goods_status = "+OrderGoodsStatusEnum.Status.PAYING.getCode()+" or a.order_goods_status = "+OrderGoodsStatusEnum.Status.GO_TO_SEND.getCode()+")");
WHERE("a.residue_transport_weight >=35");
if (ObjectUtil.isNotNull(param.getSearchType())) {
if (1 == param.getSearchType()) {
WHERE("a.send_address_shorter like '%"+ param.getSearchName() +"%'");
}else if (2 == param.getSearchType()) {
WHERE("a.receive_address_shorter like '%"+ param.getSearchName()+"%'");
}
}
ORDER_BY("a.pending_order_time desc");
}}.toString();
return sql;
}
} }
package com.clx.performance.sqlProvider; package com.clx.performance.sqlProvider;
import com.clx.order.enums.VehicleUsageEnum;
import com.clx.performance.enums.OrderGoodsTruckBindEnum; import com.clx.performance.enums.OrderGoodsTruckBindEnum;
import org.apache.ibatis.jdbc.SQL; import org.apache.ibatis.jdbc.SQL;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
public class OrderGoodsTruckBindSqlProvider { public class OrderGoodsTruckBindSqlProvider {
...@@ -33,5 +35,14 @@ public class OrderGoodsTruckBindSqlProvider { ...@@ -33,5 +35,14 @@ public class OrderGoodsTruckBindSqlProvider {
}}.toString(); }}.toString();
} }
public String selectListByTruckNo(List<String> truckList){
return new SQL(){{
SELECT(" a.order_goods_no ");
FROM("order_goods_truck_bind a");
LEFT_OUTER_JOIN("order_goods b on a.order_goods_no = b.order_goods_no");
WHERE("a.truck_no IN (" + truckList.stream().map(code -> "'"+code+"'").collect(Collectors.joining(","))+ ")" );
WHERE("b.vehicle_usage = " + VehicleUsageEnum.Status.OWN.getCode() + " or a.`status` =" + OrderGoodsTruckBindEnum.Status.NORMAL.getCode());
}}.toString();
}
} }
package com.clx.performance.sqlProvider; package com.clx.performance.sqlProvider;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.enums.OwnerAccountEnum; import com.clx.performance.enums.OwnerAccountEnum;
import com.clx.performance.param.pc.PageAppPrepaidFreightAccountParam;
import com.clx.performance.param.pc.PageOwnerAccountRunningWaterParam; import com.clx.performance.param.pc.PageOwnerAccountRunningWaterParam;
import com.clx.performance.param.pc.PagePlatformMarginAccountParam; import com.clx.performance.param.pc.PagePlatformMarginAccountParam;
import com.clx.performance.param.pc.PagePlatformPrepaidFreightAccountParam; import com.clx.performance.param.pc.PagePlatformPrepaidFreightAccountParam;
import com.clx.performance.vo.pc.OwnerAccountRunningWaterRecordVO;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.jdbc.SQL; import org.apache.ibatis.jdbc.SQL;
...@@ -84,6 +87,46 @@ public class OwnerRunningWaterRecordSqlProvider { ...@@ -84,6 +87,46 @@ public class OwnerRunningWaterRecordSqlProvider {
return sql; return sql;
} }
public String prepaidFreightOwnerAccountPageList(@Param(value = "page") Page<OwnerAccountRunningWaterRecordVO> page, @Param("param") PageAppPrepaidFreightAccountParam param) {
String sql = new SQL() {{
SELECT("a.id, a.owner_user_no," +
" a.owner_user_name,a.running_water_no, a.mobile, a.account_type, a.running_water_type,a.order_id,a.order_no,a.order_child_id,a.order_child_no,a.alteration_balance," +
" a.account_balance,a.usable_balance,a.take_out_balance,a.frozen_balance,a.create_by,date_format(a.create_time, '%Y-%m-%d %H:%i:%s') as create_time");
FROM("owner_running_water_record a");
if (ObjectUtil.isNotNull(param.getUserNo())) {
WHERE("a.owner_user_no = #{param.userNo}");
}
if (StringUtils.isNotBlank(param.getBeginTime()) && StringUtils.isNotBlank(param.getEndTime())) {
WHERE("a.create_time >= #{param.beginTime} and a.create_time <= #{param.endTime}");
}
if (ObjectUtil.isNotNull(param.getQueryWaterType())) {
if (1 == param.getQueryWaterType()) {
WHERE("a.running_water_type !=" + OwnerAccountEnum.RunningWaterStatus.CASE_OUT_FAIL.getCode());
}
if (2 == param.getQueryWaterType()) {
WHERE("a.running_water_type =" + OwnerAccountEnum.RunningWaterStatus.TOP_UP.getCode());
}
if (param.getQueryWaterType() == 3) {
WHERE("a.running_water_type in (" + OwnerAccountEnum.RunningWaterStatus.TAKE_OUT.getCode() +
"," + OwnerAccountEnum.RunningWaterStatus.CASE_OUT_SUCCESS.getCode() + " )"
);
}
}
if (ObjectUtil.isNotNull(param.getAccountType())) {
if (OwnerAccountEnum.AccountTypeStatus.MARGIN_ACCOUNT.getCode().equals(param.getAccountType())) {
WHERE("a.account_type =" + OwnerAccountEnum.AccountTypeStatus.MARGIN_ACCOUNT.getCode());
}else if (OwnerAccountEnum.AccountTypeStatus.PREPAID_FREIGHT_ACCOUNT.getCode().equals(param.getAccountType())) {
WHERE("a.account_type =" + OwnerAccountEnum.AccountTypeStatus.PREPAID_FREIGHT_ACCOUNT.getCode());
}
}
ORDER_BY("a.create_time desc");
}}.toString();
return sql;
}
public String prepaidFreightAccountList(@Param("param") PagePlatformPrepaidFreightAccountParam param) { public String prepaidFreightAccountList(@Param("param") PagePlatformPrepaidFreightAccountParam param) {
String sql = new SQL() {{ String sql = new SQL() {{
SELECT("a.id, a.owner_user_no," + SELECT("a.id, a.owner_user_no," +
......
...@@ -13,7 +13,7 @@ public class OwnerTopUpProvider { ...@@ -13,7 +13,7 @@ public class OwnerTopUpProvider {
String sql = new SQL() {{ String sql = new SQL() {{
SELECT("a.id, a.owner_user_no," + SELECT("a.id, a.owner_user_no," +
" a.top_up_no, a.top_up_balance, a.account_type, " + " a.top_up_no, a.top_up_balance, a.account_type, " +
" a.status,a.drawing_bank, a.drawing_bank_number,a.drawing_proof,date_format(a.approval_time, '%Y-%m-%d %H:%i:%s') as approval_time,a.approval_by,a.approval_turn_down,a.create_by,date_format(a.create_time, '%Y-%m-%d %H:%i:%s') as create_time,a.modified_time"); " a.status,a.drawing_bank,a.enterprise_name,a.account_number,a.drawing_bank_number,a.drawing_proof,date_format(a.approval_time, '%Y-%m-%d %H:%i:%s') as approval_time,a.approval_by,a.approval_turn_down,a.create_by,date_format(a.create_time, '%Y-%m-%d %H:%i:%s') as create_time,a.modified_time");
FROM("owner_top_up a"); FROM("owner_top_up a");
if (StringUtils.isNotBlank(param.getBeginTime()) && StringUtils.isNotBlank(param.getEndTime())) { if (StringUtils.isNotBlank(param.getBeginTime()) && StringUtils.isNotBlank(param.getEndTime())) {
WHERE("a.create_time >= #{param.beginTime} and a.create_time <= #{param.endTime}"); WHERE("a.create_time >= #{param.beginTime} and a.create_time <= #{param.endTime}");
......
package com.clx.performance.sqlProvider.customer;
import com.clx.performance.param.pc.customer.PageCustomerComplaintDetailParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.jdbc.SQL;
import java.util.Objects;
/**
* @ClassName CustomerComplaintDetailSqlProvider
* @Description
* @Author kavin
* @Date 2023/12/13 13:31
* @Version 1.0
*/
public class CustomerComplaintDetailSqlProvider {
public String pageCustomerComplaintDetail(PageCustomerComplaintDetailParam param) {
return new SQL(){{
SELECT( " a.id, a.driver_user_no ,a.driver_name,a.driver_mobile,a.child_no," +
" a.complaint_type_id,a.content,a.picture,b.name," +
" date_format(a.create_time, '%Y-%m-%d %H:%i:%s') as createTime, " +
" date_format(a.modified_time, '%Y-%m-%d %H:%i:%s') as modifiedTime ");
FROM("customer_complaint_detail a");
LEFT_OUTER_JOIN("customer_complaint_type b on a.complaint_type_id = b.id");
if(Objects.nonNull(param.getComplaintTypeId())){
WHERE("a.complaint_type_id = #{param.complaintTypeId}");
}
if(StringUtils.isNotBlank(param.getChildNo())){
WHERE("a.child_no = #{param.childNo}");
}
if(StringUtils.isNotBlank(param.getDriverMobile())){
WHERE("a.driver_mobile = #{param.driverMobile}");
}
if(StringUtils.isNotBlank(param.getDriverName())){
WHERE("a.driver_name = #{param.driverName}");
}
if(StringUtils.isNotBlank(param.getBeginTime())){
WHERE("a.create_time >= #{param.beginTime}");
}
if(StringUtils.isNotBlank(param.getEndTime())){
WHERE("a.create_time <= #{param.endTime}");
}
ORDER_BY("a.create_time desc");
}}.toString();
}
}
package com.clx.performance.strategy; package com.clx.performance.strategy;
import com.clx.order.enums.VehicleUsageEnum;
import com.clx.performance.param.pc.OrderGoodsChildParams; import com.clx.performance.param.pc.OrderGoodsChildParams;
import com.clx.performance.param.pc.OrderGoodsParams; import com.clx.performance.param.pc.OrderGoodsParams;
import com.clx.order.enums.OrderStopEnum; import com.clx.order.enums.OrderStopEnum;
...@@ -12,15 +13,13 @@ import com.clx.performance.utils.SpringContextUtils; ...@@ -12,15 +13,13 @@ import com.clx.performance.utils.SpringContextUtils;
import com.msl.common.exception.ServiceSystemException; import com.msl.common.exception.ServiceSystemException;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.amqp.core.Message; import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageBuilder; import org.springframework.amqp.core.MessageBuilder;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.HashSet; import java.util.*;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Slf4j @Slf4j
...@@ -48,7 +47,8 @@ public abstract class GoodsOrderStrategy { ...@@ -48,7 +47,8 @@ public abstract class GoodsOrderStrategy {
List<OrderGoodsChildParams> orderGoodsChildParams = orderGoodsParams.getOrderGoodsChildParams(); List<OrderGoodsChildParams> orderGoodsChildParams = orderGoodsParams.getOrderGoodsChildParams();
Set<String> set = new HashSet<>(); Set<String> set = new HashSet<>();
for (OrderGoodsChildParams item : orderGoodsChildParams) { for (OrderGoodsChildParams item : orderGoodsChildParams) {
if (CollectionUtils.isNotEmpty(item.getTruckList())) { //定向车自由车辆不做拦截操作
if (!StringUtils.equals(item.getVehicleUsage(),String.valueOf(VehicleUsageEnum.Status.OWN.getCode())) && CollectionUtils.isNotEmpty(item.getTruckList())) {
int lastSize = set.size() + item.getTruckList().size(); int lastSize = set.size() + item.getTruckList().size();
set.addAll(item.getTruckList()); set.addAll(item.getTruckList());
if (!Objects.equals(lastSize, set.size())) { if (!Objects.equals(lastSize, set.size())) {
...@@ -63,8 +63,7 @@ public abstract class GoodsOrderStrategy { ...@@ -63,8 +63,7 @@ public abstract class GoodsOrderStrategy {
if (CollectionUtils.isNotEmpty(binds)) { if (CollectionUtils.isNotEmpty(binds)) {
List<String> repeatBind = binds.stream().map(OrderGoodsTruckBind::getTruckNo).collect(Collectors.toList()); List<String> repeatBind = binds.stream().map(OrderGoodsTruckBind::getTruckNo).collect(Collectors.toList());
String trucks = String.join(", ", repeatBind); String trucks = String.join(", ", repeatBind);
throw new ServiceSystemException(ResultEnum.DATA_ERROR, "已被定向单绑定车辆:" + trucks); throw new ServiceSystemException(ResultEnum.DATA_ERROR, "已被定向单绑定车辆:" + trucks); }
}
} }
//根据不同的订单类型创建不同的货单 //根据不同的订单类型创建不同的货单
LocalDateTime sendLazyTime = goodsOrderProcess(orderGoodsParams, orderInfo, now); LocalDateTime sendLazyTime = goodsOrderProcess(orderGoodsParams, orderInfo, now);
...@@ -87,7 +86,8 @@ public abstract class GoodsOrderStrategy { ...@@ -87,7 +86,8 @@ public abstract class GoodsOrderStrategy {
log.info("执行订单状态更改,epochMilli时间不为0,时间为:{}", epochMilli); log.info("执行订单状态更改,epochMilli时间不为0,时间为:{}", epochMilli);
rabbitTemplate.send(RabbitKeyConstants.ORDER_POSTED_EXCHANGE, RabbitKeyConstants.ORDER_POSTED_ROUTE_KEY, MessageBuilder.withBody(orderNo.getBytes()).build()); rabbitTemplate.send(RabbitKeyConstants.ORDER_POSTED_EXCHANGE, RabbitKeyConstants.ORDER_POSTED_ROUTE_KEY, MessageBuilder.withBody(orderNo.getBytes()).build());
message.getMessageProperties().setExpiration(String.valueOf(epochMilli)); message.getMessageProperties().setHeader("x-delay", epochMilli);
rabbitTemplate.send( rabbitTemplate.send(
RabbitKeyConstants.ORDER_ON_EXCHANGE, RabbitKeyConstants.ORDER_ON_ROUTE_KEY, message RabbitKeyConstants.ORDER_ON_EXCHANGE, RabbitKeyConstants.ORDER_ON_ROUTE_KEY, message
); );
......
package com.clx.performance.struct; package com.clx.performance.struct;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.open.sdk.callback.message.OrderChildMessage; import com.clx.open.sdk.callback.message.OrderChildMessage;
import com.clx.performance.model.OrderChild; import com.clx.performance.model.OrderChild;
import com.clx.performance.vo.app.CustomerComplaintOrderChildVO;
import com.clx.performance.vo.app.GoingOrderChildVO; import com.clx.performance.vo.app.GoingOrderChildVO;
import com.clx.performance.vo.app.OrderChildVO; import com.clx.performance.vo.app.OrderChildVO;
import com.clx.performance.vo.pc.CarrierOrderChildDetailVO; import com.clx.performance.vo.pc.CarrierOrderChildDetailVO;
...@@ -26,6 +28,5 @@ public interface OrderChildStruct { ...@@ -26,6 +28,5 @@ public interface OrderChildStruct {
OrderChildMessage convertMessage(OrderChild item); OrderChildMessage convertMessage(OrderChild item);
Page<CustomerComplaintOrderChildVO> covertPageCustomerComplaintOrderChildVO(Page<OrderChild> page);
} }
package com.clx.performance.struct.customer;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.model.customer.CustomerComplaintDetail;
import com.clx.performance.vo.pc.customer.CustomerComplaintDetailVO;
import com.msl.common.utils.DateStructUtil;
import com.msl.common.utils.DateUtils;
import org.mapstruct.Mapper;
@Mapper(componentModel = "spring", uses = DateStructUtil.class, imports = {DateUtils.class})
public interface CustomerComplaintDetailStruct {
Page<CustomerComplaintDetailVO> convertPage(Page<CustomerComplaintDetail> page);
}
package com.clx.performance.struct.customer;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.model.customer.CustomerComplaintType;
import com.clx.performance.vo.pc.customer.CustomerComplaintTypeVO;
import com.msl.common.utils.DateStructUtil;
import com.msl.common.utils.DateUtils;
import org.mapstruct.Mapper;
import java.util.List;
@Mapper(componentModel = "spring", uses = DateStructUtil.class, imports = {DateUtils.class})
public interface CustomerComplaintTypeStruct {
Page<CustomerComplaintTypeVO> convertPage(Page<CustomerComplaintType> page);
List<CustomerComplaintTypeVO> convertList(List<CustomerComplaintType> list);
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论