diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/controller/InterfaceController.java b/dxhy-erp/src/main/java/com/dxhy/erp/controller/InterfaceController.java index c49e1762..d7634bc2 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/controller/InterfaceController.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/controller/InterfaceController.java @@ -35,6 +35,7 @@ import io.swagger.annotations.ApiParam; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Value; +import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -1218,6 +1219,31 @@ public class InterfaceController extends AbstractController { public String transferOut(ErpInvoiceData erpInvoiceData){ String zdata = erpInvoiceData.getIS_INPUT().getZDATA(); List list = JSON.parseArray(zdata, Map.class); + for(Map 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 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); + return JsonUtils.getInstance().toJsonString(outPut); + }else if(!invoices.get(0).getAuthStatus().equals("4")){ + es.setZTYPE("E"); + es.setZMESSAGE("发票状态不是认证成功不允许转出"); + outPut.setES_OUTPUT(es); + return JsonUtils.getInstance().toJsonString(outPut); + } + } try{ diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/ReceiptOutServiceImpl.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/ReceiptOutServiceImpl.java index d741974a..0752751a 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/ReceiptOutServiceImpl.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/impl/ReceiptOutServiceImpl.java @@ -135,6 +135,7 @@ public class ReceiptOutServiceImpl extends MpBaseServiceImpl