Commit 9c66a7b6 authored by liuzeheng's avatar liuzeheng

到港时间筛选

parent b18c6126
......@@ -1290,17 +1290,41 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
if (!isSplitOrderChildren && finishReqVO.getUpdateCustomer() && isNotRollbackIn) {
Set<Long> idSet = new HashSet<>();
idSet.add(orderDO.getCustomerId());
//订单发货人
OrderConsignorDO orderConsignorDO2 = orderConsignorService.getOne(new LambdaQueryWrapper<OrderConsignorDO>().eq(OrderConsignorDO::getOrderId, orderDO.getOrderId())
.orderByDesc(OrderConsignorDO::getId).last("limit 1"));
if (orderConsignorDO2 != null && orderConsignorDO2.getCustomerId() != null) {
idSet.add(orderConsignorDO2.getCustomerId());
}
//订单收货人
OrderConsigneeDO orderConsigneeDO2 = orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, orderDO.getOrderId())
.orderByDesc(OrderConsigneeDO::getId).last("limit 1"));
if (orderConsigneeDO2 != null && orderConsigneeDO2.getCustomerId() != null) {
idSet.add(orderConsigneeDO2.getCustomerId());
if(orderConsignorDO2 != null && orderConsignorDO2.getCustomerId() != null &&
orderConsigneeDO2 != null && orderConsigneeDO2.getCustomerId() != null){
//获取发货人客户经理
CustomerDO consignorCustomer = customerService.getById(orderConsignorDO2.getCustomerId()) ;
//获取收货人客户经理
CustomerDO consigneeCustomer = customerService.getById(orderConsigneeDO2.getCustomerId()) ;
//订单的发货人、收货人同属一个客户经理,则两个客户经理都延期,否则只延期订单中业绩归属方客户
if (consignorCustomer != null && consigneeCustomer != null &&
Objects.nonNull(consignorCustomer.getCustomerService()) &&
Objects.nonNull(consigneeCustomer.getCustomerService()) &&
(consignorCustomer.getCustomerService().equals(consigneeCustomer.getCustomerService()) || consignorCustomer.getCustomerService() == consigneeCustomer.getCustomerService())) {
if (orderConsignorDO2 != null && orderConsignorDO2.getCustomerId() != null) {
idSet.add(orderConsignorDO2.getCustomerId());
}
if (orderConsigneeDO2 != null && orderConsigneeDO2.getCustomerId() != null) {
idSet.add(orderConsigneeDO2.getCustomerId());
}
}
}
// //旧逻辑 2024-05-21
// if (orderConsignorDO2 != null && orderConsignorDO2.getCustomerId() != null) {
// idSet.add(orderConsignorDO2.getCustomerId());
// }
//
// if (orderConsigneeDO2 != null && orderConsigneeDO2.getCustomerId() != null) {
// idSet.add(orderConsigneeDO2.getCustomerId());
// }
for (Long id : idSet) {
customerService.updateCustomerByFinishWarehouseIn(id, orderId, orderDO != null ? orderDO.getOrderNo() : "", orderDO.getRucangTime());
}
......
......@@ -408,9 +408,30 @@ public interface BoxMapper extends AbstractMapper<BoxDO> {
beginJSDate = DateUtil.format(vo.getBeginJsDate(), "yyyy-MM-dd HH:mm:ss");
endJsDate = DateUtil.format(vo.getEndJsDate(), "yyyy-MM-dd HH:mm:ss");
}
String beginDaogangTime =null ;
String endDaogangTime =null ;
if(vo.getBeginDaogangTime()!=null ){
beginDaogangTime = DateUtil.format(vo.getBeginDaogangTime(), "yyyy-MM-dd HH:mm:ss");
endDaogangTime = DateUtil.format(vo.getEndDaogangTime(), "yyyy-MM-dd HH:mm:ss");
}
String beginQingguanTime = null ;
String endQingguanTime =null ;
if(vo.getBeginQingguanTime()!=null ){
beginQingguanTime = DateUtil.format(vo.getBeginQingguanTime(), "yyyy-MM-dd HH:mm:ss");
endQingguanTime = DateUtil.format(vo.getEndQingguanTime(), "yyyy-MM-dd HH:mm:ss");
}
String beginUlWarehouseTime = null ;
String endUlWarehouseTime =null ;
if(vo.getBeginQingguanTime()!=null ){
beginUlWarehouseTime = DateUtil.format(vo.getBeginUlWarehouseTime(), "yyyy-MM-dd HH:mm:ss");
endUlWarehouseTime = DateUtil.format(vo.getEndUlWarehouseTime(), "yyyy-MM-dd HH:mm:ss");
}
IPage<BoxDO> mpPage = MyBatisUtils.buildPage(page);
return boxSettlePage(mpPage, vo.getStartWarehouseIdList(), vo.getDestWarehouseIdList(),
vo.getSelfNo(), vo.getBoxStatus(), vo.getSlStatus(), beginJSDate, endJsDate);
vo.getSelfNo(), vo.getBoxStatus(), vo.getSlStatus(),
beginJSDate, endJsDate,beginDaogangTime,endDaogangTime,beginQingguanTime,endQingguanTime,beginUlWarehouseTime,endUlWarehouseTime);
// return selectPage(page, boxQuery);
}
......@@ -424,6 +445,11 @@ public interface BoxMapper extends AbstractMapper<BoxDO> {
"<when test = 'beginJsDate != null or endJsDate != null'>",
", ecw_box_settlement settlement ",
"</when>",
"<when test = 'beginUlWarehouseTime != null or endUlWarehouseTime != null'>",
", ecw_box_clearance clearance ",
"</when>",
"WHERE",
"box.deleted = 0 and box.pr_status &gt; 21",
......@@ -431,6 +457,10 @@ public interface BoxMapper extends AbstractMapper<BoxDO> {
"and box.id = settlement.shipment_id and settlement.deleted = 0",
"</when>",
"<when test = 'beginUlWarehouseTime != null or endUlWarehouseTime != null'>",
"and box.id = clearance.shipment_id and clearance.deleted = 0",
"</when>",
"<when test = 'beginJsDate != null'>",
"and settlement.sl_settled_time &gt;= #{beginJsDate}",
"</when>",
......@@ -439,6 +469,31 @@ public interface BoxMapper extends AbstractMapper<BoxDO> {
"and settlement.sl_settled_time &lt;= #{endJsDate}",
"</when>",
"<when test = 'beginDaogangTime != null'>",
"and box.dg_date &gt;= #{beginDaogangTime}",
"</when>",
"<when test = 'endDaogangTime != null'>",
"and box.dg_date &lt;= #{endDaogangTime}",
"</when>",
"<when test = 'beginQingguanTime != null'>",
"and box.qg_date &gt;= #{beginQingguanTime}",
"</when>",
"<when test = 'endQingguanTime != null'>",
"and box.qg_date &lt;= #{endQingguanTime}",
"</when>",
"<when test = 'beginUlWarehouseTime != null'>",
"and clearance.cl_clear_time &gt;= #{beginUlWarehouseTime}",
"</when>",
"<when test = 'endUlWarehouseTime != null'>",
"and clearance.cl_clear_time &lt;= #{endUlWarehouseTime}",
"</when>",
"<when test = 'selfNo != null and selfNo != \"\" '>",
"and box.self_no LIKE concat('%',#{selfNo},'%')",
"</when>",
......@@ -474,7 +529,15 @@ public interface BoxMapper extends AbstractMapper<BoxDO> {
@Param("boxStatus") Integer boxStatus,
@Param("slStatus") Integer slStatus,
@Param("beginJsDate") String beginJsDate,
@Param("endJsDate") String endJsDate);
@Param("endJsDate") String endJsDate,
@Param("beginDaogangTime") String beginDaogangTime,
@Param("endDaogangTime") String endDaogangTime,
@Param("beginQingguanTime") String beginQingguanTime,
@Param("endQingguanTime") String endQingguanTime,
@Param("beginUlWarehouseTime") String beginUlWarehouseTime,
@Param("endUlWarehouseTime") String endUlWarehouseTime
);
@Select("SELECT box.* from ecw_box box left join ecw_box_agent agent on box.id = agent.shipment_id\n" +
"where box.pr_status = 25 and agent.agent_id is null and box.deleted=0")
......
......@@ -37,4 +37,29 @@ public class BoxSettlementQueryVO {
@ApiModelProperty(value = "出货状态")
private Integer boxStatus;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始到港时间")
private Date beginDaogangTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束到港时间")
private Date endDaogangTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始清关时间")
private Date beginQingguanTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束清关时间")
private Date endQingguanTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始卸柜/到仓时间")
private Date beginUlWarehouseTime ;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束卸柜/到仓时间")
private Date endUlWarehouseTime ;
}
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