Commit 475b761d authored by zhangzc's avatar zhangzc

添加车辆controller

parent 1a852660
...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping;
/** /**
* @description: * @description:
* @project: Freight * @project: freight-app-service
* @name: com.esv.freight.app.feign.DriverInterface * @name: com.esv.freight.app.feign.DriverInterface
* @author: 张志臣 * @author: 张志臣
* @email: zhangzhichen@esvtek.com * @email: zhangzhichen@esvtek.com
......
...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping;
/** /**
* @description: * @description:
* @project: Freight * @project: freight-app-service
* @name: com.esv.freight.app.feign.DeliveryAddressInterface * @name: com.esv.freight.app.feign.DeliveryAddressInterface
* @author: 张志臣 * @author: 张志臣
* @email: zhangzhichen@esvtek.com * @email: zhangzhichen@esvtek.com
......
...@@ -6,10 +6,10 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -6,10 +6,10 @@ import org.springframework.web.bind.annotation.PostMapping;
/** /**
* @description: * @description:
* @project: Freight * @project: freight-app-service
* @name: com.esv.freight.app.feign.NoticeInterface * @name: com.esv.freight.app.feign.DictInterface
* @author: 黄朝斌 * @author: 张志臣
* @email: huangchaobin@esvtek.com * @email: zhangzhichen@esvtek.com
* @createTime: 2020/04/13 13:48 * @createTime: 2020/04/13 13:48
* @version:1.0 * @version:1.0
*/ */
......
...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping;
/** /**
* @description: * @description:
* @project: Freight * @project: freight-app-service
* @name: com.esv.freight.app.feign.DriverInterface * @name: com.esv.freight.app.feign.DriverInterface
* @author: 张志臣 * @author: 张志臣
* @email: zhangzhichen@esvtek.com * @email: zhangzhichen@esvtek.com
......
package com.esv.freight.app.feign;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
/**
* @description:
* @project: freight-app-service
* @name: com.esv.freight.app.feign.DriverVehicleInterface
* @author: 张志臣
* @email: zhangzhichen@esvtek.com
* @createTime: 2020/05/06 20:00
* @version:1.0
*/
@FeignClient(value = "freight-customer-service")
public interface DriverVehicleInterface {
/**
* 获取司机的车辆列表
* @param bodyJson
* @return
*/
@PostMapping(value = "customer/carrier/driver/vehicle/listByDriver")
JSONObject listByDriver(JSONObject bodyJson);
}
...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping;
/** /**
* @description: * @description:
* @project: Freight * @project: freight-app-service
* @name: com.esv.freight.app.feign.FileInterface * @name: com.esv.freight.app.feign.FileInterface
* @author: 张志臣 * @author: 张志臣
* @email: zhangzhichen@esvtek.com * @email: zhangzhichen@esvtek.com
......
...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping;
/** /**
* @description: * @description:
* @project: Freight * @project: freight-app-service
* @name: com.esv.freight.app.feign.GoodsOwnerInterface * @name: com.esv.freight.app.feign.GoodsOwnerInterface
* @author: 张志臣 * @author: 张志臣
* @email: zhangzhichen@esvtek.com * @email: zhangzhichen@esvtek.com
......
...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping;
/** /**
* @description: * @description:
* @project: Freight * @project: freight-app-service
* @name: com.esv.freight.app.feign.NoticeInterface * @name: com.esv.freight.app.feign.NoticeInterface
* @author: 张志臣 * @author: 张志臣
* @email: zhangzhichen@esvtek.com * @email: zhangzhichen@esvtek.com
......
...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping;
/** /**
* @description: * @description:
* @project: Freight * @project: freight-app-service
* @name: com.esv.freight.app.feign.ReceiveAddressInterface * @name: com.esv.freight.app.feign.ReceiveAddressInterface
* @author: 张志臣 * @author: 张志臣
* @email: zhangzhichen@esvtek.com * @email: zhangzhichen@esvtek.com
......
...@@ -5,7 +5,7 @@ import org.springframework.cloud.openfeign.FeignClient; ...@@ -5,7 +5,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
/** /**
* @description: * @description:
* @project: Freight * @project: freight-app-service
* @name: com.esv.freight.app.feign.TmsGrabInterface * @name: com.esv.freight.app.feign.TmsGrabInterface
* @author: 张志臣 * @author: 张志臣
* @email: zhangzhichen@esvtek.com * @email: zhangzhichen@esvtek.com
......
...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping;
/** /**
* @description: * @description:
* @project: Freight * @project: freight-app-service
* @name: com.esv.freight.app.feign.TmsOrderInterface * @name: com.esv.freight.app.feign.TmsOrderInterface
* @author: 张志臣 * @author: 张志臣
* @email: zhangzhichen@esvtek.com * @email: zhangzhichen@esvtek.com
......
...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping;
/** /**
* @description: * @description:
* @project: Freight * @project: freight-app-service
* @name: com.esv.freight.app.feign.TmsWaybillInterface * @name: com.esv.freight.app.feign.TmsWaybillInterface
* @author: 张志臣 * @author: 张志臣
* @email: zhangzhichen@esvtek.com * @email: zhangzhichen@esvtek.com
......
...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping;
/** /**
* @description: * @description:
* @project: Freight * @project: freight-app-service
* @name: com.esv.freight.app.feign.VehicleInterface * @name: com.esv.freight.app.feign.VehicleInterface
* @author: 张志臣 * @author: 张志臣
* @email: zhangzhichen@esvtek.com * @email: zhangzhichen@esvtek.com
......
...@@ -6,6 +6,7 @@ import com.esv.freight.app.common.response.ECode; ...@@ -6,6 +6,7 @@ import com.esv.freight.app.common.response.ECode;
import com.esv.freight.app.common.response.EResponse; import com.esv.freight.app.common.response.EResponse;
import com.esv.freight.app.common.util.ReqUtils; import com.esv.freight.app.common.util.ReqUtils;
import com.esv.freight.app.common.validator.groups.ValidatorInsert; import com.esv.freight.app.common.validator.groups.ValidatorInsert;
import com.esv.freight.app.common.validator.groups.ValidatorUpdate;
import com.esv.freight.app.feign.CarrierInterface; import com.esv.freight.app.feign.CarrierInterface;
import com.esv.freight.app.feign.DriverInterface; import com.esv.freight.app.feign.DriverInterface;
import com.esv.freight.app.feign.NoticeInterface; import com.esv.freight.app.feign.NoticeInterface;
...@@ -249,16 +250,34 @@ public class DriverAccountController { ...@@ -249,16 +250,34 @@ public class DriverAccountController {
* createTime 2020/04/13 10:00 * createTime 2020/04/13 10:00
**/ **/
@PostMapping("/realNameAuth") @PostMapping("/realNameAuth")
public EResponse realNameAuth(@RequestBody(required=false) @Validated(ValidatorInsert.class) DriverAuthForm driverAuthForm) { public EResponse realNameAuth(@RequestBody(required=false) @Validated(ValidatorUpdate.class) DriverAuthForm driverAuthForm) {
appLoginService.checkAccessToken(); appLoginService.checkAccessToken();
// 调用编辑帐号信息接口 // 调用编辑帐号信息接口
JSONObject reqJson = new JSONObject(); JSONObject reqJson = new JSONObject();
reqJson.put("id", driverAuthForm.getId()); reqJson.put("id", driverAuthForm.getId());
reqJson.put("name", driverAuthForm.getName());
reqJson.put("idCard", driverAuthForm.getIdCard());
reqJson.put("idCardExpireDate", driverAuthForm.getIdCardExpireDate());
reqJson.put("provinceCode", driverAuthForm.getProvinceCode());
reqJson.put("cityCode", driverAuthForm.getCityCode());
reqJson.put("districtCode", driverAuthForm.getDistrictCode());
reqJson.put("detailAddress", driverAuthForm.getDetailAddress());
reqJson.put("settlementType", driverAuthForm.getSettlementType());
reqJson.put("drivingLicense", driverAuthForm.getDrivingLicense());
reqJson.put("drivingLicenseType", driverAuthForm.getDrivingLicenseType());
reqJson.put("drivingLicenseStartDate", driverAuthForm.getDrivingLicenseStartDate());
reqJson.put("drivingLicenseEndDate", driverAuthForm.getDrivingLicenseEndDate());
reqJson.put("drivingLicenseIssueDepartment", driverAuthForm.getDrivingLicenseIssueDepartment());
reqJson.put("certificateVehicle", driverAuthForm.getCertificateVehicle());
reqJson.put("certificateEndDate", driverAuthForm.getCertificateEndDate());
reqJson.put("certificateNumber", driverAuthForm.getCertificateNumber());
reqJson.put("certificateUrl", driverAuthForm.getCertificateUrl());
reqJson.put("drivingLicenseUrl", driverAuthForm.getDrivingLicenseUrl());
reqJson.put("idCardFrontUrl", driverAuthForm.getIdCardFrontUrl());
reqJson.put("idCardBackUrl", driverAuthForm.getIdCardBackUrl());
log.info(reqJson.toJSONString());
JSONObject result = driverInterface.edit(reqJson); JSONObject result = driverInterface.edit(reqJson);
log.info(result.toJSONString());
if(result.getInteger("code") != 200) { if(result.getInteger("code") != 200) {
return EResponse.error(result.getInteger("code"), result.getString("message")); return EResponse.error(result.getInteger("code"), result.getString("message"));
......
...@@ -2,6 +2,7 @@ package com.esv.freight.app.module.account.controller; ...@@ -2,6 +2,7 @@ package com.esv.freight.app.module.account.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.esv.freight.app.common.util.ReqUtils; import com.esv.freight.app.common.util.ReqUtils;
import com.esv.freight.app.common.validator.groups.ValidatorUpdate;
import com.esv.freight.app.feign.GoodsOwnerInterface; import com.esv.freight.app.feign.GoodsOwnerInterface;
import com.esv.freight.app.feign.NoticeInterface; import com.esv.freight.app.feign.NoticeInterface;
import com.esv.freight.app.module.account.CustomToken; import com.esv.freight.app.module.account.CustomToken;
...@@ -192,7 +193,7 @@ public class OwnerAccountController { ...@@ -192,7 +193,7 @@ public class OwnerAccountController {
* createTime 2020/04/13 10:00 * createTime 2020/04/13 10:00
**/ **/
@PostMapping("/realNameAuth") @PostMapping("/realNameAuth")
public EResponse realNameAuth(@RequestBody(required=false) @Validated(ValidatorInsert.class) OwnerAuthForm ownerAuthForm) { public EResponse realNameAuth(@RequestBody(required=false) @Validated(ValidatorUpdate.class) OwnerAuthForm ownerAuthForm) {
appLoginService.checkAccessToken(); appLoginService.checkAccessToken();
......
...@@ -2,7 +2,12 @@ package com.esv.freight.app.module.account.form; ...@@ -2,7 +2,12 @@ package com.esv.freight.app.module.account.form;
import com.esv.freight.app.common.validator.groups.ValidatorUpdate; import com.esv.freight.app.common.validator.groups.ValidatorUpdate;
import lombok.Data; import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
/** /**
...@@ -22,4 +27,143 @@ public class DriverAuthForm { ...@@ -22,4 +27,143 @@ public class DriverAuthForm {
*/ */
@NotNull(message = "参数id不能为空", groups = {ValidatorUpdate.class}) @NotNull(message = "参数id不能为空", groups = {ValidatorUpdate.class})
private Long id; private Long id;
/**
* 姓名
*/
@Length(max = 20, message = "参数name长度不合法", groups = {ValidatorUpdate.class})
@NotBlank(message = "参数name不能为空", groups = {ValidatorUpdate.class})
private String name;
/**
* 身份证号码
*/
@Length(min = 18, max = 18, message = "参数idCard长度不合法", groups = {ValidatorUpdate.class})
@NotBlank(message = "参数idCard不能为空", groups = {ValidatorUpdate.class})
private String idCard;
/**
* 身份证有效期,格式yyyy.MM.dd,或长期
*/
@Length(max = 50, message = "参数idCardExpireDate长度不合法", groups = {ValidatorUpdate.class})
private String idCardExpireDate;
/**
* 省份代码
*/
@Length(min = 6, max = 6, message = "参数provinceCode长度不合法", groups = {ValidatorUpdate.class})
@NotBlank(message = "参数provinceCode不能为空", groups = {ValidatorUpdate.class})
private String provinceCode;
/**
* 市代码
*/
@Length(min = 6, max = 6, message = "参数cityCode长度不合法", groups = {ValidatorUpdate.class})
@NotBlank(message = "参数cityCode不能为空", groups = {ValidatorUpdate.class})
private String cityCode;
/**
* 区县代码
*/
@Length(min = 6, max = 6, message = "参数districtCode长度不合法", groups = {ValidatorUpdate.class})
@NotBlank(message = "参数districtCode不能为空", groups = {ValidatorUpdate.class})
private String districtCode;
/**
* 详细地址
*/
@Length(max = 100, message = "参数detailAddress长度不合法", groups = {ValidatorUpdate.class})
@NotBlank(message = "参数detailAddress不能为空", groups = {ValidatorUpdate.class})
private String detailAddress;
/**
* 结算对象(字典表):1-个人、2-所属承运商
*/
@Range(min = 1, max = 2, message = "参数settlementType不合法", groups = {ValidatorUpdate.class})
@NotNull(message = "参数settlementType不能为空", groups = {ValidatorUpdate.class})
private Integer settlementType;
/**
* 驾驶证号码
*/
@Length(max = 20, message = "参数drivingLicense长度不合法", groups = {ValidatorUpdate.class})
@NotBlank(message = "参数drivingLicense不能为空", groups = {ValidatorUpdate.class})
private String drivingLicense;
/**
* 驾驶证类型(字典表):1-A1、2-A2、3-A3、4-A1A2、5-A2E、6-A2D、7-B1、8-B2、9-C1、0-其他
*/
@Range(min = 0, max = 9, message = "参数drivingLicenseType不合法", groups = {ValidatorUpdate.class})
@NotNull(message = "参数drivingLicenseType不能为空", groups = {ValidatorUpdate.class})
private Integer drivingLicenseType;
/**
* 驾驶证有效期起
*/
@Length(max = 20, message = "参数drivingLicenseStartDate长度不合法", groups = {ValidatorUpdate.class})
private String drivingLicenseStartDate;
/**
* 驾驶证有效期止
*/
@Length(max = 20, message = "参数drivingLicenseEndDate长度不合法", groups = {ValidatorUpdate.class})
private String drivingLicenseEndDate;
/**
* 发证机关
*/
@Length(max = 50, message = "参数drivingLicenseIssueDepartment长度不合法", groups = {ValidatorUpdate.class})
private String drivingLicenseIssueDepartment;
/**
* 道路运输从业资格证-所驾驶车辆(字典表):1-4.5吨及以下、2-4.5吨以上
*/
@Range(min = 1, max = 2, message = "参数certificateVehicle不合法", groups = {ValidatorUpdate.class})
@NotNull(message = "参数certificateVehicle不能为空", groups = {ValidatorUpdate.class})
private Integer certificateVehicle;
/**
* 道路运输从业资格证-有效期止
*/
@Length(max = 20, message = "参数certificateEndDate长度不合法", groups = {ValidatorUpdate.class})
private String certificateEndDate;
/**
* 道路运输从业资格证-从业资格证号
*/
@Length(max = 20, message = "参数certificateNumber长度不合法", groups = {ValidatorUpdate.class})
@NotBlank(message = "参数drivingLicenseType不能为空", groups = {ValidatorUpdate.class})
private String certificateNumber;
/**
* 道路运输从业资格证-正面图片URL
*/
@Length(max = 200, message = "参数certificateUrl长度不合法", groups = {ValidatorUpdate.class})
private String certificateUrl;
/**
* 驾驶证正面图片URL
*/
@Length(max = 200, message = "参数drivingLicenseUrl长度不合法", groups = {ValidatorUpdate.class})
@NotBlank(message = "参数drivingLicenseUrl不能为空", groups = {ValidatorUpdate.class})
private String drivingLicenseUrl;
/**
* 身份证正面图片URL
*/
@Length(max = 200, message = "参数idCardFrontUrl长度不合法", groups = {ValidatorUpdate.class})
@NotBlank(message = "参数idCardFrontUrl不能为空", groups = {ValidatorUpdate.class})
private String idCardFrontUrl;
/**
* 身份证背面图片URL
*/
@Length(max = 200, message = "参数idCardBackUrl长度不合法", groups = {ValidatorUpdate.class})
@NotBlank(message = "参数idCardBackUrl不能为空", groups = {ValidatorUpdate.class})
private String idCardBackUrl;
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
}
} }
...@@ -33,116 +33,116 @@ public class OwnerAuthForm { ...@@ -33,116 +33,116 @@ public class OwnerAuthForm {
/** /**
* 货主类型:1-个人、2-企业 * 货主类型:1-个人、2-企业
*/ */
@Pattern(regexp = "[12]", message = "参数ownerType不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @Pattern(regexp = "[12]", message = "参数ownerType不合法", groups = {ValidatorUpdate.class})
@NotBlank(message = "参数ownerType不能为空", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @NotBlank(message = "参数ownerType不能为空", groups = {ValidatorUpdate.class})
private String ownerType; private String ownerType;
/** /**
* 身份证正面图片数据 * 身份证正面图片数据
*/ */
@NotBlank(message = "参数idCardFileFront不能为空", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @NotBlank(message = "参数idCardFileFront不能为空", groups = {ValidatorUpdate.class})
private String idCardFileFrontUrl; private String idCardFileFrontUrl;
/** /**
* 身份证背面图片数据 * 身份证背面图片数据
*/ */
@NotBlank(message = "参数idCardFileBack不能为空", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @NotBlank(message = "参数idCardFileBack不能为空", groups = {ValidatorUpdate.class})
private String idCardFileBackUrl; private String idCardFileBackUrl;
/** /**
* 姓名 * 姓名
*/ */
@Length(max = 20, message = "参数name长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @Length(max = 20, message = "参数name长度不合法", groups = {ValidatorUpdate.class})
@NotBlank(message = "参数name不能为空", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @NotBlank(message = "参数name不能为空", groups = {ValidatorUpdate.class})
private String name; private String name;
/** /**
* 身份证号码 * 身份证号码
*/ */
@Length(min = 18, max = 18, message = "参数idCard长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @Length(min = 18, max = 18, message = "参数idCard长度不合法", groups = {ValidatorUpdate.class})
@NotBlank(message = "参数idCard不能为空", groups = {ValidatorInsert.class}) @NotBlank(message = "参数idCard不能为空", groups = {ValidatorUpdate.class})
private String idCard; private String idCard;
/** /**
* 身份证有效期,格式yyyy.MM.dd,或长期 * 身份证有效期,格式yyyy.MM.dd,或长期
*/ */
@Length(max = 50, message = "参数idCardExpireDate长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @Length(max = 50, message = "参数idCardExpireDate长度不合法", groups = {ValidatorUpdate.class})
private String idCardExpireDate; private String idCardExpireDate;
/** /**
* 省份代码 * 省份代码
*/ */
@Length(min = 6, max = 6, message = "参数provinceCode长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @Length(min = 6, max = 6, message = "参数provinceCode长度不合法", groups = {ValidatorUpdate.class})
@NotBlank(message = "参数provinceCode不能为空", groups = {ValidatorInsert.class}) @NotBlank(message = "参数provinceCode不能为空", groups = {ValidatorUpdate.class})
private String provinceCode; private String provinceCode;
/** /**
* 市代码 * 市代码
*/ */
@Length(min = 6, max = 6, message = "参数cityCode长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @Length(min = 6, max = 6, message = "参数cityCode长度不合法", groups = {ValidatorUpdate.class})
@NotBlank(message = "参数cityCode不能为空", groups = {ValidatorInsert.class}) @NotBlank(message = "参数cityCode不能为空", groups = {ValidatorUpdate.class})
private String cityCode; private String cityCode;
/** /**
* 区县代码 * 区县代码
*/ */
@Length(min = 6, max = 6, message = "参数districtCode长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @Length(min = 6, max = 6, message = "参数districtCode长度不合法", groups = {ValidatorUpdate.class})
@NotBlank(message = "参数districtCode不能为空", groups = {ValidatorInsert.class}) @NotBlank(message = "参数districtCode不能为空", groups = {ValidatorUpdate.class})
private String districtCode; private String districtCode;
/** /**
* 详细地址 * 详细地址
*/ */
@Length(max = 100, message = "参数detailAddress长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @Length(max = 100, message = "参数detailAddress长度不合法", groups = {ValidatorUpdate.class})
@NotBlank(message = "参数detailAddress不能为空", groups = {ValidatorInsert.class}) @NotBlank(message = "参数detailAddress不能为空", groups = {ValidatorUpdate.class})
private String detailAddress; private String detailAddress;
/** /**
* 客户名称 * 客户名称
*/ */
@Length(max = 50, message = "参数ownerFullName长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @Length(max = 50, message = "参数ownerFullName长度不合法", groups = {ValidatorUpdate.class})
private String ownerFullName; private String ownerFullName;
/** /**
* 客户简称 * 客户简称
*/ */
@Length(max = 50, message = "参数ownerBriefName长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @Length(max = 50, message = "参数ownerBriefName长度不合法", groups = {ValidatorUpdate.class})
private String ownerBriefName; private String ownerBriefName;
/** /**
* 统一社会信用代码 * 统一社会信用代码
*/ */
@Length(max = 20, message = "参数uniCreditCode长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @Length(max = 20, message = "参数uniCreditCode长度不合法", groups = {ValidatorUpdate.class})
private String uniCreditCode; private String uniCreditCode;
/** /**
* 营业期限 * 营业期限
*/ */
@Length(max = 50, message = "参数creditExpireDate长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @Length(max = 50, message = "参数creditExpireDate长度不合法", groups = {ValidatorUpdate.class})
private String creditExpireDate; private String creditExpireDate;
/** /**
* 营业执照正本ULR * 营业执照正本ULR
*/ */
@Length(max = 200, message = "参数creditOriginalUrl长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @Length(max = 200, message = "参数creditOriginalUrl长度不合法", groups = {ValidatorUpdate.class})
private String creditOriginalUrl; private String creditOriginalUrl;
/** /**
* 营业执照副本ULR * 营业执照副本ULR
*/ */
@Length(max = 200, message = "参数creditCopyUrl长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @Length(max = 200, message = "参数creditCopyUrl长度不合法", groups = {ValidatorUpdate.class})
private String creditCopyUrl; private String creditCopyUrl;
/** /**
* 企业法人姓名 * 企业法人姓名
*/ */
@Length(max = 20, message = "参数legalPerson长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @Length(max = 20, message = "参数legalPerson长度不合法", groups = {ValidatorUpdate.class})
private String legalPerson; private String legalPerson;
/** /**
* 企业法人手机号 * 企业法人手机号
*/ */
@Length(max = 20, message = "参数legalPhone长度不合法", groups = {ValidatorInsert.class, ValidatorUpdate.class}) @Length(max = 20, message = "参数legalPhone长度不合法", groups = {ValidatorUpdate.class})
private String legalPhone; private String legalPhone;
@Override @Override
......
...@@ -2,18 +2,16 @@ package com.esv.freight.app.module.vehicle.controller; ...@@ -2,18 +2,16 @@ package com.esv.freight.app.module.vehicle.controller;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.esv.freight.app.common.response.ECode;
import com.esv.freight.app.common.response.EResponse; import com.esv.freight.app.common.response.EResponse;
import com.esv.freight.app.common.util.ReqUtils; import com.esv.freight.app.common.validator.groups.ValidatorDetail;
import com.esv.freight.app.common.validator.groups.ValidatorInsert; import com.esv.freight.app.common.validator.groups.ValidatorInsert;
import com.esv.freight.app.common.validator.groups.ValidatorUpdate; import com.esv.freight.app.common.validator.groups.ValidatorUpdate;
import com.esv.freight.app.feign.DriverVehicleInterface;
import com.esv.freight.app.feign.VehicleInterface; import com.esv.freight.app.feign.VehicleInterface;
import com.esv.freight.app.module.account.service.AppLoginService; import com.esv.freight.app.module.account.service.AppLoginService;
import com.esv.freight.app.module.order.form.OrderForm;
import com.esv.freight.app.module.order.vo.OrderListItemVO;
import com.esv.freight.app.module.order.vo.OrderListVO;
import com.esv.freight.app.module.vehicle.form.VehicleForm; import com.esv.freight.app.module.vehicle.form.VehicleForm;
import com.esv.freight.app.module.vehicle.form.VehicleQueryForm; import com.esv.freight.app.module.vehicle.form.VehicleQueryForm;
import com.esv.freight.app.module.vehicle.vo.DriverVehicleListVO;
import com.esv.freight.app.module.vehicle.vo.VehicleDetailVO; import com.esv.freight.app.module.vehicle.vo.VehicleDetailVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -43,11 +41,13 @@ public class VehicleController { ...@@ -43,11 +41,13 @@ public class VehicleController {
private AppLoginService appLoginService; private AppLoginService appLoginService;
private VehicleInterface vehicleInterface; private VehicleInterface vehicleInterface;
private DriverVehicleInterface driverVehicleInterface;
@Autowired @Autowired
public VehicleController(VehicleInterface vehicleInterface, AppLoginService appLoginService) { public VehicleController(DriverVehicleInterface driverVehicleInterface, VehicleInterface vehicleInterface, AppLoginService appLoginService) {
this.appLoginService = appLoginService; this.appLoginService = appLoginService;
this.vehicleInterface = vehicleInterface; this.vehicleInterface = vehicleInterface;
this.driverVehicleInterface = driverVehicleInterface;
} }
/** /**
...@@ -250,63 +250,42 @@ public class VehicleController { ...@@ -250,63 +250,42 @@ public class VehicleController {
} }
/** /**
* description 分页查询车辆列表 * description 获取车辆列表
* param vehicleQueryForm * param vehicleQueryForm
* return com.esv.freight.common.response.EResponse * return com.esv.freight.common.response.EResponse
* author 张志臣 * author 张志臣
* createTime 2020/04/28 17:00 * createTime 2020/04/28 17:00
**/ **/
@PostMapping("/list") @PostMapping("/list")
public EResponse list(@RequestBody(required=false) @Validated(ValidatorUpdate.class) VehicleQueryForm vehicleQueryForm) { public EResponse list(@RequestBody(required=false) @Validated(ValidatorDetail.class) VehicleQueryForm vehicleQueryForm) {
appLoginService.checkAccessToken(); appLoginService.checkAccessToken();
// 调用订单列表分页查询接口 // 调用获取司机的车辆列表接口
/* JSONObject reqJson = new JSONObject(); JSONObject reqJson = new JSONObject();
reqJson.put("goodsOwnerId", orderQueryForm.getGoodsOwnerId()); reqJson.put("id", vehicleQueryForm.getId());
reqJson.put("pageNum", orderQueryForm.getPageNum());
reqJson.put("pageSize", orderQueryForm.getPageSize());
reqJson.put("orderStateList", orderQueryForm.getOrderStateList());
log.info(reqJson.toJSONString()); log.info(reqJson.toJSONString());
JSONObject result = tmsInterface.listOrders(reqJson); JSONObject result = driverVehicleInterface.listByDriver(reqJson);
log.info(result.toJSONString()); log.info(result.toJSONString());
if(result.getInteger("code") != 200) { if(result.getInteger("code") != 200) {
return EResponse.error(result.getInteger("code"), result.getString("message")); return EResponse.error(result.getInteger("code"), result.getString("message"));
} }
OrderListVO pageResultVO = new OrderListVO(); List<DriverVehicleListVO> vehicleVOList = new ArrayList<>();
JSONObject data = result.getJSONObject("data"); JSONArray items = result.getJSONArray("data");
pageResultVO.setPageSize(data.getLong("pageSize")); if(items.size() > 0) {
pageResultVO.setPageNum(data.getLong("pageNum"));
pageResultVO.setTotal(data.getLong("total"));
pageResultVO.setRecordSize(data.getLong("recordSize"));
if(pageResultVO.getRecordSize() > 0) {
JSONArray items = data.getJSONArray("records");
List<OrderListItemVO> records = new ArrayList<>();
for(int i=0; i<items.size(); ++i) { for(int i=0; i<items.size(); ++i) {
OrderListItemVO vo = new OrderListItemVO(); DriverVehicleListVO vo = new DriverVehicleListVO();
JSONObject object = items.getJSONObject(i); JSONObject object = items.getJSONObject(i);
vo.setId(object.getLong("id")); vo.setId(object.getLong("id"));
vo.setOrderNO(object.getString("orderNo")); vo.setLicenseNumber(object.getString("licenseNumber"));
vo.setOrderState(object.getInteger("orderState")); vo.setVehicleStatus(object.getInteger("vehicleStatus"));
vo.setAuditState(object.getInteger("auditState")); vo.setAuditStatus(object.getInteger("auditStatus"));
vo.setDeliveryCityCode(object.getString("deliveryCityCode")); vo.setSourceType(object.getInteger("sourceType"));
vo.setReceiveCityCode(object.getString("receiveCityCode")); vo.setSelected(object.getInteger("selected"));
vo.setBusinessType(object.getInteger("businessType")); vehicleVOList.add(vo);
vo.setGoodsType(object.getInteger("goodsType"));
vo.setGoodsName(object.getInteger("goodsName"));
vo.setGoodsDetail(object.getString("goodsDetail"));
vo.setGoodsTotalAmount(object.getBigDecimal("goodsTotalAmount"));
vo.setGoodsUnit(object.getString("goodsUnit"));
vo.setRequiredDeliveryTime(object.getDate("requiredDeliveryTime"));
vo.setRequiredReceiveTime(object.getDate("requiredReceiveTime"));
vo.setCreateTime(object.getDate("createTime"));
vo.setOrderSource(object.getString("orderSource"));
records.add(vo);
} }
}
pageResultVO.setRecord(records); return EResponse.ok(vehicleVOList);
}*/
return EResponse.ok();
} }
} }
...@@ -27,55 +27,6 @@ public class VehicleQueryForm { ...@@ -27,55 +27,6 @@ public class VehicleQueryForm {
*/ */
@NotNull(message = "参数id不能为空", groups = {ValidatorDetail.class}) @NotNull(message = "参数id不能为空", groups = {ValidatorDetail.class})
private Long id; private Long id;
/**
* 承运商帐号ID
*/
private Long carrierId;
/**
* 车辆状态:1-正常、2-停用
*/
@Pattern(regexp = "[12]", message = "参数vehicleStatus不合法", groups = {ValidatorList.class})
private String vehicleStatus;
/**
* 审核状态(字典表):0-待审核、1-审核成功,2-审核失败
*/
@Range(min = 0, max = 2, message = "参数auditStatus不合法", groups = {ValidatorList.class})
private Integer auditStatus;
/**
* 车牌号
*/
@Length(max = 8, message = "参数licenseNumber长度不合法", groups = {ValidatorList.class})
private String licenseNumber;
/**
* 行驶证档案编号
*/
@Length(max = 20, message = "参数vehicleLicenseNumber长度不合法", groups = {ValidatorList.class})
private String vehicleLicenseNumber;
/**
* 道路运输证号
*/
@Length(max = 50, message = "参数ownerName长度不合法", groups = {ValidatorList.class})
private String roadCertificateNumber;
/**
* 车辆类型(字典表)
*/
private Integer vehicleType;
/**
* 二级车辆类型(字典表)
*/
private Integer vehicleType2;
/**
* 页码
**/
@Range(min = 1, max = 65535, message = "无效的pageNum", groups = {ValidatorList.class})
@NotNull(message = "参数pageNum不能为空", groups = {ValidatorList.class})
private Integer pageNum;
/**
* 每页记录条数
**/
@Range(min = 1, max = 100, message = "pageSize", groups = {ValidatorList.class})
@NotNull(message = "参数pageSize不能为空", groups = {ValidatorList.class})
private Integer pageSize;
@Override @Override
public String toString() { public String toString() {
......
...@@ -4,45 +4,42 @@ import lombok.Data; ...@@ -4,45 +4,42 @@ import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
/** /**
* @description: 车辆列表VO * @description: 车辆列表VO
* @project: Freight * @project: freight-app-service
* @name: com.esv.freight.app.module.vehicle.vo.VehicleListItemVO * @name: com.esv.freight.app.module.vehicle.vo.VehicleListVO
* @author: 张志臣 * @author: 张志臣
* @email: zhangzhichen@esvtek.com * @email: zhangzhichen@esvtek.com
* @createTime: 2020/04/28 16:00 * @createTime: 2020/04/28 16:00
* @version:1.0 * @version:1.0
*/ */
@Data @Data
public class VehicleListItemVO { public class DriverVehicleListVO {
/** /**
* *
*/ */
private Long id; private Long id;
/** /**
* 车牌号 * 车牌号
*/ */
private String licenseNumber; private String licenseNumber;
/** /**
* 审核状态(字典表):0-待审核、1-审核成功,2-审核失败 * 车辆状态:1-正常、2-停用
*/ */
private Integer auditStatus; private Integer vehicleStatus;
/** /**
* 车辆类型(字典表) * 审核状态(字典表):0-待审核、1-审核成功,2-审核失败
*/ */
private Integer vehicleType; private Integer auditStatus;
/** /**
* 二级车辆类型(字典表) * 创建来源:1-平台创建、2-司机创建
*/ */
private Integer vehicleType2; private Integer sourceType;
/** /**
* 核定载质量(吨) * 是否默认车辆:0-不是、1-是
*/ */
private BigDecimal loadCapacity; private Integer selected;
@Override @Override
public String toString() { public String toString() {
......
...@@ -8,7 +8,7 @@ import java.math.BigDecimal; ...@@ -8,7 +8,7 @@ import java.math.BigDecimal;
/** /**
* @description: 车辆详情VO * @description: 车辆详情VO
* @project: Freight * @project: freight-app-service
* @name: com.esv.freight.app.module.vehicle.vo.VehicleDetailVO * @name: com.esv.freight.app.module.vehicle.vo.VehicleDetailVO
* @author: 张志臣 * @author: 张志臣
* @email: zhangzhichen@esvtek.com * @email: zhangzhichen@esvtek.com
......
package com.esv.freight.app.module.vehicle.vo;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.List;
/**
* @description: 车辆列表VO
* @project: Freight
* @name: com.esv.freight.app.module.vehicle.vo.VehicleListVO
* @author: 张志臣
* @email: zhangzhichen@esvtek.com
* @createTime: 2020/04/28 16:00
* @version:1.0
*/
@Data
public class VehicleListVO {
/**
* 每页记录条数
**/
private Long pageSize;
/**
* 当前页码
**/
private Long pageNum;
/**
* 总记录条数
**/
private Long total;
/**
* 当前页的记录条数
**/
private Long recordSize;
/**
* 数据
**/
private List<VehicleListItemVO> record;
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment