md
This commit is contained in:
parent
1a8d43d241
commit
0b00012227
@ -469,6 +469,33 @@ public class EmisCommonController extends EmisBaseController
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 单独出账
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/redoBillByBillCode")
|
||||
public AjaxResult redoBillByBillCode(String billCode){
|
||||
String lockKey="redoBillByBillCode_"+billCode;
|
||||
// 加锁查询
|
||||
redissonService.lock(lockKey,300);
|
||||
try{
|
||||
emisBaseService.redoGenerateBill(billCode);
|
||||
}
|
||||
catch (Exception ex){
|
||||
redissonService.unlock(lockKey);
|
||||
|
||||
ex.printStackTrace();
|
||||
// 返回子定义异常
|
||||
if(ex instanceof EmisBizError){
|
||||
return AjaxResult.error(ex.getMessage(),((EmisBizError)ex).getErrorCode());
|
||||
}
|
||||
|
||||
return AjaxResult.error("确认异常,联系客服");
|
||||
}
|
||||
redissonService.unlock(lockKey);
|
||||
return AjaxResult.success("发送成功");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动出账触发
|
||||
|
||||
@ -77,4 +77,7 @@ public interface EmisSettleSubBillFeeitemMapper extends BaseMapper<EmisSettleSub
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmisSettleSubBillFeeitemByIds(Long[] ids);
|
||||
|
||||
|
||||
public int deleteEmisSettleSubBillFeeitemByBillCode(String billCode);
|
||||
}
|
||||
|
||||
@ -105,4 +105,8 @@ public interface EmisSettleSubBillMapper extends BaseMapper<EmisSettleSubBill>
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmisSettleSubBillByIds(Long[] ids);
|
||||
|
||||
|
||||
public int deleteEmisSettleSubBillByBillCode(String billCode);
|
||||
|
||||
}
|
||||
|
||||
@ -950,16 +950,32 @@ public class EmisBaseService {
|
||||
List<EmisWaybill> list = emisWaybillMapper.selectWaitDoBillList(qEmisWaybill);
|
||||
if(!CollectionUtil.isEmpty(list)){
|
||||
for(EmisWaybill dt:list){
|
||||
redoGenerateBill(dt.getBillCode());
|
||||
try {
|
||||
redoGenerateBill(dt.getBillCode());
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void redoGenerateBill(String billCode){
|
||||
public void redoGenerateBill(String billCode) throws EmisBizError{
|
||||
log.error("===>Start 运单出账:"+billCode);
|
||||
try {
|
||||
|
||||
// 已确认的不允许出账
|
||||
EmisSettleSubBill querySubBill=getSettleSubBillByBillCode(billCode);
|
||||
if(!"0".equals(querySubBill.getBlConfirm())){
|
||||
log.error("===>账单财务确认不允许出账!");
|
||||
throw new EmisBizError(EmisBizErrorType.FAIL,"账单财务确认不允许出账");
|
||||
}
|
||||
|
||||
// 删除已出账单
|
||||
emisSettleSubBillMapper.deleteEmisSettleSubBillByBillCode(billCode);
|
||||
emisSettleSubBillFeeitemMapper.deleteEmisSettleSubBillFeeitemByBillCode(billCode);
|
||||
|
||||
// 重新出账
|
||||
EmisWaybill dt=emisWaybillMapper.selectEmisWaybillByBillCode(billCode);
|
||||
// 需要先删除账单
|
||||
|
||||
// 生成分账单明细
|
||||
EmisSettleSubBill emisSettleSubBill=new EmisSettleSubBill();
|
||||
@ -1011,16 +1027,13 @@ public class EmisBaseService {
|
||||
emisSettleSubBillFeeitem.setFeeCode(feeitem.getFeeCode());
|
||||
emisSettleSubBillFeeitem.setFeeName(feeitem.getFeeName());
|
||||
emisSettleSubBillFeeitem.setOrigFee(feeitem.getRealFee());
|
||||
emisSettleSubBillFeeitem.setRemark("运费明细:"+feeitem.getFeeName());
|
||||
emisSettleSubBillFeeitem.setRemark(feeitem.getRemark());
|
||||
emisSettleSubBillFeeitemMapper.insertEmisSettleSubBillFeeitem(emisSettleSubBillFeeitem);
|
||||
}
|
||||
}
|
||||
// 出账标识
|
||||
emisWaybillMapper.updateHasDoBill(dt);
|
||||
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
log.error("===>End 运单出账");
|
||||
}
|
||||
|
||||
@ -138,12 +138,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmisSettleSubBillFeeitemByBillCode" parameterType="String">
|
||||
update emis_settle_sub_bill_feeitem set del_flag='1' where bill_code = #{billCode} and del_flag='0'
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEmisSettleSubBillFeeitemById" parameterType="Long">
|
||||
delete from emis_settle_sub_bill_feeitem where id = #{id}
|
||||
update emis_settle_sub_bill_feeitem set del_flag='1' where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEmisSettleSubBillFeeitemByIds" parameterType="String">
|
||||
delete from emis_settle_sub_bill_feeitem where id in
|
||||
update emis_settle_sub_bill_feeitem set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
@ -486,13 +486,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteEmisSettleSubBillByBillCode" parameterType="String">
|
||||
update emis_settle_sub_bill set del_flag='1' where bill_code = #{billCode} and del_flag='0'
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEmisSettleSubBillById" parameterType="Long">
|
||||
delete from emis_settle_sub_bill where id = #{id}
|
||||
update emis_settle_sub_bill set del_flag='1' where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEmisSettleSubBillByIds" parameterType="String">
|
||||
delete from emis_settle_sub_bill where id in
|
||||
update emis_settle_sub_bill set del_flag='1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user