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

Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/232
This commit is contained in:
heyu 2025-11-12 13:54:16 +08:00
commit ab652fabaa
3 changed files with 64 additions and 16 deletions

View File

@ -87,5 +87,13 @@ public class MonthlyCustomerShipmentStatVO implements Serializable {
/* 进口实际重量 */
@Excel(name = "进口实际重量")
private BigDecimal importWeight;
/* 其他票数 */
@Excel(name = "其他票数")
private Integer otherTickets;
/* 其他实际重量 */
@Excel(name = "其他实际重量")
private BigDecimal otherWeight;
}

View File

@ -67,10 +67,36 @@ public class EmisTransProductServiceImpl implements IEmisTransProductService
public int insertEmisTransProduct(EmisTransProduct emisTransProduct)
{
// 获取线路编号
QueryWrapper<EmisTransProduct> queryWrapper=new QueryWrapper();
queryWrapper.eq("trans_line_code",emisTransProduct.getTransLineCode());
Long count = emisTransProductMapper.selectCount(queryWrapper);
String prodCode=emisTransProduct.getTransLineCode()+"-"+ StringUtils.leftPad(String.valueOf(count),4,"0");
QueryWrapper<EmisTransProduct> queryWrapper=new QueryWrapper<>();
queryWrapper.likeRight("prod_code",emisTransProduct.getTransLineCode()+"-");
queryWrapper.select("prod_code");
queryWrapper.orderByDesc("prod_code");
queryWrapper.last("LIMIT 1");
List<EmisTransProduct> productList = emisTransProductMapper.selectList(queryWrapper);
String prodCode;
if (productList == null || productList.isEmpty()) {
// 如果查询结果为空,使用0000
prodCode = emisTransProduct.getTransLineCode()+"-"+"0000";
} else {
// 获取最大的prod_code,提取数字部分加1
String maxProdCode = productList.get(0).getProdCode();
String prefix = emisTransProduct.getTransLineCode()+"-";
if (maxProdCode != null && maxProdCode.startsWith(prefix)) {
String numberPart = maxProdCode.substring(prefix.length());
try {
int maxNumber = Integer.parseInt(numberPart);
int newNumber = maxNumber + 1;
prodCode = prefix + StringUtils.leftPad(String.valueOf(newNumber), 4, "0");
} catch (NumberFormatException e) {
// 如果解析失败,使用0000
prodCode = emisTransProduct.getTransLineCode()+"-"+"0000";
}
} else {
// 如果格式不匹配,使用0000
prodCode = emisTransProduct.getTransLineCode()+"-"+"0000";
}
}
emisTransProduct.setProdCode(prodCode);
emisTransProduct.preInsert();

View File

@ -4009,7 +4009,9 @@
SUM(CASE WHEN a.send_country = '0086' AND tl.trans_type = '4' THEN 1 ELSE 0 END) AS seaTickets,
IFNULL(SUM(CASE WHEN a.send_country = '0086' AND tl.trans_type = '4' THEN a.bill_weight ELSE 0 END), 0) AS seaWeight,
SUM(CASE WHEN a.receive_country = '0086' THEN 1 ELSE 0 END) AS importTickets,
IFNULL(SUM(CASE WHEN a.receive_country = '0086' THEN a.bill_weight ELSE 0 END), 0) AS importWeight
IFNULL(SUM(CASE WHEN a.receive_country = '0086' THEN a.bill_weight ELSE 0 END), 0) AS importWeight,
SUM(CASE WHEN a.receive_country != '0086' AND NOT (a.send_country = '0086' AND tl.trans_type IN ('1','2','3','4','5')) THEN 1 ELSE 0 END) AS otherTickets,
IFNULL(SUM(CASE WHEN a.receive_country != '0086' AND NOT (a.send_country = '0086' AND tl.trans_type IN ('1','2','3','4','5')) THEN a.bill_weight ELSE 0 END), 0) AS otherWeight
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.customer_code = cu.customer_code AND cu.del_flag = '0'
@ -4139,18 +4141,30 @@
</if>
<!-- 运输方式筛选 -->
<if test="transType != null and transType != ''">
AND EXISTS (
SELECT 1 FROM emis_trans_line tl
WHERE tl.line_code = a.trans_line_type
AND tl.del_flag = '0'
<if test="transType == 'import'">
AND a.receive_country = '0086'
</if>
<if test="transType != 'import'">
AND FIND_IN_SET(tl.trans_type, #{transType})
<if test="transType == 'other'">
AND a.receive_country != '0086'
AND NOT EXISTS (
SELECT 1 FROM emis_trans_line tl
WHERE tl.line_code = a.trans_line_type
AND tl.del_flag = '0'
AND a.send_country = '0086'
</if>
)
AND tl.trans_type IN ('1','2','3','4','5')
)
</if>
<if test="transType != 'other'">
AND EXISTS (
SELECT 1 FROM emis_trans_line tl
WHERE tl.line_code = a.trans_line_type
AND tl.del_flag = '0'
<if test="transType == 'import'">
AND a.receive_country = '0086'
</if>
<if test="transType != 'import'">
AND FIND_IN_SET(tl.trans_type, #{transType})
AND a.send_country = '0086'
</if>
)
</if>
</if>
<!-- 权限控制 -->
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">