Commit 5463183b authored by 332784038@qq.com's avatar 332784038@qq.com

Merge branch 'order_fee_update' into release

parents 734ad2f7 05dfabfa
-- 新增费用申请记录的付款人属性
alter table ecw_order_fee_application
add COLUMN `payer` tinyint DEFAULT NULL COMMENT '付款人' after `pay_type`;
update ecw_order_fee_application f left join ecw_receivable r on f.receivable_id = r.id set f.payer = r.payment_user;
\ No newline at end of file
......@@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.order.dal.dataobject.orderFeeApplication;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import java.math.BigDecimal;
import java.util.*;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
......@@ -38,7 +40,7 @@ public class OrderFeeApplicationDO extends BaseDO {
/**
* 费用申请金额
*/
private java.math.BigDecimal applicationFee;
private BigDecimal applicationFee;
/**
* 费用申请货币类型
*
......@@ -50,6 +52,12 @@ public class OrderFeeApplicationDO extends BaseDO {
* 枚举 {@link TODO pay_type 对应的类}
*/
private Integer payType;
/**
* 付款人
*
* 1 发货人 2 收货人
*/
private Integer payer;
/**
* 备注
*/
......
......@@ -113,7 +113,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
// if (waitApprovalCount > 0) {
// throw exception(ORDER_HAS_PROCESSING_APPROVAL, order.getOrderNo());
// }
OrderDO orderDO = orderService.getById(createReqVO.getOrderId());
Long aLong = feeApplicationMapper.selectCount(new LambdaQueryWrapperX<OrderFeeApplicationDO>()
.eq(OrderFeeApplicationDO::getOrderId, createReqVO.getOrderId())
.eq(OrderFeeApplicationDO::getStatus, 1));
......@@ -126,7 +126,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
// 返回
Long userId = SecurityFrameworkUtils.getLoginUserId();
//创建审批流
OrderDO orderDO = orderService.selectOne(OrderDO::getOrderId, createReqVO.getOrderId());
String bpmProcessId = bpmCreateServiceFactory.createBmp(userId, feeApplication.getId(), WorkFlowEmus.ORDER_FREE_APPLY.getKey(), orderDO.getOrderNo(), createReqVO.getCopyUserId());
orderService.updateStatus(orderDO.getOrderId(), null, null, null, null, null, OrderApprovalTypeResultEnum.expense_apply_processing.getType(), OrderApprovalTypeResultEnum.expense_apply_processing.getDesc());
feeApplication.setBpmProcessId(bpmProcessId);
......@@ -208,15 +208,16 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
DictDataRespDTO feeDictDataFromCache = DictFrameworkUtils.getDictDataFromCache(DictTypeConstants.RECEIVABLE_FEE_TYPE, String.valueOf(feeApplicationDO.getFeeType()));
DictDataRespDTO payDictDataFromCache = DictFrameworkUtils.getDictDataFromCache(DictTypeConstants.PAYMENT_TYPE, String.valueOf(feeApplicationDO.getPayType()));
CurrencyDO currency = currencyService.getCurrency(feeApplicationDO.getApplicationFeeCurrency());
String value = "%s: 金额[%s%s], 付款类型[%s]";
String value = "%s: 金额[%s%s], 付款类型[%s], 付款人[%s]";
ApplyInfoVO applyInfoVO = new ApplyInfoVO();
if (Objects.isNull(feeApplicationDO.getId())) {
applyInfoVO.setName("新增申请费用");
applyInfoVO.setNewValue(String.format(value,
I18nMessage.getLang() == 0 ? feeDictDataFromCache.getLabel() : feeDictDataFromCache.getLabelEn() ,
feeDictDataFromCache.getLabel().concat("/").concat(feeDictDataFromCache.getLabelEn()),
feeApplicationDO.getApplicationFee().toString(),
I18nMessage.getLang() == 0 ? currency.getTitleZh() : currency.getTitleEn(),
I18nMessage.getLang() == 0 ? payDictDataFromCache.getLabel() : payDictDataFromCache.getLabelEn()));
currency.getTitleZh().concat("/").concat(currency.getTitleEn()),
payDictDataFromCache.getLabel().concat("/").concat(payDictDataFromCache.getLabelEn()),
feeApplicationDO.getPayer() == 1 ? "发货人" : "收货人"));
}else {
OrderFeeApplicationDO oldFeeAppliction = feeApplicationMapper.selectById(feeApplicationDO.getId());
DictDataRespDTO feeDictDataFromCacheOld = DictFrameworkUtils.getDictDataFromCache(DictTypeConstants.RECEIVABLE_FEE_TYPE, String.valueOf(oldFeeAppliction.getFeeType()));
......@@ -224,15 +225,17 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
CurrencyDO currencyOld = currencyService.getCurrency(oldFeeAppliction.getApplicationFeeCurrency());
applyInfoVO.setName("修改申请费用");
applyInfoVO.setNewValue(String.format(value,
I18nMessage.getLang() == 0 ? feeDictDataFromCache.getLabel() : feeDictDataFromCache.getLabelEn() ,
feeDictDataFromCache.getLabel().concat("/").concat(feeDictDataFromCache.getLabelEn()),
feeApplicationDO.getApplicationFee().toString(),
I18nMessage.getLang() == 0 ? currency.getTitleZh() : currency.getTitleEn(),
I18nMessage.getLang() == 0 ? payDictDataFromCache.getLabel() : payDictDataFromCache.getLabelEn()));
currency.getTitleZh().concat("/").concat(currency.getTitleEn()),
payDictDataFromCache.getLabel().concat("/").concat(payDictDataFromCache.getLabelEn()),
feeApplicationDO.getPayer() == 1 ? "发货人" : "收货人"));
applyInfoVO.setOrgValue(String.format(value,
I18nMessage.getLang() == 0 ? feeDictDataFromCacheOld.getLabel() : feeDictDataFromCacheOld.getLabelEn() ,
feeDictDataFromCacheOld.getLabel().concat("/").concat(feeDictDataFromCacheOld.getLabelEn()),
oldFeeAppliction.getApplicationFee().toString(),
I18nMessage.getLang() == 0 ? currencyOld.getTitleZh() : currencyOld.getTitleEn(),
I18nMessage.getLang() == 0 ? payDictDataFromCacheOld.getLabel() : payDictDataFromCacheOld.getLabelEn()));
currencyOld.getTitleZh().concat("/").concat(currencyOld.getTitleEn()),
payDictDataFromCacheOld.getLabel().concat("/").concat(payDictDataFromCacheOld.getLabelEn()),
oldFeeAppliction.getPayer() == 1 ? "发货人" : "收货人"));
}
list.add(applyInfoVO);
}
......@@ -303,6 +306,11 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
applyInfoVO.setOrgValue(I18nMessage.getLang() == 0 ? payDictDataFromCacheOld.getLabel() : payDictDataFromCacheOld.getLabelEn());
applyInfoVO.setNewValue(I18nMessage.getLang() == 0 ? payDictDataFromCache.getLabel() : payDictDataFromCache.getLabelEn());
list.add(applyInfoVO);
applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("付款人");
applyInfoVO.setOrgValue(orderFeeApplicationDOOld.getPayer() == 1 ? "发货人" : "收货人");
applyInfoVO.setNewValue(updateReqVO.getPayer() == 1 ? "发货人" : "收货人");
list.add(applyInfoVO);
orderBusinessService.addOrderOperateLog(updateObj.getOrderId(), "", "费用修改提交审核", list);
}
......@@ -350,6 +358,10 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
applyInfoVO.setName("付款类型");
applyInfoVO.setNewValue(I18nMessage.getLang() == 0 ? payTypeDictDataFromCache.getLabel() : payTypeDictDataFromCache.getLabelEn());
list.add(applyInfoVO);
applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("付款人");
applyInfoVO.setNewValue(orderFeeApplicationDO.getPayer() == 1 ? "发货人" : "收货人");
list.add(applyInfoVO);
orderBusinessService.addOrderOperateLog(orderFeeApplicationDO.getOrderId(), "订单操作", "费用申请删除", list);
}
......@@ -400,7 +412,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
}
orderFeeApplicationDO.setStatus(result);
feeApplicationMapper.updateById(orderFeeApplicationDO);
OrderBackVO order = orderQueryService.getOrder(orderFeeApplicationDO.getOrderId());
OrderDO order = orderService.getById(orderFeeApplicationDO.getOrderId());
//生成应收
DictDataRespDTO dictDto = DictFrameworkUtils.getDictDataFromCache("receivable_fee_type", String.valueOf(orderFeeApplicationDO.getFeeType()));
//修复应收款记录不存在的BUG,
......@@ -431,7 +443,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
receivableDO.setFeeType(orderFeeApplicationDO.getFeeType());
receivableDO.setIsPayAdvance(orderFeeApplicationDO.getPayType() == 4 ? 0 : 1);
receivableDO.setState(orderFeeApplicationDO.getReceiveFlag());
receivableDO.setPaymentUser(String.valueOf(order.getDrawee() != 3 ? order.getDrawee() : orderQueryService.customDrawee(OrderConvert.INSTANCE.convert(order), orderFeeApplicationDO.getFeeType())));//6待修改
receivableDO.setPaymentUser(String.valueOf(Objects.nonNull(orderFeeApplicationDO.getPayer()) ? orderFeeApplicationDO.getPayer(): (getPayer(order, orderFeeApplicationDO))));//6待修改
receivableDO.setFeeSource(2);
receivableDO.setAuthor(orderFeeApplicationDO.getApplicationAuthor());
receivableDO.setRemark(orderFeeApplicationDO.getRemarks());
......@@ -451,7 +463,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
receivableCreateReqVO.setFeeType(orderFeeApplicationDO.getFeeType());
receivableCreateReqVO.setIsPayAdvance(orderFeeApplicationDO.getPayType() == 4 ? 0 : 1);
receivableCreateReqVO.setState(orderFeeApplicationDO.getReceiveFlag());
receivableCreateReqVO.setPaymentUser(String.valueOf(order.getDrawee() != 3 ? order.getDrawee() : orderQueryService.customDrawee(OrderConvert.INSTANCE.convert(order), orderFeeApplicationDO.getFeeType())));//6待修改
receivableCreateReqVO.setPaymentUser(String.valueOf(Objects.nonNull(orderFeeApplicationDO.getPayer()) ? orderFeeApplicationDO.getPayer(): (getPayer(order, orderFeeApplicationDO))));//6待修改
receivableCreateReqVO.setFeeSource(2);
receivableCreateReqVO.setAuthor(orderFeeApplicationDO.getApplicationAuthor());
receivableCreateReqVO.setRemark(orderFeeApplicationDO.getRemarks());
......@@ -483,6 +495,10 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
}
}
private Integer getPayer(OrderDO order, OrderFeeApplicationDO orderFeeApplicationDO) {
return order.getDrawee() != 3 ? order.getDrawee() : orderQueryService.customDrawee(order, orderFeeApplicationDO.getFeeType());
}
/*
//result
1, "处理中",
......@@ -501,7 +517,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
orderApprovalService.updateById(orderApprovalDO);
if (result == ApprovalResultStatusEnum.pass.getValue()) {
List<FeeDto> feeDtos = new ArrayList<>();
OrderBackVO order = orderQueryService.getOrder(orderApprovalDO.getOrderId());
OrderDO order = orderService.getById(orderApprovalDO.getOrderId());
List<OrderFeeApplicationDO> batchFeeList = null;
if (Objects.nonNull(orderApprovalDO.getDetails())){
batchFeeList = JSONObject.parseArray(orderApprovalDO.getDetails(), OrderFeeApplicationDO.class);
......@@ -533,7 +549,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
receivableDO.setFeeType(feeApplicationDO.getFeeType());
receivableDO.setIsPayAdvance(feeApplicationDO.getPayType() == 4 ? 0 : 1);
receivableDO.setState(feeApplicationDO.getReceiveFlag());
receivableDO.setPaymentUser(String.valueOf(order.getDrawee() != 3 ? order.getDrawee() : orderQueryService.customDrawee(OrderConvert.INSTANCE.convert(order), feeApplicationDO.getFeeType())));//6待修改
receivableDO.setPaymentUser(String.valueOf(Objects.nonNull(feeApplicationDO.getPayer()) ? feeApplicationDO.getPayer(): (getPayer(order, feeApplicationDO))));//6待修改
receivableDO.setFeeSource(2);
receivableDO.setAuthor(feeApplicationDO.getApplicationAuthor());
receivableDO.setRemark(feeApplicationDO.getRemarks());
......@@ -553,7 +569,7 @@ public class OrderFeeApplicationServiceImpl extends AbstractService<OrderFeeAppl
receivableCreateReqVO.setFeeType(feeApplicationDO.getFeeType());
receivableCreateReqVO.setIsPayAdvance(feeApplicationDO.getPayType() == 4 ? 0 : 1);
receivableCreateReqVO.setState(feeApplicationDO.getReceiveFlag());
receivableCreateReqVO.setPaymentUser(String.valueOf(order.getDrawee() != 3 ? order.getDrawee() : orderQueryService.customDrawee(OrderConvert.INSTANCE.convert(order), feeApplicationDO.getFeeType())));//6待修改
receivableCreateReqVO.setPaymentUser(String.valueOf(Objects.nonNull(feeApplicationDO.getPayer()) ? feeApplicationDO.getPayer(): (getPayer(order, feeApplicationDO))));//6待修改
receivableCreateReqVO.setFeeSource(2);
receivableCreateReqVO.setAuthor(feeApplicationDO.getApplicationAuthor());
receivableCreateReqVO.setRemark(feeApplicationDO.getRemarks());
......
......@@ -320,10 +320,10 @@ public class OrderQueryServiceImpl implements OrderQueryService {
}
vo = new OrderSpecialApplyVO();
BeanUtils.copyProperties(orderItemDO, vo);
vo.setOrgCharging(vo.getCharging());
vo.setOrgFreight(orderItemDO.getOneSeaFreight());
vo.setSubtotalFreight(orderItemDO.getSeaFreight());
vo.setOrgFreightCurrency(Long.valueOf(orderItemDO.getSeaFreightCurrency()));
vo.setFreightCurrency(Long.valueOf(orderItemDO.getSeaFreightCurrency()));
vo.setFreightVolume(orderItemDO.getSeaFreightVolume());
......@@ -331,6 +331,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
vo.setClearanceFreight(null); // 因字段冲突,copy后需要将该字段置空
vo.setOrgClearanceFreight(orderItemDO.getOneClearanceFreight());
vo.setSubtotalClearanceFreight(orderItemDO.getClearanceFreight());
vo.setOrgClearanceFreightCurrency(Long.valueOf(orderItemDO.getClearanceFreightCurrency()));
vo.setClearanceFreightCurrency(Long.valueOf(orderItemDO.getClearanceFreightCurrency()));
vo.setClearanceFreightVolume(orderItemDO.getClearanceFreightVolume());
}
......@@ -426,8 +427,11 @@ public class OrderQueryServiceImpl implements OrderQueryService {
OrderSpecialBatchApplyOrderItemDetailVO vo = new OrderSpecialBatchApplyOrderItemDetailVO();
BeanUtils.copyProperties(orderItemDO, vo);
vo.setOrgCharging(vo.getCharging());
vo.setOrgFreight(orderItemDO.getOneSeaFreight());
vo.setSubtotalFreight(orderItemDO.getSeaFreight());
vo.setOrgFreightCurrency(Long.valueOf(orderItemDO.getSeaFreightCurrency()));
vo.setFreightCurrency(Long.valueOf(orderItemDO.getSeaFreightCurrency()));
vo.setFreightVolume(orderItemDO.getSeaFreightVolume());
......@@ -435,6 +439,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
vo.setClearanceFreight(null); // 因字段冲突,copy后需要将该字段置空
vo.setOrgClearanceFreight(orderItemDO.getOneClearanceFreight());
vo.setSubtotalClearanceFreight(orderItemDO.getClearanceFreight());
vo.setOrgClearanceFreightCurrency(Long.valueOf(orderItemDO.getClearanceFreightCurrency()));
vo.setClearanceFreightCurrency(Long.valueOf(orderItemDO.getClearanceFreightCurrency()));
vo.setClearanceFreightVolume(orderItemDO.getClearanceFreightVolume());
}
......
......@@ -5323,14 +5323,22 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
switch (specialApplyVO.getApplyType()) {
case 1:
applyInfoVO.setName(specialApplyVO.getProdTitleZh() + (specialApplyVO.getCharging() == 1 ? "全包价优惠" : "运费优惠"));
applyInfoVO.setOrgValue(specialApplyVO.getOrgFreight().toString() + currencyRespDTOMap.get(specialApplyVO.getFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(specialApplyVO.getFreightVolume().intValue()).getTitleZh());
applyInfoVO.setOrgValue(specialApplyVO.getOrgFreight().toString() + currencyRespDTOMap.get(specialApplyVO.getOrgFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(specialApplyVO.getFreightVolume().intValue()).getTitleZh());
applyInfoVO.setNewValue(specialApplyVO.getFreight().toString() + currencyRespDTOMap.get(specialApplyVO.getFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(specialApplyVO.getFreightVolume().intValue()).getTitleZh());
applyInfoVOList.add(applyInfoVO);
if (specialApplyVO.getCharging() == 0) {
if (specialApplyVO.getOrgCharging() == 0 || specialApplyVO.getCharging() == 0) {
applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName(specialApplyVO.getProdTitleZh() + "清关费优惠");
applyInfoVO.setOrgValue(specialApplyVO.getOrgClearanceFreight().toString() + currencyRespDTOMap.get(specialApplyVO.getClearanceFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(specialApplyVO.getClearanceFreightVolume().intValue()).getTitleZh());
applyInfoVO.setNewValue(specialApplyVO.getClearanceFreight().toString() + currencyRespDTOMap.get(specialApplyVO.getClearanceFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(specialApplyVO.getClearanceFreightVolume().intValue()).getTitleZh());
if (specialApplyVO.getOrgCharging() == 0) {
applyInfoVO.setOrgValue(specialApplyVO.getOrgClearanceFreight().toString() + currencyRespDTOMap.get(specialApplyVO.getOrgClearanceFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(specialApplyVO.getClearanceFreightVolume().intValue()).getTitleZh());
}else {
applyInfoVO.setOrgValue("无/none");
}
if (specialApplyVO.getCharging() == 0) {
applyInfoVO.setNewValue(specialApplyVO.getClearanceFreight().toString() + currencyRespDTOMap.get(specialApplyVO.getClearanceFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(specialApplyVO.getClearanceFreightVolume().intValue()).getTitleZh());
}else {
applyInfoVO.setOrgValue("无/none");
}
applyInfoVOList.add(applyInfoVO);
}
// TODO 只能装柜前、到港后申请
......@@ -5338,17 +5346,25 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
break;
case 2:
applyInfoVO.setName(specialApplyVO.getProdTitleZh() + (specialApplyVO.getCharging() == 1 ? "全包价管理折扣" : "运费管理折扣"));
applyInfoVO.setOrgValue(specialApplyVO.getOrgFreight().toString() + currencyRespDTOMap.get(specialApplyVO.getFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(specialApplyVO.getFreightVolume().intValue()).getTitleZh());
applyInfoVO.setOrgValue(specialApplyVO.getOrgFreight().toString() + currencyRespDTOMap.get(specialApplyVO.getOrgFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(specialApplyVO.getFreightVolume().intValue()).getTitleZh());
applyInfoVO.setNewValue(specialApplyVO.getFreight().toString() + currencyRespDTOMap.get(specialApplyVO.getFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(specialApplyVO.getFreightVolume().intValue()).getTitleZh());
applyInfoVOList.add(applyInfoVO);
if (specialApplyVO.getCharging() == 0) {
if (specialApplyVO.getOrgCharging() == 0 || specialApplyVO.getCharging() == 0) {
applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName(specialApplyVO.getProdTitleZh() + "清关费管理折扣");
applyInfoVO.setOrgValue(specialApplyVO.getOrgClearanceFreight().toString() + currencyRespDTOMap.get(specialApplyVO.getClearanceFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(specialApplyVO.getClearanceFreightVolume().intValue()).getTitleZh());
applyInfoVO.setNewValue(specialApplyVO.getClearanceFreight().toString() + currencyRespDTOMap.get(specialApplyVO.getClearanceFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(specialApplyVO.getClearanceFreightVolume().intValue()).getTitleZh());
if (specialApplyVO.getOrgCharging() == 0) {
applyInfoVO.setOrgValue(specialApplyVO.getOrgClearanceFreight().toString() + currencyRespDTOMap.get(specialApplyVO.getOrgClearanceFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(specialApplyVO.getClearanceFreightVolume().intValue()).getTitleZh());
}else {
applyInfoVO.setOrgValue("无/none");
}
if (specialApplyVO.getCharging() == 0) {
applyInfoVO.setNewValue(specialApplyVO.getClearanceFreight().toString() + currencyRespDTOMap.get(specialApplyVO.getClearanceFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(specialApplyVO.getClearanceFreightVolume().intValue()).getTitleZh());
}else {
applyInfoVO.setOrgValue("无/none");
}
applyInfoVOList.add(applyInfoVO);
}
// TODO 订单核销前都可以申请
// 订单核销前都可以申请
key = WorkFlowEmus.ORDER_MANAGE_DISCOUNTS.getKey();
break;
case 3:
......@@ -5493,14 +5509,22 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
switch (specialBatchApplyVO.getApplyType()) {
case 31:
applyInfoVO.setName(vo.getProdTitleZh() + (vo.getCharging() == 1 ? "全包价优惠" : "运费优惠"));
applyInfoVO.setOrgValue(vo.getOrgFreight().toString() + currencyRespDTOMap.get(vo.getFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(vo.getFreightVolume().intValue()).getTitleZh());
applyInfoVO.setOrgValue(vo.getOrgFreight().toString() + currencyRespDTOMap.get(vo.getOrgFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(vo.getFreightVolume().intValue()).getTitleZh());
applyInfoVO.setNewValue(vo.getFreight().toString() + currencyRespDTOMap.get(vo.getFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(vo.getFreightVolume().intValue()).getTitleZh());
applyInfoVOList.add(applyInfoVO);
if (vo.getCharging() == 0) {
if (vo.getOrgCharging() == 0 || vo.getCharging() == 0) {
applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName(vo.getProdTitleZh() + "清关费优惠");
applyInfoVO.setOrgValue(vo.getOrgClearanceFreight().toString() + currencyRespDTOMap.get(vo.getClearanceFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(vo.getClearanceFreightVolume().intValue()).getTitleZh());
applyInfoVO.setNewValue(vo.getClearanceFreight().toString() + currencyRespDTOMap.get(vo.getClearanceFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(vo.getClearanceFreightVolume().intValue()).getTitleZh());
if (vo.getOrgCharging() == 0) {
applyInfoVO.setOrgValue(vo.getOrgClearanceFreight().toString() + currencyRespDTOMap.get(vo.getOrgClearanceFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(vo.getClearanceFreightVolume().intValue()).getTitleZh());
}else {
applyInfoVO.setOrgValue("无/none");
}
if (vo.getCharging() == 0) {
applyInfoVO.setNewValue(vo.getClearanceFreight().toString() + currencyRespDTOMap.get(vo.getClearanceFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(vo.getClearanceFreightVolume().intValue()).getTitleZh());
}else {
applyInfoVO.setOrgValue("无/none");
}
applyInfoVOList.add(applyInfoVO);
}
// TODO 只能装柜前、到港后申请
......@@ -5508,14 +5532,22 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
break;
case 32:
applyInfoVO.setName(vo.getProdTitleZh() + (vo.getCharging() == 1 ? "全包价管理折扣" : "运费管理折扣"));
applyInfoVO.setOrgValue(vo.getOrgFreight().toString() + currencyRespDTOMap.get(vo.getFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(vo.getFreightVolume().intValue()).getTitleZh());
applyInfoVO.setOrgValue(vo.getOrgFreight().toString() + currencyRespDTOMap.get(vo.getOrgFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(vo.getFreightVolume().intValue()).getTitleZh());
applyInfoVO.setNewValue(vo.getFreight().toString() + currencyRespDTOMap.get(vo.getFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(vo.getFreightVolume().intValue()).getTitleZh());
applyInfoVOList.add(applyInfoVO);
if (vo.getCharging() == 0) {
if (vo.getOrgCharging() == 0 || vo.getCharging() == 0) {
applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName(vo.getProdTitleZh() + "清关费管理折扣");
applyInfoVO.setOrgValue(vo.getOrgClearanceFreight().toString() + currencyRespDTOMap.get(vo.getClearanceFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(vo.getClearanceFreightVolume().intValue()).getTitleZh());
applyInfoVO.setNewValue(vo.getClearanceFreight().toString() + currencyRespDTOMap.get(vo.getClearanceFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(vo.getClearanceFreightVolume().intValue()).getTitleZh());
if (vo.getOrgCharging() == 0) {
applyInfoVO.setOrgValue(vo.getOrgClearanceFreight().toString() + currencyRespDTOMap.get(vo.getOrgClearanceFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(vo.getClearanceFreightVolume().intValue()).getTitleZh());
}else {
applyInfoVO.setOrgValue("无/none");
}
if (vo.getCharging() == 0) {
applyInfoVO.setNewValue(vo.getClearanceFreight().toString() + currencyRespDTOMap.get(vo.getClearanceFreightCurrency().intValue()).getTitleZh() + "/" + unitRespDtoMap.get(vo.getClearanceFreightVolume().intValue()).getTitleZh());
}else {
applyInfoVO.setOrgValue("无/none");
}
applyInfoVOList.add(applyInfoVO);
}
// TODO 订单核销前都可以申请
......@@ -5685,7 +5717,11 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (Objects.equals(oi.getOrderItemId(), batchApplyOrderItemDetailVO.getOrderItemId())) {
// 需要标记为固定成交单价, 且需要重置批量加价金额为0
oi.setOneClearanceFreight(batchApplyOrderItemDetailVO.getClearanceFreight());
oi.setClearanceFreightCurrency(batchApplyOrderItemDetailVO.getClearanceFreightCurrency().intValue());
oi.setClearanceFreightVolume(batchApplyOrderItemDetailVO.getClearanceFreightVolume());
oi.setOneSeaFreight(batchApplyOrderItemDetailVO.getFreight());
oi.setSeaFreightCurrency(batchApplyOrderItemDetailVO.getFreightCurrency().intValue());
oi.setSeaFreightVolume(batchApplyOrderItemDetailVO.getFreightVolume());
oi.setMarkupSeaFreight(BigDecimal.ZERO);
oi.setMarkupClearanceFreight(BigDecimal.ZERO);
oi.setIsPriced(Boolean.TRUE);
......@@ -5752,7 +5788,11 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (Objects.equals(oi.getOrderItemId(), specialApplyVO.getOrderItemId())) {
// 需要标记为固定成交单价, 且需要重置批量加价金额为0
oi.setOneClearanceFreight(specialApplyVO.getClearanceFreight());
oi.setClearanceFreightCurrency(specialApplyVO.getClearanceFreightCurrency().intValue());
oi.setClearanceFreightVolume(specialApplyVO.getClearanceFreightVolume());
oi.setOneSeaFreight(specialApplyVO.getFreight());
oi.setSeaFreightCurrency(specialApplyVO.getFreightCurrency().intValue());
oi.setSeaFreightVolume(specialApplyVO.getFreightVolume());
oi.setMarkupSeaFreight(BigDecimal.ZERO);
oi.setMarkupClearanceFreight(BigDecimal.ZERO);
oi.setIsPriced(Boolean.TRUE);
......
......@@ -53,12 +53,18 @@ public class OrderSpecialApplyVO {
@ApiModelProperty(value = "原运费(成交单价)")
private BigDecimal orgFreight = BigDecimal.ZERO;
@ApiModelProperty(value = "原运费用金额单位ID")
private Long orgFreightCurrency = 1L;
@ApiModelProperty(value = "小计清关费")
private BigDecimal subtotalClearanceFreight = BigDecimal.ZERO;
@ApiModelProperty(value = "原清关费(成交单价)")
private BigDecimal orgClearanceFreight = BigDecimal.ZERO;
@ApiModelProperty(value = "原清关费用金额单位ID")
private Long orgClearanceFreightCurrency = 1L;
@ApiModelProperty(value = "新运费(成交单价)")
private BigDecimal freight;
......@@ -94,6 +100,9 @@ public class OrderSpecialApplyVO {
@ApiModelProperty(value = "是否预付:0 到付 1 预付")
private Integer isPayAdvance;
@ApiModelProperty(value = "原计费方式:0 运费/清关费 1 全包价")
private Integer orgCharging = 0;
@ApiModelProperty(value = "计费方式:0 运费/清关费 1 全包价")
private Integer charging = 0;
......
......@@ -32,12 +32,18 @@ public class OrderSpecialBatchApplyOrderItemDetailVO {
@ApiModelProperty(value = "原运费(成交单价)")
private BigDecimal orgFreight = BigDecimal.ZERO;
@ApiModelProperty(value = "原运费用金额单位ID")
private Long orgFreightCurrency = 1L;
@ApiModelProperty(value = "小计清关费")
private BigDecimal subtotalClearanceFreight = BigDecimal.ZERO;
@ApiModelProperty(value = "原清关费(成交单价)")
private BigDecimal orgClearanceFreight = BigDecimal.ZERO;
@ApiModelProperty(value = "原清关费用金额单位ID")
private Long orgClearanceFreightCurrency = 1L;
@ApiModelProperty(value = "新运费(成交单价)")
private BigDecimal freight;
......@@ -59,6 +65,9 @@ public class OrderSpecialBatchApplyOrderItemDetailVO {
@ApiModelProperty(value = "是否预付:0 到付 1 预付")
private Integer isPayAdvance;
@ApiModelProperty(value = "原计费方式:0 运费/清关费 1 全包价")
private Integer orgCharging = 0;
@ApiModelProperty(value = "计费方式:0 运费/清关费 1 全包价")
private Integer charging = 0;
......
......@@ -45,6 +45,10 @@ public class OrderFeeApplicationBackVO {
@ApiModelProperty(value = "付款类型", required = true)
private Integer payType;
@ApiModelProperty(value = "付款人: 1 发货人 2 收货人", required = true)
private Integer payer;
@ExcelProperty("备注")
@ApiModelProperty(value = "备注")
private String remarks;
......
package cn.iocoder.yudao.module.order.vo.orderFeeApplication;
import lombok.*;
import java.math.BigDecimal;
import java.util.*;
import io.swagger.annotations.*;
import javax.validation.constraints.*;
......@@ -25,7 +27,7 @@ public class OrderFeeApplicationBaseVO {
@ApiModelProperty(value = "费用申请金额", required = true)
@NotNull(message = "费用申请金额不能为空")
private java.math.BigDecimal applicationFee;
private BigDecimal applicationFee;
@ApiModelProperty(value = "费用申请货币类型", required = true)
@NotNull(message = "费用申请货币类型不能为空")
......@@ -35,6 +37,9 @@ public class OrderFeeApplicationBaseVO {
@NotNull(message = "付款类型不能为空")
private Integer payType;
@ApiModelProperty(value = "付款人: 1 发货人 2 收货人", required = true)
private Integer payer;
@ApiModelProperty(value = "备注")
private String remarks;
......
......@@ -27,6 +27,9 @@ public class OrderFeeApplicationQueryVO {
@ApiModelProperty(value = "付款类型")
private Integer payType;
@ApiModelProperty(value = "付款人: 1 发货人 2 收货人")
private Integer payer;
@ApiModelProperty(value = "备注")
private String remarks;
......
......@@ -29,6 +29,7 @@ import cn.iocoder.yudao.module.order.convert.order.OrderConvert;
import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO;
import cn.iocoder.yudao.module.order.dto.*;
import cn.iocoder.yudao.module.order.enums.CustomDraweeEnum;
import cn.iocoder.yudao.module.order.enums.OrderApprovalTypeEnum;
import cn.iocoder.yudao.module.order.enums.OrderTempLateEnum;
import cn.iocoder.yudao.module.order.enums.TransportTypeShortEnum;
......@@ -867,6 +868,14 @@ public class OrderController {
return success(statisticsVO);
}
@GetMapping("/fee/drawee/{feeType}")
@ApiOperation("获取费用自定义付款人定义枚举值")
@ApiImplicitParam(name = "feeType", value = "费用类型", required = true,dataTypeClass = Integer.class)
public CommonResult<String> getFeeDraweeByFeeType(@PathVariable("feeType") Integer feeType) {
CustomDraweeEnum draweeEnum = CustomDraweeEnum.valueOf(feeType);
return success(Objects.nonNull(draweeEnum) ? draweeEnum.getKey() : null);
}
@GetMapping("/approvalTypeCheck")
@ApiOperation("校验订单审批是否存在互斥类型:是 或 否 ")
......
......@@ -10,6 +10,7 @@ import cn.iocoder.yudao.module.shipment.enums.BoxApprovalTypeEnum;
import cn.iocoder.yudao.module.shipment.enums.BoxStatusEnum;
import cn.iocoder.yudao.module.shipment.enums.TransportTypeEnum;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -82,35 +83,42 @@ public class BoxBaseBackVO {
@ExcelProperty("预装时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "预装时间")
private Date yzDate;
@ExcelProperty("装柜时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "装柜时间")
private Date zgDate;
@ExcelProperty("起运时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "起运时间")
private Date qyDate;
@ExcelProperty("到港时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "到港时间")
private Date dgDate;
@ExcelProperty("清关时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "清关时间")
private Date qgDate;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "到仓时间")
private Date dcDate;
@ExcelProperty("提货时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "提货时间")
private Date thDate;
......@@ -126,6 +134,7 @@ public class BoxBaseBackVO {
private Integer tyStatus;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "提交理货时间")
private Date tyTime;
......@@ -260,6 +269,7 @@ public class BoxBaseBackVO {
@ExcelProperty("创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "创建时间", required = true)
private Date createTime;
......
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