Browse Source

feat(all): 修改仓库日度月度报表查询

dist.1.2.0
zhaoqiaobo 6 months ago
parent
commit
a0bd7cc32e
  1. 15
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/QualityDeliverEntity.java
  2. 5
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchPriceEntity.java
  3. 5
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchTrainDetailEntity.java
  4. 1181
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java
  5. 109
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReturnWarehouseReportListener.java
  6. 2
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseDayMapper.java
  7. 15
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseDayMapper.xml
  8. 4
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseMonthMapper.java
  9. 15
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseMonthMapper.xml
  10. 9
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/ExpenseWarehouseMonthServiceImpl.java
  11. 9
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/vo/ExpenseWarehouseDayVO.java
  12. 7
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/vo/ExpenseWarehouseMonthVO.java

15
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/QualityDeliverEntity.java

@ -364,6 +364,16 @@ public class QualityDeliverEntity extends TenantEntity {
*/
@ApiModelProperty(value = "配送公司")
private String distributionCompany;
/**
* 配送是否整车计费
*/
@ApiModelProperty(value = "配送是否整车计费")
private String ynWholeVehicle;
/**
* 配送整车费(外协)
*/
@ApiModelProperty(value = "配送整车费(外协)")
private String deliveryFee;
/**
* 计划时间
*/
@ -584,6 +594,11 @@ public class QualityDeliverEntity extends TenantEntity {
*/
@ApiModelProperty(value = "配送成本")
private String distributionCost;
/**
* 整车成本
*/
@ApiModelProperty(value = "整车成本")
private String wholeVehicleCost;
/**
* 分货费成本
*/

5
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchPriceEntity.java

@ -54,6 +54,11 @@ public class ExpenseDispatchPriceEntity extends TenantEntity {
*/
@ApiModelProperty(value = "免费上楼层数")
private int freeFloorLevels;
/**
* 整车计费单价
*/
@ApiModelProperty(value = "整车计费单价")
private String wholeVehicleCost;
/**
* 公里数单价
*/

5
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchTrainDetailEntity.java

@ -124,6 +124,11 @@ public class ExpenseDispatchTrainDetailEntity extends TenantEntity {
*/
@ApiModelProperty(value = "配送成本")
private String distributionCost;
/**
* 整车成本
*/
@ApiModelProperty(value = "整车成本")
private String wholeVehicleCost;
/**
* 库存品配送成本
*/

1181
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java

File diff suppressed because it is too large Load Diff

109
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReturnWarehouseReportListener.java

@ -0,0 +1,109 @@
package com.logpm.distribution.receiver.report;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.logpm.distribution.dto.ReportQualityDeliverDTO;
import com.logpm.distribution.entity.QualityDeliverEntity;
import com.logpm.distribution.service.IQualityDeliverService;
import com.logpm.factorydata.feign.IFactoryDataClient;
import com.logpm.factorydata.vo.SendMsg;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.constant.report.ReportConstants;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.common.model.DistributionSignforVO;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.PackageData;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
* 回库生成明细报表
*
* @author zhaoqiaobo
* @create 2024-03-18 0:02
*/
@Slf4j
@Component
@AllArgsConstructor
public class ReturnWarehouseReportListener {
@Resource
private IQualityDeliverService qualityDeliverService;
@Resource
private IFactoryDataClient factoryDataClient;
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = FanoutConstants.distribution.DeliveryAndReturnWarehouse.QUEUE.REPORT, durable = "true"),
exchange = @Exchange(name = FanoutConstants.distribution.DeliveryAndReturnWarehouse.EXCHANGE, type = ExchangeTypes.FANOUT)
))
@Transactional(rollbackFor = Exception.class)
public void buildReport(String msg) {
log.info("回库生成明细报表: {}", msg);
if (StrUtil.isEmpty(msg)) {
return;
}
NodeFanoutMsg bean = JSONUtil.toBean(msg, NodeFanoutMsg.class);
Object main = bean.getMain();
JSONObject entries = JSONUtil.parseObj(main);
DistributionSignforVO vo = JSONUtil.toBean(entries, DistributionSignforVO.class);
Long warehouseId = bean.getWarehouseId();
BizOperationEnums bizOperation = bean.getBizOperation();
List<PackageData> details = vo.getPackageDataList();
if (CollUtil.isNotEmpty(details)) {
for (PackageData detail : details) {
QualityDeliverEntity qualityDeliverEntity = QualityDeliverEntity.builder()
.warehouseName(bean.getWarehouse())
.warehouseId(warehouseId)
.orderPackageCode(detail.getPackageCode())
.reviewUserName(bean.getOperator())
.reviewTime(bean.getOperatorTime())
.bizStatus(100)
.build();
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
qualityDeliverEntity.setConditions(1);
sendReport(bizOperation, qualityDeliverEntity);
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.LTL)) {
qualityDeliverEntity.setBizCode(vo.getReservationCode());
qualityDeliverEntity.setOrderCode(detail.getOrderCode());
qualityDeliverEntity.setCategory(detail.getProductName());
qualityDeliverEntity.setConditions(2);
sendReport(bizOperation, qualityDeliverEntity);
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.INV)) {
qualityDeliverEntity.setIncomingBatch(detail.getPickupBatch());
qualityDeliverEntity.setMallName(detail.getMallName());
qualityDeliverEntity.setMaterielCode(detail.getMaterialCode());
qualityDeliverEntity.setMaterielName(detail.getMaterialName());
qualityDeliverEntity.setConditions(3);
sendReport(bizOperation, qualityDeliverEntity);
}
}
}
}
private void sendReport(BizOperationEnums bizOperation, QualityDeliverEntity qualityDeliverEntity) {
if (BizOperationEnums.ADD.equals(bizOperation) || BizOperationEnums.MODIFY.equals(bizOperation)) {
ReportQualityDeliverDTO dto = ReportQualityDeliverDTO.builder().data(JSONUtil.toJsonStr(qualityDeliverEntity)).operation(BizOperationEnums.MODIFY).build();
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE)
.routingKey(ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY)
.message(JSONUtil.toJsonStr(dto))
.delay(3000)
.build());
}
}
}

