提交 aa499728 authored 作者: huyufan's avatar huyufan

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

# Conflicts: # performance-web/src/main/java/com/clx/performance/controller/temp/TempController.java # performance-web/src/main/java/com/clx/performance/service/impl/OrderChildServiceImpl.java # performance-web/src/test/java/com/clx/performance/JobTest.java
...@@ -18,7 +18,8 @@ public enum IdTypeEnum { ...@@ -18,7 +18,8 @@ public enum IdTypeEnum {
CASE_OUT_SUCCESS(4L, "提现成功"), CASE_OUT_SUCCESS(4L, "提现成功"),
TOP_UP_SUCCESS(5L, "充值成功"), TOP_UP_SUCCESS(5L, "充值成功"),
FROZEN(6L, "冻结"), FROZEN(6L, "冻结"),
THAW(7L, "解冻") THAW(7L, "解冻"),
TAKE_OUT(8L, "扣除")
; ;
private final Long code; private final Long code;
private final String msg; private final String msg;
......
package com.clx.performance.param.feign.transport;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import javax.validation.constraints.NotBlank;
@Getter
@Setter
@ToString
@NoArgsConstructor
public class OrderChildBankInfoDTO {
// @ApiModelProperty(value = "运单号", dataType="String", required = true)
// private String childNo;
// @ApiModelProperty(value = "用户钱包", dataType="Integer", required = true)
// private Integer userCode;
@ApiModelProperty(value = "持卡人姓名", dataType="String", required = true)
private String name;
@ApiModelProperty(value = "银行卡卡号", dataType="String", required = true)
private String cardNo;
@ApiModelProperty(value = "手机号", dataType="String", required = true)
private String mobile;
@ApiModelProperty(value = "账户类型 11个人 12企业账户", dataType="Integer", required = true)
private Integer accountType;
@ApiModelProperty(value = "银行卡类型10借记卡20借贷卡", dataType="String", required = true)
private String type;
// @ApiModelProperty(value = "是否允许提现: 允许提现1 ,禁止提现0", dataType="Integer", required = true)
// private Integer cashOut;
@ApiModelProperty(value = "身份证号", dataType="String", required = true)
@NotBlank(message = "身份证号不能为空")
private String idCard;
@ApiModelProperty(value = "银行", dataType="String", required = true)
@NotBlank(message = "银行不能为空")
private String bank;
@ApiModelProperty(value = "银行编码", dataType="String", required = true)
@NotBlank(message = "银行编码不能为空")
private String bankCode;
@ApiModelProperty(value = "身份证正面图片", required = true)
@NotBlank(message = "身份证正面图片不能为空")
private String idCardFrontImg;
@ApiModelProperty(value = "身份证背面图片", required = true)
@NotBlank(message = "身份证背面图片不能为空")
private String idCardBackImg;
}
package com.clx.performance.param.feign.transport;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Getter
@Setter
@ToString
@NoArgsConstructor
public class OrderChildDriverInfoDTO {
// @ApiModelProperty(value = "运单号", dataType="String", required = true)
// private String childNo;
// @ApiModelProperty(value = "司机ID", dataType="Integer", required = true)
// private Integer driverId;
@ApiModelProperty(value = "手机号", dataType="String", required = true)
@NotBlank(message = "手机号不能为空")
private String mobile;
@ApiModelProperty(value = "姓名", dataType="String", required = true)
@NotBlank(message = "姓名手机号不能为空")
private String name;
@ApiModelProperty(value = "性别1男2女", dataType="Integer", required = true)
private Integer sex;
// @ApiModelProperty(value = "头像相对地址", dataType="String", required = true)
// private String headImg;
// @ApiModelProperty(value = "钱包账号", dataType="String", required = true)
// private String walletCode;
@ApiModelProperty(value = "身份证号", dataType="String", required = true)
@NotBlank(message = "身份证号不能为空")
private String cardNo;
@ApiModelProperty(value = "身份证有效期起始时间", dataType="String", required = true)
@NotBlank(message = "身份证有效期起始时间不能为空")
private String cardStartTime;
@ApiModelProperty(value = "身份证有效期终止时间", dataType="String")
private String cardEndTime;
@ApiModelProperty(value = "是否是长期 0-非长期 1-长期", dataType="Integer", required = true)
@NotNull(message = "是否是长期不能为空")
private Integer cardLongTerm;
@ApiModelProperty(value = "身份证正面图片地址", dataType="String", required = true)
@NotBlank(message = "身份证正面图片地址不能为空")
private String cardFrontImg;
@ApiModelProperty(value = "身份证背面图片地址", dataType="String", required = true)
@NotBlank(message = "身份证背面图片地址不能为空")
private String cardBackImg;
@ApiModelProperty(value = "手持身份证照片地址", dataType="String")
private String faceCardImg;
@ApiModelProperty(value = "驾驶证号码", dataType="String", required = true)
@NotBlank(message = "驾驶证号码不能为空")
private String licenceNo;
@ApiModelProperty(value = "初次领证日期", dataType="String", required = true)
@NotBlank(message = "初次领证日期不能为空")
private String licenseTime;
@ApiModelProperty(value = "驾照类型", dataType="String", required = true)
@NotBlank(message = "驾照类型不能为空")
private String licenceClass;
@ApiModelProperty(value = "驾驶证正面图片", dataType="String", required = true)
@NotBlank(message = "驾驶证正面图片不能为空")
private String licenceImg;
@ApiModelProperty(value = "驾驶证背面图片", dataType="String", required = true)
@NotBlank(message = "驾驶证背面图片不能为空")
private String licenceBackImg;
@ApiModelProperty(value = "驾驶证有效期起始时间", dataType="String", required = true)
@NotBlank(message = "驾驶证有效期起始时间不能为空")
private String licenceStartTime;
@ApiModelProperty(value = "驾驶证有效期终止时间", dataType="String", required = true)
@NotBlank(message = "驾驶证有效期终止时间不能为空")
private String licenceEndTime;
// @ApiModelProperty(value = "道路运输许可证图片地址", dataType="String", required = true)
// @NotBlank(message = "道路运输许可证图片地址不能为空")
// private String transportLicenceImg;
@ApiModelProperty(value = "道路运输从业资格证号", dataType="String", required = true)
@NotBlank(message = "道路运输从业资格证号不能为空")
private String occupationalLicenceNo;
@ApiModelProperty(value = "道路运输从业资格证图片地址", dataType="String", required = true)
@NotBlank(message = "道路运输从业资格证图片地址不能为空")
private String occupationalLicenceImg;
@ApiModelProperty(value = "从业资格证有效期起始时间", dataType="String", required = true)
@NotBlank(message = "从业资格证有效期起始时间不能为空")
private String occupationalStartTime;
@ApiModelProperty(value = "从业资格证有效期终止时间", dataType="String", required = true)
@NotBlank(message = "从业资格证有效期终止时间不能为空")
private String occupationalEndTime;
@ApiModelProperty(value = "驾驶证发证机关", required = true)
@NotBlank(message = "驾驶证发证机关不能为空")
private String licenceIssueOrganization;
@ApiModelProperty(value = "身份证住址", required = true)
@NotBlank(message = "身份证住址不能为空")
private String idCardAddress;
}
package com.clx.performance.param.feign.transport;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Getter
@Setter
@ToString
@NoArgsConstructor
public class OrderChildTruckInfoDTO {
// @ApiModelProperty(value = "运单号", dataType="String", required = true)
// private String childNo;
// @ApiModelProperty(value = "车辆ID", dataType="Integer", required = true)
// private Integer truckId;
// @ApiModelProperty(value = "车主id", dataType="Integer", required = true)
// private Integer userId;
@ApiModelProperty(value = "车主手机号", dataType="String", required = true)
@NotBlank(message = "车主手机号不能为空")
private String mobile;
@ApiModelProperty(value = "车牌号", dataType="String", required = true)
@NotBlank(message = "车牌号不能为空")
private String truckNo;
// @ApiModelProperty(value = "车头车牌颜色代码", dataType="Integer", required = true)
// private Integer truckNoColorCode;
@ApiModelProperty(value = "车头车牌颜色", dataType="String", required = true)
@NotBlank(message = "车头车牌颜色不能为空")
private String truckNoColor;
@ApiModelProperty(value = "型号", dataType="String", required = true)
@NotBlank(message = "型号不能为空")
private String model;
@ApiModelProperty(value = "载重单位吨", dataType="Integer", required = true)
@NotNull(message = "载重单位吨不能为空")
private Integer load;
@ApiModelProperty(value = "吨位 单位吨", dataType="Integer", required = true)
@NotNull(message = "吨位不能为空")
private Integer grossMass;
@ApiModelProperty(value = "车头道路运输许可证编号", dataType="String", required = true)
@NotBlank(message = "车头道路运输许可证编号不能为空")
private String roadTransportCertificateNo;
@ApiModelProperty(value = "行驶证主页照片", dataType="String", required = true)
@NotBlank(message = "行驶证主页照片不能为空")
private String licenceImgMain;
@ApiModelProperty(value = "行驶证副业正面照片", dataType="String", required = true)
@NotBlank(message = "行驶证副业正面照片不能为空")
private String licenceImgSecond;
@ApiModelProperty(value = "行驶证副业背面照片", dataType="String", required = true)
@NotBlank(message = "行驶证副业背面照片不能为空")
private String licenceImgSecondBack;
@ApiModelProperty(value = "道路运输许可证图片地址", dataType="String", required = true)
@NotBlank(message = "道路运输许可证图片地址不能为空")
private String transportLicenceImg;
@ApiModelProperty(value = "行驶证有效期开始时间")
private String drivingLicenseBeginTime;
@ApiModelProperty(value = "行驶证有效期结束时间", required = true)
@NotBlank(message = "行驶证有效期结束时间不能为空")
private String drivingLicenseEndTime;
@ApiModelProperty(value = "运输证有效期开始时间")
private String transportationLicenseBeginTime;
@ApiModelProperty(value = "运输证有效期结束时间")
private String transportationLicenseEndTime;
@ApiModelProperty(value = "车辆燃料类型 1:柴油 2 天然气 3其他 4新能源/电", dataType="Integer", required = true)
@NotNull(message = "车辆燃料类型不能为空")
private Integer powerType;
@ApiModelProperty(value = "使用性质", required = true)
@NotBlank(message = "使用性质不能为空")
private String useNature;
@ApiModelProperty(value = "车辆识别代码", required = true)
@NotBlank(message = "车辆识别代码不能为空")
private String identifyCode;
@ApiModelProperty(value = "行驶证发证机关", required = true)
@NotBlank(message = "行驶证发证机关不能为空")
private String licenceIssueOrganization;
@ApiModelProperty(value = "注册日期", required = true)
@NotBlank(message = "注册日期不能为空")
private String registerDate;
@ApiModelProperty(value = "行驶证发证日期", required = true)
@NotBlank(message = "行驶证发证日期不能为空")
private String licenceIssueDate;
}
package com.clx.performance.param.feign.transport;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @description:
* @Author:liumingchao
* @Date:2022/11/4 13:50
*/
@Getter
@Setter
@NoArgsConstructor
public class OrderChildTruckTraceDTO {
// @ApiModelProperty(value = "运单号", required = true)
// private String childNo;
@ApiModelProperty(value = "定位时间", required = true)
@NotBlank(message = "定位时间不能为空")
private String locationTime;
@ApiModelProperty(value = "定位经度", required = true)
@NotBlank(message = "定位经度不能为空")
private String locationLon;
@ApiModelProperty(value = "定位纬度", required = true)
@NotBlank(message = "定位纬度不能为空")
private String locationLat;
@ApiModelProperty(value = "定位详细位置信息")
private String locationAddress;
}
package com.clx.performance.param.feign.transport;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 法人货主同步
*/
@Getter
@Setter
@ToString
@NoArgsConstructor
public class OwnerLegalSyncParam implements Serializable {
@ApiModelProperty(value = " 法人姓名 ", required = true)
@NotBlank(message = "货主登录手机号不可为空")
private String name;
@ApiModelProperty(value = " 货主手机号码 ", required = true)
@NotBlank(message = "货主姓名不可为空")
private String mobile;
@ApiModelProperty(value = " 身份证号 ", required = true)
@NotBlank(message = "身份证号不可为空")
private String cardNo;
@ApiModelProperty(value = " 企业名称 ", required = true)
private String company;
@ApiModelProperty(value = " 注册时间 ", required = true)
private String registerTime;
@ApiModelProperty(value = " 省 ", required = true)
private String province;
@ApiModelProperty(value = " 省code ", required = true)
private Integer provinceCode;
@ApiModelProperty(value = " 市 ", required = true)
private String city;
@ApiModelProperty(value = " 市code ", required = true)
private Integer cityCode;
@ApiModelProperty(value = " 区县 ", required = true)
private String county;
@ApiModelProperty(value = " 区县code ", required = true)
private Integer countyCode;
@ApiModelProperty(value = " 乡镇 ", required = true)
private String town;
@ApiModelProperty(value = " 乡镇code ", required = true)
private Integer townCode;
@ApiModelProperty(value = " 街道 ", required = true)
private String street;
@ApiModelProperty(value = " 街道code ", required = true)
private Integer streetCode;
@ApiModelProperty(value = " 详细地址 ", required = true)
private String address;
@ApiModelProperty(value = " 申请类型:1法人认证2代理人认证 ", required = true)
private Integer applyType;
@ApiModelProperty(value = " 法人姓名 ")
private String legalName;
@ApiModelProperty(value = " 法人手机号 ")
private String legalMobile;
@ApiModelProperty(value = " 法人身份证号 ")
private String legalCardNo;
@ApiModelProperty(value = " 法人身份证正面图片地址 ")
private String legalFrontImg;
@ApiModelProperty(value = " 法人身份证背面图片地址 ")
private String legalBackImg;
@ApiModelProperty(value = " 法人统一社会信用代码 ")
private String legalGroupCode;
@ApiModelProperty(value = " 法人营业执照图片地址 ")
private String legalBusinessImg;
@ApiModelProperty(value = " 代理人姓名 ")
private String agentName;
@ApiModelProperty(value = " 代理人手机号 ")
private String agentMobile;
@ApiModelProperty(value = " 代理人身份证号 ")
private String agentCardNo;
@ApiModelProperty(value = " 代理人身份证正面图片地址 ")
private String agentFrontImg;
@ApiModelProperty(value = " 代理人身份证背面图片地址 ")
private String agentBackImg;
@ApiModelProperty(value = " 代理人统一社会信用代码 ")
private String agentGroupCode;
@ApiModelProperty(value = " 代理人授权书图片地址 ")
private String agentBusinessImg;
@ApiModelProperty(value = " 企业联系人姓名 ", required = true)
private String businessName;
@ApiModelProperty(value = " 企业联系人手机号 ", required = true)
private String businessMobile;
@ApiModelProperty(value = " 企业类型 ", required = true)
private Integer businessType;
@ApiModelProperty(value = " 注册机构名称 ")
private String registerOrgName;
@ApiModelProperty(value = " 注册资本(单位:万元) ")
private Double registerAmount;
@ApiModelProperty(value = " 组织机构代码 ")
private String orgGroupCode;
@ApiModelProperty(value = " 企业邮箱 ")
private String businessEmail;
@ApiModelProperty(value = " 核准时间 ")
private String checkTime;
}
package com.clx.performance.param.feign.transport;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.validation.constraints.NotBlank;
/**
* 自然人货主同步
*/
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class OwnerPersonalSyncParam {
@ApiModelProperty(value = " 登陆手机号 ", required = true)
@NotBlank(message = "货主登录手机号不可为空")
private String mobile;
@ApiModelProperty(value = " 货主姓名 ", required = true)
@NotBlank(message = "货主姓名不可为空")
private String name;
@ApiModelProperty(value = " 身份证号 ", required = true)
@NotBlank(message = "身份证号不可为空")
private String cardNo;
@ApiModelProperty(value = " 省 ", required = true)
private String province;
@ApiModelProperty(value = " 省code ", required = true)
private Integer provinceCode;
@ApiModelProperty(value = " 市 ", required = true)
private String city;
@ApiModelProperty(value = " 市code ", required = true)
private Integer cityCode;
@ApiModelProperty(value = " 区县 ", required = true)
private String county;
@ApiModelProperty(value = " 区县code ", required = true)
private Integer countyCode;
// @ApiModelProperty(value = " 乡镇 ", required = false)
// private String town;
// @ApiModelProperty(value = " 乡镇code ", required = false)
// private Integer townCode;
// @ApiModelProperty(value = " 街道 ", required = false)
// private String street;
// @ApiModelProperty(value = " 街道code ", required = false)
// private Integer streetCode;
@NotBlank(message = "详细地址不可为空")
@ApiModelProperty(value = " 详细地址 ", required = true)
private String address;
@NotBlank(message = "身份证正面图片不可为空")
@ApiModelProperty(value = " 身份证正面图片地址 ", required = true)
private String legalFrontImg;
@NotBlank(message = "身份证背面图片不可为空")
@ApiModelProperty(value = " 身份证背面图片地址 ", required = true)
private String legalBackImg;
@ApiModelProperty(value = "手持身份证")
private String personHandheldImg;
@ApiModelProperty(value = " 个人邮箱 ")
private String businessEmail;
}
package com.clx.performance.param.feign.transport;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;
@Getter
@Setter
@ToString
@NoArgsConstructor
public class ThirdOrderChildBrokerParam {
@ApiModelProperty(value = "运单编码", dataType="String", required = true)
@NotBlank(message = "订单编码不能为空")
private String childNo;
@ApiModelProperty(value = "订单编码", dataType="String", required = true)
@NotBlank(message = "货单编码不能为空")
private String orderNo;
@ApiModelProperty(value = "车牌号", dataType="String", required = true)
@NotBlank(message = "车牌号不能为空")
private String truckNo;
@ApiModelProperty(value = "运费单价 单位分", dataType="Integer", required = true)
@NotNull(message = "运费单价不能为空")
private Integer freightPrice;
@ApiModelProperty(value = "运费 单位分", dataType="Integer", required = true)
@NotNull(message = "运费不能为空")
private Integer freight;
@ApiModelProperty(value = "实付运费 单位分", dataType="Integer", required = true)
@NotNull(message = "实付运费不能为空")
private Integer freightNoCard;
@ApiModelProperty(value = "溢价金额", dataType = "Integer", required = true)
@NotNull(message = "溢价金额不能为空")
private Integer orderChildBrokerBeyondFreight;
@ApiModelProperty(value = "净重", dataType="BigDecimal", required = true)
@NotNull(message = "净重不能为空")
private BigDecimal net;
@ApiModelProperty(value = "发货地址", dataType="String", required = true)
@NotBlank(message = "发货地址不能为空")
private String sendAddress;
@ApiModelProperty(value = "货源所在省份", dataType="String", required = true)
@NotBlank(message = "货源所在省份不能为空")
private String sendProvince;
@ApiModelProperty(value = "货源所在城市", dataType="String", required = true)
@NotBlank(message = "货源所在城市不能为空")
private String sendCity;
@ApiModelProperty(value = "货源所在区县", dataType="String", required = true)
@NotBlank(message = "货源所在区县不能为空")
private String sendCounty;
@ApiModelProperty(value = "货源所在乡镇", dataType="String", required = true)
@NotBlank(message = "货源所在乡镇不能为空")
private String sendTown;
@ApiModelProperty(value = "发货人", dataType="String", required = true)
@NotBlank(message = "发货人不能为空")
private String sendName;
@ApiModelProperty(value = "发货人手机号", dataType="String", required = true)
@NotBlank(message = "发货人手机号不能为空")
private String sendMobile;
@ApiModelProperty(value = "收货人所在省", dataType="String", required = true)
@NotBlank(message = "收货人所在省不能为空")
private String receiveProvince;
@ApiModelProperty(value = "收货人所在城市", dataType="String", required = true)
@NotBlank(message = "收货人所在城市不能为空")
private String receiveCity;
@ApiModelProperty(value = "收货人所在区县", dataType="String", required = true)
@NotBlank(message = "收货人所在区县不能为空")
private String receiveCounty;
@ApiModelProperty(value = "收货人所在乡镇", dataType="String", required = true)
@NotBlank(message = "收货人所在乡镇不能为空")
private String receiveTown;
@ApiModelProperty(value = "收货地址", dataType="String", required = true)
@NotBlank(message = "收货地址不能为空")
private String receiveAddress;
@ApiModelProperty(value = "收货人", dataType="String", required = true)
@NotBlank(message = "收货人不能为空")
private String receiveName;
@ApiModelProperty(value = "收货人手机号", dataType="String", required = true)
@NotBlank(message = "收货人手机号不能为空")
private String receiveMobile;
@ApiModelProperty(value = "装车地址经度", required = true)
@NotBlank(message = "装车地址经度不能为空")
private String loadLongitude;
@ApiModelProperty(value = "装车地址纬度", required = true)
@NotBlank(message = "装车地址纬度不能为空")
private String loadLatitude;
@ApiModelProperty(value = "卸车地址经度", required = true)
@NotBlank(message = "卸车地址经度不能为空")
private String unloadLongitude;
@ApiModelProperty(value = "卸车地址纬度", required = true)
@NotBlank(message = "卸车地址纬度不能为空")
private String unloadLatitude;
@ApiModelProperty(value = "运输距离(公里)", required = true)
@NotNull(message = "运输距离不能为空")
private BigDecimal distance;
@ApiModelProperty(value = "接单时间", dataType="String", required = true)
@NotBlank(message = "接单时间不能为空")
private String payTime;
@ApiModelProperty(value = "装车时间", dataType="String", required = true)
@NotBlank(message = "装车时间不能为空")
private String loadTime;
@ApiModelProperty(value = "卸车时间", dataType="String", required = true)
@NotBlank(message = "卸车时间不能为空")
private String unloadTime;
@ApiModelProperty(value = "支付完成时间", dataType="String", required = true)
@NotBlank(message = "支付完成时间不能为空")
private String payFinishedTime;
// @ApiModelProperty(value = "备注", dataType="String")
// private String remark;
// @ApiModelProperty(value = "创建时间", dataType="String", required = true)
// private String createTime;
@ApiModelProperty(value = "收货单位", dataType="String")
private String receiveCompany;
@ApiModelProperty(value = "发货单位", dataType="String")
private String sendCompany;
@ApiModelProperty(value = "收货净重", dataType="BigDecimal", required = true)
@NotNull(message = "收货净重不能为空")
private BigDecimal receiveNet;
@ApiModelProperty(value = "货物名称", dataType="String", required = true)
@NotBlank(message = "货物名称不能为空")
private String goodsName;
// @ApiModelProperty(value = "是否车主本人:1是,0否", dataType="Integer", required = true)
// private Integer personalDriverFlag;
@ApiModelProperty(value = "垫付类型 0 全额垫付 1 不垫付服务费", dataType="Integer", required = true)
@NotNull(message = "垫付类型不能为空")
private Integer advanceType;
@ApiModelProperty(value = "货物价格 单位 分", required = true)
@NotNull(message = "货物价格不能为空")
private Integer goodsPrice;
@ApiModelProperty(value = "源订单号 (承运平台订单号)")
@NotBlank(message = "源订单号不能为空")
private String sourceOrderNo;
@ApiModelProperty(value = "源货单号 (承运平台货单号)")
@NotBlank(message = "源货单号不能为空")
private String sourceGoodsNo;
@ApiModelProperty(value = "源开票方式 (开票方式) :1 装车 2 卸车")
@NotNull(message = "源开票方式不能为空")
private Integer sourceInvoicingType;
@ApiModelProperty(value = "源单价 (承运单价)")
@NotNull(message = "源单价不能为空")
private BigDecimal sourceFreightPrice;
@ApiModelProperty(value = "源开票金额 (开票金额)")
@NotNull(message = "源开票金额不能为空")
private BigDecimal sourceInvoicingPrice;
@ApiModelProperty(value = "源亏吨金额 (亏吨扣款)")
@NotNull(message = "源亏吨金额不能为空")
private BigDecimal sourceLossPrice;
@ApiModelProperty(value = "装车磅单图片", required = true)
@NotEmpty(message = "装车磅单图片不能为空")
private List<String> loadPoundImages;
@ApiModelProperty(value = "卸车磅单图片", required = true)
@NotEmpty(message = "卸车磅单图片不能为空")
private List<String> unLoadPoundImages;
@ApiModelProperty(value = "关联账号(货主手机号)", required = true)
@NotBlank(message = "关联账号不能为空")
private String invoiceRelationNo;
@ApiModelProperty(value = "货单信息", required = true)
@Valid
private ThirdOrderInfoDTO orderInfoDTO;
@ApiModelProperty(value = "车主信息", required = true)
@Valid
private OrderChildDriverInfoDTO truckDriverInfoDTO;
@ApiModelProperty(value = "司机信息", required = true)
@Valid
private OrderChildDriverInfoDTO driverInfoDTO;
@ApiModelProperty(value = "车主银行卡信息", required = true)
@Valid
private OrderChildBankInfoDTO truckDriverBankInfoDTO;
@ApiModelProperty(value = "司机银行卡信息", required = true)
@Valid
private OrderChildBankInfoDTO driverBankInfoDTO;
@ApiModelProperty(value = "车辆信息", required = true)
@Valid
private OrderChildTruckInfoDTO truckInfoDTO;
@ApiModelProperty(value = "运单轨迹", required = true)
@Valid
@NotEmpty(message = "运单轨迹不能为空")
private List<OrderChildTruckTraceDTO> brokerTraceList;
// @ApiModelProperty(value = "来源:0-货易来,1-诚联信 2承运", hidden = true)
// private Integer source;
}
package com.clx.performance.param.feign.transport;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
@Setter
@Getter
@ToString
@NoArgsConstructor
public class ThirdOrderInfoDTO {
@ApiModelProperty(value = "货单编码", required = true)
private String orderNo;
@ApiModelProperty(value = "货物名称", required = true)
private String goodsName;
@ApiModelProperty(value = "发货单位")
private String sendCompany;
@ApiModelProperty(value = "发货所在省份", required = true)
@NotBlank(message = "发货所在省份不能为空")
private String sendProvince;
@ApiModelProperty(value = "发货所在城市", required = true)
@NotBlank(message = "发货所在城市不能为空")
private String sendCity;
@ApiModelProperty(value = "发货所在区县", required = true)
@NotBlank(message = "发货所在区县不能为空")
private String sendCounty;
@ApiModelProperty(value = "发货所在乡镇", required = true)
@NotBlank(message = "发货所在乡镇不能为空")
private String sendTown;
@ApiModelProperty(value = "发货详细地址", required = true)
@NotBlank(message = "发货详细地址不能为空")
private String sendAddress;
@ApiModelProperty(value = "发货联系人", required = true)
@NotBlank(message = "发货联系人不能为空")
private String sendName;
@ApiModelProperty(value = "发货联系人手机号", required = true)
@NotBlank(message = "发货联系人手机号不能为空")
private String sendMobile;
@ApiModelProperty(value = "发货地址经度", required = true)
@NotBlank(message = "发货地址经度不能为空")
private String loadLongitude;
@ApiModelProperty(value = "发货地址纬度", required = true)
@NotBlank(message = "发货地址纬度不能为空")
private String loadLatitude;
@ApiModelProperty(value = "收货单位")
private String receiveCompany;
@ApiModelProperty(value = "收货人所在省", required = true)
@NotBlank(message = "收货人所在省不能为空")
private String receiveProvince;
@ApiModelProperty(value = "收货人所在城市", required = true)
@NotBlank(message = "收货人所在城市不能为空")
private String receiveCity;
@ApiModelProperty(value = "收货人所在区县", required = true)
@NotBlank(message = "收货人所在区县不能为空")
private String receiveCounty;
@ApiModelProperty(value = "收货人所在乡镇", required = true)
@NotBlank(message = "收货人所在乡镇不能为空")
private String receiveTown;
@ApiModelProperty(value = "收货详细地址", required = true)
@NotBlank(message = "收货详细地址不能为空")
private String receiveAddress;
@ApiModelProperty(value = "收货联系人", required = true)
@NotBlank(message = "收货联系人不能为空")
private String receiveName;
@ApiModelProperty(value = "收货联系人手机号", required = true)
@NotBlank(message = "收货联系人手机号不能为空")
private String receiveMobile;
@ApiModelProperty(value = "收货地址经度", required = true)
@NotBlank(message = "收货地址经度不能为空")
private String unloadLongitude;
@ApiModelProperty(value = "收货地址纬度", required = true)
@NotBlank(message = "收货地址纬度不能为空")
private String unloadLatitude;
@ApiModelProperty(value = "货物单价(单位:分)", required = true)
@NotNull(message = "货物单价不能为空")
private Integer goodsPrice;
@ApiModelProperty(value = "运费单价(单位:分)", required = true)
@NotNull(message = "运费单价不能为空")
private Integer transPrice;
@ApiModelProperty(value = "货物总重量(吨)", required = true)
@NotNull(message = "货物总重量不能为空")
private BigDecimal goodsAmount;
@ApiModelProperty(value = "最晚装货时间", required = true)
@NotBlank(message = "最晚装货时间不能为空")
private String extractTime;
@ApiModelProperty(value = "司机最晚到达时间", required = true)
@NotBlank(message = "司机最晚到达时间不能为空")
private String arriveTime;
}
package com.clx.performance.vo.feign.transport;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import java.util.List;
@Getter
@Setter
@ToString
@NoArgsConstructor
public class ThirdOrderChildBrokerResultVO {
@ApiModelProperty(value = "风控结果列表,空未风控")
private List<RiskItem> riskList;
@ApiModelProperty(value = "合规状态:0不合规 1合规")
private Integer status;
@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
public static class RiskItem {
@ApiModelProperty(value = "类型", example = "PRICE_LOW")
private String type;
@ApiModelProperty(value = "风控原因", example = "运费单价过低")
private String msg;
}
}
package com.clx.performance.component;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.msl.common.dto.HttpDTO;
import com.msl.common.result.Result;
import com.msl.common.utils.EncryptUtil;
import com.msl.common.utils.HttpUtil;
import lombok.extern.slf4j.Slf4j;
import java.security.GeneralSecurityException;
@Slf4j
public class ThirdComponent {
public static final String TRANSPORT_USER = "13403503399";
public static final String TRANSPORT_KEY = "9Y1N5AUP8N2TI359";
// @Autowired
// private HttpLogService httpLogService;
// /**
// * post请求
// *
// * @param host
// * @param httpEnum
// * @param param
// * @param httpLog
// * @param isEncrypt
// */
// @Transactional(propagation = Propagation.NOT_SUPPORTED)
// public Result<?> postRequest(String host, HttpEnum httpEnum, String param, HttpLog httpLog, boolean isEncrypt) {
// if (Objects.nonNull(httpLog)) {
// httpLog.setTryCount(httpLog.getTryCount() + 1);
// httpLogService.updateHttpLogTryCount(httpLog);
// } else {
// httpLog = new HttpLog()
// .setMsgId(UUID.randomUUID().toString())
// .setType(httpEnum.getCode())
// .setRemark(httpEnum.getMark())
// .setUrl(httpEnum.getUrl())
// .setParam(param)
// .setStatus(HttpStatusEnum.HAVING.getCode())
// .setTryCount(1);
// httpLogService.saveHttpLog(httpLog);
// }
// return isEncrypt ? encryptPost(host + httpLog.getUrl(), httpLog.getParam(), httpLog.getId()) : asyncPost(host + httpLog.getUrl(), httpLog.getParam(), httpLog.getId());
// }
//
// @Transactional(propagation = Propagation.NOT_SUPPORTED)
// public Result<?> postRequestBroker(String host, HttpEnum httpEnum, String param, HttpLog httpLog, Map<String, Object> headers) {
// if (Objects.nonNull(httpLog)) {
// httpLog.setTryCount(httpLog.getTryCount() + 1);
// httpLogService.updateHttpLogTryCount(httpLog);
// } else {
// httpLog = new HttpLog()
// .setMsgId(UUID.randomUUID().toString())
// .setType(httpEnum.getCode())
// .setRemark(httpEnum.getMark())
// .setUrl(httpEnum.getUrl())
// .setParam(param)
// .setStatus(HttpStatusEnum.HAVING.getCode())
// .setTryCount(1)
// .setHeader(JSON.toJSONString(headers));
// httpLogService.saveHttpLog(httpLog);
// }
// return asyncPostBroker(host + httpLog.getUrl(), httpLog.getParam(), httpLog.getId(), headers);
// }
//
// /**
// * get请求
// *
// * @param host
// * @param httpEnum
// * @param headers
// * @param param
// * @return
// */
// @Transactional(propagation = Propagation.NOT_SUPPORTED)
// public Result<?> getRequest(String host, HttpEnum httpEnum, Map<String, Object> headers, HttpLog httpLog, Object... param) {
// if (Objects.nonNull(httpLog)) {
// httpLog.setTryCount(httpLog.getTryCount() + 1);
// httpLogService.updateHttpLogTryCount(httpLog);
// } else {
// httpLog = new HttpLog()
// .setMsgId(UUID.randomUUID().toString())
// .setType(httpEnum.getCode())
// .setRemark(httpEnum.getMark())
// .setUrl(String.format(httpEnum.getUrl(), param))
// .setHeader(JSON.toJSONString(headers))
// .setParam("")
// .setStatus(HttpStatusEnum.HAVING.getCode())
// .setTryCount(1);
// httpLogService.saveHttpLog(httpLog);
// }
// return asyncGet(host + httpLog.getUrl(), headers, httpLog.getId());
// }
//
// private Result<?> asyncGet(String url, Map<String, Object> headers, Integer httpLogId) {
// try {
// return Optional.ofBlank(HttpClientUtil.httpGetRequest(url, headers))
// .map(res -> JSON.parseObject(res, Result.class))
// .peek(result -> httpLogService.updateHttpLogStatus(httpLogId, result))
// .filter(Result::succeed)
// .orElse(new Result<>(ResultCodeEnum.FAIL));
// } catch (Exception e) {
// log.error("http请求错误---->httpLogId:{},url:{}", httpLogId, url, e);
// }
// return new Result<>(ResultCodeEnum.FAIL);
// }
//
// private Result<?> asyncPost(String url, String param, Integer httpLogId) {
// try {
// return Optional.ofBlank(HttpClientUtil.httpPostRequest(url, param))
// .map(res -> JSON.parseObject(res, Result.class))
// .peek(result -> httpLogService.updateHttpLogStatus(httpLogId, result))
// .filter(Result::succeed)
// .orElse(new Result<>(ResultCodeEnum.FAIL));
// } catch (Exception e) {
// log.error("http请求错误---->httpLogId:{},url:{},param:{}", httpLogId, url, param, e);
// }
// return new Result<>(ResultCodeEnum.FAIL);
// }
//
// private Result<?> asyncPostBroker(String url, String param, Integer httpLogId, Map<String, Object> headers) {
// try {
// String s = HttpClientUtil.httpPostRequestBroker(url, param, headers);
// return Optional.ofBlank(s)
// .map(res -> JSON.parseObject(res, Result.class))
// .peek(result -> httpLogService.updateHttpLogStatus(httpLogId, result))
// .filter(Result::succeed)
// .orElse(new Result<>(ResultCodeEnum.FAIL));
// } catch (Exception e) {
// log.error("http请求错误---->httpLogId:{},url:{},param:{}", httpLogId, url, param, e);
// }
// return new Result<>(ResultCodeEnum.FAIL);
// }
public static String encrypt(String param) throws Exception {
HttpDTO httpDTO = EncryptUtil.buildDTO(TRANSPORT_USER, param, TRANSPORT_KEY, System.currentTimeMillis());
return JSONUtil.parse(httpDTO).toString();
}
public static Result<?> encryptPost(String url, String param, Integer httpLogId) {
try {
return HttpUtil.post(url, null,
EncryptUtil.buildDTO(TRANSPORT_USER, param, TRANSPORT_KEY, System.currentTimeMillis()))
.map(r -> JSON.parseObject(r, new TypeReference<HttpDTO>() {
}))
.peek(dto -> log.info("http请求返回------dto->{}", dto))
.mapTry(dto -> EncryptUtil.decrypt(dto.getData(), TRANSPORT_KEY))
.map(t -> {
return JSONUtil.toBean(t, Result.class);
}
).get();
// .peek(result -> httpLogService.updateHttpLogStatus(httpLogId, result))
} catch (GeneralSecurityException e) {
log.error("解密失败", e);
throw new RuntimeException();
}
}
}
package com.clx.performance.controller.pc; package com.clx.performance.controller.pc;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.dao.OrderChildDao;
import com.clx.performance.dao.OrderGoodsDao;
import com.clx.performance.dao.settle.SettlementOwnerDetailDao;
import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.feign.TransportFeignService;
import com.clx.performance.model.OrderChild;
import com.clx.performance.model.OrderGoods;
import com.clx.performance.model.settle.SettlementOwnerDetail;
import com.clx.performance.param.feign.transport.ThirdOrderChildBrokerParam;
import com.clx.performance.param.pc.ArtificialCancelOrderParam; import com.clx.performance.param.pc.ArtificialCancelOrderParam;
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.PageOrderGoodsListParam; import com.clx.performance.param.pc.PageOrderGoodsListParam;
import com.clx.performance.service.OrderCancelService; import com.clx.performance.service.OrderCancelService;
import com.clx.performance.service.TransportSyncService;
import com.clx.performance.vo.app.OrderChildVO; import com.clx.performance.vo.app.OrderChildVO;
import com.clx.performance.vo.feign.transport.ThirdOrderChildBrokerResultVO;
import com.clx.performance.vo.pc.OrderGoodsVO; import com.clx.performance.vo.pc.OrderGoodsVO;
import com.msl.common.base.PageData; import com.msl.common.base.PageData;
import com.msl.common.base.PageParam; import com.msl.common.base.PageParam;
...@@ -17,6 +29,7 @@ import io.swagger.annotations.Api; ...@@ -17,6 +29,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -32,6 +45,21 @@ public class OrderCancelController { ...@@ -32,6 +45,21 @@ public class OrderCancelController {
private final OrderCancelService orderCancelService; private final OrderCancelService orderCancelService;
@Autowired
private TransportSyncService transportSyncService;
@Autowired
private OrderChildDao orderChildDao;
@Autowired
private SettlementOwnerDetailDao settlementOwnerDetailDao;
@Autowired
private OrderGoodsDao orderGoodsDao;
@Autowired
private TransportFeignService transportFeignService;
@ApiOperation(value = "承运端取消订单", notes = "<br>By:胡宇帆") @ApiOperation(value = "承运端取消订单", notes = "<br>By:胡宇帆")
@PostMapping("/platformCancelOrderPre") @PostMapping("/platformCancelOrderPre")
public Result<Object> platformCancelOrderPre(@RequestBody OrderCancelParam param) { public Result<Object> platformCancelOrderPre(@RequestBody OrderCancelParam param) {
...@@ -67,4 +95,19 @@ public class OrderCancelController { ...@@ -67,4 +95,19 @@ public class OrderCancelController {
IPage<OrderChildVO> page = orderCancelService.orderChildCancelRecord(param); IPage<OrderChildVO> page = orderCancelService.orderChildCancelRecord(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages()); return Result.page(page.getRecords(), page.getTotal(), page.getPages());
} }
@ApiOperation(value = "syncTest", notes = "<br>By:胡宇帆")
@GetMapping("/syncTest")
public Result<ThirdOrderChildBrokerResultVO> syncTest(@RequestParam String childNo) {
OrderChild orderChild = orderChildDao.getByChildNo(childNo).get();
OrderGoods orderGoods = orderGoodsDao.getByOrderGoodsNo(orderChild.getOrderGoodsNo()).get();
SettlementOwnerDetail settlementOwnerDetail = settlementOwnerDetailDao.getByChildNo(childNo).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
ThirdOrderChildBrokerParam param = transportSyncService.generateOrderChildSync(orderChild, orderGoods, settlementOwnerDetail);
log.info("=======================生成Param{}", JSONUtil.parse(param));
Result<ThirdOrderChildBrokerResultVO> result = transportFeignService.orderChildSync(param);
return result;
}
} }
package com.clx.performance.controller.temp; package com.clx.performance.controller.temp;
import com.clx.performance.extranal.transport.TransportService;
import com.clx.performance.param.feign.transport.ThirdOrderChildBrokerParam;
import com.clx.performance.config.MslPaymentConfig; import com.clx.performance.config.MslPaymentConfig;
import com.clx.performance.service.TempService; import com.clx.performance.service.TempService;
import com.clx.performance.service.child.FeignOrderChildService; import com.clx.performance.service.child.FeignOrderChildService;
...@@ -33,6 +35,8 @@ public class TempController { ...@@ -33,6 +35,8 @@ public class TempController {
private FeignOrderChildService carrierOrderChildService; private FeignOrderChildService carrierOrderChildService;
@Autowired @Autowired
private MslPaymentConfig mslPaymentConfig; private MslPaymentConfig mslPaymentConfig;
@Autowired
private TransportService transportService;
...@@ -72,4 +76,17 @@ public class TempController { ...@@ -72,4 +76,17 @@ public class TempController {
return Result.ok(); return Result.ok();
} }
@ApiOperation(value = "承运同步网络货运 (临时接口)", notes = "<br>By:艾庆国")
@RequestMapping(value = "/orderChildSync", method = RequestMethod.GET)
public Result<Void> orderChildSync() {
ThirdOrderChildBrokerParam param = new ThirdOrderChildBrokerParam();
param.setChildNo("123");
transportService.orderChildSync(param);
return Result.ok();
}
} }
...@@ -33,4 +33,7 @@ public interface OwnerRunningWaterRecordDao extends BaseDao<OwnerRunningWaterRec ...@@ -33,4 +33,7 @@ public interface OwnerRunningWaterRecordDao extends BaseDao<OwnerRunningWaterRec
List<OwnerRunningWaterRecord> getOwnerRunningWaterRecord(String orderNo); List<OwnerRunningWaterRecord> getOwnerRunningWaterRecord(String orderNo);
List<OwnerAccountRunningWaterRecordVO> marginAccountList(PagePlatformMarginAccountParam param); List<OwnerAccountRunningWaterRecordVO> marginAccountList(PagePlatformMarginAccountParam param);
OwnerRunningWaterRecord getOneByOrderNoAndRunningWaterTypeAndAccountType(String orderNo, Integer runningWaterType, Integer accountType);
} }
...@@ -65,4 +65,12 @@ public class OwnerRunningWaterRecordDaoImpl extends BaseDaoImpl<OwnerRunningWate ...@@ -65,4 +65,12 @@ public class OwnerRunningWaterRecordDaoImpl extends BaseDaoImpl<OwnerRunningWate
public List<OwnerAccountRunningWaterRecordVO> marginAccountList(PagePlatformMarginAccountParam param) { public List<OwnerAccountRunningWaterRecordVO> marginAccountList(PagePlatformMarginAccountParam param) {
return baseMapper.marginAccountList(param); return baseMapper.marginAccountList(param);
} }
@Override
public OwnerRunningWaterRecord getOneByOrderNoAndRunningWaterTypeAndAccountType(String orderNo, Integer runningWaterType, Integer accountType) {
return baseMapper.selectOne(lQrWrapper().eq(OwnerRunningWaterRecord::getOrderNo, orderNo)
.eq(OwnerRunningWaterRecord::getRunningWaterType, runningWaterType)
.eq(OwnerRunningWaterRecord::getAccountType, accountType)
);
}
} }
...@@ -25,10 +25,11 @@ import java.util.Objects; ...@@ -25,10 +25,11 @@ import java.util.Objects;
@Repository @Repository
public class SettlementDriverDetailDaoImpl extends BaseDaoImpl<SettlementDriverDetailMapper, SettlementDriverDetail, Integer> implements SettlementDriverDetailDao { public class SettlementDriverDetailDaoImpl extends BaseDaoImpl<SettlementDriverDetailMapper, SettlementDriverDetail, Integer> implements SettlementDriverDetailDao {
@Override @Override
public boolean updateInvoiceType(SettlementDriverDetail item) { public boolean updateInvoiceTypeAndPrepayFreightFlag(SettlementDriverDetail item) {
return update(lUdWrapper() return update(lUdWrapper()
.eq(SettlementDriverDetail::getId, item.getId()) .eq(SettlementDriverDetail::getId, item.getId())
.set(SettlementDriverDetail::getInvoiceType, item.getInvoiceType()) .set(SettlementDriverDetail::getInvoiceType, item.getInvoiceType())
.set(SettlementDriverDetail::getPrepayFreightFlag, item.getPrepayFreightFlag())
); );
} }
......
...@@ -18,7 +18,7 @@ import java.util.List; ...@@ -18,7 +18,7 @@ import java.util.List;
*/ */
public interface SettlementDriverDetailDao extends BaseDao<SettlementDriverDetailMapper, SettlementDriverDetail, Integer> { public interface SettlementDriverDetailDao extends BaseDao<SettlementDriverDetailMapper, SettlementDriverDetail, Integer> {
boolean updateInvoiceType(SettlementDriverDetail item); boolean updateInvoiceTypeAndPrepayFreightFlag(SettlementDriverDetail item);
boolean updateSettlementNo(SettlementDriverDetail item); boolean updateSettlementNo(SettlementDriverDetail item);
......
package com.clx.performance.extranal.transport;
import com.clx.performance.param.feign.transport.OwnerLegalSyncParam;
import com.clx.performance.param.feign.transport.OwnerPersonalSyncParam;
import com.clx.performance.param.feign.transport.ThirdOrderChildBrokerParam;
import com.clx.performance.vo.feign.transport.ThirdOrderChildBrokerResultVO;
public interface TransportService {
ThirdOrderChildBrokerResultVO orderChildSync(ThirdOrderChildBrokerParam param);
Integer ownerLegalSync(OwnerLegalSyncParam param);
Integer ownerPersonalSync(OwnerPersonalSyncParam param);
boolean ownerExistCheck(String mobile);
Integer getOwnerId(String mobile);
}
package com.clx.performance.extranal.transport.impl;
import com.clx.performance.extranal.transport.TransportService;
import com.clx.performance.feign.TransportFeignService;
import com.clx.performance.param.feign.transport.OwnerLegalSyncParam;
import com.clx.performance.param.feign.transport.OwnerPersonalSyncParam;
import com.clx.performance.param.feign.transport.ThirdOrderChildBrokerParam;
import com.clx.performance.vo.feign.transport.ThirdOrderChildBrokerResultVO;
import com.msl.common.base.Optional;
import com.msl.common.enums.ResultCodeEnum;
import com.msl.common.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class TransportServiceImpl implements TransportService {
@Autowired
private TransportFeignService transportFeignService;
@Override
public ThirdOrderChildBrokerResultVO orderChildSync(ThirdOrderChildBrokerParam param) {
return Optional.ofNullable(transportFeignService.orderChildSync(param))
.filter(Result::succeed).orElseThrow(ResultCodeEnum.FAIL).getData();
}
@Override
public Integer ownerLegalSync(OwnerLegalSyncParam param) {
return Optional.ofNullable(transportFeignService.ownerLegalSync(param))
.filter(Result::succeed).orElseThrow(ResultCodeEnum.FAIL).getData();
}
@Override
public Integer ownerPersonalSync(OwnerPersonalSyncParam param) {
return Optional.ofNullable(transportFeignService.ownerPersonalSync(param))
.filter(Result::succeed).orElseThrow(ResultCodeEnum.FAIL).getData();
}
@Override
public boolean ownerExistCheck(String mobile) {
return Optional.ofNullable(transportFeignService.ownerExistCheck(mobile))
.filter(Result::succeed).orElseThrow(ResultCodeEnum.FAIL).getData() == 1;
}
@Override
public Integer getOwnerId(String mobile) {
return Optional.ofNullable(transportFeignService.getOwnerId(mobile))
.filter(Result::succeed).orElseThrow(ResultCodeEnum.FAIL).getData();
}
}
package com.clx.performance.feign;
import com.clx.performance.component.ThirdComponent;
import com.msl.common.result.Result;
import feign.RequestInterceptor;
import feign.RequestTemplate;
public class FeignInterceptor implements RequestInterceptor {
@Override
public void apply(RequestTemplate template){
// 通过template获取到请求体(已经被转成json)
String jsonBody = template.requestBody().asString();
// 构造通用的请求体
// String url = template.feignTarget().url() + template.url();
// Result<?> result = ThirdComponent.encryptPost(url, jsonBody, null);
// System.out.println(result);
try {
jsonBody = ThirdComponent.encrypt(jsonBody);
} catch (Exception e) {
throw new RuntimeException(e);
}
template.body(jsonBody);
}
}
\ No newline at end of file
package com.clx.performance.feign;
import com.clx.performance.param.feign.transport.OwnerLegalSyncParam;
import com.clx.performance.param.feign.transport.OwnerPersonalSyncParam;
import com.clx.performance.param.feign.transport.ThirdOrderChildBrokerParam;
import com.clx.performance.vo.feign.transport.ThirdOrderChildBrokerResultVO;
import com.msl.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.util.List;
@FeignClient(name = "transport-service-yitu", url = "${transport-service.host}", configuration = FeignInterceptor.class)
public interface TransportFeignService {
/**
* 运单同步
*/
@RequestMapping(value = "/transport-service/thirdParty/order/orderChildSync", method = RequestMethod.POST)
Result<ThirdOrderChildBrokerResultVO> orderChildSync(@RequestBody ThirdOrderChildBrokerParam param);
/**
* 运单支付运费同步
*/
@RequestMapping(value = "/transport-service/thirdParty/order/orderChildPaySync", method = RequestMethod.POST)
Result orderChildPaySync(@RequestBody @NotEmpty(message = "运单编号不能为空") List<String> childNoList);
/**
* 获取运单开票状态
* @return 0-未申请,10-已申请,20-审核失败,30-已开票
*/
@RequestMapping(value = "/transport-service/thirdParty/order/getInvoiceStatus", method = RequestMethod.POST)
Result<Integer> getInvoiceStatus(@RequestBody @NotBlank(message = "运单编号不能为空") String childNo);
/**
* 货主同步(法人模式)
* @return 货主用户id
*/
@RequestMapping(value = "/transport-service/thirdParty/owner/ownerLegalSync", method = RequestMethod.POST)
Result<Integer> ownerLegalSync(@RequestBody OwnerLegalSyncParam param);
/**
* 货主同步(自然人模式)
* @return 货主用户id
*/
@RequestMapping(value = "/transport-service/thirdParty/owner/ownerPersonalSync", method = RequestMethod.POST)
Result<Integer> ownerPersonalSync(@RequestBody OwnerPersonalSyncParam param);
/**
* 检测货主是否注册
* @return 0不存在 1存在
*/
@RequestMapping(value = "/transport-service/thirdParty/owner/ownerExistCheck", method = RequestMethod.POST)
Result<Integer> ownerExistCheck(@Validated @NotBlank(message = "手机不能为空") String mobile);
/**
* 获取货主用户id
* @Return null未注册
*/
@RequestMapping(value = "/transport-service/thirdParty/owner/getOwnerId", method = RequestMethod.POST)
Result<Integer> getOwnerId(@Validated @NotBlank(message = "手机不能为空") String mobile);
}
...@@ -43,6 +43,7 @@ public class SettlementDriverDetail implements HasKey<Integer> { ...@@ -43,6 +43,7 @@ public class SettlementDriverDetail implements HasKey<Integer> {
private BigDecimal lossWeight; //货损吨数 private BigDecimal lossWeight; //货损吨数
private BigDecimal lossFreight; //货损金额(分) private BigDecimal lossFreight; //货损金额(分)
private BigDecimal prepayFreight; //预付运费金额(分) private BigDecimal prepayFreight; //预付运费金额(分)
private Integer prepayFreightFlag; //预付运费标示 0:未预付 1:已预付
private BigDecimal settlementFreight; //结算金额(分) private BigDecimal settlementFreight; //结算金额(分)
private Integer invoiceType; //开票标识:1网运单 2普通单 private Integer invoiceType; //开票标识:1网运单 2普通单
private Integer status; //状态 private Integer status; //状态
......
package com.clx.performance.service;
import com.clx.performance.model.OrderChild;
import com.clx.performance.model.OrderGoods;
import com.clx.performance.model.settle.SettlementOwnerDetail;
import com.clx.performance.param.feign.transport.ThirdOrderChildBrokerParam;
public interface TransportSyncService {
ThirdOrderChildBrokerParam generateOrderChildSync(OrderChild orderChild, OrderGoods orderGoods, SettlementOwnerDetail settlementOwnerDetail);
}
...@@ -161,6 +161,9 @@ public class OrderChildServiceImpl implements OrderChildService { ...@@ -161,6 +161,9 @@ public class OrderChildServiceImpl implements OrderChildService {
@Autowired @Autowired
private ZjxlGpsService zjxlGpsService; private ZjxlGpsService zjxlGpsService;
@Autowired
private OwnerRunningWaterRecordDao ownerRunningWaterRecordDao;
@Override @Override
public SaveOrderChildVO saveOrderChild(OrderChildSaveParam param) { public SaveOrderChildVO saveOrderChild(OrderChildSaveParam param) {
...@@ -1054,6 +1057,8 @@ public class OrderChildServiceImpl implements OrderChildService { ...@@ -1054,6 +1057,8 @@ public class OrderChildServiceImpl implements OrderChildService {
// 更新车辆状态 // 更新车辆状态
updateDriverOrderStatusDriverConfirm(orderChild.getTruckId()); updateDriverOrderStatusDriverConfirm(orderChild.getTruckId());
// 生成扣除流水
// 生成计费单 // 生成计费单
saveSettlementDetail(orderChild,orderGoods); saveSettlementDetail(orderChild,orderGoods);
......
package com.clx.performance.service.impl;
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.FeignOrderVO;
import com.clx.performance.dao.OrderChildImageDao;
import com.clx.performance.dto.gd.GdPosDTO;
import com.clx.performance.dto.gd.GdRouteDTO;
import com.clx.performance.model.OrderChild;
import com.clx.performance.model.OrderChildImage;
import com.clx.performance.model.OrderGoods;
import com.clx.performance.model.settle.SettlementDriverDetail;
import com.clx.performance.model.settle.SettlementOwnerDetail;
import com.clx.performance.param.feign.transport.*;
import com.clx.performance.service.TransportSyncService;
import com.clx.performance.utils.gd.GdService;
import com.clx.user.feign.DriverFeign;
import com.clx.user.feign.TruckFeign;
import com.clx.user.vo.feign.*;
import com.msl.common.base.Optional;
import com.msl.common.utils.DateUtils;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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.stream.Collectors;
@Service
@Slf4j
@AllArgsConstructor
public class TransportSyncServiceImpl implements TransportSyncService {
private final OrderChildImageDao orderChildImageDao;
private final AddressFeign addressFeign;
private final OrderFeign orderFeign;
private final TruckFeign truckFeign;
private final DriverFeign driverFeign;
private final GdService gdService;
@Override
public ThirdOrderChildBrokerParam generateOrderChildSync(OrderChild orderChild, OrderGoods orderGoods, SettlementOwnerDetail settlementOwnerDetail) {
FeignOrderVO orderInfoFeign = orderFeign.getOrderInfoFeign(orderGoods.getOrderNo());
ThirdOrderChildBrokerParam param = new ThirdOrderChildBrokerParam();
FeignAddressVO data = addressFeign.getSendAndReceiveAddress(orderChild.getSendAddressId(), orderChild.getReceiveAddressId()).getData();
FeignAddressVO.Address receiveAddress = data.getReceiveAddress();
FeignAddressVO.Address sendAddress = data.getSendAddress();
//生成基础参数
generateBaseInfo(orderChild, orderGoods, param, sendAddress, receiveAddress, orderInfoFeign, settlementOwnerDetail);
//生成货单数据
generateOrderGoods(orderGoods, orderChild, sendAddress, receiveAddress, param);
//生成车辆信息
generateTruckInfo(orderChild, param);
List<GdRouteDTO> route = gdService.getRoute(orderGoods.getSendLongitude().setScale(4, RoundingMode.DOWN)
, orderGoods.getSendLatitude().setScale(4, RoundingMode.DOWN),
orderGoods.getReceiveLongitude().setScale(4, RoundingMode.DOWN),
orderGoods.getReceiveLatitude().setScale(4, RoundingMode.DOWN));
GdRouteDTO gdRouteDTO = route.get(0);
BigDecimal divide = new BigDecimal(gdRouteDTO.getDistance()).divide(new BigDecimal(1000));
param.setDistance(divide);
SyncOrderChildVO syncOrderChildVO = driverFeign.getSyncOrderChild(orderChild.getDriverUserNo(), orderChild.getTruckOwnUserNo()).getData();
DriverInfoFeignVo truckOwnerInfo = syncOrderChildVO.getTruckOwnerInfo();
DriverInfoFeignVo diverInfo = syncOrderChildVO.getDiverInfo();
BankCardVO driverBankCard = syncOrderChildVO.getDriverBankCard();
UserIdCardVO driverUserIdCardVO = syncOrderChildVO.getDriverUserIdCardVO();
BankCardVO truckOwnerBankCard = syncOrderChildVO.getTruckOwnerBankCard();
UserIdCardVO truckOwnerUserIdCardVO = syncOrderChildVO.getTruckOwnerUserIdCardVO();
DriverLicenceFeignVO driverLicenceFeignVO = syncOrderChildVO.getDriverLicenceFeignVO();
DriverLicenceFeignVO truckOwnerLicenceFeignVO = syncOrderChildVO.getTruckOwnerLicenceFeignVO();
//设置司机银行卡
generateDriverBankCard(driverBankCard, driverUserIdCardVO, param);
//设置车主银行卡
generateTruckDriverBankCard(truckOwnerBankCard, truckOwnerUserIdCardVO, param);
//司机信息
generateDriverInfoDTO(diverInfo, driverLicenceFeignVO, driverUserIdCardVO, param);
//车主信息
generateTruckDriverInfoDTO(truckOwnerInfo, truckOwnerLicenceFeignVO, truckOwnerUserIdCardVO, param);
//设置轨迹
generateRouteList(gdRouteDTO, param);
return param;
}
private void generateBaseInfo(OrderChild orderChild, OrderGoods orderGoods, ThirdOrderChildBrokerParam param,
FeignAddressVO.Address sendAddress,
FeignAddressVO.Address receiveAddress, FeignOrderVO orderInfoFeign,
SettlementOwnerDetail settlementOwnerDetail
) {
param.setChildNo(orderChild.getChildNo());
param.setFreightPrice(Integer.valueOf(orderChild.getFreightPrice().toString()));
param.setFreight(Integer.valueOf(orderChild.getFreight().toString()));
param.setSendAddress(orderGoods.getSendAddressShorter());
param.setSendProvince(sendAddress.getProvince());
param.setSendCity(sendAddress.getCity());
param.setSendCounty(sendAddress.getCounty());
param.setSendTown(sendAddress.getTown());
param.setSendName(sendAddress.getContact());
param.setSendMobile(sendAddress.getContactPhone());
param.setReceiveAddress(orderChild.getReceiveAddress());
param.setReceiveProvince(receiveAddress.getProvince());
param.setReceiveCity(receiveAddress.getCity());
param.setReceiveCounty(receiveAddress.getCounty());
param.setReceiveTown(receiveAddress.getTown());
param.setReceiveName(receiveAddress.getContact());
param.setReceiveMobile(receiveAddress.getContactPhone());
param.setLoadLongitude(orderGoods.getSendLongitude().toString());
param.setLoadLatitude(orderGoods.getSendLatitude().toString());
param.setUnloadLongitude(orderGoods.getReceiveLongitude().toString());
param.setUnloadLatitude(orderGoods.getReceiveLatitude().toString());
param.setPayTime(DateUtils.formatDateTime(orderChild.getPayTime()).get());
param.setLoadTime(DateUtils.formatDateTime(orderChild.getLoadTime()).get());
param.setUnloadTime(DateUtils.formatDateTime(orderChild.getUnloadTime()).get());
param.setPayFinishedTime(DateUtils.formatDateTime(orderChild.getFinishTime()).get());
param.setReceiveNet(orderChild.getUnloadNet());
param.setAdvanceType(0);
param.setSourceOrderNo(orderChild.getOrderNo());
param.setSourceGoodsNo(orderChild.getOrderGoodsNo());
param.setSourceInvoicingType(settlementOwnerDetail.getSettlementWay());
param.setSourceFreightPrice(settlementOwnerDetail.getFreightPrice());
param.setSourceInvoicingPrice(settlementOwnerDetail.getInvoiceFreight());
param.setSourceLossPrice(settlementOwnerDetail.getLossFreight());
param.setInvoiceRelationNo(orderInfoFeign.getContactPhoneOwner());
Optional<List<OrderChildImage>> listOptional = orderChildImageDao.listLoadAndUnload(orderChild.getChildNo());
if (listOptional.isPresent()) {
List<OrderChildImage> orderChildImages = listOptional.get();
List<String> loadPoundImages = orderChildImages.stream().filter(i -> {
return i.getType().equals(1);
}
).map(OrderChildImage::getImage).collect(Collectors.toList());
List<String> unLoadPoundImages = orderChildImages.stream().filter(i -> {
return i.getType().equals(2);
}
).map(OrderChildImage::getImage).collect(Collectors.toList());
param.setLoadPoundImages(loadPoundImages);
param.setUnLoadPoundImages(unLoadPoundImages);
}
}
//处理货单数据
private void generateOrderGoods(OrderGoods orderGoods, OrderChild orderChild, FeignAddressVO.Address sendAddress,
FeignAddressVO.Address receiveAddress, ThirdOrderChildBrokerParam param) {
ThirdOrderInfoDTO orderGoodsDto = new ThirdOrderInfoDTO();
orderGoodsDto.setOrderNo(orderGoods.getOrderGoodsNo());
orderGoodsDto.setGoodsName(orderGoods.getGoodsName());
orderGoodsDto.setSendProvince(sendAddress.getProvince());
orderGoodsDto.setSendCity(sendAddress.getCity());
orderGoodsDto.setSendCounty(sendAddress.getCounty());
orderGoodsDto.setSendTown(sendAddress.getTown());
orderGoodsDto.setSendAddress(sendAddress.getAddress());
orderGoodsDto.setSendName(sendAddress.getContact());
orderGoodsDto.setSendMobile(sendAddress.getContactPhone());
orderGoodsDto.setLoadLongitude(orderGoods.getSendLongitude().toString());
orderGoodsDto.setLoadLatitude(orderGoods.getSendLatitude().toString());
orderGoodsDto.setReceiveAddress(orderChild.getReceiveAddress());
orderGoodsDto.setReceiveProvince(receiveAddress.getProvince());
orderGoodsDto.setReceiveCity(receiveAddress.getCity());
orderGoodsDto.setReceiveCounty(receiveAddress.getCounty());
orderGoodsDto.setReceiveTown(receiveAddress.getTown());
orderGoodsDto.setReceiveName(receiveAddress.getContact());
orderGoodsDto.setReceiveMobile(receiveAddress.getContactPhone());
orderGoodsDto.setUnloadLongitude(orderGoods.getReceiveLongitude().toString());
orderGoodsDto.setUnloadLatitude(orderGoods.getReceiveLatitude().toString());
orderGoodsDto.setGoodsPrice(Integer.valueOf(orderChild.getOrderFreightPrice().toString()));
orderGoodsDto.setTransPrice(Integer.valueOf(orderChild.getFreightPrice().toString()));
orderGoodsDto.setGoodsAmount(orderGoods.getExtractWeight());
orderGoodsDto.setExtractTime(DateUtils.formatDateTime(orderGoods.getLastLoadTime()).get());
orderGoodsDto.setArriveTime(DateUtils.formatDateTime(orderGoods.getLastArriveSendTime()).get());
param.setOrderInfoDTO(orderGoodsDto);
}
//车辆信息
public void generateTruckInfo(OrderChild orderChild, ThirdOrderChildBrokerParam param) {
TruckInfoFeignVo truckInfoFeignVo = truckFeign.getTruckInfo(orderChild.getTruckId()).getData();
OrderChildTruckInfoDTO truckInfoDTO = new OrderChildTruckInfoDTO();
DriverInfoFeignVo ownerInfo = driverFeign.getDriverInfo(orderChild.getOwnerUserNo()).getData();
truckInfoDTO.setMobile(ownerInfo.getMobile());
truckInfoDTO.setTruckNo(orderChild.getTruckNo());
truckInfoDTO.setTruckNoColor(truckInfoFeignVo.getTruckNoColor());
truckInfoDTO.setModel(truckInfoFeignVo.getModel());
truckInfoDTO.setLoad(truckInfoFeignVo.getLoad());
truckInfoDTO.setGrossMass(Integer.valueOf(truckInfoFeignVo.getGrossMass().toString()));
truckInfoDTO.setRoadTransportCertificateNo(truckInfoFeignVo.getRoadTransportCertificateNo());
truckInfoDTO.setLicenceImgMain(truckInfoFeignVo.getLicenceImgMain());
truckInfoDTO.setLicenceImgSecond(truckInfoFeignVo.getLicenceImgSecond2());
truckInfoDTO.setLicenceImgSecondBack(truckInfoFeignVo.getLicenceImgSecondBack());
truckInfoDTO.setTransportLicenceImg(truckInfoFeignVo.getTransportLicenceImg());
truckInfoDTO.setPowerType(Integer.valueOf(truckInfoFeignVo.getPowerType()));
truckInfoDTO.setUseNature(truckInfoFeignVo.getUseNature());
truckInfoDTO.setIdentifyCode(truckInfoFeignVo.getIdentifyCode());
truckInfoDTO.setLicenceIssueOrganization(truckInfoFeignVo.getLicenceIssueOrganization());
truckInfoDTO.setRegisterDate(truckInfoFeignVo.getRegisterDate().toString());
truckInfoDTO.setLicenceIssueDate(truckInfoFeignVo.getLicenceIssueDate().toString());
truckInfoDTO.setDrivingLicenseEndTime(DateUtils.formatDateTime(truckInfoFeignVo.getLicenceImgMainEndTime()).get());
param.setTruckInfoDTO(truckInfoDTO);
}
//车主信息
public void generateTruckDriverInfoDTO(DriverInfoFeignVo truckOwnerInfo, DriverLicenceFeignVO licenceVO, UserIdCardVO idCardVO, ThirdOrderChildBrokerParam param) {
OrderChildDriverInfoDTO dto = new OrderChildDriverInfoDTO();
dto.setMobile(truckOwnerInfo.getMobile());
dto.setName(truckOwnerInfo.getName());
dto.setSex(idCardVO.getSex());
dto.setCardNo(idCardVO.getCardNo());
dto.setCardStartTime(idCardVO.getCardStartTime());
dto.setCardEndTime(idCardVO.getCardEndTime());
dto.setCardLongTerm(idCardVO.getCardLongTerm());
dto.setCardFrontImg(idCardVO.getCardFaceImg());
dto.setCardBackImg(idCardVO.getCardBackImg());
dto.setFaceCardImg(idCardVO.getCardFaceImg());
dto.setLicenceNo(licenceVO.getLicenceNo());
dto.setLicenseTime(DateUtils.formatDateTime(licenceVO.getLicenceTime()).get());
dto.setLicenceClass(licenceVO.getLicenceClass());
dto.setLicenceImg(licenceVO.getLicenceImg());
dto.setLicenceBackImg(licenceVO.getLicenceBackImg());
dto.setLicenceStartTime(DateUtils.formatDateTime(licenceVO.getLicenceStartTime()).get());
dto.setLicenceEndTime(DateUtils.formatDateTime(licenceVO.getLicenceEndTime()).get());
dto.setOccupationalLicenceNo(licenceVO.getOccupationalLicenceNo());
dto.setOccupationalLicenceImg(licenceVO.getOccupationalLicenceImg());
dto.setOccupationalStartTime(DateUtils.formatDateTime(licenceVO.getOccupationalLicenceStartTime()).get());
dto.setOccupationalEndTime(DateUtils.formatDateTime(licenceVO.getOccupationalLicenceEndTime()).get());
dto.setLicenceIssueOrganization(licenceVO.getLicenceIssueOrganization());
dto.setIdCardAddress(idCardVO.getAddress());
param.setTruckDriverInfoDTO(dto);
}
//司机信息
public void generateDriverInfoDTO(DriverInfoFeignVo driverInfo, DriverLicenceFeignVO licenceVO, UserIdCardVO idCardVO, ThirdOrderChildBrokerParam param) {
OrderChildDriverInfoDTO dto = new OrderChildDriverInfoDTO();
dto.setMobile(driverInfo.getMobile());
dto.setName(driverInfo.getName());
dto.setSex(idCardVO.getSex());
dto.setCardNo(idCardVO.getCardNo());
dto.setCardStartTime(idCardVO.getCardStartTime());
dto.setCardEndTime(idCardVO.getCardEndTime());
dto.setCardLongTerm(idCardVO.getCardLongTerm());
dto.setCardFrontImg(idCardVO.getCardFaceImg());
dto.setCardBackImg(idCardVO.getCardBackImg());
dto.setFaceCardImg(idCardVO.getCardFaceImg());
dto.setLicenceNo(licenceVO.getLicenceNo());
dto.setLicenseTime(DateUtils.formatDateTime(licenceVO.getLicenceTime()).get());
dto.setLicenceClass(licenceVO.getLicenceClass());
dto.setLicenceImg(licenceVO.getLicenceImg());
dto.setLicenceBackImg(licenceVO.getLicenceBackImg());
dto.setLicenceStartTime(DateUtils.formatDateTime(licenceVO.getLicenceStartTime()).get());
dto.setLicenceEndTime(DateUtils.formatDateTime(licenceVO.getLicenceEndTime()).get());
dto.setOccupationalLicenceNo(licenceVO.getOccupationalLicenceNo());
dto.setOccupationalLicenceImg(licenceVO.getOccupationalLicenceImg());
dto.setOccupationalStartTime(DateUtils.formatDateTime(licenceVO.getOccupationalLicenceStartTime()).get());
dto.setOccupationalEndTime(DateUtils.formatDateTime(licenceVO.getOccupationalLicenceEndTime()).get());
dto.setLicenceIssueOrganization(licenceVO.getLicenceIssueOrganization());
dto.setIdCardAddress(idCardVO.getAddress());
param.setDriverInfoDTO(dto);
}
//司机银行卡
public void generateDriverBankCard(BankCardVO bankCardVO, UserIdCardVO idCardVO, ThirdOrderChildBrokerParam param) {
OrderChildBankInfoDTO dto = new OrderChildBankInfoDTO();
dto.setName(bankCardVO.getName());
dto.setCardNo(bankCardVO.getCardNo());
dto.setMobile(bankCardVO.getMobile());
dto.setAccountType(Integer.valueOf(bankCardVO.getAccountType()));
dto.setType(bankCardVO.getType());
dto.setIdCard(bankCardVO.getIdCard());
dto.setBank(bankCardVO.getBank());
dto.setBankCode(bankCardVO.getBankCode());
dto.setIdCardFrontImg(idCardVO.getCardFaceImg());
dto.setIdCardBackImg(idCardVO.getCardBackImg());
param.setDriverBankInfoDTO(dto);
}
//车主银行卡
public void generateTruckDriverBankCard(BankCardVO bankCardVO, UserIdCardVO idCardVO, ThirdOrderChildBrokerParam param) {
OrderChildBankInfoDTO dto = new OrderChildBankInfoDTO();
dto.setName(bankCardVO.getName());
dto.setCardNo(bankCardVO.getCardNo());
dto.setMobile(bankCardVO.getMobile());
dto.setAccountType(Integer.valueOf(bankCardVO.getAccountType()));
dto.setType(bankCardVO.getType());
dto.setIdCard(bankCardVO.getIdCard());
dto.setBank(bankCardVO.getBank());
dto.setBankCode(bankCardVO.getBankCode());
dto.setIdCardFrontImg(idCardVO.getCardFaceImg());
dto.setIdCardBackImg(idCardVO.getCardBackImg());
param.setTruckDriverBankInfoDTO(dto);
}
public void generateRouteList(GdRouteDTO gdRouteDTO, ThirdOrderChildBrokerParam param) {
List<OrderChildTruckTraceDTO> list = new LinkedList<>();
for (int i = 0; i < gdRouteDTO.getPosList().size(); i++) {
if (i == 6) {
OrderChildTruckTraceDTO dto = new OrderChildTruckTraceDTO();
GdPosDTO gdPosDTO = gdRouteDTO.getPosList().get(gdRouteDTO.getPosList().size() - 1);
BigDecimal longitude = gdPosDTO.getLongitude();
BigDecimal latitude = gdPosDTO.getLatitude();
String address = gdService.getLonLat(longitude + "," + latitude);
dto.setLocationAddress(address);
dto.setLocationTime(LocalDateTime.now().toString());
dto.setLocationLon(longitude.toString());
dto.setLocationLat(latitude.toString());
list.add(dto);
return;
}
if (i == 0) {
OrderChildTruckTraceDTO dto = new OrderChildTruckTraceDTO();
GdPosDTO gdPosDTO = gdRouteDTO.getPosList().get(i);
BigDecimal longitude = gdPosDTO.getLongitude();
BigDecimal latitude = gdPosDTO.getLatitude();
String address = gdService.getLonLat(longitude + "," + latitude);
dto.setLocationAddress(address);
dto.setLocationTime(LocalDateTime.now().toString());
dto.setLocationLon(longitude.toString());
dto.setLocationLat(latitude.toString());
list.add(dto);
} else {
OrderChildTruckTraceDTO dto = new OrderChildTruckTraceDTO();
int randomNum = (int) (Math.random() * (gdRouteDTO.getPosList().size() - 1) + 1);
GdPosDTO gdPosDTO = gdRouteDTO.getPosList().get(randomNum);
BigDecimal longitude = gdPosDTO.getLongitude();
BigDecimal latitude = gdPosDTO.getLatitude();
String address = gdService.getLonLat(longitude + "," + latitude);
dto.setLocationAddress(address);
dto.setLocationTime(LocalDateTime.now().toString());
dto.setLocationLon(longitude.toString());
dto.setLocationLat(latitude.toString());
list.add(dto);
}
}
param.setBrokerTraceList(list);
}
}
...@@ -2,11 +2,18 @@ package com.clx.performance.service.impl.settle; ...@@ -2,11 +2,18 @@ package com.clx.performance.service.impl.settle;
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.component.IdGenerateSnowFlake;
import com.clx.performance.dao.OwnerAccountDao;
import com.clx.performance.dao.OwnerRunningWaterRecordDao;
import com.clx.performance.dao.settle.SettlementOwnerDetailDao; import com.clx.performance.dao.settle.SettlementOwnerDetailDao;
import com.clx.performance.enums.IdTypeEnum;
import com.clx.performance.enums.OwnerAccountEnum;
import com.clx.performance.enums.settle.SettlementOwnerDetailEnum; import com.clx.performance.enums.settle.SettlementOwnerDetailEnum;
import com.clx.performance.enums.settle.SettlementWayEnum; import com.clx.performance.enums.settle.SettlementWayEnum;
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.model.OwnerAccount;
import com.clx.performance.model.OwnerRunningWaterRecord;
import com.clx.performance.model.settle.SettlementOwnerDetail; import com.clx.performance.model.settle.SettlementOwnerDetail;
import com.clx.performance.param.pc.owner.PageCarrierSettlementOwnerDetailParam; import com.clx.performance.param.pc.owner.PageCarrierSettlementOwnerDetailParam;
import com.clx.performance.param.pc.owner.PageOwnerSettlementOwnerDetailParam; import com.clx.performance.param.pc.owner.PageOwnerSettlementOwnerDetailParam;
...@@ -42,6 +49,9 @@ public class SettlementOwnerDetailServiceImpl implements SettlementOwnerDetailS ...@@ -42,6 +49,9 @@ public class SettlementOwnerDetailServiceImpl implements SettlementOwnerDetailS
private final SettlementOwnerDetailDao settlementOwnerDetailDao; private final SettlementOwnerDetailDao settlementOwnerDetailDao;
private final SettlementOwnerDetailStruct settlementOwnerDetailStruct; private final SettlementOwnerDetailStruct settlementOwnerDetailStruct;
private final IdGenerateSnowFlake idGenerateSnowFlake;
private final OwnerRunningWaterRecordDao ownerRunningWaterRecordDao;
private final OwnerAccountDao ownerAccountDao;
@Override @Override
...@@ -76,7 +86,50 @@ public class SettlementOwnerDetailServiceImpl implements SettlementOwnerDetailS ...@@ -76,7 +86,50 @@ public class SettlementOwnerDetailServiceImpl implements SettlementOwnerDetailS
settlementOwnerDetail.setLossFreight(lossFreightCalc(settlementOwnerDetail.getLossPrice(), settlementOwnerDetail.getLossWeight())); settlementOwnerDetail.setLossFreight(lossFreightCalc(settlementOwnerDetail.getLossPrice(), settlementOwnerDetail.getLossWeight()));
// 预付运费 // 预付运费
BigDecimal ans = settlementOwnerDetail.getFreight().subtract(settlementOwnerDetail.getLossFreight());
if (ans.compareTo(BigDecimal.ZERO) <= 0) {
settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO); settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO);
} else {
List<OwnerRunningWaterRecord> runningWaterRecordList = ownerRunningWaterRecordDao.getOwnerRunningWaterRecord(orderChild.getOrderNo());
BigDecimal frozen = runningWaterRecordList.stream().filter(item -> {
return item.getRunningWaterType().equals(OwnerAccountEnum.RunningWaterStatus.FROZEN.getCode());
}).map(OwnerRunningWaterRecord::getAlterationBalance).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal takeOut = runningWaterRecordList.stream().filter(item -> {
return item.getRunningWaterType().equals(OwnerAccountEnum.RunningWaterStatus.TAKE_OUT.getCode());
}).map(OwnerRunningWaterRecord::getAlterationBalance).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal subtract = frozen.subtract(takeOut);
if (subtract.compareTo(BigDecimal.ZERO) <= 0) {
settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO);
}
if (subtract.subtract(ans).compareTo(BigDecimal.ZERO) >= 0) {
OwnerAccount account = ownerAccountDao.getAccountByOwnerUserNoAndAccountType(orderChild.getOwnerUserNo(),
OwnerAccountEnum.AccountTypeStatus.PREPAID_FREIGHT_ACCOUNT.getCode());
settlementOwnerDetail.setPrepayFreight(ans);
OwnerRunningWaterRecord runningWaterRecord = new OwnerRunningWaterRecord();
runningWaterRecord.setOwnerUserName(orderChild.getOwnerName());
runningWaterRecord.setMobile(orderChild.getDriverMobile());
runningWaterRecord.setCreateBy("系统");
runningWaterRecord.setOrderId(orderChild.getId());
runningWaterRecord.setOrderNo(orderChild.getOrderNo());
runningWaterRecord.setRelationId(null);
runningWaterRecord.setAlterationBalance(ans);
runningWaterRecord.setFrozenBalance(ans);
runningWaterRecord.setUsableBalance(account.getUsableBalance());
runningWaterRecord.setTakeOutBalance(BigDecimal.ZERO);
runningWaterRecord.setAccountBalance(account.getAccountBalance());
runningWaterRecord.setOwnerUserNo(account.getOwnerUserNo());
runningWaterRecord.setAccountType(OwnerAccountEnum.AccountTypeStatus.PREPAID_FREIGHT_ACCOUNT.getCode());
runningWaterRecord.setRunningWaterType(OwnerAccountEnum.RunningWaterStatus.TAKE_OUT.getCode());
runningWaterRecord.setRunningWaterNo(idGenerateSnowFlake.nextId(IdTypeEnum.Type.TAKE_OUT.getCode()));
ownerRunningWaterRecordDao.saveEntity(runningWaterRecord);
} else {
settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO);
}
}
// 开票金额 // 开票金额
settlementOwnerDetail.setInvoiceFreight(invoiceFreightCalc(orderGoods.getSettlementWay(),settlementOwnerDetail)); settlementOwnerDetail.setInvoiceFreight(invoiceFreightCalc(orderGoods.getSettlementWay(),settlementOwnerDetail));
......
package com.clx.performance.service.impl.settle; package com.clx.performance.service.impl.settle;
import com.clx.performance.dao.OrderChildDao; import com.clx.performance.dao.OrderChildDao;
import com.clx.performance.dao.OrderGoodsDao;
import com.clx.performance.dao.settle.SettlementDriverDetailDao; import com.clx.performance.dao.settle.SettlementDriverDetailDao;
import com.clx.performance.dao.settle.SettlementOwnerDetailDao; import com.clx.performance.dao.settle.SettlementOwnerDetailDao;
import com.clx.performance.enums.PerformanceResultEnum; import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.enums.settle.SettlementOwnerEnum; import com.clx.performance.enums.settle.SettlementOwnerEnum;
import com.clx.performance.feign.TransportFeignService;
import com.clx.performance.model.OrderChild; import com.clx.performance.model.OrderChild;
import com.clx.performance.model.OrderGoods;
import com.clx.performance.model.settle.SettlementDriverDetail; import com.clx.performance.model.settle.SettlementDriverDetail;
import com.clx.performance.model.settle.SettlementOwnerDetail; import com.clx.performance.model.settle.SettlementOwnerDetail;
import com.clx.performance.param.feign.transport.ThirdOrderChildBrokerParam;
import com.clx.performance.service.TransportSyncService;
import com.clx.performance.service.settle.SettlementMqService; import com.clx.performance.service.settle.SettlementMqService;
import com.clx.performance.service.settle.SettlementService; import com.clx.performance.service.settle.SettlementService;
import com.clx.performance.vo.feign.transport.ThirdOrderChildBrokerResultVO;
import com.msl.common.result.Result;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -31,6 +38,13 @@ public class SettlementServiceImpl implements SettlementService { ...@@ -31,6 +38,13 @@ public class SettlementServiceImpl implements SettlementService {
private SettlementDriverDetailDao settlementDriverDetailDao; private SettlementDriverDetailDao settlementDriverDetailDao;
@Autowired @Autowired
private SettlementMqService settlementMqService; private SettlementMqService settlementMqService;
@Autowired
private TransportSyncService transportSyncService;
@Autowired
private OrderGoodsDao orderGoodsDao;
@Autowired
private TransportFeignService transportFeignService;
@Override @Override
...@@ -42,9 +56,25 @@ public class SettlementServiceImpl implements SettlementService { ...@@ -42,9 +56,25 @@ public class SettlementServiceImpl implements SettlementService {
if (settlementOwnerDetail.getInvoiceType() != null) {return;} if (settlementOwnerDetail.getInvoiceType() != null) {return;}
// 结算金额<0走普通单 //设置司机预付运费标示
if (settlementDriverDetail.getSettlementFreight().compareTo(BigDecimal.ZERO) < 0){ if (settlementOwnerDetail.getPrepayFreight().compareTo(BigDecimal.ZERO) > 0) {
settlementDriverDetail.setPrepayFreightFlag(1);
} else {
settlementDriverDetail.setPrepayFreightFlag(0);
}
// 货主结算金额<0走普通单
if (settlementOwnerDetail.getSettlementFreight().compareTo(BigDecimal.ZERO) < 0){
invoiceType = SettlementOwnerEnum.InvoiceType.ORDINARY.getCode(); invoiceType = SettlementOwnerEnum.InvoiceType.ORDINARY.getCode();
settlementDriverDetail.setPrepayFreightFlag(0);
} else {
OrderGoods orderGoods = orderGoodsDao.getByOrderGoodsNo(orderChild.getOrderGoodsNo()).get();
//是否通过风控,调用网络货运
ThirdOrderChildBrokerParam param = transportSyncService.generateOrderChildSync(orderChild, orderGoods, settlementOwnerDetail);
Result<ThirdOrderChildBrokerResultVO> result = transportFeignService.orderChildSync(param);
System.out.println(result);
if (SettlementOwnerEnum.InvoiceType.ONLINE.getCode().equals(invoiceType) && settlementOwnerDetail.getPrepayFreight().compareTo(BigDecimal.ZERO) > 0) {
settlementDriverDetail.setPrepayFreightFlag(1);
}
} }
settlementOwnerDetail.setInvoiceType(invoiceType); settlementOwnerDetail.setInvoiceType(invoiceType);
...@@ -57,7 +87,7 @@ public class SettlementServiceImpl implements SettlementService { ...@@ -57,7 +87,7 @@ public class SettlementServiceImpl implements SettlementService {
} }
settlementOwnerDetailDao.updateInvoiceType(settlementOwnerDetail); settlementOwnerDetailDao.updateInvoiceType(settlementOwnerDetail);
settlementDriverDetailDao.updateInvoiceType(settlementDriverDetail); settlementDriverDetailDao.updateInvoiceTypeAndPrepayFreightFlag(settlementDriverDetail);
// 发送mq 通过开票标识 // 发送mq 通过开票标识
settlementMqService.invoiceTypeSync(childNo, invoiceType); settlementMqService.invoiceTypeSync(childNo, invoiceType);
......
package com.clx.performance; package com.clx.performance;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil;
import com.clx.message.feign.ClxMessageOpenapiFeign;
import com.clx.message.req.message.AliSmsMessageReq;
import com.clx.order.feign.OrderFeign; import com.clx.order.feign.OrderFeign;
import com.clx.order.vo.feign.OrderOwnTruckVo;
import com.clx.performance.component.GoodsOrderTruckRecordComponent; import com.clx.performance.component.GoodsOrderTruckRecordComponent;
import com.clx.performance.component.OrderGoodsStatusLazyComponent; import com.clx.performance.component.OrderGoodsStatusLazyComponent;
import com.clx.performance.config.ClxMessageConfig; import com.clx.performance.constant.RabbitKeyConstants;
import com.clx.performance.constant.RedisConstants;
import com.clx.performance.dao.LargeScreenAddressRouteDao;
import com.clx.performance.dao.OrderGoodsDao; import com.clx.performance.dao.OrderGoodsDao;
import com.clx.performance.service.LargeScreenService; import com.clx.performance.feign.TransportFeignService;
import com.clx.performance.model.OrderChild;
import com.clx.performance.model.OrderGoods;
import com.clx.performance.param.feign.transport.ThirdOrderChildBrokerParam;
import com.clx.performance.param.mq.OrderCancelMqParam;
import com.clx.performance.service.OrderCancelService; import com.clx.performance.service.OrderCancelService;
import com.clx.performance.service.OwnerAccountService; import com.clx.performance.vo.feign.transport.ThirdOrderChildBrokerResultVO;
import com.clx.user.feign.TruckFeign;
import com.msl.common.result.Result; import com.msl.common.result.Result;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageBuilder;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
@SpringBootTest @SpringBootTest
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
public class JobTest { public class JobTest {
...@@ -49,39 +57,35 @@ public class JobTest { ...@@ -49,39 +57,35 @@ public class JobTest {
private OrderCancelService orderCancelService; private OrderCancelService orderCancelService;
@Autowired @Autowired
private LargeScreenService largeScreenService; private TransportFeignService transportFeignService;
@Autowired
private LargeScreenAddressRouteDao largeScreenAddressRouteDao;
@Autowired
private OwnerAccountService ownerAccountService;
@Autowired
private ClxMessageOpenapiFeign clxMessageOpenapiFeign;
@Autowired
private ClxMessageConfig config;
@Autowired
private RedisTemplate<String,String> redisTemplate;
@Test @Test
public void test1() { public void test1() {
AliSmsMessageReq req = new AliSmsMessageReq(); // OrderCancelMqParam mqParam = new OrderCancelMqParam();
req.setTemplateCode(config.getCaptchaTemplateCode()); // mqParam.setType("2");
JSONObject jsonObject = new JSONObject(); // mqParam.setOrderNo("123");
jsonObject.set("code", "222"); // Message message = MessageBuilder.withBody(JSONUtil.parse(mqParam).toString().getBytes()).build();
jsonObject.set("time", "12"); // rabbitTemplate.send(
req.setChannelId(41); // RabbitKeyConstants.ORDER_CANCEL_EXCHANGE, RabbitKeyConstants.ORDER_CANCEL_ROUTE_KEY, message
req.setAppId("7134802354519449600"); // );
req.setMobile("17610126377");
req.setContent(jsonObject.toString()); //orderCancelService.ownerCancelOrderPre("PT2023102700473");
req.setExpire(300L); //orderCancelService.ownerCancelOrder("PT2023102600466");
Result<String> stringResult = clxMessageOpenapiFeign.sendAliSms(req); OrderChild orderChild = new OrderChild();
System.out.println(stringResult); OrderGoods orderGoods = new OrderGoods();
String content = redisTemplate.opsForValue().get(RedisConstants.MESSAGE_MOBILE_CAPTCHA + "17610126377"); ThirdOrderChildBrokerParam param = new ThirdOrderChildBrokerParam();
System.out.println(content); param.setOrderNo(orderChild.getOrderNo());
param.setChildNo(orderChild.getChildNo());
param.setTruckNo(orderChild.getTruckNo());
param.setFreightPrice(Integer.valueOf(orderChild.getFreightPrice().toString()));
param.setFreight(Integer.valueOf(orderChild.getFreight().toString()));
param.setSendAddress(orderGoods.getSendAddressShorter());
//缺省市区
param.setSendName(orderGoods.getUserName());
Result<ThirdOrderChildBrokerResultVO> thirdOrderChildBrokerResultVOResult = transportFeignService.orderChildSync(param);
System.out.println(thirdOrderChildBrokerResultVOResult);
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论