Commit 03ff9fb0 authored by zhengyi's avatar zhengyi

完善控货订单放货限制修改申请业务

Signed-off-by: default avatarzhengyi <landuo321@aliyun.com>
parent 130b198d
package cn.iocoder.yudao.module.order.service.orderCargoControl; package cn.iocoder.yudao.module.order.service.orderCargoControl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.spring.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.util.spring.enums.UserTypeEnum;
...@@ -51,6 +52,7 @@ import com.alibaba.excel.ExcelWriter; ...@@ -51,6 +52,7 @@ import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -493,11 +495,21 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont ...@@ -493,11 +495,21 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
// TODO 审批取消、审批拒绝,待补充业务日志及其他细节 // TODO 审批取消、审批拒绝,待补充业务日志及其他细节
return; return;
} }
if (result == 2){ if (result == 2) {
if (orderApprovalDO.getType() == 61){ OrderCargoControlApplyVO applyVO = JSONObject.parseObject(orderApprovalDO.getDetails(), OrderCargoControlApplyVO.class);
// TODO 修改放货限制 if (orderApprovalDO.getType() == 61) {
} // 修改放货限制
if (orderApprovalDO.getType() == 62){ Integer lockConsigneeDay = applyVO.getIsLimitUpdateConsignee() ? applyVO.getLockConsigneeDay() : null;
OrderDO orderDO = orderService.getById(applyVO.getOrderId());
Date lockConsigneeTime = Objects.isNull(orderDO.getUnloadTime()) || Objects.isNull(lockConsigneeDay) ? null : DateUtil.endOfDay(DateUtil.offsetDay(orderDO.getUnloadTime(), lockConsigneeDay));;
orderService.update(new LambdaUpdateWrapper<OrderDO>()
.set(OrderDO::getIsLimitUpdateConsignee, applyVO.getIsLimitUpdateConsignee())
.set(OrderDO::getLockConsigneeDay, lockConsigneeDay)
.set(OrderDO::getLockConsigneeTime, lockConsigneeTime)
.eq(OrderDO::getOrderId, orderApprovalDO.getOrderId()));
// TODO 补充订单日志
}
if (orderApprovalDO.getType() == 62) {
// TODO 海外仓修改申请 // TODO 海外仓修改申请
} }
} }
...@@ -563,7 +575,7 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont ...@@ -563,7 +575,7 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
String formId = bpmCreateServiceFactory.createBmp(userId, orderApprovalDO.getOrderApprovalId(), WorkFlowEmus.ORDER_MODEL_CHANGE.getKey(), orderDO.getOrderNo(), String formId = bpmCreateServiceFactory.createBmp(userId, orderApprovalDO.getOrderApprovalId(), WorkFlowEmus.ORDER_MODEL_CHANGE.getKey(), orderDO.getOrderNo(),
StringUtils.isNotBlank(orderCargoControlApplyVO.getCcIds()) ? orderCargoControlApplyVO.getCcIds().split(StrUtil.COMMA) : null); StringUtils.isNotBlank(orderCargoControlApplyVO.getCcIds()) ? orderCargoControlApplyVO.getCcIds().split(StrUtil.COMMA) : null);
orderApprovalDO.setFormId(formId); orderApprovalDO.setFormId(formId);
}else if (orderCargoControlApplyVO.getApplyType() == 62) { } else if (orderCargoControlApplyVO.getApplyType() == 62) {
orderApprovalDO.setOrderId(orderCargoControlApplyVO.getOrderId()); orderApprovalDO.setOrderId(orderCargoControlApplyVO.getOrderId());
orderApprovalDO.setType(62); orderApprovalDO.setType(62);
orderApprovalDO.setDetails(JSONObject.toJSONString(orderCargoControlApplyVO)); orderApprovalDO.setDetails(JSONObject.toJSONString(orderCargoControlApplyVO));
......
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