修改FI849

release
yishiqihuasheng 2 years ago
parent 6d4bc29357
commit f7bc3117b6
  1. 87
      dxhy-erp/src/main/java/com/dxhy/erp/controller/InterfaceController.java
  2. 3
      dxhy-erp/src/main/java/com/dxhy/erp/service/impl/ReceiptOutServiceImpl.java

@ -1278,37 +1278,78 @@ public class InterfaceController extends AbstractController {
"/po", JSONObject.toJSONString(fpdms),JSONObject.toJSONString(fphms), "transferOut");
transferOutRecord.setBzdh(JSONObject.toJSONString(bzdhs));
for(Map<String ,Object> map:list){
String invoiceCode =(String) map.get("ZFPDM");
String invoiceNo = (String)map.get("ZFPHM");
String uuid = invoiceCode+invoiceNo;
String[] ids = uuid.split(",");
DynamicContextHolder.push("business"+DbConstant.BUSINESS_READ);
List<BaseTDxRecordInvoice> invoices = baseIReceiptInvoiceService.selectByUuids(ids);
boolean fphmNotBlank = list.stream().allMatch(e -> StringUtils.isNotBlank((String)e.get("ZFPHM")));
boolean fpdmNotBlank = list.stream().allMatch(e -> StringUtils.isNotBlank((String)e.get("ZFPDM")));
if (!fpdmNotBlank || !fphmNotBlank){
OutPut outPut = new OutPut();
EsOutPutResp es = new EsOutPutResp();
es.setSAPKEY(erpInvoiceData.getIS_INPUT().getSAPKEY());
es.setBSKEY(erpInvoiceData.getIS_INPUT().getBSKEY());
es.setZTYPE("S");
es.setZMESSAGE("处理成功");
invoices = invoices.stream().filter(e->!"0".equals(e.getRzhYesorno())).collect(Collectors.toList());
if(CollectionUtils.isEmpty(invoices)){
es.setZTYPE("E");
es.setZMESSAGE("底账数据不存在可转出发票");
outPut.setES_OUTPUT(es);
try {
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE);
requestRecordService.saveFailedRequestRecord(transferOutRecord, 0, JsonUtils.getInstance().toJsonString(outPut),
es.getZMESSAGE());
} catch (Exception e) {
log.error("FI849接口记录保存失败,errormsg:{}",e);
}
es.setZTYPE("E");
es.setZMESSAGE("传入数据存在没有发票号码或发票代码问题");
outPut.setES_OUTPUT(es);
return JsonUtils.getInstance().toJsonString(outPut);
}
return JsonUtils.getInstance().toJsonString(outPut);
StringBuilder uuids = new StringBuilder();
for (int i = 0; i < list.size(); i++) {
String invoiceCode =(String) list.get(i).get("ZFPDM");
String invoiceNo = (String)list.get(i).get("ZFPHM");
uuids.append(invoiceCode).append(invoiceNo);
if (i<list.size()-1){
uuids.append(",");
}
}
log.info(uuids.toString());
String[] ids = uuids.toString().split(",");
DynamicContextHolder.push("business"+DbConstant.BUSINESS_READ);
List<BaseTDxRecordInvoice> invoices = baseIReceiptInvoiceService.selectByUuids(ids);
log.info("849查询到发票信息{}",invoices);
invoices = invoices.stream().filter(e->!"0".equals(e.getRzhYesorno())).collect(Collectors.toList());
log.info("过滤后发票信息{}",invoices);
if (CollectionUtils.isEmpty(invoices)){
OutPut outPut = new OutPut();
EsOutPutResp es = new EsOutPutResp();
es.setSAPKEY(erpInvoiceData.getIS_INPUT().getSAPKEY());
es.setBSKEY(erpInvoiceData.getIS_INPUT().getBSKEY());
es.setZTYPE("E");
es.setZMESSAGE("底账数据不存在可转出发票");
outPut.setES_OUTPUT(es);
return JsonUtils.getInstance().toJsonString(outPut);
}
// for(Map<String ,Object> map:list){
// String invoiceCode =(String) map.get("ZFPDM");
// String invoiceNo = (String)map.get("ZFPHM");
// String uuid = invoiceCode+invoiceNo;
// String[] ids = uuid.split(",");
// DynamicContextHolder.push("business"+DbConstant.BUSINESS_READ);
// List<BaseTDxRecordInvoice> invoices = baseIReceiptInvoiceService.selectByUuids(ids);
// OutPut outPut = new OutPut();
// EsOutPutResp es = new EsOutPutResp();
// es.setSAPKEY(erpInvoiceData.getIS_INPUT().getSAPKEY());
// es.setBSKEY(erpInvoiceData.getIS_INPUT().getBSKEY());
// es.setZTYPE("S");
// es.setZMESSAGE("处理成功");
//
// if(CollectionUtils.isEmpty(invoices)){
// es.setZTYPE("E");
// es.setZMESSAGE("底账数据不存在可转出发票");
// outPut.setES_OUTPUT(es);
//
// try {
// DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE);
// requestRecordService.saveFailedRequestRecord(transferOutRecord, 0, JsonUtils.getInstance().toJsonString(outPut),
// es.getZMESSAGE());
// } catch (Exception e) {
// log.error("FI849接口记录保存失败,errormsg:{}",e);
// }
//
// return JsonUtils.getInstance().toJsonString(outPut);
// }
// }
try{
/**

@ -52,7 +52,8 @@ public class ReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutDao,
DynamicContextHolder.push("business"+DbConstant.BUSINESS_READ);
String idStr = condVO.getPrimaryKey();
String[] ids = idStr.split(",");
// String[] ids = idStr.split(",");
String[] ids = {idStr};
// first:查询出底账表相关数据
List<BaseTDxRecordInvoice> invoices = baseIReceiptInvoiceService.selectByUuids(ids);

Loading…
Cancel
Save