Merge pull request 'develop' (#229) from develop into master

Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/229
This commit is contained in:
heyu 2025-11-11 17:24:53 +08:00
commit 799d46b52b
9 changed files with 62 additions and 66 deletions

View File

@ -18,6 +18,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xdadan.erp.common.annotation.audit.DataAuditLog;
import com.xdadan.erp.common.annotation.audit.OperateType;
import com.xdadan.erp.emis.domain.EmisWaybill;
import com.xdadan.erp.emis.domain.vo.MonthlyCustomerShipmentStatVO;
import com.xdadan.erp.emis.service.impl.EmisWaybillServiceImpl;
import org.apache.ibatis.annotations.Param;
@ -370,7 +371,7 @@ public interface EmisWaybillMapper extends BaseMapper<EmisWaybill>
* @param emisWaybill 查询条件
* @return 统计结果列表
*/
List<Map> selectMonthlyCustomerShipmentStat(EmisWaybill emisWaybill);
List<MonthlyCustomerShipmentStatVO> selectMonthlyCustomerShipmentStat(EmisWaybill emisWaybill);
/**
* 查询月结客户出货明细

View File

@ -162,38 +162,7 @@ public class EmisCustomerUserServiceImpl extends EmisBaseService implements IEmi
*/
@Override
public List<MonthlyCustomerShipmentStatVO> selectMonthlyCustomerShipmentStat(EmisWaybill emisWaybill) {
List<Map> mapList = emisWaybillMapper.selectMonthlyCustomerShipmentStat(emisWaybill);
return mapList.stream().map(map -> {
MonthlyCustomerShipmentStatVO vo = new MonthlyCustomerShipmentStatVO();
vo.setCustomerName((String) map.get("customerName"));
vo.setCustNo((String) map.get("custNo"));
vo.setCustomerCode((String) map.get("customerCode"));
Object totalTicketsObj = map.get("totalTickets");
if (totalTicketsObj != null) {
vo.setTotalTickets(((Number) totalTicketsObj).intValue());
} else {
vo.setTotalTickets(0);
}
vo.setTotalWeight((java.math.BigDecimal) map.get("totalWeight"));
vo.setSalesmen((String) map.get("salesmen"));
Object expressTicketsObj = map.get("expressTickets");
vo.setExpressTickets(expressTicketsObj != null ? ((Number) expressTicketsObj).intValue() : 0);
vo.setExpressWeight((java.math.BigDecimal) map.getOrDefault("expressWeight", java.math.BigDecimal.ZERO));
Object airTicketsObj = map.get("airTickets");
vo.setAirTickets(airTicketsObj != null ? ((Number) airTicketsObj).intValue() : 0);
vo.setAirWeight((java.math.BigDecimal) map.getOrDefault("airWeight", java.math.BigDecimal.ZERO));
Object landTicketsObj = map.get("landTickets");
vo.setLandTickets(landTicketsObj != null ? ((Number) landTicketsObj).intValue() : 0);
vo.setLandWeight((java.math.BigDecimal) map.getOrDefault("landWeight", java.math.BigDecimal.ZERO));
Object importTicketsObj = map.get("importTickets");
vo.setImportTickets(importTicketsObj != null ? ((Number) importTicketsObj).intValue() : 0);
vo.setImportWeight((java.math.BigDecimal) map.getOrDefault("importWeight", java.math.BigDecimal.ZERO));
return vo;
}).collect(Collectors.toList());
return emisWaybillMapper.selectMonthlyCustomerShipmentStat(emisWaybill);
}
/**

View File

@ -123,7 +123,7 @@ public class EmisQuoteDispAreaServiceImpl extends EmisBaseService implements IEm
public void validateEmisQuoteDispArea(EmisQuoteDispArea emisQuoteDispArea, boolean isUpdate) throws EmisBizError {
// 1. 校验区域名称和删除标志的唯一性
EmisQuoteDispArea queryParam = new EmisQuoteDispArea();
queryParam.setAreaName(emisQuoteDispArea.getAreaName());
queryParam.getParams().put("areaName",emisQuoteDispArea.getAreaName());
queryParam.setDelFlag("0"); // 只查询未删除的记录
List<EmisQuoteDispArea> existingList = emisQuoteDispAreaMapper.selectEmisQuoteDispAreaList(queryParam);

View File

@ -122,7 +122,7 @@ public class EmisQuoteSendAreaServiceImpl extends EmisBaseService implements IEm
public void validateEmisQuoteSendArea(EmisQuoteSendArea emisQuoteSendArea, boolean isUpdate) throws EmisBizError {
// 1. 校验区域名称和删除标志的唯一性
EmisQuoteSendArea queryParam = new EmisQuoteSendArea();
queryParam.setAreaName(emisQuoteSendArea.getAreaName());
queryParam.getParams().put("areaName",emisQuoteSendArea.getAreaName());
queryParam.setDelFlag("0"); // 只查询未删除的记录
List<EmisQuoteSendArea> existingList = emisQuoteSendAreaMapper.selectEmisQuoteSendAreaList(queryParam);

View File

@ -1841,7 +1841,7 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
String scanTypeLabel = DictUtils.getDictLabel("emis_scan_type", emisTmsScanRecord.getScanType());
// 记录扫描操作日志
recordWaybillOperLog(
mainBillCode,
scanBillCode,
WaybillOperLogType.SITE_DO_SCAN,
getCurrentUser().getEmpName(),
getCurrentUser().getOwnerSiteName(),

View File

@ -55,9 +55,23 @@ public class EmisWaybillOperLogServiceImpl implements IEmisWaybillOperLogService
}
@Override
public List<EmisWaybillOperLog> selectListByMainBillCode(String mainBillCode)
{
return emisWaybillOperLogMapper.selectListByMainBillCode(mainBillCode);
public List<EmisWaybillOperLog> selectListByMainBillCode(String mainBillCode) {
List<EmisWaybillOperLog> list = emisWaybillOperLogMapper.selectListByMainBillCode(mainBillCode);
if (list != null && mainBillCode != null) {
for (EmisWaybillOperLog log : list) {
if (log != null && log.getBillCode() != null
&& log.getBillCode().length() > mainBillCode.length()) {
String opDesc = log.getOpDesc();
if (opDesc == null) {
opDesc = "子单" + log.getBillCode();
} else {
opDesc = opDesc + "-子单-" + log.getBillCode();
}
log.setOpDesc(opDesc);
}
}
}
return list;
}
/**

View File

@ -64,6 +64,7 @@
SELECT #{createSite} FROM dual
)
</if>
<if test="params.areaName != null and params.areaName != ''"> and area_name =#{params.areaName}</if>
</where>
order by create_time desc

View File

@ -66,6 +66,9 @@
)
</if>
<if test="params.areaName != null and params.areaName != ''"> and area_name =#{params.areaName}</if>
</where>
order by create_time desc

View File

@ -3999,7 +3999,7 @@
a.cust_no AS custNo,
COUNT(DISTINCT a.bill_code) AS totalTickets,
IFNULL(SUM(a.bill_weight), 0) AS totalWeight,
GROUP_CONCAT(DISTINCT a.salesmen ORDER BY a.order_date SEPARATOR '/') AS salesmen,
GROUP_CONCAT(DISTINCT cu.salesmen ORDER BY a.order_date SEPARATOR '/') AS salesmen,
SUM(CASE WHEN a.send_country = '0086' AND tl.trans_type = '1' THEN 1 ELSE 0 END) AS expressTickets,
IFNULL(SUM(CASE WHEN a.send_country = '0086' AND tl.trans_type = '1' THEN a.bill_weight ELSE 0 END), 0) AS expressWeight,
SUM(CASE WHEN a.send_country = '0086' AND tl.trans_type = '2' THEN 1 ELSE 0 END) AS airTickets,
@ -4010,7 +4010,7 @@
IFNULL(SUM(CASE WHEN a.receive_country = '0086' AND tl.trans_type IN ('1', '2', '3') THEN a.bill_weight ELSE 0 END), 0) AS importWeight
FROM emis_waybill a
LEFT JOIN emis_trans_line tl ON a.trans_line_type = tl.line_code AND tl.del_flag = '0'
LEFT JOIN emis_customer_user cu ON a.cust_no = cu.monthly_pay_code AND cu.del_flag = '0'
LEFT JOIN emis_customer_user cu ON a.customer_code = cu.customer_code AND cu.del_flag = '0'
<where>
a.del_flag = '0'
AND a.order_status !='0'
@ -4062,7 +4062,7 @@
<if test="salesmen != null and salesmen != ''">
AND cu.salesmen LIKE CONCAT('%', #{salesmen}, '%')
</if>
<!-- 权限控制:销售主管 -->
<!-- 权限控制 -->
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
AND (
cu.sales_executive = #{params.privEmpName}
@ -4116,6 +4116,14 @@
<if test="custNo != null and custNo != ''">
AND a.cust_no = #{custNo}
</if>
<!-- 寄件国家 -->
<if test="sendCountry != null and sendCountry != ''">
AND a.send_country = #{sendCountry}
</if>
<!-- 目的国家 -->
<if test="receiveCountry != null and receiveCountry != ''">
AND a.receive_country = #{receiveCountry}
</if>
<!-- 运输方式筛选 -->
<if test="transType != null and transType != ''">
AND EXISTS (
@ -4142,7 +4150,7 @@
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
AND EXISTS (
SELECT 1 FROM emis_customer_user cu
WHERE a.cust_no = cu.monthly_pay_code
WHERE a.customer_code = cu.customer_code
AND cu.del_flag = '0'
AND (
cu.sales_executive = #{params.privEmpName}