Browse Source

Merge remote-tracking branch 'origin/dev' into dev

fix-sign
pref_mail@163.com 4 months ago
parent
commit
792782aa02
  1. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  2. 24
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java
  3. 1
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml
  4. 30
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportIncomingController.java
  5. 30
      blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportIncomingDTO.java
  6. 19
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.java
  7. 92
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml
  8. 5
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml
  9. 10
      blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportIncomingService.java
  10. 112
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportIncomingServiceImpl.java
  11. 4
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java
  12. 15
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportDeptIncomingNumVO.java
  13. 33
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportDeptIncomingVO.java

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml

@ -630,8 +630,8 @@
lds ON ldsi.stockup_id = lds.id WHERE ldsi.reservation_id = ldrs.reservation_id) AS stockupArea
FROM
logpm_distribution_reservation_stocklist AS ldrs
INNER JOIN logpm_distribution_stock_list AS ldsl ON ldrs.stocklist_id = ldsl.id AND ldsl.is_deleted = 0 AND ldsl.stock_list_status != 2
INNER JOIN logpm_dis_stock_list_detail AS ldsld ON ldrs.reservation_id = ldsld.reservation_id and AND ldsld.is_deleted = 0 AND ldsld.stock_package_status != 2
INNER JOIN logpm_distribution_stock_list AS ldsl ON ldrs.stocklist_id = ldsl.id AND ldsl.is_deleted = 0
INNER JOIN logpm_dis_stock_list_detail AS ldsld ON ldrs.reservation_id = ldsld.reservation_id AND ldsld.is_deleted = 0 AND ldsld.stock_package_status != 2
ldrs.stocklist_id = ldsl.id
WHERE
ldrs.is_deleted = 0

24
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java

@ -1394,6 +1394,30 @@ public class SyncOrderInfoToPlatform {
}
@XxlJob("updateOrderInfo")
public ReturnT<String> updateOrderInfo(String param) {
log.info("############updateOrderInfo: 处理运单重新审核 开始");
List<JSONObject> ls = warehouseMappingDataService.findAllDealWithWaybillNo();
ls.forEach(json -> {
Integer id = json.getInt("id");
String orderCode = json.getStr("waybillNo");
Long warehouseId = json.getLong("warehouseId");
log.info("###################updateOrderInfo: 当前处理的订单为 orderCode={}",orderCode);
distributionStockArticleClient.updateOrderInfo(orderCode,warehouseId);
warehouseMappingDataService.updateStatusDealwithWaybillById(id);
});
log.info("############updateOrderInfo: 处理运单重新审核 完成");
return ReturnT.SUCCESS;
}
}

1
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml

@ -508,6 +508,7 @@
<select id="findAllDealWithWaybillNo" resultType="cn.hutool.json.JSONObject">
select id id,
waybill_no waybillNo,
warehouse_id warehouseId,
status status
from deal_with_waybill_pay_type
where status = 0

30
blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportIncomingController.java

@ -0,0 +1,30 @@
package com.logpm.report.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.report.dto.ReportIncomingDTO;
import com.logpm.report.service.IReportIncomingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@AllArgsConstructor
@RequestMapping("/reportIncoming")
@Api(value = "收入报表", tags = "收入报表")
public class ReportIncomingController extends BladeController {
private final IReportIncomingService reportIncomingService;
@GetMapping("/deptIncomingPage")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "营业部收入报表", notes = "营业部收入报表")
public R deptIncomingPage(ReportIncomingDTO reportIncomingDTO) {
return reportIncomingService.deptIncomingPage(reportIncomingDTO);
}
}

30
blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportIncomingDTO.java

@ -0,0 +1,30 @@
package com.logpm.report.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class ReportIncomingDTO implements Serializable {
private Integer pageNum;
private Integer pageSize;
private String startTimeStr;
private String endTimeStr;
private Date startTime;
private Date endTime;
private String year;
private String month;
private String businessLine;
private String departureWarehouseName;
private String destinationWarehouseName;
private String brand;
}

19
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.java

@ -0,0 +1,19 @@
package com.logpm.report.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.report.dto.ReportIncomingDTO;
import com.logpm.report.vo.ReportDeptIncomingNumVO;
import com.logpm.report.vo.ReportDeptIncomingVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface ReportIncomingMapper {
IPage<ReportDeptIncomingVO> deptIncomingPage(IPage<Object> page, @Param("param") ReportIncomingDTO reportIncomingDTO);
List<ReportDeptIncomingNumVO> findIncomingNum( @Param("param") ReportIncomingDTO reportIncomingDTO);
}

