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

@ -1,10 +1,10 @@
/**
/**
* @Project: emis
* @Title: EmisTmsScanRecordServiceImpl.java
* @author linfso
* @date 2024-03-01 08:54:59
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @version v1.0
* @Description: <p> TMS扫描记录 实体类 </p>
*/
@ -43,7 +43,7 @@ import org.springframework.transaction.annotation.Transactional;
/**
* TMS扫描记录Service业务层处理
*
*
* @author linfso
* @date 2024-03-01 08:54:59
*/
@ -88,7 +88,7 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
/**
* 查询TMS扫描记录
*
*
* @param id TMS扫描记录主键
* @return TMS扫描记录
*/
@ -124,7 +124,7 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
/**
* 查询TMS扫描记录列表
*
*
* @param emisTmsScanRecord TMS扫描记录
* @return TMS扫描记录
*/
@ -171,7 +171,7 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
/**
* 新增TMS扫描记录
*
*
* @param emisTmsScanRecord TMS扫描记录
* @return 结果
*/
@ -183,7 +183,7 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
/**
* 修改TMS扫描记录
*
*
* @param emisTmsScanRecord TMS扫描记录
* @return 结果
*/
@ -195,7 +195,7 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
/**
* 批量删除TMS扫描记录
*
*
* @param ids 需要删除的TMS扫描记录主键
* @return 结果
*/
@ -207,7 +207,7 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
/**
* 删除TMS扫描记录信息
*
*
* @param id TMS扫描记录主键
* @return 结果
*/
@ -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

@ -1,10 +1,10 @@
/**
/**
* @Project: emis
* @Title: EmisWaybillOperLogServiceImpl.java
* @author linfso
* @date 2025-01-20 15:55:57
* @Copyright: ShangHai Duta 2022 All rights reserved.
* @version v1.0
* @version v1.0
* @Description: <p> 运单操作日志 实体类 </p>
*/
@ -19,19 +19,19 @@ import com.xdadan.erp.emis.service.IEmisWaybillOperLogService;
/**
* 运单操作日志Service业务层处理
*
*
* @author linfso
* @date 2025-01-20 15:55:57
*/
@Service
public class EmisWaybillOperLogServiceImpl implements IEmisWaybillOperLogService
public class EmisWaybillOperLogServiceImpl implements IEmisWaybillOperLogService
{
@Autowired
private EmisWaybillOperLogMapper emisWaybillOperLogMapper;
/**
* 查询运单操作日志
*
*
* @param id 运单操作日志主键
* @return 运单操作日志
*/
@ -44,7 +44,7 @@ public class EmisWaybillOperLogServiceImpl implements IEmisWaybillOperLogService
/**
* 查询运单操作日志列表
*
*
* @param emisWaybillOperLog 运单操作日志
* @return 运单操作日志
*/
@ -55,15 +55,29 @@ 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;
}
/**
* 检查是否重复
*
* @param emisWaybillOperLog
*
* @param emisWaybillOperLog
* @return 数量
*/
@Override
@ -74,7 +88,7 @@ public class EmisWaybillOperLogServiceImpl implements IEmisWaybillOperLogService
/**
* 新增运单操作日志
*
*
* @param emisWaybillOperLog 运单操作日志
* @return 结果
*/
@ -86,7 +100,7 @@ public class EmisWaybillOperLogServiceImpl implements IEmisWaybillOperLogService
/**
* 修改运单操作日志
*
*
* @param emisWaybillOperLog 运单操作日志
* @return 结果
*/
@ -98,7 +112,7 @@ public class EmisWaybillOperLogServiceImpl implements IEmisWaybillOperLogService
/**
* 批量删除运单操作日志
*
*
* @param ids 需要删除的运单操作日志主键
* @return 结果
*/
@ -110,7 +124,7 @@ public class EmisWaybillOperLogServiceImpl implements IEmisWaybillOperLogService
/**
* 删除运单操作日志信息
*
*
* @param id 运单操作日志主键
* @return 结果
*/

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
@ -159,4 +160,4 @@
#{areaId}
</foreach>
</delete>
</mapper>
</mapper>

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
@ -161,4 +164,4 @@
#{areaId}
</foreach>
</delete>
</mapper>
</mapper>

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}