Merge pull request 'demand: TMS系统 - 客户管理 - 月结客户界面 新增字段调整 月结客户导入验重逻辑bug修复 修改运单selectOne bug修复' (#128) from develop into master
Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/128
This commit is contained in:
commit
4546d4c600
@ -94,7 +94,7 @@ public interface EmisWaybillProblemInfoMapper extends BaseMapper<EmisWaybillProb
|
|||||||
* @param billCode
|
* @param billCode
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
EmisWaybillProblemInfo selectEmisWaybillProblemInfoByBillCode(@Param("billCode") String billCode);
|
List<EmisWaybillProblemInfo> selectEmisWaybillProblemInfoByBillCode(@Param("billCode") String billCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据运单号查
|
* 根据运单号查
|
||||||
|
|||||||
@ -160,29 +160,43 @@ public class EmisWaybillProblemInfoServiceImpl extends EmisBaseService implement
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void deleteEmisWaybillProblemInfoByBillCode(String billCode) {
|
public void deleteEmisWaybillProblemInfoByBillCode(String billCode) {
|
||||||
EmisWaybillProblemInfo emisWaybillProblemInfo = emisWaybillProblemInfoMapper.selectEmisWaybillProblemInfoByBillCode(billCode);
|
// 查询所有该运单下的问题件
|
||||||
if (emisWaybillProblemInfo == null) {
|
List<EmisWaybillProblemInfo> problemList = emisWaybillProblemInfoMapper
|
||||||
|
.selectEmisWaybillProblemInfoByBillCode(billCode);
|
||||||
|
if (problemList == null || problemList.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 记录是否需要重算提成
|
||||||
|
boolean needReCalcProfit = false;
|
||||||
|
String mainBillCode = null;
|
||||||
|
for (EmisWaybillProblemInfo emisWaybillProblemInfo : problemList) {
|
||||||
// 删除该问题件的扫描轨迹
|
// 删除该问题件的扫描轨迹
|
||||||
emisTmsScanRecordMapper.deletePromScanRecord(emisWaybillProblemInfo.getId().toString(), emisWaybillProblemInfo.getMainBillCode());
|
emisTmsScanRecordMapper.deletePromScanRecord(emisWaybillProblemInfo.getId().toString(),
|
||||||
|
emisWaybillProblemInfo.getMainBillCode());
|
||||||
// 删除问题件
|
// 删除问题件
|
||||||
emisWaybillProblemInfoMapper.deleteEmisWaybillProblemInfoById(emisWaybillProblemInfo.getId());
|
emisWaybillProblemInfoMapper.deleteEmisWaybillProblemInfoById(emisWaybillProblemInfo.getId());
|
||||||
|
// 判断是否需要重算提成
|
||||||
// 获取运单信息
|
|
||||||
EmisWaybill waybill = getWaybillByBillCode(emisWaybillProblemInfo.getBillCode());
|
EmisWaybill waybill = getWaybillByBillCode(emisWaybillProblemInfo.getBillCode());
|
||||||
if (!"6".equals(waybill.getPaymentType())) {
|
if (waybill != null && !"6".equals(waybill.getPaymentType())) {
|
||||||
// 重新计算提成
|
needReCalcProfit = true;
|
||||||
emisCommissionProfitService.reCalcProfitByBillCode(emisWaybillProblemInfo.getBillCode(),null);
|
}
|
||||||
|
// 记录mainBillCode用于后续取消登记
|
||||||
|
if (mainBillCode == null) {
|
||||||
|
mainBillCode = emisWaybillProblemInfo.getMainBillCode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 重新计算提成
|
||||||
|
if (needReCalcProfit) {
|
||||||
|
emisCommissionProfitService.reCalcProfitByBillCode(billCode, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除运单的问题件记录
|
// 删除运单的问题件记录
|
||||||
|
if (mainBillCode != null) {
|
||||||
EmisWaybill emisWaybill = new EmisWaybill();
|
EmisWaybill emisWaybill = new EmisWaybill();
|
||||||
emisWaybill.setBillCode(emisWaybillProblemInfo.getMainBillCode());
|
emisWaybill.setBillCode(mainBillCode);
|
||||||
emisWaybillMapper.cancelProblemRegister(emisWaybill);
|
emisWaybillMapper.cancelProblemRegister(emisWaybill);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除问题件信息
|
* 删除问题件信息
|
||||||
|
|||||||
@ -131,6 +131,7 @@
|
|||||||
select id, bill_code, main_bill_code, bl_sub_bill, problem_type, problem_title, problem_cause, send_site, send_site_code, register_man_code, register_man_dept, register_site_code, register_date, register_save_date, data_from, status, is_send_site_register, bl_reversion, reversion_str, reversion_man, reversion_man_code, reversion_site_code, reversion_date, bl_checkok, deal_result, bl_see, file_path, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site
|
select id, bill_code, main_bill_code, bl_sub_bill, problem_type, problem_title, problem_cause, send_site, send_site_code, register_man_code, register_man_dept, register_site_code, register_date, register_save_date, data_from, status, is_send_site_register, bl_reversion, reversion_str, reversion_man, reversion_man_code, reversion_site_code, reversion_date, bl_checkok, deal_result, bl_see, file_path, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site
|
||||||
from emis_waybill_problem_info a
|
from emis_waybill_problem_info a
|
||||||
where a.bill_code = #{billCode}
|
where a.bill_code = #{billCode}
|
||||||
|
and a.problem_type in ('173','170')
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectEmisWaybillProblemInfoByBillCodes" parameterType="list" resultMap="EmisWaybillProblemInfoResult">
|
<select id="selectEmisWaybillProblemInfoByBillCodes" parameterType="list" resultMap="EmisWaybillProblemInfoResult">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user