Commit 0b5adbee authored by zhangzc's avatar zhangzc

添加运单搜索接口

parent 05b00e4e
...@@ -55,4 +55,12 @@ public interface TmsWaybillInterface { ...@@ -55,4 +55,12 @@ public interface TmsWaybillInterface {
*/ */
@PostMapping(value = "tms/waybill/sign") @PostMapping(value = "tms/waybill/sign")
JSONObject sign(JSONObject bodyJson); JSONObject sign(JSONObject bodyJson);
/**
* 模糊搜索
* @param bodyJson
* @return
*/
@PostMapping(value = "tms/waybill/list/multi/condition")
JSONObject condition(JSONObject bodyJson);
} }
...@@ -10,6 +10,7 @@ import com.esv.freight.app.feign.TmsOrderInterface; ...@@ -10,6 +10,7 @@ import com.esv.freight.app.feign.TmsOrderInterface;
import com.esv.freight.app.feign.TmsWaybillInterface; import com.esv.freight.app.feign.TmsWaybillInterface;
import com.esv.freight.app.module.account.service.AppLoginService; import com.esv.freight.app.module.account.service.AppLoginService;
import com.esv.freight.app.module.waybill.form.UploadEvidenceForm; import com.esv.freight.app.module.waybill.form.UploadEvidenceForm;
import com.esv.freight.app.module.waybill.form.WaybillMultiQueryForm;
import com.esv.freight.app.module.waybill.form.WaybillQueryForm; import com.esv.freight.app.module.waybill.form.WaybillQueryForm;
import com.esv.freight.app.module.waybill.vo.WaybillDetailVO; import com.esv.freight.app.module.waybill.vo.WaybillDetailVO;
import com.esv.freight.app.module.waybill.vo.WaybillListItemVO; import com.esv.freight.app.module.waybill.vo.WaybillListItemVO;
...@@ -179,6 +180,8 @@ public class DriverWaybillController { ...@@ -179,6 +180,8 @@ public class DriverWaybillController {
waybillDetailVO.setRequiredDeliveryTime(data.getDate("requiredDeliveryTime")); waybillDetailVO.setRequiredDeliveryTime(data.getDate("requiredDeliveryTime"));
waybillDetailVO.setRequiredReceiveTime(data.getDate("requiredReceiveTime")); waybillDetailVO.setRequiredReceiveTime(data.getDate("requiredReceiveTime"));
waybillDetailVO.setRequiredReceiptTime(data.getDate("requiredReceiptTime")); waybillDetailVO.setRequiredReceiptTime(data.getDate("requiredReceiptTime"));
waybillDetailVO.setDeliveryGoodsAmount(data.getBigDecimal("deliveryGoodsAmount"));
waybillDetailVO.setReceiveGoodsAmount(data.getBigDecimal("receiveGoodsAmount"));
return EResponse.ok(waybillDetailVO); return EResponse.ok(waybillDetailVO);
} }
...@@ -261,4 +264,85 @@ public class DriverWaybillController { ...@@ -261,4 +264,85 @@ public class DriverWaybillController {
return EResponse.ok(); return EResponse.ok();
} }
/**
* description 运单搜索
* param waybillQueryForm
* return com.esv.freight.common.response.EResponse
* author 张志臣
* createTime 2020/05/09 15:00
**/
@PostMapping("/list/multi/condition")
public EResponse condition(@RequestBody(required=false) @Validated(ValidatorList.class) WaybillMultiQueryForm waybillMultiQueryForm) {
appLoginService.checkAccessToken();
// 调用运单列表分页查询接口
JSONObject reqJson = new JSONObject();
reqJson.put("condition", waybillMultiQueryForm.getCondition());
reqJson.put("pageNum", waybillMultiQueryForm.getPageNum());
reqJson.put("pageSize", waybillMultiQueryForm.getPageSize());
log.info(reqJson.toJSONString());
JSONObject result = tmsWaybillInterface.condition(reqJson);
log.info(result.toJSONString());
if(result.getInteger("code") != 200) {
return EResponse.error(result.getInteger("code"), result.getString("message"));
}
WaybillListVO pageResultVO = new WaybillListVO();
JSONObject data = result.getJSONObject("data");
pageResultVO.setPageSize(data.getLong("pageSize"));
pageResultVO.setPageNum(data.getLong("pageNum"));
pageResultVO.setTotal(data.getLong("totalSize"));
pageResultVO.setRecordSize(data.getLong("recordSize"));
if(pageResultVO.getRecordSize() > 0) {
JSONArray items = data.getJSONArray("records");
List<WaybillListItemVO> records = new ArrayList<>();
for(int i=0; i<items.size(); ++i) {
WaybillListItemVO vo = new WaybillListItemVO();
JSONObject object = items.getJSONObject(i);
vo.setId(object.getLong("id"));
vo.setVehicleId(object.getLong("vehicleId"));
vo.setVehicleLicenseNo(object.getString("vehicleLicenseNo"));
vo.setWaybillNo(object.getString("waybillNo"));
vo.setWaybillState(object.getInteger("waybillState"));
vo.setDeliveryStrategy(object.getInteger("deliveryStrategy"));
vo.setOrderId(object.getLong("orderId"));
vo.setOrderNo(object.getString("orderNo"));
vo.setGoodsOwnerId(object.getLong("goodsOwnerId"));
vo.setGoodsOwnerName(object.getString("goodsOwnerName"));
vo.setDeliveryCityCode(object.getString("deliveryCityCode"));
vo.setReceiveCityCode(object.getString("receiveCityCode"));
vo.setDriverId(object.getLong("driverId"));
vo.setDriverName(object.getString("driverName"));
vo.setDriverPhone(object.getString("driverPhone"));
vo.setSettlementType(object.getString("settlementType"));
vo.setCarrierId(object.getLong("carrierId"));
vo.setCarrierName(object.getString("carrierName"));
vo.setBusinessType(object.getInteger("businessType"));
vo.setGoodsType(object.getInteger("goodsType"));
vo.setGoodsNameCode(object.getInteger("goodsNameCode"));
vo.setGoodsName(object.getString("goodsName"));
vo.setGoodsAmount(object.getBigDecimal("goodsAmount"));
vo.setFreightUnitPriceOutput(object.getBigDecimal("freightUnitPriceOutput"));
vo.setDeliveryEvidenceId(object.getLong("deliveryEvidenceId"));
vo.setDeliveryTime(object.getDate("deliveryTime"));
vo.setDeliveryGoodsAmount(object.getBigDecimal("deliveryGoodsAmount"));
vo.setReceiveEvidenceId(object.getLong("receiveEvidenceId"));
vo.setReceiveTime(object.getDate("receiveTime"));
vo.setReceiveGoodsAmount(object.getBigDecimal("receiveGoodsAmount"));
vo.setPayVerifyState(object.getInteger("payVerifyState"));
vo.setGoodsUnit(object.getInteger("goodsUnit"));
vo.setFreightUnitPriceInput(object.getBigDecimal("freightUnitPriceInput"));
vo.setCreateTime(object.getDate("createTime"));
vo.setRequiredDeliveryTime(object.getDate("requiredDeliveryTime"));
vo.setRequiredReceiveTime(object.getDate("requiredReceiveTime"));
records.add(vo);
}
pageResultVO.setRecord(records);
}
return EResponse.ok(pageResultVO);
}
} }
...@@ -12,6 +12,7 @@ import com.esv.freight.app.feign.TmsOrderInterface; ...@@ -12,6 +12,7 @@ import com.esv.freight.app.feign.TmsOrderInterface;
import com.esv.freight.app.feign.TmsWaybillInterface; import com.esv.freight.app.feign.TmsWaybillInterface;
import com.esv.freight.app.module.account.service.AppLoginService; import com.esv.freight.app.module.account.service.AppLoginService;
import com.esv.freight.app.module.waybill.form.UploadEvidenceForm; import com.esv.freight.app.module.waybill.form.UploadEvidenceForm;
import com.esv.freight.app.module.waybill.form.WaybillMultiQueryForm;
import com.esv.freight.app.module.waybill.form.WaybillQueryForm; import com.esv.freight.app.module.waybill.form.WaybillQueryForm;
import com.esv.freight.app.module.waybill.vo.WaybillListItemVO; import com.esv.freight.app.module.waybill.vo.WaybillListItemVO;
import com.esv.freight.app.module.waybill.vo.WaybillListVO; import com.esv.freight.app.module.waybill.vo.WaybillListVO;
...@@ -160,4 +161,85 @@ public class OwnerWaybillController { ...@@ -160,4 +161,85 @@ public class OwnerWaybillController {
return EResponse.ok(); return EResponse.ok();
} }
/**
* description 运单搜索
* param waybillQueryForm
* return com.esv.freight.common.response.EResponse
* author 张志臣
* createTime 2020/05/09 15:00
**/
@PostMapping("/list/multi/condition")
public EResponse condition(@RequestBody(required=false) @Validated(ValidatorList.class) WaybillMultiQueryForm waybillMultiQueryForm) {
appLoginService.checkAccessToken();
// 调用运单列表分页查询接口
JSONObject reqJson = new JSONObject();
reqJson.put("condition", waybillMultiQueryForm.getCondition());
reqJson.put("pageNum", waybillMultiQueryForm.getPageNum());
reqJson.put("pageSize", waybillMultiQueryForm.getPageSize());
log.info(reqJson.toJSONString());
JSONObject result = tmsWaybillInterface.condition(reqJson);
log.info(result.toJSONString());
if(result.getInteger("code") != 200) {
return EResponse.error(result.getInteger("code"), result.getString("message"));
}
WaybillListVO pageResultVO = new WaybillListVO();
JSONObject data = result.getJSONObject("data");
pageResultVO.setPageSize(data.getLong("pageSize"));
pageResultVO.setPageNum(data.getLong("pageNum"));
pageResultVO.setTotal(data.getLong("totalSize"));
pageResultVO.setRecordSize(data.getLong("recordSize"));
if(pageResultVO.getRecordSize() > 0) {
JSONArray items = data.getJSONArray("records");
List<WaybillListItemVO> records = new ArrayList<>();
for(int i=0; i<items.size(); ++i) {
WaybillListItemVO vo = new WaybillListItemVO();
JSONObject object = items.getJSONObject(i);
vo.setId(object.getLong("id"));
vo.setVehicleId(object.getLong("vehicleId"));
vo.setVehicleLicenseNo(object.getString("vehicleLicenseNo"));
vo.setWaybillNo(object.getString("waybillNo"));
vo.setWaybillState(object.getInteger("waybillState"));
vo.setDeliveryStrategy(object.getInteger("deliveryStrategy"));
vo.setOrderId(object.getLong("orderId"));
vo.setOrderNo(object.getString("orderNo"));
vo.setGoodsOwnerId(object.getLong("goodsOwnerId"));
vo.setGoodsOwnerName(object.getString("goodsOwnerName"));
vo.setDeliveryCityCode(object.getString("deliveryCityCode"));
vo.setReceiveCityCode(object.getString("receiveCityCode"));
vo.setDriverId(object.getLong("driverId"));
vo.setDriverName(object.getString("driverName"));
vo.setDriverPhone(object.getString("driverPhone"));
vo.setSettlementType(object.getString("settlementType"));
vo.setCarrierId(object.getLong("carrierId"));
vo.setCarrierName(object.getString("carrierName"));
vo.setBusinessType(object.getInteger("businessType"));
vo.setGoodsType(object.getInteger("goodsType"));
vo.setGoodsNameCode(object.getInteger("goodsNameCode"));
vo.setGoodsName(object.getString("goodsName"));
vo.setGoodsAmount(object.getBigDecimal("goodsAmount"));
vo.setFreightUnitPriceOutput(object.getBigDecimal("freightUnitPriceOutput"));
vo.setDeliveryEvidenceId(object.getLong("deliveryEvidenceId"));
vo.setDeliveryTime(object.getDate("deliveryTime"));
vo.setDeliveryGoodsAmount(object.getBigDecimal("deliveryGoodsAmount"));
vo.setReceiveEvidenceId(object.getLong("receiveEvidenceId"));
vo.setReceiveTime(object.getDate("receiveTime"));
vo.setReceiveGoodsAmount(object.getBigDecimal("receiveGoodsAmount"));
vo.setPayVerifyState(object.getInteger("payVerifyState"));
vo.setGoodsUnit(object.getInteger("goodsUnit"));
vo.setFreightUnitPriceInput(object.getBigDecimal("freightUnitPriceInput"));
vo.setCreateTime(object.getDate("createTime"));
vo.setRequiredDeliveryTime(object.getDate("requiredDeliveryTime"));
vo.setRequiredReceiveTime(object.getDate("requiredReceiveTime"));
records.add(vo);
}
pageResultVO.setRecord(records);
}
return EResponse.ok(pageResultVO);
}
} }
...@@ -44,19 +44,19 @@ public class UploadEvidenceForm { ...@@ -44,19 +44,19 @@ public class UploadEvidenceForm {
private String pictureUrl01; private String pictureUrl01;
/** /**
* 发货单据01URL * 发货单据02URL
*/ */
@Length(max = 500, message = "参数pictureUrl01长度不合法", groups = {ValidatorInsert.class}) @Length(max = 500, message = "参数pictureUrl01长度不合法", groups = {ValidatorInsert.class})
private String pictureUrl02; private String pictureUrl02;
/** /**
* 发货单据01URL * 发货单据03URL
*/ */
@Length(max = 500, message = "参数pictureUrl01长度不合法", groups = {ValidatorInsert.class}) @Length(max = 500, message = "参数pictureUrl01长度不合法", groups = {ValidatorInsert.class})
private String pictureUrl03; private String pictureUrl03;
/** /**
* 发货单据01URL * 发货单据04URL
*/ */
@Length(max = 500, message = "参数pictureUrl01长度不合法", groups = {ValidatorInsert.class}) @Length(max = 500, message = "参数pictureUrl01长度不合法", groups = {ValidatorInsert.class})
private String pictureUrl04; private String pictureUrl04;
......
package com.esv.freight.app.module.waybill.form;
import com.esv.freight.app.common.validator.groups.ValidatorList;
import com.esv.freight.app.module.account.validator.groups.ValidatorLoginByPwd;
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;
/**
* @description:
* @project: freight-app-service
* @name: com.esv.freight.app.module.waybill.form.WaybillMultiQueryForm
* @author: 张志臣
* @email: zhangzhichen@esvtek.com
* @createTime: 2020/05/09 14:00
* @version:1.0
*/
@Data
public class WaybillMultiQueryForm {
/**
* 运单号
*/
@Length(max = 64, message = "参数condition长度不合法", groups = {ValidatorList.class})
@NotBlank(message = "参数condition不能为空", groups = {ValidatorList.class})
private String condition;
/**
* 当前页数
*/
@NotNull(message = "参数pageNum不能为空", groups = {ValidatorList.class})
private Long pageNum;
/**
* 每页显示记录数
*/
@Range(min = 1, max = 1000, message = "pageSize", groups = {ValidatorList.class})
@NotNull(message = "参数pageSize不能为空", groups = {ValidatorList.class})
private Long pageSize;
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
}
}
...@@ -129,6 +129,16 @@ public class WaybillDetailVO { ...@@ -129,6 +129,16 @@ public class WaybillDetailVO {
*/ */
private Date requiredReceiptTime; private Date requiredReceiptTime;
/**
* 实际发货运单量
*/
private BigDecimal deliveryGoodsAmount;
/**
* 实际收货运单量
*/
private BigDecimal receiveGoodsAmount;
@Override @Override
public String toString() { public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE); 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