Commit c3f57db2 authored by lanbaoming's avatar lanbaoming

Merge branch 'dev'

# Conflicts:
#	yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderBusinessServiceImpl.java
#	yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/orderException/OrderExceptionServiceImpl.java
parents 90290cf4 55d166f5
package cn.iocoder.yudao.framework.toolkit;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ZTestMapper extends BaseMapper<zTest> {
}
......@@ -11,7 +11,7 @@
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts s
where s.deleted = 0 and s.customer_id=contact.id) as all_contact_phone
from (select a.*,
c.name as default_contact_name2,
c.name as default_contact_name,
concat(c.area_code, c.phone_new, '') as default_contact_phone,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone2,
......
......@@ -6,6 +6,7 @@ import lombok.Data;
import lombok.ToString;
import java.math.BigDecimal;
import java.util.List;
/*
客户分析报表
......@@ -35,23 +36,30 @@ public class CustomerAnalysisReq extends PageParam {
/*
客户国家
*/
private String country;
private List<String> country;
private String countrystr;
private String countrystrs;
/*
客户来源
*/
private int source;
private List<Integer> source;
private String sourcestr;
private String sourcestrs;
/*
销售经理
*/
private String salesmanid;
private List<String> salesmanid;
private String salesmanidstr;
private String salesmanidstrs;
/*
部门ID
*/
private String deptid;
private List<String> deptid;
private String deptidstr;
private String deptidstrs;
/*
客户姓名
......@@ -77,7 +85,9 @@ public class CustomerAnalysisReq extends PageParam {
/*
客户角色
*/
private String customerrole;
private List<String> customerrole;
private String customerrolestr;
private String customerrolestrs;
/*
......
......@@ -218,9 +218,146 @@ public class CustomerAnalysisImpl implements CustomerAnalysisService {
if (Req.getSearchData3() != null) {
Req.setSearchData3(Req.getSearchData3().divide(new BigDecimal(100)));
}*/
setCountry(Req);
setCusRole(Req);
setSource(Req);
setsalesmanid(Req);
setDept(Req);
return Req;
}
/*
设置部门多选
*/
private void setDept(CustomerAnalysisReq Req)
{
if (Req.getDeptid() != null && Req.getDeptid().size() > 0) {
if (Req.getDeptid().size() == 1) {
Req.setDeptidstr(Req.getDeptid().get(0).toString());
Req.setDeptidstrs("");
} else if (Req.getDeptid().size() > 1) {
String sR = "(";
for (String s : Req.getDeptid()
) {
sR += s + ",";
}
sR = sR.substring(0, sR.length() - 1);
sR += ")";
Req.setDeptidstr("");
Req.setDeptidstrs(sR);
}
} else {
Req.setDeptidstr("");
Req.setDeptidstrs("");
}
}
/*
客户经理
*/
private void setsalesmanid(CustomerAnalysisReq Req) {
if (Req.getSalesmanid() != null && Req.getSalesmanid().size() > 0) {
if (Req.getSalesmanid().size() == 1) {
Req.setSalesmanidstr(Req.getSalesmanid().get(0).toString());
Req.setSalesmanidstrs("");
} else if (Req.getSalesmanid().size() > 1) {
String sR = "(";
for (String s : Req.getSalesmanid()
) {
sR += s + ",";
}
sR = sR.substring(0, sR.length() - 1);
sR += ")";
Req.setSalesmanidstr("");
Req.setSalesmanidstrs(sR);
}
} else {
Req.setSalesmanidstr("");
Req.setSalesmanidstrs("");
}
}
/*
客户来源
*/
private void setSource(CustomerAnalysisReq Req) {
if (Req.getSource() != null && Req.getSource().size() > 0) {
if (Req.getSource().size() == 1) {
Req.setSourcestr(Req.getSource().get(0).toString());
Req.setSourcestrs("");
} else if (Req.getSource().size() > 1) {
String sR = "(";
for (int s : Req.getSource()
) {
sR += s + ",";
}
sR = sR.substring(0, sR.length() - 1);
sR += ")";
Req.setSourcestr("");
Req.setSourcestrs(sR);
}
} else {
Req.setSourcestr("");
Req.setSourcestrs("");
}
}
private void setCountry(CustomerAnalysisReq Req) {
//设置多选查询条件 lanbm 2024-06-24 add
if (Req.getCountry() != null && Req.getCountry().size() > 0) {
if (Req.getCountry().size() == 1) {
Req.setCountrystr(Req.getCountry().get(0));
Req.setCountrystrs("");
} else if (Req.getCountry().size() > 1) {
String sR = "(";
for (String s : Req.getCountry()
) {
sR += s + ",";
}
sR = sR.substring(0, sR.length() - 1);
sR += ")";
Req.setCountrystr("");
Req.setCountrystrs(sR);
}
} else {
Req.setCountrystr("");
Req.setCountrystrs("");
}
}
/*
客户角色多选 lanbm 2024-06-24 add
*/
private void setCusRole(CustomerAnalysisReq Req) {
if (Req.getCustomerrole() != null && Req.getCustomerrole().size() > 0) {
if (Req.getCustomerrole().size() == 1) {
Req.setCustomerrolestr(Req.getCustomerrole().get(0));
Req.setCustomerrolestrs("");
} else if (Req.getCustomerrole().size() > 1) {
String sR = "(";
for (String s : Req.getCustomerrole()
) {
sR += s + ",";
}
sR = sR.substring(0, sR.length() - 1);
sR += ")";
Req.setCustomerrolestr("");
Req.setCustomerrolestrs(sR);
}
} else {
Req.setCustomerrolestrs("");
Req.setCustomerrolestr("");
}
}
/*
获取某年某月的最后一天 lanbm 2024-04-16 add
......@@ -687,7 +824,7 @@ public class CustomerAnalysisImpl implements CustomerAnalysisService {
// 计算百分比
double percentage = number / (double) divisor;
// 格式化输出百分比
String formatted = String.format("%.2f%%", percentage*100);
String formatted = String.format("%.2f%%", percentage * 100);
return formatted;
}
......@@ -736,14 +873,13 @@ public class CustomerAnalysisImpl implements CustomerAnalysisService {
}
/*
lanbm 2024-04-26 add
*/
public PageResult<CustomerAnalysisResp> getListPage_New(CustomerAnalysisReq req)
throws JsonProcessingException {
List<CustomerAnalysisResp> list = customerAnalysisMapper.getListPage_New(req);
long total=list.size();
long total = list.size();
list = GetPageResult(list, req.getPageNo(), req.getPageSize());
return new PageResult<>(list, total, req.getPageSize(),
req.getPageNo(),
......
......@@ -160,23 +160,50 @@
<!--业绩类型-->
and c.is_new= #{cusYjType}
</if>
<if test="source!=null and source!=''">
and source= #{source}
<!--客户来源-->
<if test="sourcestr!=null and sourcestr!=''">
and source= #{sourcestr}
</if>
<if test="customerrole!=null and customerrole!=''">
and type= #{customerrole}
<if test="sourcestrs!=null and sourcestrs!=''">
and source in ${sourcestrs}
</if>
<if test="country!=null and country!=''">
and c.country= #{country}
<!--客户角色-->
<if test="customerrolestr!=null and customerrolestr!=''">
and type =#{customerrolestr}
</if>
<if test="salesmanid!=null and salesmanid!=''">
<if test="customerrolestrs!=null and customerrolestrs!=''">
and type in ${customerrolestrs}
</if>
<!--lanbm 2024-06-24 添加国家多选功能-->
<if test="countrystr!=null and countrystr!=''">
and c.country= #{countrystr}
</if>
<if test="countrystrs!=null and countrystrs!=''">
and c.country in ${countrystrs}
</if>
<if test="salesmanidstr!=null and salesmanidstr!=''">
<!--有具体的客户经理,就不算掉入公海池客户-->
and c.is_in_open_sea=0
and c.customer_service= #{salesmanid}
and c.customer_service= #{salesmanidstr}
</if>
<if test="salesmanidstrs!=null and salesmanidstrs!=''">
<!--有具体的客户经理,就不算掉入公海池客户-->
and c.is_in_open_sea=0
and c.customer_service in ${salesmanidstrs}
</if>
<if test="deptid!=null and deptid!=''">
and u_d.dept_id= #{deptid}
</if>
<if test="deptidstrs!=null and deptidstrs!=''">
and u_d.dept_id in ${deptidstrs}
</if>
<if test="sdate4!=null and sdate4!=''">
<!--客户创建时间-->
<if test="edate4!=null and edate4!=''">
......
......@@ -93,17 +93,23 @@ public class LineChannelPackagingServiceImpl extends AbstractService<LineChannel
}
@Override
public List<LineChannelPackagingDO> queryAirClearancePrice(List<String> packages, Long channelId, Long lineId) {
public List<LineChannelPackagingDO> queryAirClearancePrice(
List<String> packages,
Long channelId,
Long lineId) {
List<LineChannelPackagingDO> list = new ArrayList<>();
if (CollectionUtil.isNotEmpty(packages)) {
for (String packageType : packages) {
List<LineChannelPackagingDO> packagingDOList = lineChannelPackagingMapper.queryAirClearancePrice(packageType, channelId, lineId);
List<LineChannelPackagingDO> packagingDOList =
lineChannelPackagingMapper.queryAirClearancePrice(packageType,
channelId, lineId);
if (CollectionUtil.isNotEmpty(packagingDOList)){
list.addAll(packagingDOList);
}
}
} else {
list = lineChannelPackagingMapper.queryAirClearancePrice(null, channelId, lineId);
list = lineChannelPackagingMapper.queryAirClearancePrice(null,
channelId, lineId);
}
return list;
}
......
......@@ -103,7 +103,8 @@ public class WarehouseAreaServiceImpl extends AbstractService<WarehouseAreaMappe
@Override
public List<WarehouseAreaBackVO> getWarehouseAreaListV1(WarehouseAreaQueryVO query) {
List<WarehouseAreaDO> list = getWarehouseAreaList(query);
List<WarehouseAreaBackVO> dataList = WarehouseAreaConvert.INSTANCE.convertList(list);
List<WarehouseAreaBackVO> dataList =
WarehouseAreaConvert.INSTANCE.convertList(list);
matchChild(dataList, true);
return dataList;
}
......
......@@ -103,11 +103,14 @@ public class WarehouseAreaController {
ExcelUtils.write(response, "库区库域.xls", "数据", WarehouseAreaBackVO.class, datas);
}
//查询库位
@GetMapping("/getByWarehouseId")
@ApiOperation("获得仓库查询库域")
// @PreAuthorize("@ss.hasPermission('ecw:warehouse-area:query')")
public CommonResult<List<WarehouseAreaBackVO>> getWarehouseAreaPage(WarehouseAreaQueryVO query) {
List<WarehouseAreaBackVO> list = warehouseAreaService.getWarehouseAreaListV1(query);
//@PreAuthorize("@ss.hasPermission('ecw:warehouse-area:query')")
public CommonResult<List<WarehouseAreaBackVO>> getWarehouseAreaPage(
WarehouseAreaQueryVO query) {
List<WarehouseAreaBackVO> list =
warehouseAreaService.getWarehouseAreaListV1(query);
return success(list);
}
......
......@@ -82,7 +82,8 @@ public class AppWarehouseAreaController {
@ApiOperation("获得仓库查询库域")
@PreAuthenticated
public CommonResult<List<WarehouseAreaBackVO>> getWarehouseAreaPage(WarehouseAreaQueryVO query) {
List<WarehouseAreaDO> list = warehouseAreaService.getWarehouseAreaList(query);
List<WarehouseAreaDO> list =
warehouseAreaService.getWarehouseAreaList(query);
// 导出 Excel
List<WarehouseAreaBackVO> datas = WarehouseAreaConvert.INSTANCE.convertList(list);
matchChild(datas, true);
......
......@@ -82,7 +82,8 @@ public class ProductPriceExceptionHandleListener {
//找出这些订单的未处理的未报价异常
List<OrderExceptionDO> exceptionDOList =
orderExceptionService.list(new LambdaQueryWrapper<OrderExceptionDO>()
.eq(OrderExceptionDO::getOrderExceptionType, OrderExceptionEnum.ORDER_NO_QUOTE_EXCEPTION.getKey())
.eq(OrderExceptionDO::getOrderExceptionType,
OrderExceptionEnum.ORDER_NO_QUOTE_EXCEPTION.getKey())
.in(OrderExceptionDO::getOrderItemId, orderItemIdSet)
.ne(OrderExceptionDO::getOrderExceptionStatus, 2)
);
......@@ -109,6 +110,10 @@ public class ProductPriceExceptionHandleListener {
}
}
else
{
}
//只要有价格就处理清关费未报价异常
//if (productPriceDO.getPriceType() == 0) {
......
......@@ -613,13 +613,16 @@ public class OrderQueryServiceImpl implements OrderQueryService {
initialLogisticsInfoDto.setLineId(dto.getLineId());
initialLogisticsInfoDto.setTransportId(dto.getTransportId());
initialLogisticsInfoDto.setChannelId(dto.getChannelId());
// 保存初始物流信息,该信息为收费信息
//保存初始物流信息,该信息为收费信息
dto.setInitialLogisticsInfoDto(initialLogisticsInfoDto);
LogisticsInfoDto logisticsInfoDto = new LogisticsInfoDto();
BeanUtils.copyProperties(initialLogisticsInfoDto, logisticsInfoDto);
if (Objects.nonNull(dto.getAdjustToDestWarehouseId()) && dto.getAdjustToDestWarehouseId() > 0L) {
if (Objects.nonNull(dto.getAdjustToDestWarehouseId()) &&
dto.getAdjustToDestWarehouseId() > 0L) {
// 如果有始发仓调仓记录id,则获取最新的调仓仓库信息
WarehouseRegionVO startWarehouseRegionVO = warehouseMapper.findWarehouseRegion(dto.getAdjustToDestWarehouseId());
WarehouseRegionVO startWarehouseRegionVO =
warehouseMapper.findWarehouseRegion(dto.getAdjustToDestWarehouseId());
if (Objects.nonNull(startWarehouseRegionVO)) {
logisticsInfoDto.setStartWarehouseId(dto.getAdjustToDestWarehouseId());
logisticsInfoDto.setStartCityId(startWarehouseRegionVO.getShi());
......@@ -632,7 +635,8 @@ public class OrderQueryServiceImpl implements OrderQueryService {
logisticsInfoDto.setStartVolume(startWarehouseRegionVO.getVolume());
}
}
if (Objects.nonNull(dto.getDestAdjustToDestWarehouseId()) && dto.getDestAdjustToDestWarehouseId() > 0L) {
if (Objects.nonNull(dto.getDestAdjustToDestWarehouseId()) &&
dto.getDestAdjustToDestWarehouseId() > 0L) {
// 如果有目的地的目的仓调仓记录id,则获取最新的调仓仓库信息
WarehouseRegionVO destWarehouseRegionVO = warehouseMapper.findWarehouseRegion(dto.getDestAdjustToDestWarehouseId());
if (Objects.nonNull(destWarehouseRegionVO)) {
......
......@@ -6271,7 +6271,9 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
OrderConsigneeDO orderConsigneeDO =
orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, orderDO.getOrderId()).orderByDesc(OrderConsigneeDO::getId).last("limit 1"));
// 更新所属客户经理(业务员)
if (Objects.isNull(orderDO.getParentOrderId()) || orderDO.getParentOrderId() == 0 || orderDO.getSplitSeparateOrder()) {
if (Objects.isNull(orderDO.getParentOrderId()) ||
orderDO.getParentOrderId() == 0 ||
orderDO.getSplitSeparateOrder()) {
// 拆单子订单不执行客户经理分配规则,以原单为主
if (Objects.nonNull(orderDO.getCustomerId()) && orderDO.getCustomerId() > 0) {
addOrderCustomerService(orderDO,
......@@ -6279,8 +6281,14 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderDO.getCustomerId()) ? 1 : 2);
}
}
orderBusinessService.costCalculation(userId, orderDO, orderConsignorDO.getCustomerId(), orderConsigneeDO.getCustomerId(),
orderConsignorDO.getCustomerContactsId(), orderConsigneeDO.getCustomerContactsId(), orderItemDOList, 15);
orderBusinessService.costCalculation(userId,
orderDO,
orderConsignorDO.getCustomerId(),
orderConsigneeDO.getCustomerId(),
orderConsignorDO.getCustomerContactsId(),
orderConsigneeDO.getCustomerContactsId(),
orderItemDOList, 15);
}
@Override
......@@ -6297,8 +6305,14 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
addOrderCustomerService(orderDO, Objects.equals(orderConsignorDO.getCustomerId(), orderDO.getCustomerId()) ? 1 : 2);
}
}
orderBusinessService.costCalculation(userId, orderDO, orderConsignorDO.getCustomerId(), orderConsigneeDO.getCustomerId(),
orderConsignorDO.getCustomerContactsId(), orderConsigneeDO.getCustomerContactsId(), orderItemDOList, 10);
orderBusinessService.costCalculation(userId,
orderDO,
orderConsignorDO.getCustomerId(),
orderConsigneeDO.getCustomerId(),
orderConsignorDO.getCustomerContactsId(),
orderConsigneeDO.getCustomerContactsId(),
orderItemDOList,
10);
}
@Override
......
......@@ -353,9 +353,12 @@ public class OrderSpecialNeedServiceImpl extends AbstractService<OrderSpecialNee
@Override
@Transactional(rollbackFor = Exception.class)
public void buildSpecialReceivable(Long orderId, int type) {
List<OrderSpecialNeedDO> orderSpecialNeedDOS = orderSpecialNeedMapper.selectList(OrderSpecialNeedDO::getOrderId, orderId);
List<OrderSpecialNeedDO> orderSpecialNeedDOS =
orderSpecialNeedMapper.selectList(OrderSpecialNeedDO::getOrderId,
orderId);
if (CollectionUtil.isNotEmpty(orderSpecialNeedDOS)) {
orderSpecialNeedDOS.stream().filter(item -> item.getTransFee().compareTo(BigDecimal.ZERO) == 1).forEach(item -> build(item, type));
orderSpecialNeedDOS.stream().filter(
item -> item.getTransFee().compareTo(BigDecimal.ZERO) == 1).forEach(item -> build(item, type));
}
}
......
......@@ -495,17 +495,13 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
QueryWrapperX lambdaQueryWrapper = new QueryWrapperX();
lambdaQueryWrapper.eq("a.deleted", 0);
lambdaQueryWrapper.apply("a.order_id = {0}", orderId);
return orderExceptionMapper.selectOrderExceptionListByOrderId(lambdaQueryWrapper);
return orderExceptionMapper.selectOrderExceptionListByOrderId(
lambdaQueryWrapper);
}
@Override
public List<OrderExceptionDO> getPendingOrderExceptionByOrderIdAndOrderItemIdAndExceptionKey(Long orderId, Long orderItemId, String exceptionKey) {
return orderExceptionMapper.selectList(
new LambdaQueryWrapper<OrderExceptionDO>().
in(OrderExceptionDO::getOrderExceptionStatus, 0, 1).
eq(Objects.nonNull(orderId), OrderExceptionDO::getOrderId, orderId).
eq(Objects.nonNull(orderItemId), OrderExceptionDO::getOrderItemId, orderItemId).
eq(StringUtils.isNotBlank(exceptionKey), OrderExceptionDO::getOrderExceptionType, exceptionKey));
return orderExceptionMapper.selectList(new LambdaQueryWrapper<OrderExceptionDO>().in(OrderExceptionDO::getOrderExceptionStatus, 0, 1).eq(Objects.nonNull(orderId), OrderExceptionDO::getOrderId, orderId).eq(Objects.nonNull(orderItemId), OrderExceptionDO::getOrderItemId, orderItemId).eq(StringUtils.isNotBlank(exceptionKey), OrderExceptionDO::getOrderExceptionType, exceptionKey));
}
@Override
......@@ -560,7 +556,8 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
@Override
@Transactional(rollbackFor = Exception.class)
public void handlerExceptionByExceptionId(OrderExceptionResultHandlerVo vo) {
public void handlerExceptionByExceptionId(
OrderExceptionResultHandlerVo vo) {
OrderExceptionDO orderExceptionDO =
this.getById(vo.getOrderExceptionId());
......@@ -772,7 +769,9 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
} else {
throw exception(ORDER_HANDLER_EXCEPTION_NOT_EXISTS);
}
} else if ((orderExceptionDO.getOrderExceptionType() + "_result").equals(OrderExceptionResult.ORDER_LACK_BOX_EXCEPTION_RESULT.KEY)) {
} else if ((orderExceptionDO.getOrderExceptionType() + "_result").
equals(OrderExceptionResult.ORDER_LACK_BOX_EXCEPTION_RESULT.KEY)) {
//少箱
switch (vo.getOrderExceptionHandlerResult()) {
case OrderExceptionResult.ORDER_LACK_BOX_EXCEPTION_RESULT.PENDING:
......@@ -791,6 +790,7 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
break;
default:
throw exception(ORDER_HANDLER_EXCEPTION_NOT_EXISTS);
}
} else if ((orderExceptionDO.getOrderExceptionType() + "_result").equals(OrderExceptionResult.ORDER_OTHER_EXCEPTION_RESULT.KEY)) {
//其它异常
......@@ -2394,7 +2394,8 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
}
@Override
public PageResult<OrderBackVO> selectOrderExceptionPage(OrderExceptionQueryVO reqVo, PageVO page) {
public PageResult<OrderBackVO> selectOrderExceptionPage(
OrderExceptionQueryVO reqVo, PageVO page) {
String startTime = "";
String endTime = "";
......@@ -2408,28 +2409,38 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
}
if (StrUtil.equals(reqVo.getOrderNoKey(), "in")) {
queryWrapper.like(StrUtil.isNotBlank(reqVo.getOrderNo()), "a.order_no", reqVo.getOrderNo());
queryWrapper.like(StrUtil.isNotBlank(reqVo.getOrderNo()),
"a.order_no", reqVo.getOrderNo());
} else if (StrUtil.equals(reqVo.getOrderNoKey(), "eq")) {
queryWrapper.eq(StrUtil.isNotBlank(reqVo.getOrderNo()), "a.order_no", reqVo.getOrderNo());
queryWrapper.eq(StrUtil.isNotBlank(reqVo.getOrderNo()),
"a.order_no", reqVo.getOrderNo());
} else if (StrUtil.equals(reqVo.getOrderNoKey(), "ne")) {
queryWrapper.ne(StrUtil.isNotBlank(reqVo.getOrderNo()), "a.order_no", reqVo.getOrderNo());
queryWrapper.ne(StrUtil.isNotBlank(reqVo.getOrderNo()),
"a.order_no", reqVo.getOrderNo());
} else if (StrUtil.equals(reqVo.getOrderNoKey(), "nt")) {
queryWrapper.notLike(StrUtil.isNotBlank(reqVo.getOrderNo()), "a.order_no", reqVo.getOrderNo());
queryWrapper.notLike(StrUtil.isNotBlank(reqVo.getOrderNo()),
"a.order_no", reqVo.getOrderNo());
}
if (StrUtil.equals(reqVo.getMarksKey(), "in")) {
queryWrapper.like(StrUtil.isNotBlank(reqVo.getMarks()), "a.marks", reqVo.getMarks());
queryWrapper.like(StrUtil.isNotBlank(reqVo.getMarks()),
"a.marks", reqVo.getMarks());
} else if (StrUtil.equals(reqVo.getMarksKey(), "eq")) {
queryWrapper.eq(StrUtil.isNotBlank(reqVo.getMarks()), "a.marks", reqVo.getMarks());
queryWrapper.eq(StrUtil.isNotBlank(reqVo.getMarks()),
"a.marks", reqVo.getMarks());
} else if (StrUtil.equals(reqVo.getMarksKey(), "ne")) {
queryWrapper.ne(StrUtil.isNotBlank(reqVo.getMarks()), "a.marks", reqVo.getMarks());
queryWrapper.ne(StrUtil.isNotBlank(reqVo.getMarks()),
"a.marks", reqVo.getMarks());
} else if (StrUtil.equals(reqVo.getMarksKey(), "nt")) {
queryWrapper.notLike(StrUtil.isNotBlank(reqVo.getMarks()), "a.marks", reqVo.getMarks());
queryWrapper.notLike(StrUtil.isNotBlank(reqVo.getMarks()),
"a.marks", reqVo.getMarks());
}
queryWrapper.eqIfPresent("a.is_external_warehouse", reqVo.getIsExternalWarehouse());
queryWrapper.eqIfPresent("a.is_cargo_control", reqVo.getIsCargoControl());
queryWrapper.eqIfPresent("a.is_external_warehouse",
reqVo.getIsExternalWarehouse());
queryWrapper.eqIfPresent("a.is_cargo_control",
reqVo.getIsCargoControl());
queryWrapper.eqIfPresent("a.transport_id", reqVo.getTransportId());
if (StringUtils.isNotBlank(reqVo.getOriginId())) {
queryWrapper.eqIfPresent("wl.start_warehouse_id", reqVo.getOriginId());
......@@ -2505,7 +2516,8 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
queryWrapper.inIfPresent("b.order_exception_type", reqVo.getOrderExceptionType());
}*/
orderExceptionMapper.selectOrderPage(mpPage, queryWrapper, reqVo.getOrderExceptionType(), startTime, endTime);
orderExceptionMapper.selectOrderPage(mpPage,
queryWrapper, reqVo.getOrderExceptionType(), startTime, endTime);
return PageResult.of(mpPage);
}
......@@ -2641,7 +2653,9 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
orderExceptionEnum.getKey());
if (CollectionUtil.isNotEmpty(pendHeavyExceptionList)) {
for (OrderExceptionDO orderExceptionDO : pendHeavyExceptionList) {
for (OrderExceptionDO orderExceptionDO :
pendHeavyExceptionList) {
// 自动处理 只处理待处理的。 处理中的不需要了
if (orderExceptionDO.getOrderExceptionStatus() == 0) {
autoProcessExceptionDo(orderExceptionDO,
......@@ -2667,10 +2681,12 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
orderExceptionResultHandlerVo.setSource("pc");
orderExceptionResultHandlerVo.setOrderExceptionId(orderExceptionDO.getId());
orderExceptionResultHandlerVo.setSystemAutoProcess(isSystemAutoProcess);
orderExceptionResultHandlerVo.setOrderExceptionHandlerResult(orderExceptionHandlerResult);
orderExceptionResultHandlerVo.setOrderExceptionHandlerResult(
orderExceptionHandlerResult);
orderExceptionResultHandlerVo.setOrderExceptionHandlerRemark(
StrUtil.isBlank(remark) ? "系统自动处理" : remark);
//自动处理时设置处理人为admin
orderExceptionResultHandlerVo.setHandlerId(adminId);
//工作流处理
......
......@@ -1074,9 +1074,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
@Override
@Transactional(rollbackFor = Exception.class)
public boolean finishWarehouseIn(OrderWarehouseInFinishReqVO finishReqVO) {
String msg = "完成入仓";
Long orderId = finishReqVO.getOrderId();
OrderDO orderDO = orderService.getById(orderId);
if (orderDO == null) {
......@@ -1283,6 +1281,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
boolean firstRucang = orderDO.getRucangTime() == null;
if (firstRucang) {
//在下面的函数中完成费用计算 lanbm 2024-06-20 添加注释
orderService.finishOrderWarehouseIn(orderDO.getOrderId());
} else {
orderService.finishOrderWarehouseInUpdate(orderDO.getOrderId());
......@@ -1816,17 +1815,23 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
String autoProcessExceptionRemark = "系统自动处理 处理人admin";
if (OrderItemStatusEnum.more_than.getValue().equals(diffType)) {
OrderExceptionEnum orderSuperfluousBoxException = OrderExceptionEnum.ORDER_SUPERFLUOUS_BOX_EXCEPTION;
OrderExceptionEnum orderSuperfluousBoxException =
OrderExceptionEnum.ORDER_SUPERFLUOUS_BOX_EXCEPTION;
// 箱数有变化时才更新异常
boolean noSameCartonsOrderException = isNoSameCartonsOrderException(orderId, cartonsNumDiff, orderSuperfluousBoxException);
boolean noSameCartonsOrderException =
isNoSameCartonsOrderException(orderId,
cartonsNumDiff,
orderSuperfluousBoxException);
if (noSameCartonsOrderException) {
// 生成多箱异常
OrderExceptionCreateReqVO orderExceptionCreateReqVO = genOrderException(orderId, null, orderDO,
OrderExceptionCreateReqVO orderExceptionCreateReqVO =
genOrderException(orderId, null, orderDO,
OrderExceptionEnum.ORDER_SUPERFLUOUS_BOX_EXCEPTION,
String.format("超出%d%s", cartonsNumDiff, label),
String.format("more than %d %s", cartonsNumDiff, labelEn), null);
String.format("more than %d %s", cartonsNumDiff, labelEn),
null);
orderExceptionService.createOrderException(orderExceptionCreateReqVO);
// 自动处理少箱的未处理异常
......@@ -1867,6 +1872,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
autoProcessExceptionRemark,
OrderExceptionResult.ORDER_LACK_BOX_EXCEPTION_RESULT.CONFIRM_CORRECT);
// 删除多箱的未处理异常
//lanbm 2024-06-23 处理少箱异常的时间问题
orderExceptionService.autoProcessException(orderId, null,
OrderExceptionEnum.ORDER_SUPERFLUOUS_BOX_EXCEPTION,
autoProcessExceptionRemark,
......@@ -4895,7 +4901,8 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
}
@Override
public List<OrderWarehouseInWithAttrVO> getOrderWarehouseInCommonAttrList(Long orderId, Long excludeOrderWarehouseInId) {
public List<OrderWarehouseInWithAttrVO> getOrderWarehouseInCommonAttrList(
Long orderId, Long excludeOrderWarehouseInId) {
// 根据订单id获取入库详情
OrderDO orderDO = orderService.getById(orderId);
......@@ -4903,13 +4910,19 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
throw ServiceExceptionUtil.exception(ErrorCodeConstants.ORDER_NOT_EXISTS);
}
List<OrderItemDO> orderItemDOList = orderItemService.list(new LambdaQueryWrapper<OrderItemDO>()
//订单明细
List<OrderItemDO> orderItemDOList =
orderItemService.list(new LambdaQueryWrapper<OrderItemDO>()
.eq(OrderItemDO::getOrderId, orderId).orderByAsc(OrderItemDO::getOrderItemId));
List<OrderWarehouseInDO> orderWarehouseInDOList = orderWarehouseInMapper.selectList(new LambdaQueryWrapper<OrderWarehouseInDO>()
//ecw_order_warehouse_in 入仓货物详情表
List<OrderWarehouseInDO> orderWarehouseInDOList =
orderWarehouseInMapper.selectList(
new LambdaQueryWrapper<OrderWarehouseInDO>()
.eq(OrderWarehouseInDO::getOrderId, orderId).orderByAsc(OrderWarehouseInDO::getId));
if (excludeOrderWarehouseInId != null) {
orderWarehouseInDOList = orderWarehouseInDOList.stream().filter(t -> !t.getId().equals(excludeOrderWarehouseInId)).collect(Collectors.toList());
orderWarehouseInDOList =
orderWarehouseInDOList.stream().filter(t -> !t.getId().equals(excludeOrderWarehouseInId)).collect(Collectors.toList());
}
List<OrderWarehouseInWithAttrVO> resultList = new ArrayList<>();
......
......@@ -138,7 +138,11 @@ public class OrderCommissionPayableJob implements JobHandler {
return "";
}
private void addCommissionPayable(CommissionPayableDO commissionPayable, OrderItemDO orderItemDO, OrderDO orderDO, Integer feeType, BigDecimal amount) {
private void addCommissionPayable(CommissionPayableDO commissionPayable,
OrderItemDO orderItemDO,
OrderDO orderDO,
Integer feeType,
BigDecimal amount) {
commissionPayable.setOrderId(orderItemDO.getOrderId());
commissionPayable.setOrderNo(orderItemDO.getOrderNo());
commissionPayable.setPayableNo(orderDO.getContainerNumber());
......@@ -168,7 +172,8 @@ public class OrderCommissionPayableJob implements JobHandler {
commissionPayable.setTotalAmount(amount.multiply(orderItemDO.getChargeVolume()).setScale(2, RoundingMode.HALF_UP));
} else if (StringUtils.equals("kg", unitDO.getFuhao())) {
// 重量
commissionPayable.setTotalAmount(amount.multiply(orderItemDO.getChargeWeight()).setScale(2, RoundingMode.HALF_UP));
commissionPayable.setTotalAmount(
amount.multiply(orderItemDO.getChargeWeight()).setScale(2, RoundingMode.HALF_UP));
} else if (StringUtils.equals("a", unitDO.getFuhao())) {
// 数量
commissionPayable.setTotalAmount(amount.multiply(orderItemDO.getChargeQuantity()).setScale(2, RoundingMode.HALF_UP));
......
......@@ -2,13 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.order.dal.mysql.orderException.OrderExceptionMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
-->
<select id="selectOrderPage" resultType="cn.iocoder.yudao.module.order.vo.orderException.OrderBackVO">
SELECT b.id AS id,
......
......@@ -342,7 +342,8 @@ public class OrderController {
query.setUserType(UserTypeEnum.ADMIN.getValue());
// query.setSalesmanId(salesmanId);
query.setCreator(String.valueOf(salesmanId));
PageResult<OrderBackPageVO> pageResult = orderQueryService.myOrderPage(query, page);
PageResult<OrderBackPageVO> pageResult =
orderQueryService.myOrderPage(query, page);
return success(pageResult);
}
......
......@@ -66,19 +66,25 @@ public class OrderExceptionController {
@GetMapping("/page")
@ApiOperation("获得订单异常分页")
public CommonResult<PageResult<OrderBackVO>> getOrderExceptionPage(@Valid OrderExceptionQueryVO query, PageVO page) {
public CommonResult<PageResult<OrderBackVO>> getOrderExceptionPage(
@Valid OrderExceptionQueryVO query, PageVO page) {
if (StrUtil.isNotBlank(query.getSalesmanId())) {
//得到跟进客服对应的所有客户经理
List<String> serviceIdList = orderExceptionService.getCustomerServiceListById(Long.parseLong(query.getSalesmanId()));
List<String> serviceIdList =
orderExceptionService.getCustomerServiceListById(
Long.parseLong(query.getSalesmanId()));
List<String> customerServiceList = query.getCustomerIds();
if (null == customerServiceList) {
customerServiceList = new ArrayList<>();
}
customerServiceList.addAll(serviceIdList);
List list = customerServiceList.stream().distinct().collect(Collectors.toList());
List list = customerServiceList.stream().distinct().
collect(Collectors.toList());
query.setCustomerIds(list);
}
PageResult<OrderBackVO> pageResult = orderExceptionService.selectOrderExceptionPage(query, page);
PageResult<OrderBackVO> pageResult =
orderExceptionService.selectOrderExceptionPage(query, page);
return success(pageResult);
}
......@@ -111,6 +117,18 @@ public class OrderExceptionController {
public CommonResult<List<OrderExceptionBackVO>> getOrderExceptionListByOrderId(@RequestParam("orderId") Long orderId) {
List<OrderExceptionBackVO> list =
orderExceptionService.getOrderExceptionListByOrderId(orderId);
for (OrderExceptionBackVO v : list
) {
//lanbm 2024-06-23 处理少箱异常,创建时间和处理时间一致
if (v.getHandlerRemark() != null
&& v.getOrderExceptionType() != null) {
if (v.getHandlerRemark().equals("系统自动处理 处理人admin") &&
v.getOrderExceptionType() == "order_lack_box_exception") {
//少箱异常
v.setHandlerTime(v.getCreateTime());
}
}
}
return success(list);
}
......
......@@ -31,8 +31,10 @@ public class OrderLocationController {
@GetMapping("/list-by-order-id")
@ApiOperation("根据订单id获得订单仓位列表")
@ApiImplicitParam(name = "orderId", value = "订单id", required = true, example = "1024", dataTypeClass = Long.class)
public CommonResult<List<OrderLocationBackVO>> getLocationListByOrderId(@RequestParam("orderId") Long orderId) {
List<OrderLocationDO> list = locationService.getOrderLocationListByOrderId(orderId);
public CommonResult<List<OrderLocationBackVO>> getLocationListByOrderId(
@RequestParam("orderId") Long orderId) {
List<OrderLocationDO> list =
locationService.getOrderLocationListByOrderId(orderId);
return success(OrderLocationConvert.INSTANCE.convertList(list));
}
......
......@@ -32,7 +32,8 @@ public class AppOrderExceptionController {
@ApiOperation("根据订单ID获取所有的订单异常列表")
@ApiImplicitParam(name = "orderId", value = "订单ID", required = true, example = "1024", dataTypeClass = Long.class)
public CommonResult<List<OrderExceptionBackVO>> getOrderExceptionListByOrderId(@RequestParam("orderId") Long orderId) {
List<OrderExceptionBackVO> list = orderExceptionService.getOrderExceptionListByOrderId(orderId);
List<OrderExceptionBackVO> list =
orderExceptionService.getOrderExceptionListByOrderId(orderId);
return success(list);
}
......
package cn.iocoder.yudao.framework.toolkit;
package cn.iocoder.yudao.module.product.dal.dataobject.coupon;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
@TableName("z_test")
@Data
public class zTest {
public class zTest3 {
private Long id;
private String testname;
......
......@@ -67,6 +67,7 @@ public class BasePrice extends BaseDO {
* 全包价金额单位
*/
private Long allPriceUnit;
/**
* 全包价体积单位
*/
......
package cn.iocoder.yudao.module.product.dal.mysql.coupon;
import cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper;
import cn.iocoder.yudao.module.product.dal.dataobject.coupon.zTest3;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ZTestMapper3 extends AbstractMapper<zTest3> {
}
......@@ -81,6 +81,7 @@ public class ProdCostDto {
*/
private Long freightVolume;
//返回给前端页面的清关价
@ApiModelProperty(value = "商品清关费单价(成交)")
private BigDecimal oneClearanceFee;
......
......@@ -24,8 +24,10 @@ import cn.iocoder.yudao.module.ecw.api.currency.dto.ExchangeRateRespDTO;
import cn.iocoder.yudao.module.ecw.api.internalMessage.InternalMessageApi;
import cn.iocoder.yudao.module.ecw.api.internalMessage.dto.InternalMessageCreateDto;
import cn.iocoder.yudao.module.product.convert.product.ProductPriceConvert;
import cn.iocoder.yudao.module.product.dal.dataobject.coupon.zTest3;
import cn.iocoder.yudao.module.product.dal.dataobject.product.*;
import cn.iocoder.yudao.module.product.dal.dataobject.productPriceSnapshot.ProductPriceSnapshotDO;
import cn.iocoder.yudao.module.product.dal.mysql.coupon.ZTestMapper3;
import cn.iocoder.yudao.module.product.dal.mysql.product.*;
import cn.iocoder.yudao.module.product.dal.mysql.productPriceSnapshot.ProductPriceSnapshotMapper;
import cn.iocoder.yudao.module.product.dto.AirClearancePriceResultDto;
......@@ -127,6 +129,9 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
@Resource
private ProductPriceStepClearanceService productPriceStepClearanceService;
@Resource
private ZTestMapper3 zTestMapper;
private static final String PREFIX = "price_batch_update_";
private static final Integer DATA_THRESHOLD = 50;
......@@ -1244,13 +1249,20 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
//lanbm 2024-06-06 处理单询价问题添加的逻辑点。
if (productPriceDO.getNeedOrderInquiry() != null) {
if (productPriceDO.getNeedOrderInquiry() == 1) {
if (productPriceDO.getNeedOrderInquiry() == 1 ||
productPriceDO.getNeedOrderInquiry() == 0) {
hasPrice = true;
}
}
//没有价格信息不继续后面的处理
if (!hasPrice) continue;
if (!hasPrice) {
zTest3 m=new zTest3();
m.setTestname("没有价格信息,不后续处理");
m.setCreatedate(new Date());
zTestMapper.insert(m);
continue;
}
//校验价格的有效期
if (validateStartDate == null && validateEndDate == null) {
......@@ -1284,6 +1296,13 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
handleData.setNeedHandleList(needHandleList);
applicationContext.publishEvent(handleData);
}
else
{
zTest3 m=new zTest3();
m.setTestname("needHandleList 为空");
m.setCreatedate(new Date());
zTestMapper.insert(m);
}
}
@Override
......
......@@ -58,9 +58,14 @@ public class ProductPriceStepServiceImpl extends AbstractService<ProductPriceSte
);
}
//获取阶梯价
@Override
public BasePrice getProductPriceStep(Long productPriceId, BigDecimal num, Integer priceType) {
List<ProductPriceStepDO> list = this.list(new LambdaQueryWrapperX<ProductPriceStepDO>()
public BasePrice getProductPriceStep(Long productPriceId,
BigDecimal num,
Integer priceType) {
//0-运费,1-全包价, 2-清关费
List<ProductPriceStepDO> list = this.list(
new LambdaQueryWrapperX<ProductPriceStepDO>()
.eq(ProductPriceStepDO::getProductPriceId, productPriceId)
.eq(ProductPriceStepDO::getPriceType, priceType)
.eq(ProductPriceStepDO::getDeleted, 0)
......@@ -72,7 +77,10 @@ public class ProductPriceStepServiceImpl extends AbstractService<ProductPriceSte
if (CollectionUtil.isEmpty(list)){
productPriceEmptyType = 1;
}else {
ProductPriceStepDO priceStepDO = list.stream().filter(priceStep -> priceStep.getStartNum().compareTo(num) <= 0 && priceStep.getEndNum().compareTo(num) >= 0).findFirst().orElse(null);
ProductPriceStepDO priceStepDO =
list.stream().filter(priceStep ->
priceStep.getStartNum().compareTo(num) <= 0 &&
priceStep.getEndNum().compareTo(num) >= 0).findFirst().orElse(null);
basePrice = new BasePrice();
if (Objects.isNull(priceStepDO)){
productPriceEmptyType = 2;
......
......@@ -2,11 +2,13 @@ package cn.iocoder.yudao.module.product.controller.admin.prod;
import cn.hutool.core.collection.CollectionUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
import cn.iocoder.yudao.module.product.component.ProdCostCalculation;
import cn.iocoder.yudao.module.product.dto.CalculationCostResultDto;
import cn.iocoder.yudao.module.product.param.ConditionParam;
import cn.iocoder.yudao.module.product.param.ProdConditionParam;
import cn.iocoder.yudao.module.product.service.coupon.CouponService;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -44,11 +46,20 @@ public class ProdLinePriceController {
public CommonResult<CalculationCostResultDto> calculationProdCost(
@RequestBody ConditionParam param) {
//lanbm 2024-06-20 记录的参数日志
//String listToString = JSON.toJSONString(param);
//JsonUtils.SaveLog(listToString);
if (CollectionUtil.isEmpty(param.getProdConditionParamList())) {
return error(ORDER_ITEM_PROD_NOT_EXISTS);
}
// 前端实时计价时需要将订单的固定价格参数进行格式化,转为未定价,否则不会去查询当前实时价格
param.setProdConditionParamList(param.getProdConditionParamList().stream().peek(it -> it.setIsPriced(false)).collect(Collectors.toList()));
param.setProdConditionParamList(
param.getProdConditionParamList().stream().
peek(it -> it.setIsPriced(false)).
collect(Collectors.toList()));
//获取价格信息 lanbm 2024-06-20 添加注释
List<ProdConditionParam> prodConditionParams =
prodCostCalculation.obtainProdLineOnePrice(
param.getProdConditionParamList(),
......@@ -59,6 +70,7 @@ public class ProdLinePriceController {
param.getLineId(),
param.getChannelId(),
false);
CalculationCostResultDto dto =
prodCostCalculation.calculationProdCost(prodConditionParams,
"",
......
......@@ -96,10 +96,12 @@ public class ShipmentBillingZipExportListener {
* @param event 编号记录
*/
@EventListener(ShipmentBillingZipExportPushEvent.class)
public void shipmentBillingZipExportPushEvent(ShipmentBillingZipExportPushEvent event) {
public void shipmentBillingZipExportPushEvent(
ShipmentBillingZipExportPushEvent event) {
if (StringUtils.isNotBlank(event.getRequestParams())) {
try {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DATA_FORMAT);
DateTimeFormatter formatter =
DateTimeFormatter.ofPattern(DATA_FORMAT);
String nowTime = formatter.format(LocalDateTime.now());
JSONObject jsonObject = JSONObject.parseObject(event.getRequestParams());
Long shipmentId = jsonObject.getLong("shipmentId");
......
......@@ -62,6 +62,7 @@ import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.*;
import java.util.stream.Collectors;
......@@ -400,8 +401,33 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B
@Override
public BoxMergePkgDO getMergePkgInfoById(Long id) {
BoxMergePkgDO boxMergePkgDO = boxMergePkgMapper.selectById(id);
if (boxMergePkgDO.getSumVolume() == null) {
if (boxMergePkgDO.getSumVolume() == null||
boxMergePkgDO.getSumVolume().compareTo(new BigDecimal(0))==0) {
//lanbm 2024-06-20注释掉
boxMergePkgDO = boxMergePkgMapper.getMergePkgInfoById(id);
//根据长宽高计算箱的体积
if (boxMergePkgDO.getPkgHight() == null) {
boxMergePkgDO.setPkgHight(new BigDecimal(0));
}
if (boxMergePkgDO.getPkgWidth() == null) {
boxMergePkgDO.setPkgWidth(new BigDecimal(0));
}
if(boxMergePkgDO.getPkgLength()==null)
{
boxMergePkgDO.setPkgLength(new BigDecimal(0));
}
BigDecimal v=
boxMergePkgDO.getPkgHight().multiply(new BigDecimal(0.01)).
multiply(boxMergePkgDO.getPkgLength()).
multiply(new BigDecimal(0.01)).multiply(boxMergePkgDO.getPkgWidth()
).multiply(new BigDecimal(0.01));
//四舍五入
BigDecimal v2= v.setScale(1,BigDecimal.ROUND_HALF_UP);
boxMergePkgDO.setSumVolume(v2);
}
return boxMergePkgDO;
}
......
......@@ -868,7 +868,8 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin
if (checkFile.exists()) {
checkFile.delete();
}
List<BoxPreloadGoodsBackVO> goodsItemList = boxPreloadGoodsService.getShipGoodItemList(shipmentId);
List<BoxPreloadGoodsBackVO> goodsItemList =
boxPreloadGoodsService.getShipGoodItemList(shipmentId);
//以secId排序
goodsItemList.sort(Comparator.comparing(BoxPreloadGoodsBackVO::getSecId));
......@@ -879,7 +880,10 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin
List<InputStream> inputStreams = new ArrayList<>();
for (Map.Entry<Long, List<BoxPreloadGoodsBackVO>> entry : orderMap.entrySet()) {
Long orderId = entry.getKey();
MakeBillOfLadingDO makeBillOfLadingDO = makeBillOfLadingMapper.selectOne(new LambdaQueryWrapperX<MakeBillOfLadingDO>().eq(MakeBillOfLadingDO::getOrderId, orderId).eq(MakeBillOfLadingDO::getStatus, 2).select(MakeBillOfLadingDO::getImgUrl));
MakeBillOfLadingDO makeBillOfLadingDO =
makeBillOfLadingMapper.selectOne(
new LambdaQueryWrapperX<MakeBillOfLadingDO>().eq(
MakeBillOfLadingDO::getOrderId, orderId).eq(MakeBillOfLadingDO::getStatus, 2).select(MakeBillOfLadingDO::getImgUrl));
if (makeBillOfLadingDO == null) continue;
if (StringUtils.isNotBlank(makeBillOfLadingDO.getImgUrl())) {
if (StringUtils.isNotBlank(makeBillOfLadingDO.getImgUrl())) {
......@@ -980,8 +984,12 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin
paramMap.put("num1", item.getWarehouseInInfoVO().getCartonsNum());
paramMap.put("volume", item.getWarehouseInInfoVO().getWeight());
paramMap.put("weight", Objects.nonNull(item.getChargeWeight()) && item.getChargeWeight().compareTo(item.getMinMeteringWeight()) > 0 ? item.getChargeWeight() : item.getMinMeteringWeight());
if (item.getSeaFreightCurrency() != 1) {// 运费固定为美元,其他币种转换为美元
BigDecimal seaFreight = changeAmountToDestCurrency(item.getSeaFreightCurrency().longValue(), 1L, item.getOneSeaFreight());
if (item.getSeaFreightCurrency() != 1) {
// 运费固定为美元,其他币种转换为美元
BigDecimal seaFreight =
changeAmountToDestCurrency(
item.getSeaFreightCurrency().longValue(),
1L, item.getOneSeaFreight());
paramMap.put("seaFreight", seaFreight);
} else {
paramMap.put("seaFreight", item.getOneSeaFreight());
......@@ -1032,13 +1040,16 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin
}
}
}
StringBuffer seaStringBuffer = getStringBuffer(totalFeeMap, orderItemIds, 1);//运费
StringBuffer clearanceStringBuffer = getStringBuffer(totalFeeMap, orderItemIds, 2);//清关费
StringBuffer seaStringBuffer = getStringBuffer(totalFeeMap,
orderItemIds, 1);//运费
StringBuffer clearanceStringBuffer =
getStringBuffer(totalFeeMap, orderItemIds, 2);//清关费
totalItemMap.put("totalNum", totalNum);
totalItemMap.put("totalVolume", totalVolume);
totalItemMap.put("totalWeight", totalWeight);
totalItemMap.put("totalSeaFreight", seaStringBuffer.length() == 0 ? "" : seaStringBuffer.deleteCharAt(seaStringBuffer.length() - 1));
totalItemMap.put("totalClearanceFreight", clearanceStringBuffer.length() == 0 ? "" : clearanceStringBuffer.deleteCharAt(clearanceStringBuffer.length() - 1));
totalItemMap.put("totalClearanceFreight",
clearanceStringBuffer.length() == 0 ? "" : clearanceStringBuffer.deleteCharAt(clearanceStringBuffer.length() - 1));
templateMap.put("totalItemMap", totalItemMap);//订单项总计
templateMap.put("dataList", dataList);//订单项
......@@ -1153,7 +1164,9 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin
//总金额加上保价费
if (info.getCostVO().getInsuranceCurrencyId().longValue() == 1L) {
totalLeft = totalLeft.add(info.getCostVO().getInsuranceFee());
} else if (info.getCostVO().getInsuranceCurrencyId().longValue() == realClearanceFreightCurrency) {
} else if (info.getCostVO().getInsuranceCurrencyId().longValue() ==
realClearanceFreightCurrency) {
//加报价费
totalRight = totalRight.add(info.getCostVO().getInsuranceFee());
} else {
//TODO 和总金额拼起来展示?还是转换成美元加进去?
......
......@@ -58,6 +58,7 @@ public class BoxMergePkgController {
@ApiOperation("更新合包箱")
//@PreAuthorize("@ss.hasPermission('ecw:box-merge-pkg:update')")
public CommonResult<Boolean> updateBoxMergePkg(@Valid @RequestBody BoxMergePkgUpdateReqVO updateReqVO) {
//lanbm 2024-06-20 添加注释
boxMergePkgService.updateBoxMergePkg(updateReqVO);
return success(true);
}
......@@ -140,7 +141,9 @@ public class BoxMergePkgController {
@ApiOperation("获得封箱数据")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
//@PreAuthorize("@ss.hasPermission('ecw:box-pkg-order:query')")
public CommonResult<BoxMergePkgBackVO> getMergePkgInfoById(@RequestParam("id") Long id) {
public CommonResult<BoxMergePkgBackVO> getMergePkgInfoById(
@RequestParam("id") Long id) {
//lanbm 2024-06-20 添加注释
BoxMergePkgDO boxMergePkgBackVO = boxMergePkgService.getMergePkgInfoById(id);
return success(BoxMergePkgConvert.INSTANCE.convert(boxMergePkgBackVO));
}
......
......@@ -104,7 +104,8 @@ public class MakeBillOfLadingController {
@PutMapping("/update")
@ApiOperation("更新制作提货单")
//@PreAuthorize("@ss.hasPermission('shipment:make-bill-of-lading:update')")
public CommonResult<Boolean> updateMakeBillOfLading(@Valid @RequestBody MakeBillOfLadingUpdateReqVO updateReqVO) {
public CommonResult<Boolean> updateMakeBillOfLading(
@Valid @RequestBody MakeBillOfLadingUpdateReqVO updateReqVO) {
makeBillOfLadingService.updateMakeBillOfLading(updateReqVO);
return success(true);
}
......@@ -181,7 +182,9 @@ public class MakeBillOfLadingController {
@ApiImplicitParam(name = "orderId", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
//@PreAuthorize("@ss.hasPermission('shipment:make-bill-of-lading:query')")
public CommonResult<MakeBillOfLadingBackVO> downloadByOrderId(@RequestParam("orderId") Long orderId, HttpServletResponse response) {
MakeBillOfLadingDO lading = makeBillOfLadingService.selectOne(MakeBillOfLadingDO::getOrderId, orderId);
MakeBillOfLadingDO lading =
makeBillOfLadingService.selectOne(MakeBillOfLadingDO::getOrderId,
orderId);
if (lading == null) {
return error(new ErrorCode(1109010018,
"该提单未制作或未审批通过!"));
......@@ -212,7 +215,8 @@ public class MakeBillOfLadingController {
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
//@PreAuthorize("@ss.hasPermission('shipment:make-bill-of-lading:query')")
public CommonResult<MakeBillOfLadingBackVO> download(@RequestParam("id") Long id, HttpServletResponse response) {
MakeBillOfLadingDO makeBillOfLading = makeBillOfLadingService.getMakeBillOfLading(id);
MakeBillOfLadingDO makeBillOfLading =
makeBillOfLadingService.getMakeBillOfLading(id);
return success(MakeBillOfLadingConvert.INSTANCE.convert(makeBillOfLading));
}
......@@ -257,7 +261,8 @@ public class MakeBillOfLadingController {
})
//@PreAuthorize("@ss.hasPermission('shipment:make-bill-of-lading:query')")
public CommonResult<Map<String, Object>> makeAirBillOfLading(@RequestParam("orderId") Long orderId, @RequestParam("shipmentId") Long shipmentId) throws Exception {
Map<String, Object> map = makeBillOfLadingService.makeAirBillOfLading(orderId, shipmentId);
Map<String, Object> map =
makeBillOfLadingService.makeAirBillOfLading(orderId, shipmentId);
return success(map);
}
......
......@@ -63,7 +63,9 @@ public class ReceivableController {
@GetMapping("/getReceivableListByOrderId")
@ApiOperation("根据订单ID获得应收款列表")
@ApiImplicitParam(name = "id", value = "订单ID", required = true, example = "1024", dataTypeClass = Long.class)
public CommonResult<List<ReceivableBackVO>> getReceivableListByOrderId(@RequestParam("id") Long id) {
public CommonResult<List<ReceivableBackVO>> getReceivableListByOrderId(
@RequestParam("id") Long id) {
//lanbm 2024-06-20 添加注释
return success(receivableService.getReceivableListByOrderId(id));
}
......
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