md
This commit is contained in:
parent
41af266927
commit
adac0a0877
@ -16,13 +16,13 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.xdadan.erp.emis.domain.EmisSitePrepaidRecharge;
|
||||
import com.xdadan.erp.emis.domain.EmisWaybill;
|
||||
import com.xdadan.erp.emis.domain.EmisWaybillAjustApply;
|
||||
import com.xdadan.erp.emis.domain.*;
|
||||
import com.xdadan.erp.emis.domain.enumtype.EmisBizErrorType;
|
||||
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||
import com.xdadan.erp.emis.service.EmisBaseService;
|
||||
import com.xdadan.erp.emis.service.IEmisSettleBillService;
|
||||
import com.xdadan.erp.emis.utils.WaybillHelper;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@ -42,7 +42,6 @@ import com.xdadan.erp.common.core.page.TableDataInfo;
|
||||
import com.xdadan.erp.common.enums.BusinessType;
|
||||
import com.xdadan.erp.common.utils.poi.ExcelUtil;
|
||||
|
||||
import com.xdadan.erp.emis.domain.EmisSettleSubBill;
|
||||
import com.xdadan.erp.emis.service.IEmisSettleSubBillService;
|
||||
|
||||
/**
|
||||
@ -61,6 +60,10 @@ public class EmisSettleSubBillController extends EmisBaseController
|
||||
@Autowired
|
||||
private EmisBaseService emisBaseService;
|
||||
|
||||
@Autowired
|
||||
private IEmisSettleBillService emisSettleBillService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询结算子账单列表
|
||||
@ -240,6 +243,16 @@ public class EmisSettleSubBillController extends EmisBaseController
|
||||
|
||||
emisBaseService.confirmBillByCenter(emisSettleSubBill);
|
||||
|
||||
// 判断账单是否已经被合并,若被合并则需要重新计算费用
|
||||
// 重新计算总账单费用
|
||||
// 获取账单是否已经被合并,若合并则更新账单费用
|
||||
if(!StringUtils.isEmpty(old.getSettleBillNo())) {
|
||||
EmisSettleBill oldSettleBill=emisSettleBillService.selectEmisSettleBillBySettleBillNo(old.getSettleBillNo());
|
||||
if(oldSettleBill!=null) {
|
||||
emisSettleBillService.reCalcSettleBillFee(oldSettleBill);
|
||||
}
|
||||
}
|
||||
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
// 返回子定义异常
|
||||
|
||||
@ -344,9 +344,12 @@ public class EmisSettleBillServiceImpl extends EmisBaseService implements IEmisS
|
||||
// 部分收款
|
||||
emisSettleBill.setPaymentStatus("2");
|
||||
}
|
||||
}
|
||||
|
||||
//发票状态不改变
|
||||
// 如果已开票,则调整为部分开票
|
||||
if("1".equals(emisSettleBill.getOpenBillStatus())){
|
||||
emisSettleBill.setOpenBillStatus("2");
|
||||
}
|
||||
}
|
||||
|
||||
// 账单总金额
|
||||
return emisSettleBillMapper.updateEmisSettleBill(emisSettleBill);
|
||||
|
||||
@ -45,8 +45,6 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements
|
||||
@Autowired
|
||||
private IEmisWaybillService emisWaybillService;
|
||||
|
||||
@Autowired
|
||||
private IEmisSettleBillService emisSettleBillService;
|
||||
|
||||
/**
|
||||
* 查询运单调整申请
|
||||
@ -212,20 +210,7 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements
|
||||
|
||||
emisWaybillService.reUpdateWayBill(emisWaybillOld,emisWaybillSave);
|
||||
|
||||
// 重新计算总账单费用
|
||||
// 获取账单是否已经被合并,若合并则更新账单费用
|
||||
if(!CollectionUtils.isEmpty(emisSettleSubBillList)) {
|
||||
// 如果只有一个子账单,则更新总账单
|
||||
if(emisSettleSubBillList.size()==1) {
|
||||
EmisSettleSubBill emisSettleSubBill=emisSettleSubBillList.get(0);
|
||||
if(!StringUtils.isEmpty(emisSettleSubBill.getSettleBillNo())) {
|
||||
EmisSettleBill old=emisSettleBillService.selectEmisSettleBillBySettleBillNo(emisSettleSubBill.getSettleBillNo());
|
||||
if(old!=null) {
|
||||
emisSettleBillService.reCalcSettleBillFee(old);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 审核通过
|
||||
return emisWaybillAjustApplyMapper.auditCenterPass(emisWaybillAjustApply);
|
||||
|
||||
@ -169,7 +169,7 @@
|
||||
</select>
|
||||
|
||||
|
||||
<!--获取扫描统计数据-->
|
||||
<!--获取签收异常扫描统计数据-->
|
||||
|
||||
<select id="queryScanStatList" parameterType="EmisTmsScanRecord" resultMap="ScanStatDataInfoResult">
|
||||
select t1.scan_site_code,t1.scan_count,t2.sign_count,round(round(t2.sign_count/t1.scan_count,3)*100,1) as sign_rate
|
||||
@ -178,6 +178,17 @@
|
||||
from emis_tms_scan_record a,emis_waybill b
|
||||
where a.del_flag='0' and b.del_flag='0' and a.main_bill_code=b.bill_code
|
||||
and a.scan_type=#{scanType}
|
||||
<if test="scanType != null and scanType == '20'">
|
||||
and a.scan_site_code=b.send_site_code
|
||||
</if>
|
||||
<if test="scanType != null and scanType == '30'">
|
||||
and a.scan_site_code=b.dispatch_underling_site_code
|
||||
</if>
|
||||
<if test="scanType != null and scanType == '40'">
|
||||
and a.scan_site_code=b.dispatch_underling_site_code
|
||||
</if>
|
||||
|
||||
|
||||
<if test="scanSiteCode != null and scanSiteCode != ''"> and a.scan_site_code=#{scanSiteCode}</if>
|
||||
<if test="preOrNextStationCode != null and preOrNextStationCode != ''"> and a.pre_or_next_station_code=#{preOrNextStationCode}</if>
|
||||
<if test="scanManCode != null and scanManCode != ''"> and a.scan_man_code=#{scanManCode}</if>
|
||||
@ -200,6 +211,16 @@
|
||||
from emis_tms_scan_record a,emis_waybill b
|
||||
where a.del_flag='0' and b.del_flag='0' and a.main_bill_code=b.bill_code and b.bl_sign='1'
|
||||
and a.scan_type=#{scanType}
|
||||
<if test="scanType != null and scanType == '20'">
|
||||
and a.scan_site_code=b.send_site_code
|
||||
</if>
|
||||
<if test="scanType != null and scanType == '30'">
|
||||
and a.scan_site_code=b.dispatch_underling_site_code
|
||||
</if>
|
||||
<if test="scanType != null and scanType == '40'">
|
||||
and a.scan_site_code=b.dispatch_underling_site_code
|
||||
</if>
|
||||
|
||||
<if test="scanSiteCode != null and scanSiteCode != ''"> and a.scan_site_code=#{scanSiteCode}</if>
|
||||
<if test="preOrNextStationCode != null and preOrNextStationCode != ''"> and a.pre_or_next_station_code=#{preOrNextStationCode}</if>
|
||||
<if test="scanManCode != null and scanManCode != ''"> and a.scan_man_code=#{scanManCode}</if>
|
||||
@ -223,21 +244,30 @@
|
||||
|
||||
|
||||
<select id="queryScanStatRecordList" parameterType="EmisTmsScanRecord" resultMap="EmisTmsScanRecordResult">
|
||||
select a.main_bill_code as bill_code,a.main_bill_code,a.bl_sub_bill,a.scan_type,max(scan_date) as scan_date,
|
||||
select a.main_bill_code as bill_code,a.main_bill_code,a.bl_sub_bill,a.scan_type,scan_date as scan_date,
|
||||
a.pre_or_next_station,a.pre_or_next_station_code,a.scan_site, a.scan_site_code,a.scan_man,a.scan_man_code
|
||||
from emis_tms_scan_record a,emis_waybill b
|
||||
where a.del_flag='0' and b.del_flag='0' and a.main_bill_code=b.bill_code and b.bl_sign!='1'
|
||||
and a.main_bill_code in(
|
||||
select distinct x.main_bill_code
|
||||
from emis_tms_scan_record x
|
||||
where x.del_flag='0' and x.scan_site_code=#{scanSiteCode}
|
||||
and x.scan_type=#{scanType}
|
||||
<if test="preOrNextStationCode != null and preOrNextStationCode != ''"> and x.pre_or_next_station_code=#{preOrNextStationCode}</if>
|
||||
<if test="scanManCode != null and scanManCode != ''"> and x.scan_man_code=#{scanManCode}</if>
|
||||
<if test="params.beginScanDate != null and params.beginScanDate != ''">and x.scan_date <![CDATA[ >= ]]> #{params.beginScanDate}</if>
|
||||
<if test="params.endScanDate != null and params.endScanDate != ''">and x.scan_date <![CDATA[ <= ]]> #{params.endScanDate}</if>
|
||||
)
|
||||
and a.id in(
|
||||
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="queryScanStatRecordList_old" parameterType="EmisTmsScanRecord" resultMap="EmisTmsScanRecordResult">
|
||||
select a.main_bill_code as bill_code,a.main_bill_code,a.bl_sub_bill,a.scan_type,max(scan_date) as scan_date,
|
||||
a.pre_or_next_station,a.pre_or_next_station_code,a.scan_site, a.scan_site_code,a.scan_man,a.scan_man_code
|
||||
from emis_tms_scan_record a,emis_waybill b
|
||||
where a.del_flag='0' and b.del_flag='0' and a.main_bill_code=b.bill_code and b.bl_sign!='1'
|
||||
and a.main_bill_code in(
|
||||
select distinct x.main_bill_code
|
||||
from emis_tms_scan_record x
|
||||
where x.del_flag='0' and x.scan_site_code=#{scanSiteCode}
|
||||
and x.scan_type=#{scanType}
|
||||
<if test="preOrNextStationCode != null and preOrNextStationCode != ''"> and x.pre_or_next_station_code=#{preOrNextStationCode}</if>
|
||||
<if test="scanManCode != null and scanManCode != ''"> and x.scan_man_code=#{scanManCode}</if>
|
||||
<if test="params.beginScanDate != null and params.beginScanDate != ''">and x.scan_date <![CDATA[ >= ]]> #{params.beginScanDate}</if>
|
||||
<if test="params.endScanDate != null and params.endScanDate != ''">and x.scan_date <![CDATA[ <= ]]> #{params.endScanDate}</if>
|
||||
)
|
||||
GROUP BY a.main_bill_code
|
||||
</select>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user