2
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseDayMapper.java

@ -40,7 +40,7 @@ public interface ExpenseWarehouseDayMapper extends BaseMapper<ExpenseWarehouseDa
* @param expenseWarehouseDay
* @return
*/
List<ExpenseWarehouseDayVO> selectExpenseWarehouseDayPage(IPage page, ExpenseWarehouseDayVO expenseWarehouseDay);
List<ExpenseWarehouseDayVO> selectExpenseWarehouseDayPage(@Param("page") IPage page, @Param("expenseWarehouseDay") ExpenseWarehouseDayVO expenseWarehouseDay);
/**

15
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseDayMapper.xml

@ -8,7 +8,20 @@
<select id="selectExpenseWarehouseDayPage" resultMap="expenseWarehouseDayResultMap">
select * from logpm_expense_warehouse_day where is_deleted = 0
select * from logpm_expense_warehouse_day
where is_deleted = 0
<if test="expenseWarehouseDay.startDateQuery != null and expenseWarehouseDay.startDateQuery != ''">
and cost_settlement >= #{expenseWarehouseDay.startDateQuery}
</if>
<if test="expenseWarehouseDay.endDateQuery != null and expenseWarehouseDay.endDateQuery != ''">
and cost_settlement <![CDATA[ <= ]]> #{expenseWarehouseDay.endDateQuery}
</if>
<if test="expenseWarehouseDay.warehouseNameQuery != null and expenseWarehouseDay.warehouseNameQuery != ''">
and warehouse_name in
<foreach collection="expenseWarehouseDay.warehouseNameQuery.split(',')" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</select>

4
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseMonthMapper.java

@ -38,10 +38,10 @@ public interface ExpenseWarehouseMonthMapper extends BaseMapper<ExpenseWarehouse
* 自定义分页
*
* @param page
* @param queryWrapper
* @param vo
* @return
*/
List<ExpenseWarehouseMonthVO> selectExpenseWarehouseMonthPage(IPage page,@Param("ew") Wrapper<ExpenseWarehouseMonthVO> queryWrapper);
List<ExpenseWarehouseMonthVO> selectExpenseWarehouseMonthPage(@Param("page") IPage page, @Param("vo") ExpenseWarehouseMonthVO vo);
/**

15
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/ExpenseWarehouseMonthMapper.xml

@ -8,7 +8,20 @@
<select id="selectExpenseWarehouseMonthPage" resultMap="expenseWarehouseMonthResultMap">
select * from logpm_expense_warehouse_month ${ew.customSqlSegment}
select * from logpm_expense_warehouse_month
where is_deleted = 0
<if test="vo.startDateQuery != null and vo.startDateQuery != ''">
and cost_settlement >= #{vo.startDateQuery}
</if>
<if test="vo.endDateQuery != null and vo.endDateQuery != ''">
and cost_settlement <![CDATA[ <= ]]> #{vo.endDateQuery}
</if>
<if test="vo.warehouseNameQuery != null and vo.warehouseNameQuery != ''">
and warehouse_name in
<foreach collection="vo.warehouseNameQuery.split(',')" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</select>

9
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/ExpenseWarehouseMonthServiceImpl.java

@ -17,16 +17,13 @@
package com.logpm.statistics.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.statistics.entity.ExpenseWarehouseMonthEntity;
import com.logpm.statistics.excel.ExpenseWarehouseMonthExcel;
import com.logpm.statistics.mapper.ExpenseWarehouseMonthMapper;
import com.logpm.statistics.service.IExpenseWarehouseMonthService;
import com.logpm.statistics.util.QueryUtil;
import com.logpm.statistics.vo.ExpenseWarehouseMonthVO;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.constant.BladeConstant;
import org.springframework.stereotype.Service;
import java.util.List;
@ -42,9 +39,9 @@ public class ExpenseWarehouseMonthServiceImpl extends BaseServiceImpl<ExpenseWar
@Override
public IPage<ExpenseWarehouseMonthVO> selectExpenseWarehouseMonthPage(IPage<ExpenseWarehouseMonthVO> page, ExpenseWarehouseMonthVO expenseWarehouseMonth) {
QueryWrapper<ExpenseWarehouseMonthVO> queryWrapper = QueryUtil.buildQueryWrapper(expenseWarehouseMonth, ExpenseWarehouseMonthVO.class);
queryWrapper.lambda().eq(ExpenseWarehouseMonthVO::getIsDeleted, BladeConstant.DB_NOT_DELETED);
return page.setRecords(baseMapper.selectExpenseWarehouseMonthPage(page, queryWrapper));
// QueryWrapper<ExpenseWarehouseMonthVO> queryWrapper = QueryUtil.buildQueryWrapper(expenseWarehouseMonth, ExpenseWarehouseMonthVO.class);
// queryWrapper.lambda().eq(ExpenseWarehouseMonthVO::getIsDeleted, BladeConstant.DB_NOT_DELETED);
return page.setRecords(baseMapper.selectExpenseWarehouseMonthPage(page, expenseWarehouseMonth));
}

9
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/vo/ExpenseWarehouseDayVO.java

@ -17,7 +17,7 @@
package com.logpm.statistics.vo;
import com.logpm.statistics.entity.ExpenseWarehouseDayEntity;
import org.springblade.core.tool.node.INode;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -31,5 +31,10 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
public class ExpenseWarehouseDayVO extends ExpenseWarehouseDayEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "开始时间 年-月-日")
private String startDateQuery;
@ApiModelProperty(value = "结束时间 年-月-日")
private String endDateQuery;
@ApiModelProperty(value = "仓库 A,B,C")
private String warehouseNameQuery;
}

7
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/vo/ExpenseWarehouseMonthVO.java

@ -40,4 +40,11 @@ public class ExpenseWarehouseMonthVO extends ExpenseWarehouseMonthEntity {
@ApiModelProperty(value = "成本结算时间")
private String CostSettlementTime;
@ApiModelProperty(value = "开始时间 年-月-日")
private String startDateQuery;
@ApiModelProperty(value = "结束时间 年-月-日")
private String endDateQuery;
@ApiModelProperty(value = "仓库 A,B,C")
private String warehouseNameQuery;
}

Loading…
Cancel
Save