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

Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/218
This commit is contained in:
heyu 2025-11-05 11:34:53 +08:00
commit 09a8554e68
2 changed files with 18 additions and 8 deletions

View File

@ -109,9 +109,17 @@ public class EmisSalesCommissionRatioServiceImpl implements IEmisSalesCommission
*/ */
@Override @Override
public boolean checkRatioValid(EmisSalesCommissionRatio entity) { public boolean checkRatioValid(EmisSalesCommissionRatio entity) {
java.math.BigDecimal sum = entity.getSalesExecutiveRatio() BigDecimal executiveRatio = entity.getSalesExecutiveRatio() != null
.add(entity.getSalesmenRatio()) ? entity.getSalesExecutiveRatio()
.add(entity.getSalesSupportRatio()); : BigDecimal.ZERO;
return sum.compareTo(new java.math.BigDecimal("100.00")) <= 0; BigDecimal salesmenRatio = entity.getSalesmenRatio() != null
? entity.getSalesmenRatio()
: BigDecimal.ZERO;
BigDecimal supportRatio = entity.getSalesSupportRatio() != null
? entity.getSalesSupportRatio()
: BigDecimal.ZERO;
BigDecimal sum = executiveRatio.add(salesmenRatio).add(supportRatio);
return sum.compareTo(new BigDecimal("100.00")) <= 0;
} }
} }

View File

@ -165,11 +165,13 @@
select bill_code from emis_waybill_problem_info ewpi where ewpi.del_flag='0' and ewpi.`problem_type` in(151,173,170) select bill_code from emis_waybill_problem_info ewpi where ewpi.del_flag='0' and ewpi.`problem_type` in(151,173,170)
)--> )-->
<select id="queryScanStatList" parameterType="EmisTmsScanRecord" resultMap="ScanStatDataInfoResult"> <select id="queryScanStatList" parameterType="EmisTmsScanRecord" resultMap="ScanStatDataInfoResult">
select tbA.scan_site_code ,count(tbA.bill_code) as scan_count,sum(if(tbA.bl_sign=1,1,0)) as sign_count,round(round(ifnull(sum(if(tbA.bl_sign=1,1,0)),0)/count(tbA.bill_code),3)*100,1) as sign_rate select tbA.scan_site_code ,count(tbA.bill_code) as scan_count,sum(if(tbA.bl_sign=1 or (tbA.customs_clear=2 and tbA.trans_type=2),1,0)) as sign_count,round(round(ifnull(sum(if(tbA.bl_sign=1 or (tbA.customs_clear=2 and tbA.trans_type=2),1,0)),0)/count(tbA.bill_code),3)*100,1) as sign_rate
from ( from (
select DISTINCT a.scan_site_code,b.bill_code , b.bl_sign select DISTINCT a.scan_site_code,b.bill_code , b.bl_sign, b.customs_clear, k.trans_type
from emis_tms_scan_record a,emis_waybill b from emis_tms_scan_record a
where a.del_flag='0' and b.del_flag='0' and a.bill_code=b.bill_code inner join emis_waybill b on a.bill_code=b.bill_code
left join emis_trans_line k on b.trans_line_type=k.line_code and k.del_flag='0'
where a.del_flag='0' and b.del_flag='0'
and not EXISTS ( and not EXISTS (
select 1 from emis_waybill_problem_info ewpi where ewpi.bill_code=b.bill_code and ewpi.del_flag='0' and ewpi.`problem_type` in(151,173,170) select 1 from emis_waybill_problem_info ewpi where ewpi.bill_code=b.bill_code and ewpi.del_flag='0' and ewpi.`problem_type` in(151,173,170)
) )