Commit ab06b799 authored by zhengyi's avatar zhengyi

Merge branch 'release-fix' into release

parents 51aa7709 3c999a77
......@@ -404,4 +404,17 @@ public interface ErrorCodeConstants {
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");
ErrorCode ORDER_EXISTS_PICKUP_NOT_CARGO_CONTROL = new ErrorCode(1004001159, "order.exists.pickup.not.cargo.control");
ErrorCode ORDER_EXISTS_PICK_NOT_CANCEL_CARGO_CONTROL = new ErrorCode(1004001160, "order.exists.pick.not.cancel.cargo.control");
ErrorCode ORDER_OVERSEAS_WAREHOUSE_UPDATE_NEED_APPLY = new ErrorCode(1004001161, "order.overseas.warehouse.update.need.applying");
ErrorCode NOT_UPDATE_DEST_COUNTRY = new ErrorCode(1004001162, "order.not.update.dest.country");
ErrorCode NOT_UPDATE_DEPARTURE = new ErrorCode(1004001163, "order.not.update.departure");
ErrorCode NOT_UPDATE_TRANSPORT = new ErrorCode(1004001164, "order.not.update.transport");
ErrorCode ORDER_PRE_INSTALLATION_UNPACKAGED_CONTAINER_NOT_UPDATE = new ErrorCode(1004001165, "order.pre.installation.unpackaged.container.not.update");
// /空运订单分拣未出货, 锁定订单信息无法修改
ErrorCode ORDER_SORTING_NOT_SHIPMENT_NOT_UPDATE = new ErrorCode(1004001166, "order.sorting.not.shipment.not.update");
}
......@@ -41,19 +41,27 @@ public interface OrderService extends IService<OrderDO> {
OrderDO createOrder(OrderCreateReqVO createReqVO, MemberUserDO memberUserDO);
/**
* 更新订单
* 更新编辑下单或草稿订单
*
* @param updateReqVO 更新信息
*/
void updateOrder(@Valid OrderUpdateReqVO updateReqVO, MemberUserDO memberUserDO);
/**
* 更新订单
* 更新入仓订单
*
* @param updateReqVO 更新信息
* @param memberUserDO 会员信息
*/
void updateOrderApply(@Valid OrderUpdateReqVO updateReqVO, MemberUserDO memberUserDO);
/**
* 更新出货订单
*
* @param updateReqVO 更新信息
*/
void shipmentOrderApplyUpdate(@Valid OrderUpdateReqVO updateReqVO, MemberUserDO memberUserDO);
/**
* 订单入仓
......
......@@ -518,8 +518,17 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
} else if (orderApprovalDO.getType() == 62) {
msg = result == 4 ? "海外仓修改申请取消" : "海外仓修改申请拒绝";
ApplyInfoVO applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改为海外仓模式");
applyInfoVO.setName("订单修改海外仓模式");
// 这里不用判断订单中的值了,只需要看申请结果就能得出原值和新值相反的文案结果
applyInfoVO.setOrgValue(applyVO.getIsOverseasWarehouse() ? "订单修改为非海外仓" : "订单修改为海外仓");
applyInfoVO.setNewValue(applyVO.getIsOverseasWarehouse() ? "订单修改为海外仓" : "订单修改为非海外仓");
list.add(applyInfoVO);
if (StringUtils.isNotBlank(applyVO.getReasonZh())) {
applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改海外仓模式理由");
applyInfoVO.setNewValue(applyVO.getReasonZh());
list.add(applyInfoVO);
}
}
}
if (result == 2) {
......@@ -553,10 +562,27 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
}
} else if (orderApprovalDO.getType() == 62) {
// TODO 海外仓修改申请
String type = orderDO.getType();
if (StringUtils.isNotBlank(type)) {
type = applyVO.getIsOverseasWarehouse() ? type.concat(",2") : Arrays.stream(type.split(",")).filter(s -> !StringUtils.equals("2", s)).collect(Collectors.joining(","));
}else {
type = "2";
}
// TODO 修改订单海外仓模式, 不确定对订单其他方面是否有影响,订单编号生成规则与海外仓无关联
orderService.update(new LambdaUpdateWrapper<OrderDO>().set(OrderDO::getType, type).eq(OrderDO::getOrderId, orderApprovalDO.getOrderId()));
msg = "海外仓修改申请审批通过";
ApplyInfoVO applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改为海外仓模式");
applyInfoVO.setName("订单修改海外仓模式");
// 这里不用判断订单中的值了,只需要看申请结果就能得出原值和新值相反的文案结果
applyInfoVO.setOrgValue(applyVO.getIsOverseasWarehouse() ? "订单修改为非海外仓" : "订单修改为海外仓");
applyInfoVO.setNewValue(applyVO.getIsOverseasWarehouse() ? "订单修改为海外仓" : "订单修改为非海外仓");
list.add(applyInfoVO);
if (StringUtils.isNotBlank(applyVO.getReasonZh())) {
applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改海外仓模式理由");
applyInfoVO.setNewValue(applyVO.getReasonZh());
list.add(applyInfoVO);
}
}
}
orderApprovalMapper.updateById(orderApprovalDO);
......@@ -612,7 +638,7 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
OrderDO orderDO = orderService.getById(orderCargoControlApplyVO.getOrderId());
// TODO 待确认具体拦截哪些审批任务
int count = orderApprovalMapper.processingItemApproval(null, orderCargoControlApplyVO.getOrderId(), Arrays.asList(orderCargoControlApplyVO.getApplyType(), 14));
if (count > 0){
if (count > 0) {
throw exception(ORDER_IS_APPROVAL_IN_PROCESS);
}
OrderCargoControlReleaseInfoDto releaseInfoDto = this.getOrderCargoControlReleaseInfo(orderCargoControlApplyVO.getOrderId());
......@@ -672,6 +698,15 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
list.add(applyInfoVO);
}
} else if (orderCargoControlApplyVO.getApplyType() == 62) {
if (Objects.isNull(orderCargoControlApplyVO.getIsOverseasWarehouse())) {
throw exception(10000000, "请选择订单海外仓修改是或否");
}
if (StringUtils.isNotBlank(orderDO.getType()) && orderDO.getType().contains("2") && orderCargoControlApplyVO.getIsOverseasWarehouse()) {
throw exception(10000000, "该订单已经是海外仓订单");
}
if ((StringUtils.isBlank(orderDO.getType()) || !orderDO.getType().contains("2")) && !orderCargoControlApplyVO.getIsOverseasWarehouse()) {
throw exception(10000000, "该订单已经是非海外仓订单");
}
orderApprovalDO.setOrderId(orderCargoControlApplyVO.getOrderId());
orderApprovalDO.setType(62);
orderApprovalDO.setDetails(JSONObject.toJSONString(orderCargoControlApplyVO));
......@@ -681,8 +716,17 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
orderApprovalDO.setFormId(formId);
msg = "海外仓修改申请";
ApplyInfoVO applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改为海外仓模式");
applyInfoVO.setName("订单修改海外仓模式");
// 这里不用判断订单中的值了,只需要看申请结果就能得出原值和新值相反的文案结果
applyInfoVO.setOrgValue(orderCargoControlApplyVO.getIsOverseasWarehouse() ? "订单修改为非海外仓" : "订单修改为海外仓");
applyInfoVO.setNewValue(orderCargoControlApplyVO.getIsOverseasWarehouse() ? "订单修改为海外仓" : "订单修改为非海外仓");
list.add(applyInfoVO);
if (StringUtils.isNotBlank(orderCargoControlApplyVO.getReasonZh())) {
applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改海外仓模式理由");
applyInfoVO.setNewValue(orderCargoControlApplyVO.getReasonZh());
list.add(applyInfoVO);
}
}
orderApprovalMapper.updateById(orderApprovalDO);
orderService.updateStatus(orderApprovalDO.getOrderId(), "", null, null, null, null, orderApprovalDO.getType(), OrderApprovalTypeResultEnum.typeAndResultOf(orderApprovalDO.getType(), 1).getDesc(), false);
......
......@@ -87,6 +87,10 @@ public class OrderCargoControlApplyVO {
private Integer newLockConsigneeDay;
@ApiModelProperty(value = "是否海外仓")
private Boolean isOverseasWarehouse;
@ApiModelProperty(value = "附件")
private String annex;
......
......@@ -81,6 +81,7 @@ import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.UNAUTHORIZED;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
......@@ -105,7 +106,6 @@ public class OrderController {
private RoleApi roleApi;
@Autowired
private OrderItemService orderItemService;
@Autowired
private ProductService productService;
@Autowired
......@@ -268,7 +268,7 @@ public class OrderController {
@ApiOperation("(新修改订单)订单修改审批申请")
// @PreAuthorize("@ss.hasPermission('ecw:order:update')")
@Idempotent(timeout = 5)
public CommonResult<Boolean> specialApplyOrder(@Valid @RequestBody OrderUpdateReqVO updateReqVO) {
public CommonResult<Boolean> orderUpdateApply(@Valid @RequestBody OrderUpdateReqVO updateReqVO) {
if (Objects.equals(TransportTypeShortEnum.AIR_FREIGHT_LINE.getValue(), updateReqVO.getTransportId())
|| Objects.equals(TransportTypeShortEnum.AIR_SEA_COMBINED_TRANSPORT.getValue(), updateReqVO.getTransportId())) {
if (Objects.isNull(updateReqVO.getChannelId()) || 0 == updateReqVO.getChannelId()) {
......@@ -286,6 +286,27 @@ public class OrderController {
return success(true);
}
@PutMapping("/shipment/update/apply")
@ApiOperation("(新修改订单)订单修改审批申请")
@Idempotent(timeout = 5)
public CommonResult<Boolean> shipmentOrderApplyUpdate(@Valid @RequestBody OrderUpdateReqVO updateReqVO) {
if (Objects.equals(TransportTypeShortEnum.AIR_FREIGHT_LINE.getValue(), updateReqVO.getTransportId())
|| Objects.equals(TransportTypeShortEnum.AIR_SEA_COMBINED_TRANSPORT.getValue(), updateReqVO.getTransportId())) {
if (Objects.isNull(updateReqVO.getChannelId()) || 0 == updateReqVO.getChannelId()) {
throw exception(ORDER_LINE_CHANNEL_NOT_NULL);
}
}
String redisKey = MessageFormat.format(ORDER_UPDATE_KEY, updateReqVO.getOrderId().toString());
Long count = redisHelper.incrBy(redisKey, 1);
if (count > 1) {
return error(ORDER_UPDATE_REPEAT_COMMIT);
}
redisHelper.expire(redisKey, 1, TimeUnit.MINUTES);
orderService.shipmentOrderApplyUpdate(updateReqVO, null);
redisHelper.delete(redisKey);
return success(true);
}
@GetMapping("update/info")
@ApiOperation("获得订单修改申请详情")
@ApiImplicitParam(name = "approveId", value = "审核ID", required = true, example = "1024", dataType = "Long")
......
......@@ -160,6 +160,14 @@ public class OrderCargoControlController {
return success(applyVO);
}
@GetMapping("overseas-warehouse-update/info/{orderId}")
@ApiOperation("根据订单ID查询订单海外仓修改审核详情")
@ApiImplicitParam(name = "orderId", value = "订单ID", required = true, example = "1024", dataType = "Long")
public CommonResult<OrderCargoControlApplyVO> approvalOrderCargoControlOverseasWarehouseUpdateByOrderId(@PathVariable(value = "orderId") Long orderId) {
OrderCargoControlApplyVO applyVO = orderCargoControlService.approvalOrderCargoControlOverseasWarehouseUpdateByOrderId(orderId);
return success(applyVO);
}
@GetMapping("cancel/approval/{orderApprovalId}")
@ApiOperation("根据审批id取消审批")
@ApiImplicitParams({
......
......@@ -121,7 +121,9 @@ public interface OfferMapper extends BaseMapperX<OfferDO> {
"from ecw_offer o ",
"left join ecw_customer_contacts cc on (o.relation = 1 and cc.id = o.consignor_id) or (o.relation = 2 and cc.id = o.consignee_id) ",
"left join ecw_customer user on user.id = o.relation_id ",
"<when test = 'pageVO.sourceIds != null and pageVO.sourceIds.size() > 0'>",
"left join ecw_customer user on user.id = o.relation_id ",
"</when>",
"left join system_user u on u.id = o.follow_up_salesman_id ",
"left join ecw_region s on o.objective_id = s.id ",
"left join ecw_warehouse_line line on o.line_id = line.id ",
......
......@@ -32,6 +32,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
......@@ -44,6 +45,7 @@ import java.text.MessageFormat;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error;
......@@ -135,6 +137,18 @@ public class MakeBillOfLadingController {
return success(true);
}
@PostMapping("/check/billOfLading/{orderId}")
@ApiOperation("检查提单状态是否已制作提单")
@ApiImplicitParam(name = "orderId", value = "该值为orderId", required = true, example = "1024", dataType = "Long")
public CommonResult<Boolean> checkBillOfLadingStatus(@PathVariable Long orderId) {
MakeBillOfLadingDO billOfLadingDO = makeBillOfLadingService.getOne(new LambdaQueryWrapperX<MakeBillOfLadingDO>()
.eq(MakeBillOfLadingDO::getOrderId, orderId)
.orderByDesc(MakeBillOfLadingDO::getId)
.last("limit 1"));
return success(Objects.nonNull(billOfLadingDO) && StringUtils.isNotBlank(billOfLadingDO.getImgUrl()));
}
@GetMapping("/get")
@ApiOperation("获得制作提货单")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
......
......@@ -282,4 +282,15 @@ customer.merge.customer.service.not.same=
order.exists.pickup.not.cargo.control=
order.exists.pick.not.cancel.cargo.control=
order.overseas.warehouse.update.need.applying=
order.not.update.dest.country=
order.not.update.departure=
order.not.update.transport=
order.pre.installation.unpackaged.container.not.update=
order.sorting.not.shipment.not.update=
box.update.repeat.commit=
\ No newline at end of file
......@@ -1089,4 +1089,14 @@ customer.merge.customer.service.not.same=tow customer's customer serivce not sam
order.exists.pickup.not.cargo.control=The order has a delivery record and cannot be controlled
order.exists.pick.not.cancel.cargo.control=There is a release record for the order, and the control cannot be cancelled
order.overseas.warehouse.update.need.applying=Order overseas warehouse modification requires separate application
order.not.update.dest.country=Not allowed to modify the destination country
order.not.update.departure=Not allowed to modify the origin location
order.not.update.transport=No modification of transportation method allowed
order.pre.installation.unpackaged.container.not.update=Order pre installed without container, order information cannot be modified
order.sorting.not.shipment.not.update=Order sorting not shipped, order information cannot be modified
box.update.repeat.commit=Duplicate submission of self assigned number status modification
\ No newline at end of file
......@@ -1086,13 +1086,16 @@ customer.deleted.not.exists=\u88AB\u5408\u5E76\u5BA2\u6237\u4E0D\u5B58\u5728
customer.saved.customer.service.is.null=\u88AB\u4FDD\u7559\u5BA2\u6237\u7684\u5BA2\u6237\u7ECF\u7406\u4E3A\u7A7A
customer.deleted.customer.service.is.null=\u88AB\u5408\u5E76\u7684\u5BA2\u6237\u7684\u5BA2\u6237\u7ECF\u7406\u4E3A\u7A7A
customer.merge.customer.service.not.same=\u4E24\u5BA2\u6237\u7684\u5BA2\u6237\u7ECF\u7406\u4E0D\u4E00\u81F4
order.is.not.pre.installed =\u8ba2\u5355\u672a\u9884\u88c5\uff0c\u4e0d\u80fd\u5408\u5305
order.item.charging.not.null=\u8ba2\u5355\u5546\u54c1\u8ba1\u8d39\u65b9\u5f0f\u4e0d\u80fd\u4e3a\u7a7a
order.item.is.pay.advance.not.null=\u8ba2\u5355\u5546\u54c1\u662f\u5426\u9884\u4ed8\u4e0d\u80fd\u4e3a\u7a7a
order.item.freight.currency.not.null=\u8ba2\u5355\u5546\u54c1\u8fd0\u8d39\u8d27\u5e01\u5355\u4f4d\u4e0d\u80fd\u4e3a\u7a7a
order.item.freight.unit.not.null=\u8ba2\u5355\u5546\u54c1\u8fd0\u8d39\u8ba1\u91cf\u5355\u4f4d\u4e0d\u80fd\u4e3a\u7a7a
order.item.clearance.currency.not.null=\u8ba2\u5355\u5546\u54c1\u6e05\u5173\u8d39\u8d27\u5e01\u5355\u4f4d\u4e0d\u80fd\u4e3a\u7a7a
order.item.clearance.unit.not.null=\u8ba2\u5355\u5546\u54c1\u6e05\u5173\u8d39\u8ba1\u91cf\u5355\u4f4d\u4e0d\u80fd\u4e3a\u7a7a
order.exists.pickup.not.cargo.control=\u8ba2\u5355\u5b58\u5728\u63d0\u8d27\u8bb0\u5f55\uff0c\u4e0d\u80fd\u8fdb\u884c\u63a7\u8d27
order.exists.pick.not.cancel.cargo.control=\u8ba2\u5355\u5b58\u5728\u653e\u8d27\u8bb0\u5f55\uff0c\u4e0d\u80fd\u53d6\u6d88\u63a7\u8d27
order.overseas.warehouse.update.need.applying=\u8ba2\u5355\u6d77\u5916\u4ed3\u4fee\u6539\u9700\u8981\u5355\u72ec\u7533\u8bf7
order.not.update.dest.country=\u4e0d\u5141\u8bb8\u4fee\u6539\u76ee\u7684\u56fd
order.not.update.departure=\u4e0d\u5141\u8bb8\u4fee\u6539\u59cb\u53d1\u5730
order.not.update.transport=\u4e0d\u5141\u8bb8\u4fee\u6539\u8fd0\u8f93\u65b9\u5f0f
order.pre.installation.unpackaged.container.not.update=\u8ba2\u5355\u9884\u88c5\u672a\u88c5\u67dc, \u8ba2\u5355\u4fe1\u606f\u65e0\u6cd5\u4fee\u6539
order.sorting.not.shipment.not.update=\u8ba2\u5355\u5206\u62e3\u672a\u51fa\u8d27, \u8ba2\u5355\u4fe1\u606f\u65e0\u6cd5\u4fee\u6539
box.update.repeat.commit=\u81ea\u7f16\u53f7\u72b6\u6001\u4fee\u6539\u91cd\u590d\u63d0\u4ea4
\ No newline at end of file
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