Commit 130b198d authored by zhengyi's avatar zhengyi

控货相关的审批业务部分提交

Signed-off-by: default avatarzhengyi <landuo321@aliyun.com>
parent ec4cc447
...@@ -93,8 +93,8 @@ public enum WorkFlowEmus { ...@@ -93,8 +93,8 @@ public enum WorkFlowEmus {
FINANCE_COMMISSION_PAYMENT_WRITE_OFF("finance_commission_payment_write_off", "财务审核-佣金付款单核销审核"), FINANCE_COMMISSION_PAYMENT_WRITE_OFF("finance_commission_payment_write_off", "财务审核-佣金付款单核销审核"),
FINANCE_COMMISSION_PAYMENT_WRITE_OFF_NO("finance_commission_payment_write_off_no", "财务审核-佣金付款单反核销审核"), FINANCE_COMMISSION_PAYMENT_WRITE_OFF_NO("finance_commission_payment_write_off_no", "财务审核-佣金付款单反核销审核"),
SHIPMENT_LINE_WEIGHT_ALLOW_OVER("shipment_line_weight_allow_over", "出货审批-允许超出线路重量上限审核"), SHIPMENT_LINE_WEIGHT_ALLOW_OVER("shipment_line_weight_allow_over", "出货审批-允许超出线路重量上限审核"),
ORDER_MODEL_CHANGE("order_model_change", "订单审批-订单模式变更审核"), ORDER_MODEL_CHANGE("order_model_change", "订单审批-订单海外仓修改审核"),
SHIPMENT_CHANGE_RELEASE_GOODS_LIMIT("shipment_change_release_goods_limit", "出货审批-变更出货限制审核"), SHIPMENT_CHANGE_RELEASE_GOODS_LIMIT("shipment_change_release_goods_limit", "订单审批-变更放货限制审核"),
; ;
private String key; private String key;
private String value; private String value;
......
...@@ -3,14 +3,19 @@ package cn.iocoder.yudao.module.bpm.service.order.listener; ...@@ -3,14 +3,19 @@ package cn.iocoder.yudao.module.bpm.service.order.listener;
import cn.iocoder.yudao.module.bpm.enums.WorkFlowEmus; import cn.iocoder.yudao.module.bpm.enums.WorkFlowEmus;
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEvent; import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEvent;
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener; import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
import cn.iocoder.yudao.module.order.service.order.OrderFeeApplicationService;
import cn.iocoder.yudao.module.order.service.orderCargoControl.OrderCargoControlService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Component @Component
@Slf4j @Slf4j
public class BmpOrderModelChangeResultListener extends BpmProcessInstanceResultEventListener { public class BmpOrderModelChangeResultListener extends BpmProcessInstanceResultEventListener {
@Resource
OrderCargoControlService orderCargoControlService;
@Override @Override
protected String getProcessDefinitionKey() { protected String getProcessDefinitionKey() {
return WorkFlowEmus.ORDER_MODEL_CHANGE.getKey(); return WorkFlowEmus.ORDER_MODEL_CHANGE.getKey();
...@@ -18,7 +23,8 @@ public class BmpOrderModelChangeResultListener extends BpmProcessInstanceResultE ...@@ -18,7 +23,8 @@ public class BmpOrderModelChangeResultListener extends BpmProcessInstanceResultE
@Override @Override
protected void onEvent(BpmProcessInstanceResultEvent event) { protected void onEvent(BpmProcessInstanceResultEvent event) {
log.info("----------------------订单模式变更审核----------------------,{},{}" + event.getBusinessKey(), event.getResult()); log.info("----------------------控货订单海外仓修改审核----------------------,{},{}" + event.getBusinessKey(), event.getResult());
orderCargoControlService.approvalOrderCargoControl(event.getBusinessKey(), event.getResult());
} }
} }
...@@ -3,14 +3,19 @@ package cn.iocoder.yudao.module.bpm.service.shipment.listener; ...@@ -3,14 +3,19 @@ package cn.iocoder.yudao.module.bpm.service.shipment.listener;
import cn.iocoder.yudao.module.bpm.enums.WorkFlowEmus; import cn.iocoder.yudao.module.bpm.enums.WorkFlowEmus;
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEvent; import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEvent;
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener; import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
import cn.iocoder.yudao.module.order.service.orderCargoControl.OrderCargoControlService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Component @Component
@Slf4j @Slf4j
public class BmpChangeReleaseGoodsLimitResultListener extends BpmProcessInstanceResultEventListener { public class BmpChangeReleaseGoodsLimitResultListener extends BpmProcessInstanceResultEventListener {
@Resource
OrderCargoControlService orderCargoControlService;
@Override @Override
protected String getProcessDefinitionKey() { protected String getProcessDefinitionKey() {
return WorkFlowEmus.SHIPMENT_CHANGE_RELEASE_GOODS_LIMIT.getKey(); return WorkFlowEmus.SHIPMENT_CHANGE_RELEASE_GOODS_LIMIT.getKey();
...@@ -18,7 +23,8 @@ public class BmpChangeReleaseGoodsLimitResultListener extends BpmProcessInstance ...@@ -18,7 +23,8 @@ public class BmpChangeReleaseGoodsLimitResultListener extends BpmProcessInstance
@Override @Override
protected void onEvent(BpmProcessInstanceResultEvent event) { protected void onEvent(BpmProcessInstanceResultEvent event) {
log.info("----------------------变更出货限制回调----------------------,{},{}" + event.getBusinessKey(), event.getResult()); log.info("----------------------变更放货限制回调----------------------,{},{}" + event.getBusinessKey(), event.getResult());
orderCargoControlService.approvalOrderCargoControl(event.getBusinessKey(), event.getResult());
} }
} }
...@@ -39,7 +39,10 @@ public class OrderApprovalDO extends BaseDO { ...@@ -39,7 +39,10 @@ public class OrderApprovalDO extends BaseDO {
* 7 控货订单放货修改 8 控货订单反复核 9 控货订单已放货记录调货审批 10 控货订单取消放货 * 7 控货订单放货修改 8 控货订单反复核 9 控货订单已放货记录调货审批 10 控货订单取消放货
* 11 合单申请 12 费用申请 13 调仓申请 14 订单修改 18 预装审核 19 封柜审核 * 11 合单申请 12 费用申请 13 调仓申请 14 订单修改 18 预装审核 19 封柜审核
* 22 入仓修改 23 退仓 * 22 入仓修改 23 退仓
*
* 41 批量费用申请 * 41 批量费用申请
*
* 61 修改放货限制 62 海外仓修改申请
*/ */
private Integer type; private Integer type;
/** /**
......
...@@ -166,6 +166,21 @@ public interface OrderApprovalMapper extends AbstractMapper<OrderApprovalDO> { ...@@ -166,6 +166,21 @@ public interface OrderApprovalMapper extends AbstractMapper<OrderApprovalDO> {
}) })
OrderApprovalDO newOrderCargoControlPickInfo(@Param("orderId") Long orderId, @Param("id") Long id, @Param("type") Integer type); OrderApprovalDO newOrderCargoControlPickInfo(@Param("orderId") Long orderId, @Param("id") Long id, @Param("type") Integer type);
@ResultType(OrderApprovalDO.class)
@Select({
"<script>",
"select",
" * ",
"from ecw_order_approval ",
"where ",
"order_id = #{orderId} ",
"and type = #{type} ",
"order by order_approval_id desc",
"limit 1",
"</script>"
})
OrderApprovalDO orderApprovalInfoByOrderIdAndType(@Param("orderId") Long orderId, @Param("type") Integer type);
@ResultType(OrderApprovalDO.class) @ResultType(OrderApprovalDO.class)
@Select({ @Select({
"<script>", "<script>",
......
...@@ -11,10 +11,8 @@ import cn.iocoder.yudao.module.order.dto.OrderQueryDTO; ...@@ -11,10 +11,8 @@ import cn.iocoder.yudao.module.order.dto.OrderQueryDTO;
import cn.iocoder.yudao.module.order.vo.order.OrderBackPageVO; import cn.iocoder.yudao.module.order.vo.order.OrderBackPageVO;
import cn.iocoder.yudao.module.order.vo.order.OrderQueryVO; import cn.iocoder.yudao.module.order.vo.order.OrderQueryVO;
import cn.iocoder.yudao.module.order.vo.order.OrderSendSmsReqVO; import cn.iocoder.yudao.module.order.vo.order.OrderSendSmsReqVO;
import cn.iocoder.yudao.module.order.vo.orderCargoControl.OrderCargoControlBackVO; import cn.iocoder.yudao.module.order.vo.orderCargoControl.*;
import cn.iocoder.yudao.module.order.vo.orderCargoControl.OrderCargoControlCreateReqVO; import cn.iocoder.yudao.module.order.vo.orderCargoControlPick.OrderCargoControlPickApplyVO;
import cn.iocoder.yudao.module.order.vo.orderCargoControl.OrderCargoControlQueryVO;
import cn.iocoder.yudao.module.order.vo.orderCargoControl.OrderCargoControlUpdateReqVO;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
...@@ -134,4 +132,35 @@ public interface OrderCargoControlService extends IService<OrderCargoControlDO> ...@@ -134,4 +132,35 @@ public interface OrderCargoControlService extends IService<OrderCargoControlDO>
* @return 返回是或否 * @return 返回是或否
*/ */
Boolean checkControlPassword(Long orderId); Boolean checkControlPassword(Long orderId);
/**
* @param approveId 表单业务ID
* @param result 1 处理中 2 通过 3 不通过 4 已取消
*/
void approvalOrderCargoControl(String approveId, Integer result);
/**
* 订单放货限制修改申请
*
* @param orderId 订单ID
* @return 订单放货限制修改申请业务表单详情
*/
OrderCargoControlApplyVO approvalOrderCargoControlPickLimitUpdateByOrderId(Long orderId);
/**
* 订单海外仓修改申请
*
* @param orderId 订单ID
* @return 订单海外仓修改申请业务表单详情
*/
OrderCargoControlApplyVO approvalOrderCargoControlOverseasWarehouseUpdateByOrderId(Long orderId);
/**
* 订单控货相关申请管理
*
* @param orderCargoControlApplyVO 控货订单审批业务申请信息
*/
void orderCargoControlPickApply(OrderCargoControlApplyVO orderCargoControlApplyVO);
} }
...@@ -1330,7 +1330,14 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo ...@@ -1330,7 +1330,14 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
userId = Long.valueOf(dto.getValue()); userId = Long.valueOf(dto.getValue());
} }
OrderApprovalDO approvalDO = orderApprovalMapper.selectById(orderApprovalId); OrderApprovalDO approvalDO = orderApprovalMapper.selectById(orderApprovalId);
if (approvalDO.getDeleted() || (approvalDO.getType() != 7 && approvalDO.getType() != 8 && approvalDO.getType() != 9 && approvalDO.getType() != 10 && approvalDO.getStatus() != 1)) { if (approvalDO.getDeleted() ||
(approvalDO.getType() != 7
&& approvalDO.getType() != 8
&& approvalDO.getType() != 9
&& approvalDO.getType() != 10
&& approvalDO.getType() != 61
&& approvalDO.getType() != 62
&& approvalDO.getStatus() != 1)) {
throw exception(ORDER_APPROVAL_STATUS_NOT_CORRECT); throw exception(ORDER_APPROVAL_STATUS_NOT_CORRECT);
} }
if (Objects.isNull(approvalDO.getFormId())) { if (Objects.isNull(approvalDO.getFormId())) {
......
package cn.iocoder.yudao.module.order.vo.orderCargoControl;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
@Data
@ApiModel(value = "订单控货相关审核信息")
public class OrderCargoControlApplyVO {
@ApiModelProperty(value = "申请类型:此处应该是 61 放货限制修改申请 62 海外仓修改申请", required = true)
@NotNull(message = "申请类型不能为空")
private Integer applyType;
@ExcelProperty("订单id")
@ApiModelProperty(value = "订单id")
@NotNull(message = "订单ID不能为空")
private Long orderId;
@ApiModelProperty(value = "订单编号")
private String orderNo;
@ApiModelProperty(value = "提单号")
private String tidanNo;
@ApiModelProperty(value = "是否控货")
private Boolean isCargoControl;
@ApiModelProperty(value = "0 控货中;1 已放完货;2 部分控货")
private Integer cargoControlStatus;
@ApiModelProperty(value = "入仓数量")
private Integer sumQuantity = 0;
@ApiModelProperty(value = "入仓箱数")
private Integer sumNum = 0;
@ApiModelProperty(value = "入仓体积")
private BigDecimal sumVolume = BigDecimal.ZERO;
@ApiModelProperty(value = "入仓重量")
private BigDecimal sumWeight = BigDecimal.ZERO;
@ApiModelProperty(value = "已放货箱数")
private Integer releaseNum = 0;
@ApiModelProperty(value = "原放货箱数")
private Integer pickNum = 0;
@ApiModelProperty(value = "现在放货箱数")
private Integer currentPickNum = 0;
@ApiModelProperty(value = "放货数量")
private Integer pickQuantity = 0;
@ApiModelProperty(value = "放货体积")
private BigDecimal pickVolume = BigDecimal.ZERO;
@ApiModelProperty(value = "放货重量")
private BigDecimal pickWeight = BigDecimal.ZERO;
@ApiModelProperty(value = "是否限制修改收货人")
private Boolean isLimitUpdateConsignee;
@ApiModelProperty(value = "放货锁定收货人天数")
private Integer lockConsigneeDay;
// @ApiModelProperty(value = "放货锁定收货人到期时间")
// @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
// @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
// private Date lockConsigneeTime;
@ApiModelProperty(value = "附件")
private String annex;
@ApiModelProperty(value = "修改原因")
private String reasonZh;
@ApiModelProperty(value = "审批状态: 1 处理中 2 通过 3 不通过 4 已取消")
private Integer applyStatus = 1;
@ApiModelProperty(value = "抄送人(id逗号拼接)")
private String ccIds;
}
...@@ -142,4 +142,17 @@ public class OrderCargoControlController { ...@@ -142,4 +142,17 @@ public class OrderCargoControlController {
orderCargoControlService.sendSmsCode(getLoginUserId(), reqVO, null); orderCargoControlService.sendSmsCode(getLoginUserId(), reqVO, null);
return success(true); return success(true);
} }
@GetMapping("cancel/approval/{orderApprovalId}")
@ApiOperation("根据审批id取消审批")
@ApiImplicitParams({
@ApiImplicitParam(name = "orderApprovalId", value = "审批ID", required = true, example = "1024", dataType = "Long"),
@ApiImplicitParam(name = "reason", value = "取消原因", required = true, example = "1024", dataType = "String")
})
@Deprecated
public CommonResult<Boolean> cancelApprovalByOrderApprovalId(@PathVariable(value = "orderApprovalId") Long orderApprovalId,
@RequestParam(value = "reason") String reason) {
orderCargoControlPickService.cancelApprovalByOrderApprovalId(orderApprovalId, reason);
return success(Boolean.TRUE);
}
} }
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