md
This commit is contained in:
parent
c5c4e0bb06
commit
f3d8f4fa57
@ -218,10 +218,38 @@ public class EmisSettleBillController extends BaseController
|
||||
List<EmisSettleSubBill> subBillList=emisBaseService.selectSubBillListBySettleBillNo(settleBillNo);
|
||||
emisSettleBill.setSubBillList(subBillList);
|
||||
|
||||
try {
|
||||
int isCanPay=emisSettleBillService.checkCanOnlinePay(emisSettleBill);
|
||||
if(isCanPay==1) {
|
||||
emisSettleBill.setBlLockOnlinePay("F");
|
||||
}else{
|
||||
emisSettleBill.setBlLockOnlinePay("T");
|
||||
emisSettleBill.setLockOnlinePayReason("该单不支持在线支付");
|
||||
}
|
||||
} catch (EmisBizError emisBizError) {
|
||||
emisBizError.printStackTrace();
|
||||
emisSettleBill.setBlLockOnlinePay("T");
|
||||
emisSettleBill.setLockOnlinePayReason("该单不支持在线支付:"+emisBizError.getMessage());
|
||||
}
|
||||
|
||||
return AjaxResult.success("成功",emisSettleBill);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/checkCanOnlinePay")
|
||||
public AjaxResult checkCanOnlinePay(EmisSettleBill emisSettleBill)
|
||||
{
|
||||
try {
|
||||
int isCanPay=emisSettleBillService.checkCanOnlinePay(emisSettleBill);
|
||||
if(isCanPay==1) {
|
||||
return AjaxResult.success("支持在线支付", isCanPay);
|
||||
}else{
|
||||
return AjaxResult.error("不支持在线支付", isCanPay);
|
||||
}
|
||||
} catch (EmisBizError emisBizError) {
|
||||
emisBizError.printStackTrace();
|
||||
return AjaxResult.error(emisBizError.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取微信二维码付款图片
|
||||
@ -261,10 +289,6 @@ public class EmisSettleBillController extends BaseController
|
||||
@PostMapping(value = "/sumbitWxPay")
|
||||
public AjaxResult sumbitWxPay(@RequestBody EmisSettleBill emisSettleBill)
|
||||
{
|
||||
// String customerCode=emisSettleBill.getCustomerCode();
|
||||
// emisSettleBill.setCustomerCode(customerCode);
|
||||
// return AjaxResult.success("123");
|
||||
|
||||
try {
|
||||
Map<String,String> payObj=emisSettleBillPayLogService.genWxPayFromWxApp(emisSettleBill.getSettleBillNo(),emisSettleBill.getAppId(),emisSettleBill.getOpenId());
|
||||
return AjaxResult.success("成功",payObj);
|
||||
|
||||
@ -198,6 +198,11 @@ public class EmisSettleBill extends BaseEntity
|
||||
// appId
|
||||
private String appId;
|
||||
|
||||
// 在线支付是否锁定,锁定原因 T-锁定 F-不锁定
|
||||
private String blLockOnlinePay;
|
||||
private String lockOnlinePayReason;
|
||||
|
||||
|
||||
List<EmisSettleSubBill> subBillList;
|
||||
|
||||
|
||||
|
||||
@ -87,6 +87,14 @@ public interface IEmisSettleBillService extends IDataAuditService
|
||||
*/
|
||||
public int checkUnique(EmisSettleBill emisSettleBill);
|
||||
|
||||
|
||||
/**
|
||||
* 检查是否允许在线支付
|
||||
* @param emisSettleBill
|
||||
* @return
|
||||
*/
|
||||
public int checkCanOnlinePay(EmisSettleBill emisSettleBill) throws EmisBizError;
|
||||
|
||||
/**
|
||||
* 新增结算总账单
|
||||
*
|
||||
|
||||
@ -103,5 +103,5 @@ public interface IEmisSettleInvoiceChRecordService
|
||||
*/
|
||||
void export(HttpServletResponse response, EmisSettleInvoiceChRecord emisSettleInvoiceChRecord);
|
||||
|
||||
List<EmisSettleInvoiceChRecord> selectEmisSettleInvoiceChRecordListAll(EmisSettleInvoiceChRecord emisSettleInvoiceChRecord);
|
||||
List<EmisSettleInvoiceChRecord> selectEmisSettleInvoiceChRecordListAll(EmisSettleInvoiceChRecord emisSettleInvoiceChRecord);
|
||||
}
|
||||
|
||||
@ -88,6 +88,9 @@ public class EmisSettleBillServiceImpl extends EmisBaseService implements IEmisS
|
||||
@Autowired
|
||||
private EmisSettleSubBillFeeitemMapper emisSettleSubBillFeeitemMapper;
|
||||
|
||||
@Autowired
|
||||
private EmisSettleInvoiceChRecordMapper emisSettleInvoiceChRecordMapper;
|
||||
|
||||
/**
|
||||
* 获取稽核数据
|
||||
* @param id
|
||||
@ -177,6 +180,57 @@ public class EmisSettleBillServiceImpl extends EmisBaseService implements IEmisS
|
||||
return emisSettleBillMapper.checkUnique(emisSettleBill);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否可以开票
|
||||
* @param emisSettleBill
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int checkCanOnlinePay(EmisSettleBill emisSettleBill) throws EmisBizError {
|
||||
// 检查开票抬头是否都是探路者
|
||||
/*
|
||||
1、未收款 已开票 票是探路供应链
|
||||
2、未收款、未开票
|
||||
3、未收款、不开票
|
||||
*/
|
||||
EmisSettleBill oldBill = emisSettleBillMapper.selectSettleBillBySettleBillNo(emisSettleBill.getSettleBillNo());
|
||||
if (oldBill == null) {
|
||||
throw new EmisBizError(EmisBizErrorType.FAIL, "账单不存在");
|
||||
}
|
||||
|
||||
// 未收款 已开票 票是探路供应链
|
||||
if ( "0".equals(emisSettleBill.getPaymentStatus()) && "1".equals(emisSettleBill.getOpenBillStatus()) ) {
|
||||
EmisSettleInvoiceChRecord invoiceQuery=new EmisSettleInvoiceChRecord();
|
||||
invoiceQuery.getParams().put("settleBillNo",emisSettleBill.getSettleBillNo());
|
||||
List<EmisSettleInvoiceChRecord> invoiceChList = emisSettleInvoiceChRecordMapper.selectEmisSettleInvoiceChRecordList(invoiceQuery);
|
||||
if(!CollectionUtils.isEmpty(invoiceChList)){
|
||||
for (EmisSettleInvoiceChRecord item:invoiceChList) {
|
||||
// 供应链税号
|
||||
if( !"91320104MAD3LBDK4E".equals(item.getSalerCompanyTaxNo()) ) {
|
||||
throw new EmisBizError(EmisBizErrorType.FAIL, "存在非供应链的开的发票");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
// 未收款、未开票
|
||||
if ( "0".equals(emisSettleBill.getPaymentStatus()) && "0".equals(emisSettleBill.getOpenBillStatus()) ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// 未收款、不开票
|
||||
if ( "0".equals(emisSettleBill.getPaymentStatus()) && "3".equals(emisSettleBill.getOpenBillStatus()) ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// 其他不允许支付
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增结算总账单
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user