Browse Source

调整对账单2b

master
pref_mail@163.com 4 months ago
parent
commit
1e1732da8c
  1. 4
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/FinanceWaybillVO.java
  2. 48
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceOrderInfoServiceImpl.java
  3. 57
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java
  4. 14
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java
  5. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseWaybillDTO.java
  6. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml

4
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/FinanceWaybillVO.java

@ -83,6 +83,10 @@ public class FinanceWaybillVO implements Serializable {
private String goodsTypeFreightPrice; private String goodsTypeFreightPrice;
private Integer goodsTypeCount; private Integer goodsTypeCount;
private String payStatus;
private String settlementStatus;
} }

48
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceOrderInfoServiceImpl.java

@ -1,6 +1,7 @@
package com.logpm.statistics.service.impl; package com.logpm.statistics.service.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -14,6 +15,8 @@ import com.logpm.statistics.service.*;
import com.logpm.statistics.vo.StatisticsBalanceAbnormalVO; import com.logpm.statistics.vo.StatisticsBalanceAbnormalVO;
import com.logpm.statistics.vo.StatisticsBalanceOrderInfoVO; import com.logpm.statistics.vo.StatisticsBalanceOrderInfoVO;
import com.logpm.statistics.vo.StatisticsBalanceRecordVO; import com.logpm.statistics.vo.StatisticsBalanceRecordVO;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException; import org.springblade.common.exception.CustomerException;
@ -21,6 +24,7 @@ import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.BeanUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -33,14 +37,23 @@ import java.util.stream.Collectors;
@Slf4j @Slf4j
@Service @Service
@AllArgsConstructor
public class StatisticsBalanceOrderInfoServiceImpl extends BaseServiceImpl<StatisticsBalanceOrderInfoMapper, StatisticsBalanceOrderInfoEntity> implements IStatisticsBalanceOrderInfoService { public class StatisticsBalanceOrderInfoServiceImpl extends BaseServiceImpl<StatisticsBalanceOrderInfoMapper, StatisticsBalanceOrderInfoEntity> implements IStatisticsBalanceOrderInfoService {
private final IStatisticsBalanceAbnormalService balanceAbnormalService; @Autowired
private final IStatisticsBalanceAbnormalPhotoService balanceAbnormalPhotoService; private IStatisticsBalanceAbnormalService balanceAbnormalService;
private final IStatisticsBalanceRecordService balanceRecordService; @Autowired
private final IStatisticsBalanceRecordPhotoService balanceRecordPhotoService; private IStatisticsBalanceAbnormalPhotoService balanceAbnormalPhotoService;
private final IBasicdataWarehouseClient warehouseClient; @Autowired
private IStatisticsBalanceRecordService balanceRecordService;
@Autowired
private IStatisticsBalanceRecordPhotoService balanceRecordPhotoService;
@Autowired
private IBasicdataWarehouseClient warehouseClient;
@Autowired
private IStatisticsOrderInfoService statisticsOrderInfoService;
@Autowired
private IWarehouseWaybillClient warehouseWaybillClient;
@Override @Override
public IPage<StatisticsBalanceOrderInfoVO> pageList(MerchantStatisticsDTO merchantStatisticsDTO) { public IPage<StatisticsBalanceOrderInfoVO> pageList(MerchantStatisticsDTO merchantStatisticsDTO) {
@ -287,6 +300,29 @@ public R findBalanceDetail(Long balanceOrderId) {
updateById(statisticsBalanceOrderInfoEntity); updateById(statisticsBalanceOrderInfoEntity);
// 更新运单状态
// 获取结算单对应的运单ID
LambdaQueryWrapper<StatisticsOrderInfoEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(StatisticsOrderInfoEntity::getBalanceOrderId, balanceOrderInfoId);
List<StatisticsOrderInfoEntity> list = statisticsOrderInfoService.list(queryWrapper);
List<Long> waybillIds = list.stream().map(StatisticsOrderInfoEntity::getWaybillId).collect(Collectors.toList());
// 更新运单的状态
List<WarehouseWaybillEntity> data = new ArrayList<>();
waybillIds.forEach(id ->{
WarehouseWaybillEntity t = new WarehouseWaybillEntity();
t.setId(id);
// t.setPayStatus("30");
t.setSettlementStatus("30");
data.add(t);
});
warehouseWaybillClient.updateList(data);
return R.success("结算成功"); return R.success("结算成功");
} }

57
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java

@ -45,6 +45,8 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.StringUtil; import org.springblade.core.tool.utils.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -55,22 +57,35 @@ import java.util.stream.Collectors;
@Slf4j @Slf4j
@Service @Service
@AllArgsConstructor
public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOrderInfoMapper, StatisticsOrderInfoEntity> implements IStatisticsOrderInfoService { public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOrderInfoMapper, StatisticsOrderInfoEntity> implements IStatisticsOrderInfoService {
private final IStatisticsChangesRecordService changesRecordService; @Autowired
private final IStatisticsChangesPhotoService changesPhotoService; private IStatisticsChangesRecordService changesRecordService;
private final IStatisticsBalanceOrderInfoService balanceOrderInfoService; @Autowired
private final IBasicdataPriceClient priceClient; private IStatisticsChangesPhotoService changesPhotoService;
private final IStatisticsDistributionPackageService distributionPackageService; @Lazy
private final IStatisticsWarehousePackageService warehousePackageService; @Autowired
private final IStatisticsTrunklinePackageService trunklinePackageService; private IStatisticsBalanceOrderInfoService balanceOrderInfoService;
private final IStatisticsReconciliationOrderInfoService reconciliationOrderInfoService; @Autowired
private final IStatisticsAftersalesOrderRecordService aftersalesOrderRecordService; private IBasicdataPriceClient priceClient;
private final IBasicdataWarehouseClient warehouseClient; @Autowired
private final IStatisticsBalanceRecordService balanceRecordService; private IStatisticsDistributionPackageService distributionPackageService;
private final IWarehouseWaybillClient warehouseWaybillClient; @Autowired
private final IBasicdataClientClient basicdataClientClient; private IStatisticsWarehousePackageService warehousePackageService;
@Autowired
private IStatisticsTrunklinePackageService trunklinePackageService;
@Autowired
private IStatisticsReconciliationOrderInfoService reconciliationOrderInfoService;
@Autowired
private IStatisticsAftersalesOrderRecordService aftersalesOrderRecordService;
@Autowired
private IBasicdataWarehouseClient warehouseClient;
@Autowired
private IStatisticsBalanceRecordService balanceRecordService;
@Autowired
private IWarehouseWaybillClient warehouseWaybillClient;
@Autowired
private IBasicdataClientClient basicdataClientClient;
@Override @Override
public List<StatisticsOrderInfoEntity> findListByWaybillId(Long waybillId) { public List<StatisticsOrderInfoEntity> findListByWaybillId(Long waybillId) {
@ -786,7 +801,8 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
// updateById(orderInfoEntity); // updateById(orderInfoEntity);
return Boolean.TRUE; } return Boolean.TRUE;
}
@Override @Override
public StatisticsPackageFeeInfoVO findPackageListByOrderIds(List<Long> orderInfoIdsList) { public StatisticsPackageFeeInfoVO findPackageListByOrderIds(List<Long> orderInfoIdsList) {
@ -1113,7 +1129,7 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
balanceOrderInfoEntity.setIsAftersale(0); balanceOrderInfoEntity.setIsAftersale(0);
balanceOrderInfoEntity.setAftersalesFee(BigDecimal.ZERO); balanceOrderInfoEntity.setAftersalesFee(BigDecimal.ZERO);
balanceOrderInfoEntity.setBalanceStatus(2); balanceOrderInfoEntity.setBalanceStatus(0);
balanceOrderInfoEntity.setHasBalanceFee(balanceOrderInfoEntity.getTotalBalanceFee()); balanceOrderInfoEntity.setHasBalanceFee(balanceOrderInfoEntity.getTotalBalanceFee());
balanceOrderInfoEntity.setBalanceUserName(AuthUtil.getUserName()); balanceOrderInfoEntity.setBalanceUserName(AuthUtil.getUserName());
balanceOrderInfoEntity.setBalanceTime(new Date(System.currentTimeMillis())); balanceOrderInfoEntity.setBalanceTime(new Date(System.currentTimeMillis()));
@ -1161,26 +1177,21 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
// 批量更新运单状态 // 批量更新运单状态
List<WarehouseWaybillEntity> te = warehouseWaybillClient.findListByWaybillIds(waybillIds); List<WarehouseWaybillEntity> te = warehouseWaybillClient.findListByWaybillIds(waybillIds);
List<WarehouseWaybillEntity> data = new ArrayList<>(); List<WarehouseWaybillEntity> data = new ArrayList<>();
te.forEach(waybillEntity ->{ te.forEach(waybillEntity -> {
WarehouseWaybillEntity t = new WarehouseWaybillEntity(); WarehouseWaybillEntity t = new WarehouseWaybillEntity();
t.setId(waybillEntity.getId()); t.setId(waybillEntity.getId());
t.setPayStatus("30"); t.setPayStatus("30");
t.setSettlementStatus("30"); // t.setSettlementStatus("30");
data.add(t); data.add(t);
}); });
warehouseWaybillClient.updateList(data); warehouseWaybillClient.updateList(data);
return R.success("操作成功"); return R.success("操作成功");
} }
@Override @Override

14
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java

@ -314,19 +314,9 @@ public class WarehouseWaybillController extends BladeController {
String method = "############pageFinanceWaybillList: "; String method = "############pageFinanceWaybillList: ";
log.info(method + "请求参数{}", waybillDTO); log.info(method + "请求参数{}", waybillDTO);
try{ try{
List<Long> destinationWarehouseIds = new ArrayList<>(); List<Long> destinationWarehouseIds = warehouseClient.getWarehouseIds();
//当前登录人选择的仓库 //当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
List<BasicdataWarehouseEntity> myWatchWarehouse = warehouseClient.getMyWatchWarehouse();
if(!myWatchWarehouse.isEmpty()){
myWatchWarehouse.forEach(warehouseEntity -> {
destinationWarehouseIds.add(warehouseEntity.getId());
});
}
}else{
destinationWarehouseIds.add(myCurrentWarehouse.getId());
}
waybillDTO.setDestinationWarehouseIds(destinationWarehouseIds); waybillDTO.setDestinationWarehouseIds(destinationWarehouseIds);
IPage<FinanceWaybillVO> pages = warehouseWaybillService.pageFinanceWaybillList(waybillDTO); IPage<FinanceWaybillVO> pages = warehouseWaybillService.pageFinanceWaybillList(waybillDTO);

10
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseWaybillDTO.java

@ -75,4 +75,14 @@ public class WarehouseWaybillDTO extends WarehouseWaybillEntity {
private Date checkTimeEndDate; private Date checkTimeEndDate;
private String ids; private String ids;
/**
* 付款状态
*/
private String payStatus;
/**
* 结算状态
*/
private String settlementStatus;
} }

10
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml

@ -494,7 +494,9 @@
GROUP_CONCAT(concat(lwwd.product_name,'(',IFNULL(lwwd.delivery_price,0),')')) goodsTypeDeliveryPrice, GROUP_CONCAT(concat(lwwd.product_name,'(',IFNULL(lwwd.delivery_price,0),')')) goodsTypeDeliveryPrice,
GROUP_CONCAT(concat(lwwd.product_name,'(',IFNULL(lwwd.pickup_price,0),')')) goodsTypePickupPrice, GROUP_CONCAT(concat(lwwd.product_name,'(',IFNULL(lwwd.pickup_price,0),')')) goodsTypePickupPrice,
GROUP_CONCAT(concat(lwwd.product_name,'(',IFNULL(lwwd.freight_price,0),')')) goodsTypeFreightPrice, GROUP_CONCAT(concat(lwwd.product_name,'(',IFNULL(lwwd.freight_price,0),')')) goodsTypeFreightPrice,
count(lwwd.id) goodsTypeCount count(lwwd.id) goodsTypeCount,
lww.pay_status,
lww.settlement_status
from logpm_warehouse_waybill lww from logpm_warehouse_waybill lww
left join logpm_basicdata_client lbc on lbc.id = lww.consignee_id left join logpm_basicdata_client lbc on lbc.id = lww.consignee_id
left join logpm_warehouse_waybill_detail lwwd on lwwd.waybill_id = lww.id and lwwd.is_deleted = 0 left join logpm_warehouse_waybill_detail lwwd on lwwd.waybill_id = lww.id and lwwd.is_deleted = 0
@ -642,6 +644,12 @@
<if test="param.freezeTimeEndDate != null"> <if test="param.freezeTimeEndDate != null">
and lww.freeze_time &lt;= #{param.freezeTimeEndDate} and lww.freeze_time &lt;= #{param.freezeTimeEndDate}
</if> </if>
<if test="param.payStatus != null">
and lww.pay_status = #{param.payStatus}
</if>
<if test="param.settlementStatus != null">
and lww.freeze_time = #{param.settlementStatus}
</if>
GROUP BY lww.id GROUP BY lww.id
order by lww.create_time desc order by lww.create_time desc
</select> </select>

Loading…
Cancel
Save