Commit 5680fecb authored by lanbaoming's avatar lanbaoming

2024-06-05

parent 96e27c3b
......@@ -18,13 +18,15 @@ public class BpmOrderRevokeSplitOrderResultListener extends BpmProcessInstanceRe
OrderSplitService orderSplitService;
@Override
protected String getProcessDefinitionKey() {
return WorkFlowEmus.REVOKE_SPLIT_ORDER.getKey();
}
@Override
protected void onEvent(BpmProcessInstanceResultEvent event) {
log.info("-------------------撤销拆单审核回调-------------------------{},{}", event.getBusinessKey(), event.getResult());
orderSplitService.revokeSplitApplyCallback(event.getBusinessKey(), event.getResult());
orderSplitService.revokeSplitApplyCallback(event.getBusinessKey(),
event.getResult());
}
}
......@@ -46,6 +46,7 @@ public interface OrderMutualMapper extends AbstractMapper<OrderMutualDO> {
return null;
}
/* lanbm 2024-06-05 修改BUG
@Select("update ecw_order_mutual set deleted=0 where creator=#{query.creator} and create_time=#{query.createTime} " +
"and updater=#{query.updater} and update_time=#{query.updateTime} and mutual_order_id=#{query.mutualOrderId}")
void updateMutualBackByRelatId(OrderMutualDO item);
......@@ -53,4 +54,13 @@ public interface OrderMutualMapper extends AbstractMapper<OrderMutualDO> {
@Select("update ecw_order_mutual set deleted=0 where creator=#{query.creator} and create_time=#{query.createTime} " +
"and updater=#{query.updater} and update_time=#{query.updateTime} and order_id=#{query.orderId}")
void updateMutualBackByOrderId(OrderMutualDO item);
*/
@Select("update ecw_order_mutual set deleted=0 where creator=#{creator} and create_time=#{createTime} " +
"and updater=#{updater} and update_time=#{updateTime} and mutual_order_id=#{mutualOrderId}")
void updateMutualBackByRelatId(OrderMutualDO item);
@Select("update ecw_order_mutual set deleted=0 where creator=#{creator} and create_time=#{createTime} " +
"and updater=#{updater} and update_time=#{updateTime} and order_id=#{orderId}")
void updateMutualBackByOrderId(OrderMutualDO item);
}
......@@ -97,9 +97,11 @@ public class OrderMutualServiceImpl extends AbstractService<OrderMutualMapper, O
@Override
@Transactional(rollbackFor = Exception.class)
public void dealMutualByOrderId(Long orderId,List<Long> splitOrderIds,int type) {
public void dealMutualByOrderId(Long orderId,
List<Long> splitOrderIds,int type) {
if (type == 1) {
List<OrderMutualDO> orderMutualDOS = mutualMapper.selectList(new LambdaQueryWrapperX<OrderMutualDO>()
List<OrderMutualDO> orderMutualDOS =
mutualMapper.selectList(new LambdaQueryWrapperX<OrderMutualDO>()
.and(i -> i.eq(OrderMutualDO::getMutualOrderId, orderId)
.or()
.eq(OrderMutualDO::getOrderId, orderId)
......@@ -125,8 +127,15 @@ public class OrderMutualServiceImpl extends AbstractService<OrderMutualMapper, O
} else if (type == 2) {
if (CollectionUtil.isNotEmpty(splitOrderIds)) {
//删除拆单后的关联订单,不管后面有没有新增关联,都删除才对
List<OrderMutualDO> orderGuanlianDOS = mutualMapper.selectList(new LambdaQueryWrapperX<OrderMutualDO>().and(i -> i.in(OrderMutualDO::getOrderId, splitOrderIds).or().in(OrderMutualDO::getMutualOrderId, splitOrderIds)));
List<OrderMutualDO> orderGuanlianDOS =
mutualMapper.selectList(
new LambdaQueryWrapperX<OrderMutualDO>().
and(i -> i.in(OrderMutualDO::getOrderId,
splitOrderIds).or().
in(OrderMutualDO::getMutualOrderId,
splitOrderIds)));
orderGuanlianDOS.stream().forEach(item -> {
if (splitOrderIds.contains(item.getOrderId())) {
mutualMapper.updateMutualBackByRelatId(item);
} else if (splitOrderIds.contains(item.getMutualOrderId())) {
......
......@@ -1124,7 +1124,8 @@ public class OrderQueryServiceImpl implements OrderQueryService {
log.warn(I18nMessage.getLang().toString());
int start = (page.getPage() - 1) * page.getRows();
int size = page.getRows();
List<OrderBackPageVO> list = orderMapper.adminCargoControlOrderList(start, size, query);
List<OrderBackPageVO> list =
orderMapper.adminCargoControlOrderList(start, size, query);
return new PageResult<>(list, total, mpPage.getSize(), page.getPage(), (total + mpPage.getSize() - 1) / mpPage.getSize());
}
......
......@@ -6069,11 +6069,15 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
@Override
public void deleteOrderByParentOrderId(Long parentOrderId, List<OrderBackInfoDto> orderBackInfoDtoList) {
public void deleteOrderByParentOrderId(Long parentOrderId,
List<OrderBackInfoDto> orderBackInfoDtoList) {
// 置空母订单的拆单时间
this.update(new LambdaUpdateWrapper<OrderDO>().set(OrderDO::getSplitTime, null).eq(OrderDO::getOrderId, parentOrderId));
this.update(new LambdaUpdateWrapper<OrderDO>().set(OrderDO::getSplitTime,
null).eq(OrderDO::getOrderId, parentOrderId));
// 查询相关子订单信息,并且删除子订单相关的记录,避免重新撤销拆单后再次拆单的数据重复
List<OrderDO> orderDOList = orderMapper.selectList(new LambdaQueryWrapper<OrderDO>().eq(OrderDO::getParentOrderId, parentOrderId));
List<OrderDO> orderDOList =
orderMapper.selectList(new LambdaQueryWrapper<OrderDO>().eq(OrderDO::getParentOrderId, parentOrderId));
if (CollectionUtil.isNotEmpty(orderBackInfoDtoList)) {
List<Long> orderIds = new ArrayList<>();
for (OrderBackInfoDto splitOrder : orderBackInfoDtoList) {
......@@ -6103,7 +6107,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
// 处理关联关系
orderGuanlianService.dealGuanlianByOrderId(parentOrderId, orderIds, 2);
// 处理互斥关系
orderMutualService.dealMutualByOrderId(parentOrderId, orderIds, 2);
orderMutualService.dealMutualByOrderId(parentOrderId,
orderIds, 2);
// 物理删除订单 ,在所有业务执行完成后进行删除
orderMapper.remove(orderIds);
}
......
......@@ -270,7 +270,8 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
// 修改订单控货状态
String msg = "";
if (Objects.equals(orderCargoControlPick.getControlNum(), orderCargoControlPick.getPickNum())) {
if (Objects.equals(orderCargoControlPick.getControlNum(),
orderCargoControlPick.getPickNum())) {
// 已放完货
orderDO.setCargoControlStatus(1);
msg = String.format("订单放货%s箱, 放货方式:%s, 已放完货, 收货人姓名%s,电话+%s", orderCargoControlPick.getPickNum(), isPasswordPick ? "密码放货" : "验证码放货",
......
......@@ -1475,17 +1475,23 @@ public class OrderSplitServiceImpl extends AbstractService<OrderSplitMapper, Ord
@Override
public void revokeSplitApplyCallback(String approvalId, Integer result) {
OrderApprovalDO orderApprovalDO = orderApprovalService.getById(approvalId);
OrderApprovalDO orderApprovalDO =
orderApprovalService.getById(approvalId);
//detail转对象
OrderSplitRevokeApplyDetailDto orderSplitRevokeApplyDetailDto = JSON.parseObject(orderApprovalDO.getDetails(), OrderSplitRevokeApplyDetailDto.class);
OrderSplitRevokeApplyDetailDto orderSplitRevokeApplyDetailDto =
JSON.parseObject(orderApprovalDO.getDetails(),
OrderSplitRevokeApplyDetailDto.class);
OrderBackInfoDto parentOrder = orderSplitRevokeApplyDetailDto.getParentOrder();
OrderBackInfoDto parentOrder =
orderSplitRevokeApplyDetailDto.getParentOrder();
List<OrderBackInfoDto> childrenOrderList = orderSplitRevokeApplyDetailDto.getChildrenOrderList();
List<OrderBackInfoDto> childrenOrderList =
orderSplitRevokeApplyDetailDto.getChildrenOrderList();
//更新审核单状态
orderApprovalService.callbackUpdate(orderApprovalDO, orderApprovalDO.getFormId(), result);
orderApprovalService.callbackUpdate(orderApprovalDO,
orderApprovalDO.getFormId(), result);
String processingResults = orderApprovalDO.getProcessingResults();
if (ApprovalResultStatusEnum.reject.getValue().equals(result)) {
......@@ -1517,20 +1523,30 @@ public class OrderSplitServiceImpl extends AbstractService<OrderSplitMapper, Ord
} else if (ApprovalResultStatusEnum.pass.getValue().equals(result)) {
OrderDO orderDO = orderService.getById(parentOrder.getOrderId());
// 记录撤销拆单成功的动态日志
orderBusinessService.addOrderTimeLog(orderDO.getStatus(), orderDO, 10);
orderBusinessService.addOrderTimeLog(orderDO.getStatus(),
orderDO, 10);
// 所有子订单的订单id
// List<Long> orderIds = childrenOrderList.stream().map(OrderBackInfoDto::getOrderId).collect(Collectors.toList());
// 校验标签箱号范围值
// this.checkLabel(orderDO, orderIds);
// 补全原单的标签箱号记录
orderLabelService.updateRevokeSplitOrderLabel(orderDO, childrenOrderList);
orderLabelService.updateRevokeSplitOrderLabel(orderDO,
childrenOrderList);
//更新订单状态 入仓-撤销拆单-已通过 ,注:避免原单是出货阶段进行的拆单,撤销拆单需要重置出货状态,出货阶段是不允许撤销拆单的
orderService.updateStatus(parentOrder.getOrderId(), null, OrderStatusEnum.IN_WAREHOUSE.getValue(), null, OrderWarehouseInStatusEnum.warehouse_finished.getValue(), 0,
0, OrderApprovalTypeResultEnum.typeAndResultOf(orderApprovalDO.getType(), result).getDesc(), null, false);
orderService.updateStatus(parentOrder.getOrderId(),
null, OrderStatusEnum.IN_WAREHOUSE.getValue(),
null,
OrderWarehouseInStatusEnum.warehouse_finished.getValue(),
0,
0,
OrderApprovalTypeResultEnum.typeAndResultOf(orderApprovalDO.getType(),
result).getDesc(),
null,
false);
// 撤销拆单将母订单的动态重置
if (parentOrder.getTransportId() == 1){
if (parentOrder.getTransportId() == 1) {
orderTimeService.preReverseReviewDeleteOrderTime(parentOrder.getOrderId());
}else if (parentOrder.getTransportId() == 3){
} else if (parentOrder.getTransportId() == 3) {
orderTimeService.sortingReverseReviewDeleteOrderTime(parentOrder.getOrderId());
}
//纪录仓库操作
......@@ -1547,7 +1563,8 @@ public class OrderSplitServiceImpl extends AbstractService<OrderSplitMapper, Ord
splitItemMapper.deleteByOrderId(parentOrder.getOrderId());
splitMapper.deleteByOrderId(parentOrder.getOrderId());
// 删除已撤销的拆单
orderService.deleteOrderByParentOrderId(parentOrder.getOrderId(), childrenOrderList);
orderService.deleteOrderByParentOrderId(parentOrder.getOrderId(),
childrenOrderList);
}
}
......
......@@ -86,11 +86,15 @@ public class OrderCargoControlController {
// }
/*
控货订单列表 lanbm 2024-06-05 添加注释
*/
@GetMapping("/cargo/control/order")
@ApiOperation("获得控货订单列表查询订单分页")
public CommonResult<PageResult<OrderBackPageVO>> cargoControlOrderPage(OrderQueryVO query, PageVO page) {
query.setUserType(UserTypeEnum.ADMIN.getValue());
PageResult<OrderBackPageVO> pageResult = orderCargoControlService.orderPage(query, page);
PageResult<OrderBackPageVO> pageResult =
orderCargoControlService.orderPage(query, page);
return success(pageResult);
}
......
......@@ -183,7 +183,7 @@ public class BoxController {
@GetMapping("/page")
@ApiOperation("获得出货分页, use this")
// @PreAuthorize("@ss.hasPermission({'shipment:box:query', 'shipment:box:query:air'})")
//@PreAuthorize("@ss.hasPermission({'shipment:box:query', 'shipment:box:query:air'})")
public CommonResult<PageResult<BoxBackVO>> getBoxPage(@Valid BoxQueryVO query, PageVO page) {
//lanbm 2024-05-13 处理问题添加注释
return success(boxService.getBoxPage(query, page));
......
......@@ -313,10 +313,17 @@ public class BoxPreloadGoodsController {
return success("");
}
/*
海运已装单下载 lanbm 2024-06-05 修改模板
添加注释
*/
@GetMapping("/downloadLoadGoodsList")
@ApiOperation("下载已装单")
@ApiImplicitParam(name = "shipmentId", value = "出货单ID", required = true, example = "20", dataTypeClass = Long.class)
public CommonResult<String> downloadLoadGoodsList(@RequestParam("shipmentId") Long shipmentId, HttpServletResponse response) throws Exception {
public CommonResult<String> downloadLoadGoodsList(
@RequestParam("shipmentId") Long shipmentId,
HttpServletResponse response) throws Exception {
BoxDO box = boxService.getBox(shipmentId);
FileMakeReqDTO reqDTO = new FileMakeReqDTO();
JSONObject jsonObject = new JSONObject();
......
package cn.iocoder.yudao.module.wealth.vo.receiptItem;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import com.alibaba.excel.annotation.ExcelProperty;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
......@@ -52,7 +55,7 @@ public class ReceiptItemBackVO {
private Long currencyId;
@ExcelProperty("创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
@ApiModelProperty(value = "创建时间")
private Date createTime;
......@@ -61,7 +64,7 @@ public class ReceiptItemBackVO {
private String rate;
@ExcelProperty("实收日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
@ApiModelProperty(value = "实收日期")
private Date amountDate;
......
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