92
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.logpm.report.mapper.ReportIncomingMapper">
<select id="deptIncomingPage" resultType="com.logpm.report.vo.ReportDeptIncomingVO">
select waw.business_line businessLine,
lww.departure_warehouse_name departureWarehouseName,
lww.destination_warehouse_name destinationWarehouseName,
lww.brand brand,
count(lww.id) waybillNum,
sum(lww.total_count) num,
sum(IFNULL(lww.total_weight,0)) weight,
sum(IFNULL(lww.total_volume,0)) volume,
sum(IFNULL(lww.pickup_fee,0)) pickupFee,
sum(IFNULL(lww.total_freight,0)) freightFee,
sum(IFNULL(lww.delivery_fee,0)) deliveryFee,
sum(IFNULL(lww.warehouse_management_fee,0)) warehouseManagementFee,
sum(IFNULL(lww.storage_fee,0)) storageFee,
sum(IFNULL(lww.handling_fee,0)) handlingFee,
sum(IFNULL(lww.sorting_fee,0)) sortingFee,
sum(IFNULL(lww.install_fee,0)) installFee,
sum(IFNULL(lww.other_fee,0)) otherFee,
sum(IFNULL(lww.pickup_fee,0))+sum(IFNULL(lww.total_freight,0))+sum(IFNULL(lww.delivery_fee,0))+sum(IFNULL(lww.warehouse_management_fee,0))+sum(IFNULL(lww.storage_fee,0))+sum(IFNULL(lww.handling_fee,0))+sum(IFNULL(lww.sorting_fee,0))+sum(IFNULL(lww.install_fee,0))+sum(IFNULL(lww.other_fee,0)) totalFee
from logpm_warehouse_waybill lww
left join logpm_warehouse_warehouse waw on waw.id = lww.destination_warehouse_id
where lww.document_making_time &gt; '2024-10-22 00:00:00'
and lww.departure_warehouse_id != 1847456188105195522
<if test="param.businessLine != null and param.businessLine != '' ">
and waw.business_line like concat('%',#{param.businessLine},'%')
</if>
<if test="param.departureWarehouseName != null and param.departureWarehouseName != '' ">
and lww.departure_warehouse_name like concat('%',#{param.departureWarehouseName},'%')
</if>
<if test="param.destinationWarehouseName != null and param.destinationWarehouseName != '' ">
and lww.destination_warehouse_name like concat('%',#{param.destinationWarehouseName},'%')
</if>
<if test="param.brand != null and param.brand != '' ">
and lww.brand like concat('%',#{param.brand},'%')
</if>
<if test="param.startTime != null ">
and lww.document_making_time &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and lww.document_making_time &lt;= #{param.endTime}
</if>
group by waw.business_line,lww.departure_warehouse_name,
lww.destination_warehouse_name,
lww.brand
</select>
<select id="findIncomingNum" resultType="com.logpm.report.vo.ReportDeptIncomingNumVO">
select waw.business_line businessLine,
lww.departure_warehouse_name departureWarehouseName,
lww.destination_warehouse_name destinationWarehouseName,
lww.brand brand,
case when lww.waybill_type = '1' then count(ldpl.id)
when lww.waybill_type = '2' then sum(ldpn.quantity) end stockNum,
case when lww.waybill_type = '1' then sum(IF(ldpl.order_package_status='70',1,0))
when lww.waybill_type = '2' then sum(ldpn.signin_quantity) end signNum,
from logpm_warehouse_waybill lww
left join logpm_warehouse_warehouse waw on waw.id = lww.destination_warehouse_id
left join logpm_distribution_parcel_list ldpl on ldpl.waybill_id = lww.id
left join logpm_distribution_parcel_number ldpn on ldpn.parcel_list_id = ldpl.id
where lww.document_making_time &gt; '2024-10-22 00:00:00'
and lww.departure_warehouse_id != 1847456188105195522
<if test="param.businessLine != null and param.businessLine != '' ">
and waw.business_line like concat('%',#{param.businessLine},'%')
</if>
<if test="param.departureWarehouseName != null and param.departureWarehouseName != '' ">
and lww.departure_warehouse_name like concat('%',#{param.departureWarehouseName},'%')
</if>
<if test="param.destinationWarehouseName != null and param.destinationWarehouseName != '' ">
and lww.destination_warehouse_name like concat('%',#{param.destinationWarehouseName},'%')
</if>
<if test="param.brand != null and param.brand != '' ">
and lww.brand like concat('%',#{param.brand},'%')
</if>
<if test="param.startTime != null ">
and lww.document_making_time &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and lww.document_making_time &lt;= #{param.endTime}
</if>
group by waw.business_line,lww.departure_warehouse_name,
lww.destination_warehouse_name,
lww.brand
</select>
</mapper>

5
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml

@ -588,11 +588,12 @@
IFNULL( sum( quantity ), 0 )
FROM
logpm_distribution_reservation AS ldr
LEFT JOIN logpm_distribution_reservation_package AS ldrp ON ldr.id = ldrp.reservation_id AND ldrp.packet_bar_status != 2 AND ldrp.is_deleted = 0
LEFT JOIN logpm_distribution_reservation_package AS ldrp ON ldr.id = ldrp.reservation_id AND ldrp.packet_bar_status != 2
AND ldrp.is_deleted = 0
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldrp.parce_list_id = ldpl.id AND ldpl.order_package_status != 70
<where>
ldr.is_deleted = 0
AND DATE_FORMAT( ldrp.create_time, "%y%m%d" ) = DATE_FORMAT( now(), "%y%m%d" )
AND DATE_FORMAT( ldr.create_time, "%y%m%d" ) = DATE_FORMAT( now(), "%y%m%d" )
AND ldpl.warehouse_id = #{warehouseId}
</where>
) + (SELECT

10
blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportIncomingService.java

@ -0,0 +1,10 @@
package com.logpm.report.service;
import com.logpm.report.dto.ReportIncomingDTO;
import org.springblade.core.tool.api.R;
public interface IReportIncomingService {
R deptIncomingPage(ReportIncomingDTO reportIncomingDTO);
}

112
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportIncomingServiceImpl.java

@ -0,0 +1,112 @@
package com.logpm.report.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.report.dto.ReportIncomingDTO;
import com.logpm.report.mapper.ReportIncomingMapper;
import com.logpm.report.service.IReportIncomingService;
import com.logpm.report.vo.ReportDeptIncomingNumVO;
import com.logpm.report.vo.ReportDeptIncomingVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@Service
@Slf4j
@AllArgsConstructor
public class ReportIncomingServiceImpl implements IReportIncomingService {
private final ReportIncomingMapper reportIncomingMapper;
@Override
public R deptIncomingPage(ReportIncomingDTO reportIncomingDTO) {
IPage<Object> page = new Page<>();
page.setCurrent(reportIncomingDTO.getPageNum());
page.setSize(reportIncomingDTO.getPageSize());
String year = reportIncomingDTO.getYear();
String month = reportIncomingDTO.getMonth();
String startTimeStr = reportIncomingDTO.getStartTimeStr();
String endTimeStr = reportIncomingDTO.getEndTimeStr();
if(StringUtil.isNotBlank(startTimeStr) && StringUtil.isNotBlank(endTimeStr)){
reportIncomingDTO.setStartTime(CommonUtil.getStartByDateStr(startTimeStr));
reportIncomingDTO.setEndTime(CommonUtil.getEndByDateStr(endTimeStr));
}else{
if(StringUtil.isNotBlank(month)){
Calendar instance = Calendar.getInstance();
if(StringUtil.isBlank(year)){
log.info("############deptIncomingPage:请选择年份");
return R.fail(405,"请选择年份");
}
try{
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
final Date parse = sdf.parse(year+"-"+month);
reportIncomingDTO.setStartTime(CommonUtil.StringToDate(sdf1.format(parse)));
final Calendar cal = Calendar.getInstance();
cal.setTime(parse);
final int last = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
cal.set(Calendar.DAY_OF_MONTH, last);
cal.add(Calendar.DATE, +1);
cal.add(Calendar.SECOND, -1);
reportIncomingDTO.setEndTime(cal.getTime());
}catch (Exception e){
log.info("############deptIncomingPage:");
return R.fail(405,"请选择年份");
}
}else{
if(StringUtil.isNotBlank(year)){
Calendar instance = Calendar.getInstance();
instance.set(Calendar.YEAR,Integer.parseInt(year));
instance.set(Calendar.MONTH,Calendar.JANUARY);
instance.set(Calendar.DAY_OF_MONTH,1);
instance.set(Calendar.HOUR_OF_DAY, 0);
instance.set(Calendar.MINUTE, 0);
instance.set(Calendar.SECOND, 0);
instance.set(Calendar.MILLISECOND, 0);
reportIncomingDTO.setStartTime(instance.getTime());
instance.set(Calendar.MONTH,Calendar.DECEMBER);
instance.set(Calendar.DAY_OF_MONTH,31);
instance.set(Calendar.HOUR_OF_DAY, 23);
instance.set(Calendar.MINUTE, 59);
instance.set(Calendar.SECOND, 59);
instance.set(Calendar.MILLISECOND, 999);
reportIncomingDTO.setEndTime(instance.getTime());
}else{
Calendar instance = Calendar.getInstance();
instance.set(Calendar.HOUR_OF_DAY, 23);
instance.set(Calendar.MINUTE, 59);
instance.set(Calendar.SECOND, 59);
instance.set(Calendar.MILLISECOND, 999);
reportIncomingDTO.setEndTime(instance.getTime());
instance.add(Calendar.DATE, -7);
instance.set(Calendar.HOUR_OF_DAY, 0);
instance.set(Calendar.MINUTE, 0);
instance.set(Calendar.SECOND, 0);
instance.set(Calendar.MILLISECOND, 0);
reportIncomingDTO.setStartTime(instance.getTime());
}
}
}
IPage<ReportDeptIncomingVO> iPage = reportIncomingMapper.deptIncomingPage(page,reportIncomingDTO);
//查询数据对应的在库数和签收数
List<ReportDeptIncomingNumVO> ls = reportIncomingMapper.findIncomingNum(reportIncomingDTO);
return null;
}
}

4
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java

@ -752,7 +752,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
indexBillLadingSignforMonthDataVO.setClerkOverTimeSignfoNum(monthBillLadingOverTimeNum);
//查询当月计划总数
Integer monthBillLadingPlanNum = warehouseIndexMapper.findBillLadingPlanNumByMonth(warehouseId);
indexBillLadingSignforMonthDataVO.setClerkSignNum(monthBillLadingPlanNum);
indexBillLadingSignforMonthDataVO.setPlanNum(monthBillLadingPlanNum);
indexBillLadingSignforMonthDataVO.setClerkOverTimeScale("0.0000");
if (monthBillLadingOverTimeNum > 0 && monthBillLadingPlanNum > 0) {
//计算当月的超时签收率
@ -830,7 +830,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
Integer monthClerkSignforNum = warehouseIndexMapper.findClerkSignforNumByMonth(warehouseId);
indexSignforMonthDataVO.setClerkSignNum(monthClerkSignforNum);
Integer monthPlan = warehouseIndexMapper.findPlanNumByMonth(warehouseId);
indexSignforMonthDataVO.setClerkSignNum(monthPlan);
indexSignforMonthDataVO.setPlanNum(monthPlan);
if (monthClerkSignforNum > 0 && monthPlan > 0) {
BigDecimal bd1 = new BigDecimal(monthClerkSignforNum);
BigDecimal bd2 = new BigDecimal(monthPlan);

15
blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportDeptIncomingNumVO.java

@ -0,0 +1,15 @@
package com.logpm.report.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class ReportDeptIncomingNumVO implements Serializable {
private String businessLine;//事业线
private String departureWarehouseName;//始发仓
private String destinationWarehouseName;//目的仓
private String brand;//品牌
}

33
blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportDeptIncomingVO.java

@ -0,0 +1,33 @@
package com.logpm.report.vo;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class ReportDeptIncomingVO implements Serializable {
private String businessLine;//事业线
private String departureWarehouseName;//始发仓
private String destinationWarehouseName;//目的仓
private String brand;//品牌
private Integer waybillNum;//运单数
private Integer num;//件数
private BigDecimal weight;//重量
private BigDecimal volume;//体积
private Integer stockNum;//到货件数
private Integer signNum;//签收件数
private BigDecimal pickupFee;//提货费
private BigDecimal freightFee;//运费
private BigDecimal deliveryFee;//送货费
private BigDecimal warehouseManagementFee;//仓库管理费
private BigDecimal storageFee;//仓储费
private BigDecimal handlingFee;//仓储操作费
private BigDecimal sortingFee;//仓储分拣费
private BigDecimal installFee;//安装费
private BigDecimal otherFee;//其他费
private BigDecimal totalFee;//总费用
}
Loading…
Cancel
Save