Commit 9cff5ef7 authored by 332784038@qq.com's avatar 332784038@qq.com

Merge remote-tracking branch 'origin/order-update' into order-update

parents ddb8bdfd 7126027d
......@@ -402,4 +402,6 @@ public interface ErrorCodeConstants {
ErrorCode CLEARANCE_UNIT_NOT_NULL = new ErrorCode(1004001160, "order.item.clearance.unit.not.null");
ErrorCode ORDER_CARGO_CONTROL_LIMIT_UPDATE_CONSIGNEE_ERROR = new ErrorCode(1004001155, "order.cargo.control.limit.update.consignee.error");
ErrorCode ORDER_CARGO_CONTROL_LIMIT_UPDATE_CONSIGNEE_INFO = new ErrorCode(1004001156, "order.cargo.control.limit.update.consignee.info");
ErrorCode ORDER_CARGO_CONTROL_CONSIGNEE_LIMIT_UPDATE_APPLYING = new ErrorCode(1004001157, "order.cargo.control.consignee.limit.update.applying");
ErrorCode ORDER_CARGO_CONTROL_OVERSEAS_WAREHOUSE_UPDATE_APPLYING = new ErrorCode(1004001158, "order.cargo.control.overseas.warehouse.update.applying");
}
......@@ -486,35 +486,70 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
if (Objects.isNull(orderApprovalDO)) {
throw exception(ORDER_APPROVAL_INFO_NOT_FIND);
}
OrderCargoControlApplyVO applyVO = JSONObject.parseObject(orderApprovalDO.getDetails(), OrderCargoControlApplyVO.class);
orderApprovalDO.setStatus(result);
List<ApplyInfoVO> list = new ArrayList<>();
String msg = "";
if (result == 1) {
// 进行中的审批直接返回
return;
}
if (result == 3 || result == 4) {
// TODO 审批取消、审批拒绝,待补充业务日志及其他细节
return;
if (orderApprovalDO.getType() == 61) {
msg = result == 3 ? "收货人限制修改申请取消" : "收货人限制修改申请拒绝";
ApplyInfoVO applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("是否限制修改收货人");
applyInfoVO.setOrgValue(applyVO.getIsLimitUpdateConsignee() ? "是" : "否");
applyInfoVO.setNewValue(applyVO.getNewIsLimitUpdateConsignee() ? "是" : "否");
list.add(applyInfoVO);
applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("锁定收货人天数");
applyInfoVO.setOrgValue(Objects.isNull(applyVO.getLockConsigneeDay()) ? "空" : applyVO.getLockConsigneeDay() + "天");
applyInfoVO.setNewValue(Objects.isNull(applyVO.getNewLockConsigneeDay()) ? "空" : applyVO.getNewLockConsigneeDay() + "天");
list.add(applyInfoVO);
}else if (orderApprovalDO.getType() == 61) {
msg = result == 3 ? "海外仓修改申请取消" : "海外仓修改申请拒绝";
ApplyInfoVO applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改为海外仓模式");
list.add(applyInfoVO);
}
}
if (result == 2) {
OrderCargoControlApplyVO applyVO = JSONObject.parseObject(orderApprovalDO.getDetails(), OrderCargoControlApplyVO.class);
if (orderApprovalDO.getType() == 61) {
// 修改放货限制
Integer newLockConsigneeDay = applyVO.getNewIsLimitUpdateConsignee() ? applyVO.getNewLockConsigneeDay() : null;
OrderDO orderDO = orderService.getById(applyVO.getOrderId());
Date newLockConsigneeTime = Objects.isNull(orderDO.getUnloadTime()) || Objects.isNull(newLockConsigneeDay) ? null : DateUtil.endOfDay(DateUtil.offsetDay(orderDO.getUnloadTime(), newLockConsigneeDay));;
Date newLockConsigneeTime = Objects.isNull(orderDO.getUnloadTime()) || Objects.isNull(newLockConsigneeDay) ? null : DateUtil.endOfDay(DateUtil.offsetDay(orderDO.getUnloadTime(), newLockConsigneeDay));
;
orderService.update(new LambdaUpdateWrapper<OrderDO>()
.set(OrderDO::getIsLimitUpdateConsignee, applyVO.getNewIsLimitUpdateConsignee())
.set(OrderDO::getLockConsigneeDay, newLockConsigneeDay)
.set(OrderDO::getLockConsigneeTime, newLockConsigneeTime)
.eq(OrderDO::getOrderId, orderApprovalDO.getOrderId()));
// TODO 补充订单日志
}
if (orderApprovalDO.getType() == 62) {
msg = "收货人限制修改申请审批通过";
ApplyInfoVO applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("是否限制修改收货人");
applyInfoVO.setOrgValue(applyVO.getIsLimitUpdateConsignee() ? "是" : "否");
applyInfoVO.setNewValue(applyVO.getNewIsLimitUpdateConsignee() ? "是" : "否");
list.add(applyInfoVO);
applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("锁定收货人天数");
applyInfoVO.setOrgValue(Objects.isNull(applyVO.getLockConsigneeDay()) ? "空" : applyVO.getLockConsigneeDay() + "天");
applyInfoVO.setNewValue(Objects.isNull(applyVO.getNewLockConsigneeDay()) ? "空" : applyVO.getNewLockConsigneeDay() + "天");
list.add(applyInfoVO);
}else if (orderApprovalDO.getType() == 62) {
// TODO 海外仓修改申请
msg = "海外仓修改申请审批通过";
ApplyInfoVO applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改为海外仓模式");
list.add(applyInfoVO);
}
}
orderApprovalMapper.updateById(orderApprovalDO);
// orderBusinessService.createOrderControlLogs(controlLogParams);
orderBusinessService.addOrderOperateLog(orderApprovalDO.getOrderId(), "订单操作", msg, list);
}
......@@ -566,7 +601,8 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
orderApprovalDO.setUpdater(creator);
orderApprovalDO.setCreateTime(now);
orderApprovalDO.setUpdateTime(now);
List<ApplyInfoVO> list = new ArrayList<>();
String msg = "";
if (orderCargoControlApplyVO.getApplyType() == 61) {
orderApprovalDO.setOrderId(orderCargoControlApplyVO.getOrderId());
orderApprovalDO.setType(61);
......@@ -575,6 +611,17 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
String formId = bpmCreateServiceFactory.createBmp(userId, orderApprovalDO.getOrderApprovalId(), WorkFlowEmus.ORDER_MODEL_CHANGE.getKey(), orderDO.getOrderNo(),
StringUtils.isNotBlank(orderCargoControlApplyVO.getCcIds()) ? orderCargoControlApplyVO.getCcIds().split(StrUtil.COMMA) : null);
orderApprovalDO.setFormId(formId);
msg = "收货人限制修改申请";
ApplyInfoVO applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("是否限制修改收货人");
applyInfoVO.setOrgValue(orderCargoControlApplyVO.getIsLimitUpdateConsignee() ? "是" : "否");
applyInfoVO.setNewValue(orderCargoControlApplyVO.getNewIsLimitUpdateConsignee() ? "是" : "否");
list.add(applyInfoVO);
applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("锁定收货人天数");
applyInfoVO.setOrgValue(Objects.isNull(orderCargoControlApplyVO.getLockConsigneeDay()) ? "空" : orderCargoControlApplyVO.getLockConsigneeDay() + "天");
applyInfoVO.setNewValue(Objects.isNull(orderCargoControlApplyVO.getNewLockConsigneeDay()) ? "空" : orderCargoControlApplyVO.getNewLockConsigneeDay() + "天");
list.add(applyInfoVO);
} else if (orderCargoControlApplyVO.getApplyType() == 62) {
orderApprovalDO.setOrderId(orderCargoControlApplyVO.getOrderId());
orderApprovalDO.setType(62);
......@@ -583,7 +630,12 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
String formId = bpmCreateServiceFactory.createBmp(userId, orderApprovalDO.getOrderApprovalId(), WorkFlowEmus.SHIPMENT_CHANGE_RELEASE_GOODS_LIMIT.getKey(), orderDO.getOrderNo(),
StringUtils.isNotBlank(orderCargoControlApplyVO.getCcIds()) ? orderCargoControlApplyVO.getCcIds().split(StrUtil.COMMA) : null);
orderApprovalDO.setFormId(formId);
msg = "海外仓修改申请";
ApplyInfoVO applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改为海外仓模式");
list.add(applyInfoVO);
}
orderApprovalMapper.updateById(orderApprovalDO);
orderBusinessService.addOrderOperateLog(orderApprovalDO.getOrderId(), "订单操作", msg, list);
}
}
......@@ -142,6 +142,23 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
if (orderDO.getCargoControlStatus() == 1) {
throw exception(ORDER_CARGO_CONTROL_PICK_FINISH);
}
// 检查订单是否在收货人限制修改申请中
long limitUpdateCount = orderApprovalMapper.selectCount(new LambdaQueryWrapper<OrderApprovalDO>()
.eq(OrderApprovalDO::getOrderId, orderDO.getOrderId())
.eq(OrderApprovalDO::getType, 61)
.eq(OrderApprovalDO::getStatus, 1)
);
if (limitUpdateCount > 0){
throw exception(ORDER_CARGO_CONTROL_CONSIGNEE_LIMIT_UPDATE_APPLYING);
}
long overseasWarehouseUpdateCount = orderApprovalMapper.selectCount(new LambdaQueryWrapper<OrderApprovalDO>()
.eq(OrderApprovalDO::getOrderId, orderDO.getOrderId())
.eq(OrderApprovalDO::getType, 62)
.eq(OrderApprovalDO::getStatus, 1)
);
if (overseasWarehouseUpdateCount > 0){
throw exception(ORDER_CARGO_CONTROL_OVERSEAS_WAREHOUSE_UPDATE_APPLYING);
}
//不能大于总箱数
if (createReqVO.getPickNum() > orderDO.getSumNum()) {
throw exception(ORDER_CARGO_CONTROL_NUM_GO_BEYOND);
......
......@@ -253,6 +253,20 @@ public class OrderQueryVO {
@ApiModelProperty(value = "自定义付款人信息")
private String customDrawee;
@ApiModelProperty(value = "是否限制修改收货人")
private Boolean isLimitUpdateConsignee;
@ApiModelProperty(value = "开始放货锁定收货人到期时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date beginLockConsigneeTime;
@ApiModelProperty(value = "结束放货锁定收货人到期时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date endLockConsigneeTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始送货时间")
......
......@@ -2430,6 +2430,12 @@
<if test="query.beginTakeTime != null and query.endTakeTime != null ">
AND o.`status` > 19 AND o.`take_time` between #{query.beginTakeTime} and #{query.endTakeTime}
</if>
<if test="query.isLimitUpdateConsignee != null">
AND o.`is_limit_update_consignee` = #{query.isLimitUpdateConsignee,jdbcType=BOOLEAN}
</if>
<if test="query.beginLockConsigneeTime != null and query.endLockConsigneeTime != null ">
AND o.`lock_consignee_time` between #{query.beginLockConsigneeTime} and #{query.endLockConsigneeTime}
</if>
<if test="query.beginSplitTime != null and query.endSplitTime != null ">
AND o.`split_time` between #{query.beginSplitTime} and #{query.endSplitTime}
</if>
......@@ -2972,6 +2978,12 @@
<if test="query.containerNumber != null and query.containerNumber != '' ">
AND o.`container_number` = #{query.containerNumber}
</if>
<if test="query.isLimitUpdateConsignee != null">
AND o.`is_limit_update_consignee` = #{query.isLimitUpdateConsignee,jdbcType=BOOLEAN}
</if>
<if test="query.beginLockConsigneeTime != null and query.endLockConsigneeTime != null ">
AND o.`lock_consignee_time` between #{query.beginLockConsigneeTime} and #{query.endLockConsigneeTime}
</if>
<if test="query.beginRucangTime != null and query.endRucangTime != null ">
AND o.order_id in(select distinct wi.order_id from ecw_order_warehouse_in wi where wi.deleted = 0 and
wi.`in_time` between #{query.beginRucangTime} and #{query.endRucangTime})
......@@ -4037,6 +4049,12 @@
<if test="query.customerId != null">
AND o.`customer_id` = #{query.customerId}
</if>
<if test="query.isLimitUpdateConsignee != null">
AND o.`is_limit_update_consignee` = #{query.isLimitUpdateConsignee,jdbcType=BOOLEAN}
</if>
<if test="query.beginLockConsigneeTime != null and query.endLockConsigneeTime != null ">
AND o.`lock_consignee_time` between #{query.beginLockConsigneeTime} and #{query.endLockConsigneeTime}
</if>
<if test="query.beginRucangTime != null and query.endRucangTime != null ">
AND o.order_id in(select distinct wi.order_id from ecw_order_warehouse_in wi where wi.deleted = 0 and
wi.`in_time` between #{query.beginRucangTime} and #{query.endRucangTime})
......@@ -4358,6 +4376,12 @@
<if test="query.beginTakeTime != null and query.endTakeTime != null ">
AND o.`status` > 19 AND o.`take_time` between #{query.beginTakeTime} and #{query.endTakeTime}
</if>
<if test="query.isLimitUpdateConsignee != null">
AND o.`is_limit_update_consignee` = #{query.isLimitUpdateConsignee,jdbcType=BOOLEAN}
</if>
<if test="query.beginLockConsigneeTime != null and query.endLockConsigneeTime != null ">
AND o.`lock_consignee_time` between #{query.beginLockConsigneeTime} and #{query.endLockConsigneeTime}
</if>
<if test="query.beginSplitTime != null and query.endSplitTime != null ">
AND o.`split_time` between #{query.beginSplitTime} and #{query.endSplitTime}
</if>
......@@ -4535,6 +4559,12 @@
<if test="query.beginTakeTime != null and query.endTakeTime != null ">
AND o.`status` > 19 AND o.`take_time` between #{query.beginTakeTime} and #{query.endTakeTime}
</if>
<if test="query.isLimitUpdateConsignee != null">
AND o.`is_limit_update_consignee` = #{query.isLimitUpdateConsignee,jdbcType=BOOLEAN}
</if>
<if test="query.beginLockConsigneeTime != null and query.endLockConsigneeTime != null ">
AND o.`lock_consignee_time` between #{query.beginLockConsigneeTime} and #{query.endLockConsigneeTime}
</if>
<if test="query.beginSplitTime != null and query.endSplitTime != null ">
AND o.`split_time` between #{query.beginSplitTime} and #{query.endSplitTime}
</if>
......
......@@ -272,3 +272,5 @@ member.id.is.null=
score.count.error=
order.cargo.control.limit.update.consignee.error=
order.cargo.control.limit.update.consignee.info=
order.cargo.control.consignee.limit.update.applying=
order.cargo.control.overseas.warehouse.update.applying=
......@@ -1008,6 +1008,8 @@ order.item.clearance.currency.not.null=Customs clearance fee for order goods, cu
order.item.clearance.unit.not.null=The unit of measurement for customs clearance fees for order goods cannot be empty
order.cargo.control.limit.update.consignee.error=The current control order restricts the modification of the consignee, and no restriction time was found
order.cargo.control.limit.update.consignee.info=The recipient restriction modification time for the controlled goods order has not expired, and the recipient information for the order cannot be modified
order.cargo.control.consignee.limit.update.applying=The consignee's restriction modification application is in progress, and the goods cannot be released!
order.cargo.control.overseas.warehouse.update.applying=The overseas warehouse modification application cannot proceed with the release of goods!
member.id.is.null=no member ids
score.count.error= score count must > 0
......
......@@ -1033,7 +1033,8 @@ reward.redeem.recipient.error = \u793C\u54C1\u6536\u8D27\u4EBA\u4FE1\u606F\u4E0D
redeem.import.no.record = \u8868\u683C\u4E2D\u65E0\u8BB0\u5F55
order.cargo.control.limit.update.consignee.error=\u5f53\u524d\u63a7\u8d27\u8ba2\u5355\u9650\u5236\u4fee\u6539\u6536\u8d27\u4eba\uff0c\u672a\u67e5\u8be2\u5230\u9650\u5236\u65f6\u95f4
order.cargo.control.limit.update.consignee.info=\u63a7\u8d27\u8ba2\u5355\u6536\u8d27\u4eba\u9650\u5236\u4fee\u6539\u65f6\u95f4\u672a\u5230\u671f\uff0c\u4e0d\u80fd\u4fee\u6539\u8ba2\u5355\u6536\u8d27\u4eba\u4fe1\u606f
order.cargo.control.consignee.limit.update.applying=\u6536\u8d27\u4eba\u9650\u5236\u4fee\u6539\u7533\u8bf7\u4e2d\uff0c\u4e0d\u80fd\u8fdb\u884c\u653e\u8d27\uff01
order.cargo.control.overseas.warehouse.update.applying=\u6d77\u5916\u4ed3\u4fee\u6539\u7533\u8bf7\u4e2d\uff0c\u4e0d\u80fd\u8fdb\u884c\u653e\u8d27\uff01
get.lock.failed = \u670D\u52A1\u7E41\u5FD9\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5
reward.redeem.not.exist = \u793C\u54C1\u5151\u6362\u8BB0\u5F55\u4E0D\u5B58\u5728
......
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