diff --git a/dxhy-base/src/main/java/com/dxhy/base/model/BaseReceiptOutCancelRespVO.java b/dxhy-base/src/main/java/com/dxhy/base/model/BaseReceiptOutCancelRespVO.java index d823f655..8e87a702 100644 --- a/dxhy-base/src/main/java/com/dxhy/base/model/BaseReceiptOutCancelRespVO.java +++ b/dxhy-base/src/main/java/com/dxhy/base/model/BaseReceiptOutCancelRespVO.java @@ -76,5 +76,6 @@ public class BaseReceiptOutCancelRespVO extends BaseBaseRespVO { private String remark; private String outBelongDate; + private String outResource; } diff --git a/dxhy-base/src/main/java/com/dxhy/base/service/receipt/BaseReceiptOutServiceImpl.java b/dxhy-base/src/main/java/com/dxhy/base/service/receipt/BaseReceiptOutServiceImpl.java index 206ee679..d41a5b48 100644 --- a/dxhy-base/src/main/java/com/dxhy/base/service/receipt/BaseReceiptOutServiceImpl.java +++ b/dxhy-base/src/main/java/com/dxhy/base/service/receipt/BaseReceiptOutServiceImpl.java @@ -650,6 +650,7 @@ public class BaseReceiptOutServiceImpl extends MpBaseServiceImpl query = new QueryWrapper<>(); 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 getPullRecordList(@RequestBody PullRecordReq pullRecordReq){ try{ + if(pullRecordReq.getSm().equals("99")){ + pullRecordReq.setSm(""); + } + if(pullRecordReq.getCompanyCode().equals("99")){ + List orgCodes = getUserInfo().getOrgCodes(); + List collect = orgCodes.stream().map(TaxOrgCode::getOrgCode).collect(Collectors.toList()); + pullRecordReq.setOrgCode(collect); + } return ResponseEntity.ok(R.ok().put("data",extInvoicePoolService.selectPullRecord(pullRecordReq))); }catch (Exception e){ e.printStackTrace(); diff --git a/dxhy-extend/src/main/java/com/dxhy/extend/controller/VouncherSyncController.java b/dxhy-extend/src/main/java/com/dxhy/extend/controller/VouncherSyncController.java index eb73760e..893688b4 100644 --- a/dxhy-extend/src/main/java/com/dxhy/extend/controller/VouncherSyncController.java +++ b/dxhy-extend/src/main/java/com/dxhy/extend/controller/VouncherSyncController.java @@ -34,62 +34,70 @@ public class VouncherSyncController { //是否全量 X为全量推送,空为增量推送。 //全量推送逻辑为 查询出的符合条件的凭证全部推送,全量推送不再检查是否在自定义表中已传输。 //增量推送,已传输的凭证数据不再推送(检查传输记录表是否已传输成功) - - - /** - * 传参逻辑 年 月 必传 期间只能传一个月的 - * - */ - String ifAll=map.get("ifAll"); - //公司代码 + try{ String companyCode = map.get("companyCode"); - //开始日期 - String startTime= map.get("startTime"); - String endTime = map.get("endTime"); - if(startTime!=null && startTime!=""){ - startTime=startTime.replace("-",""); - } - if(endTime!=null && endTime!=""){ - endTime=endTime.replace("-",""); - } - //结束日期 - String month=map.get("monat"); - //GJAHR nian - String gjahr=map.get("gjahr"); + String[] split = companyCode.split(","); + StringBuilder sb = new StringBuilder(); + for (String str:split){ + /** + * 传参逻辑 年 月 必传 期间只能传一个月的 + * + */ + String ifAll=map.get("ifAll"); + //公司代码 + + //开始日期 + String startTime= map.get("startTime"); + String endTime = map.get("endTime"); + if(startTime!=null && startTime!=""){ + startTime=startTime.replace("-",""); + } + if(endTime!=null && endTime!=""){ + endTime=endTime.replace("-",""); + } + //结束日期 + String month=map.get("monat"); + //GJAHR nian + String gjahr=map.get("gjahr"); - SNSAPObject object = new SNSAPObject(); - object.setSYSID("FPXT"); - object.setIFYWID("FI842"); - object.setBSKEY(UUID.randomUUID().toString().replace("-", "")); - //object.setSAPKEY(""); + SNSAPObject object = new SNSAPObject(); + object.setSYSID("FPXT"); + object.setIFYWID("FI842"); + object.setBSKEY(UUID.randomUUID().toString().replace("-", "")); + //object.setSAPKEY(""); // object.setZFILED1(""); // object.setZFILED2(""); // object.setZFILED3(""); // object.setZFILED4(""); - object.setZFILED5("200"); - Map requestMap = new HashMap<>(); - List list = new ArrayList<>(); - requestMap.put("ZGSDM",companyCode); - requestMap.put("GJAHR",gjahr); - requestMap.put("MONAT",month); - requestMap.put("ZDATEF",startTime); - requestMap.put("ZDATET",endTime); - requestMap.put("ZFLAG",ifAll); - object.setZDATA(JSONObject.toJSONString(requestMap)); - JSONObject request = new JSONObject(); - request.put("IS_INPUT",object); - try{ + object.setZFILED5("200"); + Map requestMap = new HashMap<>(); + List list = new ArrayList<>(); + requestMap.put("ZGSDM",companyCode); + requestMap.put("GJAHR",gjahr); + requestMap.put("MONAT",month); + requestMap.put("ZDATEF",startTime); + requestMap.put("ZDATET",endTime); + requestMap.put("ZFLAG",ifAll); + object.setZDATA(JSONObject.toJSONString(requestMap)); + JSONObject request = new JSONObject(); + request.put("IS_INPUT",object); + String s = vouncherSyncService.sendPo(JSONObject.toJSONString(request)); Map map1 = JSONObject.parseObject(s, Map.class); Map output = (Map)map1.get("ES_OUTPUT"); String ztype =(String) output.get("ZTYPE"); if(ztype.equals("S")){ - return ResponseEntity.ok(R.ok().put("data","数据拉取成功")); + }else { - return ResponseEntity.ok(R.error((String)output.get("ZDATA"))); + sb.append(str+output.get("ZDATA")); } - + } + if(sb.length()>0){ + return ResponseEntity.ok(R.ok().put("data",sb)); + }else{ + return ResponseEntity.ok(R.ok().put("data","拉取成功")); + } }catch (Exception e ){ e.printStackTrace(); return ResponseEntity.ok(R.error(CommonConstants.MSG_ERR_DEFAULT)); diff --git a/dxhy-extend/src/main/java/com/dxhy/extend/entity/ExtAddTaxInvoice.java b/dxhy-extend/src/main/java/com/dxhy/extend/entity/ExtAddTaxInvoice.java index 2ff8e0db..d531fa62 100644 --- a/dxhy-extend/src/main/java/com/dxhy/extend/entity/ExtAddTaxInvoice.java +++ b/dxhy-extend/src/main/java/com/dxhy/extend/entity/ExtAddTaxInvoice.java @@ -138,4 +138,5 @@ public class ExtAddTaxInvoice implements Serializable { private String imageNumber; private String accountPeriod; private String compCode; + private String bzdh; } diff --git a/dxhy-extend/src/main/java/com/dxhy/extend/entity/ExtOtherInvoice.java b/dxhy-extend/src/main/java/com/dxhy/extend/entity/ExtOtherInvoice.java index 74d0eebd..f7af08eb 100644 --- a/dxhy-extend/src/main/java/com/dxhy/extend/entity/ExtOtherInvoice.java +++ b/dxhy-extend/src/main/java/com/dxhy/extend/entity/ExtOtherInvoice.java @@ -66,4 +66,7 @@ public class ExtOtherInvoice implements Serializable { private String postingTime; private String imageId; private String accountPeriod; + private String inAccountStatus; + private String bzdh; + private String snVoucherNumber; } diff --git a/dxhy-extend/src/main/java/com/dxhy/extend/entity/ExtTicketInvoiceModel.java b/dxhy-extend/src/main/java/com/dxhy/extend/entity/ExtTicketInvoiceModel.java index 5ebcf2a5..fc00ba63 100644 --- a/dxhy-extend/src/main/java/com/dxhy/extend/entity/ExtTicketInvoiceModel.java +++ b/dxhy-extend/src/main/java/com/dxhy/extend/entity/ExtTicketInvoiceModel.java @@ -2,6 +2,7 @@ package com.dxhy.extend.entity; import java.io.Serializable; +import com.baomidou.mybatisplus.annotation.TableField; import lombok.Data; /** @@ -102,8 +103,13 @@ public class ExtTicketInvoiceModel implements Serializable { private String snVoucherNumber; private String voucherNumber; private String postingTime; + @TableField("image_id") private String imageId; private String accountPeriod; private String compCode; + private String bzdh; + @TableField("inaccount_status") + private String inAccountStatus; + } diff --git a/dxhy-extend/src/main/java/com/dxhy/extend/entity/PullRecordReq.java b/dxhy-extend/src/main/java/com/dxhy/extend/entity/PullRecordReq.java index 75ffa921..a0f4d596 100644 --- a/dxhy-extend/src/main/java/com/dxhy/extend/entity/PullRecordReq.java +++ b/dxhy-extend/src/main/java/com/dxhy/extend/entity/PullRecordReq.java @@ -2,12 +2,16 @@ package com.dxhy.extend.entity; import lombok.Data; +import java.util.List; + /** * @Author wangzhikun * @Date 2023/4/14 2023/4/14 */ @Data public class PullRecordReq { + private String companyCode; + //公司名称 private String companyName; //账期 @@ -27,6 +31,8 @@ public class PullRecordReq { //过账终止日期 private String accountEndDate; + private List orgCode; + private int curr; private int size; } diff --git a/dxhy-extend/src/main/java/com/dxhy/extend/service/companypool/TicketServiceImpl.java b/dxhy-extend/src/main/java/com/dxhy/extend/service/companypool/TicketServiceImpl.java index ef0a0b73..80326cb8 100644 --- a/dxhy-extend/src/main/java/com/dxhy/extend/service/companypool/TicketServiceImpl.java +++ b/dxhy-extend/src/main/java/com/dxhy/extend/service/companypool/TicketServiceImpl.java @@ -5,6 +5,8 @@ import java.util.Map; import javax.annotation.Resource; +import com.dxhy.common.constant.DictConstant; +import com.dxhy.common.service.DictdetaServcice; import org.apache.commons.lang.StringUtils; import org.springframework.stereotype.Service; @@ -33,6 +35,8 @@ import lombok.extern.slf4j.Slf4j; public class TicketServiceImpl extends MpBaseServiceImpl implements TicketService { @Resource private ExtTicketDao extTicketDao; + @Resource + private DictdetaServcice dictdetaServcice; @Override public String queryList(Map paramsMap, int curr, int size) { @@ -40,11 +44,13 @@ public class TicketServiceImpl extends MpBaseServiceImpl{}",pageList.get(i).getInAccountStatus()); + pageList.get(i).setInAccountStatus(dictdetaServcice.queryDictName(DictConstant.INACCOUNT_STATUS,pageList.get(i).getInAccountStatus())); + log.info("入账状态====>{}",pageList.get(i).getInAccountStatus()); } } diff --git a/dxhy-extend/src/main/java/com/dxhy/extend/service/pool/ExtInvoicePoolServiceImpl.java b/dxhy-extend/src/main/java/com/dxhy/extend/service/pool/ExtInvoicePoolServiceImpl.java index fdf47a99..900c50bc 100644 --- a/dxhy-extend/src/main/java/com/dxhy/extend/service/pool/ExtInvoicePoolServiceImpl.java +++ b/dxhy-extend/src/main/java/com/dxhy/extend/service/pool/ExtInvoicePoolServiceImpl.java @@ -3,6 +3,8 @@ package com.dxhy.extend.service.pool; import java.util.List; import java.util.Map; +import com.dxhy.common.constant.DictConstant; +import com.dxhy.common.service.DictdetaServcice; import com.dxhy.extend.entity.*; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; @@ -20,6 +22,8 @@ import com.dxhy.extend.util.InvoiceTypeUtils; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import javax.annotation.Resource; + /** * @author dxhy */ @@ -35,6 +39,9 @@ public class ExtInvoicePoolServiceImpl extends MpBaseServiceImpl pramsMap, int curr, int size) { JSONObject json = new JSONObject(); @@ -42,13 +49,13 @@ public class ExtInvoicePoolServiceImpl extends MpBaseServiceImpl{}",pageList.get(i).getInAccountStatus()); pageList.get(i).setInvoiceType(InvoiceTypeUtils.invoiceTypeName(pageList.get(i).getInvoiceType())); pageList.get(i).setQsrq(pageList.get(i).getQsrq() == null ? "" : pageList.get(i).getQsrq()); pageList.get(i).setRzrq(pageList.get(i).getRzrq() == null ? "" : pageList.get(i).getRzrq()); @@ -205,9 +215,11 @@ public class ExtInvoicePoolServiceImpl extends MpBaseServiceImpl{}",pageList.get(i).getInAccountStatus()); + pageList.get(i).setInAccountStatus(dictdetaServcice.queryDictName(DictConstant.INACCOUNT_STATUS, + pageList.get(i).getInAccountStatus())); + } } @@ -285,13 +301,13 @@ public class ExtInvoicePoolServiceImpl extends MpBaseServiceImpl + + + + @@ -46,7 +50,7 @@ je,DATE_FORMAT(t.qs_date,'%Y-%m-%d') qsrq,t.inaccount_status,t.bzdh, t.qs_status qszt,t.qs_name qsr, t.invoice_status yczt,DATE_FORMAT(t.status_update_date,'%Y-%m-%d') ycsj,rzh_date - rzsj, + rzsj,t.sn_voucher_number,t.account_period,t.posting_time,t.image_id, rzh_yesorno rzzt,auth_status rzclzt,bdk_status rzlx,rzh_belong_date skssq,dept_name from t_dx_record_invoice t WHERE t.invoice_status != '0' diff --git a/dxhy-extend/src/main/resources/mapper/ExtInvoicePoolMapper.xml b/dxhy-extend/src/main/resources/mapper/ExtInvoicePoolMapper.xml index 4b9da6a7..2faf90aa 100644 --- a/dxhy-extend/src/main/resources/mapper/ExtInvoicePoolMapper.xml +++ b/dxhy-extend/src/main/resources/mapper/ExtInvoicePoolMapper.xml @@ -28,7 +28,6 @@ DATE_FORMAT(t.qs_date,'%Y-%m-%d') qsrq, t.qs_name qsr, DATE_FORMAT(t.payment_date,'%Y-%m') inAccountMonth, - t.payment_status inAccountStatus, t.voucher_number voucherNo, t.amortize_status amortizeStatus, t.amortize_amount amortizeAmount, @@ -109,18 +108,23 @@ and t.qs_type = #{qsfs} - - and t.posting_time = #{postingTime} + + and t.posting_time between #{postingTimeStart} and #{postingTimeEnd} - - and t.image_id = #{imageId} + + and t.image_id = #{imageNumber} and t.account_period = #{accountPeriod} - - and t.payment_status = #{inAccountStatus} + + and t.inaccount_status = #{inAccountStatus} + + + and t.bzdh = #{bzdh} + + + and t.sn_voucher_number = #{snVoucherNumber} @@ -158,8 +162,10 @@ DATE_FORMAT(t.qs_date,'%Y-%m-%d') qsrq, t.qs_name qsr, DATE_FORMAT(t.payment_date,'%Y-%m') inAccountMonth, - t.payment_status inAccountStatus, + t.payment_status paymentStatus, + t.inaccount_status inAccountStatus, t.voucher_number voucherNo, + t.sn_voucher_number snVoucherNumber, t.posting_time postingTime, t.amortize_status amortizeStatus, t.amortize_amount amortizeAmount, @@ -170,8 +176,10 @@ t.scan_id scanId, t.remark, t.document_number documentNumber, - t.image_id imageId, + t.image_id imageNumber, t.account_period accountPeriod, + t.inaccount_status inAccountStatus, + t.bzdh bzdh, DATE_FORMAT(t.collect_date,'%Y-%m-%d') collectDate, t.collect_from collectFrom from t_dx_record_invoice t @@ -224,11 +232,8 @@ and t.qs_type = #{qsfs} - - and t.payment_status = #{inAccountStatus} - - - and posting_time between #{postingTimeStart} and #{postingTimeEnd} + + and t.posting_time between #{postingTimeStart} and #{postingTimeEnd} and t.image_id = #{imageNumber} @@ -236,15 +241,24 @@ and t.account_period = #{accountPeriod} + + and t.inaccount_status = #{inAccountStatus} + + + and t.bzdh = #{bzdh} + + + and t.sn_voucher_number = #{snVoucherNumber} + and DATE_FORMAT(t.payment_date,'%Y-%m') = #{inAccountMonth} and t.invoice_source = #{invoiceSource} - - and t.sn_voucher_number = #{snVoucherNumber} - + + + @@ -433,15 +466,24 @@ and t.sn_voucher_number = #{snVoucherNumber} - - and t.posting_time = #{postingTime} + + + and t.posting_time between #{postingTimeStart} and #{postingTimeEnd} + and t.image_id = #{imageNumber} + and t.account_period = #{accountPeriod} + + and t.inaccount_status = #{inAccountStatus} + + + and t.bzdh = #{bzdh} + @@ -561,6 +616,15 @@ and vr.butxt = #{companyName} + + and vr.bukrs in + + #{item} + + + + and vr.bukrs = #{companyCode} + and CONCAT_WS("-",vr.gjahr,vr.monat) = #{accountPeriod} diff --git a/dxhy-extend/src/main/resources/mapper/TicketMapper.xml b/dxhy-extend/src/main/resources/mapper/TicketMapper.xml index 42af06c2..a5b7ef80 100644 --- a/dxhy-extend/src/main/resources/mapper/TicketMapper.xml +++ b/dxhy-extend/src/main/resources/mapper/TicketMapper.xml @@ -54,18 +54,24 @@ and t.company = #{company} - - and t.sn_voucher_number = #{snVoucherNumber} - - - and t.posting_time = #{postingTime} + + and t.posting_time between #{postingTimeStart} and #{postingTimeEnd} - - and t.image_id = #{imageId} + + and t.image_id = #{imageNumber} and t.account_period = #{accountPeriod} + + and t.inaccount_status = #{inAccountStatus} + + + t.bzdh = #{bzdh} + + + t.sn_voucher_number = #{snVoucherNumber} + @@ -112,10 +118,7 @@ and t.company = #{company} - - and t.sn_voucher_number = #{snVoucherNumber} - - + and t.posting_time between #{postingTimeStart} and #{postingTimeEnd} @@ -124,5 +127,14 @@ and t.account_period = #{accountPeriod} + + and t.inaccount_status = #{inAccountStatus} + + + t.bzdh = #{bzdh} + + + t.sn_voucher_number = #{snVoucherNumber} + diff --git a/dxhy-sign/src/main/java/com/dxhy/sign/service/fpqs/impl/FpqsServiceImpl.java b/dxhy-sign/src/main/java/com/dxhy/sign/service/fpqs/impl/FpqsServiceImpl.java index 1da101c8..1d8d34bf 100644 --- a/dxhy-sign/src/main/java/com/dxhy/sign/service/fpqs/impl/FpqsServiceImpl.java +++ b/dxhy-sign/src/main/java/com/dxhy/sign/service/fpqs/impl/FpqsServiceImpl.java @@ -252,8 +252,11 @@ public class FpqsServiceImpl extends MpBaseServiceImpl