|
|
|
@ -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<Map> list = JSON.parseArray(zdata, Map.class); |
|
|
|
|
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); |
|
|
|
|
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{ |
|
|
|
|