From 333904fc99e3ad1a9c63112dca4410944fe1516e Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Sat, 14 Sep 2024 09:17:10 +0800 Subject: [PATCH 01/67] =?UTF-8?q?fw-cbs=E5=88=86=E6=94=AF=E7=BB=93?= =?UTF-8?q?=E6=9E=84=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base-webapp/pom.xml | 10 +- fw-cbs/pom.xml | 48 + .../cbs8/dto/req/AgentPayRequestDTO.java | 32 + .../dto/req/AgentPayResultRequestDTO.java | 20 + .../frame/cbs8/dto/req/ElecRequestDTO.java | 134 +++ .../frame/cbs8/dto/req/PayRequestDTO.java | 272 ++++++ .../cbs8/dto/req/PayResultRequestDTO.java | 44 + .../cbs8/dto/req/PaymentApplyAgentDTO.java | 132 +++ .../dto/req/PaymentApplySubmitReqDTO.java | 245 +++++ .../cbs8/dto/req/TransactionDetailReqDTO.java | 164 ++++ .../frame/cbs8/dto/res/AgentPayQueryDTO.java | 280 ++++++ .../cbs8/dto/res/AgentPayResultResDTO.java | 450 +++++++++ .../frame/cbs8/dto/res/CbsResDataDTO.java | 458 +++++++++ .../frame/cbs8/dto/res/CbsResponseDTO.java | 44 + .../frame/cbs8/dto/res/ElecResponseDTO.java | 305 ++++++ .../frame/cbs8/dto/res/PayResponseDTO.java | 73 ++ .../frame/cbs8/dto/res/PayResultResDTO.java | 890 ++++++++++++++++++ .../cbs8/dto/res/TransactionDetailDTO.java | 207 ++++ .../hzya/frame/cbs8/entity/PaymentEntity.java | 327 +++++++ .../frame/cbs8/service/ICbs8ExtService.java | 60 ++ .../hzya/frame/cbs8/service/ICbs8Service.java | 65 ++ .../cbs8/service/impl/Cbs8ExtServiceImpl.java | 216 +++++ .../cbs8/service/impl/Cbs8ServiceImpl.java | 269 ++++++ .../com/hzya/frame/cbs8/util/CBSUtil.java | 187 ++++ .../hzya/frame/cbs8/util/CbsAccessToken.java | 140 +++ .../hzya/frame/cbs8/util/CurrencyEnum.java | 137 +++ .../com/hzya/frame/cbs8/util/PayState.java | 73 ++ .../com/hzya/frame/cbs8/util/SM2Util.java | 237 +++++ fw-cbs/src/main/webapp/WEB-INF/web.xml | 6 + pom.xml | 2 +- 30 files changed, 5521 insertions(+), 6 deletions(-) create mode 100644 fw-cbs/pom.xml create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/AgentPayRequestDTO.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/AgentPayResultRequestDTO.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/ElecRequestDTO.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/PayRequestDTO.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/PayResultRequestDTO.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/PaymentApplyAgentDTO.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/PaymentApplySubmitReqDTO.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/TransactionDetailReqDTO.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/AgentPayQueryDTO.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/AgentPayResultResDTO.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/CbsResDataDTO.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/CbsResponseDTO.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/ElecResponseDTO.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/PayResponseDTO.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/PayResultResDTO.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/TransactionDetailDTO.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/entity/PaymentEntity.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/service/ICbs8ExtService.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/service/ICbs8Service.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/service/impl/Cbs8ExtServiceImpl.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/service/impl/Cbs8ServiceImpl.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/util/CBSUtil.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/util/CbsAccessToken.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/util/CurrencyEnum.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/util/PayState.java create mode 100644 fw-cbs/src/main/java/com/hzya/frame/cbs8/util/SM2Util.java create mode 100644 fw-cbs/src/main/webapp/WEB-INF/web.xml diff --git a/base-webapp/pom.xml b/base-webapp/pom.xml index 79bd4cf9..c423ca54 100644 --- a/base-webapp/pom.xml +++ b/base-webapp/pom.xml @@ -23,11 +23,11 @@ - - - - - + + com.hzya.frame + fw-cbs + ${revision} + diff --git a/fw-cbs/pom.xml b/fw-cbs/pom.xml new file mode 100644 index 00000000..4bdeaccc --- /dev/null +++ b/fw-cbs/pom.xml @@ -0,0 +1,48 @@ + + + + kangarooDataCenterV3 + com.hzya.frame + ${revision} + + 4.0.0 + fw-cbs + jar + ${revision} + + + + com.hzya.frame + base-service + ${revision} + + + mysql + mysql-connector-java + ${mysql-connector-java} + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + none + execute + true + + + + + repackage + + + + + + + diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/AgentPayRequestDTO.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/AgentPayRequestDTO.java new file mode 100644 index 00000000..1a906cba --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/AgentPayRequestDTO.java @@ -0,0 +1,32 @@ +package com.hzya.frame.cbs8.dto.req; + +import java.util.List; + +/** + * @Description 代发代扣请求参数 + * @Author xiangerlin + * @Date 2024/6/18 16:20 + **/ +public class AgentPayRequestDTO { + + //代发表头 + private PaymentApplySubmitReqDTO paymentApplySubmitReqDTO; + //代发明细 + private List paymentApplyAgentDTO; + + public PaymentApplySubmitReqDTO getPaymentApplySubmitReqDTO() { + return paymentApplySubmitReqDTO; + } + + public void setPaymentApplySubmitReqDTO(PaymentApplySubmitReqDTO paymentApplySubmitReqDTO) { + this.paymentApplySubmitReqDTO = paymentApplySubmitReqDTO; + } + + public List getPaymentApplyAgentDTO() { + return paymentApplyAgentDTO; + } + + public void setPaymentApplyAgentDTO(List paymentApplyAgentDTO) { + this.paymentApplyAgentDTO = paymentApplyAgentDTO; + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/AgentPayResultRequestDTO.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/AgentPayResultRequestDTO.java new file mode 100644 index 00000000..a4ef80c8 --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/AgentPayResultRequestDTO.java @@ -0,0 +1,20 @@ +package com.hzya.frame.cbs8.dto.req; + +/** + * @Description 代发代扣详情查询请求参数 + * @Author xiangerlin + * @Date 2024/6/18 17:40 + **/ +public class AgentPayResultRequestDTO { + + //申请单编号。 代发代扣支付接口会返回这个单号的 + private String busNum; + + public String getBusNum() { + return busNum; + } + + public void setBusNum(String busNum) { + this.busNum = busNum; + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/ElecRequestDTO.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/ElecRequestDTO.java new file mode 100644 index 00000000..f318d279 --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/ElecRequestDTO.java @@ -0,0 +1,134 @@ +package com.hzya.frame.cbs8.dto.req; + +import java.util.List; + +/** + * @Description 电子回单查询请求参数 + * @Author xiangerlin + * @Date 2024/1/4 17:08 + **/ +public class ElecRequestDTO { + // 开始日期 + private String startDate; + + // 结束日期 + private String endDate; + + // 账号 + private String accountNo; + + // 币种列表 + private List currencyList; + + // 银行类型列表 + private List bankTypeList; + + // 回单文件状态 1-已取回 0-未取回 + private String billStatus; + + // 借贷 1-借 2-贷 + private String loanType; + + // 单位编码列表 + private List unitCodeList; + + // 对账码列表 + private List checkCodeList; + + // ERP业务参考号 + private String settleBusinessReferenceCode; + + public ElecRequestDTO(String settleBusinessReferenceCode) { + this.settleBusinessReferenceCode = settleBusinessReferenceCode; + } + + public ElecRequestDTO(String startDate, String endDate, String settleBusinessReferenceCode) { + this.startDate = startDate; + this.endDate = endDate; + this.settleBusinessReferenceCode = settleBusinessReferenceCode; + } + + public ElecRequestDTO() { + + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getAccountNo() { + return accountNo; + } + + public void setAccountNo(String accountNo) { + this.accountNo = accountNo; + } + + public List getCurrencyList() { + return currencyList; + } + + public void setCurrencyList(List currencyList) { + this.currencyList = currencyList; + } + + public List getBankTypeList() { + return bankTypeList; + } + + public void setBankTypeList(List bankTypeList) { + this.bankTypeList = bankTypeList; + } + + public String getBillStatus() { + return billStatus; + } + + public void setBillStatus(String billStatus) { + this.billStatus = billStatus; + } + + public String getLoanType() { + return loanType; + } + + public void setLoanType(String loanType) { + this.loanType = loanType; + } + + public List getUnitCodeList() { + return unitCodeList; + } + + public void setUnitCodeList(List unitCodeList) { + this.unitCodeList = unitCodeList; + } + + public List getCheckCodeList() { + return checkCodeList; + } + + public void setCheckCodeList(List checkCodeList) { + this.checkCodeList = checkCodeList; + } + + public String getSettleBusinessReferenceCode() { + return settleBusinessReferenceCode; + } + + public void setSettleBusinessReferenceCode(String settleBusinessReferenceCode) { + this.settleBusinessReferenceCode = settleBusinessReferenceCode; + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/PayRequestDTO.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/PayRequestDTO.java new file mode 100644 index 00000000..957d18ad --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/PayRequestDTO.java @@ -0,0 +1,272 @@ +package com.hzya.frame.cbs8.dto.req; + +/** + * @Description 经办支付请求DTO + * @Author xiangerlin + * @Date 2024/1/3 09:02 + **/ +public class PayRequestDTO { + private String referenceNum;//业务参考号,必填 + private String busType;//业务类型 必填 + private String amount;//金额 必填 + private String currency;//币种编码,必填 + private String payAccount;//付款账号,非集中支付模式必填 + private String revAccount;//收款账号 必填 + private String revAccountName;//收款方户名 必填 + private String revBankType;//收款银行类型编码,必填 + private String revBankName;//收款开户行名称 + private String cnapsCode;//联行号 必填 + private String purpose;//支付用途 必填 + + private String innerAccount;//内部账号 + private String revBankArea;//收款银行地区名称 + private String revProvince;//收款人省 + private String revCity;//收款人市 + private String bankNum;//收款地区码|银行号 + private String summary;//该笔支付备注 + private String expectTime;//期望支付时间 + private String personalFlag;//公私标记 1对私 0对公 + private String urgentTag;//加急,1加急0不加2特急 + private String realTimeTag;//是否实时 1实时0落地 + private String cityFlag;//同城标志 0同城1异地 + private String payChannel;//支付渠道 + private String busiStep;//业务步数 集中支付需要传1,其他不用传 + private String applyUnitCode;//申请人单位号,集中支付必传 + private String displayApplyUnitCode;//申请人单位号(前端显示),集中支付如果传了,会将其转化为applyUnitCode + + private String erpExtend1;//客户备用字段1 + private String erpExtend2;//客户备用字段2 + private String erpExtend3;//客户备用字段3 + + public String getReferenceNum() { + return referenceNum; + } + + public void setReferenceNum(String referenceNum) { + this.referenceNum = referenceNum; + } + + public String getBusType() { + return busType; + } + + public void setBusType(String busType) { + this.busType = busType; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getPayAccount() { + return payAccount; + } + + public void setPayAccount(String payAccount) { + this.payAccount = payAccount; + } + + public String getRevAccount() { + return revAccount; + } + + public void setRevAccount(String revAccount) { + this.revAccount = revAccount; + } + + public String getRevAccountName() { + return revAccountName; + } + + public void setRevAccountName(String revAccountName) { + this.revAccountName = revAccountName; + } + + public String getRevBankType() { + return revBankType; + } + + public void setRevBankType(String revBankType) { + this.revBankType = revBankType; + } + + public String getRevBankName() { + return revBankName; + } + + public void setRevBankName(String revBankName) { + this.revBankName = revBankName; + } + + public String getCnapsCode() { + return cnapsCode; + } + + public void setCnapsCode(String cnapsCode) { + this.cnapsCode = cnapsCode; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getInnerAccount() { + return innerAccount; + } + + public void setInnerAccount(String innerAccount) { + this.innerAccount = innerAccount; + } + + public String getRevBankArea() { + return revBankArea; + } + + public void setRevBankArea(String revBankArea) { + this.revBankArea = revBankArea; + } + + public String getRevProvince() { + return revProvince; + } + + public void setRevProvince(String revProvince) { + this.revProvince = revProvince; + } + + public String getRevCity() { + return revCity; + } + + public void setRevCity(String revCity) { + this.revCity = revCity; + } + + public String getBankNum() { + return bankNum; + } + + public void setBankNum(String bankNum) { + this.bankNum = bankNum; + } + + public String getSummary() { + return summary; + } + + public void setSummary(String summary) { + this.summary = summary; + } + + public String getExpectTime() { + return expectTime; + } + + public void setExpectTime(String expectTime) { + this.expectTime = expectTime; + } + + public String getPersonalFlag() { + return personalFlag; + } + + public void setPersonalFlag(String personalFlag) { + this.personalFlag = personalFlag; + } + + public String getUrgentTag() { + return urgentTag; + } + + public void setUrgentTag(String urgentTag) { + this.urgentTag = urgentTag; + } + + public String getRealTimeTag() { + return realTimeTag; + } + + public void setRealTimeTag(String realTimeTag) { + this.realTimeTag = realTimeTag; + } + + public String getCityFlag() { + return cityFlag; + } + + public void setCityFlag(String cityFlag) { + this.cityFlag = cityFlag; + } + + public String getPayChannel() { + return payChannel; + } + + public void setPayChannel(String payChannel) { + this.payChannel = payChannel; + } + + public String getBusiStep() { + return busiStep; + } + + public void setBusiStep(String busiStep) { + this.busiStep = busiStep; + } + + public String getApplyUnitCode() { + return applyUnitCode; + } + + public void setApplyUnitCode(String applyUnitCode) { + this.applyUnitCode = applyUnitCode; + } + + public String getDisplayApplyUnitCode() { + return displayApplyUnitCode; + } + + public void setDisplayApplyUnitCode(String displayApplyUnitCode) { + this.displayApplyUnitCode = displayApplyUnitCode; + } + + public String getErpExtend1() { + return erpExtend1; + } + + public void setErpExtend1(String erpExtend1) { + this.erpExtend1 = erpExtend1; + } + + public String getErpExtend2() { + return erpExtend2; + } + + public void setErpExtend2(String erpExtend2) { + this.erpExtend2 = erpExtend2; + } + + public String getErpExtend3() { + return erpExtend3; + } + + public void setErpExtend3(String erpExtend3) { + this.erpExtend3 = erpExtend3; + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/PayResultRequestDTO.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/PayResultRequestDTO.java new file mode 100644 index 00000000..8180c6f0 --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/PayResultRequestDTO.java @@ -0,0 +1,44 @@ +package com.hzya.frame.cbs8.dto.req; + +import java.util.List; + +/** + * @Description 查询交易结果请求参数 + * @Author xiangerlin + * @Date 2024/1/3 09:46 + **/ +public class PayResultRequestDTO { + public PayResultRequestDTO() { + } + public PayResultRequestDTO(String referenceNum) { + this.referenceNum = referenceNum; + } + + private String referenceNum;//业务参考号,必填 + private List statusList;//状态 + private List payStatusList;//支付状态 + + public String getReferenceNum() { + return referenceNum; + } + + public void setReferenceNum(String referenceNum) { + this.referenceNum = referenceNum; + } + + public List getStatusList() { + return statusList; + } + + public void setStatusList(List statusList) { + this.statusList = statusList; + } + + public List getPayStatusList() { + return payStatusList; + } + + public void setPayStatusList(List payStatusList) { + this.payStatusList = payStatusList; + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/PaymentApplyAgentDTO.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/PaymentApplyAgentDTO.java new file mode 100644 index 00000000..509165a3 --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/PaymentApplyAgentDTO.java @@ -0,0 +1,132 @@ +package com.hzya.frame.cbs8.dto.req; + +/** + * @Description 代发代扣明细 + * @Author xiangerlin + * @Date 2024/6/18 13:45 + **/ +public class PaymentApplyAgentDTO { + //每笔明细金额 + private String dtlAmount; + //收款账号 + private String dtlRevAccount; + //联行号 同行可不传,跨行必传 + private String dtlCnapsCode; + //收款账户名称 + private String dtlRevName; + //收款开户行 ,如果传的联行号能匹配到对应到开户行,cbs8会自动带出 + private String dtlRevBankName; + + + + //是否跨行 Y跨行 N同行 + private String dtlBankFlag; + //明细用途 + private String dtlPurpose; + //明细摘要 + private String dtlRemark; + //收款账号银行号|地区码 + private String dtlRevBankArea; + //收款开户地 + private String dtlRevBankCity; + //明细序号,从1开始递增 + private int dtlSeqNum; + //备用字段 一共6个 + private String dtlExtend1; + + public String getDtlAmount() { + return dtlAmount; + } + + public void setDtlAmount(String dtlAmount) { + this.dtlAmount = dtlAmount; + } + + public String getDtlRevAccount() { + return dtlRevAccount; + } + + public void setDtlRevAccount(String dtlRevAccount) { + this.dtlRevAccount = dtlRevAccount; + } + + public String getDtlCnapsCode() { + return dtlCnapsCode; + } + + public void setDtlCnapsCode(String dtlCnapsCode) { + this.dtlCnapsCode = dtlCnapsCode; + } + + public String getDtlRevName() { + return dtlRevName; + } + + public void setDtlRevName(String dtlRevName) { + this.dtlRevName = dtlRevName; + } + + public String getDtlRevBankName() { + return dtlRevBankName; + } + + public void setDtlRevBankName(String dtlRevBankName) { + this.dtlRevBankName = dtlRevBankName; + } + + public String getDtlBankFlag() { + return dtlBankFlag; + } + + public void setDtlBankFlag(String dtlBankFlag) { + this.dtlBankFlag = dtlBankFlag; + } + + public String getDtlPurpose() { + return dtlPurpose; + } + + public void setDtlPurpose(String dtlPurpose) { + this.dtlPurpose = dtlPurpose; + } + + public String getDtlRemark() { + return dtlRemark; + } + + public void setDtlRemark(String dtlRemark) { + this.dtlRemark = dtlRemark; + } + + public String getDtlRevBankArea() { + return dtlRevBankArea; + } + + public void setDtlRevBankArea(String dtlRevBankArea) { + this.dtlRevBankArea = dtlRevBankArea; + } + + public String getDtlRevBankCity() { + return dtlRevBankCity; + } + + public void setDtlRevBankCity(String dtlRevBankCity) { + this.dtlRevBankCity = dtlRevBankCity; + } + + public int getDtlSeqNum() { + return dtlSeqNum; + } + + public void setDtlSeqNum(int dtlSeqNum) { + this.dtlSeqNum = dtlSeqNum; + } + + public String getDtlExtend1() { + return dtlExtend1; + } + + public void setDtlExtend1(String dtlExtend1) { + this.dtlExtend1 = dtlExtend1; + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/PaymentApplySubmitReqDTO.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/PaymentApplySubmitReqDTO.java new file mode 100644 index 00000000..863ecb63 --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/PaymentApplySubmitReqDTO.java @@ -0,0 +1,245 @@ +package com.hzya.frame.cbs8.dto.req; + +/** + * @Description 批量代发代扣 203代发 201代扣 + * @Author xiangerlin + * @Date 2024/6/18 11:58 + **/ +public class PaymentApplySubmitReqDTO { + //业务参考号 + private String referenceNum; + /** + * 业务类型 + * 201-代扣 + * 203-代发 + * 代发工资传203 + */ + private String busType; + //总金额 小数位2位 + private String amount; + //币种 + private String currency; + //付款账号 + private String payAccount; + //用途 + private String purpose; + // 以上是必填字段 + + + + //备注 + private String summary; + //期望支付时间 + private String expectTime; + //公私标识 1对私 0对公 + private String personalFlag; + //加急标志 1加急 0不加急 + private String urgentTag; + //是否实时 1实时 0落地 + private String realTimeTag; + /** + * 同城标志 0同城 1异地 + * 收/付账号所属同一个城市为同城,否则为异地 + */ + private String cityFlag; + //银行备用字段 一共8个 + private String bankExtend1; + private String bankExtend2; + private String bankExtend3; + private String bankExtend4; + private String bankExtend5; + private String bankExtend6; + private String bankExtend7; + private String bankExtend8; + + //客户备用字段1 + private String erpExtend1; + //客户备用字段1 + private String erpExtend2; + //客户备用字段1 + private String erpExtend3; + + public String getReferenceNum() { + return referenceNum; + } + + public void setReferenceNum(String referenceNum) { + this.referenceNum = referenceNum; + } + + public String getBusType() { + return busType; + } + + public void setBusType(String busType) { + this.busType = busType; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getPayAccount() { + return payAccount; + } + + public void setPayAccount(String payAccount) { + this.payAccount = payAccount; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getSummary() { + return summary; + } + + public void setSummary(String summary) { + this.summary = summary; + } + + public String getExpectTime() { + return expectTime; + } + + public void setExpectTime(String expectTime) { + this.expectTime = expectTime; + } + + public String getPersonalFlag() { + return personalFlag; + } + + public void setPersonalFlag(String personalFlag) { + this.personalFlag = personalFlag; + } + + public String getUrgentTag() { + return urgentTag; + } + + public void setUrgentTag(String urgentTag) { + this.urgentTag = urgentTag; + } + + public String getRealTimeTag() { + return realTimeTag; + } + + public void setRealTimeTag(String realTimeTag) { + this.realTimeTag = realTimeTag; + } + + public String getCityFlag() { + return cityFlag; + } + + public void setCityFlag(String cityFlag) { + this.cityFlag = cityFlag; + } + + public String getBankExtend1() { + return bankExtend1; + } + + public void setBankExtend1(String bankExtend1) { + this.bankExtend1 = bankExtend1; + } + + public String getErpExtend1() { + return erpExtend1; + } + + public void setErpExtend1(String erpExtend1) { + this.erpExtend1 = erpExtend1; + } + + public String getErpExtend2() { + return erpExtend2; + } + + public void setErpExtend2(String erpExtend2) { + this.erpExtend2 = erpExtend2; + } + + public String getErpExtend3() { + return erpExtend3; + } + + public void setErpExtend3(String erpExtend3) { + this.erpExtend3 = erpExtend3; + } + + public String getBankExtend2() { + return bankExtend2; + } + + public void setBankExtend2(String bankExtend2) { + this.bankExtend2 = bankExtend2; + } + + public String getBankExtend3() { + return bankExtend3; + } + + public void setBankExtend3(String bankExtend3) { + this.bankExtend3 = bankExtend3; + } + + public String getBankExtend4() { + return bankExtend4; + } + + public void setBankExtend4(String bankExtend4) { + this.bankExtend4 = bankExtend4; + } + + public String getBankExtend5() { + return bankExtend5; + } + + public void setBankExtend5(String bankExtend5) { + this.bankExtend5 = bankExtend5; + } + + public String getBankExtend6() { + return bankExtend6; + } + + public void setBankExtend6(String bankExtend6) { + this.bankExtend6 = bankExtend6; + } + + public String getBankExtend7() { + return bankExtend7; + } + + public void setBankExtend7(String bankExtend7) { + this.bankExtend7 = bankExtend7; + } + + public String getBankExtend8() { + return bankExtend8; + } + + public void setBankExtend8(String bankExtend8) { + this.bankExtend8 = bankExtend8; + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/TransactionDetailReqDTO.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/TransactionDetailReqDTO.java new file mode 100644 index 00000000..26f5f4bf --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/req/TransactionDetailReqDTO.java @@ -0,0 +1,164 @@ +package com.hzya.frame.cbs8.dto.req; + +import java.util.List; + +/** + * @Description 查询境内交易明细参数 + * @Author xiangerlin + * @Date 2024/1/3 09:55 + **/ +public class TransactionDetailReqDTO { + private int currentPage;//当前页码 从1开始 + private int pageSize;//本次查询的记录数,最大1000条 + private String startDate;//开始日期 + private String endDate;//结束日期 + private String dateType;//日期类型0:交易日期,1:起息日期 + private List accountNoList;//账户列表 + private List bankTypeList;//银行类型列表 + private List currencyList;//币种列表 + private String detailedSources;//明细来源 + private String currentFlag;//明细类型 + private String loanType;//借贷类型 1:借 2:贷 + private List accountNatureList;//账户性质列表 + private String bankSerialNumber;//银行流水号 + private String transactionSerialNumber;//交易流水号 + private List unitCodeList ;//单位编码列表 + private String erpSerialNumber ;//erp业务参考号 + + public TransactionDetailReqDTO() { + + } + + public TransactionDetailReqDTO(String startDate, String endDate) { + this.startDate = startDate; + this.endDate = endDate; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getDateType() { + return dateType; + } + + public void setDateType(String dateType) { + this.dateType = dateType; + } + + public List getAccountNoList() { + return accountNoList; + } + + public void setAccountNoList(List accountNoList) { + this.accountNoList = accountNoList; + } + + public List getBankTypeList() { + return bankTypeList; + } + + public void setBankTypeList(List bankTypeList) { + this.bankTypeList = bankTypeList; + } + + public List getCurrencyList() { + return currencyList; + } + + public void setCurrencyList(List currencyList) { + this.currencyList = currencyList; + } + + public String getDetailedSources() { + return detailedSources; + } + + public void setDetailedSources(String detailedSources) { + this.detailedSources = detailedSources; + } + + public String getCurrentFlag() { + return currentFlag; + } + + public void setCurrentFlag(String currentFlag) { + this.currentFlag = currentFlag; + } + + public String getLoanType() { + return loanType; + } + + public void setLoanType(String loanType) { + this.loanType = loanType; + } + + public List getAccountNatureList() { + return accountNatureList; + } + + public void setAccountNatureList(List accountNatureList) { + this.accountNatureList = accountNatureList; + } + + public String getBankSerialNumber() { + return bankSerialNumber; + } + + public void setBankSerialNumber(String bankSerialNumber) { + this.bankSerialNumber = bankSerialNumber; + } + + public String getTransactionSerialNumber() { + return transactionSerialNumber; + } + + public void setTransactionSerialNumber(String transactionSerialNumber) { + this.transactionSerialNumber = transactionSerialNumber; + } + + public List getUnitCodeList() { + return unitCodeList; + } + + public void setUnitCodeList(List unitCodeList) { + this.unitCodeList = unitCodeList; + } + + public String getErpSerialNumber() { + return erpSerialNumber; + } + + public void setErpSerialNumber(String erpSerialNumber) { + this.erpSerialNumber = erpSerialNumber; + } + + public int getCurrentPage() { + return currentPage; + } + + public void setCurrentPage(int currentPage) { + this.currentPage = currentPage; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/AgentPayQueryDTO.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/AgentPayQueryDTO.java new file mode 100644 index 00000000..402e7895 --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/AgentPayQueryDTO.java @@ -0,0 +1,280 @@ +package com.hzya.frame.cbs8.dto.res; + +/** + * @Description 代发代扣查询详情 + * @Author xiangerlin + * @Date 2024/6/19 09:02 + **/ +public class AgentPayQueryDTO { + // 申请单编号 + private String busNum; + + // 代发/代扣明细序号 + private String dtlSeqNum; + + // 金额 + private String dtlAmount; // 考虑到金额计算精度,建议使用BigDecimal + + // 收款人名称 + private String dtlRevName; + + // 收款人账号 + private String dtlRevAccount; + + // 收款人开户行 + private String dtlRevBankName; + + // 银行号 + private String dtlBankNum; + + // 联行号 + private String dtlCnapsCode; + + // 是否跨行(Y:开户行是招商银行。N:开户行是他行。为空默认为招行) + private String dtlBankFlag; + + // 地区名称 + private String dtlRevBankArea; + + // 注释 + private String dtlRemark; + + // 状态 + private String dtlStatus; + + // 错误信息 + private String dtlErrorMessage; + + // 他行开户地 + private String dtlRevBankCity; + + // 备用字段1-6 + private String dtlExtend1; + private String dtlExtend2; + private String dtlExtend3; + private String dtlExtend4; + private String dtlExtend5; + private String dtlExtend6; + + // ERP备注1-3 + private String dtlErpComment1; + private String dtlErpComment2; + private String dtlErpComment3; + + // 用途 + private String dtlPurpose; + + // 银行支付时间 + private String dtlPayTime; + + // 实际扣款金额 + private String dtlActualAmount; + + public String getBusNum() { + return busNum; + } + + public void setBusNum(String busNum) { + this.busNum = busNum; + } + + public String getDtlSeqNum() { + return dtlSeqNum; + } + + public void setDtlSeqNum(String dtlSeqNum) { + this.dtlSeqNum = dtlSeqNum; + } + + public String getDtlAmount() { + return dtlAmount; + } + + public void setDtlAmount(String dtlAmount) { + this.dtlAmount = dtlAmount; + } + + public String getDtlRevName() { + return dtlRevName; + } + + public void setDtlRevName(String dtlRevName) { + this.dtlRevName = dtlRevName; + } + + public String getDtlRevAccount() { + return dtlRevAccount; + } + + public void setDtlRevAccount(String dtlRevAccount) { + this.dtlRevAccount = dtlRevAccount; + } + + public String getDtlRevBankName() { + return dtlRevBankName; + } + + public void setDtlRevBankName(String dtlRevBankName) { + this.dtlRevBankName = dtlRevBankName; + } + + public String getDtlBankNum() { + return dtlBankNum; + } + + public void setDtlBankNum(String dtlBankNum) { + this.dtlBankNum = dtlBankNum; + } + + public String getDtlCnapsCode() { + return dtlCnapsCode; + } + + public void setDtlCnapsCode(String dtlCnapsCode) { + this.dtlCnapsCode = dtlCnapsCode; + } + + public String getDtlBankFlag() { + return dtlBankFlag; + } + + public void setDtlBankFlag(String dtlBankFlag) { + this.dtlBankFlag = dtlBankFlag; + } + + public String getDtlRevBankArea() { + return dtlRevBankArea; + } + + public void setDtlRevBankArea(String dtlRevBankArea) { + this.dtlRevBankArea = dtlRevBankArea; + } + + public String getDtlRemark() { + return dtlRemark; + } + + public void setDtlRemark(String dtlRemark) { + this.dtlRemark = dtlRemark; + } + + public String getDtlStatus() { + return dtlStatus; + } + + public void setDtlStatus(String dtlStatus) { + this.dtlStatus = dtlStatus; + } + + public String getDtlErrorMessage() { + return dtlErrorMessage; + } + + public void setDtlErrorMessage(String dtlErrorMessage) { + this.dtlErrorMessage = dtlErrorMessage; + } + + public String getDtlRevBankCity() { + return dtlRevBankCity; + } + + public void setDtlRevBankCity(String dtlRevBankCity) { + this.dtlRevBankCity = dtlRevBankCity; + } + + public String getDtlExtend1() { + return dtlExtend1; + } + + public void setDtlExtend1(String dtlExtend1) { + this.dtlExtend1 = dtlExtend1; + } + + public String getDtlExtend2() { + return dtlExtend2; + } + + public void setDtlExtend2(String dtlExtend2) { + this.dtlExtend2 = dtlExtend2; + } + + public String getDtlExtend3() { + return dtlExtend3; + } + + public void setDtlExtend3(String dtlExtend3) { + this.dtlExtend3 = dtlExtend3; + } + + public String getDtlExtend4() { + return dtlExtend4; + } + + public void setDtlExtend4(String dtlExtend4) { + this.dtlExtend4 = dtlExtend4; + } + + public String getDtlExtend5() { + return dtlExtend5; + } + + public void setDtlExtend5(String dtlExtend5) { + this.dtlExtend5 = dtlExtend5; + } + + public String getDtlExtend6() { + return dtlExtend6; + } + + public void setDtlExtend6(String dtlExtend6) { + this.dtlExtend6 = dtlExtend6; + } + + public String getDtlErpComment1() { + return dtlErpComment1; + } + + public void setDtlErpComment1(String dtlErpComment1) { + this.dtlErpComment1 = dtlErpComment1; + } + + public String getDtlErpComment2() { + return dtlErpComment2; + } + + public void setDtlErpComment2(String dtlErpComment2) { + this.dtlErpComment2 = dtlErpComment2; + } + + public String getDtlErpComment3() { + return dtlErpComment3; + } + + public void setDtlErpComment3(String dtlErpComment3) { + this.dtlErpComment3 = dtlErpComment3; + } + + public String getDtlPurpose() { + return dtlPurpose; + } + + public void setDtlPurpose(String dtlPurpose) { + this.dtlPurpose = dtlPurpose; + } + + public String getDtlPayTime() { + return dtlPayTime; + } + + public void setDtlPayTime(String dtlPayTime) { + this.dtlPayTime = dtlPayTime; + } + + public String getDtlActualAmount() { + return dtlActualAmount; + } + + public void setDtlActualAmount(String dtlActualAmount) { + this.dtlActualAmount = dtlActualAmount; + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/AgentPayResultResDTO.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/AgentPayResultResDTO.java new file mode 100644 index 00000000..5ea5d5ae --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/AgentPayResultResDTO.java @@ -0,0 +1,450 @@ +package com.hzya.frame.cbs8.dto.res; + +import java.util.List; + +/** + * @Description 代发代扣 返回参数对象 + * @Author xiangerlin + * @Date 2024/6/19 08:53 + **/ +public class AgentPayResultResDTO { + // 支付的业务类型 + private String busType; + + // 申请单编号 + private String busNum; + + // 付款账户 + private String payAccount; + + // 付款账户名称 + private String payAccountName; + + // 付款账户开户行 + private String payBankName; + + // 付款银行类型 + private String payBankType; + + // 币种 + private String currency; + + // 金额 + private String amount; + + // 收款账户 + private String revAccount; + + // 收款账户名称 + private String revAccountName; + + // 收款开户行 + private String revBankName; + + // 收款银行类型 + private String revBankType; + + // 收款人省 + private String revProvince; + + // 对账码集合(假设为String列表) + private List checkCodeList; + + // 收款人市 + private String revCity; + + // 支付渠道 + private String payChannel; + + // 付款单提示信息/银行返回信息 + private String errorMsg; + + // 支付申请状态 + private String status; + + // 经办人ID + private String createBy; + + // 经办人名称 + private String createByName; + + // 用途 + private String purpose; + + // 摘要/备注 + private String summary; + + // 期望支付时间 + private String expectTime; + + // 支付时间 + private String payDate; + + // 支付状态 + private String payStatus; + + // 客户备用字段1 + private String erpExtend1; + + // 客户备用字段2 + private String erpExtend2; + + // 客户备用字段3 + private String erpExtend3; + + // 计划流水号 + private String planNumber; + + // 资金预算编号 + private String planItemCode; + + // 预算项名称 + private String planItemName; + + // 预算所属单位编码 + private String planUnitCode; + + // 预算所属单位名称 + private String planUnitName; + + // 单位编码(前端展示) + private String displayUnitCode; + + // 预算单位编码(前端展示) + private String displayPlanUnitCode; + + // 经办用户单位编码(前端展示) + private String displayOperaterOrgCode; + + // 付方单位编码(前端展示) + private String displayPayOrgCode; + + // 客商编号 + private String revCustomerCode; + + // 结算方式 + private String payType; + + //代发代扣详情 + private List agentDetails; + + public String getBusType() { + return busType; + } + + public void setBusType(String busType) { + this.busType = busType; + } + + public String getBusNum() { + return busNum; + } + + public void setBusNum(String busNum) { + this.busNum = busNum; + } + + public String getPayAccount() { + return payAccount; + } + + public void setPayAccount(String payAccount) { + this.payAccount = payAccount; + } + + public String getPayAccountName() { + return payAccountName; + } + + public void setPayAccountName(String payAccountName) { + this.payAccountName = payAccountName; + } + + public String getPayBankName() { + return payBankName; + } + + public void setPayBankName(String payBankName) { + this.payBankName = payBankName; + } + + public String getPayBankType() { + return payBankType; + } + + public void setPayBankType(String payBankType) { + this.payBankType = payBankType; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getRevAccount() { + return revAccount; + } + + public void setRevAccount(String revAccount) { + this.revAccount = revAccount; + } + + public String getRevAccountName() { + return revAccountName; + } + + public void setRevAccountName(String revAccountName) { + this.revAccountName = revAccountName; + } + + public String getRevBankName() { + return revBankName; + } + + public void setRevBankName(String revBankName) { + this.revBankName = revBankName; + } + + public String getRevBankType() { + return revBankType; + } + + public void setRevBankType(String revBankType) { + this.revBankType = revBankType; + } + + public String getRevProvince() { + return revProvince; + } + + public void setRevProvince(String revProvince) { + this.revProvince = revProvince; + } + + public List getCheckCodeList() { + return checkCodeList; + } + + public void setCheckCodeList(List checkCodeList) { + this.checkCodeList = checkCodeList; + } + + public String getRevCity() { + return revCity; + } + + public void setRevCity(String revCity) { + this.revCity = revCity; + } + + public String getPayChannel() { + return payChannel; + } + + public void setPayChannel(String payChannel) { + this.payChannel = payChannel; + } + + public String getErrorMsg() { + return errorMsg; + } + + public void setErrorMsg(String errorMsg) { + this.errorMsg = errorMsg; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public String getCreateByName() { + return createByName; + } + + public void setCreateByName(String createByName) { + this.createByName = createByName; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getSummary() { + return summary; + } + + public void setSummary(String summary) { + this.summary = summary; + } + + public String getExpectTime() { + return expectTime; + } + + public void setExpectTime(String expectTime) { + this.expectTime = expectTime; + } + + public String getPayDate() { + return payDate; + } + + public void setPayDate(String payDate) { + this.payDate = payDate; + } + + public String getPayStatus() { + return payStatus; + } + + public void setPayStatus(String payStatus) { + this.payStatus = payStatus; + } + + public String getErpExtend1() { + return erpExtend1; + } + + public void setErpExtend1(String erpExtend1) { + this.erpExtend1 = erpExtend1; + } + + public String getErpExtend2() { + return erpExtend2; + } + + public void setErpExtend2(String erpExtend2) { + this.erpExtend2 = erpExtend2; + } + + public String getErpExtend3() { + return erpExtend3; + } + + public void setErpExtend3(String erpExtend3) { + this.erpExtend3 = erpExtend3; + } + + public String getPlanNumber() { + return planNumber; + } + + public void setPlanNumber(String planNumber) { + this.planNumber = planNumber; + } + + public String getPlanItemCode() { + return planItemCode; + } + + public void setPlanItemCode(String planItemCode) { + this.planItemCode = planItemCode; + } + + public String getPlanItemName() { + return planItemName; + } + + public void setPlanItemName(String planItemName) { + this.planItemName = planItemName; + } + + public String getPlanUnitCode() { + return planUnitCode; + } + + public void setPlanUnitCode(String planUnitCode) { + this.planUnitCode = planUnitCode; + } + + public String getPlanUnitName() { + return planUnitName; + } + + public void setPlanUnitName(String planUnitName) { + this.planUnitName = planUnitName; + } + + public String getDisplayUnitCode() { + return displayUnitCode; + } + + public void setDisplayUnitCode(String displayUnitCode) { + this.displayUnitCode = displayUnitCode; + } + + public String getDisplayPlanUnitCode() { + return displayPlanUnitCode; + } + + public void setDisplayPlanUnitCode(String displayPlanUnitCode) { + this.displayPlanUnitCode = displayPlanUnitCode; + } + + public String getDisplayOperaterOrgCode() { + return displayOperaterOrgCode; + } + + public void setDisplayOperaterOrgCode(String displayOperaterOrgCode) { + this.displayOperaterOrgCode = displayOperaterOrgCode; + } + + public String getDisplayPayOrgCode() { + return displayPayOrgCode; + } + + public void setDisplayPayOrgCode(String displayPayOrgCode) { + this.displayPayOrgCode = displayPayOrgCode; + } + + public String getRevCustomerCode() { + return revCustomerCode; + } + + public void setRevCustomerCode(String revCustomerCode) { + this.revCustomerCode = revCustomerCode; + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType; + } + + public List getAgentDetails() { + return agentDetails; + } + + public void setAgentDetails(List agentDetails) { + this.agentDetails = agentDetails; + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/CbsResDataDTO.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/CbsResDataDTO.java new file mode 100644 index 00000000..0bb30dc8 --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/CbsResDataDTO.java @@ -0,0 +1,458 @@ +package com.hzya.frame.cbs8.dto.res; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.annotation.JSONField; + +import java.util.List; + +/** + * @Description data节点 + * @Author xiangerlin + * @Date 2024/1/2 09:26 + **/ +public class CbsResDataDTO { + + + private List list;//明细数据 + //------- 交易明细字段----- + private int endRow; + private Boolean hasNextPage;//是否有下一页 + private Boolean hasPreviousPage;//是否有前一页 + @JSONField(name = "isFirstPage") + private Boolean hasFirstPage; + @JSONField(name = "isLastPage") + private Boolean hasLastPage; + private int navigateFirstPage; + private int navigateLastPage; + private int navigatePages; + private int nextPage; + private int pageNum; + private int pageSize; + private int pages; + private int prePage; + private int size; + private int startRow; + private int total; + //------- 交易明细字段----- + + //------经办支付返回参数------ + private String busNum;//申请单编号 + private String errorCode;//错误编码 + private String errorMsg;//错误信息 + private String freezeFlowNum;//内部户冻结流水号 + private String recordNum;//批量经办序号 + private String referenceNum;//业务参考号 + private Boolean successed;//是否成功 + //------经办支付返回参数------ + + + //------查询交易结果返回参数------- + + private String busType;//支付业务类型 + private String payAccount;//付款账号 + private String payAccountName;//付款户名 + private String payBankName;//付款开户行名称 + private String payBankType;//付款银行类型 + private String currency;//币种 + private String amount;//金额 + private String revAccount;//收款账户 + private String revAccountName;//收款账户名 + private String revBankName;//收款开户行 + private String revBankType;//收款银行类型 + private String payChannel;//支付渠道 + + private String status;//支付申请单状态 + private String payStatus;//支付状态 + private String payDate;//支付时间 + private String planNumber;//计划流水号 + private String planItemCode;//资金预算编号 + private String planItemName;//预算名称 + private String erpExtend1;//客户备用字段1 + private String erpExtend2;//客户备用字段1 + private String erpExtend3;//客户备用字段1 + + //------查询交易结果返回参数------- + + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public int getEndRow() { + return endRow; + } + + public void setEndRow(int endRow) { + this.endRow = endRow; + } + + public Boolean getHasNextPage() { + return hasNextPage; + } + + public void setHasNextPage(Boolean hasNextPage) { + this.hasNextPage = hasNextPage; + } + + public Boolean getHasPreviousPage() { + return hasPreviousPage; + } + + public void setHasPreviousPage(Boolean hasPreviousPage) { + this.hasPreviousPage = hasPreviousPage; + } + + public Boolean getHasFirstPage() { + return hasFirstPage; + } + + public void setHasFirstPage(Boolean hasFirstPage) { + this.hasFirstPage = hasFirstPage; + } + + public Boolean getHasLastPage() { + return hasLastPage; + } + + public void setHasLastPage(Boolean hasLastPage) { + this.hasLastPage = hasLastPage; + } + + public int getNavigateFirstPage() { + return navigateFirstPage; + } + + public void setNavigateFirstPage(int navigateFirstPage) { + this.navigateFirstPage = navigateFirstPage; + } + + public int getNavigateLastPage() { + return navigateLastPage; + } + + public void setNavigateLastPage(int navigateLastPage) { + this.navigateLastPage = navigateLastPage; + } + + public int getNavigatePages() { + return navigatePages; + } + + public void setNavigatePages(int navigatePages) { + this.navigatePages = navigatePages; + } + + public int getNextPage() { + return nextPage; + } + + public void setNextPage(int nextPage) { + this.nextPage = nextPage; + } + + public int getPageNum() { + return pageNum; + } + + public void setPageNum(int pageNum) { + this.pageNum = pageNum; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public int getPages() { + return pages; + } + + public void setPages(int pages) { + this.pages = pages; + } + + public int getPrePage() { + return prePage; + } + + public void setPrePage(int prePage) { + this.prePage = prePage; + } + + public int getSize() { + return size; + } + + public void setSize(int size) { + this.size = size; + } + + public int getStartRow() { + return startRow; + } + + public void setStartRow(int startRow) { + this.startRow = startRow; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public String getBusNum() { + return busNum; + } + + public void setBusNum(String busNum) { + this.busNum = busNum; + } + + public String getErrorCode() { + return errorCode; + } + + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + } + + public String getErrorMsg() { + return errorMsg; + } + + public void setErrorMsg(String errorMsg) { + this.errorMsg = errorMsg; + } + + public String getFreezeFlowNum() { + return freezeFlowNum; + } + + public void setFreezeFlowNum(String freezeFlowNum) { + this.freezeFlowNum = freezeFlowNum; + } + + public String getRecordNum() { + return recordNum; + } + + public void setRecordNum(String recordNum) { + this.recordNum = recordNum; + } + + public String getReferenceNum() { + return referenceNum; + } + + public void setReferenceNum(String referenceNum) { + this.referenceNum = referenceNum; + } + + public Boolean getSuccessed() { + return successed; + } + + public void setSuccessed(Boolean successed) { + this.successed = successed; + } + + public String getBusType() { + return busType; + } + + public void setBusType(String busType) { + this.busType = busType; + } + + public String getPayAccount() { + return payAccount; + } + + public void setPayAccount(String payAccount) { + this.payAccount = payAccount; + } + + public String getPayAccountName() { + return payAccountName; + } + + public void setPayAccountName(String payAccountName) { + this.payAccountName = payAccountName; + } + + public String getPayBankName() { + return payBankName; + } + + public void setPayBankName(String payBankName) { + this.payBankName = payBankName; + } + + public String getPayBankType() { + return payBankType; + } + + public void setPayBankType(String payBankType) { + this.payBankType = payBankType; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getRevAccount() { + return revAccount; + } + + public void setRevAccount(String revAccount) { + this.revAccount = revAccount; + } + + public String getRevAccountName() { + return revAccountName; + } + + public void setRevAccountName(String revAccountName) { + this.revAccountName = revAccountName; + } + + public String getRevBankName() { + return revBankName; + } + + public void setRevBankName(String revBankName) { + this.revBankName = revBankName; + } + + public String getRevBankType() { + return revBankType; + } + + public void setRevBankType(String revBankType) { + this.revBankType = revBankType; + } + + public String getPayChannel() { + return payChannel; + } + + public void setPayChannel(String payChannel) { + this.payChannel = payChannel; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getPayStatus() { + return payStatus; + } + + public void setPayStatus(String payStatus) { + this.payStatus = payStatus; + } + + public String getPayDate() { + return payDate; + } + + public void setPayDate(String payDate) { + this.payDate = payDate; + } + + public String getPlanNumber() { + return planNumber; + } + + public void setPlanNumber(String planNumber) { + this.planNumber = planNumber; + } + + public String getPlanItemCode() { + return planItemCode; + } + + public void setPlanItemCode(String planItemCode) { + this.planItemCode = planItemCode; + } + + public String getPlanItemName() { + return planItemName; + } + + public void setPlanItemName(String planItemName) { + this.planItemName = planItemName; + } + + public String getErpExtend1() { + return erpExtend1; + } + + public void setErpExtend1(String erpExtend1) { + this.erpExtend1 = erpExtend1; + } + + public String getErpExtend2() { + return erpExtend2; + } + + public void setErpExtend2(String erpExtend2) { + this.erpExtend2 = erpExtend2; + } + + public String getErpExtend3() { + return erpExtend3; + } + + public void setErpExtend3(String erpExtend3) { + this.erpExtend3 = erpExtend3; + } + + /** + * 把json字符串转换成指定范型的list + * @param json + * @param list + * @param clazz + * @param + */ + private static void adaptAndAddToList(String json, List list, Class clazz) { + JSONObject jsonObject = JSON.parseObject(json); + + if (jsonObject.containsKey("list")) { + JSONArray listArray = jsonObject.getJSONArray("list"); + for (Object item : listArray) { + JSONObject itemObject = (JSONObject) item; + // 适配不同类型的节点 + list.add(JSON.toJavaObject(itemObject, clazz)); + } + } + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/CbsResponseDTO.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/CbsResponseDTO.java new file mode 100644 index 00000000..1abae5b9 --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/CbsResponseDTO.java @@ -0,0 +1,44 @@ +package com.hzya.frame.cbs8.dto.res; + +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.annotation.JSONField; + +import java.util.List; + +/** + * @Description cbs响应DTO + * @Author xiangerlin + * @Date 2024/1/2 09:25 + **/ +public class CbsResponseDTO { + //private List data;//数据 + private List data;//数据 + private String code;//0表示成功 + private String msg;//消息 + + + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/ElecResponseDTO.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/ElecResponseDTO.java new file mode 100644 index 00000000..6e77d30a --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/ElecResponseDTO.java @@ -0,0 +1,305 @@ +package com.hzya.frame.cbs8.dto.res; + +/** + * @Description 电子回单查询返回参数 + * @Author xiangerlin + * @Date 2024/1/4 17:13 + **/ +public class ElecResponseDTO { + + // 账号 + private String accountNo; + + // 账号名称 + private String accountName; + + // 银行类型 + private String bankType; + + // 银行类型名称 + private String bankTypeName; + + // 开户行 + private String openingBank; + + // 交易日期 + private String transactionDate; + + // 电子回单文件状态 + private String electronicBillStatus; + + // 电子回单文件名称 + private String billFileName; + + // 回单文件下载地址 + private String bucketFileUrl; + + // 回单文件名称 + private String bucketFileName; + + // 回单类型 + private String electronicBillType; + + // 银行流水号 + private String bankSerialNumber; + + // 回单编号 + private String printInstanceNumber; + + // 币种 + private String currency; + + // 币种名称 + private String currencyName; + + // 借贷类型 + private String loanType; + + // 交易金额 + private String transactionAmount; + + // 对方账号 + private String oppositeAccount; + + // 对方账户名 + private String oppositeAccountName; + + // 对方开户地 + private String oppositeOpeningPlace; + + // 对方开户行 + private String oppositeOpeningBank; + + // 摘要 + private String digest; + + // 用途 + private String purpose; + + // 账户性质 + private String accountNatureCode; + + // 对账码 + private String checkCode; + + // 单位编码 + private String unitCode; + + // ERP业务参考号 + private String settleBusinessReferenceCode; + public String getAccountNo() { + return accountNo; + } + + public void setAccountNo(String accountNo) { + this.accountNo = accountNo; + } + + public String getAccountName() { + return accountName; + } + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + public String getBankType() { + return bankType; + } + + public void setBankType(String bankType) { + this.bankType = bankType; + } + + public String getBankTypeName() { + return bankTypeName; + } + + public void setBankTypeName(String bankTypeName) { + this.bankTypeName = bankTypeName; + } + + public String getOpeningBank() { + return openingBank; + } + + public void setOpeningBank(String openingBank) { + this.openingBank = openingBank; + } + + public String getTransactionDate() { + return transactionDate; + } + + public void setTransactionDate(String transactionDate) { + this.transactionDate = transactionDate; + } + + public String getElectronicBillStatus() { + return electronicBillStatus; + } + + public void setElectronicBillStatus(String electronicBillStatus) { + this.electronicBillStatus = electronicBillStatus; + } + + public String getBillFileName() { + return billFileName; + } + + public void setBillFileName(String billFileName) { + this.billFileName = billFileName; + } + + public String getBucketFileUrl() { + return bucketFileUrl; + } + + public void setBucketFileUrl(String bucketFileUrl) { + this.bucketFileUrl = bucketFileUrl; + } + + public String getBucketFileName() { + return bucketFileName; + } + + public void setBucketFileName(String bucketFileName) { + this.bucketFileName = bucketFileName; + } + + public String getElectronicBillType() { + return electronicBillType; + } + + public void setElectronicBillType(String electronicBillType) { + this.electronicBillType = electronicBillType; + } + + public String getBankSerialNumber() { + return bankSerialNumber; + } + + public void setBankSerialNumber(String bankSerialNumber) { + this.bankSerialNumber = bankSerialNumber; + } + + public String getPrintInstanceNumber() { + return printInstanceNumber; + } + + public void setPrintInstanceNumber(String printInstanceNumber) { + this.printInstanceNumber = printInstanceNumber; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getCurrencyName() { + return currencyName; + } + + public void setCurrencyName(String currencyName) { + this.currencyName = currencyName; + } + + public String getLoanType() { + return loanType; + } + + public void setLoanType(String loanType) { + this.loanType = loanType; + } + + public String getTransactionAmount() { + return transactionAmount; + } + + public void setTransactionAmount(String transactionAmount) { + this.transactionAmount = transactionAmount; + } + + public String getOppositeAccount() { + return oppositeAccount; + } + + public void setOppositeAccount(String oppositeAccount) { + this.oppositeAccount = oppositeAccount; + } + + public String getOppositeAccountName() { + return oppositeAccountName; + } + + public void setOppositeAccountName(String oppositeAccountName) { + this.oppositeAccountName = oppositeAccountName; + } + + public String getOppositeOpeningPlace() { + return oppositeOpeningPlace; + } + + public void setOppositeOpeningPlace(String oppositeOpeningPlace) { + this.oppositeOpeningPlace = oppositeOpeningPlace; + } + + public String getOppositeOpeningBank() { + return oppositeOpeningBank; + } + + public void setOppositeOpeningBank(String oppositeOpeningBank) { + this.oppositeOpeningBank = oppositeOpeningBank; + } + + public String getDigest() { + return digest; + } + + public void setDigest(String digest) { + this.digest = digest; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getAccountNatureCode() { + return accountNatureCode; + } + + public void setAccountNatureCode(String accountNatureCode) { + this.accountNatureCode = accountNatureCode; + } + + public String getCheckCode() { + return checkCode; + } + + public void setCheckCode(String checkCode) { + this.checkCode = checkCode; + } + + public String getUnitCode() { + return unitCode; + } + + public void setUnitCode(String unitCode) { + this.unitCode = unitCode; + } + + public String getSettleBusinessReferenceCode() { + return settleBusinessReferenceCode; + } + + public void setSettleBusinessReferenceCode(String settleBusinessReferenceCode) { + this.settleBusinessReferenceCode = settleBusinessReferenceCode; + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/PayResponseDTO.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/PayResponseDTO.java new file mode 100644 index 00000000..2534d4f8 --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/PayResponseDTO.java @@ -0,0 +1,73 @@ +package com.hzya.frame.cbs8.dto.res; + +/** + * @Description 经办支付接口返回参数中的data节点 + * @Author xiangerlin + * @Date 2024/1/3 14:35 + **/ +public class PayResponseDTO { + + private String busNum;//申请单编号 + private String errorCode;//错误编码 + private String errorMsg;//错误信息 + private String freezeFlowNum;//内部户冻结流水号 + private String recordNum;//批量经办序号 + private String referenceNum;//业务参考号 + private Boolean successed;//是否成功 + + public String getBusNum() { + return busNum; + } + + public void setBusNum(String busNum) { + this.busNum = busNum; + } + + public String getErrorCode() { + return errorCode; + } + + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + } + + public String getErrorMsg() { + return errorMsg; + } + + public void setErrorMsg(String errorMsg) { + this.errorMsg = errorMsg; + } + + public String getFreezeFlowNum() { + return freezeFlowNum; + } + + public void setFreezeFlowNum(String freezeFlowNum) { + this.freezeFlowNum = freezeFlowNum; + } + + public String getRecordNum() { + return recordNum; + } + + public void setRecordNum(String recordNum) { + this.recordNum = recordNum; + } + + public String getReferenceNum() { + return referenceNum; + } + + public void setReferenceNum(String referenceNum) { + this.referenceNum = referenceNum; + } + + public Boolean getSuccessed() { + return successed; + } + + public void setSuccessed(Boolean successed) { + this.successed = successed; + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/PayResultResDTO.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/PayResultResDTO.java new file mode 100644 index 00000000..4ab82489 --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/PayResultResDTO.java @@ -0,0 +1,890 @@ +package com.hzya.frame.cbs8.dto.res; + +/** + * @Description 交易结果查询data节点响应的参数 + * @Author xiangerlin + * @Date 2024/1/3 15:45 + **/ +public class PayResultResDTO { + + private String payDate;//支付日期 + private String accountFlag; + + private String agentDetails; + + private String amount; + + private String bankExtend1; + + private String bankExtend10; + + private String bankExtend11; + + private String bankExtend2; + + private String bankExtend3; + + private String bankExtend4; + + private String bankExtend5; + + private String bankExtend6; + + private String bankExtend7; + + private String bankExtend8; + + private String bankExtend9; + + private String bankInterfaceType; + + private String bankNum; + + private String bankVersion; + + private String batchNum; + + private String busNum; + + private String busType; + + private String checkCodeList; + + private String cityFlag; + + private String cnapsCode; + + private String createBy; + + private String createByName; + + private String createTime; + + private String currency; + + private String dealPeopleList; + + private String detailNum; + + private String erpExtend1; + + private String erpExtend2; + + private String erpExtend3; + + private String errorMsg; + + private String expectTime; + + + + private String extend1; + + private String extend2; + + private String extend3; + + private String extend4; + + private String extend5; + + private String freezeFlowNum; + + private String freezeStatus; + + private String id; + + private String innerAccount; + + private String innerAccountName; + + private String inputType; + + private String isDeleted; + + private String isSaveRev; + + private String lastPrintTime; + + private String lastPrintUser; + + private String operaterOrgCode; + + private String operaterOrgCodeList; + + private String operaterOrgName; + + private String payAccount; + + private String payAccountName; + + private String payAccountSeq; + + private String payBankName; + + private String payBankType; + + private String payChannel; + + private String payOrgCode; + + private String payOrgName; + + private String payStatus;// 支付状态 + + private String paymentApplyUnionDTO; + + private String personalFlag; + + private String printTimes; + + private String procInstId; + + private String procStatus; + + private String projectCode; + + private String purpose; + + private String realName; + + private String realRevAccount; + + private String realTimeTag; + + private String referenceNum; + + private String revAccount; + + private String revAccountName; + + private String revAccountSeq; + + private String revBankArea; + + private String revBankName; + + private String revBankType; + + private String revCity; + + private String revProvince; + + private String status;//支付申请状态 + + private String summary; + + private String unitCode; + + private String unitName; + + private String updateBy; + + private String updateTime; + + private String urgentTag; + + public String getAccountFlag() { + return accountFlag; + } + + public void setAccountFlag(String accountFlag) { + this.accountFlag = accountFlag; + } + + public String getAgentDetails() { + return agentDetails; + } + + public void setAgentDetails(String agentDetails) { + this.agentDetails = agentDetails; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getBankExtend1() { + return bankExtend1; + } + + public void setBankExtend1(String bankExtend1) { + this.bankExtend1 = bankExtend1; + } + + public String getBankExtend10() { + return bankExtend10; + } + + public void setBankExtend10(String bankExtend10) { + this.bankExtend10 = bankExtend10; + } + + public String getBankExtend11() { + return bankExtend11; + } + + public void setBankExtend11(String bankExtend11) { + this.bankExtend11 = bankExtend11; + } + + public String getBankExtend2() { + return bankExtend2; + } + + public void setBankExtend2(String bankExtend2) { + this.bankExtend2 = bankExtend2; + } + + public String getBankExtend3() { + return bankExtend3; + } + + public void setBankExtend3(String bankExtend3) { + this.bankExtend3 = bankExtend3; + } + + public String getBankExtend4() { + return bankExtend4; + } + + public void setBankExtend4(String bankExtend4) { + this.bankExtend4 = bankExtend4; + } + + public String getBankExtend5() { + return bankExtend5; + } + + public void setBankExtend5(String bankExtend5) { + this.bankExtend5 = bankExtend5; + } + + public String getBankExtend6() { + return bankExtend6; + } + + public void setBankExtend6(String bankExtend6) { + this.bankExtend6 = bankExtend6; + } + + public String getBankExtend7() { + return bankExtend7; + } + + public void setBankExtend7(String bankExtend7) { + this.bankExtend7 = bankExtend7; + } + + public String getBankExtend8() { + return bankExtend8; + } + + public void setBankExtend8(String bankExtend8) { + this.bankExtend8 = bankExtend8; + } + + public String getBankExtend9() { + return bankExtend9; + } + + public void setBankExtend9(String bankExtend9) { + this.bankExtend9 = bankExtend9; + } + + public String getBankInterfaceType() { + return bankInterfaceType; + } + + public void setBankInterfaceType(String bankInterfaceType) { + this.bankInterfaceType = bankInterfaceType; + } + + public String getBankNum() { + return bankNum; + } + + public void setBankNum(String bankNum) { + this.bankNum = bankNum; + } + + public String getBankVersion() { + return bankVersion; + } + + public void setBankVersion(String bankVersion) { + this.bankVersion = bankVersion; + } + + public String getBatchNum() { + return batchNum; + } + + public void setBatchNum(String batchNum) { + this.batchNum = batchNum; + } + + public String getBusNum() { + return busNum; + } + + public void setBusNum(String busNum) { + this.busNum = busNum; + } + + public String getBusType() { + return busType; + } + + public void setBusType(String busType) { + this.busType = busType; + } + + public String getCheckCodeList() { + return checkCodeList; + } + + public void setCheckCodeList(String checkCodeList) { + this.checkCodeList = checkCodeList; + } + + public String getCityFlag() { + return cityFlag; + } + + public void setCityFlag(String cityFlag) { + this.cityFlag = cityFlag; + } + + public String getCnapsCode() { + return cnapsCode; + } + + public void setCnapsCode(String cnapsCode) { + this.cnapsCode = cnapsCode; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public String getCreateByName() { + return createByName; + } + + public void setCreateByName(String createByName) { + this.createByName = createByName; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getDealPeopleList() { + return dealPeopleList; + } + + public void setDealPeopleList(String dealPeopleList) { + this.dealPeopleList = dealPeopleList; + } + + public String getDetailNum() { + return detailNum; + } + + public void setDetailNum(String detailNum) { + this.detailNum = detailNum; + } + + public String getErpExtend1() { + return erpExtend1; + } + + public void setErpExtend1(String erpExtend1) { + this.erpExtend1 = erpExtend1; + } + + public String getErpExtend2() { + return erpExtend2; + } + + public void setErpExtend2(String erpExtend2) { + this.erpExtend2 = erpExtend2; + } + + public String getErpExtend3() { + return erpExtend3; + } + + public void setErpExtend3(String erpExtend3) { + this.erpExtend3 = erpExtend3; + } + + public String getErrorMsg() { + return errorMsg; + } + + public void setErrorMsg(String errorMsg) { + this.errorMsg = errorMsg; + } + + public String getExpectTime() { + return expectTime; + } + + public void setExpectTime(String expectTime) { + this.expectTime = expectTime; + } + + public String getExtend1() { + return extend1; + } + + public void setExtend1(String extend1) { + this.extend1 = extend1; + } + + public String getExtend2() { + return extend2; + } + + public void setExtend2(String extend2) { + this.extend2 = extend2; + } + + public String getExtend3() { + return extend3; + } + + public void setExtend3(String extend3) { + this.extend3 = extend3; + } + + public String getExtend4() { + return extend4; + } + + public void setExtend4(String extend4) { + this.extend4 = extend4; + } + + public String getExtend5() { + return extend5; + } + + public void setExtend5(String extend5) { + this.extend5 = extend5; + } + + public String getFreezeFlowNum() { + return freezeFlowNum; + } + + public void setFreezeFlowNum(String freezeFlowNum) { + this.freezeFlowNum = freezeFlowNum; + } + + public String getFreezeStatus() { + return freezeStatus; + } + + public void setFreezeStatus(String freezeStatus) { + this.freezeStatus = freezeStatus; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getInnerAccount() { + return innerAccount; + } + + public void setInnerAccount(String innerAccount) { + this.innerAccount = innerAccount; + } + + public String getInnerAccountName() { + return innerAccountName; + } + + public void setInnerAccountName(String innerAccountName) { + this.innerAccountName = innerAccountName; + } + + public String getInputType() { + return inputType; + } + + public void setInputType(String inputType) { + this.inputType = inputType; + } + + public String getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(String isDeleted) { + this.isDeleted = isDeleted; + } + + public String getIsSaveRev() { + return isSaveRev; + } + + public void setIsSaveRev(String isSaveRev) { + this.isSaveRev = isSaveRev; + } + + public String getLastPrintTime() { + return lastPrintTime; + } + + public void setLastPrintTime(String lastPrintTime) { + this.lastPrintTime = lastPrintTime; + } + + public String getLastPrintUser() { + return lastPrintUser; + } + + public void setLastPrintUser(String lastPrintUser) { + this.lastPrintUser = lastPrintUser; + } + + public String getOperaterOrgCode() { + return operaterOrgCode; + } + + public void setOperaterOrgCode(String operaterOrgCode) { + this.operaterOrgCode = operaterOrgCode; + } + + public String getOperaterOrgCodeList() { + return operaterOrgCodeList; + } + + public void setOperaterOrgCodeList(String operaterOrgCodeList) { + this.operaterOrgCodeList = operaterOrgCodeList; + } + + public String getOperaterOrgName() { + return operaterOrgName; + } + + public void setOperaterOrgName(String operaterOrgName) { + this.operaterOrgName = operaterOrgName; + } + + public String getPayAccount() { + return payAccount; + } + + public void setPayAccount(String payAccount) { + this.payAccount = payAccount; + } + + public String getPayAccountName() { + return payAccountName; + } + + public void setPayAccountName(String payAccountName) { + this.payAccountName = payAccountName; + } + + public String getPayAccountSeq() { + return payAccountSeq; + } + + public void setPayAccountSeq(String payAccountSeq) { + this.payAccountSeq = payAccountSeq; + } + + public String getPayBankName() { + return payBankName; + } + + public void setPayBankName(String payBankName) { + this.payBankName = payBankName; + } + + public String getPayBankType() { + return payBankType; + } + + public void setPayBankType(String payBankType) { + this.payBankType = payBankType; + } + + public String getPayChannel() { + return payChannel; + } + + public void setPayChannel(String payChannel) { + this.payChannel = payChannel; + } + + public String getPayOrgCode() { + return payOrgCode; + } + + public void setPayOrgCode(String payOrgCode) { + this.payOrgCode = payOrgCode; + } + + public String getPayOrgName() { + return payOrgName; + } + + public void setPayOrgName(String payOrgName) { + this.payOrgName = payOrgName; + } + + public String getPayStatus() { + return payStatus; + } + + public void setPayStatus(String payStatus) { + this.payStatus = payStatus; + } + + public String getPaymentApplyUnionDTO() { + return paymentApplyUnionDTO; + } + + public void setPaymentApplyUnionDTO(String paymentApplyUnionDTO) { + this.paymentApplyUnionDTO = paymentApplyUnionDTO; + } + + public String getPersonalFlag() { + return personalFlag; + } + + public void setPersonalFlag(String personalFlag) { + this.personalFlag = personalFlag; + } + + public String getPrintTimes() { + return printTimes; + } + + public void setPrintTimes(String printTimes) { + this.printTimes = printTimes; + } + + public String getProcInstId() { + return procInstId; + } + + public void setProcInstId(String procInstId) { + this.procInstId = procInstId; + } + + public String getProcStatus() { + return procStatus; + } + + public void setProcStatus(String procStatus) { + this.procStatus = procStatus; + } + + public String getProjectCode() { + return projectCode; + } + + public void setProjectCode(String projectCode) { + this.projectCode = projectCode; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getRealName() { + return realName; + } + + public void setRealName(String realName) { + this.realName = realName; + } + + public String getRealRevAccount() { + return realRevAccount; + } + + public void setRealRevAccount(String realRevAccount) { + this.realRevAccount = realRevAccount; + } + + public String getRealTimeTag() { + return realTimeTag; + } + + public void setRealTimeTag(String realTimeTag) { + this.realTimeTag = realTimeTag; + } + + public String getReferenceNum() { + return referenceNum; + } + + public void setReferenceNum(String referenceNum) { + this.referenceNum = referenceNum; + } + + public String getRevAccount() { + return revAccount; + } + + public void setRevAccount(String revAccount) { + this.revAccount = revAccount; + } + + public String getRevAccountName() { + return revAccountName; + } + + public void setRevAccountName(String revAccountName) { + this.revAccountName = revAccountName; + } + + public String getRevAccountSeq() { + return revAccountSeq; + } + + public void setRevAccountSeq(String revAccountSeq) { + this.revAccountSeq = revAccountSeq; + } + + public String getRevBankArea() { + return revBankArea; + } + + public void setRevBankArea(String revBankArea) { + this.revBankArea = revBankArea; + } + + public String getRevBankName() { + return revBankName; + } + + public void setRevBankName(String revBankName) { + this.revBankName = revBankName; + } + + public String getRevBankType() { + return revBankType; + } + + public void setRevBankType(String revBankType) { + this.revBankType = revBankType; + } + + public String getRevCity() { + return revCity; + } + + public void setRevCity(String revCity) { + this.revCity = revCity; + } + + public String getRevProvince() { + return revProvince; + } + + public void setRevProvince(String revProvince) { + this.revProvince = revProvince; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getSummary() { + return summary; + } + + public void setSummary(String summary) { + this.summary = summary; + } + + public String getUnitCode() { + return unitCode; + } + + public void setUnitCode(String unitCode) { + this.unitCode = unitCode; + } + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getUrgentTag() { + return urgentTag; + } + + public void setUrgentTag(String urgentTag) { + this.urgentTag = urgentTag; + } + + public String getPayDate() { + return payDate; + } + + public void setPayDate(String payDate) { + this.payDate = payDate; + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/TransactionDetailDTO.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/TransactionDetailDTO.java new file mode 100644 index 00000000..9cd4e3cd --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/dto/res/TransactionDetailDTO.java @@ -0,0 +1,207 @@ +package com.hzya.frame.cbs8.dto.res; + +/** + * @Description 境内账户交易明细 + * @Author xiangerlin + * @Date 2023/12/29 16:40 + **/ +public class TransactionDetailDTO{ + private String accountNo;//银行账号 + private String accountName;//银行名称 + private String bankType;//银行类型 + private String openBank;//开户行名称 + private String bankTransactionDate;//交易日期 + private String bankSerialNumber;//银行流水号 + private String transactionSerialNumber;//交易流水号 + private String currency;//币种 + private String loanType;//借贷类型 + private String incurredAmount;//发生额 + private String accountBalance;//交易后余额 + private String purpose;//用途 + private String digest;//摘要 + private String oppositeAccount;//对方账号 + private String oppositeName;//对方户名 + private String oppositeOpeningBank;//对方开户行 + private String associatedCustomerNumber;//关联客户号 + private String merchantNumber;//客商编号 + private String merchantName;//客商名称 + private String transactionCode;//交易代码 + private String remark;//备注 + private String erpSerialNumber;//erp业务参考号 + + public String getAccountNo() { + return accountNo; + } + + public void setAccountNo(String accountNo) { + this.accountNo = accountNo; + } + + public String getAccountName() { + return accountName; + } + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + public String getBankType() { + return bankType; + } + + public void setBankType(String bankType) { + this.bankType = bankType; + } + + public String getOpenBank() { + return openBank; + } + + public void setOpenBank(String openBank) { + this.openBank = openBank; + } + + public String getBankTransactionDate() { + return bankTransactionDate; + } + + public void setBankTransactionDate(String bankTransactionDate) { + this.bankTransactionDate = bankTransactionDate; + } + + public String getBankSerialNumber() { + return bankSerialNumber; + } + + public void setBankSerialNumber(String bankSerialNumber) { + this.bankSerialNumber = bankSerialNumber; + } + + public String getTransactionSerialNumber() { + return transactionSerialNumber; + } + + public void setTransactionSerialNumber(String transactionSerialNumber) { + this.transactionSerialNumber = transactionSerialNumber; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getLoanType() { + return loanType; + } + + public void setLoanType(String loanType) { + this.loanType = loanType; + } + + public String getIncurredAmount() { + return incurredAmount; + } + + public void setIncurredAmount(String incurredAmount) { + this.incurredAmount = incurredAmount; + } + + public String getAccountBalance() { + return accountBalance; + } + + public void setAccountBalance(String accountBalance) { + this.accountBalance = accountBalance; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getDigest() { + return digest; + } + + public void setDigest(String digest) { + this.digest = digest; + } + + public String getOppositeAccount() { + return oppositeAccount; + } + + public void setOppositeAccount(String oppositeAccount) { + this.oppositeAccount = oppositeAccount; + } + + public String getOppositeName() { + return oppositeName; + } + + public void setOppositeName(String oppositeName) { + this.oppositeName = oppositeName; + } + + public String getOppositeOpeningBank() { + return oppositeOpeningBank; + } + + public void setOppositeOpeningBank(String oppositeOpeningBank) { + this.oppositeOpeningBank = oppositeOpeningBank; + } + + public String getAssociatedCustomerNumber() { + return associatedCustomerNumber; + } + + public void setAssociatedCustomerNumber(String associatedCustomerNumber) { + this.associatedCustomerNumber = associatedCustomerNumber; + } + + public String getMerchantNumber() { + return merchantNumber; + } + + public void setMerchantNumber(String merchantNumber) { + this.merchantNumber = merchantNumber; + } + + public String getMerchantName() { + return merchantName; + } + + public void setMerchantName(String merchantName) { + this.merchantName = merchantName; + } + + public String getTransactionCode() { + return transactionCode; + } + + public void setTransactionCode(String transactionCode) { + this.transactionCode = transactionCode; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getErpSerialNumber() { + return erpSerialNumber; + } + + public void setErpSerialNumber(String erpSerialNumber) { + this.erpSerialNumber = erpSerialNumber; + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/entity/PaymentEntity.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/entity/PaymentEntity.java new file mode 100644 index 00000000..c98cfb5f --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/entity/PaymentEntity.java @@ -0,0 +1,327 @@ +package com.hzya.frame.cbs8.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/6 16:17 + **/ +public class PaymentEntity extends BaseEntity { + + private String oaId;//主表id + private String formsonId;//明细表id + private String payCompany;//付款公司 + private String title;//流程标题 + private String tableName;//表名称 + private String billName;//单据名称 + private String referenceNum;//业务参考号 唯一id + private String referenceNumNew;//重试的时候生成新的业务参考号 + private String busType;//业务类型 + private String payResultField;//支付结果字段 + private String payDateField;//打款日期字段 + private String applyCodeField;//支付申请单号字段 + private String receiptFiled;//电子回单字段 + private String summaryId;//summaryid + private String startDate;//单据日期 + private String finishedflag;//流程状态 + private String payDate;//打款日期 + private String payResult;//支付结果 + private String applyCode;//支付申请单号 + private String payAccount;//付款账号 + private String payBankName;//付款开户银行 + private String amount;//金额 + private String purpose;//支付用途 + private String revAccount;//收款账号 + private String revBankName;//收款开户行名称 + private String revBankType;//收款银行类型 + private String revAccountName;//收款账户名称 + private String cnapsCode;//联行号 + private String receipt;//电子回单 + private String currency;//币种 数字 + private String currencyName;//币种 中文 + private String currencyCode;//币种编码 + private String personalFlag;//公私标记 + private String payType;//付款类别 + private String payCompanyCode;//付款公司编码 + + public String getOaId() { + return oaId; + } + + public void setOaId(String oaId) { + this.oaId = oaId; + } + + public String getPayCompany() { + return payCompany; + } + + public void setPayCompany(String payCompany) { + this.payCompany = payCompany; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getBillName() { + return billName; + } + + public void setBillName(String billName) { + this.billName = billName; + } + + public String getReferenceNum() { + return referenceNum; + } + + public void setReferenceNum(String referenceNum) { + this.referenceNum = referenceNum; + } + + public String getReferenceNumNew() { + return referenceNumNew; + } + + public void setReferenceNumNew(String referenceNumNew) { + this.referenceNumNew = referenceNumNew; + } + + public String getBusType() { + return busType; + } + + public void setBusType(String busType) { + this.busType = busType; + } + + public String getPayResultField() { + return payResultField; + } + + public void setPayResultField(String payResultField) { + this.payResultField = payResultField; + } + + public String getPayDateField() { + return payDateField; + } + + public void setPayDateField(String payDateField) { + this.payDateField = payDateField; + } + + public String getReceiptFiled() { + return receiptFiled; + } + + public void setReceiptFiled(String receiptFiled) { + this.receiptFiled = receiptFiled; + } + + public String getSummaryId() { + return summaryId; + } + + public void setSummaryId(String summaryId) { + this.summaryId = summaryId; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getFinishedflag() { + return finishedflag; + } + + public void setFinishedflag(String finishedflag) { + this.finishedflag = finishedflag; + } + + public String getPayDate() { + return payDate; + } + + public void setPayDate(String payDate) { + this.payDate = payDate; + } + + public String getPayResult() { + return payResult; + } + + public void setPayResult(String payResult) { + this.payResult = payResult; + } + + public String getPayAccount() { + return payAccount; + } + + public void setPayAccount(String payAccount) { + this.payAccount = payAccount; + } + + public String getPayBankName() { + return payBankName; + } + + public void setPayBankName(String payBankName) { + this.payBankName = payBankName; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getRevAccount() { + return revAccount; + } + + public void setRevAccount(String revAccount) { + this.revAccount = revAccount; + } + + public String getRevBankName() { + return revBankName; + } + + public void setRevBankName(String revBankName) { + this.revBankName = revBankName; + } + + public String getRevBankType() { + return revBankType; + } + + public void setRevBankType(String revBankType) { + this.revBankType = revBankType; + } + + public String getRevAccountName() { + return revAccountName; + } + + public void setRevAccountName(String revAccountName) { + this.revAccountName = revAccountName; + } + + public String getCnapsCode() { + return cnapsCode; + } + + public void setCnapsCode(String cnapsCode) { + this.cnapsCode = cnapsCode; + } + + public String getReceipt() { + return receipt; + } + + public void setReceipt(String receipt) { + this.receipt = receipt; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getCurrencyName() { + return currencyName; + } + + public void setCurrencyName(String currencyName) { + this.currencyName = currencyName; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public void setCurrencyCode(String currencyCode) { + this.currencyCode = currencyCode; + } + + public String getPersonalFlag() { + return personalFlag; + } + + public void setPersonalFlag(String personalFlag) { + this.personalFlag = personalFlag; + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType; + } + + public String getPayCompanyCode() { + return payCompanyCode; + } + + public void setPayCompanyCode(String payCompanyCode) { + this.payCompanyCode = payCompanyCode; + } + + public String getFormsonId() { + return formsonId; + } + + public void setFormsonId(String formsonId) { + this.formsonId = formsonId; + } + + public String getApplyCodeField() { + return applyCodeField; + } + + public void setApplyCodeField(String applyCodeField) { + this.applyCodeField = applyCodeField; + } + + public String getApplyCode() { + return applyCode; + } + + public void setApplyCode(String applyCode) { + this.applyCode = applyCode; + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/ICbs8ExtService.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/ICbs8ExtService.java new file mode 100644 index 00000000..5f47a625 --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/ICbs8ExtService.java @@ -0,0 +1,60 @@ +package com.hzya.frame.cbs8.service; + +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/7 14:20 + **/ +public interface ICbs8ExtService { + + /** + * 支付经办 + * @param entity + * @return + */ + SysExtensionApiEntity payApply(SysExtensionApiEntity entity); + + /** + * 代发代扣 支付申请 + * @param entity + * @return + */ + SysExtensionApiEntity agentPayApply(SysExtensionApiEntity entity); + + /** + * 交易结果查询 + * @param entity + * @return + */ + SysExtensionApiEntity payResult(SysExtensionApiEntity entity); + + /** + * 交易明细查询 + * @param entity + * @return + */ + SysExtensionApiEntity transactionDetailQuery(SysExtensionApiEntity entity); + /** + * 代发代扣 + * @param entity + * @return + */ + SysExtensionApiEntity payApplyAgent(SysExtensionApiEntity entity); + + /** + * 代发代扣结果查询 + * @param entity + * @return + */ + SysExtensionApiEntity payApplyAgentResult(SysExtensionApiEntity entity); + + /** + * 电子回单查询 + * @param entity + * @return + */ + SysExtensionApiEntity elecQuery(SysExtensionApiEntity entity); + +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/ICbs8Service.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/ICbs8Service.java new file mode 100644 index 00000000..9693e554 --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/ICbs8Service.java @@ -0,0 +1,65 @@ +package com.hzya.frame.cbs8.service; + +import com.hzya.frame.cbs8.dto.req.*; +import com.hzya.frame.cbs8.dto.res.*; +import com.hzya.frame.cbs8.entity.PaymentEntity; + +import java.util.List; + +/** + * @Description cbs8接口 + * @Author xiangerlin + * @Date 2024/6/6 15:30 + **/ +public interface ICbs8Service { + + /** + * 支付申请 + * @param paymentEntity + */ + PayResponseDTO payApply(PaymentEntity paymentEntity); + + /** + * 通过业务参考号查询交易结果 3.2.6 + * @param resultRequestDTO + * @return + * @throws Exception + */ + List queryPayResult(PayResultRequestDTO resultRequestDTO); + + /** + * 查询电子回单 + * @param elecRequestDTO + * startDate 开始日期 - 必填 + * endDate 结束日期 -必填 + * billStatus 回单状态 1-已取回 0-未取回 ,只有已取回的才能下载 + * settleBusinessReferenceCode 业务参考号 + * @return List + * bucketFileUrl 回单下载地址 + * billFileName 回单文件名称 + * settleBusinessReferenceCode 业务参考号 + */ + List queryElecBill(ElecRequestDTO elecRequestDTO); + + /** + * 查询交易明细 + * @param transactionDetailReqDTO + * @return + */ + CbsResDataDTO queryTransactionDetail(TransactionDetailReqDTO transactionDetailReqDTO); + + /** + * 代发代扣 支付申请 + * @param paymentApplySubmitReqDTO + * @param paymentApplyAgentList + */ + PayResponseDTO agentPayApply(PaymentApplySubmitReqDTO paymentApplySubmitReqDTO, List paymentApplyAgentList); + + /** + * 代发代扣 详情查询 + * @param agentPayResultRequestDTO + * @return + */ + AgentPayResultResDTO agentPayResult(AgentPayResultRequestDTO agentPayResultRequestDTO); + +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/impl/Cbs8ExtServiceImpl.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/impl/Cbs8ExtServiceImpl.java new file mode 100644 index 00000000..68527318 --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/impl/Cbs8ExtServiceImpl.java @@ -0,0 +1,216 @@ +package com.hzya.frame.cbs8.service.impl; + +import cn.hutool.core.convert.Convert; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.cbs8.dto.req.*; +import com.hzya.frame.cbs8.entity.PaymentEntity; +import com.hzya.frame.cbs8.service.ICbs8ExtService; +import com.hzya.frame.cbs8.util.CBSUtil; +import com.hzya.frame.cbs8.util.CbsAccessToken; +import com.hzya.frame.stringutil.StringUtil; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.web.exception.BaseSystemException; +import org.apache.http.protocol.HTTP; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import java.util.*; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/7 14:20 + **/ + +@Service(value = "cbs8Ext") +public class Cbs8ExtServiceImpl implements ICbs8ExtService { + + Logger logger = LoggerFactory.getLogger(getClass()); + /** + * 支付经办 + * + * @param entity + * @return + */ + @Override + public SysExtensionApiEntity payApply(SysExtensionApiEntity entity) { + String bodys = entity.getBodys(); + if (StrUtil.isNotEmpty(bodys)){ + PaymentEntity paymentEntity = JSONObject.parseObject(bodys,PaymentEntity.class); + if (null != paymentEntity){ + PayRequestDTO payRequestDTO = new PayRequestDTO(); + String ferenceNum = Convert.toStr(paymentEntity.getReferenceNumNew(),paymentEntity.getReferenceNum()); + payRequestDTO.setReferenceNum(ferenceNum); + payRequestDTO.setBusType(paymentEntity.getBusType()); + payRequestDTO.setAmount(paymentEntity.getAmount()); + payRequestDTO.setCurrency(paymentEntity.getCurrency()); + payRequestDTO.setPayAccount(StringUtil.replaceBlank(paymentEntity.getPayAccount())); + payRequestDTO.setRevAccount(StringUtil.replaceBlank(paymentEntity.getRevAccount())); + payRequestDTO.setRevAccountName(StringUtil.replaceBlank(paymentEntity.getRevAccountName())); + payRequestDTO.setRevBankType(StringUtil.replaceBlank((paymentEntity.getRevBankType()))); + payRequestDTO.setRevBankName(StringUtil.replaceBlank(paymentEntity.getRevBankName())); + payRequestDTO.setCnapsCode(StringUtil.replaceBlank((paymentEntity.getCnapsCode()))); + payRequestDTO.setPurpose(paymentEntity.getPurpose()); + payRequestDTO.setErpExtend1(paymentEntity.getPayType()); + //集中支付模式 + if (CBSUtil.CENTRALIZED_PAYMENT_TYPE.equals(payRequestDTO.getBusType())){ + payRequestDTO.setBusiStep("1"); + payRequestDTO.setApplyUnitCode(paymentEntity.getPayCompanyCode()); + payRequestDTO.setPayAccount(null); + } + List list = Arrays.asList(payRequestDTO); + String requestData = JSONObject.toJSONString(list); + //加密 签名 + encrypAndsign(entity,requestData); + } + } + return entity; + } + + /** + * 代发代扣 支付申请 + * + * @param entity + * @return + */ + @Override + public SysExtensionApiEntity agentPayApply(SysExtensionApiEntity entity) { + String boyds = entity.getBodys(); + if (StrUtil.isNotEmpty(boyds)){ + AgentPayRequestDTO agentPayRequest = JSONObject.parseObject(boyds,AgentPayRequestDTO.class); + String requestData = JSONObject.toJSONString(agentPayRequest); + //加密签名 + encrypAndsign(entity, requestData); + } + return entity; + } + + /** + * 交易结果查询 + * + * @param entity + * @return + */ + @Override + public SysExtensionApiEntity payResult(SysExtensionApiEntity entity) { + String bodys = entity.getBodys(); + if (StrUtil.isNotEmpty(bodys)){ + PayResultRequestDTO payResultRequest = JSONObject.parseObject(bodys,PayResultRequestDTO.class); + if (null != payResultRequest && StrUtil.isNotEmpty(payResultRequest.getReferenceNum())){ + String requestData = JSONObject.toJSONString(payResultRequest); + //加密 签名 + encrypAndsign(entity,requestData); + }else { + throw new BaseSystemException("业务参考号不能为空!!!!"); + } + } + return entity; + } + + /** + * 交易明细查询 + * + * @param entity + * @return + */ + @Override + public SysExtensionApiEntity transactionDetailQuery(SysExtensionApiEntity entity) { + String bodys = entity.getBodys(); + if (StrUtil.isNotEmpty(bodys)){ + TransactionDetailReqDTO transactionDetailReqDTO = JSONObject.parseObject(bodys,TransactionDetailReqDTO.class); + String requestData = JSONObject.toJSONString(transactionDetailReqDTO); + ////加密签名 + encrypAndsign(entity, requestData); + } + return entity; + } + + /** + * 代发代扣 + * + * @param entity + * @return + */ + @Override + public SysExtensionApiEntity payApplyAgent(SysExtensionApiEntity entity) { + String bodys = entity.getBodys(); + if (StrUtil.isNotEmpty(bodys)){ + AgentPayRequestDTO agentPayRequest = JSONObject.parseObject(bodys,AgentPayRequestDTO.class); + String requestData = JSONObject.toJSONString(agentPayRequest); + ////加密签名 + encrypAndsign(entity, requestData); + } + return entity; + } + + + + /** + * 代发代扣结果查询 + * + * @param entity + * @return + */ + @Override + public SysExtensionApiEntity payApplyAgentResult(SysExtensionApiEntity entity) { + String bodys = entity.getBodys(); + if (StrUtil.isNotEmpty(bodys)){ + AgentPayResultRequestDTO agentPayResultRequestDTO = JSONObject.parseObject(bodys,AgentPayResultRequestDTO.class); + String requestData = JSONObject.toJSONString(agentPayResultRequestDTO); + encrypAndsign(entity,requestData); + } + return entity; + } + + /** + * 电子回单查询 + * + * @param entity + * @return + */ + @Override + public SysExtensionApiEntity elecQuery(SysExtensionApiEntity entity) { + String bodys = entity.getBodys(); + if (StrUtil.isNotEmpty(bodys)){ + ElecRequestDTO elecRequestDTO = JSONObject.parseObject(bodys,ElecRequestDTO.class); + String requestData = JSONObject.toJSONString(elecRequestDTO); + //加密 签名 + encrypAndsign(entity,requestData); + } + return entity; + } + + + /** + * 请求头 + * @param sign + * @param timestamp + * @return + */ + private Map headersValueOf(String sign, long timestamp){ + Map header = new HashMap(); + header.put(CBSUtil.SIGN_HEADER_NAME,sign); + header.put(CBSUtil.TIMESTAMP_HEADER,Long.toString(timestamp)); + header.put(HTTP.CONTENT_TYPE,CBSUtil.TARGET_CONTENT_TYPE); + header.put(CBSUtil.AUTHORIZATION,CBSUtil.BEARER+ CbsAccessToken.getToken()); + return header; + } + + /** + * 加密 签名 + * @param entity 接口转发参数对象 + * @param requestData 请求参数json字符串 + */ + private void encrypAndsign(SysExtensionApiEntity entity, String requestData) { + //签名 + long timestamp = System.currentTimeMillis(); + logger.info("CBS请求参数明文:{}",requestData); + String sign = CBSUtil.sign(requestData,timestamp); + //加密 + byte[] encryptedData = CBSUtil.encrypt(requestData); + Map header = headersValueOf(sign,timestamp); + entity.setByteBodys(encryptedData); + entity.setHeaders(header); + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/impl/Cbs8ServiceImpl.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/impl/Cbs8ServiceImpl.java new file mode 100644 index 00000000..8949397e --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/impl/Cbs8ServiceImpl.java @@ -0,0 +1,269 @@ +package com.hzya.frame.cbs8.service.impl; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.map.MapBuilder; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.hzya.frame.cbs8.dto.req.*; +import com.hzya.frame.cbs8.dto.res.*; +import com.hzya.frame.cbs8.entity.PaymentEntity; +import com.hzya.frame.cbs8.service.ICbs8Service; +import com.hzya.frame.cbs8.util.CBSUtil; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.commons.collections.CollectionUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Base64; +import java.util.List; +import java.util.Map; + +/** + * @Description cbs8接口 + * @Author xiangerlin + * @Date 2024/6/7 14:44 + **/ +@Service +public class Cbs8ServiceImpl implements ICbs8Service { + Logger logger = LoggerFactory.getLogger(getClass()); + + @Override + public PayResponseDTO payApply(PaymentEntity paymentEntity) { + Map headerMap = MapBuilder.create(true) + .put("apiCode", "8000260001") + .put("publicKey","ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj") + .put("secretKey","7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") + .put("appId","800026") + .build(); + String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfaceToESB").addHeaders(headerMap).body(JSONObject.toJSONString(paymentEntity)).timeout(60000).execute().body(); + //解密响应报文 + String result = decryptResBody(body); + if (StrUtil.isNotEmpty(result)){ + CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class); + List dataList = cbsResponseDTO.getData(); + if (CollectionUtils.isNotEmpty(dataList)){ + JSONObject o = dataList.get(0); + PayResponseDTO payResponseDTO = JSON.toJavaObject(o, PayResponseDTO.class); + return payResponseDTO; + } + } + return new PayResponseDTO(); + } + + /** + * 通过业务参考号查询交易结果 3.2.6 + * + * @param resultRequestDTO + * @return + * @throws Exception + */ + @Override + public List queryPayResult(PayResultRequestDTO resultRequestDTO) { + Map headerMap = MapBuilder.create(true) + .put("apiCode", "8000260002") + .put("publicKey","ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj") + .put("secretKey","7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") + .put("appId","800026") + .build(); + String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfaceToESB").addHeaders(headerMap).body(JSONObject.toJSONString(resultRequestDTO)).timeout(60000).execute().body(); + String result = decryptResBody(body); + CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class); + if (CollectionUtils.isNotEmpty(cbsResponseDTO.getData())){ + List dataList = cbsResponseDTO.getData(); + List payResultList = CBSUtil.convertJsonArrayToList(dataList, PayResultResDTO.class); + return payResultList; + } + return new ArrayList(); + } + + /** + * 查询电子回单 + * + * @param elecRequestDTO startDate 开始日期 - 必填 + * endDate 结束日期 -必填 + * billStatus 回单状态 1-已取回 0-未取回 ,只有已取回的才能下载 + * settleBusinessReferenceCode 业务参考号 + * @return List + * bucketFileUrl 回单下载地址 + * billFileName 回单文件名称 + * settleBusinessReferenceCode 业务参考号 + */ + @Override + public List queryElecBill(ElecRequestDTO elecRequestDTO) { + if (null == elecRequestDTO){ + elecRequestDTO = new ElecRequestDTO(); + } + if (StrUtil.isEmpty(elecRequestDTO.getStartDate())){ + elecRequestDTO.setStartDate(DateUtil.today()); + } + if (StrUtil.isEmpty(elecRequestDTO.getEndDate())){ + elecRequestDTO.setEndDate(DateUtil.today()); + } + String params = JSON.toJSONString(elecRequestDTO, SerializerFeature.WRITE_MAP_NULL_FEATURES, SerializerFeature.QuoteFieldNames); + logger.info("电子回单查询请求参数为:{}", params); + Map headerMap = MapBuilder.create(true) + .put("apiCode", "8000260005") + .put("publicKey","ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj") + .put("secretKey","7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") + .put("appId","800026") + .build(); + String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfaceToESB").addHeaders(headerMap).body(params).timeout(60000).execute().body(); + String result = decryptResBody(body); + if (StrUtil.isNotEmpty(result)){ + CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class); + if (null != cbsResponseDTO){ + if (CollectionUtils.isNotEmpty(cbsResponseDTO.getData())){ + List dataList = cbsResponseDTO.getData(); + if (CollectionUtils.isNotEmpty(dataList)){ + JSONObject jsonObject = dataList.get(0); + CbsResDataDTO dataDTO = JSON.toJavaObject(jsonObject, CbsResDataDTO.class); + List elecResponseDTOList = CBSUtil.convertJsonArrayToList(dataDTO.getList(), ElecResponseDTO.class); + return elecResponseDTOList; + } + } + } + } + return null; + } + + /** + * 查询交易明细 + * + * @param transactionDetailReqDTO + * @return + */ + @Override + public CbsResDataDTO queryTransactionDetail(TransactionDetailReqDTO transactionDetailReqDTO) { + //页码 + int currentPage = transactionDetailReqDTO.getCurrentPage(); + //每页条数 + int pageSize = transactionDetailReqDTO.getPageSize(); + if (currentPage == 0){ + currentPage = CBSUtil.DEFAULT_CURRENT_PAGE; + transactionDetailReqDTO.setCurrentPage(currentPage);//页码 + } + if (pageSize == 0){ + pageSize = CBSUtil.DEFAULT_PAGE_SIZE; + transactionDetailReqDTO.setPageSize(pageSize); + } + if (StrUtil.isNotEmpty(transactionDetailReqDTO.getStartDate())){ + transactionDetailReqDTO.setStartDate(DateUtil.today()); + } + if (StrUtil.isNotEmpty(transactionDetailReqDTO.getEndDate())){ + transactionDetailReqDTO.setEndDate(DateUtil.today()); + } + String params = JSON.toJSONString(transactionDetailReqDTO); + Map headerMap = MapBuilder.create(true) + .put("apiCode", "8000260006") + .put("publicKey","ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj") + .put("secretKey","7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") + .put("appId","800026") + .build(); + String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfaceToESB").addHeaders(headerMap).body(params).timeout(60000).execute().body(); + String result = decryptResBody(body); + if (StrUtil.isNotEmpty(result)){ + CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class); + if (null != cbsResponseDTO){ + if (CollectionUtils.isNotEmpty(cbsResponseDTO.getData())){ + List list = cbsResponseDTO.getData(); + if (CollectionUtils.isNotEmpty(list)){ + JSONObject jsonObject = list.get(0); + CbsResDataDTO dataDTO = JSON.toJavaObject(jsonObject, CbsResDataDTO.class); + return dataDTO; + } + } + } + } + return new CbsResDataDTO(); + } + + /** + * 代发代扣 支付申请 + * @param paymentApplySubmitReqDTO + * @param paymentApplyAgentList + */ + @Override + public PayResponseDTO agentPayApply(PaymentApplySubmitReqDTO paymentApplySubmitReqDTO, List paymentApplyAgentList) { + AgentPayRequestDTO param = new AgentPayRequestDTO(); + param.setPaymentApplySubmitReqDTO(paymentApplySubmitReqDTO); + param.setPaymentApplyAgentDTO(paymentApplyAgentList); + String params = JSON.toJSONString(param); + Map headerMap = MapBuilder.create(true) + .put("apiCode", "8000260003") + .put("publicKey","ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj") + .put("secretKey","7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") + .put("appId","800026") + .build(); + String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfaceToESB").addHeaders(headerMap).body(params).timeout(60000).execute().body(); + String result = decryptResBody(body); + if (StrUtil.isNotEmpty(result)){ + CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class); + List dataList = cbsResponseDTO.getData(); + if (CollectionUtils.isNotEmpty(dataList)){ + JSONObject o = dataList.get(0); + PayResponseDTO payResponseDTO = JSON.toJavaObject(o, PayResponseDTO.class); + return payResponseDTO; + } + } + return new PayResponseDTO(); + } + + /** + * 代发代扣 详情查询 + * + * @param agentPayResultRequestDTO + * @return + */ + @Override + public AgentPayResultResDTO agentPayResult(AgentPayResultRequestDTO agentPayResultRequestDTO) { + Map headerMap = MapBuilder.create(true) + .put("apiCode", "8000260004")//数智办公 + .put("publicKey","ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj")//数智财资 + .put("secretKey","7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") + .put("appId","800026") + .build(); + String params = JSON.toJSONString(agentPayResultRequestDTO); + String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfaceToESB").addHeaders(headerMap).body(params).timeout(60000).execute().body(); + //解密报文 + String result = decryptResBody(body); + if (StrUtil.isNotEmpty(result)){ + CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class); + List dataList = cbsResponseDTO.getData(); + if (CollectionUtils.isNotEmpty(dataList)){ + JSONObject o = dataList.get(0); + AgentPayResultResDTO agentPayResultResDTO = JSON.toJavaObject(o, AgentPayResultResDTO.class); + return agentPayResultResDTO; + } + } + return new AgentPayResultResDTO(); + } + + /** + * 解密响应报文 + * @param body + * @return + */ + private String decryptResBody(String body){ + if (StrUtil.isNotEmpty(body)){ + JsonResultEntity resultEntity = JSONObject.parseObject(body,JsonResultEntity.class); + String bodyBase64 = String.valueOf(resultEntity.getAttribute()); + byte[] bodyBytes = Base64.getDecoder().decode(bodyBase64); + //这里验证一下,如果系统异常 返回的报文没加密 + String test = new String(bodyBytes); + if (JSONUtil.isTypeJSON(test)){ + return test; + } + //解密报文 + String result = CBSUtil.decrypt(bodyBytes); + logger.info("银行响应参数:{}",result); + return result; + } + return null; + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/util/CBSUtil.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/util/CBSUtil.java new file mode 100644 index 00000000..602a9124 --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/util/CBSUtil.java @@ -0,0 +1,187 @@ +package com.hzya.frame.cbs8.util; + +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; +import org.apache.commons.codec.binary.Base64; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import java.nio.charset.StandardCharsets; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/7 15:38 + **/ +@Component +public class CBSUtil { + /** + * 集中支付模式 + */ + public static final String CENTRALIZED_PAYMENT_TYPE = "401"; + /** + * 分页查询 最大条数 + */ + public static final int MAX_PAGE_SIZE = 1000; + /** + * 默认分页查询条数 + */ + public static final int DEFAULT_PAGE_SIZE = 100; + /** + * 默认页码 + */ + public static final int DEFAULT_CURRENT_PAGE = 1; + static Logger logger = LogManager.getLogger(CBSUtil.class); + + /** + * 请求参数格式 + */ + public static String TARGET_CONTENT_TYPE = "application/json"; + + /** + * 签名请求头参数名 + */ + public static String SIGN_HEADER_NAME = "X-MBCLOUD-API-SIGN"; + /** + * 时间戳请求头参数名 + */ + public static String TIMESTAMP_HEADER = "X-MBCLOUD-TIMESTAMP"; + + public static String ENCRYPTION_ENABLED_HEADER_NAME = "X-MBCLOUD-ENCRYPTION-ENABLED"; + + public static String X_MBCLOUD_COMPRESS = "X-Mbcloud-Compress"; + + /** + * 请求头token参数名 + */ + public static String AUTHORIZATION = "Authorization"; + + /** + *token前缀 + */ + public static String BEARER = "Bearer "; + + /** + * 财资管理云公钥(平台公钥) + */ + public static String bodyEncryptionKey; + + /** + * 企业私钥(加密) + */ + public static String signEncryptionPrivateKey; + + /** + * 企业私钥(解密) + */ + public static String bodyDecryptionKey; + + /** + * 财资管理云公钥(平台公钥) + */ + @Value("${cbs8.cbs_public_key:}") + public void setBodyEncryptionKey(String bodyEncryptionKey) { + CBSUtil.bodyEncryptionKey = bodyEncryptionKey; + } + /** + * 企业私钥(解密) + */ + @Value("${cbs8.ya_private_key:}") + public void setSignEncryptionPrivateKey(String signEncryptionPrivateKey) { + CBSUtil.signEncryptionPrivateKey = signEncryptionPrivateKey; + } + /** + * 企业私钥(解密) + */ + @Value("${cbs8.ya_private_key:}") + public void setBodyDecryptionKey(String bodyDecryptionKey) { + CBSUtil.bodyDecryptionKey = bodyDecryptionKey; + } + + //将json数组转为list + public static List convertJsonArrayToList(List list, Class clazz) { + String jsonArray = JSON.toJSONString(list); + List result = JSON.parseObject(jsonArray, new TypeReference>(clazz) {}); + return result; + } + + /** + * 将时间戳转换成日期字符串 + * @param timestamp + * @return + */ + public static String convertTimestampToString(String timestamp) { + if (StrUtil.isNotEmpty(timestamp) && NumberUtil.isNumber(timestamp)){ + // 创建SimpleDateFormat对象,指定日期时间格式 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + // 将时间戳转换为Date对象 + Date date = new Date(Long.valueOf(timestamp)); + + // 使用SimpleDateFormat格式化Date对象,得到字符串表示 + return sdf.format(date); + } + return null; + } + + /** + * 签名 + * @param requestData + * @return + */ + public static String sign(String requestData){ + long timestamp = System.currentTimeMillis(); + return sign(requestData,timestamp); + } + + /** + * 签名 + * @param requestData + * @param timestamp + * @return + */ + public static String sign(String requestData,long timestamp){ + + // 请求数据拼接: 报文体+时间戳 + byte[] requestDataBytes = requestData.getBytes(StandardCharsets.UTF_8); + byte[] timestampBytes = ("×tamp=" + timestamp).getBytes(StandardCharsets.UTF_8); + byte[] newBytes = new byte[requestDataBytes.length + timestampBytes.length]; + System.arraycopy(requestDataBytes, 0, newBytes, 0, requestDataBytes.length); + System.arraycopy(timestampBytes, 0, newBytes, requestDataBytes.length, timestampBytes.length); + + // 生成签名 + byte[] signature = SM2Util.sign(signEncryptionPrivateKey, newBytes); + String sign = Base64.encodeBase64String(SM2Util.encodeDERSignature(signature)); + logger.info("签名:{}", sign); + return sign; + } + + /** + * 加密 + * @param requestData + * @return + */ + public static byte[] encrypt(String requestData){ + byte[] encrypt = SM2Util.encrypt(bodyEncryptionKey, requestData.getBytes(StandardCharsets.UTF_8)); + return encrypt; + } + + public static String decrypt(byte[] cipherData){ + try { + byte[] decrypt = SM2Util.decrypt(bodyDecryptionKey, cipherData); + String text = new String(decrypt); + return text; + }catch (Exception e){ + logger.error("解密失败",e); + e.printStackTrace(); + } + return null; + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/util/CbsAccessToken.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/util/CbsAccessToken.java new file mode 100644 index 00000000..341af450 --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/util/CbsAccessToken.java @@ -0,0 +1,140 @@ +package com.hzya.frame.cbs8.util; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.web.action.ApplicationContextUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.data.relational.core.sql.In; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import java.util.HashMap; +import java.util.Map; + +/** + * @Description cbs token + * @Author xiangerlin + * @Date 2024/6/7 15:56 + **/ +@Component +public class CbsAccessToken { + + private static final Logger logger = LoggerFactory.getLogger(CbsAccessToken.class); + @Value("${cbs8.appId:}") + private String app_id; + @Value("${cbs8.appSecret:}") + private String app_secret; + @Value("${cbs8.url:}") + private String app_url; + + private static String appId; + private static String appSecret; + private static String url; + @PostConstruct + public void init() { + appId = app_id; + appSecret = app_secret; + url = app_url; + } + //刷新token用 + private static final String BEARER = "Bearer "; + /** + * 过期时间 + */ + private Long expiryTime ; + private String token; + + private CbsAccessToken(){ + + } + private static CbsAccessToken cbsAccessToken = new CbsAccessToken(); + + + public static CbsAccessToken getInstance() { + if (null == cbsAccessToken.token){ + initToken(); + }else { + //判断token有没有过期 + if (System.currentTimeMillis() >= cbsAccessToken.expiryTime){ + initToken(); + }else { + refreshToken(); + } + } + return cbsAccessToken; + } + + public static String getToken(){ + return getInstance().token; + } + /** + * 获取token + */ + private static void initToken(){ + CbsAccessToken ct = (CbsAccessToken) ApplicationContextUtil.getBeanByName("cbsAccessToken"); + logger.info("开始获取cbstoken"); + Map param = new HashMap<>(); + param.put("app_id",ct.appId); + param.put("app_secret",ct.appSecret); + param.put("grant_type","client_credentials"); + String res = HttpRequest.post(ct.url+"/openapi/app/v1/app/token").body(JSONObject.toJSONString(param)).execute().body(); + logger.info("获取cbstoken结果",res); + if (StrUtil.isNotEmpty(res) && JSONUtil.isTypeJSON(res)){ + JSONObject tokenObject = JSONObject.parseObject(res); + String code = tokenObject.getString("code");//0表示成功 + if ("0".equals(code)){ + JSONObject dataObj = tokenObject.getJSONObject("data"); + if (null != dataObj){ + String token = dataObj.getString("token"); + //过期时间 单位是秒 30分钟有效 + Integer expires = dataObj.getInteger("expires"); + cbsAccessToken.token = token; + //提前5分钟让token失效 所以这里设置成过期时间为当前时间+25分钟 + cbsAccessToken.expiryTime = System.currentTimeMillis()+1000*60*25L; + } + } + } + } + + /** + * 刷新token + */ + private static void refreshToken(){ + CbsAccessToken ct = (CbsAccessToken) ApplicationContextUtil.getBeanByName("cbsAccessToken"); + //token不为空,并且没过期 刷新token + if (null != cbsAccessToken.token && System.currentTimeMillis() < cbsAccessToken.expiryTime ){ + String res = HttpRequest.get(ct.url + "/openapi/app/v1/app/refresh-token").header("Authorization", BEARER + cbsAccessToken.token).execute().body(); + logger.info("刷新cbstoken结果",res); + if (StrUtil.isNotEmpty(res) && JSONUtil.isTypeJSON(res)){ + JSONObject tokenObject = JSONObject.parseObject(res); + String code = tokenObject.getString("code");//0表示成功 + if ("0".equals(code)){ + JSONObject dataObj = tokenObject.getJSONObject("data"); + if (null != dataObj){ + //续期的token + String token = dataObj.getString("token"); + //新token过期时间 单位是秒 30分钟有效 + Integer expires = dataObj.getInteger("expires"); + cbsAccessToken.token = token; + //提前5分钟让token失效 所以这里设置成过期时间为当前时间+25分钟 + cbsAccessToken.expiryTime = System.currentTimeMillis()+1000*60*25L; + } + }else { + initToken(); + } + } + }else { + initToken(); + } + } + + public static void main(String[] args) { + System.out.println("第1次取token:"+getToken()); + System.out.println("第2次取token:"+getToken()); + System.out.println("第3次取token:"+getToken()); + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/util/CurrencyEnum.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/util/CurrencyEnum.java new file mode 100644 index 00000000..abde767c --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/util/CurrencyEnum.java @@ -0,0 +1,137 @@ +package com.hzya.frame.cbs8.util; + +/** + * @Description 币种枚举表 + * @Author xiangerlin + * @Date 2024/6/25 10:20 + **/ +public enum CurrencyEnum { + + CNY("10", "人民币", "CNY", "¥"), + ASF("11", "记帐瑞士法朗", "ASF", "ASF"), + BRL("12", "巴西里亚尔", "BRL", "BRL"), + IDR("13", "印度尼西亚卢比", "IDR", "rps"), + INR("14", "印度卢比", "INR", "rs"), + IRR("15", "伊朗里亚尔", "IRR", "ri"), + JOD("16", "约旦第纳尔", "JOD", "jdr"), + KRW("17", "韩国圆", "KRW", "$"), + KWD("18", "科威特第纳尔", "KWD", "kd"), + MOP("19", "澳门元", "MOP", "pat"), + MXN("20", "墨西哥比索", "MXN", "mex$"), + HKD("21", "港币", "HKD", "HK$"), + MYR("22", "马来西亚林吉特", "MYR", "m$"), + NPR("23", "尼泊尔卢比", "NPR", "nrs"), + NZD("24", "新西兰元", "NZD", "$nz"), + PHP("25", "菲律宾比索", "PHP", "phil"), + PKR("26", "巴基斯坦卢比", "PKR", "prs"), + RUB("27", "俄罗斯卢布", "RUB", "RUB"), + AUD("29", "澳元", "AUD", "A$"), + THB("30", "泰国铢", "THB", "bt"), + TWD("31", "台湾元", "TWD", "$"), + USD("32", "美元", "USD", "US$"), + TZS("33", "坦桑尼亚先令", "TZS", "tsh"), + EUR("35", "欧元", "EUR", "EUR"), + CAD("39", "加拿大元", "CAD", "CAN$"), + GBP("43", "英镑", "GBP", "£"), + JPY("65", "日元", "JPY", "J"), + SGD("69", "新加坡元", "SGD", "S$"), + NOK("83", "挪威克朗", "NOK", "nkr"), + DKK("85", "丹麦克朗", "DKK", "DKr"), + AED("86", "阿联酋迪拉姆", "AED", "AED"), + CHF("87", "瑞士法朗", "CHF", "SF"), + SEK("88", "瑞典克朗", "SEK", "SKR"), + ZAR("89", "南非兰特", "ZAR", "ZAR"), + AOA("71", "安哥拉宽扎", "AOA", "kz"), + DZD("72", "阿尔及利亚第纳尔", "DZD", "AD."), + GHS("73", "塞地", "GHS", "¢"), + KES("74", "肯尼亚先令", "KES", "K.Sh"), + NGN("75", "奈拉", "NGN", "N"), + QAR("76", "卡塔尔里亚尔", "QAR", "QR."), + VND("77", "越南盾", "VND", "D."), + PES("78", "新索尔", "PES", "S/."), + PLZ("79", "兹罗提", "PLZ", "ZL."), + TRY("80", "土耳其镑", "TRY", "£T."), + SAR("81", "亚尔", "SAR", "SAR."), + KZT("82", "哈萨克斯坦腾格", "KZT", "〒"), + CDF("90", "刚果法郎", "CDF", "FC"), + LYD("91", "利比亚第纳尔", "LYD", "LD."), + EGP("92", "埃及镑", "EGP", "£E."), + VEF("93", "委内瑞拉玻利瓦尔", "VEF", "B"), + OMR("94", "阿曼里尔", "OMR", "RO."), + PLN("95", "波兰兹罗提", "PLN", "Zl"), + HUF("96", "匈牙利福林", "HUF", "Ft"), + BDT("97", "孟加拉塔卡", "BDT", "TK"), + LAK("98", "老挝基普", "LAK", "K"), + ZMW("37", "赞比亚克瓦查", "ZMW", "ZM"), + ETB("28", "埃塞俄比亚比尔", "ETB", "Br"), + PRK("34", "巴基斯坦卢比", "PRK", "Rs."), + BND("36", "文莱元", "BND", "B$"), + XOF("38", "西非法郎", "XOF", "XOF"), + PGK("41", "巴布亚新几内亚基纳", "PGK", "PGK"), + LKR("40", "斯里兰卡卢比", "LKR", "LK"), + GNF("46", "几内亚法郎", "GNF", "GNF"), + TND("42", "突尼斯第纳尔", "TND", "TN"), + UZS("44", "乌兹别克斯坦苏姆", "UZS", "UZ"), + XAF("45", "中非法郎", "XAF", "XA"), + SDG("49", "苏丹磅", "SDG", "£S"), + GE("47", "格鲁吉亚拉里", "GEL", "GE"), + MN("48", "蒙图", "MNT", "MN"), + TJS("50", "塔吉克索莫尼", "TJS", "TJS"), + UGX("51", "乌干达先令", "UGX", "UGX"), + CLP("52", "智利比索", "CLP", "CLP"), + MMK("53", "缅元", "MMK", "MMK"), + KHR("54", "柬埔寨瑞尔", "KHR", "KHR"), + BHD("55", "巴林第纳尔", "BHD", "BHD"), + RSD("56", "塞尔维亚第纳尔", "RSD", "RSD"), + KGS("57", "吉尔吉斯斯坦索姆", "KGS", "KGS"), + COP("58", "哥伦比亚比索", "COP", "COP"), + GYD("59", "圭亚那元", "GYD", "GYD"), + ARS("60", "阿根廷比索", "ARS", "ARS"), + CZK("61", "捷克克朗", "CZK", "CZK"), + PEN("62", "秘鲁索尔", "PEN", "PEN"), + RON("63", "罗马尼亚列伊", "RON", "RON"), + UAH("64", "乌克兰格里夫纳", "UAH", "UAH"), + ILS("66", "以色列新谢克尔", "ILS", "ILS"), + IQD("67", "伊拉克第纳尔", "IQD", "IQD"), + ERN("68", "厄立特里亚纳克法", "ERN", "ERN"), + CNH("84", "离岸人民币", "CNH", "CNH"), + MKD("99", "马其顿第纳尔", "MKD", "MKD"); + + private final String code; + private final String chineseName; + private final String internationalCode; + private final String symbol; + + CurrencyEnum(String code, String chineseName, String internationalCode, String symbol) { + this.code = code; + this.chineseName = chineseName; + this.internationalCode = internationalCode; + this.symbol = symbol; + } + + public String getCode() { + return code; + } + + public String getChineseName() { + return chineseName; + } + + public String getInternationalCode() { + return internationalCode; + } + + public String getSymbol() { + return symbol; + } + + //根据币种code获取币种中文名 + public static String getChineseNameByCode(String code) { + for (CurrencyEnum currency : values()) { + if (currency.code.equals(code)) { + return currency.chineseName; + } + } + return null; // 或者抛出异常,表示找不到对应的币种 + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/util/PayState.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/util/PayState.java new file mode 100644 index 00000000..0ab494c7 --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/util/PayState.java @@ -0,0 +1,73 @@ +package com.hzya.frame.cbs8.util; + +/** + * @Author:hecan + * @Description:支付类型(支付状态) + * @params: + * @return: + * @Date: 2023/3/14 15:05 + */ +public enum PayState { + a("a","待提交直联"), + b("b","已提交直联"), + c("c","银行已受理"), + d("d","银行未受理"), + e("e","可疑"), + f("f","待人工确认"), + g("g","支付成功"), + h("h","支付失败"), + i("i","部分成功"), + j("j","退票"), + k("k","取消支付"), + n("n","其他"), + p("p","支付中"), + q("q","待支付"), + one("1","待处理"), + two("2","审批中"), + three("3","处理失败"), + four("4","审批完成"), + five("5","审批撤销"), + six("6","审批拒绝"), + seven("7","待发送审批"), + eight("8","集中受理中"), + nine("9","审批退回"), + ten("10","预处理中"), + eleven("11","预处理拒绝"), + twelve("12","资金监控审批中"); + + + //类型 + private String type; + //值 + private String value; + + PayState(String type, String value){ + this.type=type; + this.value=value; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public static String payStateGetValue(String type){ + for (PayState payState : PayState.values()){ + if(payState.getType()==type||payState.getType().equals(type)){ + return payState.getValue().toString(); + } + } + return null; + } +} diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/util/SM2Util.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/util/SM2Util.java new file mode 100644 index 00000000..46b20936 --- /dev/null +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/util/SM2Util.java @@ -0,0 +1,237 @@ +package com.hzya.frame.cbs8.util; + +import org.bouncycastle.asn1.*; +import org.bouncycastle.crypto.engines.SM2Engine; +import org.bouncycastle.crypto.params.*; +import org.bouncycastle.crypto.signers.SM2Signer; +import org.bouncycastle.jce.ECNamedCurveTable; +import org.bouncycastle.jce.spec.ECParameterSpec; +import org.bouncycastle.math.ec.ECCurve; +import org.bouncycastle.math.ec.ECPoint; +import org.bouncycastle.util.encoders.Hex; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import java.io.ByteArrayInputStream; +import java.math.BigInteger; +import java.nio.charset.StandardCharsets; +import java.security.SecureRandom; +import java.util.Base64; +import java.util.Enumeration; + +/** + * @author: xiang2lin + * @time: 2024/6/14 + * @description: SM2加解密工具类 + */ + +public class SM2Util { + static Logger logger = LoggerFactory.getLogger(SM2Util.class); + private SM2Util() { + throw new IllegalStateException("Utility class"); + } + + private static final String STD_NAME = "sm2p256v1"; + + /** + * SM2加密算法 + * + * @param publicKey 公钥 + * @param data 明文数据 + * @return + */ + public static byte[] encrypt(String publicKey, byte[] data) { + ECPublicKeyParameters ecPublicKeyParameters = encodePublicKey(Hex.decode(publicKey)); + SM2Engine engine = new SM2Engine(); + engine.init(true, new ParametersWithRandom(ecPublicKeyParameters, new SecureRandom())); + + byte[] bytes = null; + try { + byte[] cipherText = engine.processBlock(data, 0, data.length); + bytes = C1C2C3ToC1C3C2(cipherText); + } catch (Exception e) { + logger.warn("SM2加密时出现异常:" + e.getMessage()); + } + return bytes; + } + + /** + * SM2解密算法 + * + * @param privateKey 私钥 + * @param cipherData 密文数据 + * @return + */ + public static byte[] decrypt(String privateKey, byte[] cipherData) { + ECPrivateKeyParameters ecPrivateKeyParameters = encodePrivateKey(Hex.decode(privateKey)); + SM2Engine engine = new SM2Engine(); + engine.init(false, ecPrivateKeyParameters); + + byte[] bytes = null; + try { + cipherData = C1C3C2ToC1C2C3(cipherData); + bytes = engine.processBlock(cipherData, 0, cipherData.length); + } catch (Exception e) { + logger.warn("SM2解密时出现异常:" + e.getMessage()); + } + return bytes; + } + + /** + * 签名算法 + * + * @param privateKey 私钥 + * @param data 明文数据 + * @return + */ + public static byte[] sign(String privateKey, byte[] data) { + ECPrivateKeyParameters ecPrivateKeyParameters = encodePrivateKey(hexToByte(privateKey)); + SM2Signer signer = new SM2Signer(); + ParametersWithID parameters = new ParametersWithID(ecPrivateKeyParameters, "1234567812345678".getBytes()); + signer.init(true, parameters); + signer.update(data, 0, data.length); + + byte[] signature = null; + try { + signature = decodeDERSignature(signer.generateSignature()); + } catch (Exception e) { + logger.warn("SM2签名时出现异常:" + e.getMessage()); + } + return signature; + } + + private static byte[] hexToByte(String hex) + throws IllegalArgumentException { + if (hex.length() % 2 != 0) { + throw new IllegalArgumentException(); + } + char[] arr = hex.toCharArray(); + byte[] b = new byte[hex.length() / 2]; + for (int i = 0, j = 0, l = hex.length(); i < l; i++, j++) { + String swap = "" + arr[i++] + arr[i]; + int byteInt = Integer.parseInt(swap, 16) & 0xFF; + b[j] = BigInteger.valueOf(byteInt).byteValue(); + } + return b; + } + + private static byte[] C1C2C3ToC1C3C2(byte[] cipherText) throws Exception { + if (cipherText != null && cipherText.length >= 97) { + byte[] bytes = new byte[cipherText.length]; + System.arraycopy(cipherText, 0, bytes, 0, 65); + System.arraycopy(cipherText, cipherText.length - 32, bytes, 65, 32); + System.arraycopy(cipherText, 65, bytes, 97, cipherText.length - 97); + return bytes; + } else { + throw new Exception("SM2 cipher text error, must be more than 96 bytes and in the format C1||C3||C2."); + } + } + + private static byte[] C1C3C2ToC1C2C3(byte[] cipherText) throws Exception { + if (cipherText != null && cipherText.length >= 97) { + byte[] bytes = new byte[cipherText.length]; + System.arraycopy(cipherText, 0, bytes, 0, 65); + System.arraycopy(cipherText, 97, bytes, 65, cipherText.length - 97); + System.arraycopy(cipherText, 65, bytes, cipherText.length - 32, 32); + return bytes; + } else { + throw new Exception("SM2 cipher text error, must be more than 96 bytes and in the format C1||C3||C2."); + } + } + + private static ECPublicKeyParameters encodePublicKey(byte[] value) { + byte[] x = new byte[32]; + byte[] y = new byte[32]; + System.arraycopy(value, 1, x, 0, 32); + System.arraycopy(value, 33, y, 0, 32); + BigInteger X = new BigInteger(1, x); + BigInteger Y = new BigInteger(1, y); + ECPoint Q = getSM2Curve().createPoint(X, Y); + return new ECPublicKeyParameters(Q, getECDomainParameters()); + } + + private static ECCurve getSM2Curve() { + ECParameterSpec spec = ECNamedCurveTable.getParameterSpec(STD_NAME); + return spec.getCurve(); + } + + private static ECPrivateKeyParameters encodePrivateKey(byte[] value) { + BigInteger d = new BigInteger(1, value); + return new ECPrivateKeyParameters(d, getECDomainParameters()); + } + + private static ECDomainParameters getECDomainParameters() { + ECParameterSpec spec = ECNamedCurveTable.getParameterSpec(STD_NAME); + return new ECDomainParameters(spec.getCurve(), spec.getG(), spec.getN(), spec.getH(), spec.getSeed()); + } + + private static byte[] decodeDERSignature(byte[] signature) { + ASN1InputStream stream = new ASN1InputStream(new ByteArrayInputStream(signature)); + + byte[] bytes = new byte[64]; + try { + ASN1Sequence primitive = (ASN1Sequence) stream.readObject(); + Enumeration enumeration = primitive.getObjects(); + BigInteger R = ((ASN1Integer) enumeration.nextElement()).getValue(); + BigInteger S = ((ASN1Integer) enumeration.nextElement()).getValue(); + byte[] r = format(R.toByteArray()); + byte[] s = format(S.toByteArray()); + System.arraycopy(r, 0, bytes, 0, 32); + System.arraycopy(s, 0, bytes, 32, 32); + } catch (Exception e) { + logger.warn("decodeDERSignature时出现异常:" + e.getMessage()); + } + return bytes; + } + + public static byte[] encodeDERSignature(byte[] signature) { + byte[] r = new byte[32]; + byte[] s = new byte[32]; + System.arraycopy(signature, 0, r, 0, 32); + System.arraycopy(signature, 32, s, 0, 32); + ASN1EncodableVector vector = new ASN1EncodableVector(); + vector.add(new ASN1Integer(new BigInteger(1, r))); + vector.add(new ASN1Integer(new BigInteger(1, s))); + + byte[] encoded = null; + try { + encoded = (new DERSequence(vector)).getEncoded(); + } catch (Exception e) { + logger.warn("encodeDERSignature时出现异常:" + e.getMessage()); + } + return encoded; + } + + private static byte[] format(byte[] value) { + if (value.length == 32) { + return value; + } else { + byte[] bytes = new byte[32]; + if (value.length > 32) { + System.arraycopy(value, value.length - 32, bytes, 0, 32); + } else { + System.arraycopy(value, 0, bytes, 32 - value.length, value.length); + } + return bytes; + } + } + + + public static void main(String[] args) { + String requestData = "hello啊"; + byte[] encrypt = encrypt("0452d60e72f6a3050d2f8e8f4505f874ef345e15da38fda8dd64b9e756b7231c056dff1674c4826ada424cc78ea36fd58afc50bcefb5d721bf25b179efac2ebb17", requestData.getBytes(StandardCharsets.UTF_8)); + String temp = new String(encrypt); + byte[] decrypt = decrypt("c3509b6df8bdaf84c464daa1b6fa11a8fca77b0e4a6f076ee68487f288278a85", encrypt); + System.out.println("解密完成"+new String(decrypt)); + + String encodeToString = Base64.getEncoder().encodeToString(encrypt); + byte[] decode = Base64.getDecoder().decode(encodeToString); + byte[] decrypt1 = decrypt("c3509b6df8bdaf84c464daa1b6fa11a8fca77b0e4a6f076ee68487f288278a85", decode); + System.out.println("解密完成1"+new String(decrypt1)); + + String base64 = "eyJtc2ciOiLns7vnu5/lvILluLjvvIzor7fnqI3lkI7lho3or5UiLCJkYXRhIjpudWxsLCJjb2RlIjoiNTAwIn0="; + byte[] decode1 = Base64.getDecoder().decode(base64); + String decode2 = new String(decode1); + byte[] decryptbyte = decrypt("83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44", decode1); + System.out.println("解密完成"+new String(decryptbyte)); + } +} diff --git a/fw-cbs/src/main/webapp/WEB-INF/web.xml b/fw-cbs/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..d80081d1 --- /dev/null +++ b/fw-cbs/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index fc53bd54..e6a78b18 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ base-webapp base-core - + fw-cbs From 8b00953f4715f7392fce4acac4daa66c2fb15130 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Sat, 14 Sep 2024 10:08:39 +0800 Subject: [PATCH 02/67] =?UTF-8?q?fw-oa=E5=88=86=E6=94=AF=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base-webapp/pom.xml | 10 +- fw-oa/pom.xml | 48 ++ .../frame/seeyon/cap4/form/dto/FormDTO.java | 74 ++ .../seeyon/cap4/form/dto/FormDataDTO.java | 36 + .../seeyon/cap4/form/dto/MasterTableDTO.java | 45 ++ .../frame/seeyon/cap4/form/dto/RecordDTO.java | 34 + .../seeyon/cap4/form/dto/RecordFieldDTO.java | 52 ++ .../seeyon/cap4/form/dto/SubTableDTO.java | 9 + .../seeyon/cbs8/dao/IAgentPaymentDao.java | 12 + .../cbs8/dao/IAgentPaymentDetailDao.java | 12 + .../frame/seeyon/cbs8/dao/ICbsLogDao.java | 12 + .../frame/seeyon/cbs8/dao/IPaymentDao.java | 10 + .../cbs8/dao/ITransactionDetailDao.java | 12 + .../cbs8/dao/impl/AgentPaymentDaoImpl.java | 15 + .../dao/impl/AgentPaymentDetailDaoImpl.java | 15 + .../seeyon/cbs8/dao/impl/CbsLogDaoImpl.java | 15 + .../seeyon/cbs8/dao/impl/PaymentDaoImpl.java | 15 + .../dao/impl/TransactionDetailDaoImpl.java | 17 + .../cbs8/entity/AgentPaymentDetailEntity.java | 113 +++ .../cbs8/entity/AgentPaymentDetailEntity.xml | 84 +++ .../cbs8/entity/AgentPaymentEntity.java | 145 ++++ .../seeyon/cbs8/entity/AgentPaymentEntity.xml | 126 ++++ .../seeyon/cbs8/entity/CbsLogEntity.java | 151 ++++ .../frame/seeyon/cbs8/entity/CbsLogEntity.xml | 116 +++ .../seeyon/cbs8/entity/PaymentEntity.java | 327 +++++++++ .../seeyon/cbs8/entity/PaymentEntity.xml | 339 +++++++++ .../cbs8/entity/TransactionDetailEntity.java | 155 ++++ .../cbs8/entity/TransactionDetailEntity.xml | 91 +++ .../service/IAgentPaymentDetailService.java | 18 + .../cbs8/service/IAgentPaymentService.java | 45 ++ .../seeyon/cbs8/service/ICbsLogService.java | 53 ++ .../seeyon/cbs8/service/IPaymentService.java | 63 ++ .../service/ITransactionDetailService.java | 29 + .../impl/AgentPaymentDetailServiceImpl.java | 39 + .../service/impl/AgentPaymentServiceImpl.java | 93 +++ .../cbs8/service/impl/CbsLogServiceImpl.java | 198 +++++ .../cbs8/service/impl/PaymentServiceImpl.java | 150 ++++ .../impl/TransactionDetailServiceImpl.java | 98 +++ .../seeyon/dao/ICapFormDefinitionDao.java | 51 ++ .../frame/seeyon/dao/ICtpAttachmentDao.java | 21 + .../hzya/frame/seeyon/dao/ICtpFileDao.java | 12 + .../com/hzya/frame/seeyon/dao/ISeeYonDao.java | 108 +++ .../frame/seeyon/dao/ISeeYonInterFaceDao.java | 37 + .../dao/impl/CapFormDefinitionDaoImpl.java | 39 + .../seeyon/dao/impl/CtpAttachmentDaoImpl.java | 31 + .../frame/seeyon/dao/impl/CtpFileDaoImpl.java | 17 + .../frame/seeyon/dao/impl/SeeYonDaoImpl.java | 94 +++ .../dao/impl/SeeYonInterFaceDaoImpl.java | 43 ++ .../entity/CapFormDefinitionEntity.java | 71 ++ .../seeyon/entity/CapFormDefinitionEntity.xml | 41 ++ .../frame/seeyon/entity/CfsLogEntity.java | 65 ++ .../seeyon/entity/CollAttachmentResDTO.java | 340 +++++++++ .../seeyon/entity/CtpAttachmentEntity.java | 124 ++++ .../seeyon/entity/CtpAttachmentEntity.xml | 89 +++ .../frame/seeyon/entity/CtpFileEntity.java | 113 +++ .../frame/seeyon/entity/CtpFileEntity.xml | 49 ++ .../frame/seeyon/entity/OAU8ResponseDTO.java | 89 +++ .../entity/OAWorkflowEventDataEntity.java | 153 ++++ .../seeyon/entity/SeeYonInterFaceEntity.java | 112 +++ .../seeyon/entity/SeeYonInterFaceEntity.xml | 52 ++ .../frame/seeyon/entity/SeeyonEntity.java | 684 ++++++++++++++++++ .../hzya/frame/seeyon/entity/SeeyonEntity.xml | 250 +++++++ .../frame/seeyon/enums/ColEventTypeEnum.java | 45 ++ .../frame/seeyon/paybill/dao/IPayBillDao.java | 33 + .../paybill/dao/impl/PayBillDaoImpl.java | 32 + .../seeyon/paybill/entity/PayBillEntity.java | 107 +++ .../seeyon/paybill/entity/PayBillEntity.xml | 62 ++ .../paybill/service/IPayBillService.java | 29 + .../service/impl/PayBillServiceImpl.java | 105 +++ .../frame/seeyon/recbill/dao/IRecBillDao.java | 31 + .../recbill/dao/impl/RecBillDaoImpl.java | 30 + .../seeyon/recbill/entity/RecBillEntity.java | 104 +++ .../seeyon/recbill/entity/RecBillEntity.xml | 40 + .../recbill/service/IRecBillService.java | 26 + .../service/impl/RecBillServiceImpl.java | 104 +++ .../seeyon/service/ICtpAttachmentService.java | 20 + .../frame/seeyon/service/ICtpFileService.java | 12 + .../seeyon/service/INoProcessService.java | 26 + .../seeyon/service/ISeeYonInterFace.java | 84 +++ .../seeyon/service/ISeeyonExtService.java | 29 + .../impl/CtpAttachmentServiceImpl.java | 70 ++ .../service/impl/CtpFileServiceImpl.java | 15 + .../service/impl/NoProcessServiceImpl.java | 119 +++ .../service/impl/SeeYonInterFaceImpl.java | 507 +++++++++++++ .../service/impl/SeeyonExtServiceImpl.java | 241 ++++++ .../com/hzya/frame/seeyon/util/OABipUtil.java | 65 ++ .../hzya/frame/seeyon/util/OAPayState.java | 73 ++ .../hzya/frame/seeyon/util/OARestUtil.java | 209 ++++++ .../com/hzya/frame/seeyon/util/OAU8Util.java | 34 + fw-oa/src/main/webapp/WEB-INF/web.xml | 6 + pom.xml | 2 +- 91 files changed, 7815 insertions(+), 6 deletions(-) create mode 100644 fw-oa/pom.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDTO.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDataDTO.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/MasterTableDTO.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordDTO.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordFieldDTO.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/SubTableDTO.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IAgentPaymentDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IAgentPaymentDetailDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ICbsLogDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IPaymentDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ITransactionDetailDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/AgentPaymentDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/AgentPaymentDetailDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/CbsLogDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/PaymentDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/TransactionDetailDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentDetailEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentDetailEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/TransactionDetailEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/TransactionDetailEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IAgentPaymentDetailService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IAgentPaymentService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/ICbsLogService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IPaymentService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/ITransactionDetailService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/AgentPaymentDetailServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/AgentPaymentServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/PaymentServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/TransactionDetailServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICapFormDefinitionDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICtpAttachmentDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICtpFileDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ISeeYonDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ISeeYonInterFaceDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CapFormDefinitionDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpAttachmentDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpFileDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/SeeYonDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/SeeYonInterFaceDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CfsLogEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CollAttachmentResDTO.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpAttachmentEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpAttachmentEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpFileEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpFileEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/OAU8ResponseDTO.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/OAWorkflowEventDataEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeYonInterFaceEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeYonInterFaceEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeyonEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeyonEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/enums/ColEventTypeEnum.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/IPayBillDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/impl/PayBillDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/IPayBillService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/impl/PayBillServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/dao/IRecBillDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/dao/impl/RecBillDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/service/IRecBillService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/service/ICtpAttachmentService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/service/ICtpFileService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/service/INoProcessService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeyonExtService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/CtpAttachmentServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/CtpFileServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/NoProcessServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeyonExtServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/util/OABipUtil.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/util/OAPayState.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/util/OAU8Util.java create mode 100644 fw-oa/src/main/webapp/WEB-INF/web.xml diff --git a/base-webapp/pom.xml b/base-webapp/pom.xml index 79bd4cf9..0cd3f16b 100644 --- a/base-webapp/pom.xml +++ b/base-webapp/pom.xml @@ -54,11 +54,11 @@ - - - - - + + com.hzya.frame + fw-oa + ${revision} + diff --git a/fw-oa/pom.xml b/fw-oa/pom.xml new file mode 100644 index 00000000..04552396 --- /dev/null +++ b/fw-oa/pom.xml @@ -0,0 +1,48 @@ + + + + kangarooDataCenterV3 + com.hzya.frame + ${revision} + + 4.0.0 + fw-oa + jar + ${revision} + + + + com.hzya.frame + base-service + ${revision} + + + mysql + mysql-connector-java + ${mysql-connector-java} + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + none + execute + true + + + + + repackage + + + + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDTO.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDTO.java new file mode 100644 index 00000000..e9fe54b8 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDTO.java @@ -0,0 +1,74 @@ +package com.hzya.frame.seeyon.cap4.form.dto; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.List; + +/** + * @Description 无流程表单批量保存请求参数 + * @Author xiangerlin + * @Date 2024/1/8 11:18 + **/ +public class FormDTO { + @JSONField(ordinal = 4) + private String formCode;//模版编号 + @JSONField(ordinal = 5) + private String loginName;//模版编号 + @JSONField(ordinal = 2) + private String rightId;//权限id,找到无流程表单,点新增,弹出的窗口上会有这个参数 + @JSONField(ordinal = 3) + private List dataList;//导入的数据 + @JSONField(ordinal = 1) + private String[] uniqueFiled;//更新用的唯一标识 + @JSONField(ordinal = 6) + private Boolean doTrigger;//是否执行触发(Since V8.0sp2),测试中发现传了这个参数会报错 + + public String getFormCode() { + return formCode; + } + + public void setFormCode(String formCode) { + this.formCode = formCode; + } + + public String getLoginName() { + return loginName; + } + + public void setLoginName(String loginName) { + this.loginName = loginName; + } + + public String getRightId() { + return rightId; + } + + public void setRightId(String rightId) { + this.rightId = rightId; + } + + public List getDataList() { + return dataList; + } + + public void setDataList(List dataList) { + this.dataList = dataList; + } + + public String[] getUniqueFiled() { + return uniqueFiled; + } + + public void setUniqueFiled(String[] uniqueFiled) { + this.uniqueFiled = uniqueFiled; + } + + public Boolean getDoTrigger() { + return doTrigger; + } + + public void setDoTrigger(Boolean doTrigger) { + this.doTrigger = doTrigger; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDataDTO.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDataDTO.java new file mode 100644 index 00000000..b69031d6 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDataDTO.java @@ -0,0 +1,36 @@ +package com.hzya.frame.seeyon.cap4.form.dto; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.List; + +/** + * @Description dataList节点 + * @Author xiangerlin + * @Date 2024/1/8 11:26 + **/ +public class FormDataDTO { + @JSONField(ordinal = 1) + private MasterTableDTO masterTable;//主表数据 + @JSONField(ordinal = 2) + private List subTables;//子表数据 + + //private List<> attachmentInfos;//附件列表 + + public MasterTableDTO getMasterTable() { + return masterTable; + } + + public void setMasterTable(MasterTableDTO masterTable) { + this.masterTable = masterTable; + } + + public List getSubTables() { + return subTables; + } + + public void setSubTables(List subTables) { + this.subTables = subTables; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/MasterTableDTO.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/MasterTableDTO.java new file mode 100644 index 00000000..56f5f9fb --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/MasterTableDTO.java @@ -0,0 +1,45 @@ +package com.hzya.frame.seeyon.cap4.form.dto; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.List; + +/** + * @Description 主表数据 + * @Author xiangerlin + * @Date 2024/1/8 11:29 + **/ + +public class MasterTableDTO { + @JSONField(ordinal = 1) + private String name;//表名 + @JSONField(ordinal = 2) + private RecordDTO record;//数据 + @JSONField(ordinal = 3) + private List changedFields;//需要计算的字段 + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public RecordDTO getRecord() { + return record; + } + + public void setRecord(RecordDTO record) { + this.record = record; + } + + public List getChangedFields() { + return changedFields; + } + + public void setChangedFields(List changedFields) { + this.changedFields = changedFields; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordDTO.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordDTO.java new file mode 100644 index 00000000..cc3857e0 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordDTO.java @@ -0,0 +1,34 @@ +package com.hzya.frame.seeyon.cap4.form.dto; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.List; + +/** + * @Description record节点 + * @Author xiangerlin + * @Date 2024/1/8 11:31 + **/ +public class RecordDTO { + @JSONField(ordinal = 1) + private long id;//数据id,测试中发现新增时这个参数随便填写 不影响导入 + @JSONField(ordinal = 2) + private List fields;//字段列表 + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public List getFields() { + return fields; + } + + public void setFields(List fields) { + this.fields = fields; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordFieldDTO.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordFieldDTO.java new file mode 100644 index 00000000..a2bfa15b --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordFieldDTO.java @@ -0,0 +1,52 @@ +package com.hzya.frame.seeyon.cap4.form.dto; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * @Description masterTable—record—fields的结构 + * @Author xiangerlin + * @Date 2024/1/8 11:32 + **/ +public class RecordFieldDTO { + @JSONField(ordinal = 1) + private String name;//数据域名称 ,fieldxxxx + @JSONField(ordinal = 2) + private String value;//数据值(优先) + @JSONField(ordinal = 3) + private String showValue;//显示值 + + public RecordFieldDTO() { + + } + + public RecordFieldDTO(String name, String value, String showValue) { + this.name = name; + this.value = value; + this.showValue = showValue; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getShowValue() { + return showValue; + } + + public void setShowValue(String showValue) { + this.showValue = showValue; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/SubTableDTO.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/SubTableDTO.java new file mode 100644 index 00000000..8d5e5226 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/SubTableDTO.java @@ -0,0 +1,9 @@ +package com.hzya.frame.seeyon.cap4.form.dto; + +/** + * @Description 子表数据 + * @Author xiangerlin + * @Date 2024/1/8 11:29 + **/ +public class SubTableDTO { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IAgentPaymentDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IAgentPaymentDao.java new file mode 100644 index 00000000..5336cd91 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IAgentPaymentDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.seeyon.cbs8.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity; + +/** + * @Description 代发代扣 + * @Author xiangerlin + * @Date 2024/6/26 10:50 + **/ +public interface IAgentPaymentDao extends IBaseDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IAgentPaymentDetailDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IAgentPaymentDetailDao.java new file mode 100644 index 00000000..96895bb4 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IAgentPaymentDetailDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.seeyon.cbs8.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity; + +/** + * @Description 代发代扣明细 + * @Author xiangerlin + * @Date 2024/6/26 10:54 + **/ +public interface IAgentPaymentDetailDao extends IBaseDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ICbsLogDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ICbsLogDao.java new file mode 100644 index 00000000..032d1a3e --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ICbsLogDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.seeyon.cbs8.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity; + +/** + * @Description cbs8支付日志 + * @Author xiangerlin + * @Date 2024/6/14 17:30 + **/ +public interface ICbsLogDao extends IBaseDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IPaymentDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IPaymentDao.java new file mode 100644 index 00000000..c8a18848 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IPaymentDao.java @@ -0,0 +1,10 @@ +package com.hzya.frame.seeyon.cbs8.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; + +/** + * oa集成cbs + */ +public interface IPaymentDao extends IBaseDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ITransactionDetailDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ITransactionDetailDao.java new file mode 100644 index 00000000..37cf015a --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ITransactionDetailDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.seeyon.cbs8.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.seeyon.cbs8.entity.TransactionDetailEntity; + +/** + * @Description cbs交易明细 oa底表 + * @Author xiangerlin + * @Date 2024/6/24 11:10 + **/ +public interface ITransactionDetailDao extends IBaseDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/AgentPaymentDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/AgentPaymentDaoImpl.java new file mode 100644 index 00000000..5b2e3852 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/AgentPaymentDaoImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.seeyon.cbs8.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.cbs8.dao.IAgentPaymentDao; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/26 10:51 + **/ +@Repository("OAAgentPaymentDaoImpl") +public class AgentPaymentDaoImpl extends MybatisGenericDao implements IAgentPaymentDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/AgentPaymentDetailDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/AgentPaymentDetailDaoImpl.java new file mode 100644 index 00000000..2b873067 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/AgentPaymentDetailDaoImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.seeyon.cbs8.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.cbs8.dao.IAgentPaymentDetailDao; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/26 10:55 + **/ +@Repository("OAAgentPaymentDetailDaoImpl") +public class AgentPaymentDetailDaoImpl extends MybatisGenericDao implements IAgentPaymentDetailDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/CbsLogDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/CbsLogDaoImpl.java new file mode 100644 index 00000000..a42437b0 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/CbsLogDaoImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.seeyon.cbs8.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.cbs8.dao.ICbsLogDao; +import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/14 17:31 + **/ +@Repository() +public class CbsLogDaoImpl extends MybatisGenericDao implements ICbsLogDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/PaymentDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/PaymentDaoImpl.java new file mode 100644 index 00000000..f2744983 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/PaymentDaoImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.seeyon.cbs8.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.cbs8.dao.IPaymentDao; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description oa集成cbs + * @Author xiangerlin + * @Date 2024/6/6 16:28 + **/ +@Repository("OAPaymentDaoImpl") +public class PaymentDaoImpl extends MybatisGenericDao implements IPaymentDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/TransactionDetailDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/TransactionDetailDaoImpl.java new file mode 100644 index 00000000..e4fb1bac --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/TransactionDetailDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.seeyon.cbs8.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.cbs8.dao.IPaymentDao; +import com.hzya.frame.seeyon.cbs8.dao.ITransactionDetailDao; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; +import com.hzya.frame.seeyon.cbs8.entity.TransactionDetailEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/24 11:10 + **/ +@Repository("OATransactionDetailDaoImpl") +public class TransactionDetailDaoImpl extends MybatisGenericDao implements ITransactionDetailDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentDetailEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentDetailEntity.java new file mode 100644 index 00000000..4776058c --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentDetailEntity.java @@ -0,0 +1,113 @@ +package com.hzya.frame.seeyon.cbs8.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description 代发代扣明细表 + * @Author xiangerlin + * @Date 2024/6/18 14:58 + **/ +public class AgentPaymentDetailEntity extends BaseEntity { + //每笔明细金额 + private String dtlAmount; + //收款账号 + private String dtlRevAccount; + //联行号 同行可不传,跨行必传 + private String dtlCnapsCode; + //收款账户名称 + private String dtlRevName; + //收款开户行 ,如果传的联行号能匹配到对应到开户行,cbs8会自动带出 + private String dtlRevBankName; + //主表id + private String formmainId; + //表名 + private String tabName; + + //明细序号,从1开始递增 + private int dtlSeqNum; + + //支付结果 + private String payResult; + //支付日期 + private String payDate; + + public String getDtlAmount() { + return dtlAmount; + } + + public void setDtlAmount(String dtlAmount) { + this.dtlAmount = dtlAmount; + } + + public String getDtlRevAccount() { + return dtlRevAccount; + } + + public void setDtlRevAccount(String dtlRevAccount) { + this.dtlRevAccount = dtlRevAccount; + } + + public String getDtlCnapsCode() { + return dtlCnapsCode; + } + + public void setDtlCnapsCode(String dtlCnapsCode) { + this.dtlCnapsCode = dtlCnapsCode; + } + + public String getDtlRevName() { + return dtlRevName; + } + + public void setDtlRevName(String dtlRevName) { + this.dtlRevName = dtlRevName; + } + + public String getDtlRevBankName() { + return dtlRevBankName; + } + + public void setDtlRevBankName(String dtlRevBankName) { + this.dtlRevBankName = dtlRevBankName; + } + + public String getFormmainId() { + return formmainId; + } + + public void setFormmainId(String formmainId) { + this.formmainId = formmainId; + } + + public String getTabName() { + return tabName; + } + + public void setTabName(String tabName) { + this.tabName = tabName; + } + + public int getDtlSeqNum() { + return dtlSeqNum; + } + + public void setDtlSeqNum(int dtlSeqNum) { + this.dtlSeqNum = dtlSeqNum; + } + + public String getPayResult() { + return payResult; + } + + public void setPayResult(String payResult) { + this.payResult = payResult; + } + + public String getPayDate() { + return payDate; + } + + public void setPayDate(String payDate) { + this.payDate = payDate; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentDetailEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentDetailEntity.xml new file mode 100644 index 00000000..43869fc1 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentDetailEntity.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + id, + formmainId, + tabName, + dtlSeqNum, + dtlAmount, + dtlRevAccount, + dtlCnapsCode, + dtlRevName, + dtlRevBankName, + payResult, + payDate + + + + + + + + update formson_0225 set + + field0045 =#{payDate}, + field0044 =#{payResult} + + where id = #{id} + + + + + update formson_0225 set + + field0045 =#{payDate}, + field0044 =#{payResult} + + where field0001=#{dtlSeqNum} and field0019=#{dtlAmount} and field0035=#{dtlCnapsCode} and field0037=#{dtlRevName} + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentEntity.java new file mode 100644 index 00000000..b4b2748a --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentEntity.java @@ -0,0 +1,145 @@ +package com.hzya.frame.seeyon.cbs8.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description 代发代扣 主表 + * @Author xiangerlin + * @Date 2024/6/18 14:44 + **/ +public class AgentPaymentEntity extends BaseEntity { + + //oa id + private String oaId; + private String finishedflag; + //流程标题 + private String title; + //业务参考号 + private String referenceNum; + /** + * 业务类型 + * 201-代扣 + * 203-代发 + * 代发工资传203 + */ + private String busType; + //总金额 小数位2位 + private String amount; + //币种 + private String currency; + //付款账号 + private String payAccount; + //用途 + private String purpose; + //申请单号 + private String applyCode; + //支付结果 + private String payResult; + + private String tableName;//表名称 + private String billName;//单据名称 + + public String getReferenceNum() { + return referenceNum; + } + + public void setReferenceNum(String referenceNum) { + this.referenceNum = referenceNum; + } + + public String getBusType() { + return busType; + } + + public void setBusType(String busType) { + this.busType = busType; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getPayAccount() { + return payAccount; + } + + public void setPayAccount(String payAccount) { + this.payAccount = payAccount; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getBillName() { + return billName; + } + + public void setBillName(String billName) { + this.billName = billName; + } + + public String getOaId() { + return oaId; + } + + public void setOaId(String oaId) { + this.oaId = oaId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getFinishedflag() { + return finishedflag; + } + + public void setFinishedflag(String finishedflag) { + this.finishedflag = finishedflag; + } + + public String getApplyCode() { + return applyCode; + } + + public void setApplyCode(String applyCode) { + this.applyCode = applyCode; + } + + public String getPayResult() { + return payResult; + } + + public void setPayResult(String payResult) { + this.payResult = payResult; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentEntity.xml new file mode 100644 index 00000000..c0b0f6f0 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentEntity.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + oaId, + tableName, + finishedflag, + title, + billName, + referenceNum, + busType, + amount, + currency, + payAccount, + applyCode, + payResult, + purpose + + + + + + + + + + + update formmain_0224 set + + field0043 =#{applyCode}, + field0046 =#{payResult} + + where id = #{oaId} + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.java new file mode 100644 index 00000000..21cc1a4f --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.java @@ -0,0 +1,151 @@ +package com.hzya.frame.seeyon.cbs8.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description cbs支付日志 + * @Author xiangerlin + * @Date 2024/6/14 17:16 + **/ +public class CbsLogEntity extends BaseEntity { + //流程标题 + private String title; + //请款主体 + private String pay_company; + //收款人 + private String payee; + //金额 + private String amount; + //cbs申请单号 + private String cbs_apply_code; + //日志表id + private String id; + //oa单据id + private String oa_id; + //oa单据号 + private String bill_code; + //英文表名 + private String tab_name_en; + //中文表名 + private String tab_name_ch; + //支付状态 + private String pay_state; + //支付信息 + private String message; + //支付申请状态 + private String apply_state; + //成功标记 + private String successed; + + public String getOa_id() { + return oa_id; + } + + public void setOa_id(String oa_id) { + this.oa_id = oa_id; + } + + public String getBill_code() { + return bill_code; + } + + public void setBill_code(String bill_code) { + this.bill_code = bill_code; + } + + public String getTab_name_en() { + return tab_name_en; + } + + public void setTab_name_en(String tab_name_en) { + this.tab_name_en = tab_name_en; + } + + public String getTab_name_ch() { + return tab_name_ch; + } + + public void setTab_name_ch(String tab_name_ch) { + this.tab_name_ch = tab_name_ch; + } + + public String getPay_state() { + return pay_state; + } + + public void setPay_state(String pay_state) { + this.pay_state = pay_state; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getApply_state() { + return apply_state; + } + + public void setApply_state(String apply_state) { + this.apply_state = apply_state; + } + + public String getSuccessed() { + return successed; + } + + public void setSuccessed(String successed) { + this.successed = successed; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getPay_company() { + return pay_company; + } + + public void setPay_company(String pay_company) { + this.pay_company = pay_company; + } + + public String getPayee() { + return payee; + } + + public void setPayee(String payee) { + this.payee = payee; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getCbs_apply_code() { + return cbs_apply_code; + } + + public void setCbs_apply_code(String cbs_apply_code) { + this.cbs_apply_code = cbs_apply_code; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.xml new file mode 100644 index 00000000..3e03a88a --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + id, + field0002 as title, + field0003 as pay_company, + field0004 as payee, + field0005 as cbs_apply_code, + field0006 as bill_code, + field0007 as oa_id, + field0008 as tab_name_ch, + field0009 as tab_name_en, + field0010 as pay_state, + field0011 as message, + field0012 as apply_state, + field0014 as successed + + + + + + + + + + + + + update formmain_0232 set + + field0010 =#{pay_state}, + field0011 =#{message}, + field0012 =#{apply_state}, + field0014 =#{successed} + + where id = #{id} + + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.java new file mode 100644 index 00000000..9f68e3ff --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.java @@ -0,0 +1,327 @@ +package com.hzya.frame.seeyon.cbs8.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/6 16:17 + **/ +public class PaymentEntity extends BaseEntity { + + private String oaId;//主表id + private String formsonId;//明细表id + private String payCompany;//付款公司 + private String title;//流程标题 + private String tableName;//表名称 + private String billName;//单据名称 + private String referenceNum;//业务参考号 唯一id + private String referenceNumNew;//重试的时候生成新的业务参考号 + private String busType;//业务类型 + private String payResultField;//支付结果字段 + private String payDateField;//打款日期字段 + private String applyCodeField;//支付申请单号字段 + private String receiptFiled;//电子回单字段 + private String summaryId;//summaryid + private String startDate;//单据日期 + private String finishedflag;//流程状态 + private String payDate;//打款日期 + private String payResult;//支付结果 + private String applyCode;//支付申请单号 + private String payAccount;//付款账号 + private String payBankName;//付款开户银行 + private String amount;//金额 + private String purpose;//支付用途 + private String revAccount;//收款账号 + private String revBankName;//收款开户行名称 + private String revBankType;//收款银行类型 + private String revAccountName;//收款账户名称 + private String cnapsCode;//联行号 + private String receipt;//电子回单 + private String currency;//币种 数字 + private String currencyName;//币种 中文 + private String currencyCode;//币种编码 + private String personalFlag;//公私标记 + private String payType;//付款类别 + private String payCompanyCode;//付款公司编码 + + public String getOaId() { + return oaId; + } + + public void setOaId(String oaId) { + this.oaId = oaId; + } + + public String getPayCompany() { + return payCompany; + } + + public void setPayCompany(String payCompany) { + this.payCompany = payCompany; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getBillName() { + return billName; + } + + public void setBillName(String billName) { + this.billName = billName; + } + + public String getReferenceNum() { + return referenceNum; + } + + public void setReferenceNum(String referenceNum) { + this.referenceNum = referenceNum; + } + + public String getReferenceNumNew() { + return referenceNumNew; + } + + public void setReferenceNumNew(String referenceNumNew) { + this.referenceNumNew = referenceNumNew; + } + + public String getBusType() { + return busType; + } + + public void setBusType(String busType) { + this.busType = busType; + } + + public String getPayResultField() { + return payResultField; + } + + public void setPayResultField(String payResultField) { + this.payResultField = payResultField; + } + + public String getPayDateField() { + return payDateField; + } + + public void setPayDateField(String payDateField) { + this.payDateField = payDateField; + } + + public String getReceiptFiled() { + return receiptFiled; + } + + public void setReceiptFiled(String receiptFiled) { + this.receiptFiled = receiptFiled; + } + + public String getSummaryId() { + return summaryId; + } + + public void setSummaryId(String summaryId) { + this.summaryId = summaryId; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getFinishedflag() { + return finishedflag; + } + + public void setFinishedflag(String finishedflag) { + this.finishedflag = finishedflag; + } + + public String getPayDate() { + return payDate; + } + + public void setPayDate(String payDate) { + this.payDate = payDate; + } + + public String getPayResult() { + return payResult; + } + + public void setPayResult(String payResult) { + this.payResult = payResult; + } + + public String getPayAccount() { + return payAccount; + } + + public void setPayAccount(String payAccount) { + this.payAccount = payAccount; + } + + public String getPayBankName() { + return payBankName; + } + + public void setPayBankName(String payBankName) { + this.payBankName = payBankName; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getRevAccount() { + return revAccount; + } + + public void setRevAccount(String revAccount) { + this.revAccount = revAccount; + } + + public String getRevBankName() { + return revBankName; + } + + public void setRevBankName(String revBankName) { + this.revBankName = revBankName; + } + + public String getRevBankType() { + return revBankType; + } + + public void setRevBankType(String revBankType) { + this.revBankType = revBankType; + } + + public String getRevAccountName() { + return revAccountName; + } + + public void setRevAccountName(String revAccountName) { + this.revAccountName = revAccountName; + } + + public String getCnapsCode() { + return cnapsCode; + } + + public void setCnapsCode(String cnapsCode) { + this.cnapsCode = cnapsCode; + } + + public String getReceipt() { + return receipt; + } + + public void setReceipt(String receipt) { + this.receipt = receipt; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getCurrencyName() { + return currencyName; + } + + public void setCurrencyName(String currencyName) { + this.currencyName = currencyName; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public void setCurrencyCode(String currencyCode) { + this.currencyCode = currencyCode; + } + + public String getPersonalFlag() { + return personalFlag; + } + + public void setPersonalFlag(String personalFlag) { + this.personalFlag = personalFlag; + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType; + } + + public String getPayCompanyCode() { + return payCompanyCode; + } + + public void setPayCompanyCode(String payCompanyCode) { + this.payCompanyCode = payCompanyCode; + } + + public String getFormsonId() { + return formsonId; + } + + public void setFormsonId(String formsonId) { + this.formsonId = formsonId; + } + + public String getApplyCodeField() { + return applyCodeField; + } + + public void setApplyCodeField(String applyCodeField) { + this.applyCodeField = applyCodeField; + } + + public String getApplyCode() { + return applyCode; + } + + public void setApplyCode(String applyCode) { + this.applyCode = applyCode; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.xml new file mode 100644 index 00000000..b8d3deee --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.xml @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + oaId, + formsonId, + payCompany, + payCompanyCode, + title, + tableName, + billName, + referenceNum, + busType, + payResultField, + payDateField, + applyCodeField, + receiptFiled, + summaryId, + startDate, + finishedflag, + payDate, + payResult, + applyCode, + payAccount, + payBankName, + amount, + purpose, + revAccount, + revBankName, + revBankType, + revAccountName, + cnapsCode, + receipt, + currency, + personalFlag, + payType + + + + + SELECT + formmain_0209.id as oaId, -- 主表id + formson_0210.formsonId, + 'formson_0210' as tableName, -- 表名 + COL_SUMMARY.SUBJECT as title, -- 单据标题 + unit.name as payCompany, -- 付款公司 + '差旅费报销单' as billName, + 'field0072' as payResultField, -- 支付结果字段 + 'field0073' as payDateField, -- 打款日期字段 + 'field0080' AS applyCodeField,-- CBS支付申请单号 + '' as receiptFiled,-- 电子回单字段 + COL_SUMMARY.id as summaryId, + formmain_0209.field0017||'-'||formson_0210.sort as referenceNum, -- 单据编号 + formmain_0209.START_DATE as startDate, -- 单据日期 + formmain_0209.FINISHEDFLAG as finishedflag, -- 流程状态 + formson_0210.field0073 as payDate, -- 打款日期 + formson_0210.field0072 as payResult, -- 支付结果 + formson_0210.field0080 AS applyCode,-- 支付申请单号 + REGEXP_REPLACE(formmain_0209.field0042, '[[:space:]]', '') as payAccount, -- 付款账户 + REGEXP_REPLACE(formmain_0209.field0041, '[[:space:]]', '') as payBankName, -- 付款开户行 + formson_0210.field0031 as amount, -- 金额 + formmain_0209.field0038 as purpose, -- 用途 + formmain_0209.field0038 as cbsAbstract, -- 摘要 + REGEXP_REPLACE(formson_0210.field0069, '[[:space:]]', '') as revAccount, -- 收款账户 + formson_0210.field0068 as revBankName, -- 收款开户行 + formson_0210.field0075 as revAccountName, -- 收款人 + REGEXP_REPLACE(formson_0210.field0071, '[[:space:]]', '') as cnapsCode, -- 收款联行号 + item.ENUMVALUE as personalFlag,-- 公私标记 + formson_0210.field0079 as revBankType, + '10' as currency, + '202' as busType, + '' as receipt -- 电子回单 + FROM + ( + SELECT + WM_CONCAT(id) AS formsonId, + formmain_id, + SUM(field0031) AS field0031, + MIN(sort) AS sort, + field0068, + field0069, + field0071, + field0079, + field0075, + field0070, + field0072, + field0073, + field0080 + FROM + formson_0210 + WHERE + field0067 = '-5486592002512828355' + GROUP BY + formmain_id, + field0068, + field0069, + field0071, + field0079, + field0075, + field0070, + field0072, + field0073, + field0080 + )formson_0210 + LEFT JOIN formmain_0209 ON formson_0210.FORMMAIN_ID = formmain_0209.id + LEFT JOIN COL_SUMMARY ON COL_SUMMARY.FORM_RECORDID = formmain_0209.id + left join CTP_ENUM_ITEM item on item.id =formson_0210.field0070 + left join ORG_UNIT unit on unit.id =formmain_0209.field0002 + + + + + + + + + + + + + + + + + + + + + + update ${tableName} set + + ${payDateField} =#{payDate}, + ${payResultField} =#{payResult}, + ${applyCodeField} =#{applyCode} + + where id = #{formsonId} + + + + + update ${tableName} set ${receiptFiled}=#{receipt} where id = #{oaId} and ${receiptFiled} is null + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/TransactionDetailEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/TransactionDetailEntity.java new file mode 100644 index 00000000..e1d66a2d --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/TransactionDetailEntity.java @@ -0,0 +1,155 @@ +package com.hzya.frame.seeyon.cbs8.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description cbs交易明细日志OA底表 + * @Author xiangerlin + * @Date 2024/6/24 10:49 + **/ +public class TransactionDetailEntity extends BaseEntity { + private String id;//id + private String accountNo;//银行账号 + private String accountName;//户名 + private String openBank;//开户行名称 + private String bankType;//我方银行类型 + private String bankTransactionDate;//交易日期 + private String transactionSerialNumber;//交易流水号 + private String bankSerialNumber;//银行流水号 + private String currency;//币种 + private String incurredAmount;//发生额 + private String purpose;//用途 + private String digest;//摘要 + private String oppositeAccount;//对方账号 + private String oppositeName;//对方户名 + private String oppositeOpeningBank;//对方开户行 + + private String remark;//备注 + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getAccountNo() { + return accountNo; + } + + public void setAccountNo(String accountNo) { + this.accountNo = accountNo; + } + + public String getAccountName() { + return accountName; + } + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + public String getOpenBank() { + return openBank; + } + + public void setOpenBank(String openBank) { + this.openBank = openBank; + } + + public String getBankTransactionDate() { + return bankTransactionDate; + } + + public void setBankTransactionDate(String bankTransactionDate) { + this.bankTransactionDate = bankTransactionDate; + } + + public String getTransactionSerialNumber() { + return transactionSerialNumber; + } + + public void setTransactionSerialNumber(String transactionSerialNumber) { + this.transactionSerialNumber = transactionSerialNumber; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getIncurredAmount() { + return incurredAmount; + } + + public void setIncurredAmount(String incurredAmount) { + this.incurredAmount = incurredAmount; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getDigest() { + return digest; + } + + public void setDigest(String digest) { + this.digest = digest; + } + + public String getOppositeAccount() { + return oppositeAccount; + } + + public void setOppositeAccount(String oppositeAccount) { + this.oppositeAccount = oppositeAccount; + } + + public String getOppositeName() { + return oppositeName; + } + + public void setOppositeName(String oppositeName) { + this.oppositeName = oppositeName; + } + + public String getOppositeOpeningBank() { + return oppositeOpeningBank; + } + + public void setOppositeOpeningBank(String oppositeOpeningBank) { + this.oppositeOpeningBank = oppositeOpeningBank; + } + + public String getBankType() { + return bankType; + } + + public void setBankType(String bankType) { + this.bankType = bankType; + } + + public String getBankSerialNumber() { + return bankSerialNumber; + } + + public void setBankSerialNumber(String bankSerialNumber) { + this.bankSerialNumber = bankSerialNumber; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/TransactionDetailEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/TransactionDetailEntity.xml new file mode 100644 index 00000000..3fa7fc60 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/TransactionDetailEntity.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + id, + field0001 as accountNo, + field0002 as accountName, + field0003 as openBank, + field0004 as bankType, + field0005 as transactionSerialNumber, + field0006 as bankTransactionDate, + field0007 as bankSerialNumber, + field0008 as currency, + field0009 as incurredAmount, + field0010 as purpose, + field0011 as digest, + field0012 as oppositeAccount, + field0013 as oppositeName, + field0014 as oppositeOpeningBank, + field0015 as remark + + + + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IAgentPaymentDetailService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IAgentPaymentDetailService.java new file mode 100644 index 00000000..f0a4811b --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IAgentPaymentDetailService.java @@ -0,0 +1,18 @@ +package com.hzya.frame.seeyon.cbs8.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity; + +/** + * @Description 代发代扣明细 + * @Author xiangerlin + * @Date 2024/6/26 11:00 + **/ +public interface IAgentPaymentDetailService extends IBaseService { + /** + * 更新明细表支付状态 + * @param detail + */ + void updatePayResult(AgentPaymentDetailEntity detail); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IAgentPaymentService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IAgentPaymentService.java new file mode 100644 index 00000000..dcb6d78f --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IAgentPaymentService.java @@ -0,0 +1,45 @@ +package com.hzya.frame.seeyon.cbs8.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity; + +import java.util.List; + +/** + * @Description OA代发代扣 + * @Author xiangerlin + * @Date 2024/6/18 15:04 + **/ +public interface IAgentPaymentService extends IBaseService { + + /** + * 查询待支付待代发代扣 主表 + * @param entity + * @return + * @throws Exception + */ + List queryUnpaid(AgentPaymentEntity entity) throws Exception; + + /** + * 根据支付申请单号查询 + * @param agentPayment + * @return + * @throws Exception + */ + AgentPaymentEntity queryByApplyCode(AgentPaymentEntity agentPayment)throws Exception; + + /** + * 查询明细表 + * @param entity + * @return + * @throws Exception + */ + List queryDetails(AgentPaymentDetailEntity entity)throws Exception; + + /** + * 更新支付状态 + * @param entity + */ + void updateResult(AgentPaymentEntity entity); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/ICbsLogService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/ICbsLogService.java new file mode 100644 index 00000000..7160c21f --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/ICbsLogService.java @@ -0,0 +1,53 @@ +package com.hzya.frame.seeyon.cbs8.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; + +import java.util.List; + +/** + * @Description cbs8支付日志 + * @Author xiangerlin + * @Date 2024/6/14 17:22 + **/ +public interface ICbsLogService extends IBaseService { + /** + * 查询支付中的数据 + * @param logEntity + * @return + */ + List queryInPayment(CbsLogEntity logEntity); + /** + * 保存日志,通过rest接口的形式 + * @param logEntity + */ + void saveLog(CbsLogEntity logEntity); + + /** + * 补推,从自己开发的页面或者APIpost + * 需要传oa表单id和表单编号 + * @param entity + */ + void retry(CbsLogEntity entity); + /** + * 补推,从OA页面 + * 只需要传日志表id就行 + * @param jsonObject + */ + void resend(JSONObject jsonObject); + + /** + * 获取token + * @param entity + * @return + */ + SysExtensionApiEntity getTokenExt(SysExtensionApiEntity entity); + + /** + * 更新日志 + * @param logEntity + */ + void updateLog(CbsLogEntity logEntity); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IPaymentService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IPaymentService.java new file mode 100644 index 00000000..4243084c --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IPaymentService.java @@ -0,0 +1,63 @@ +package com.hzya.frame.seeyon.cbs8.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; + +import java.util.List; + +/** + * @Description oa对接cbs + * @Author xiangerlin + * @Date 2024/6/6 16:31 + **/ +public interface IPaymentService extends IBaseService { + + /** + * 查询待支付的数据 需要推送到CBS的 + * 如果需要查询流程状态已结束的 需要调用方设置finishedflag=1 + * @param entity + * @return + * @throws Exception + */ + List queryUnpaid(PaymentEntity entity)throws Exception; + + /** + * 查询交易成功的数据 + * 内置了查询条件payResult = PayState.payStateGetValue("g"); 支付成功 + * @param entity + * @return + * @throws Exception + */ + List querySuccess(PaymentEntity entity)throws Exception; + + /** + * 查询交易成功,且电子回单为空的 + * @param entity + * @return + * @throws Exception + */ + List queryElecIsNull(PaymentEntity entity)throws Exception; + + /** + * 查询支付中的数据 + * 内置了查询条件 payResult = '支付中' or payResult not in ('审批撤销','审批拒绝','处理失败','退票','支付成功','取消支付','修改支付','支付失败') + * @param entity + * @return + * @throws Exception + */ + List queryInPayment(PaymentEntity entity)throws Exception; + + /** + * 更新支付状态 + * @param entity + * @throws Exception + */ + void updatePayState(PaymentEntity entity)throws Exception; + + /** + * 更新电子回单字段 + * @param entity + * @throws Exception + */ + void updateElec(PaymentEntity entity)throws Exception; +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/ITransactionDetailService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/ITransactionDetailService.java new file mode 100644 index 00000000..61126686 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/ITransactionDetailService.java @@ -0,0 +1,29 @@ +package com.hzya.frame.seeyon.cbs8.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.cbs8.entity.TransactionDetailEntity; + +import java.util.List; + +/** + * @Description cbs交易明细 OA底表 + * @Author xiangerlin + * @Date 2024/6/24 11:07 + **/ +public interface ITransactionDetailService extends IBaseService { + + + /** + * 只返回交易流水号 + * @param entity + * @return + */ + List querySerialNumber(TransactionDetailEntity entity); + + /** + * 保存交易明细,通过rest接口的方式 + * @param entity + * @throws Exception + */ + void restSave(TransactionDetailEntity entity); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/AgentPaymentDetailServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/AgentPaymentDetailServiceImpl.java new file mode 100644 index 00000000..8bbbad34 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/AgentPaymentDetailServiceImpl.java @@ -0,0 +1,39 @@ +package com.hzya.frame.seeyon.cbs8.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.seeyon.cbs8.dao.IAgentPaymentDetailDao; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity; +import com.hzya.frame.seeyon.cbs8.service.IAgentPaymentDetailService; +import com.hzya.frame.seeyon.cbs8.service.IAgentPaymentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/26 11:01 + **/ +@Service("OAAgentPaymentDetailServiceImpl") +public class AgentPaymentDetailServiceImpl extends BaseService implements IAgentPaymentDetailService { + + private IAgentPaymentDetailDao agentPaymentDetailDao; + + @Autowired + public void setAgentPaymentDetailDao(IAgentPaymentDetailDao agentPaymentDetailDao) { + this.agentPaymentDetailDao = agentPaymentDetailDao; + this.dao = agentPaymentDetailDao; + } + + /** + * 更新明细表支付状态 + * + * @param detail + */ + @DS("#detail.dataSourceCode") + @Override + public void updatePayResult(AgentPaymentDetailEntity detail) { + agentPaymentDetailDao.update("com.hzya.frame.seeyon.cbs8.dao.impl.AgentPaymentDetailDaoImpl.entity_update_result",detail); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/AgentPaymentServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/AgentPaymentServiceImpl.java new file mode 100644 index 00000000..ab3ab4b9 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/AgentPaymentServiceImpl.java @@ -0,0 +1,93 @@ +package com.hzya.frame.seeyon.cbs8.service.impl; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.seeyon.cbs8.dao.IAgentPaymentDao; +import com.hzya.frame.seeyon.cbs8.dao.IAgentPaymentDetailDao; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity; +import com.hzya.frame.seeyon.cbs8.service.IAgentPaymentDetailService; +import com.hzya.frame.seeyon.cbs8.service.IAgentPaymentService; +import com.hzya.frame.web.exception.BaseSystemException; +import org.apache.commons.collections.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/18 15:06 + **/ +@Service(value = "cbs8AgentPaymentServiceImpl") +public class AgentPaymentServiceImpl extends BaseService implements IAgentPaymentService { + + private IAgentPaymentDao agentPaymentDao; + + @Autowired + private IAgentPaymentDetailService agentPaymentDetailService; + @Autowired + public void setAgentPaymentDao(IAgentPaymentDao agentPaymentDao) { + this.agentPaymentDao = agentPaymentDao; + this.dao = agentPaymentDao; + } + /** + * 查询待支付待代发代扣 主表 + * + * @param entity + * @return + * @throws Exception + */ + @DS("#entity.dataSourceCode") + @Override + public List queryUnpaid(AgentPaymentEntity entity) throws Exception { + List list = agentPaymentDao.queryList(entity, "com.hzya.frame.seeyon.cbs8.dao.impl.AgentPaymentDaoImpl.entity_list_base_unpaid"); + return list; + } + + /** + * 根据支付申请单号查询 + * + * @param entity + * @return + * @throws Exception + */ + @Override + public AgentPaymentEntity queryByApplyCode(AgentPaymentEntity entity) throws Exception { + if (null != entity && StrUtil.isNotEmpty(entity.getApplyCode())){ + List list = agentPaymentDao.query(entity); + if (CollectionUtils.isNotEmpty(list)){ + if (list.size() > 1){ + throw new BaseSystemException("根据"+entity.getApplyCode()+"查询到多条记录"); + } + return list.get(0); + } + } + return null; + } + + /** + * 查询明细表 + * + * @param entity + * @return + * @throws Exception + */ + @DS("#entity.dataSourceCode") + @Override + public List queryDetails(AgentPaymentDetailEntity entity) throws Exception { + List list = agentPaymentDetailService.query(entity); + return list; + } + + /** + * @param entity + */ + @DS("#entity.dataSourceCode") + @Override + public void updateResult(AgentPaymentEntity entity) { + agentPaymentDao.update("com.hzya.frame.seeyon.cbs8.dao.impl.AgentPaymentDaoImpl.entity_update",entity); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java new file mode 100644 index 00000000..07a89a52 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java @@ -0,0 +1,198 @@ +package com.hzya.frame.seeyon.cbs8.service.impl; + +import cn.hutool.core.map.MapBuilder; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.seeyon.cbs8.dao.ICbsLogDao; +import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; +import com.hzya.frame.seeyon.cbs8.service.ICbsLogService; +import com.hzya.frame.seeyon.util.OAPayState; +import com.hzya.frame.seeyon.util.OARestUtil; +import com.hzya.frame.stringutil.StringUtil; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.web.exception.BaseSystemException; +import org.apache.commons.collections.CollectionUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Description cbs8支付日志 + * @Author xiangerlin + * @Date 2024/6/14 17:22 + **/ +@Service(value = "CbsLogServiceImpl") +public class CbsLogServiceImpl extends BaseService implements ICbsLogService { + + + Logger log = LoggerFactory.getLogger(getClass()); + + private ICbsLogDao cbsLogDao; + @Value("${OA.data_source_code:}") + private String oa_data_source_code; + @Autowired + public void setCbsLogDao(ICbsLogDao cbsLogDao) { + this.cbsLogDao = cbsLogDao; + this.dao = cbsLogDao; + } + @Autowired + private OARestUtil restUtil; + + /** + * 查询支付中的数据 + * + * @param logEntity + * @return + */ + @DS("#logEntity.dataSourceCode") + @Override + public List queryInPayment(CbsLogEntity logEntity) { + List logList = cbsLogDao.queryList(logEntity, "CbsLogEntity_list_base_in_payment"); + return logList; + } + + /** + * 保存日志,通过rest接口的形式 + * + * @param cbsLogEntity + */ + @Override + public void saveLog(CbsLogEntity cbsLogEntity) { + String oa_id = StringUtil.nullConvert(cbsLogEntity.getOa_id()); + String bill_code = StringUtil.nullConvert(cbsLogEntity.getBill_code()); + String tab_name_en = StringUtil.nullConvert(cbsLogEntity.getTab_name_en()); + String tab_name_ch = StringUtil.nullConvert(cbsLogEntity.getTab_name_ch()); + String pay_state = StringUtil.nullConvert(cbsLogEntity.getPay_state()); + String message = StringUtil.nullConvert(cbsLogEntity.getMessage()); + String apply_state = StringUtil.nullConvert(cbsLogEntity.getApply_state()); + String successed = StringUtil.nullConvert(cbsLogEntity.getSuccessed()); + String title = StringUtil.nullConvert(cbsLogEntity.getTitle()); + String pay_company = StringUtil.nullConvert(cbsLogEntity.getPay_company()); + String payee = StringUtil.nullConvert(cbsLogEntity.getPayee()); + String amount = StringUtil.nullConvert(cbsLogEntity.getAmount()); + String cbs_apply_code = StringUtil.nullConvert(cbsLogEntity.getCbs_apply_code()); + //根据oaid判断是否在日志表中存在,如果存在,则更新,如果不存在,则新增 + CbsLogEntity cbsLogEntityResend=new CbsLogEntity(); + cbsLogEntityResend.setOa_id(cbsLogEntity.getOa_id()); + cbsLogEntityResend.setDataSourceCode(oa_data_source_code); + List queryList = query(cbsLogEntityResend); + if(CollectionUtils.isEmpty(queryList)){ + String data = StrUtil.format(getXmlTemplate(),title,pay_company,payee,amount,cbs_apply_code,bill_code,oa_id,tab_name_ch,tab_name_en,pay_state,message,apply_state,successed); + Map headerMap = MapBuilder.create(true) + .put("apiCode", "8000240007") + .put("publicKey","ZJYAorA7JuRDfrVjywcx78BFcqlLwthgXNC65TXxxQMUHuxCe7eDIk+3zDUT+v578prj")//发送者 + .put("secretKey","a54vt9Wx7gdBig+4JCkZ/lISIIL2m4ZEyZkXtW0uQVBDHS+V4SVgT6xhNblacri/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//发送者 + .put("appId","800024") + .build(); + JSONObject paramsTemplate = new JSONObject(); + paramsTemplate.put("loginName", "hzya_rest"); + paramsTemplate.put("dataXml", data); + String params = JSONObject.toJSONString(paramsTemplate); + logger.info("保存支付申请日志到OA底表请求参数:{}",params); + String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(params).timeout(60000).execute().body(); + logger.info("保存支付申请日志到OA底表响应参数:{}",body); + }else{ + for (CbsLogEntity logEntity : queryList) { + logEntity.setPay_state(pay_state); + logEntity.setMessage(message); + logEntity.setApply_state(apply_state); + logEntity.setSuccessed(successed); + logEntity.setBill_code(cbsLogEntity.getBill_code()); + logEntity.setDataSourceCode(oa_data_source_code); + try { + update(logEntity); + }catch (Exception e){ + e.printStackTrace(); + logger.error("更新"); + } + } + } + } + + /** + * 补推,从自己开发的页面或者APIpost + * 需要传oa表单id和表单编号 + * + * @param entity + */ + @Override + public void retry(CbsLogEntity entity) { + PaymentEntity paymentEntity = new PaymentEntity(); + paymentEntity.setOaId(entity.getOa_id()); + paymentEntity.setReferenceNum(entity.getBill_code()); + CbsLogEntity logEntity = new CbsLogEntity(); + logEntity.setId(entity.getId()); + logEntity = cbsLogDao.queryOne(logEntity); + String pay_state = logEntity.getPay_state(); + if (OAPayState.h.getValue().equals(pay_state) + || OAPayState.three.getValue().equals(pay_state) + || OAPayState.k.getValue().equals(pay_state) + || "推送失败".equals(pay_state)){ + //todo 调用重试方法 + }else { + throw new BaseSystemException("只允许补推支付失败的记录"); + } + } + + /** + * 补推,从OA页面 + * 只需要传日志表id就行 + * + * @param jsonObject + */ + @Override + public void resend(JSONObject jsonObject) { + if (null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("id"))){ + String id = jsonObject.getString("id"); + CbsLogEntity cbsLogEntity = new CbsLogEntity(); + cbsLogEntity.setId(id); + cbsLogEntity =cbsLogDao.queryOne(cbsLogEntity); + if (null != cbsLogEntity && StrUtil.isNotEmpty(cbsLogEntity.getOa_id()) && StrUtil.isNotEmpty(cbsLogEntity.getBill_code())){ + retry(cbsLogEntity); + } + } + } + + /** + * 获取token + * + * @param entity + * @return + */ + @Override + public SysExtensionApiEntity getTokenExt(SysExtensionApiEntity entity) { + String token = restUtil.getToken("hzya_rest", "8000240000"); + Map headers = entity.getHeaders(); + if (null == headers){ + headers = new HashMap<>(); + } + headers.put("token",token); + return entity; + } + + /** + * 更新日志 + * + * @param logEntity + */ + @DS("#logEntity.dataSourceCode") + @Override + public void updateLog(CbsLogEntity logEntity) { + cbsLogDao.update(logEntity); + } + + //获取xml模板 + private String getXmlTemplate(){ + return ""; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/PaymentServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/PaymentServiceImpl.java new file mode 100644 index 00000000..3a8b01f1 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/PaymentServiceImpl.java @@ -0,0 +1,150 @@ +package com.hzya.frame.seeyon.cbs8.service.impl; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.seeyon.cbs8.dao.IPaymentDao; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; +import com.hzya.frame.seeyon.cbs8.service.IPaymentService; +import com.hzya.frame.seeyon.util.OAPayState; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/6 16:34 + **/ +@Service("OAPaymentServiceImpl") +public class PaymentServiceImpl extends BaseService implements IPaymentService { + + + + private IPaymentDao paymentDao; + + @Autowired + public void setPaymentDao(IPaymentDao paymentDao) { + this.paymentDao = paymentDao; + this.dao = paymentDao; + } + + /** + * 查询列表 + * @param entity + * @return + */ + @DS("#entity.dataSourceCode") + @Override + public List query(PaymentEntity entity) { + List list = paymentDao.queryList(entity, "com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.entity_list_base"); + return list; + } + + /** + * 查询待支付的数据 需要推送到CBS的 + * 如果需要查询流程状态已结束的 需要调用方设置finishedflag=1 + * + * @param entity + * @return + * @throws Exception + */ + + + @DS("#entity.dataSourceCode") + @Override + public List queryUnpaid(PaymentEntity entity) throws Exception { + List list = paymentDao.queryList(entity, "com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.PaymentEntity_list_base_unpaid"); + return list; + } + + /** + * 查询交易成功的数据 + * 内置了查询条件payResult = PayState.payStateGetValue("g"); 支付成功 + * + * @param entity + * @return + * @throws Exception + */ + @DS("#entity.dataSourceCode") + @Override + public List querySuccess(PaymentEntity entity) throws Exception { + if (null == entity){ + entity = new PaymentEntity(); + } + entity.setPayResult(OAPayState.payStateGetValue("g")); + List list = paymentDao.queryList(entity, "com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.PaymentEntity_list_base"); + return list; + } + + /** + * 查询交易成功,且电子回单为空的 + * + * @param entity + * @return + * @throws Exception + */ + @DS("#entity.dataSourceCode") + @Override + public List queryElecIsNull(PaymentEntity entity) throws Exception { + List list = paymentDao.queryList(entity, "com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.PaymentEntity_list_base_elec_isnull"); + return list; + } + + /** + * 查询支付中的数据 + * 内置了查询条件 payResult = '支付中' or payResult not in ('审批撤销','审批拒绝','处理失败','退票','支付成功','取消支付','修改支付','支付失败') + * + * @param entity + * @return + * @throws Exception + */ + @DS("#entity.dataSourceCode") + @Override + public List queryInPayment(PaymentEntity entity) throws Exception { + List list = paymentDao.queryList(entity, "com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.PaymentEntity_list_base_in_payment"); + return list; + } + + /** + * 更新支付状态 + * + * @param entity + * @throws Exception + */ + @DS("#entity.dataSourceCode") + @Override + public void updatePayState(PaymentEntity entity) throws Exception { + if (null != entity + && StrUtil.isNotEmpty(entity.getTableName()) + && StrUtil.isNotEmpty(entity.getOaId()) + && StrUtil.isNotEmpty(entity.getFormsonId()) + && StrUtil.isNotEmpty(entity.getPayDateField()) + && StrUtil.isNotEmpty(entity.getPayResultField())){ + String formsonId = entity.getFormsonId(); + String[] formsonIdArray = formsonId.split(","); + for (String s : formsonIdArray) { + entity.setFormsonId(s); + paymentDao.update("com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.PaymentEntity_update_payState",entity); + } + } + } + + /** + * 更新电子回单字段 + * + * @param entity + * @throws Exception + */ + @DS("#entity.dataSourceCode") + @Override + public void updateElec(PaymentEntity entity) throws Exception { + if (null != entity + && StrUtil.isNotEmpty(entity.getTableName()) + && StrUtil.isNotEmpty(entity.getOaId()) + && StrUtil.isNotEmpty(entity.getReceiptFiled())){ + paymentDao.update("com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.PaymentEntity_update_electronic",entity); + } + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/TransactionDetailServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/TransactionDetailServiceImpl.java new file mode 100644 index 00000000..21cee3ea --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/TransactionDetailServiceImpl.java @@ -0,0 +1,98 @@ +package com.hzya.frame.seeyon.cbs8.service.impl; + +import cn.hutool.core.map.MapBuilder; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.seeyon.cbs8.dao.ITransactionDetailDao; +import com.hzya.frame.seeyon.cbs8.entity.TransactionDetailEntity; +import com.hzya.frame.seeyon.cbs8.service.IPaymentService; +import com.hzya.frame.seeyon.cbs8.service.ITransactionDetailService; +import com.hzya.frame.stringutil.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/24 11:08 + **/ +@Service(value = "OATransactionDetailServiceImpl") +public class TransactionDetailServiceImpl extends BaseService implements ITransactionDetailService { + + private ITransactionDetailDao transactionDetailDao; + + @Autowired + public void setTransactionDetailDao(ITransactionDetailDao dao) { + this.transactionDetailDao = dao; + this.dao=dao; + } + + /** + * 只返回交易流水号 + * + * @param entity + * @return + */ + @DS("#entity.dataSourceCode") + @Override + public List querySerialNumber(TransactionDetailEntity entity) { + List list = transactionDetailDao.queryList(entity, "TransactionDetailEntity_list_serialNumber");; + return list; + } + + /** + * 保存交易明细,通过rest接口的方式 + * + * @param entity + * @throws Exception + */ + @Override + public void restSave(TransactionDetailEntity entity) { + String field0001= StringUtil.nullConvert(entity.getAccountNo());//我方银行账号 + String field0002=StringUtil.nullConvert(entity.getAccountName());//我方户名 + String field0003=StringUtil.nullConvert(entity.getOpenBank());//我方开户行 + String field0004=StringUtil.nullConvert(entity.getBankType());//我方银行类型 + String field0005=StringUtil.nullConvert(entity.getTransactionSerialNumber());//交易流水号 + String field0006=StringUtil.nullConvert(entity.getBankTransactionDate());//交易日期 + String field0007=StringUtil.nullConvert(entity.getBankSerialNumber());//银行流水号 + String field0008=StringUtil.nullConvert(entity.getCurrency());//币种 + String field0009=StringUtil.nullConvert(entity.getIncurredAmount());//收款金额 + String field0010=StringUtil.nullConvert(entity.getPurpose());//用途 + String field0011=StringUtil.nullConvert(entity.getDigest());//摘要 + String field0012=StringUtil.nullConvert(entity.getOppositeAccount());//对方账号 + String field0013=StringUtil.nullConvert(entity.getOppositeName());//对方户名 + String field0014=StringUtil.nullConvert(entity.getOppositeOpeningBank());//对方开户行 + String field0015=StringUtil.nullConvert(entity.getRemark());//备注 + String data = StrUtil.format(getXmlTemplate(),field0001,field0002,field0003,field0004,field0005,field0006,field0007,field0008,field0009,field0010,field0011,field0012,field0013,field0014,field0015); + Map headerMap = MapBuilder.create(true) + .put("apiCode", "8000240006") + .put("publicKey","ZJYAorA7JuRDfrVjywcx78BFcqlLwthgXNC65TXxxQMUHuxCe7eDIk+3zDUT+v578prj") + .put("secretKey","a54vt9Wx7gdBig+4JCkZ/lISIIL2m4ZEyZkXtW0uQVBDHS+V4SVgT6xhNblacri/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") + .put("appId","800024") + .build(); + JSONObject paramsTemplate = new JSONObject(); + paramsTemplate.put("loginName", "hzya_rest"); + paramsTemplate.put("dataXml", data); + String params = JSONObject.toJSONString(paramsTemplate); + logger.info("保存交易明细到OA底表请求参数:{}",params); + String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(params).timeout(60000).execute().body(); + logger.info("保存交易明细到OA底表响应参数:{}",body); + } + + /** + * 无流程表单模版 + * transaction 交易明细 + * payApply 支付申请日志 + * @return + */ + private String getXmlTemplate(){ + return ""; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICapFormDefinitionDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICapFormDefinitionDao.java new file mode 100644 index 00000000..f892fa11 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICapFormDefinitionDao.java @@ -0,0 +1,51 @@ +package com.hzya.frame.seeyon.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.seeyon.entity.CapFormDefinitionEntity; +import com.hzya.frame.seeyon.entity.CtpFileEntity; +import com.hzya.frame.seeyon.paybill.entity.PayBillEntity; + +import java.util.List; + +/** + * + * @content OA字段配置表DAO + * @className: Administrator + * @author laborer + * @date 2024-09-09 16:00 + * + */ + +public interface ICapFormDefinitionDao extends IBaseDao { + + /** + * + * @content 通过模版编号获取无流程表单配置信息 + * @className: Administrator + * @author laborer + * @date 2024-09-09 16:02 + * + */ + List getFormFiled(CapFormDefinitionEntity fieldInfo); +/** + * + * @content 通过主键删除单据数据 + * @className: Administrator + * @author laborer + * @date 2024-09-09 17:04 + * + */ + + int deleteByKey(CapFormDefinitionEntity fieldInfo); +/** + * + * @content 通过客户传递的数据值查询古河条件的数据 + * @className: Administrator + * @author laborer + * @date 2024-09-09 17:05 + * + */ + + List getFormFiledByFileValue(CapFormDefinitionEntity fieldInfo); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICtpAttachmentDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICtpAttachmentDao.java new file mode 100644 index 00000000..5c64e35f --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICtpAttachmentDao.java @@ -0,0 +1,21 @@ +package com.hzya.frame.seeyon.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.seeyon.entity.CtpAttachmentEntity; + +import java.util.List; + +public interface ICtpAttachmentDao extends IBaseDao { + //更新数据 + @DS("#ctpAttachmentEntity.dataSourceCode") + int updateCtpAttachment(CtpAttachmentEntity ctpAttachmentEntity); + + //根据fiel_url查询附件业务记录,如果存在则更新,如果不存在则新增 + @DS("#ctpAttachmentEntity.dataSourceCode") + List queryCtpAttachment(CtpAttachmentEntity ctpAttachmentEntity); + + //新增 + @DS("#ctpAttachmentEntity.dataSourceCode") + CtpAttachmentEntity saveCtpAttachment(CtpAttachmentEntity ctpAttachmentEntity); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICtpFileDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICtpFileDao.java new file mode 100644 index 00000000..87961648 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICtpFileDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.seeyon.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.seeyon.entity.CtpFileEntity; + +/** + * @Description seeyon 附件对象 + * @Author xiangerlin + * @Date 2024/6/17 15:21 + **/ +public interface ICtpFileDao extends IBaseDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ISeeYonDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ISeeYonDao.java new file mode 100644 index 00000000..02d6888a --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ISeeYonDao.java @@ -0,0 +1,108 @@ +package com.hzya.frame.seeyon.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.seeyon.entity.SeeyonEntity; + +import java.util.List; + +/** + * com.hzya.frame.seeyon.dao + * + * @author yqh + * @date 2023-08 -30 10:43 + */ + +public interface ISeeYonDao extends IBaseDao { + /*** + * @Content:通过类型获取OA基本档案数据 + * @Author 👻👻👻👻yqh👻👻👻👻 + * @Date 2023年8月30日11:33:17 + * @Param seeyon + * @return + **/ + @DS("ht_oa_sqlserver") + List selectOAListByTypeformson_0324(SeeyonEntity seeyon); + @DS("ht_oa_sqlserver") + List selectOAListByTypeformson_0352(SeeyonEntity seeyon); + @DS("ht_oa_sqlserver") + List selectOAListByTypeMain(SeeyonEntity seeyon); + /** + * 通过关联关系获取附件主键 + * @param seeyonEntity + * @return + */ + @DS("ht_oa_sqlserver") + List selectFileUrl(SeeyonEntity seeyonEntity); +/*** + * @Content:修改数据状态,避免重复抓取 + * @Author 👻👻👻👻yqh👻👻👻👻 + * @Date + * @Param + * @return + **/ + int updateFormStete(SeeyonEntity s); + + /** + * + * @content 查询付款单中得电子回单 + * @Param + * @Return + * @Author hecan + * @Date 2023/11/9 14:23 + * **/ + @DS("ht_oa_sqlserver") + List selectOAListByTypeformmain_0327(SeeyonEntity seeyon); + @DS("ht_oa_sqlserver") + int updateFormformmain_0327(SeeyonEntity seeyon); + + /** + * + * @content 根据付款方id查询付款名 + * @Param + * @Return + * @Author hecan + * @Date 2023/11/9 14:23 + * **/ + @DS("ht_oa_sqlserver") + List selectOAListByField0258(SeeyonEntity seeyon); + + /** + * + * @content 查询速网U8C中的所有组织 + * @Param + * @Return + * @Author hecan + * @Date 2023/11/13 11:56 + * **/ + @DS("sowow_sqlserver_test") + List selectOAListByCorp(SeeyonEntity seeyon); + + /** + * + * @content 修改OA中的字段为速网U8C销售订单主键 + * @Param + * @Return + * @Author hecan + * @Date 2023/11/15 11:28 + * **/ + @DS("swoa_mysql") + int updateFormformmain_0237(SeeyonEntity seeyonEntity); + @DS("swoa_mysql") + int updateFormformson_0238(SeeyonEntity seeyonEntity); + //根据销售订单编码查询档案主键 + @DS("swoa_mysql") + SeeyonEntity selectOAListByformmain_0237(SeeyonEntity seeyonEntity); + + /** + * + * @content 修改付款单报销单等单据的推送状态 + * @Param + * @Return + * @Author hecan + * @Date 2023/12/20 8:59 + * **/ + @DS("ht_oa_sqlserver") + int updatepush(SeeyonEntity seeyon); + +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ISeeYonInterFaceDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ISeeYonInterFaceDao.java new file mode 100644 index 00000000..2edbc648 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ISeeYonInterFaceDao.java @@ -0,0 +1,37 @@ +package com.hzya.frame.seeyon.dao; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity; + +import java.util.List; +import java.util.Map; + +/** + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2023-08-30 10:27 + */ +public interface ISeeYonInterFaceDao { + /*** + * 查询OA档案数据,暂时只根据ID查询,只返回ID集合,此方法暂时用于更新无流程表单判断 + * @content: + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-30 10:54 + * @param + * @return java.util.List + **/ + List queryArchives(SeeYonInterFaceEntity seeYonInterFaceEntity); + + /*** + * 答应我写注释好吗 + * @content: + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2024-01-18 16:01 + * @param jsonObject 根据模版ID获取数据 + * @return java.util.List + **/ + List queryDefinitionInfo(SeeYonInterFaceEntity jsonObject); + List> queryDefinitionData(SeeYonInterFaceEntity jsonObject); + +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CapFormDefinitionDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CapFormDefinitionDaoImpl.java new file mode 100644 index 00000000..07304f45 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CapFormDefinitionDaoImpl.java @@ -0,0 +1,39 @@ +package com.hzya.frame.seeyon.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.dao.ICapFormDefinitionDao; +import com.hzya.frame.seeyon.dao.ICtpFileDao; +import com.hzya.frame.seeyon.entity.CapFormDefinitionEntity; +import com.hzya.frame.seeyon.entity.CtpFileEntity; +import com.hzya.frame.seeyon.paybill.entity.PayBillEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * + * @content OA字段配置表DAO + * @className: Administrator + * @author laborer + * @date 2024-09-09 16:00 + * + */ +@Repository(value = "CapFormDefinitionDaoImpl") +public class CapFormDefinitionDaoImpl extends MybatisGenericDao implements ICapFormDefinitionDao { + @DS("#fieldInfo.dataSourceCode") + @Override + public List getFormFiled(CapFormDefinitionEntity fieldInfo) { + return (List) selectList("com.hzya.frame.seeyon.entity.CapFormDefinitionEntity.CapFormDefinitionEntity_list_base",fieldInfo); + } + @DS("#fieldInfo.dataSourceCode") + @Override + public int deleteByKey(CapFormDefinitionEntity fieldInfo) { + return super.delete("com.hzya.frame.seeyon.entity.CapFormDefinitionEntity.CapFormDefinitionEntity_delete",fieldInfo); + } + @DS("#fieldInfo.dataSourceCode") + @Override + public List getFormFiledByFileValue(CapFormDefinitionEntity fieldInfo) { + return (List) selectList("com.hzya.frame.seeyon.entity.CapFormDefinitionEntity.CapFormDefinitionEntity_list_table_info",fieldInfo); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpAttachmentDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpAttachmentDaoImpl.java new file mode 100644 index 00000000..080c28bc --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpAttachmentDaoImpl.java @@ -0,0 +1,31 @@ +package com.hzya.frame.seeyon.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.dao.ICtpAttachmentDao; +import com.hzya.frame.seeyon.entity.CtpAttachmentEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository(value = "ctpAttachmentDaoImpl") +public class +CtpAttachmentDaoImpl extends MybatisGenericDao implements ICtpAttachmentDao { + @DS("#ctpAttachmentEntity.dataSourceCode") + @Override + public int updateCtpAttachment(CtpAttachmentEntity ctpAttachmentEntity) { + return super.update("com.hzya.frame.seeyon.dao.impl.CtpAttachmentDaoImpl.entity_update",ctpAttachmentEntity); + } + + @DS("#ctpAttachmentEntity.dataSourceCode") + @Override + public List queryCtpAttachment(CtpAttachmentEntity ctpAttachmentEntity) { + return (List) super.selectList("com.hzya.frame.seeyon.dao.impl.CtpAttachmentDaoImpl.entity_list_base",ctpAttachmentEntity); + } + + @DS("#ctpAttachmentEntity.dataSourceCode") + @Override + public CtpAttachmentEntity saveCtpAttachment(CtpAttachmentEntity ctpAttachmentEntity) { + return super.save("com.hzya.frame.seeyon.dao.impl.CtpAttachmentDaoImpl.entity_insert",ctpAttachmentEntity); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpFileDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpFileDaoImpl.java new file mode 100644 index 00000000..8b80d3d7 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpFileDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.seeyon.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.dao.ICtpAttachmentDao; +import com.hzya.frame.seeyon.dao.ICtpFileDao; +import com.hzya.frame.seeyon.entity.CtpAttachmentEntity; +import com.hzya.frame.seeyon.entity.CtpFileEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/17 15:22 + **/ +@Repository() +public class CtpFileDaoImpl extends MybatisGenericDao implements ICtpFileDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/SeeYonDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/SeeYonDaoImpl.java new file mode 100644 index 00000000..332ae7fc --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/SeeYonDaoImpl.java @@ -0,0 +1,94 @@ +package com.hzya.frame.seeyon.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.dao.ISeeYonDao; +import com.hzya.frame.seeyon.entity.SeeyonEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * com.hzya.frame.seeyon.dao.impl + * + * @author yqh + * @date 2023-08 -30 10:44 + */ +@DS("htsqlserver") +@Repository(value = "seeYonDaoImpl") +public class SeeYonDaoImpl extends MybatisGenericDao implements ISeeYonDao { + @DS("ht_oa_sqlserver") + @Override + public List selectOAListByTypeformson_0352(SeeyonEntity seeyon) { + return (List) super.selectList("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_list_base_formson_0352",seeyon); + } + @DS("ht_oa_sqlserver") + @Override + public List selectOAListByTypeformson_0324(SeeyonEntity seeyon) { + return (List) super.selectList("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_list_base_formson_0324",seeyon); + } + @DS("ht_oa_sqlserver") + @Override + public List selectOAListByTypeMain(SeeyonEntity seeyon) { + return (List) super.selectList("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_list_base_main",seeyon); + } + @DS("ht_oa_sqlserver") + @Override + public List selectFileUrl(SeeyonEntity seeyon) { + return (List) super.selectList("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_list_base_ctp_attachment",seeyon); + } + @DS("ht_oa_sqlserver") + @Override + public int updateFormStete(SeeyonEntity s) { + return super.update("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_update",s); + } + + @DS("ht_oa_sqlserver") + @Override + public List selectOAListByTypeformmain_0327(SeeyonEntity seeyon) { + return (List) super.selectList("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_list_base_formmain_0327",seeyon); + } + + @DS("ht_oa_sqlserver") + @Override + public int updateFormformmain_0327(SeeyonEntity seeyon) { + return super.update("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_update_formmain_0327",seeyon); + } + + @DS("ht_oa_sqlserver") + @Override + public List selectOAListByField0258(SeeyonEntity seeyon) { + return (List) super.selectList("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_list_base_field0258",seeyon); + } + + @DS("sowow_sqlserver_test") + @Override + public List selectOAListByCorp(SeeyonEntity seeyon) { + return (List) super.selectList("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_list_base_corp",seeyon); + } + + @Override + @DS("swoa_mysql") + public int updateFormformmain_0237(SeeyonEntity seeyonEntity) { + return super.update("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_update_formmain_0237",seeyonEntity); + } + + @Override + @DS("swoa_mysql") + public int updateFormformson_0238(SeeyonEntity seeyonEntity) { + return super.update("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_update_formson_0238",seeyonEntity); + } + + @Override + @DS("swoa_mysql") + public SeeyonEntity selectOAListByformmain_0237(SeeyonEntity seeyonEntity) { + return (SeeyonEntity) super.selectOne("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_list_base_formmain_0237",seeyonEntity); + } + + @DS("ht_oa_sqlserver") + @Override + public int updatepush(SeeyonEntity seeyon) { + return super.update("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_update_push",seeyon); + } + +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/SeeYonInterFaceDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/SeeYonInterFaceDaoImpl.java new file mode 100644 index 00000000..4091f0be --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/SeeYonInterFaceDaoImpl.java @@ -0,0 +1,43 @@ +package com.hzya.frame.seeyon.dao.impl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.dao.ISeeYonInterFaceDao; +import com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +/** + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2023-08-30 10:27 + */ +@Repository(value = "seeYonInterFaceDao") +public class SeeYonInterFaceDaoImpl extends MybatisGenericDao implements ISeeYonInterFaceDao { + + + @Override + @DS("ht_oa_sqlserver") + public List queryArchives(SeeYonInterFaceEntity seeYonInterFaceEntity) { + List list = super.query("com.hzya.frame.seeyon.dao.impl.SeeYonInterFaceDaoImpl.queryArchives",seeYonInterFaceEntity); + return list; + } + + @Override + @DS("#seeYonInterFaceEntity.dataSourceCode") + public List queryDefinitionInfo(SeeYonInterFaceEntity seeYonInterFaceEntity) { + + return super.selectList("com.hzya.frame.seeyon.dao.impl.SeeYonInterFaceDaoImpl.queryDefinitionInfo",seeYonInterFaceEntity); + } + + @Override + @DS("#seeYonInterFaceEntity.dataSourceCode") + public List> queryDefinitionData(SeeYonInterFaceEntity seeYonInterFaceEntity) { + List> list = super.selectList("com.hzya.frame.seeyon.dao.impl.SeeYonInterFaceDaoImpl.queryDefinitionData",seeYonInterFaceEntity); + return list ; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.java new file mode 100644 index 00000000..2ab841bd --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.java @@ -0,0 +1,71 @@ +package com.hzya.frame.seeyon.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +import java.io.File; + +/** + * + * @content OA字段配置表 + * @className: Administrator + * @author laborer + * @date 2024-09-09 15:48 + * + */ + +public class CapFormDefinitionEntity extends BaseEntity { + private String fieldInfo;//字段属性定义 + private String viewInfo;//视图权限定义 + private String appbindInfo;//应用绑定定义 + private String tableName;//表名 + private String fieldName;//字段名称 + private String fieldValue;//字段值 + + public String getFieldValue() { + return fieldValue; + } + + public void setFieldValue(String fieldValue) { + this.fieldValue = fieldValue; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getFieldName() { + return fieldName; + } + + public void setFieldName(String fieldName) { + this.fieldName = fieldName; + } + + public String getFieldInfo() { + return fieldInfo; + } + + public void setFieldInfo(String fieldInfo) { + this.fieldInfo = fieldInfo; + } + + public String getViewInfo() { + return viewInfo; + } + + public void setViewInfo(String viewInfo) { + this.viewInfo = viewInfo; + } + + public String getAppbindInfo() { + return appbindInfo; + } + + public void setAppbindInfo(String appbindInfo) { + this.appbindInfo = appbindInfo; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.xml new file mode 100644 index 00000000..5c0a498d --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + id, + field_info, + view_info, + appbind_info + + + + + + + + + + delete from ${tableName} where ${fieldName} = #{id} + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CfsLogEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CfsLogEntity.java new file mode 100644 index 00000000..31c22e17 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CfsLogEntity.java @@ -0,0 +1,65 @@ +package com.hzya.frame.seeyon.entity; + +/** + * @Description 保存交行日志用 + * @Author xiangerlin + * @Date 2024/3/18 14:07 + **/ +public class CfsLogEntity { + + private String tab_name_ch;//中文表名 + private String tab_name_en;//英文表名 + private OAWorkflowEventDataEntity oaWorkflowEventDataEntity;//无流程表单数据 + + private String result;//交通银行返回的参数(解析后的) + public CfsLogEntity() { + + } + + /** + * + * @param tab_name_ch 中文表名 + * @param tab_name_en 英文表名 + * @param oaWorkflowEventDataEntity 无流程表单数据 + */ + public CfsLogEntity(String tab_name_ch, String tab_name_en, OAWorkflowEventDataEntity oaWorkflowEventDataEntity,String result) { + this.tab_name_ch = tab_name_ch; + this.tab_name_en = tab_name_en; + this.oaWorkflowEventDataEntity = oaWorkflowEventDataEntity; + this.result=result; + } + + public String getTab_name_ch() { + return tab_name_ch; + } + + public void setTab_name_ch(String tab_name_ch) { + this.tab_name_ch = tab_name_ch; + } + + public String getTab_name_en() { + return tab_name_en; + } + + public void setTab_name_en(String tab_name_en) { + this.tab_name_en = tab_name_en; + } + + + + public OAWorkflowEventDataEntity getOaWorkflowEventDataEntity() { + return oaWorkflowEventDataEntity; + } + + public void setOaWorkflowEventDataEntity(OAWorkflowEventDataEntity oaWorkflowEventDataEntity) { + this.oaWorkflowEventDataEntity = oaWorkflowEventDataEntity; + } + + public String getResult() { + return result; + } + + public void setResult(String result) { + this.result = result; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CollAttachmentResDTO.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CollAttachmentResDTO.java new file mode 100644 index 00000000..42094a55 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CollAttachmentResDTO.java @@ -0,0 +1,340 @@ +package com.hzya.frame.seeyon.entity; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; +import com.alibaba.fastjson.annotation.JSONField; + +import java.util.List; +import java.util.Map; + +/** + * @Description 查询协同附件列表返回对象 /rest/coll/attachments/{summaryID}/{attType} + * @Author xiangerlin + * @Date 2024/8/16 09:11 + **/ +public class CollAttachmentResDTO { + private String id; //ctp_attachment 表的id + private String reference;// 流程表的id, col_summary + private String subReference;//流程表单附件字段存的id + private String category;//应用分类 + private String type; + private String filename;//附件名称 + private String mimeType;//附件类型 + private String createdate; + private String size;//附件大小 + private String description; + private String fileUrl;//附件id,ctp_file 表的逐渐 + private String extension; + private String icon; + private String iconFont; + private String genesisId; + private String sort; + private String officeTransformEnable; + private String obsObjectKey; + private String secretLevel; + private String secretLevelName; + private String canBrowse; + private String v; + private Boolean wpsOnlineEnable; + private Boolean allowTrans; + private JSONObject transValue; + private String createdateStr; + @JSONField(name = "new") + private Boolean newFile; + private Map extraMap; // 使用Map来存储额外的键值对 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getReference() { + return reference; + } + + public void setReference(String reference) { + this.reference = reference; + } + + public String getSubReference() { + return subReference; + } + + public void setSubReference(String subReference) { + this.subReference = subReference; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getFilename() { + return filename; + } + + public void setFilename(String filename) { + this.filename = filename; + } + + public String getMimeType() { + return mimeType; + } + + public void setMimeType(String mimeType) { + this.mimeType = mimeType; + } + + public String getCreatedate() { + return createdate; + } + + public void setCreatedate(String createdate) { + this.createdate = createdate; + } + + public String getSize() { + return size; + } + + public void setSize(String size) { + this.size = size; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getFileUrl() { + return fileUrl; + } + + public void setFileUrl(String fileUrl) { + this.fileUrl = fileUrl; + } + + public String getExtension() { + return extension; + } + + public void setExtension(String extension) { + this.extension = extension; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getIconFont() { + return iconFont; + } + + public void setIconFont(String iconFont) { + this.iconFont = iconFont; + } + + public String getGenesisId() { + return genesisId; + } + + public void setGenesisId(String genesisId) { + this.genesisId = genesisId; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort; + } + + public String getOfficeTransformEnable() { + return officeTransformEnable; + } + + public void setOfficeTransformEnable(String officeTransformEnable) { + this.officeTransformEnable = officeTransformEnable; + } + + public String getObsObjectKey() { + return obsObjectKey; + } + + public void setObsObjectKey(String obsObjectKey) { + this.obsObjectKey = obsObjectKey; + } + + public String getSecretLevel() { + return secretLevel; + } + + public void setSecretLevel(String secretLevel) { + this.secretLevel = secretLevel; + } + + public String getSecretLevelName() { + return secretLevelName; + } + + public void setSecretLevelName(String secretLevelName) { + this.secretLevelName = secretLevelName; + } + + public String getCanBrowse() { + return canBrowse; + } + + public void setCanBrowse(String canBrowse) { + this.canBrowse = canBrowse; + } + + public String getV() { + return v; + } + + public void setV(String v) { + this.v = v; + } + + public Boolean getWpsOnlineEnable() { + return wpsOnlineEnable; + } + + public void setWpsOnlineEnable(Boolean wpsOnlineEnable) { + this.wpsOnlineEnable = wpsOnlineEnable; + } + + public Boolean getAllowTrans() { + return allowTrans; + } + + public void setAllowTrans(Boolean allowTrans) { + this.allowTrans = allowTrans; + } + + public JSONObject getTransValue() { + return transValue; + } + + public void setTransValue(JSONObject transValue) { + this.transValue = transValue; + } + + public String getCreatedateStr() { + return createdateStr; + } + + public void setCreatedateStr(String createdateStr) { + this.createdateStr = createdateStr; + } + + public Boolean getNewFile() { + return newFile; + } + + public void setNewFile(Boolean newFile) { + this.newFile = newFile; + } + + public Map getExtraMap() { + return extraMap; + } + + public void setExtraMap(Map extraMap) { + this.extraMap = extraMap; + } + + public static void main(String[] args) { + String str = "[{\n" + + "\t\"id\": 5180424495316486643,\n" + + "\t\"reference\": -1741558410793893622,\n" + + "\t\"subReference\": 584122959825946183,\n" + + "\t\"category\": 66,\n" + + "\t\"type\": 0,\n" + + "\t\"filename\": \"Order.pdf\",\n" + + "\t\"mimeType\": \"application/pdf\",\n" + + "\t\"createdate\": 1723454209000,\n" + + "\t\"size\": 131234,\n" + + "\t\"description\": null,\n" + + "\t\"fileUrl\": -5577707714790406265,\n" + + "\t\"extension\": \"pdf\",\n" + + "\t\"icon\": \"pdf.gif\",\n" + + "\t\"iconFont\": \"pdf\",\n" + + "\t\"genesisId\": null,\n" + + "\t\"sort\": 0,\n" + + "\t\"officeTransformEnable\": \"disable\",\n" + + "\t\"obsObjectKey\": \"\",\n" + + "\t\"secretLevel\": null,\n" + + "\t\"secretLevelName\": null,\n" + + "\t\"canBrowse\": 1,\n" + + "\t\"v\": \"fcdf8ae9d97bf2969fa6005394442885\",\n" + + "\t\"wpsOnlineEnable\": false,\n" + + "\t\"allowTrans\": false,\n" + + "\t\"transValue\": {\n" + + "\t\t\"isWpsOnlineEnable\": false,\n" + + "\t\t\"isAllowTrans\": false\n" + + "\t},\n" + + "\t\"createdateStr\": \"1723454209000\",\n" + + "\t\"new\": false,\n" + + "\t\"extraMap\": {}\n" + + "}, {\n" + + "\t\"id\": -6639984402087339,\n" + + "\t\"reference\": -1741558410793893622,\n" + + "\t\"subReference\": 649078190027982545,\n" + + "\t\"category\": 66,\n" + + "\t\"type\": 0,\n" + + "\t\"filename\": \"Invoice.pdf\",\n" + + "\t\"mimeType\": \"application/pdf\",\n" + + "\t\"createdate\": 1723454201000,\n" + + "\t\"size\": 158553,\n" + + "\t\"description\": null,\n" + + "\t\"fileUrl\": -4345076582332676605,\n" + + "\t\"extension\": \"pdf\",\n" + + "\t\"icon\": \"pdf.gif\",\n" + + "\t\"iconFont\": \"pdf\",\n" + + "\t\"genesisId\": null,\n" + + "\t\"sort\": 0,\n" + + "\t\"officeTransformEnable\": \"disable\",\n" + + "\t\"obsObjectKey\": \"\",\n" + + "\t\"secretLevel\": null,\n" + + "\t\"secretLevelName\": null,\n" + + "\t\"canBrowse\": 1,\n" + + "\t\"v\": \"85d721af033c7dddf385be2c7ea8d423\",\n" + + "\t\"wpsOnlineEnable\": false,\n" + + "\t\"allowTrans\": false,\n" + + "\t\"transValue\": {\n" + + "\t\t\"isWpsOnlineEnable\": false,\n" + + "\t\t\"isAllowTrans\": false\n" + + "\t},\n" + + "\t\"createdateStr\": \"1723454201000\",\n" + + "\t\"new\": false,\n" + + "\t\"extraMap\": {}\n" + + "}]"; + List list = JSON.parseArray(str,CollAttachmentResDTO.class); + System.out.println(list); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpAttachmentEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpAttachmentEntity.java new file mode 100644 index 00000000..1b482263 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpAttachmentEntity.java @@ -0,0 +1,124 @@ +package com.hzya.frame.seeyon.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +import java.util.Date; + +/** + * + * @content OA附件业务表 + * @Param + * @Return + * @Author hecan + * @Date 2023/11/1 14:58 + * **/ +public class CtpAttachmentEntity extends BaseEntity { + private String id;//主键ID + private String sub_reference;//次数据ID此id为真正写在流程表单中的ID + private String category; //应用分类、 + private String type;//分类 + private String filename;//附件名称 + private String file_url;//附件链接 + private String mime_type;// + private Date createdate;//创建时间 + private String attachment_size;//附件大小 + private String sort;//序号 + private String att_reference;//流程表的ID(col_summary) + private String uuid; + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getSub_reference() { + return sub_reference; + } + + public void setSub_reference(String sub_reference) { + this.sub_reference = sub_reference; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getFilename() { + return filename; + } + + public void setFilename(String filename) { + this.filename = filename; + } + + public String getFile_url() { + return file_url; + } + + public void setFile_url(String file_url) { + this.file_url = file_url; + } + + public String getMime_type() { + return mime_type; + } + + public void setMime_type(String mime_type) { + this.mime_type = mime_type; + } + + public Date getCreatedate() { + return createdate; + } + + public void setCreatedate(Date createdate) { + this.createdate = createdate; + } + + public String getAttachment_size() { + return attachment_size; + } + + public void setAttachment_size(String attachment_size) { + this.attachment_size = attachment_size; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort; + } + + public String getAtt_reference() { + return att_reference; + } + + public void setAtt_reference(String att_reference) { + this.att_reference = att_reference; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpAttachmentEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpAttachmentEntity.xml new file mode 100644 index 00000000..f4747121 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpAttachmentEntity.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + id, + sub_reference, + category, + type, + filename, + file_url, + mime_type, + createdate, + attachment_size, + sort, + att_reference + + + + + + + + + + insert into CTP_ATTACHMENT( + + id, + sub_reference, + category, + type, + filename, + file_url, + mime_type, + attachment_size, + sort, + att_reference, + createdate + + )values + ( + + #{id}, + #{sub_reference}, + #{category}, + #{type}, + #{filename}, + #{file_url}, + #{mime_type}, + #{attachment_size}, + #{sort}, + #{att_reference}, + #{createdate} + + ) + + + + + update CTP_ATTACHMENT set + + sub_reference = #{sub_reference}, + att_reference = #{att_reference} + + where file_url = #{file_url} + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpFileEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpFileEntity.java new file mode 100644 index 00000000..61ebce25 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpFileEntity.java @@ -0,0 +1,113 @@ +package com.hzya.frame.seeyon.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +import java.io.File; + +/** + * @Description OA附件表 + * @Author xiangerlin + * @Date 2021/10/29 08:56 + **/ +public class CtpFileEntity extends BaseEntity { + private String category;//应用类别 + private String type;//类型 + private String filename;//文件名 + private String mime_type;//文件类型 + private String create_date; + private String create_member; + private String file_size;//大小 + private String description;//描述 + private String update_date; + private String account_id; + + + private File file;//临时用 + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getFilename() { + return filename; + } + + public void setFilename(String filename) { + this.filename = filename; + } + + public String getMime_type() { + return mime_type; + } + + public void setMime_type(String mime_type) { + this.mime_type = mime_type; + } + + public String getCreate_date() { + return create_date; + } + + public void setCreate_date(String create_date) { + this.create_date = create_date; + } + + public String getCreate_member() { + return create_member; + } + + public void setCreate_member(String create_member) { + this.create_member = create_member; + } + + public String getFile_size() { + return file_size; + } + + public void setFile_size(String file_size) { + this.file_size = file_size; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getUpdate_date() { + return update_date; + } + + public void setUpdate_date(String update_date) { + this.update_date = update_date; + } + + public String getAccount_id() { + return account_id; + } + + public void setAccount_id(String account_id) { + this.account_id = account_id; + } + + public File getFile() { + return file; + } + + public void setFile(File file) { + this.file = file; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpFileEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpFileEntity.xml new file mode 100644 index 00000000..3f3c8cad --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpFileEntity.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + id, + category, + type, + filename, + mime_type, + create_date, + create_member, + file_size, + description, + update_date, + account_id + + + + + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/OAU8ResponseDTO.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/OAU8ResponseDTO.java new file mode 100644 index 00000000..c8b473ec --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/OAU8ResponseDTO.java @@ -0,0 +1,89 @@ +package com.hzya.frame.seeyon.entity; + +import com.alibaba.fastjson.annotation.JSONField; + +/** + * @Description u8返回对象 + * @Author xiangerlin + * @Date 2024/5/14 15:40 + **/ +public class OAU8ResponseDTO { + @JSONField(name = "Flag") + private String flag; + @JSONField(name = "DataOne") + private String dataOne; + @JSONField(name = "DataTwo") + private String dataTwo; + @JSONField(name = "Msg") + private String msg; + + //如果co初始化失败,或者token不对的时候会返回这些信息 + private String code; + private String success; + private String message; + private String data; + + public String getFlag() { + return flag; + } + + public void setFlag(String flag) { + this.flag = flag; + } + + public String getDataOne() { + return dataOne; + } + + public void setDataOne(String dataOne) { + this.dataOne = dataOne; + } + + public String getDataTwo() { + return dataTwo; + } + + public void setDataTwo(String dataTwo) { + this.dataTwo = dataTwo; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getSuccess() { + return success; + } + + public void setSuccess(String success) { + this.success = success; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getData() { + return data; + } + + public void setData(String data) { + this.data = data; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/OAWorkflowEventDataEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/OAWorkflowEventDataEntity.java new file mode 100644 index 00000000..341e553f --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/OAWorkflowEventDataEntity.java @@ -0,0 +1,153 @@ +package com.hzya.frame.seeyon.entity; + + +import com.alibaba.fastjson.JSONObject; + +import java.util.Map; + +/** + * @Content OA监听事件提供的表单内容 + * @Author 👻👻👻👻👻👻👻👻👻👻 gjh + * @Date 2020-12-24 8:38 + * @Version 1.0 + */ +public class OAWorkflowEventDataEntity { + private String id;//业务表单id + private String eventType;//流程类型 + /** 流程ID*/ + private String summaryId; + /** 节点ID*/ + private String affairId; + private String currentActivityId; + /** 表单表的FORM ID,用此字段标记是哪个流程*/ + private String formApp; + /****/ + private String formViewOperation; + private Object summaryObj; + private String deeCfgId; + private String currentNodeLast; + private Map businessData; + private Map extData; + private String businessDataStr; + private JSONObject hzyaExtData;//存放一些扩展数据 + private String OnProcessFinished; + public String getSummaryId() { + return summaryId; + } + + public void setSummaryId(String summaryId) { + this.summaryId = summaryId; + } + + public String getAffairId() { + return affairId; + } + + public void setAffairId(String affairId) { + this.affairId = affairId; + } + + public String getCurrentActivityId() { + return currentActivityId; + } + + public void setCurrentActivityId(String currentActivityId) { + this.currentActivityId = currentActivityId; + } + + public String getFormApp() { + return formApp; + } + + public void setFormApp(String formApp) { + this.formApp = formApp; + } + + public String getFormViewOperation() { + return formViewOperation; + } + + public void setFormViewOperation(String formViewOperation) { + this.formViewOperation = formViewOperation; + } + + public Object getSummaryObj() { + return summaryObj; + } + + public void setSummaryObj(Object summaryObj) { + this.summaryObj = summaryObj; + } + + public String getDeeCfgId() { + return deeCfgId; + } + + public void setDeeCfgId(String deeCfgId) { + this.deeCfgId = deeCfgId; + } + + public String getCurrentNodeLast() { + return currentNodeLast; + } + + public void setCurrentNodeLast(String currentNodeLast) { + this.currentNodeLast = currentNodeLast; + } + + public Map getBusinessData() { + return businessData; + } + + public void setBusinessData(Map businessData) { + this.businessData = businessData; + } + + public Map getExtData() { + return extData; + } + + public void setExtData(Map extData) { + this.extData = extData; + } + + public String getBusinessDataStr() { + return businessDataStr; + } + + public void setBusinessDataStr(String businessDataStr) { + this.businessDataStr = businessDataStr; + } + + public String getOnProcessFinished() { + return OnProcessFinished; + } + + public void setOnProcessFinished(String onProcessFinished) { + OnProcessFinished = onProcessFinished; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getEventType() { + return eventType; + } + + public void setEventType(String eventType) { + this.eventType = eventType; + } + + public JSONObject getHzyaExtData() { + return hzyaExtData; + } + + public void setHzyaExtData(JSONObject hzyaExtData) { + this.hzyaExtData = hzyaExtData; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeYonInterFaceEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeYonInterFaceEntity.java new file mode 100644 index 00000000..449da122 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeYonInterFaceEntity.java @@ -0,0 +1,112 @@ +package com.hzya.frame.seeyon.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +import java.util.List; + +/** + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2023-08-30 10:38 + */ +public class SeeYonInterFaceEntity extends BaseEntity { + private String tabName; + //三方系统ID + private String tripartiteId; + //OA对应字段 + private String oaField; + //模板info + private String field_info; + //模版ID + private String formAppId; + //主表集合 + private List formMainIds; + //主表ID,用于查询明细数据 + private String formMainId; + //事件类型 + private String eventType; + //表单名称 + private String name; + //流程id + private String summaryId; + public String getTabName() { + return tabName; + } + + public void setTabName(String tabName) { + this.tabName = tabName; + } + + public String getTripartiteId() { + return tripartiteId; + } + + public void setTripartiteId(String tripartiteId) { + this.tripartiteId = tripartiteId; + } + + public String getOaField() { + return oaField; + } + + public void setOaField(String oaField) { + this.oaField = oaField; + } + + public String getField_info() { + return field_info; + } + + public void setField_info(String field_info) { + this.field_info = field_info; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getFormAppId() { + return formAppId; + } + + public void setFormAppId(String formAppId) { + this.formAppId = formAppId; + } + + public List getFormMainIds() { + return formMainIds; + } + + public void setFormMainIds(List formMainIds) { + this.formMainIds = formMainIds; + } + + public String getFormMainId() { + return formMainId; + } + + public void setFormMainId(String formMainId) { + this.formMainId = formMainId; + } + + public String getEventType() { + return eventType; + } + + public void setEventType(String eventType) { + this.eventType = eventType; + } + + public String getSummaryId() { + return summaryId; + } + + public void setSummaryId(String summaryId) { + this.summaryId = summaryId; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeYonInterFaceEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeYonInterFaceEntity.xml new file mode 100644 index 00000000..4190704d --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeYonInterFaceEntity.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + id as id + + + + + + + + + + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeyonEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeyonEntity.java new file mode 100644 index 00000000..773386d0 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeyonEntity.java @@ -0,0 +1,684 @@ +package com.hzya.frame.seeyon.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +import java.util.List; + +/** + * com.hzya.frame.seeyon.entity + * + * @author yqh + * @date 2023-08 -30 10:45 + */ + +public class SeeyonEntity extends BaseEntity { + private String field0026;//合同评审编号 + private String field0001;//关联合同 + private String field0003;//合同编号 + private String field0016;//创建日期 + private String field0002;//合同名称 + private String field0004;//入账公司 + private String field0005;//供应商 + private String field0006;//合同类型 + private String field0015;//合同签订日期 + private String field0009;//合同开始时间 + private String field0010;//合同结束时间 + private String field0012;//是否固定金额 + private String field0013;//合同总金额 + private String field0027;//是否重大合同 + private String field0008;//项目 + private String field0032;//合同附件 + private String field0033;//其他附件 + private String field0034;//业务板块一级 + private String field0035;//合同分类 + private String field0038;//开票信息查询 + private String field0039;//付款信息查询 + private String field0044;//合同数量 + private String field0047;//业务板块二级 + private String field0048;//内容概要与评审理由 + private String field0049;//是否多方 + private String field0050;//是否多项目 + private String field0054;//合同已付金额 + private String field0055;//发票已收金额 + private String field0056;//审批中付款金额 + private String field0057;//审批中已收发票金额 + private String field0017;//行号 + private String field0018;//标的物名称 + private String field0019;//标的物编码 + private String field0021;//规格型号 + private String field0022;//总数量 + private String field0023;//单价 + private String field0024;//不含税金额 + private String field0025;//含税金额 + private String field0036;//税率 + private String field0037;//税务编码 + private String field0040;//已开票数量 + private String field0041;//剩余数量 + private String field0042;//在途数量 + private String field0051;//标的物明细表项目 + private String field0052;//相对方 + private String field0053;//其他相关方名称 + private String tableName;//表名称 + private List formson_0324;//合同标的物明细(明细表1) + private List formson_0352;// 相对方(明细表2) + private String formmain_id;//主表ID + private String file_url;//附件ID + private String sub_reference;//附件管理关系 + private String filename;//附件名称 + private String attachment_size;//文件大小 + private String field0067;//状态 + private String field0066;//业务板块三级 + private String loginName;//登录名 + private String dduid;//钉钉id + + private String field0137;//付款账号 + private String field0264;//CFS电子回单 + private String summary_id;//col_summary表id + private String name;//姓名 + private String pk_corp;//公司主键 + private String field0120;//OA关联速网U8C主键的字段 + + private String field0121;//oa对接erp明细主键 + private String details_id;//销售订单明细id + private String da_id;//销售订单档案id + + private String pushField;//杭泰推送标识字段 + private String pushValue;//推送的值 + private String updateTime; + private String field0066Id; + private String field0047Id; + private String field0034Id; + private String field0103;//钉钉ID + + public String getField0103() { + return field0103; + } + + public void setField0103(String field0103) { + this.field0103 = field0103; + } + + public String getField0066Id() { + return field0066Id; + } + + public void setField0066Id(String field0066Id) { + this.field0066Id = field0066Id; + } + + public String getField0047Id() { + return field0047Id; + } + + public void setField0047Id(String field0047Id) { + this.field0047Id = field0047Id; + } + + public String getField0034Id() { + return field0034Id; + } + + public void setField0034Id(String field0034Id) { + this.field0034Id = field0034Id; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getPushField() { + return pushField; + } + + public void setPushField(String pushField) { + this.pushField = pushField; + } + + public String getPushValue() { + return pushValue; + } + + public void setPushValue(String pushValue) { + this.pushValue = pushValue; + } + + public String getDa_id() { + return da_id; + } + + public void setDa_id(String da_id) { + this.da_id = da_id; + } + + public String getDetails_id() { + return details_id; + } + + public void setDetails_id(String details_id) { + this.details_id = details_id; + } + + public String getField0121() { + return field0121; + } + + public void setField0121(String field0121) { + this.field0121 = field0121; + } + + public String getField0120() { + return field0120; + } + + public void setField0120(String field0120) { + this.field0120 = field0120; + } + + public String getPk_corp() { + return pk_corp; + } + + public void setPk_corp(String pk_corp) { + this.pk_corp = pk_corp; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getField0264() { + return field0264; + } + + public void setField0264(String field0264) { + this.field0264 = field0264; + } + + public String getSummary_id() { + return summary_id; + } + + public void setSummary_id(String summary_id) { + this.summary_id = summary_id; + } + + public String getField0137() { + return field0137; + } + + public void setField0137(String field0137) { + this.field0137 = field0137; + } + + public String getDduid() { + return dduid; + } + + public void setDduid(String dduid) { + this.dduid = dduid; + } + + public String getLoginName() { + return loginName; + } + + public void setLoginName(String loginName) { + this.loginName = loginName; + } + + public String getField0067() { + return field0067; + } + + public void setField0067(String field0067) { + this.field0067 = field0067; + } + + public String getAttachment_size() { + return attachment_size; + } + + public void setAttachment_size(String attachment_size) { + this.attachment_size = attachment_size; + } + + public String getFilename() { + return filename; + } + + public void setFilename(String filename) { + this.filename = filename; + } + + public String getSub_reference() { + return sub_reference; + } + + public void setSub_reference(String sub_reference) { + this.sub_reference = sub_reference; + } + + public String getFile_url() { + return file_url; + } + + public void setFile_url(String file_url) { + this.file_url = file_url; + } + + public String getFormmain_id() { + return formmain_id; + } + + public void setFormmain_id(String formmain_id) { + this.formmain_id = formmain_id; + } + + public List getFormson_0324() { + return formson_0324; + } + + public void setFormson_0324(List formson_0324) { + this.formson_0324 = formson_0324; + } + + public List getFormson_0352() { + return formson_0352; + } + + public void setFormson_0352(List formson_0352) { + this.formson_0352 = formson_0352; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getField0026() { + return field0026; + } + + public void setField0026(String field0026) { + this.field0026 = field0026; + } + + public String getField0001() { + return field0001; + } + + public void setField0001(String field0001) { + this.field0001 = field0001; + } + + public String getField0003() { + return field0003; + } + + public void setField0003(String field0003) { + this.field0003 = field0003; + } + + public String getField0016() { + return field0016; + } + + public void setField0016(String field0016) { + this.field0016 = field0016; + } + + public String getField0002() { + return field0002; + } + + public void setField0002(String field0002) { + this.field0002 = field0002; + } + + public String getField0004() { + return field0004; + } + + public void setField0004(String field0004) { + this.field0004 = field0004; + } + + public String getField0005() { + return field0005; + } + + public void setField0005(String field0005) { + this.field0005 = field0005; + } + + public String getField0006() { + return field0006; + } + + public void setField0006(String field0006) { + this.field0006 = field0006; + } + + public String getField0015() { + return field0015; + } + + public void setField0015(String field0015) { + this.field0015 = field0015; + } + + public String getField0009() { + return field0009; + } + + public void setField0009(String field0009) { + this.field0009 = field0009; + } + + public String getField0010() { + return field0010; + } + + public void setField0010(String field0010) { + this.field0010 = field0010; + } + + public String getField0012() { + return field0012; + } + + public void setField0012(String field0012) { + this.field0012 = field0012; + } + + public String getField0013() { + return field0013; + } + + public void setField0013(String field0013) { + this.field0013 = field0013; + } + + public String getField0027() { + return field0027; + } + + public void setField0027(String field0027) { + this.field0027 = field0027; + } + + public String getField0008() { + return field0008; + } + + public void setField0008(String field0008) { + this.field0008 = field0008; + } + + public String getField0032() { + return field0032; + } + + public void setField0032(String field0032) { + this.field0032 = field0032; + } + + public String getField0033() { + return field0033; + } + + public void setField0033(String field0033) { + this.field0033 = field0033; + } + + public String getField0034() { + return field0034; + } + + public void setField0034(String field0034) { + this.field0034 = field0034; + } + + public String getField0035() { + return field0035; + } + + public void setField0035(String field0035) { + this.field0035 = field0035; + } + + public String getField0038() { + return field0038; + } + + public void setField0038(String field0038) { + this.field0038 = field0038; + } + + public String getField0039() { + return field0039; + } + + public void setField0039(String field0039) { + this.field0039 = field0039; + } + + public String getField0044() { + return field0044; + } + + public void setField0044(String field0044) { + this.field0044 = field0044; + } + + public String getField0047() { + return field0047; + } + + public void setField0047(String field0047) { + this.field0047 = field0047; + } + + public String getField0048() { + return field0048; + } + + public void setField0048(String field0048) { + this.field0048 = field0048; + } + + public String getField0049() { + return field0049; + } + + public void setField0049(String field0049) { + this.field0049 = field0049; + } + + public String getField0050() { + return field0050; + } + + public void setField0050(String field0050) { + this.field0050 = field0050; + } + + public String getField0054() { + return field0054; + } + + public void setField0054(String field0054) { + this.field0054 = field0054; + } + + public String getField0055() { + return field0055; + } + + public void setField0055(String field0055) { + this.field0055 = field0055; + } + + public String getField0056() { + return field0056; + } + + public void setField0056(String field0056) { + this.field0056 = field0056; + } + + public String getField0057() { + return field0057; + } + + public void setField0057(String field0057) { + this.field0057 = field0057; + } + + public String getField0017() { + return field0017; + } + + public void setField0017(String field0017) { + this.field0017 = field0017; + } + + public String getField0018() { + return field0018; + } + + public void setField0018(String field0018) { + this.field0018 = field0018; + } + + public String getField0019() { + return field0019; + } + + public void setField0019(String field0019) { + this.field0019 = field0019; + } + + public String getField0021() { + return field0021; + } + + public void setField0021(String field0021) { + this.field0021 = field0021; + } + + public String getField0022() { + return field0022; + } + + public void setField0022(String field0022) { + this.field0022 = field0022; + } + + public String getField0023() { + return field0023; + } + + public void setField0023(String field0023) { + this.field0023 = field0023; + } + + public String getField0024() { + return field0024; + } + + public void setField0024(String field0024) { + this.field0024 = field0024; + } + + public String getField0025() { + return field0025; + } + + public void setField0025(String field0025) { + this.field0025 = field0025; + } + + public String getField0036() { + return field0036; + } + + public void setField0036(String field0036) { + this.field0036 = field0036; + } + + public String getField0037() { + return field0037; + } + + public void setField0037(String field0037) { + this.field0037 = field0037; + } + + public String getField0040() { + return field0040; + } + + public void setField0040(String field0040) { + this.field0040 = field0040; + } + + public String getField0041() { + return field0041; + } + + public void setField0041(String field0041) { + this.field0041 = field0041; + } + + public String getField0042() { + return field0042; + } + + public void setField0042(String field0042) { + this.field0042 = field0042; + } + + public String getField0051() { + return field0051; + } + + public void setField0051(String field0051) { + this.field0051 = field0051; + } + + public String getField0052() { + return field0052; + } + + public void setField0052(String field0052) { + this.field0052 = field0052; + } + + public String getField0053() { + return field0053; + } + + public void setField0053(String field0053) { + this.field0053 = field0053; + } + + public String getField0066() { + return field0066; + } + + public void setField0066(String field0066) { + this.field0066 = field0066; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeyonEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeyonEntity.xml new file mode 100644 index 00000000..83714c7d --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeyonEntity.xml @@ -0,0 +1,250 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + + + + splitbank,bankaccno,name,code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update formmain_0327 set field0264 = #{field0264} where id = #{id} + + + + + update formmain_0323 set field0067 = 'Y' + where id = #{id} + + + + + update formmain_0237 set field0120 = #{field0120} + where field0010 = #{field0010} + + + + + update formson_0238 set field0121 = #{field0121} + where field0012 = #{field0012} and formmain_id=#{formmain_id} + + + + + update ${tableName} set ${pushField} = #{pushValue} + where id=#{id} + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/enums/ColEventTypeEnum.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/enums/ColEventTypeEnum.java new file mode 100644 index 00000000..69b1af3e --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/enums/ColEventTypeEnum.java @@ -0,0 +1,45 @@ +package com.hzya.frame.seeyon.enums; + +/** + * 流程事件类型枚举 + */ +public enum ColEventTypeEnum { + + ONBEFORESTART("onBeforeStart","流程发起前"), + ONSTART("onStart","流程发起"), + ONBEFORESTOP("onBeforeStop","终止前事件"), + ONSTOP("onStop","终止事件"), + ONBEFORECANCEL("onBeforeCancel","撤销前事件"), + ONCANCEL("onCancel","撤销事件"), + ONPROCESSFINISHED("onProcessFinished","结束事件"), + ONBEFOREFINISHWORKITEM("onBeforeFinishWorkitem","处理前事件"), + ONFINISHWORKITEM("onFinishWorkitem","处理事件"), + ONBEFORESTEPBACK("onBeforeStepBack","回退前事件"), + ONSTEPBACK("onStepBack","回退事件"), + ONBEFORETAKEBACK("onBeforeTakeBack","取回前事件"), + ONTAKEBACK("onTakeBack","取回事件"), + ; + private String type; + private String name; + + ColEventTypeEnum(String type, String name) { + this.type = type; + this.name = name; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/IPayBillDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/IPayBillDao.java new file mode 100644 index 00000000..a0ec8db8 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/IPayBillDao.java @@ -0,0 +1,33 @@ +package com.hzya.frame.seeyon.paybill.dao; + +import com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity; +import com.hzya.frame.seeyon.paybill.entity.PayBillEntity; + +import java.util.List; +import java.util.Map; + +/** + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2023-08-30 10:27 + */ +public interface IPayBillDao { +/** + * + * @content 获取OA工程付款单数据 + * @author laborer + * @date 2024/6/20 0020 11:30 + * + */ + List getOaEngineerPay(PayBillEntity entity); +/** + * + * @content 修改推送状态 + * @author laborer + * @date 2024/6/21 0021 11:15 + * + */ + + int updateState(PayBillEntity pay); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/impl/PayBillDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/impl/PayBillDaoImpl.java new file mode 100644 index 00000000..3a753554 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/impl/PayBillDaoImpl.java @@ -0,0 +1,32 @@ +package com.hzya.frame.seeyon.paybill.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity; +import com.hzya.frame.seeyon.paybill.dao.IPayBillDao; +import com.hzya.frame.seeyon.paybill.entity.PayBillEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +/** + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2023-08-30 10:27 + */ +@Repository(value = "PayBillDaoImpl") +public class PayBillDaoImpl extends MybatisGenericDao implements IPayBillDao { + + @DS("#entity.dataSourceCode") + @Override + public List getOaEngineerPay(PayBillEntity entity) { + return super.selectList("com.hzya.frame.seeyon.paybill.dao.impl.PayBillDaoImpl.PayBillEntity_list_base",entity); + } + @DS("#pay.dataSourceCode") + @Override + public int updateState(PayBillEntity pay) { + return super.update("com.hzya.frame.seeyon.paybill.dao.impl.PayBillDaoImpl.PayBillEntity_update",pay); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.java new file mode 100644 index 00000000..1a9308de --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.java @@ -0,0 +1,107 @@ +package com.hzya.frame.seeyon.paybill.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +import java.util.List; +import java.util.Map; + +/** + * + * @content 付款結算單 + * @author laborer + * @date 2024/6/20 0020 11:07 + * + */ + +public class PayBillEntity extends BaseEntity { + private String billDate;//付款日期 + private String primalMoney;//付款金额信息 + private String pkOppaccount;//付款银行信息 + private String pkSupplier;//供应商信息 + private String tableName;//表名称 + private String fieldName;//字段名称 + private String state;//推送状态 + private String pkOrg;//组织 + private String pkCustomer;//客户 + private String pk_oppaccount;//付款账户 + + public String getPkCustomer() { + return pkCustomer; + } + + public void setPkCustomer(String pkCustomer) { + this.pkCustomer = pkCustomer; + } + + public String getPk_oppaccount() { + return pk_oppaccount; + } + + public void setPk_oppaccount(String pk_oppaccount) { + this.pk_oppaccount = pk_oppaccount; + } + + public String getPkOrg() { + return pkOrg; + } + + public void setPkOrg(String pkOrg) { + this.pkOrg = pkOrg; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getFieldName() { + return fieldName; + } + + public void setFieldName(String fieldName) { + this.fieldName = fieldName; + } + + public String getBillDate() { + return billDate; + } + + public void setBillDate(String billDate) { + this.billDate = billDate; + } + + public String getPrimalMoney() { + return primalMoney; + } + + public void setPrimalMoney(String primalMoney) { + this.primalMoney = primalMoney; + } + + public String getPkOppaccount() { + return pkOppaccount; + } + + public void setPkOppaccount(String pkOppaccount) { + this.pkOppaccount = pkOppaccount; + } + + public String getPkSupplier() { + return pkSupplier; + } + + public void setPkSupplier(String pkSupplier) { + this.pkSupplier = pkSupplier; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.xml new file mode 100644 index 00000000..736d5914 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + update ${tableName} set ${fieldName} = #{state} where id = #{id} + + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/IPayBillService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/IPayBillService.java new file mode 100644 index 00000000..caad27a7 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/IPayBillService.java @@ -0,0 +1,29 @@ +package com.hzya.frame.seeyon.paybill.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; +import com.hzya.frame.seeyon.paybill.entity.PayBillEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +import java.util.List; + +/** + * + * @content huoqu + * @author laborer获取OA付款单数据并推送BIP生成付款结算单 + * @date 2024/6/20 0020 11:19 + * + */ + +public interface IPayBillService extends IBaseService { +/** + * + * @content 工程付款单数据同步BIP + * @author laborer + * @date 2024/6/20 0020 11:24 + * + */ +JsonResultEntity sendEngineerPayBillToBip(JSONObject requestJson); + +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/impl/PayBillServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/impl/PayBillServiceImpl.java new file mode 100644 index 00000000..5bdf9b4b --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/impl/PayBillServiceImpl.java @@ -0,0 +1,105 @@ +package com.hzya.frame.seeyon.paybill.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; +import com.hzya.frame.seeyon.paybill.dao.IPayBillDao; +import com.hzya.frame.seeyon.paybill.entity.PayBillEntity; +import com.hzya.frame.seeyon.paybill.service.IPayBillService; +import com.hzya.frame.seeyon.service.impl.SeeYonInterFaceImpl; +import com.hzya.frame.seeyon.util.OABipUtil; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.commons.collections.CollectionUtils; +import org.jetbrains.annotations.NotNull; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * + * @content 付款单同步BIP + * @author laborer + * @date 2024/6/20 0020 15:20 + * + */ + +@Service("PayBillServiceImpl") +public class PayBillServiceImpl extends BaseService implements IPayBillService { + private static final Logger logger = LoggerFactory.getLogger(PayBillServiceImpl.class); + + @Autowired + private IPayBillDao payBillDao; + /** + * + * @content 工程付款单数据同步BIP + * @author laborer + * @date 2024/6/20 0020 11:24 + * + */ + @Override + public JsonResultEntity sendEngineerPayBillToBip(JSONObject requestJson) { + PayBillEntity entity = new PayBillEntity(); + requestJson.put("db_code","OA"); + entity.setDataSourceCode(requestJson.getString("db_code")); + ListpayBillEntityList = payBillDao.getOaEngineerPay(entity); + if(CollectionUtils.isNotEmpty(payBillEntityList)){ + for(PayBillEntity pay : payBillEntityList){ + String token = OABipUtil.getBipToken("yonyou","8000230000"); + JSONObject main = bindingAdd(pay); + logger.info("工程付款单调用中台生成BIP付款结算单推送报文{}",main.toString()); + String result = OABipUtil.sendU9cTOBipEsb(main.toString(),"8000230014",token); + logger.info("工程付款单调用中台生成BIP付款结算单返回结果{}",result); + JSONObject resultObj = JSON.parseObject(result); + boolean flag = resultObj.getBoolean("success"); + if(flag){ + pay.setState("Y"); + }else{ + pay.setState("N"); + } + pay.setDataSourceCode(requestJson.getString("db_code")); + payBillDao.updateState(pay); + // todo 后续在写吧(没字段等OA开了外网在创建),修改推送状态,避免再次查询 + } + } + return null; + } + + @NotNull + private JSONObject bindingAdd(PayBillEntity pay) { + JSONObject head = new JSONObject(); + head.put("pk_org","");//所属组织 + head.put("pk_group","");//集团 + head.put("bill_type","F5");//单据类型 默认F5 + head.put("trade_type","D5");//付款结算类型 默认D5 + head.put("source_flag","2");//付款结算类型 默认2 + head.put("bill_date",pay.getBillDate());//单据日期 + head.put("primal_money",pay.getPrimalMoney());//付款原币金额 + head.put("pk_currtype","CNY");//币种 + head.put("billmaker","");//制单人 + //处理明细数据,按照明细付款 多个明细生成多个付款结算单 + JSONArray detailsArr = new JSONArray(); + JSONObject body = new JSONObject(); + body.put("pk_org","");//所属组织 + body.put("pk_group","");//集团 + body.put("bill_type","F5");//单据类型 默认F5 + body.put("trade_type","D5");//付款结算类型 默认D5 + body.put("pk_currtype","CNY");//币种 + body.put("bill_date",pay.getBillDate());//单据日期 + body.put("pay_primal",pay.getPrimalMoney());//付款原币金额 + body.put("creationtime",pay.getBillDate());//创建时间 + body.put("direction","-1");//方向 :1=收;-1=付; + body.put("objecttype","0");//交易对象 + body.put("pk_customer",pay.getPkCustomer());//客户 + body.put("pk_account",pay.getPkOppaccount());//付款银行账号 + detailsArr.add(body); + JSONObject main = new JSONObject(); + main.put("head",head);//表头 + main.put("body",detailsArr);//明细数据 + return main; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/dao/IRecBillDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/dao/IRecBillDao.java new file mode 100644 index 00000000..7668f65e --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/dao/IRecBillDao.java @@ -0,0 +1,31 @@ +package com.hzya.frame.seeyon.recbill.dao; + +import com.hzya.frame.seeyon.recbill.entity.RecBillEntity; + +import java.util.List; + +/** + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2023-08-30 10:27 + */ +public interface IRecBillDao { +/** + * + * @content 获取OA工程付款单数据 + * @author laborer + * @date 2024/6/20 0020 11:30 + * + */ + List getOaRecBill(RecBillEntity rec); +/** + * + * @content 修改推送状态 + * @author laborer + * @date 2024/6/21 0021 11:15 + * + */ + + int updateState(RecBillEntity rec); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/dao/impl/RecBillDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/dao/impl/RecBillDaoImpl.java new file mode 100644 index 00000000..3682e8a2 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/dao/impl/RecBillDaoImpl.java @@ -0,0 +1,30 @@ +package com.hzya.frame.seeyon.recbill.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.recbill.dao.IRecBillDao; +import com.hzya.frame.seeyon.recbill.entity.RecBillEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2023-08-30 10:27 + */ +@Repository(value = "RecBillDaoImpl") +public class RecBillDaoImpl extends MybatisGenericDao implements IRecBillDao { + + @DS("#rec.dataSourceCode") + @Override + public List getOaRecBill(RecBillEntity rec) { + return super.selectList("com.hzya.frame.seeyon.recbill.dao.impl.RecBillDaoImpl.PayBillEntity_list_base",rec); + } + @DS("#rec.dataSourceCode") + @Override + public int updateState(RecBillEntity rec) { + return super.update("com.hzya.frame.seeyon.recbill.dao.impl.RecBillDaoImpl.PayBillEntity_update",rec); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.java new file mode 100644 index 00000000..5a271b5d --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.java @@ -0,0 +1,104 @@ +package com.hzya.frame.seeyon.recbill.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * + * @content 付款結算單 + * @author laborer + * @date 2024/6/20 0020 11:07 + * + */ + +public class RecBillEntity extends BaseEntity { + private String billDate;//付款日期 + private String primalMoney;//付款金额信息 + private String pkOppaccount;//付款银行信息 + private String pkSupplier;//供应商信息 + private String tableName;//表名称 + private String fieldName;//字段名称 + private String state;//推送状态 + private String pkCustomer;//客户 + private String pkAccount;//收款账户 + private String pkOrg;//组织 + + public String getPkCustomer() { + return pkCustomer; + } + + public void setPkCustomer(String pkCustomer) { + this.pkCustomer = pkCustomer; + } + + public String getPkAccount() { + return pkAccount; + } + + public void setPkAccount(String pkAccount) { + this.pkAccount = pkAccount; + } + + public String getPkOrg() { + return pkOrg; + } + + public void setPkOrg(String pkOrg) { + this.pkOrg = pkOrg; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getFieldName() { + return fieldName; + } + + public void setFieldName(String fieldName) { + this.fieldName = fieldName; + } + + public String getBillDate() { + return billDate; + } + + public void setBillDate(String billDate) { + this.billDate = billDate; + } + + public String getPrimalMoney() { + return primalMoney; + } + + public void setPrimalMoney(String primalMoney) { + this.primalMoney = primalMoney; + } + + public String getPkOppaccount() { + return pkOppaccount; + } + + public void setPkOppaccount(String pkOppaccount) { + this.pkOppaccount = pkOppaccount; + } + + public String getPkSupplier() { + return pkSupplier; + } + + public void setPkSupplier(String pkSupplier) { + this.pkSupplier = pkSupplier; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.xml new file mode 100644 index 00000000..21f3fc7e --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + update ${tableName} set ${fieldName} = #{state} where id = #{id} + + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/service/IRecBillService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/service/IRecBillService.java new file mode 100644 index 00000000..96930a43 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/service/IRecBillService.java @@ -0,0 +1,26 @@ +package com.hzya.frame.seeyon.recbill.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * + * @content huoqu + * @author laborer获取OA付款单数据并推送BIP生成付款结算单 + * @date 2024/6/20 0020 11:19 + * + */ + +public interface IRecBillService extends IBaseService { +/** + * + * @content 工程付款单数据同步BIP + * @author laborer + * @date 2024/6/20 0020 11:24 + * + */ +JsonResultEntity sendRecBillToBip(JSONObject requestJson); + +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java new file mode 100644 index 00000000..f65d2855 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java @@ -0,0 +1,104 @@ +package com.hzya.frame.seeyon.recbill.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; +import com.hzya.frame.seeyon.recbill.dao.IRecBillDao; +import com.hzya.frame.seeyon.recbill.entity.RecBillEntity; +import com.hzya.frame.seeyon.recbill.service.IRecBillService; +import com.hzya.frame.seeyon.util.OABipUtil; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.commons.collections.CollectionUtils; +import org.jetbrains.annotations.NotNull; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * + * @content 付款单同步BIP + * @author laborer + * @date 2024/6/20 0020 15:20 + * + */ + +@Service("RecBillServiceImpl") +public class RecBillServiceImpl extends BaseService implements IRecBillService { + private static final Logger logger = LoggerFactory.getLogger(RecBillServiceImpl.class); + + @Autowired + private IRecBillDao payBillDao; + /** + * + * @content 工程付款单数据同步BIP + * @author laborer + * @date 2024/6/20 0020 11:24 + * + */ + @Override + public JsonResultEntity sendRecBillToBip(JSONObject requestJson) { + RecBillEntity entity = new RecBillEntity(); + requestJson.put("db_code","OA"); + entity.setDataSourceCode(requestJson.getString("db_code")); + ListpayBillEntityList = payBillDao.getOaRecBill(entity); + if(CollectionUtils.isNotEmpty(payBillEntityList)){ + for(RecBillEntity pay : payBillEntityList){ + String token = OABipUtil.getBipToken("yonyou","8000230000"); + JSONObject main = bindingAdd(pay); + logger.info("银行流水收款信息数据{}",main.toString()); + String result = OABipUtil.sendU9cTOBipEsb(main.toString(),"8000230016",token); + logger.info("银行流水收款信息数据{}",result); + JSONObject resultObj = JSON.parseObject(result); + boolean flag = resultObj.getBoolean("success"); + if(flag){ + pay.setState("Y"); + }else{ + pay.setState("N"); + } + pay.setDataSourceCode(requestJson.getString("db_code")); + payBillDao.updateState(pay); + // todo 后续在写吧(没字段等OA开了外网在创建),修改推送状态,避免再次查询 + } + } + return null; + } + + @NotNull + private JSONObject bindingAdd(RecBillEntity pay) { + JSONObject head = new JSONObject(); + head.put("pk_org","");//所属组织 + head.put("pk_group","");//集团 + head.put("bill_type","F4");//单据类型 默认F5 + head.put("trade_type","D4");//付款结算类型 默认D5 + head.put("source_flag","2");//付款结算类型 默认2 + head.put("bill_date",pay.getBillDate());//单据日期 + head.put("primal_money",pay.getPrimalMoney());//付款原币金额 + head.put("pk_currtype","CNY");//币种 + head.put("billmaker","");//制单人 + //处理明细数据,按照明细付款 多个明细生成多个付款结算单 + JSONArray detailsArr = new JSONArray(); + JSONObject body = new JSONObject(); + body.put("pk_org","");//所属组织 + body.put("pk_group","");//集团 + body.put("bill_type","F4");//单据类型 默认F5 + body.put("trade_type","D4");//付款结算类型 默认D5 + body.put("pk_currtype","CNY");//币种 + body.put("bill_date",pay.getBillDate());//单据日期 + body.put("pay_primal",pay.getPrimalMoney());//付款原币金额 + body.put("creationtime",pay.getBillDate());//创建时间 + body.put("direction","-1");//方向 :1=收;-1=付; + body.put("objecttype","0");//交易对象 + body.put("pk_customer",pay.getPkCustomer());//客户 + body.put("pk_account",pay.getPkAccount());//收款银行账号 + detailsArr.add(body); + JSONObject main = new JSONObject(); + main.put("head",head);//表头 + main.put("body",detailsArr);//明细数据 + return main; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ICtpAttachmentService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ICtpAttachmentService.java new file mode 100644 index 00000000..3af20d9d --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ICtpAttachmentService.java @@ -0,0 +1,20 @@ +package com.hzya.frame.seeyon.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.entity.CtpAttachmentEntity; + +/** + * @Description seeyon 附件关系 + * @Author xiangerlin + * @Date 2024/6/17 15:30 + **/ +public interface ICtpAttachmentService extends IBaseService { + /** + * 保存附件关系表 + * @param fileUrl ctp_file id + * @param col_summary_id col_summary id + * @param sub_reference 随机uuid + * @return + */ + CtpAttachmentEntity saveAttachment(String fileUrl, String col_summary_id, String sub_reference)throws Exception; +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ICtpFileService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ICtpFileService.java new file mode 100644 index 00000000..b34826ef --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ICtpFileService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.seeyon.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.entity.CtpFileEntity; + +/** + * @Description seeyon 附件 + * @Author xiangerlin + * @Date 2024/6/17 15:23 + **/ +public interface ICtpFileService extends IBaseService { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/INoProcessService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/INoProcessService.java new file mode 100644 index 00000000..57e72e80 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/INoProcessService.java @@ -0,0 +1,26 @@ +package com.hzya.frame.seeyon.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * + * @content 无流程表单公用service + * @className: Administrator + * @author laborer + * @date 2024-09-09 14:53 + * + */ +public interface INoProcessService { +/** + * + * @content 无流程删除通用接口 + * @className: Administrator + * @author laborer + * @date 2024-09-09 15:08 + * + */ + + JsonResultEntity DeleteProcessField(JSONObject requestData); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java new file mode 100644 index 00000000..762023b7 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java @@ -0,0 +1,84 @@ +package com.hzya.frame.seeyon.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * 致远OA接口类 + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2023-08-22 9:29 + */ +public interface ISeeYonInterFace { + + /*** + * 发起OA表单方法 + * @content: + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-22 9:31 + * @param requestData 请求json + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity thirdInterfaceSend(JSONObject requestData); + + + + /*** + * @Content: 提供给OA的标准接口方法,包含参数 entity 为OA 的data信息, , eventType 为事件类型 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2020-12-24 10:36 + * @Param [entity, eventType] + * eventType: + * 发起前事件 onBeforeStart , + * 发起事件 onStart , + * 终止前事件 onBeforeStop , + * 终止事件 onStop, + * 撤销前事件 onBeforeCancel, + * 撤销事件 onCancel, + * 结束事件 onProcessFinished, + * 处理前事件 onBeforeFinishWorkitem, + * 处理事件 onFinishWorkitem, + * 回退前事件 onBeforeStepBack, + * 回退事件 onStepBack, + * 取回前事件 onBeforeTakeBack, + * 取回事件 onTakeBack, + * @return string + **/ + JsonResultEntity thirdInterfaceSeeYonPlugInInterfaceEntrance(JSONObject requestData); + + + /*** + * 致远OA业务流程集成补推方法,需要传递参数 + * @param jsonObject formAppId 表单模版ID CAP_FORM_DEFINITION, formMainIds 集合 dataSourceCode 数据源编码 + * @return ht_oa_sqlserver + * @throws Exception + */ + JsonResultEntity thirdInterfaceSeeYonDefinitionRePush(JSONObject jsonObject) throws Exception; + + /** + * seeyon流程事件监听前置方法,绑定数据源 + * @param sysExtensionApi + * @return + * @throws Exception + */ + SysExtensionApiEntity colEventPre(SysExtensionApiEntity sysExtensionApi)throws Exception; + /** + * seeyon流程事件监听 + * @param jsonObject + * @return + * @throws Exception + */ + JsonResultEntity colEventListener(JSONObject jsonObject)throws Exception; + + /** + * seeyon流程事件监听后置方法,调用三方接口 + * @param jsonStr + * @param formAppId + * @param eventType + * @return + * @throws Exception + */ + String colEventPost(String jsonStr,String formAppId,String eventType)throws Exception; +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeyonExtService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeyonExtService.java new file mode 100644 index 00000000..4f06472d --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeyonExtService.java @@ -0,0 +1,29 @@ +package com.hzya.frame.seeyon.service; + +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * @Description seeyon扩展类 + * @Author xiangerlin + * @Date 2024/5/14 14:04 + **/ +public interface ISeeyonExtService { + + /** + * @Since 3.0 + * 英德赛 OA档案传U8 + * 根据不同formApp来调U8不同接口 + * @param entity + * @return + */ + SysExtensionApiEntity ydcSeeyon2u8(SysExtensionApiEntity entity); + + /** + * @Since 3.0 + * 回调方法 + * @param logEntity + */ + void ydcSeeyon2u8CallBack(SysMessageManageLogEntity logEntity); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/CtpAttachmentServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/CtpAttachmentServiceImpl.java new file mode 100644 index 00000000..0ee1e68f --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/CtpAttachmentServiceImpl.java @@ -0,0 +1,70 @@ +package com.hzya.frame.seeyon.service.impl; + +import cn.hutool.core.date.DateUtil; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.seeyon.dao.ICtpAttachmentDao; +import com.hzya.frame.seeyon.entity.CtpAttachmentEntity; +import com.hzya.frame.seeyon.entity.CtpFileEntity; +import com.hzya.frame.seeyon.service.ICtpAttachmentService; +import com.hzya.frame.seeyon.service.ICtpFileService; +import com.hzya.frame.uuid.UUIDLong; +import org.apache.commons.collections.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/17 15:31 + **/ +@Service(value = "ctpAttachmentService") +public class CtpAttachmentServiceImpl extends BaseService implements ICtpAttachmentService { + + private ICtpAttachmentDao ctpAttachmentDao; + @Autowired + private ICtpFileService ctpFileService; + @Autowired + public void setCtpAttachmentDao(ICtpAttachmentDao dao) { + this.ctpAttachmentDao = dao; + this.dao = dao; + } + + /** + * 保存附件关系表 + * + * @param fileUrl ctp_file id + * @param col_summary_id col_summary id + * @param sub_reference 随机uuid + * @return + */ + @Override + public CtpAttachmentEntity saveAttachment(String fileUrl, String col_summary_id, String sub_reference)throws Exception { + //查一下附件 + CtpFileEntity ctpFileEntity = new CtpFileEntity(); + ctpFileEntity.setId(fileUrl); + ctpFileEntity.setDataSourceCode(""); + List ctpFileList = ctpFileService.query(ctpFileEntity); + if (CollectionUtils.isNotEmpty(ctpFileList)){ + CtpFileEntity ctpFile = ctpFileList.get(0); + if (null != ctpFile){ + CtpAttachmentEntity ctpAttachmentEntity = new CtpAttachmentEntity(); + ctpAttachmentEntity.setId(String.valueOf(UUIDLong.longUUID())); + ctpAttachmentEntity.setFile_url(ctpFile.getId());//ctp_file表的id + ctpAttachmentEntity.setAtt_reference(col_summary_id);//业务表单的id + ctpAttachmentEntity.setSub_reference(sub_reference);//这个字段要保存到业务表附件到字段上 + ctpAttachmentEntity.setCategory("66");//这里写66 才可以显示图片 + ctpAttachmentEntity.setFilename(ctpFile.getFilename()); + ctpAttachmentEntity.setType(ctpFile.getType()); + ctpAttachmentEntity.setMime_type(ctpFile.getMime_type()); + ctpAttachmentEntity.setAttachment_size(ctpFile.getFile_size()); + ctpAttachmentEntity.setCreatedate(new Date()); + this.save(ctpAttachmentEntity); + return ctpAttachmentEntity; + } + } + return null; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/CtpFileServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/CtpFileServiceImpl.java new file mode 100644 index 00000000..31f96553 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/CtpFileServiceImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.seeyon.service.impl; + +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.seeyon.entity.CtpFileEntity; +import com.hzya.frame.seeyon.service.ICtpFileService; +import org.springframework.stereotype.Service; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/17 15:24 + **/ +@Service() +public class CtpFileServiceImpl extends BaseService implements ICtpFileService { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/NoProcessServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/NoProcessServiceImpl.java new file mode 100644 index 00000000..87ba10be --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/NoProcessServiceImpl.java @@ -0,0 +1,119 @@ +package com.hzya.frame.seeyon.service.impl; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.seeyon.dao.ICapFormDefinitionDao; +import com.hzya.frame.seeyon.entity.CapFormDefinitionEntity; +import com.hzya.frame.seeyon.service.INoProcessService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.commons.collections.CollectionUtils; +import org.checkerframework.checker.units.qual.A; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicReference; + +/** + * + * @content 无流程表单公用service + * @className: Administrator + * @author laborer + * @date 2024-09-09 14:53 + * + */ + +@Service(value = "NoProcessServiceImpl") +public class NoProcessServiceImpl implements INoProcessService { + private static final Logger logger = LoggerFactory.getLogger(NoProcessServiceImpl.class); + @Autowired + private ICapFormDefinitionDao capFormDefinitionDao; + @Override + public JsonResultEntity DeleteProcessField(JSONObject requestData) { + Listcount =new ArrayList<>(); + JSONObject jsonStrObj = requestData.getJSONObject("jsonStr"); + String formCode = jsonStrObj.getString("formCode"); + String fieldName = jsonStrObj.getString("fieldName"); + String fieldValue = jsonStrObj.getString("fieldValue"); + if(StrUtil.isEmpty(formCode)){ + return new JsonResultEntity("表单编码不能为空:formCode",false); + } + if(StrUtil.isEmpty(fieldName)){ + return new JsonResultEntity("字段名称不能为空:fieldName",false); + } + if(StrUtil.isEmpty(fieldValue)){ + return new JsonResultEntity("字段值不能为空:fieldValue",false); + } + + //通过表单编号获取表单字段信息 + CapFormDefinitionEntity fieldInfo = new CapFormDefinitionEntity(); + fieldInfo.setAppbindInfo(formCode); + fieldInfo.setDataSourceCode("djoatest"); + ListcapFormDefinitionEntityList = capFormDefinitionDao.getFormFiled(fieldInfo); + if(CollectionUtils.isEmpty(capFormDefinitionEntityList)){ + return new JsonResultEntity("通过表单编号查询表单有误,请检查表单编号:"+formCode,false); + } + + try { + capFormDefinitionEntityList.forEach(item->{ + String appbindInfo = item.getAppbindInfo(); + //格式化字段信息 + JSONObject jsonObject = JSONObject.parseObject(appbindInfo); + boolean queryFlag = false; + //如果模版编号相同则继续删除,反正跳过 + if(formCode.equals(jsonObject.getString("formCode"))){ + JSONObject field = JSONObject.parseObject(item.getFieldInfo()); + JSONObject frontFormmain = field.getJSONObject("front_formmain"); + JSONArray formsons = field.getJSONArray("formsons"); + JSONArray fieldInfoTable = frontFormmain.getJSONArray("fieldInfo"); + //验证需要删除的条件字段在表单属性中是否存在 + for (int i = 0; i < fieldInfoTable.size(); i++) { + JSONObject fieldInfoTableObj = fieldInfoTable.getJSONObject(i); + String name = fieldInfoTableObj.getString("name"); + //如果表单属性中存在该字段则验证通过,如果不存在直接返回错误 + if(name.equals(fieldName)){ + queryFlag = true; + + } + } + //验证通过获取数据库表名称进行数据删除 + if(queryFlag){ + String tableName = frontFormmain.getString("tableName"); + //如果主表名称获取主表的主键进行数据删除 + fieldInfo.setTableName(tableName); + fieldInfo.setFieldName(fieldName); + fieldInfo.setFieldValue(fieldValue); + ListdataFormList = capFormDefinitionDao.getFormFiledByFileValue(fieldInfo); + if(CollectionUtils.isNotEmpty(dataFormList)){ + dataFormList.forEach(item1->{ + String id = item1.getId(); + count.add(id); + fieldInfo.setFieldName("id"); + fieldInfo.setId(id); + capFormDefinitionDao.deleteByKey(fieldInfo); + //循环该表单下面的所有子表信息进行子表删除 + if(CollectionUtils.isNotEmpty(formsons)){ + formsons.forEach(formsonsItem->{ + JSONObject jsonObjectBoddy = JSONObject.parseObject(formsonsItem.toString()); + String bodyTableName = jsonObjectBoddy.getString("tableName"); + fieldInfo.setTableName(bodyTableName); + fieldInfo.setFieldName("formmain_id"); + fieldInfo.setId(id); + capFormDefinitionDao.deleteByKey(fieldInfo); + }); + } + }); + } + } + } + }); + } catch (Exception e) { + throw new RuntimeException(e); + } + return new JsonResultEntity("删除成功,删除的数据ID"+ JSON.toJSONString(count),true); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java new file mode 100644 index 00000000..8e8be89e --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java @@ -0,0 +1,507 @@ +package com.hzya.frame.seeyon.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.map.MapBuilder; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.seeyon.dao.ISeeYonInterFaceDao; +import com.hzya.frame.seeyon.entity.OAWorkflowEventDataEntity; +import com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity; +import com.hzya.frame.seeyon.service.ISeeYonInterFace; +import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity; +import com.hzya.frame.sysnew.application.api.service.ISysApplicationApiService; +import com.hzya.frame.sysnew.application.database.dao.ISysApplicationDatabaseDao; +import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity; +import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import com.hzya.frame.web.exception.BaseSystemException; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2023-08-22 9:30 + */ +@Service(value = "seeYonInterFace") +public class SeeYonInterFaceImpl implements ISeeYonInterFace { + private static final Logger logger = LoggerFactory.getLogger(SeeYonInterFaceImpl.class); + /*** rest 用户名*/ + private static final String RESTUSERNAME = "hzyaRest"; + /*** rest 密码*/ + private static final String RESTPASSWORD = "a5ce21b8-91db-4cec-b3e3-3e44719655fd"; + // TODO 此处URL暂时写死,后续根据传递的应用ID获取 + private static final String sendUrl = "http://60.204.152.210/seeyon/"; + //速网esb地址 + private static final String baseUrl = "http://hzya.ufyct.com:9067/kangarooDataCenter/entranceController/externalCallInterface"; + @Resource + private ISysApplicationDatabaseDao sysApplicationDatabaseDao; + @Autowired + private ISysApplicationApiService sysApplicationApiService; + /** + * 定义所支持的事件静态代码块 + */ + private static final StringBuffer eventTypeBuffer = new StringBuffer(); + + { + eventTypeBuffer.append("发起前事件 onBeforeStart ,"); + eventTypeBuffer.append("发起事件 onStart ,"); + eventTypeBuffer.append("终止前事件 onBeforeStop ,"); + eventTypeBuffer.append("终止事件 onStop,"); + eventTypeBuffer.append("撤销前事件 onBeforeCancel,"); + eventTypeBuffer.append("撤销事件 onCancel,"); + eventTypeBuffer.append("结束事件 onProcessFinished,"); + eventTypeBuffer.append("处理前事件 onBeforeFinishWorkitem,"); + eventTypeBuffer.append("处理事件 onFinishWorkitem,"); + eventTypeBuffer.append("回退前事件 onBeforeStepBack,"); + eventTypeBuffer.append("回退事件 onStepBack,"); + eventTypeBuffer.append("取回前事件 onBeforeTakeBack,"); + eventTypeBuffer.append("取回事件 onTakeBack,"); + } + + //基础档案类型 + private final String ARCHIVESTYPE = "archives"; + //流程表单类型 + private final String FLOWTYPE = "flow"; + //创建基础档案 + private final String CREATEARCHIVES = "create"; + //更新基础档案 + private final String UPDATEARCHIVES = "update"; + //创建基础档案 + private final String CREATEARCHIVESURL = "rest/form/import/"; + //创建基础档案 + private final String UPDATEARCHIVESURL = "rest/form/update"; + @Resource + private ISeeYonInterFaceDao seeYonInterFaceDao; + + + //上一次同步时间 + private String LAST_SYNCHRONISED_TIME = ""; + /**** + * @Content:发起无流程表单接口实现 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2019/12/23 17:03 + * @Param [templateCode 模版编码, sendLoginName 发送人登录帐号 ,xmlData ] + * @return java.lang.Integer + **/ + public static JsonResultEntity saveNoProcess(String templateCode , String interfaceUrl,String sendLoginName, String xmlData) { + String token = getToken(RESTUSERNAME, RESTPASSWORD, sendLoginName); + Map res = new HashMap(); + res.put("loginName", sendLoginName); + res.put("dataXml", xmlData); + res.put("token", token); + String result = HttpRequest.post(sendUrl + interfaceUrl + templateCode).header("token", token).body(JSON.toJSONString(res)).execute().body(); + logger.info("无流程表单执行结果:" + result); + return BaseResult.getFailureMessageEntity("执行成功", result); + } + + public static JsonResultEntity upDateNoProcess(String interfaceUrl, String templateCode, String sendLoginName, String moduleId, String xmlData) { + String token = getToken(RESTUSERNAME, RESTPASSWORD, sendLoginName); + Map res = new HashMap(); + res.put("loginName", sendLoginName); + res.put("dataXml", xmlData); + res.put("token", token); + res.put("moduleId", moduleId); + res.put("templateCode", templateCode); + logger.info("更新无流程表单参数:{}",JSON.toJSONString(res)); + String result = HttpRequest.put(sendUrl + interfaceUrl).header("token", token).body(JSON.toJSONString(res)).execute().body(); + logger.info("更新无流程表单执行结果:" + result); + return BaseResult.getFailureMessageEntity("执行成功", result); + } + + // { +// "moduleId":"5701605966502512923", +// "templateCode":"formmain_0360", +// "loginName":"seeyon", +// "dataXml":"<![CDATA[1438373948291346275]]><![CDATA[9218745623489128746]]><![CDATA[6897123456789123456]]><![CDATA[5729461284567891234]]>" +// } + private static String getToken(String userName, String password, String loginName) { + JSONObject jsonObject = new JSONObject(); + /** 获取token*/ + + jsonObject.put("userName", userName); + jsonObject.put("password", password); + jsonObject.put("loginName", loginName); + logger.info("请求获取token开始---------------------------------------------"); + logger.info("请求参数" + jsonObject.toJSONString()); + String result = HttpUtil.post(sendUrl + "rest/token", jsonObject.toJSONString()); + logger.info("获取token结果---------------------------------------------" + result); + logger.info("获取token结果---------------------------------------------" + result); + jsonObject = JSONObject.parseObject(result); + if ("".equals(result) || result == null) { + logger.info("获取token失败!"); + throw new RuntimeException("获取token失败!"); + } else { + String token = jsonObject.get("id").toString(); + return token; + } + } + + /*** + * 发起OA表单方法 + * @content: + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-22 9:32 + * @param + * @return com.hzya.frame.web.entity.BaseResult + **/ + @Override + public JsonResultEntity thirdInterfaceSend(JSONObject requestData) { + JSONObject jsonStr = requestData.getJSONObject("jsonStr"); + if (ObjectUtils.isEmpty(jsonStr)) { + throw new BaseSystemException("jsonStr为空!请传递参数"); + } + //类型 flow archives + String type = jsonStr.getString("type"); + if (StringUtils.isEmpty(type)) { + throw new BaseSystemException("请传递类型!type 流程表单:flow 基础档案:archives"); + } + //模版编号 + String templateCode = jsonStr.getString("templateCode"); + if (StringUtils.isEmpty(templateCode)) { + throw new BaseSystemException("请传入模版编号!templateCode不允许为空"); + } + JSONObject data = jsonStr.getJSONObject("data"); + String attributeArrayStr = jsonStr.getString("attribute"); + if (StringUtils.isEmpty(attributeArrayStr)) { + throw new BaseSystemException("attribute不允许为空"); + } + List attributeArray = JSON.parseArray(attributeArrayStr, JSONObject.class); + JsonResultEntity result = null; + if (ARCHIVESTYPE.equalsIgnoreCase(type)) { + switch (templateCode){ + //预留的 + case "abc123": + break; + } + } + if (FLOWTYPE.equalsIgnoreCase(type)) { + } + return result; + } + + + @Override + public JsonResultEntity thirdInterfaceSeeYonPlugInInterfaceEntrance(JSONObject requestData){ + String jsonStr = requestData.getString("jsonStr"); + JSONObject jsonObject = requestData.getJSONObject("jsonStr"); + OAWorkflowEventDataEntity entity = JSON.parseObject(jsonStr,OAWorkflowEventDataEntity.class); + logger.info("监听OA事件入参:"+jsonObject.toJSONString()); + JSONObject formBeanData = jsonObject.getJSONObject("businessDataStr"); + String eventType = jsonObject.getString("eventType") ; + /** 流程ID*/ + String summaryId = entity.getSummaryId(); + /** 节点ID*/ + String affairId = entity.getAffairId(); + String currentActivityId = entity.getCurrentActivityId(); + /****/ + String formViewOperation = entity.getFormViewOperation(); + Object summaryObj = entity.getSummaryObj(); + String deeCfgId = entity.getDeeCfgId(); + String currentNodeLast = entity.getCurrentNodeLast(); + Map businessData = JSON.parseObject(entity.getBusinessDataStr(), Map.class); + Map extData = entity.getExtData(); + /** 表单表的FORM ID,用此字段标记是哪个流程*/ + String formApp = entity.getFormApp(); + + //formApp 最好过滤一下 + + + String result = null; + try { + //流程事件处理 + result = colEventPost(jsonStr, formApp, eventType); + }catch (Exception e){ + return BaseResult.getFailureMessageEntity("传递失败",e.getMessage()); + } + try { + /** 根据事件类型处理相关事件*/ + switch (eventType) { + /** 发起前事件*/ + case "onBeforeStart": + break; + /** 发起事件*/ + case "onStart": + //流程发起 新增grpu8单据 + break; + /** 终止前事件*/ + case "onBeforeStop": + break; + /** 终止事件*/ + case "onStop": + //流程终止,更新grpu8单据 + break; + /** 撤销前事件*/ + case "onBeforeCancel": + break; + /** 撤销事件*/ + case "onCancel": + //流程撤销,更新grpu8单据 + break; + /** 结束事件*/ + case "onProcessFinished": + break; + /** 处理前事件*/ + case "onBeforeFinishWorkitem": + /** 根据form处理相关业务表单的数据*/ + switch (formApp) { + case "abc123": + break; + default: + return BaseResult.getFailureMessageEntity("未匹配到表单!当前formID:" + formApp, ""); + } + break; + /** 处理事件*/ + case "onFinishWorkitem": + break; + /** 回退前事件*/ + case "onBeforeStepBack": + break; + /** 回退事件*/ + case "onStepBack": + break; + /** 取回前事件*/ + case "onBeforeTakeBack": + break; + /** 取回事件*/ + case "onTakeBack": + break; + default: +// throw new RuntimeException("传入了非法事件类型!请参照:" + eventTypeBuffer.toString()); + return BaseResult.getFailureMessageEntity("传入了非法事件类型!请参照:" + eventTypeBuffer.toString(), "", ""); + } + return BaseResult.getSuccessMessageEntity("传递成功", result); + }catch (Exception e){ + return BaseResult.getFailureMessageEntity("传递失败",e.getMessage()); + } + } + + + @Override + public JsonResultEntity thirdInterfaceSeeYonDefinitionRePush(JSONObject jsonObject) throws Exception { + JSONObject requestData = jsonObject.getJSONObject("jsonStr"); + JSONArray resultEntityArray = new JSONArray(); + if(null == requestData){ + throw new BaseSystemException("参数传递错误需要jsonStr!"); + } + //表单模版ID + String formAppId = requestData.getString("formAppId"); + //事件事件类型 + String eventType = requestData.getString("eventType"); + //数据源编码 + String dataSourceCode = requestData.getString("dataSourceCode"); + //主表ID集合 formMainIds + JSONArray formMainIds = requestData.getJSONArray("formMainIds"); + if(StrUtil.isEmpty(eventType)){ + throw new BaseSystemException("需要传递eventType 参照致远OA事件!"); + } + if(StrUtil.isEmpty(formAppId)){ + throw new BaseSystemException("需要传递formAppId 参照致远OA 表 CAP_FORM_DEFINITION!"); + } + if(StrUtil.isEmpty(dataSourceCode)){ + throw new BaseSystemException("需要传递dataSourceCode 参照中台表 sys_data_source!"); + } + if(null == formMainIds || formMainIds.size() == 0){ + throw new BaseSystemException("需要传递业务主表数据id集合,不允许全量推送!"); + } + + SeeYonInterFaceEntity seeYonInterFaceEntity = new SeeYonInterFaceEntity(); + BeanUtil.copyProperties(requestData,seeYonInterFaceEntity); + List seeYonInterFaceEntityList = seeYonInterFaceDao.queryDefinitionInfo(seeYonInterFaceEntity); + if(null != seeYonInterFaceEntityList && seeYonInterFaceEntityList.size() >0){ + for(SeeYonInterFaceEntity interFaceEntity : seeYonInterFaceEntityList){ + String field_info = interFaceEntity.getField_info(); + JSONObject infoJson = JSON.parseObject(field_info); + //获取主表信息 + JSONObject formMain = infoJson.getJSONObject("front_formmain"); + //获取明细表信息 + JSONArray formSons = infoJson.getJSONArray("formsons"); + //主表tableName + String formMainTableName = formMain.getString("tableName"); + + /** 设置主表查询条件*/ + interFaceEntity.setTabName(formMainTableName); + interFaceEntity.setDataSourceCode(dataSourceCode); + interFaceEntity.setFormMainIds( formMainIds.toJavaList(String.class) ); + + List> forMainList = seeYonInterFaceDao.queryDefinitionData(interFaceEntity); + for (Map forMainRow : forMainList) { + //定义致远OA事件对象 + JSONObject seeYonBean = new JSONObject(); + //定义主表对象 + JSONObject formMainObj = new JSONObject(); + //获取主表ID + String forMainId = String.valueOf(forMainRow.get("ID")); + //组装主表数据 + for (Map.Entry entry : forMainRow.entrySet()) { + formMainObj.put(entry.getKey().toLowerCase(),entry.getValue()); + } + //组装明细表数据 + if(null != formSons && formSons.size() > 0){ + for(Object formSon : formSons){ + JSONObject son = JSON.parseObject(JSON.toJSONString(formSon)); + //明细数据 + String sonTableName = son.getString("tableName"); + SeeYonInterFaceEntity details = new SeeYonInterFaceEntity(); + details.setFormMainId(forMainId); + details.setTabName(sonTableName); + details.setDataSourceCode(dataSourceCode); + JSONArray jsonArray = new JSONArray(); + List> forSonList = seeYonInterFaceDao.queryDefinitionData(details); + for (Map forSons : forSonList) { + //组装明细数据 + JSONObject forSonJson = new JSONObject(); + for (Map.Entry entry : forSons.entrySet()) { + forSonJson.put(entry.getKey().toLowerCase(),entry.getValue()); + } + jsonArray.add(forSonJson); + } + //设置明细表数据 + seeYonBean.put(sonTableName,jsonArray); + } + } + + seeYonBean.put(formMainTableName,formMainObj); + JSONObject rePushRequestData = new JSONObject(); + JSONObject object = new JSONObject(); + object.put("formApp",formAppId); + object.put("eventType",eventType); + object.put("businessDataStr",seeYonBean.toJSONString()); + object.put("affairId",""); + object.put("summaryId",requestData.getString("summaryId")); + object.put("currentActivityId",""); + object.put("id",forMainId); + object.put("hzyaExtData",requestData.getJSONObject("hzyaExtData")); + logger.info("Method:thirdInterfaceSeeYonDefinitionRePush 组装seeYonBean DATA: {}",seeYonBean.toJSONString()); + + rePushRequestData.put("jsonStr",object); + + + JsonResultEntity resultEntity = thirdInterfaceSeeYonPlugInInterfaceEntrance(rePushRequestData); + if(null != resultEntity){ + resultEntityArray.add(resultEntity.getAttribute()); + }else{ + JSONObject jsonResultEntity = new JSONObject(); + jsonResultEntity.put("msg","从新推送失败"); + jsonResultEntity.put("id",forMainId); + resultEntityArray.add(jsonResultEntity); + + } + + } + } + } + return BaseResult.getSuccessMessageEntity("从新推送执行结束",resultEntityArray); + } + + /** + * seeyon流程事件监听前置方法,绑定数据源 + * @param entity + * @return + * @throws Exception + */ + @Override + public SysExtensionApiEntity colEventPre(SysExtensionApiEntity entity) throws Exception { + try { + SysApplicationEntity applicationEntity = entity.getSendApp(); + SysApplicationDatabaseEntity sysApplicationDatabaseEntity = new SysApplicationDatabaseEntity(); + sysApplicationDatabaseEntity.setSts("Y"); + sysApplicationDatabaseEntity.setDbStatus("1"); + sysApplicationDatabaseEntity.setAppId(applicationEntity.getId()); + sysApplicationDatabaseEntity.setDataSourceCode("master"); + List sysDataSourceEntities = sysApplicationDatabaseDao.queryDSBase(sysApplicationDatabaseEntity); + if(sysDataSourceEntities != null && sysDataSourceEntities.size() > 0){ + String parm = entity.getBodys(); + JSONObject jsonObject = JSONObject.parseObject(parm); + jsonObject.put("dataSourceCode",sysDataSourceEntities.get(0).getSourceCode()); + entity.setBodys(jsonObject.toJSONString()); + } + } catch (Exception e) { + e.printStackTrace(); + } + return entity; + } + + /** + * seeyon流程事件监听 + * + * @param jsonObject + * @return + * @throws Exception + */ + @Override + public JsonResultEntity colEventListener(JSONObject jsonObject) throws Exception { + try { + if (null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("jsonStr"))){ + SeeYonInterFaceEntity entity = jsonObject.getJSONObject("jsonStr").toJavaObject(SeeYonInterFaceEntity.class); + JSONObject requestData = new JSONObject(); + //表单模版ID + requestData.put("formAppId", entity.getFormAppId()); + //事件事件类型 + requestData.put("eventType",entity.getEventType()); + //数据源编码 + requestData.put("dataSourceCode",entity.getDataSourceCode()); + requestData.put("formMainIds",entity.getFormMainIds()); + requestData.put("summaryId",entity.getSummaryId()); + JSONObject jsonStr = new JSONObject(); + jsonStr.put("jsonStr",requestData); + thirdInterfaceSeeYonDefinitionRePush(jsonStr); + } + }catch (Exception e){ + logger.error("流程事件通知接口出错:{}",e); + return BaseResult.getSuccessMessageEntity("失败",e.getMessage()); + } + return BaseResult.getSuccessMessageEntity("成功"); + } + + /** + * seeyon流程事件监听后置方法,调用三方接口 + * + * @param jsonStr + * @param formAppId + * @param eventType + * @return + * @throws Exception + */ + @Override + public String colEventPost(String jsonStr, String formAppId, String eventType) throws Exception { + if (StrUtil.isNotEmpty(jsonStr) && StrUtil.isNotEmpty(formAppId) && StrUtil.isNotEmpty(eventType)){ + SysApplicationApiEntity sysApplicationApiEntity = new SysApplicationApiEntity(); + sysApplicationApiEntity.setHeaderIn(formAppId+"_"+eventType); + List applist = sysApplicationApiService.queryLike(sysApplicationApiEntity); + if (CollectionUtil.isNotEmpty(applist)){ + if (applist.size() > 1){ + throw new BaseSystemException("根据formID:" + formAppId+"查询出多条数据"); + } + SysApplicationApiEntity sysApp = applist.get(0); + Map headerMap = MapBuilder.create(true) + .put("apiCode", String.valueOf(sysApp.getApiCode())) + //这里用中台做为发送方 + .put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj") + .put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") + .put("appId",String.valueOf(sysApp.getAppCode())) + .build(); + String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(jsonStr).timeout(60000).execute().body(); + logger.info("调用中台返回的参数:{}",body); + return body; + } + } + return null; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeyonExtServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeyonExtServiceImpl.java new file mode 100644 index 00000000..9849bb40 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeyonExtServiceImpl.java @@ -0,0 +1,241 @@ +package com.hzya.frame.seeyon.service.impl; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.seeyon.entity.OAWorkflowEventDataEntity; +import com.hzya.frame.seeyon.service.ISeeyonExtService; +import com.hzya.frame.seeyon.util.OAU8Util; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity; +import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogStatusEnum; +import com.hzya.frame.uuid.UUIDLong; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * @Description seeyon扩展类 + * @Author xiangerlin + * @Date 2024/5/14 14:04 + **/ +@Service(value = "seeyonExt") +public class SeeyonExtServiceImpl implements ISeeyonExtService { + + + Logger logger = LogManager.getLogger(getClass()); + + @Autowired + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + + /** + * 英德赛 OA档案传U8 + * 根据不同formApp来调U8不同接口 + * @Since 3.0 + * @param entity + * @return + */ + @Override + public SysExtensionApiEntity ydcSeeyon2u8(SysExtensionApiEntity entity) { + String bodys = entity.getBodys(); + if (StrUtil.isNotEmpty(bodys)){ + try { + OAWorkflowEventDataEntity dataEntity = JSON.parseObject(bodys,OAWorkflowEventDataEntity.class); + String businessDataStr = dataEntity.getBusinessDataStr();//oa表单参数 + JSONObject businessData = JSON.parseObject(businessDataStr); + String formApp = dataEntity.getFormApp(); + SysExtensionApiEntity param = new SysExtensionApiEntity(); + Map headerMap = entity.getHeaders(); + JSONObject hzyaExtData = dataEntity.getHzyaExtData();//扩展参数 + if (null == hzyaExtData){ + hzyaExtData = new JSONObject(); + } + //根据forApp组装不同参数 + switch (formApp){ + case "-8691606453890363968":// + hzyaExtData.put("billCode", "cunhuoabc123456"); + getInventory(businessData,param); + break; + case "6223456019738676230": + getSupplier(businessData,param,hzyaExtData); + break; + case "-9122508232154527168": + getCustomer(businessData,param,hzyaExtData); + break; + default: + param.setBodys("未匹配到表单!当前formID:"+ formApp); + logger.error("未匹配到表单!当前formID:"+formApp); + } + headerMap.put("hzyaExtData", JSON.toJSONString(hzyaExtData)); + return param; + }catch (Exception e){ + e.printStackTrace(); + logger.error("执行英德赛OA存货同步U8接口报错:{}", e); + } + } + return null; + } + + /** + * 回调方法 + * @Since 3.0 + * @param logEntity + */ + @Override + public void ydcSeeyon2u8CallBack(SysMessageManageLogEntity logEntity) { + + + //在这里记录日志 + JSONObject targetData = JSON.parseObject(logEntity.getTargetData());//这个对象里的body是 发送到u8的请求报文 + JSONObject sourceData = JSON.parseObject(logEntity.getSourceData()); + JSONObject sourceHeaders = sourceData.getJSONObject("header");//源数据header + JSONObject sourceBody = sourceData.getJSONObject("body");//源数据body + JSONObject hzyaExtData = sourceHeaders.getJSONObject("hzyaExtData"); + JSONArray formMainIds = new JSONArray(); + formMainIds.add(sourceBody.getString("id")); + JSONObject param = new JSONObject(); + String formApp = sourceBody.getString("formApp"); + param.put("formAppId",formApp); + param.put("formMainIds",formMainIds); + param.put("dataSourceCode","ht_oa_sqlserver"); + param.put("eventType",sourceBody.getString("eventType")); + + //把返回的单号更新到oa档案表 + String sql = ""; + switch (formApp){ + case "-8691606453890363968"://存货 + sql = ""; + break; + case "6223456019738676230"://供应商 + sql = "update formmain_0229 set field0002 = '' where field0001 = "+hzyaExtData.getString("billCode"); + break; + case "-9122508232154527168"://客户 + sql = "update formmain_0230 set field0002 = '' where field0001 = "+hzyaExtData.getString("billCode"); + break; + } + IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); + logDetails.setRootAppPk(JSON.toJSONString(param)); + logDetails.setRootAppBill(hzyaExtData.getString("billCode")); + logDetails.setNewTransmitInfo(logEntity.getReturnData()); + logDetails.setNewPushDate(new Date()); + logDetails.setRootAppNewData(targetData.getString("body")); + //logDetails.setNewState(SysMessageManageLogStatusEnum.statusGetValue(logEntity.getStatus())); + logDetails.setPluginId("SeeyonExtPlugin"); + try { + if (StrUtil.isEmpty(hzyaExtData.getString("integration_task_living_details_id"))){ + if (SysMessageManageLogStatusEnum.SUCCESS.getType().equals(logEntity.getStatus())) {//成功 + taskLivingDetailsService.saveLogToSuccess(logDetails); + }else { + taskLivingDetailsService.saveLogToFail(logDetails);//失败 + } + }else { + logDetails.setId(hzyaExtData.getString("integration_task_living_details_id")); + if (SysMessageManageLogStatusEnum.SUCCESS.getType().equals(logEntity.getStatus())) {//成功 + taskLivingDetailsService.saveLogFailToSuccess(logDetails); + }else { + taskLivingDetailsService.updateLogFailToSuccess(logDetails);//失败 + } + } + }catch (Exception e){ + logger.error("保存日志出错:{}",e); + } + } + + //存货参数组装 + private SysExtensionApiEntity getInventory(JSONObject businessData,SysExtensionApiEntity param){ + if (null != businessData){ + JSONObject formmain0227 = businessData.getJSONObject("formmain_0227"); + JSONArray formson0228Arr = businessData.getJSONArray("formson_0228"); + for (int i=0; i< formson0228Arr.size(); i++){ + JSONObject formson0228 = formson0228Arr.getJSONObject(i); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("Token", "Hzya1314_CheckSkip"); + jsonObject.put("billid", formson0228.getString("id")); + jsonObject.put("AccId", formmain0227.getString("field0015")); + + JSONObject oArchives = new JSONObject(); + oArchives.put("cInvCode", formson0228.getString("field0002")); + oArchives.put("cInvCCode", formson0228.getString("field0005")); + oArchives.put("cInvName", formson0228.getString("field0003")); + //todo 这个没值 + oArchives.put("cGroupCode", "01"); + oArchives.put("cComUnitCode", formson0228.getString("field0006")); + + jsonObject.put("oArchives", oArchives); + param.setBodys(JSON.toJSONString(jsonObject)); + } + } + return param; + } + //供应商参数组装 + private SysExtensionApiEntity getSupplier(JSONObject businessData,SysExtensionApiEntity param,JSONObject hzyaExtData){ + if (null != businessData){ + JSONObject formmain0225 = businessData.getJSONObject("formmain_0225"); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("billid", formmain0225.getString("id")); + jsonObject.put("AccId", formmain0225.getString("field0020")); + jsonObject.put("Token", OAU8Util.getToken()); + JSONObject oArchives = new JSONObject(); + oArchives.put("cVenCode", formmain0225.getString("field0002")); + oArchives.put("cVenName ", formmain0225.getString("field0003")); + oArchives.put("cVenAbbName", formmain0225.getString("field0004")); + oArchives.put("cVCCode", formmain0225.getString("field0006")); + oArchives.put("cVenExch_name", formmain0225.getString("field0010")); + //oArchives.put("bVenTax", "false"); + //oArchives.put("bLicenceDate", "false"); + //oArchives.put("bBusinessDate", "false"); + //oArchives.put("bProxyDate", "false"); + //oArchives.put("bPassGMP", "false"); + //oArchives.put("bVenCargo", "false"); + //oArchives.put("bProxyForeign", "true"); + //oArchives.put("bVenService", "true"); + //oArchives.put("iVenGSPType", "0"); + //oArchives.put("bVenOverseas", "false"); + //oArchives.put("bVenAccPeriodMng", "false"); + //oArchives.put("bVenHomeBranch", "false"); + oArchives.put("dVenCreateDatetime", DateUtil.now()); + oArchives.put("cVenRegCode", formmain0225.getString("field0009")); + oArchives.put("cVenBank", formmain0225.getString("field0011")); + oArchives.put("cVenAccount", formmain0225.getString("field0012")); + jsonObject.put("oArchives", oArchives); + param.setBodys(JSON.toJSONString(jsonObject)); + hzyaExtData.put("billCode", formmain0225.getString("field0001")); + hzyaExtData.put("formmainId", formmain0225.getString("id")); + } + return param; + } + //客户参数组装 + private SysExtensionApiEntity getCustomer(JSONObject businessData,SysExtensionApiEntity param,JSONObject hzyaExtData){ + if (null != businessData){ + JSONObject formmain0226 = businessData.getJSONObject("formmain_0226"); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("billid", formmain0226.getString("id")); + jsonObject.put("AccId", formmain0226.getString("field0025")); + jsonObject.put("Token", "Hzya1314_CheckSkip"); + + JSONObject oArchives = new JSONObject(); + oArchives.put("cCusCode", formmain0226.getString("field0002")); + oArchives.put("cCusName", formmain0226.getString("field0007")); + oArchives.put("cCusAbbName", formmain0226.getString("field0008")); + oArchives.put("cCCCode", formmain0226.getString("field0012")); + oArchives.put("cCusExch_name", formmain0226.getString("field0013")); + // todo 这个字段没值 + oArchives.put("cCusMngTypeCode", "999"); + + jsonObject.put("oArchives", oArchives); + param.setBodys(JSON.toJSONString(jsonObject)); + hzyaExtData.put("billCode",formmain0226.getString("field0001")); + hzyaExtData.put("formmainId",formmain0226.getString("id")); + } + return param; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OABipUtil.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OABipUtil.java new file mode 100644 index 00000000..9484e2fb --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OABipUtil.java @@ -0,0 +1,65 @@ +package com.hzya.frame.seeyon.util; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; + +/** + * com.hzya.frame.bip.v3.v2207.util + * + * @author makejava + * @date 2024-05 -30 14:20 + */ + +public class OABipUtil { + /** + * + * @content 发送单据到BIP系统 + * @author laborer + * @date 2024/6/21 0021 10:51 + * + */ + + public static String sendU9cTOBipEsb(String parm, String apiCode,String token){ + String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface"; + System.out.println("推送参数"+parm); + String result = HttpRequest.post(baseUrl) + .header("appId", "800023")//头信息,多个头信息多次调用此方法即可 + .header("access_token", token)//头信息,多个头信息多次调用此方法即可 + .header("apiCode", apiCode)//头信息,多个头信息多次调用此方法即可 + .header("publicKey", "ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可 + .header("secretKey", "7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可 + .body(parm)//表单内容 + .timeout(20000)//超时,毫秒 + .execute().body(); + System.out.println("返回参数"+result); + if(StrUtil.isNotEmpty(result)){ + return analytic(result); + } + return null; + } + public static String getBipToken(String userCode, String apiCode){ + String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface"; + String result = HttpRequest.post(baseUrl) + .header("appId", "800023")//头信息,多个头信息多次调用此方法即可 + .header("apiCode", apiCode)//头信息,多个头信息多次调用此方法即可 + .header("usercode", userCode)//头信息,多个头信息多次调用此方法即可 + .header("publicKey", "ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可 + .header("secretKey", "7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可 + .body("")//表单内容 + .timeout(20000)//超时,毫秒 + .execute().body(); + System.out.println("返回参数"+result); + if(StrUtil.isNotEmpty(result)){ + JSONObject obj = JSON.parseObject( analytic(result)); + JSONObject data = obj.getJSONObject("data"); + return data.getString("access_token"); + } + return null; + } + public static String analytic(String parm){ + JSONObject main = JSON.parseObject(parm); + return main.getString("attribute"); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OAPayState.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OAPayState.java new file mode 100644 index 00000000..3fdfac15 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OAPayState.java @@ -0,0 +1,73 @@ +package com.hzya.frame.seeyon.util; + +/** + * @Author:hecan + * @Description:支付类型(支付状态) + * @params: + * @return: + * @Date: 2023/3/14 15:05 + */ +public enum OAPayState { + a("a","待提交直联"), + b("b","已提交直联"), + c("c","银行已受理"), + d("d","银行未受理"), + e("e","可疑"), + f("f","待人工确认"), + g("g","支付成功"), + h("h","支付失败"), + i("i","部分成功"), + j("j","退票"), + k("k","取消支付"), + n("n","其他"), + p("p","支付中"), + q("q","待支付"), + one("1","待处理"), + two("2","审批中"), + three("3","处理失败"), + four("4","审批完成"), + five("5","审批撤销"), + six("6","审批拒绝"), + seven("7","待发送审批"), + eight("8","集中受理中"), + nine("9","审批退回"), + ten("10","预处理中"), + eleven("11","预处理拒绝"), + twelve("12","资金监控审批中"); + + + //类型 + private String type; + //值 + private String value; + + OAPayState(String type, String value){ + this.type=type; + this.value=value; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public static String payStateGetValue(String type){ + for (OAPayState payState : OAPayState.values()){ + if(payState.getType()==type||payState.getType().equals(type)){ + return payState.getValue().toString(); + } + } + return null; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java new file mode 100644 index 00000000..84b42102 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java @@ -0,0 +1,209 @@ +package com.hzya.frame.seeyon.util; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpUtil; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.seeyon.entity.CollAttachmentResDTO; +import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity; +import com.hzya.frame.sysnew.application.api.service.ISysApplicationApiService; +import com.hzya.frame.web.exception.BaseSystemException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.io.File; +import java.util.HashMap; +import java.util.List; + +/** + * @Description 致远rest接口工具类 + * @Author xiangerlin + * @Date 2024/6/17 15:49 + **/ +@Component +public class OARestUtil { + @Autowired + private ISysApplicationApiService sysApplicationApiService; + static Logger logger = LoggerFactory.getLogger(OARestUtil.class); + + private OARestUtil() { + } + + + /** + * 附件上传 + * @param file 附件对象 + * @param api_code 接口编码 + * @return + */ + public JSONObject fileUpload(File file,String api_code) { + if (StrUtil.isNotEmpty(api_code)){ + //1、查询附件上传api接口信息 + SysApplicationApiEntity sysApp = getByCode(api_code); + if (null != sysApp){ + String app_url = sysApp.getAppUrl(); + String url = app_url+"/seeyon/rest/attachment?token=@token@"; + String token = getToken(null,"8000240000"); + url = url.replaceAll("@token@",token); + HashMap paramMap = new HashMap<>(); + paramMap.put("file", file); + String result = HttpUtil.post(url, paramMap); + if (StrUtil.isNotBlank(result)) { + logger.info("附件上传结果"+result); + JSONObject jsonObject = JSONObject.parseObject(result); + String atts = jsonObject.get("atts").toString(); + if (StrUtil.isNotEmpty(atts)) { + JSONArray jsonArray = JSONArray.parseArray(atts); + JSONObject res = (JSONObject) jsonArray.get(0); + return res; + } + } + } + }else { + throw new BaseSystemException("api_code不能为空"); + } + return null; + } + + /*** + * 查询协同附件列表 + * @param summaryId col_summary表id + * @param attType 0代表附件,2代表关联文档,“0,2”代表附件和关联文档 + * @param apiCode 接口编码 + * @return + */ + public List getColAttachments(String summaryId,String attType,String apiCode,String loginName){ + if (StrUtil.isNotEmpty(summaryId) && StrUtil.isNotEmpty(apiCode)){ + SysApplicationApiEntity sysApp = getByCode(apiCode); + String token = getToken(loginName,sysApp); + String appUrl = StrUtil.removeSuffix(sysApp.getAppUrl(),"/"); + if (StrUtil.isEmpty(attType)){ + attType = "0"; + } + String url = "/seeyon/rest/coll/attachments/@SummaryID@/@attType@"; + url = url.replaceAll("@SummaryID@",summaryId).replaceAll("@attType@",attType); + String body = HttpRequest.get(appUrl + url).header("token", token).execute().body(); + if (StrUtil.isNotEmpty(body) && JSONUtil.isTypeJSON(body)){ + List list = JSON.parseArray(body,CollAttachmentResDTO.class); + return list; + } + } + return null; + } + + /** + * 附件下载 + * @param loginName oa登录名 + * @param apiCode 接口编码 + * @param fileId 附件id + * @param fileName 附件名 + * @return 附件字节数组 + */ + public byte[] downloadFileBytes(String loginName,String apiCode,String fileId,String fileName){ + if (StrUtil.isNotEmpty(apiCode)){ + SysApplicationApiEntity sysApp = getByCode(apiCode); + String token = getToken(loginName,sysApp); + String appUrl = StrUtil.removeSuffix(sysApp.getAppUrl(),"/"); + String url = "/seeyon/rest/attachment/file/@ctp_file_ID@?fileName=@文件名@&token=@token@"; + url = url.replaceAll("@ctp_file_ID@",fileId).replaceAll("@文件名@",fileName).replaceAll("@token@",token); + byte[] bytes = HttpUtil.downloadBytes(appUrl + url); + return bytes; + } + return null; + } + + + /** + * 附件下载 + * @param loginName oa登录名 + * @param apiCode 接口编码 + * @param fileId 附件id + * @param fileName 附件名 + * @param token + * @return 附件字节数组 + */ + public byte[] downloadFileBytes(String loginName,String apiCode,String fileId,String fileName,String token){ + if (StrUtil.isNotEmpty(apiCode)){ + SysApplicationApiEntity sysApp = getByCode(apiCode); + if (StrUtil.isEmpty(token)){ + token = getToken(loginName,sysApp); + } + String appUrl = StrUtil.removeSuffix(sysApp.getAppUrl(),"/"); + String url = "/seeyon/rest/attachment/file/@ctp_file_ID@?fileName=@文件名@&token=@token@"; + url = url.replaceAll("@ctp_file_ID@",fileId).replaceAll("@文件名@",fileName).replaceAll("@token@",token); + byte[] bytes = HttpUtil.downloadBytes(appUrl + url); + return bytes; + } + return null; + } + /** + * 获取token + * @param login_name + * @param api_code + * @return + */ + public String getToken(String login_name,String api_code){ + if (StrUtil.isNotEmpty(api_code)){ + SysApplicationApiEntity sysApp = getByCode(api_code); + return getToken(login_name,sysApp); + }else { + throw new BaseSystemException("api_code不能为空"); + } + } + + /** + * 获取token + * @param login_name oa登录名 + * @param sysApp 应用信息 + * @return + */ + public String getToken(String login_name,SysApplicationApiEntity sysApp){ + if (null != sysApp){ + HashMap hashMap = new HashMap<>(); + String app_url = StrUtil.removeSuffix(sysApp.getAppUrl(), "/"); + String url = app_url+"/seeyon/rest/token"; + String headerIn = sysApp.getHeaderIn(); + JSONArray headers = JSON.parseArray(headerIn); + for (int i = 0; i < headers.size(); i++) { + JSONObject object1 = headers.getJSONObject(i); + String parameterName = object1.getString("parameterName"); + if ("userName".equals(parameterName) || "password".equals(parameterName) || "loginName".equals(parameterName)){ + String example = object1.getString("example"); + hashMap.put(parameterName,example); + } + } + login_name = hashMap.get("loginName"); + if (StrUtil.isEmpty(login_name)){ + hashMap.put("loginName","hzya"); + } + String result = HttpRequest.post(url).body(JSON.toJSONString(hashMap)).execute().body(); + JSONObject jsonObject = JSONObject.parseObject(result); + if (null != jsonObject) { + logger.info("======token:{}======" ,jsonObject.getString("id")); + return jsonObject.getString("id"); + } + } + return null; + } + private SysApplicationApiEntity getByCode(String api_code){ + if (StrUtil.isNotEmpty(api_code)){ + SysApplicationApiEntity sysApp = new SysApplicationApiEntity(); + sysApp.setApiCode(Long.valueOf(api_code)); + sysApp = sysApplicationApiService.queryOne(sysApp); + if (null != sysApp && StrUtil.isNotEmpty(sysApp.getId())){ + sysApp = sysApplicationApiService.get(sysApp.getId()); + if (null != sysApp){ + return sysApp; + } + } + }else { + throw new BaseSystemException("api_code不能为空"); + } + return null; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OAU8Util.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OAU8Util.java new file mode 100644 index 00000000..76decc6d --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OAU8Util.java @@ -0,0 +1,34 @@ +package com.hzya.frame.seeyon.util; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.seeyon.entity.OAU8ResponseDTO; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/5/14 15:30 + **/ +public class OAU8Util { + + static Logger logger = LogManager.getLogger(OAU8Util.class); + + //获取token + public static String getToken() { + String url = "http://127.0.0.1:51910/Api/Base/GetToken"; + JSONObject jsonObject = new JSONObject(); + jsonObject.put("secretkey", "L1NhkDrQhtBDzTxFxPI0jxWcBzTBSPvaI5xZusRRi9ofS9d6ngxrj1erwbdjxtUT"); + logger.info("获取U8token参数:{}", jsonObject.toJSONString()); + String token = HttpRequest.post( url).body(jsonObject.toJSONString()).timeout(60000).execute().body(); + logger.info("token返回参数:{}", jsonObject.toJSONString()); + if (StrUtil.isNotEmpty(token)) { + OAU8ResponseDTO u8ResponseDTO = JSONObject.parseObject(token, OAU8ResponseDTO.class); + return u8ResponseDTO.getMessage(); + } + return token; + + } +} diff --git a/fw-oa/src/main/webapp/WEB-INF/web.xml b/fw-oa/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..d80081d1 --- /dev/null +++ b/fw-oa/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index fc53bd54..1d2115b9 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ - + fw-oa From 44fb1eaca1a6eb9b9d70748d2dc33c17d3b3d36b Mon Sep 17 00:00:00 2001 From: "476474485@qq.com" Date: Sat, 14 Sep 2024 15:21:44 +0800 Subject: [PATCH 03/67] =?UTF-8?q?=E7=BC=96=E5=86=99=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E9=92=89=E9=92=89=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/sysnew/login/ILoginService.java | 9 ++ .../sysnew/login/impl/LoginServiceImpl.java | 126 ++++++++++++++++++ .../service/impl/EntranceServiceImpl.java | 2 +- 3 files changed, 136 insertions(+), 1 deletion(-) diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/login/ILoginService.java b/base-service/src/main/java/com/hzya/frame/sysnew/login/ILoginService.java index 90f9bfa0..69b63c81 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/login/ILoginService.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/login/ILoginService.java @@ -15,4 +15,13 @@ public interface ILoginService { * @throws Exception */ JsonResultEntity doLogin(JSONObject jsonObject)throws Exception; +/**** + * 移动端登录 + * @content: + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2024-09-14 10:51 + * @param + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity appDoLogin(JSONObject jsonObject) ; } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java index 3b0bf5be..f0db3c9e 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java @@ -2,7 +2,18 @@ package com.hzya.frame.sysnew.login.impl; import cn.dev33.satoken.stp.SaTokenInfo; import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpUtil; import com.alibaba.fastjson.JSONObject; +import com.dingtalk.api.DefaultDingTalkClient; +import com.dingtalk.api.DingTalkClient; +import com.dingtalk.api.request.OapiGettokenRequest; +import com.dingtalk.api.request.OapiV2UserGetRequest; +import com.dingtalk.api.request.OapiV2UserGetuserinfoRequest; +import com.dingtalk.api.response.OapiGettokenResponse; +import com.dingtalk.api.response.OapiV2UserGetResponse; +import com.dingtalk.api.response.OapiV2UserGetuserinfoResponse; import com.hzya.frame.sysnew.application.dao.ISysApplicationDao; import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; import com.hzya.frame.sysnew.login.ILoginService; @@ -21,11 +32,15 @@ import com.hzya.frame.sysnew.userRoles.entity.SysUserRolesEntity; import com.hzya.frame.util.AESUtil; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; +import com.hzya.frame.web.exception.BaseSystemException; import org.checkerframework.checker.units.qual.C; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; +import java.util.Map; /** @@ -35,6 +50,7 @@ import java.util.List; **/ @Service(value = "loginService") public class LoginServiceImpl implements ILoginService { + private final Logger logger = LoggerFactory.getLogger(LoginServiceImpl.class); @Resource private ISysUserDao sysUserDao; @@ -131,6 +147,116 @@ public class LoginServiceImpl implements ILoginService { return BaseResult.getSuccessMessageEntity("登录成功", res); } + /**** + * 移动端登录地址 + * @content: + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2024-09-14 11:14 + * @param + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + @Override + public JsonResultEntity appDoLogin(JSONObject jsonObject) { + //移动端类型 + JSONObject entity = getData("jsonStr", jsonObject, JSONObject.class); + //DD,weChat + String appType = entity.getString("appType"); + String appId = entity.getString("appId"); + String apiCode = entity.getString("apiCode"); + String userApiCode = entity.getString("userApiCode"); + SysUserEntity userEntity = new SysUserEntity(); + switch (appType){ + case "DD": + String code = entity.getString("code");//授权码 + String requestType = entity.getString("UserAgent");// pc端还是移动端 + JSONObject bodyParams = new JSONObject(); + bodyParams.put("code",code); + String result = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface"). + header("appId",appId). + header("apiCode",userApiCode). + header("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"). + header("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). + body(bodyParams.toJSONString()). + execute(). + body(); + JSONObject resultJson = JSONObject.parseObject(result); + boolean flag = resultJson.getBoolean("flag"); + if(!flag){ + throw new BaseSystemException("请求错误:"+resultJson.getString("msg")); + } + String userid = resultJson.getString("userid"); + if(StrUtil.isEmpty(userid)){ + return BaseResult.getFailureMessageEntity("认证失败!当前用户未绑定钉钉","1005"); + } + userEntity.setDdUserId( userid); + userEntity = sysUserDao.queryOne(userEntity); + if(null == userEntity ){ + if(StrUtil.isEmpty(userid)){ + JSONObject object = new JSONObject(); + object.put("userid",userid); + return BaseResult.getFailureMessageEntity("认证失败!当前用户未绑定钉钉","1005",object); + } + } + break; + case "weChat": + break; + default: + throw new BaseSystemException("错误的App类型:"+appType+" 支持的app类型有:DD,weChat"); + + } + //登录 + StpUtil.login(userEntity.getId()); + //获取token + SaTokenInfo tokenInfo = StpUtil.getTokenInfo(); + String token = tokenInfo.getTokenValue(); + //获取公司 + SysOrganEntity sysOrganEntity = new SysOrganEntity(); + sysOrganEntity.setUserId(userEntity.getId()); + List sysOrganEntities = sysOrganDao.queryUserCompany(sysOrganEntity); + //返回值 + JSONObject res = new JSONObject(); + res.put("token", token); + res.put("userInfo", userEntity); + res.put("company", sysOrganEntities); + //切换数据源查询 + + return BaseResult.getSuccessMessageEntity("登录成功", res); + + //校验当前登陆人是否有权限 + //boolean flag = false; + //SysInterfaceEntity sysInterfaceEntity = (SysInterfaceEntity) interfaceCache.get("6","beanNameloginServiceinterfacNamedoLogin"); + //if(sysInterfaceEntity == null || sysInterfaceEntity.getId() == null){ + // return BaseResult.getFailureMessageEntity("用户无访问权限,请联系管理员"); + //} + ////查询用户权限 + //if(!flag){ + // SysPopedomInterfaceEntity userPopedomInterfaceEntity = (SysPopedomInterfaceEntity) interfaceCache.get("4","userId"+sysUserEntity.getId()+"interfaceId"+sysInterfaceEntity.getId()); + // if(userPopedomInterfaceEntity != null && userPopedomInterfaceEntity.getId() != null ){ + // flag = true; + // } + //} + ////查询用户角色的权限 + //if(!flag){ + // List userRoleMap = (List) interfaceCache.get("3",null); + // if(userRoleMap != null && userRoleMap.size() > 0){ + // for (SysUserRolesEntity sysUserRolesEntity : userRoleMap) { + // if(sysUserRolesEntity.getUserId().equals(sysUserEntity.getId())){ + // SysPopedomInterfaceEntity sysPopedomInterfaceEntity = (SysPopedomInterfaceEntity) interfaceCache.get("5","roleId"+sysUserRolesEntity.getRoleId()+"interfaceId"+sysInterfaceEntity.getId()); + // if(sysPopedomInterfaceEntity != null && sysPopedomInterfaceEntity.getId() != null ){ + // flag = true; + // break; + // } + // } + // } + // } + //} + //if(!flag){ + // return BaseResult.getFailureMessageEntity("用户无访问权限,请联系管理员"); + //} + + } + + protected T getData(String key, JSONObject jsonObject, Class clz) { if (checkStr(jsonObject.getString(key))) { return jsonObject.getJSONObject(key).toJavaObject(clz); diff --git a/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java b/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java index 9dec83c7..ea5f4c44 100644 --- a/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java +++ b/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java @@ -78,7 +78,7 @@ public class EntranceServiceImpl implements IEntranceService { if (m.getName().equals(serviceMethod.trim())) { if (m.getName().startsWith("thirdInterface")) {//TODO 后续可能要加强校验规则 logger.info("第三方接口,不校验是否登陆"); - }else if (!"doLogin".equals(m.getName())) { + }else if (!"doLogin".equals(m.getName())&& !"appDoLogin".equals(m.getName()) ) { try { StpUtil.checkLogin(); //校验当前登陆人是否有权限 From 55aa4c4a92c03eff6bed089d996a32b308da443b Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Sat, 14 Sep 2024 16:30:05 +0800 Subject: [PATCH 04/67] =?UTF-8?q?dev=E9=BB=98=E8=AE=A4=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA10086=EF=BC=8C=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81=E8=8E=B7=E5=8F=96url?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + base-buildpackage/src/main/resources/application.yml | 4 ++-- .../com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java | 6 ++++-- .../service/impl/SysSendMessageLogServiceImpl.java | 6 ++++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 1565f44e..b6cc5cd0 100644 --- a/.gitignore +++ b/.gitignore @@ -63,3 +63,4 @@ $RECYCLE.BIN/ /base-buildpackage/target/ /base-common/target/ /base-core/target/ +/base-webapp/target/classes/com/hzya/frame/ diff --git a/base-buildpackage/src/main/resources/application.yml b/base-buildpackage/src/main/resources/application.yml index 7b481a9d..821ad1c1 100644 --- a/base-buildpackage/src/main/resources/application.yml +++ b/base-buildpackage/src/main/resources/application.yml @@ -1,5 +1,5 @@ server: - port: 9999 + port: 10086 servlet: context-path: /kangarooDataCenterV3 localIP: 127.0.0.1 @@ -93,7 +93,7 @@ mybatis-plus: db-config: id-type: auto # 主键策略 zt: - url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface + url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface #JimuReport[minidao配置] minidao : base-package: org.jeecg.modules.jmreport.desreport.dao* diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java index f0db3c9e..2057cbee 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java @@ -36,6 +36,7 @@ import com.hzya.frame.web.exception.BaseSystemException; import org.checkerframework.checker.units.qual.C; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -58,7 +59,8 @@ public class LoginServiceImpl implements ILoginService { private ISysPersonDao sysPersonDao; @Resource private ISysOrganDao sysOrganDao; - + @Value("${zt.url}") + private String url ; @Resource private ISysApplicationDao sysApplicationDao; @Resource @@ -171,7 +173,7 @@ public class LoginServiceImpl implements ILoginService { String requestType = entity.getString("UserAgent");// pc端还是移动端 JSONObject bodyParams = new JSONObject(); bodyParams.put("code",code); - String result = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface"). + String result = HttpRequest.post("url"). header("appId",appId). header("apiCode",userApiCode). header("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"). diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java index 2ff4f682..d48fb778 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java @@ -25,6 +25,7 @@ import com.hzya.frame.sysnew.warningInterface.entity.SysWarningInterfaceEntity; import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; import javax.annotation.Resource; @@ -55,7 +56,8 @@ public class SysSendMessageLogServiceImpl extends BaseService Date: Sat, 14 Sep 2024 16:57:45 +0800 Subject: [PATCH 05/67] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E8=B7=A8=E5=9F=9F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/entrance/controler/EntranceController.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java b/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java index a48c72bf..75e73ca6 100644 --- a/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java +++ b/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java @@ -21,11 +21,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; @@ -56,6 +52,7 @@ public class EntranceController { protected ISysApplicationService sysApplicationService; @RequestMapping(value = "/option") @ResponseBody + @CrossOrigin(origins = "*") public JsonResultEntity option(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception { return entranceService.doBusiness(servletRequest, servletResponse); } From d9405aad90d453a5384fddcdb079aa75ac1b0dea Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Sat, 14 Sep 2024 16:59:04 +0800 Subject: [PATCH 06/67] =?UTF-8?q?dev=E9=BB=98=E8=AE=A4=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA10086=EF=BC=8C=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81=E8=8E=B7=E5=8F=96url?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzya/frame/sysnew/login/impl/LoginServiceImpl.java | 8 ++++++++ .../com/hzya/frame/sysnew/user/entity/SysUserEntity.xml | 2 ++ 2 files changed, 10 insertions(+) diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java index 2057cbee..985b999d 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java @@ -131,6 +131,14 @@ public class LoginServiceImpl implements ILoginService { //} //登录 StpUtil.login(sysUserEntity.getId()); + //修改ddid或者修改微信id + if((entity.getDdUserId() != null && !"".equals(entity.getDdUserId())) + || (entity.getWxUserId() != null && !"".equals(entity.getWxUserId())) ){ + sysUserEntity.setDdUserId(entity.getDdUserId()); + sysUserEntity.setWxUserId(entity.getWxUserId()); + sysUserDao.update(sysUserEntity); + } + //获取token SaTokenInfo tokenInfo = StpUtil.getTokenInfo(); String token = tokenInfo.getTokenValue(); diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.xml b/base-service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.xml index 82c6d1ed..c27713bc 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.xml @@ -373,6 +373,8 @@ sts = #{sts}, org_id = #{org_id}, company_id = #{companyId}, + dd_user_id = #{ddUserId}, + wx_user_id = #{wxUserId}, where id = #{id} From 165e548056de7dbee5c4af4d9c613fcda657aef8 Mon Sep 17 00:00:00 2001 From: username Date: Wed, 18 Sep 2024 16:51:20 +0800 Subject: [PATCH 07/67] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E4=BB=A3=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base-buildpackage/pom.xml | 6 + .../plugin/PushMessagePluginInitializer.java | 1 + .../main/resources/application-zqtlocal.yml | 2 +- .../api/entity/SysApplicationApiEntity.xml | 112 ++- .../service/ISysApplicationApiService.java | 2 + .../impl/SysApplicationApiServiceImpl.java | 40 + .../entity/SysApplicationEntity.java | 10 + .../impl/SysApplicationServiceImpl.java | 2 +- .../entity/SysMessageManageLogEntity.xml | 4 +- .../entity/SysMessageTemplateEntity.java | 44 +- .../entity/SysMessageTemplateEntity.xml | 40 +- .../impl/SysMessageTemplateServiceImpl.java | 328 ++++---- .../entity/SysPushMessageEntity.java | 10 - .../entity/SysPushMessageEntity.xml | 10 +- .../impl/SysPushMessageServiceImpl.java | 1 + .../entity/SysSendMessageLogEntity.java | 102 ++- .../entity/SysSendMessageLogEntity.xml | 233 +++--- .../service/ISysSendMessageLogService.java | 2 + .../impl/SysSendMessageLogServiceImpl.java | 749 ++++++++++-------- .../entity/SysWarningConfigEntity.java | 76 +- .../entity/SysWarningConfigEntity.xml | 99 +-- .../impl/SysWarningConfigServiceImpl.java | 276 ++++++- .../dao/ISysWarningInterfaceDao.java | 5 +- .../dao/impl/SysWarningInterfaceDaoImpl.java | 9 +- .../entity/SysWarningInterfaceEntity.java | 21 +- .../entity/SysWarningInterfaceEntity.xml | 65 +- .../service/ISysWarningInterfaceService.java | 2 + .../impl/SysWarningInterfaceServiceImpl.java | 53 +- 28 files changed, 1419 insertions(+), 885 deletions(-) diff --git a/base-buildpackage/pom.xml b/base-buildpackage/pom.xml index 41435a19..1a317d04 100644 --- a/base-buildpackage/pom.xml +++ b/base-buildpackage/pom.xml @@ -38,6 +38,12 @@ llg + + zqtlocal + + zqtlocal + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/plugin/PushMessagePluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/plugin/PushMessagePluginInitializer.java index 3e0a996f..3bc07a67 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/plugin/PushMessagePluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/plugin/PushMessagePluginInitializer.java @@ -62,6 +62,7 @@ public class PushMessagePluginInitializer extends PluginBaseEntity { public JsonResultEntity executeBusiness(JSONObject requestJson) { try { logger.info("======开始执行定时消息推送========"); + //目前只查询一周内的异常日志进行消息推送 List list = sysPushMessageDao.getAll(); for(SysPushMessageEntity entity : list){ diff --git a/base-buildpackage/src/main/resources/application-zqtlocal.yml b/base-buildpackage/src/main/resources/application-zqtlocal.yml index ffff00a3..5aeac683 100644 --- a/base-buildpackage/src/main/resources/application-zqtlocal.yml +++ b/base-buildpackage/src/main/resources/application-zqtlocal.yml @@ -36,4 +36,4 @@ cbs8: OA: data_source_code: yc_oa zt: - url: http://127.0.0.1:9082/kangarooDataCenterV3/entranceController/externalCallInterface \ No newline at end of file + url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface \ No newline at end of file diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml b/base-service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml index 089b6eb5..f2d0a1dc 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml @@ -42,6 +42,7 @@ + @@ -156,52 +157,87 @@ WHERE diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/api/service/ISysApplicationApiService.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/api/service/ISysApplicationApiService.java index 2218bf04..52272f22 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/api/service/ISysApplicationApiService.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/api/service/ISysApplicationApiService.java @@ -24,6 +24,8 @@ public interface ISysApplicationApiService extends IBaseService resultList = new ArrayList<>(); + for (int i = 0; i < appIdList.length; i++) { + entity.setAppId(appIdList[i]); + List list = sysApplicationApiDao.queryBase(entity); + resultList.addAll(list); + } + //手动分页 + int total = resultList.size(); + int fromIndex = (pageNum - 1) * pageSize; + int toIndex = Math.min(fromIndex + pageSize, total); + List pageList = resultList.subList(fromIndex, toIndex); + + PageInfo pageInfo = new PageInfo<>(pageList); + pageInfo.setTotal(total); + pageInfo.setPages((total + pageSize - 1) / pageSize); + + return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + } + /** * 模糊查询,联查sys_app * diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.java index 3eb1ff34..3be0953f 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.java @@ -42,6 +42,16 @@ public class SysApplicationEntity extends BaseEntity { private String interfaceStatus; /** 数据源是否启用(1、开启 2、关闭) */ private String dbStatus; + /** 新消息数 */ + private int newMessageCount; + + public int getNewMessageCount() { + return newMessageCount; + } + + public void setNewMessageCount(int newMessageCount) { + this.newMessageCount = newMessageCount; + } /** 系统类型 1、致远OA 2、用友U8C 3、用友BIP */ private String appType; diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java index b6ad01cd..2a11d6ef 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java @@ -2649,7 +2649,7 @@ public class SysApplicationServiceImpl extends BaseService sendMssage(sysPushMessageEntity)); + taskExecutor.execute(() -> sendMssage(sysPushMessageEntity)); return sysMessageManageLogEntity; } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/messageManageLog/entity/SysMessageManageLogEntity.xml b/base-service/src/main/java/com/hzya/frame/sysnew/messageManageLog/entity/SysMessageManageLogEntity.xml index 5c02e0bb..990d106a 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/messageManageLog/entity/SysMessageManageLogEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sysnew/messageManageLog/entity/SysMessageManageLogEntity.xml @@ -566,7 +566,8 @@ where id = #{id} a.status AS status, a.remark AS remark, a.create_time AS createTime, - a.modify_time AS modifyTime + a.modify_time AS modifyTime, + receiveApi.api_name AS receiveApiName FROM @@ -577,6 +578,7 @@ where id = #{id} LEFT JOIN sys_application sendApp ON a.send_app = sendApp.id AND sendApp.sts = 'Y' + LEFT JOIN sys_application_api receiveApi ON a.receive_code = receiveApi.api_code AND receiveApi.sts = 'Y' AND a.id in diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/messageTemplate/entity/SysMessageTemplateEntity.java b/base-service/src/main/java/com/hzya/frame/sysnew/messageTemplate/entity/SysMessageTemplateEntity.java index 5cda5ede..5a1ba2a6 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/messageTemplate/entity/SysMessageTemplateEntity.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/messageTemplate/entity/SysMessageTemplateEntity.java @@ -12,8 +12,6 @@ public class SysMessageTemplateEntity extends BaseEntity { /** 公司id */ private String companyId; - /** 调用单据类型 */ - private String billKindId; /** 模版类型 */ private String templateType; /** 模版名称 */ @@ -26,14 +24,8 @@ public class SysMessageTemplateEntity extends BaseEntity { private String btns; /** 数据源 */ private String dataSource; - /** 创建时间 */ - private Date createDate; - /** 创建人 */ - private String createPersonId; - /** 状态 */ + /** 状态 0:停用 1:启用 */ private String state; - /** 删除标志 */ - private Integer isdelete; public String getCompanyId() { @@ -44,14 +36,6 @@ public class SysMessageTemplateEntity extends BaseEntity { this.companyId = companyId; } - public String getBillKindId() { - return billKindId; - } - - public void setBillKindId(String billKindId) { - this.billKindId = billKindId; - } - public String getTemplateType() { return templateType; } @@ -99,23 +83,6 @@ public class SysMessageTemplateEntity extends BaseEntity { public void setDataSource(String dataSource) { this.dataSource = dataSource; } - - public Date getCreateDate() { - return createDate; - } - - public void setCreateDate(Date createDate) { - this.createDate = createDate; - } - - public String getCreatePersonId() { - return createPersonId; - } - - public void setCreatePersonId(String createPersonId) { - this.createPersonId = createPersonId; - } - public String getState() { return state; } @@ -123,14 +90,5 @@ public class SysMessageTemplateEntity extends BaseEntity { public void setState(String state) { this.state = state; } - - public Integer getIsdelete() { - return isdelete; - } - - public void setIsdelete(Integer isdelete) { - this.isdelete = isdelete; - } - } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/messageTemplate/entity/SysMessageTemplateEntity.xml b/base-service/src/main/java/com/hzya/frame/sysnew/messageTemplate/entity/SysMessageTemplateEntity.xml index 80002b16..e1cf60d5 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/messageTemplate/entity/SysMessageTemplateEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sysnew/messageTemplate/entity/SysMessageTemplateEntity.xml @@ -12,17 +12,13 @@ - - - - @@ -34,18 +30,14 @@ ,modify_time ,sts ,org_id - ,company_id - ,bill_kind_id + ,company_id ,template_type ,template_name ,message_title ,message_contents ,btns - ,data_source - ,create_date - ,create_person_id - ,state - ,isdelete + ,data_source + ,state @@ -70,17 +62,13 @@ and sts = #{sts} and org_id = #{org_id} and company_id = #{companyId} - and bill_kind_id = #{billKindId} and template_type = #{templateType} and template_name = #{templateName} and message_title = #{messageTitle} and message_contents = #{messageContents} and btns = #{btns} and data_source = #{dataSource} - and create_date = #{createDate} - and create_person_id = #{createPersonId} and state = #{state} - and isdelete = #{isdelete} and sts='Y' order by sorts asc @@ -100,15 +88,12 @@ and sts = #{sts} and org_id = #{org_id} and company_id = #{companyId} - and bill_kind_id = #{billKindId} and template_type = #{templateType} and template_name = #{templateName} and message_title = #{messageTitle} and message_contents = #{messageContents} and btns = #{btns} and data_source = #{dataSource} - and create_date = #{createDate} - and create_person_id = #{createPersonId} and state = #{state} and isdelete = #{isdelete} and sts='Y' @@ -132,17 +117,13 @@ and sts like concat('%',#{sts},'%') and org_id like concat('%',#{org_id},'%') and company_id like concat('%',#{companyId},'%') - and bill_kind_id like concat('%',#{billKindId},'%') and template_type like concat('%',#{templateType},'%') and template_name like concat('%',#{templateName},'%') and message_title like concat('%',#{messageTitle},'%') and message_contents like concat('%',#{messageContents},'%') and btns like concat('%',#{btns},'%') and data_source like concat('%',#{dataSource},'%') - and create_date like concat('%',#{createDate},'%') - and create_person_id like concat('%',#{createPersonId},'%') and state like concat('%',#{state},'%') - and isdelete like concat('%',#{isdelete},'%') and sts='Y' order by sorts asc @@ -164,15 +145,12 @@ or sts = #{sts} or org_id = #{org_id} or company_id = #{companyId} - or bill_kind_id = #{billKindId} or template_type = #{templateType} or template_name = #{templateName} or message_title = #{messageTitle} or message_contents = #{messageContents} or btns = #{btns} or data_source = #{dataSource} - or create_date = #{createDate} - or create_person_id = #{createPersonId} or state = #{state} or isdelete = #{isdelete} and sts='Y' @@ -194,17 +172,13 @@ sts , org_id , company_id , - bill_kind_id , template_type , template_name , message_title , message_contents , btns , data_source , - create_date , - create_person_id , state , - isdelete , sts, )values( @@ -218,17 +192,13 @@ #{sts} , #{org_id} , #{companyId} , - #{billKindId} , #{templateType} , #{templateName} , #{messageTitle} , #{messageContents} , #{btns} , #{dataSource} , - #{createDate} , - #{createPersonId} , #{state} , - #{isdelete} , 'Y', ) @@ -278,17 +248,13 @@ update sys_message_template set sts = #{sts}, org_id = #{org_id}, company_id = #{companyId}, - bill_kind_id = #{billKindId}, template_type = #{templateType}, template_name = #{templateName}, message_title = #{messageTitle}, message_contents = #{messageContents}, btns = #{btns}, data_source = #{dataSource}, - create_date = #{createDate}, - create_person_id = #{createPersonId}, state = #{state}, - isdelete = #{isdelete}, where id = #{id} diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/messageTemplate/service/impl/SysMessageTemplateServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/messageTemplate/service/impl/SysMessageTemplateServiceImpl.java index 7f4db12a..6930fd2c 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/messageTemplate/service/impl/SysMessageTemplateServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/messageTemplate/service/impl/SysMessageTemplateServiceImpl.java @@ -9,11 +9,15 @@ import com.hzya.frame.sysnew.messageTemplate.dao.ISysMessageTemplateDao; import com.hzya.frame.sysnew.messageTemplate.service.ISysMessageTemplateService; import com.hzya.frame.sysnew.person.dao.ISysPersonDao; import com.hzya.frame.sysnew.user.entity.SysUserEntity; +import com.hzya.frame.sysnew.warningConfig.dao.ISysWarningConfigDao; +import com.hzya.frame.sysnew.warningConfig.entity.SysWarningConfigEntity; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; + import javax.annotation.Resource; + import com.hzya.frame.basedao.service.impl.BaseService; import java.sql.*; @@ -28,178 +32,178 @@ import java.util.List; */ @Service(value = "sysMessageTemplateService") public class SysMessageTemplateServiceImpl extends BaseService implements ISysMessageTemplateService { - + private ISysMessageTemplateDao sysMessageTemplateDao; - @Resource - public IExecSqlService execSqlService; - + @Resource + private ISysWarningConfigDao sysWarningConfigDao; + + @Resource + public IExecSqlService execSqlService; + @Autowired - public void setSysMessageTemplateDao(ISysMessageTemplateDao dao) { - this.sysMessageTemplateDao = dao; - this.dao = dao; - } + public void setSysMessageTemplateDao(ISysMessageTemplateDao dao) { + this.sysMessageTemplateDao = dao; + this.dao = dao; + } - @Override - public JsonResultEntity queryEntityPage(JSONObject jsonObject) { - SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class); - //判断分页 - if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { - return BaseResult.getFailureMessageEntity("分页查询参数不存在"); - } - PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - List list = sysMessageTemplateDao.queryByLike(entity); - PageInfo pageInfo = new PageInfo(list); - return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); - } + @Override + public JsonResultEntity queryEntityPage(JSONObject jsonObject) { + SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class); + //判断分页 + if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { + return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + } + PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + List list = sysMessageTemplateDao.queryByLike(entity); + PageInfo pageInfo = new PageInfo(list); + return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + } - @Override - public JsonResultEntity queryEntity(JSONObject jsonObject){ - SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class); - if(entity == null){ - entity = new SysMessageTemplateEntity(); - } - List list = sysMessageTemplateDao.queryByLike(entity); - return BaseResult.getSuccessMessageEntity("查询数据成功", list); - } + @Override + public JsonResultEntity queryEntity(JSONObject jsonObject) { + SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class); + if (entity == null) { + entity = new SysMessageTemplateEntity(); + } + List list = sysMessageTemplateDao.queryByLike(entity); + return BaseResult.getSuccessMessageEntity("查询数据成功", list); + } - @Override - public JsonResultEntity getEntity(JSONObject jsonObject){ - SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class); - if(entity == null){ - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if(entity.getId() == null || "".equals(entity.getId())){ - return BaseResult.getFailureMessageEntity("系统错误"); - } - entity = sysMessageTemplateDao.get(entity.getId()); - if(entity == null){ - return BaseResult.getFailureMessageEntity("获取消息模版失败"); - } - return BaseResult.getSuccessMessageEntity("获取消息模版成功", entity); - } + @Override + public JsonResultEntity getEntity(JSONObject jsonObject) { + SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity = sysMessageTemplateDao.get(entity.getId()); + if (entity == null) { + return BaseResult.getFailureMessageEntity("获取消息模版失败"); + } + return BaseResult.getSuccessMessageEntity("获取消息模版成功", entity); + } - @Override - public JsonResultEntity saveEntity(JSONObject jsonObject){ - SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if(entity.getBillKindId() == null || "".equals(entity.getBillKindId())){ - return BaseResult.getFailureMessageEntity("调用单据类型不允许为空"); - } - if(entity.getTemplateType() == null || "".equals(entity.getTemplateType())){ - return BaseResult.getFailureMessageEntity("模版类型不允许为空"); - } - if(entity.getTemplateName() == null || "".equals(entity.getTemplateName())){ - return BaseResult.getFailureMessageEntity("模版名称不允许为空"); - } - if(entity.getMessageContents() == null || "".equals(entity.getMessageContents())){ - return BaseResult.getFailureMessageEntity("消息内容不允许为空"); - } - if(entity.getDataSource() == null || "".equals(entity.getDataSource())){ - return BaseResult.getFailureMessageEntity("数据源不允许为空"); - } - if(entity.getCreateDate() == null){ - return BaseResult.getFailureMessageEntity("创建时间不允许为空"); - } - if(entity.getCreatePersonId() == null || "".equals(entity.getCreatePersonId())){ - return BaseResult.getFailureMessageEntity("创建人不允许为空"); - } - entity.setCreate(); - sysMessageTemplateDao.save(entity); - return BaseResult.getSuccessMessageEntity("保存消息模版成功",entity); - } + @Override + public JsonResultEntity saveEntity(JSONObject jsonObject) { + SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getTemplateType() == null || "".equals(entity.getTemplateType())) { + return BaseResult.getFailureMessageEntity("模版类型不允许为空"); + } + if (entity.getTemplateName() == null || "".equals(entity.getTemplateName())) { + return BaseResult.getFailureMessageEntity("模版名称不允许为空"); + } + if (entity.getMessageContents() == null || "".equals(entity.getMessageContents())) { + return BaseResult.getFailureMessageEntity("消息内容不允许为空"); + } + if (entity.getDataSource() == null || "".equals(entity.getDataSource())) { + return BaseResult.getFailureMessageEntity("数据源不允许为空"); + } + entity.setCreate(); + sysMessageTemplateDao.save(entity); + return BaseResult.getSuccessMessageEntity("保存消息模版成功", entity); + } - @Override - public JsonResultEntity updateEntity(JSONObject jsonObject){ - SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class); - if(entity == null){ - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getId() == null || "".equals(entity.getId())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - if(entity.getBillKindId() == null || "".equals(entity.getBillKindId())){ - return BaseResult.getFailureMessageEntity("调用单据类型不允许为空"); - } - if(entity.getTemplateType() == null || "".equals(entity.getTemplateType())){ - return BaseResult.getFailureMessageEntity("模版类型不允许为空"); - } - if(entity.getTemplateName() == null || "".equals(entity.getTemplateName())){ - return BaseResult.getFailureMessageEntity("模版名称不允许为空"); - } - if(entity.getMessageContents() == null || "".equals(entity.getMessageContents())){ - return BaseResult.getFailureMessageEntity("消息内容不允许为空"); - } - if(entity.getDataSource() == null || "".equals(entity.getDataSource())){ - return BaseResult.getFailureMessageEntity("数据源不允许为空"); - } - if(entity.getCreateDate() == null){ - return BaseResult.getFailureMessageEntity("创建时间不允许为空"); - } - if(entity.getCreatePersonId() == null || "".equals(entity.getCreatePersonId())){ - return BaseResult.getFailureMessageEntity("创建人不允许为空"); - } - entity.setUpdate(); - sysMessageTemplateDao.update(entity); - return BaseResult.getSuccessMessageEntity("修改消息模版成功",entity); - } + @Override + public JsonResultEntity updateEntity(JSONObject jsonObject) { + SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getTemplateType() == null || "".equals(entity.getTemplateType())) { + return BaseResult.getFailureMessageEntity("模版类型不允许为空"); + } + if (entity.getTemplateName() == null || "".equals(entity.getTemplateName())) { + return BaseResult.getFailureMessageEntity("模版名称不允许为空"); + } + if (entity.getMessageContents() == null || "".equals(entity.getMessageContents())) { + return BaseResult.getFailureMessageEntity("消息内容不允许为空"); + } + if (entity.getDataSource() == null || "".equals(entity.getDataSource())) { + return BaseResult.getFailureMessageEntity("数据源不允许为空"); + } + entity.setUpdate(); + sysMessageTemplateDao.update(entity); + return BaseResult.getSuccessMessageEntity("修改消息模版成功", entity); + } - @Override - public JsonResultEntity deleteEntity(JSONObject jsonObject){ - SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class); - if(entity == null){ - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getId() == null || "".equals(entity.getId())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - entity.setUpdate(); - //1、判断这个模版有没有被使用过,使用过就不能删除(待完成) - //将模版id去,预警配置表里查一下,如果有匹配的数据,代表有人正在使用,不能删除 - sysMessageTemplateDao.logicRemove(entity); - return BaseResult.getSuccessMessageEntity("删除消息模版成功"); - } + @Override + public JsonResultEntity deleteEntity(JSONObject jsonObject) { + SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //判断这个模版有没有被使用过,使用过就不能删除 + //将模版id去,预警配置表里查一下,如果有匹配的数据,代表有人正在使用,不能删除 + SysWarningConfigEntity warningConfigEntity = new SysWarningConfigEntity(); + warningConfigEntity.setMessageTemplateId(entity.getId()); + int count = sysWarningConfigDao.getCount(warningConfigEntity); + if (count > 0) { + return BaseResult.getFailureMessageEntity("该模版已被使用,不能删除"); + } + entity.setUpdate(); + sysMessageTemplateDao.logicRemove(entity); + return BaseResult.getSuccessMessageEntity("删除消息模版成功"); + } - @Override - public JsonResultEntity enableDisableEntity(JSONObject jsonObject){ - SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class); - if(entity == null){ - return BaseResult.getFailureMessageEntity("参数不允许为空"); - } - if (entity.getId() == null || "".equals(entity.getId())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - if (entity.getState() == null || "".equals(entity.getState())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - //0启用,1禁用 - if("0".equals(entity.getState())){ - entity.setUpdate(); - sysMessageTemplateDao.update(entity); - return BaseResult.getSuccessMessageEntity("启用模版成功"); - }else{ - //停用消息模版 - entity.setUpdate(); - sysMessageTemplateDao.update(entity); - return BaseResult.getSuccessMessageEntity("停用模版成功"); - } - } + @Override + public JsonResultEntity enableDisableEntity(JSONObject jsonObject) { + SysMessageTemplateEntity entity = getData("jsonStr", jsonObject, SysMessageTemplateEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getState() == null || "".equals(entity.getState())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //0停用,1启用 + if ("0".equals(entity.getState())) { + entity.setUpdate(); + sysMessageTemplateDao.update(entity); + //同步停用到预警配置表 + SysWarningConfigEntity warningConfigEntity = new SysWarningConfigEntity(); + warningConfigEntity.setMessageTemplateId(entity.getId()); + warningConfigEntity.setStatus("1"); + List warningConfigList = sysWarningConfigDao.queryByLike(warningConfigEntity); + for (SysWarningConfigEntity warningConfig : warningConfigList) { + warningConfig.setStatus("0"); + warningConfig.setUpdate(); + sysWarningConfigDao.update(warningConfig); + } + return BaseResult.getSuccessMessageEntity("停用模版成功"); + } else { + entity.setUpdate(); + sysMessageTemplateDao.update(entity); + return BaseResult.getSuccessMessageEntity("启用模版成功"); + } + } - @Override - public JsonResultEntity checkSql(JSONObject jsonObject) throws Exception { - try { - String sql = JSONObject.parseObject(jsonObject.getString("jsonStr")).getString("sql"); - List> result = execSqlService.execSelectSql(sql, "master"); - return BaseResult.getSuccessMessageEntity("SQL检查成功", result); - } catch (Exception e) { - return BaseResult.getFailureMessageEntity("SQL检查失败,原因:" + e.getMessage()); - } - } + @Override + public JsonResultEntity checkSql(JSONObject jsonObject) throws Exception { + try { + String sql = JSONObject.parseObject(jsonObject.getString("jsonStr")).getString("sql"); + List> result = execSqlService.execSelectSql(sql, "master"); + return BaseResult.getSuccessMessageEntity("SQL检查成功", result); + } catch (Exception e) { + return BaseResult.getFailureMessageEntity("SQL检查失败,原因:" + e.getMessage()); + } + } - @Override - public JsonResultEntity spliceMessage(JSONObject jsonObject){ - return BaseResult.getSuccessMessageEntity("消息拼接成功"); - } + @Override + public JsonResultEntity spliceMessage(JSONObject jsonObject) { + return BaseResult.getSuccessMessageEntity("消息拼接成功"); + } } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.java b/base-service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.java index 94eeb61f..9f5ba071 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.java @@ -9,8 +9,6 @@ public class SysPushMessageEntity extends BaseEntity { private Long warningAppCode; /** 预警接口编码 */ private Long warningApiCode; - /** 接收者ID列表*/ - private String recipientIdList; /** 预警应用类型 */ private String warningAppType; /** 发送应用名称 */ @@ -59,14 +57,6 @@ public class SysPushMessageEntity extends BaseEntity { this.receiveApiCode = receiveApiCode; } - public String getRecipientIdList() { - return recipientIdList; - } - - public void setRecipientIdList(String recipientIdList) { - this.recipientIdList = recipientIdList; - } - public String getWarningAppType() { return warningAppType; } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.xml b/base-service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.xml index 0916a33a..547ed5e9 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.xml @@ -7,7 +7,6 @@ - @@ -23,19 +22,20 @@ warning_config.sendAppid AS warning_app_code, warning_config.endApiCode AS warning_api_code, warning_config.app_type AS warning_app_type, - warning_config.recipient_id AS recipient_id_list, log.send_app_name, log.receive_app_name, receive_api_name, log.receive_api_code, log.return_data, - log.STATUS + log.STATUS, + log.create_time FROM v_hzya_sys_warning warning_config - LEFT JOIN v_hzya_sys_send_message_log log ON warning_config.api_code = log.receive_api_code + LEFT JOIN v_hzya_sys_send_message_log log ON warning_config.api_code = log.receive_api_code WHERE log.STATUS = '4' - AND warning_config.push_method = '定时' + AND warning_config.push_method = '定时' + AND log.create_time > DATE_SUB( CURDATE( ), INTERVAL 1 WEEK ) diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/pushMessage/service/impl/SysPushMessageServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/pushMessage/service/impl/SysPushMessageServiceImpl.java index 28a7028d..c3200814 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/pushMessage/service/impl/SysPushMessageServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/pushMessage/service/impl/SysPushMessageServiceImpl.java @@ -30,4 +30,5 @@ public class SysPushMessageServiceImpl extends BaseService list = sysPushMessageDao.getAll(); return BaseResult.getSuccessMessageEntity("success"); } + } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.java b/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.java index 6e88baf2..b425872e 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.java @@ -9,17 +9,20 @@ import com.hzya.frame.web.entity.BaseEntity; * @since 2024-08-30 14:19:30 */ public class SysSendMessageLogEntity extends BaseEntity { - + + + //接收人姓名 + private String recipientsPersonName; + //发送人姓名 + private String sendPersonName; /** 公司id */ private String companyId; - /** 来源业务单据 */ - private String billId; /** 消息类型(1、系统消息、2、单据消息、3、钉钉、4微信、5短信、6、邮件) */ private String type; /** 发送给谁(三方系统userID 钉钉微信、邮箱、手机号) */ - private String sendToUserId; + private String recipientsPersonId; /** 发送给系统内部人员ID */ - private String sendToPersonId; + private String recipientsInteriorId; /** 消息内容 */ private String sendCount; /** 发送时间 */ @@ -32,7 +35,72 @@ public class SysSendMessageLogEntity extends BaseEntity { private Integer state; /** 三方系统消息结果 */ private String resultMessage; + /** 预警接口表id */ + private String warningInterfaceId; + /** 应用id */ + private String appId; + /** 应用名称 */ + private String appName; + /** 消息标题 */ + private String messageTitle; + /** 按钮 */ + private String btns; + public String getAppName() { + return appName; + } + + public void setAppName(String appName) { + this.appName = appName; + } + + public String getMessageTitle() { + return messageTitle; + } + + public void setMessageTitle(String messageTitle) { + this.messageTitle = messageTitle; + } + + public String getBtns() { + return btns; + } + + public void setBtns(String btns) { + this.btns = btns; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getWarningInterfaceId() { + return warningInterfaceId; + } + + public void setWarningInterfaceId(String warningInterfaceId) { + this.warningInterfaceId = warningInterfaceId; + } + + public String getRecipientsPersonName() { + return recipientsPersonName; + } + + public void setRecipientsPersonName(String recipientsPersonName) { + this.recipientsPersonName = recipientsPersonName; + } + + public String getSendPersonName() { + return sendPersonName; + } + + public void setSendPersonName(String sendPersonName) { + this.sendPersonName = sendPersonName; + } public String getCompanyId() { return companyId; @@ -42,14 +110,6 @@ public class SysSendMessageLogEntity extends BaseEntity { this.companyId = companyId; } - public String getBillId() { - return billId; - } - - public void setBillId(String billId) { - this.billId = billId; - } - public String getType() { return type; } @@ -58,20 +118,20 @@ public class SysSendMessageLogEntity extends BaseEntity { this.type = type; } - public String getSendToUserId() { - return sendToUserId; + public String getRecipientsPersonId() { + return recipientsPersonId; } - public void setSendToUserId(String sendToUserId) { - this.sendToUserId = sendToUserId; + public void setRecipientsPersonId(String recipientsPersonId) { + this.recipientsPersonId = recipientsPersonId; } - public String getSendToPersonId() { - return sendToPersonId; + public String getRecipientsInteriorId() { + return recipientsInteriorId; } - public void setSendToPersonId(String sendToPersonId) { - this.sendToPersonId = sendToPersonId; + public void setRecipientsInteriorId(String recipientsInteriorId) { + this.recipientsInteriorId = recipientsInteriorId; } public String getSendCount() { diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.xml b/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.xml index 144a67e7..b0e9b621 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.xml @@ -12,31 +12,24 @@ - - - + + + + + + + + + - - - - - - - - - - - - - id @@ -47,53 +40,67 @@ ,modify_time ,sts ,org_id - ,company_id - ,bill_id + ,company_id ,type - ,send_to_user_id - ,send_to_person_id + ,recipients_person_id + ,recipients_interior_id ,send_count ,send_datetime ,send_person_id ,source_model_name ,state - ,result_message + ,result_message + ,warning_interface_id @@ -110,10 +117,9 @@ and sts = #{sts} and org_id = #{org_id} and company_id = #{companyId} - and bill_id = #{billId} and type = #{type} - and send_to_user_id = #{sendToUserId} - and send_to_person_id = #{sendToPersonId} + and recipients_person_id = #{recipientsPersonId} + and recipients_interior_id = #{recipientsInteriorId} and send_count = #{sendCount} and send_datetime = #{sendDatetime} and send_person_id = #{sendPersonId} @@ -128,32 +134,51 @@ @@ -172,10 +197,9 @@ or sts = #{sts} or org_id = #{org_id} or company_id = #{companyId} - or bill_id = #{billId} or type = #{type} - or send_to_user_id = #{sendToUserId} - or send_to_person_id = #{sendToPersonId} + or recipients_person_id = #{recipientsPersonId} + or recipients_interior_id = #{recipientsInteriorId} or send_count = #{sendCount} or send_datetime = #{sendDatetime} or send_person_id = #{sendPersonId} @@ -201,16 +225,16 @@ sts , org_id , company_id , - bill_id , type , - send_to_user_id , - send_to_person_id , + recipients_person_id , + recipients_interior_id , send_count , send_datetime , send_person_id , source_model_name , state , result_message , + warning_interface_id , sts, )values( @@ -224,34 +248,34 @@ #{sts} , #{org_id} , #{companyId} , - #{billId} , #{type} , - #{sendToUserId} , - #{sendToPersonId} , + #{recipientsPersonId} , + #{recipientsInteriorId} , #{sendCount} , #{sendDatetime} , #{sendPersonId} , #{sourceModelName} , #{state} , #{resultMessage} , + #{warningInterfaceId} , 'Y', ) - insert into sys_send_message_log(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, bill_id, type, send_to_user_id, send_to_person_id, send_count, send_datetime, send_person_id, source_model_name, state, result_message, sts) + insert into sys_send_message_log(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, bill_id, type, recipients_person_id, recipients_interior_id, send_count, send_datetime, send_person_id, source_model_name, state, result_message, sts) values - (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.billId},#{entity.type},#{entity.sendToUserId},#{entity.sendToPersonId},#{entity.sendCount},#{entity.sendDatetime},#{entity.sendPersonId},#{entity.sourceModelName},#{entity.state},#{entity.resultMessage}, 'Y') + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.billId},#{entity.type},#{entity.recipientsPersonId},#{entity.recipientsInteriorId},#{entity.sendCount},#{entity.sendDatetime},#{entity.sendPersonId},#{entity.sourceModelName},#{entity.state},#{entity.resultMessage}, 'Y') - insert into sys_send_message_log(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, bill_id, type, send_to_user_id, send_to_person_id, send_count, send_datetime, send_person_id, source_model_name, state, result_message) + insert into sys_send_message_log(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, bill_id, type, recipients_person_id, recipients_interior_id, send_count, send_datetime, send_person_id, source_model_name, state, result_message) values - (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.billId},#{entity.type},#{entity.sendToUserId},#{entity.sendToPersonId},#{entity.sendCount},#{entity.sendDatetime},#{entity.sendPersonId},#{entity.sourceModelName},#{entity.state},#{entity.resultMessage}) + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.billId},#{entity.type},#{entity.recipientsPersonId},#{entity.recipientsInteriorId},#{entity.sendCount},#{entity.sendDatetime},#{entity.sendPersonId},#{entity.sourceModelName},#{entity.state},#{entity.resultMessage}) on duplicate key update create_user_id = values(create_user_id), @@ -263,8 +287,8 @@ company_id = values(company_id), bill_id = values(bill_id), type = values(type), - send_to_user_id = values(send_to_user_id), - send_to_person_id = values(send_to_person_id), + recipients_person_id = values(recipients_person_id), + recipients_interior_id = values(recipients_interior_id), send_count = values(send_count), send_datetime = values(send_datetime), send_person_id = values(send_person_id), @@ -282,10 +306,9 @@ update sys_send_message_log set sts = #{sts}, org_id = #{org_id}, company_id = #{companyId}, - bill_id = #{billId}, type = #{type}, - send_to_user_id = #{sendToUserId}, - send_to_person_id = #{sendToPersonId}, + recipients_person_id = #{recipientsPersonId}, + recipients_interior_id = #{recipientsInteriorId}, send_count = #{sendCount}, send_datetime = #{sendDatetime}, send_person_id = #{sendPersonId}, @@ -308,10 +331,9 @@ update sys_send_message_log set sts= 'N' ,modify_time = #{modify_time},modify_u and sorts = #{sorts} and sts = #{sts} and company_id = #{companyId} - and bill_id = #{billId} and type = #{type} - and send_to_user_id = #{sendToUserId} - and send_to_person_id = #{sendToPersonId} + and recipients_person_id = #{recipientsPersonId} + and recipients_interior_id = #{recipientsInteriorId} and send_count = #{sendCount} and send_datetime = #{sendDatetime} and send_person_id = #{sendPersonId} @@ -326,28 +348,5 @@ update sys_send_message_log set sts= 'N' ,modify_time = #{modify_time},modify_u delete from sys_send_message_log where id = #{id} - - - - diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/ISysSendMessageLogService.java b/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/ISysSendMessageLogService.java index 929a22b3..0472f9ac 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/ISysSendMessageLogService.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/ISysSendMessageLogService.java @@ -23,6 +23,8 @@ public interface ISysSendMessageLogService extends IBaseService implements ISysSendMessageLogService { - @Resource - private ISysWarningInterfaceDao sysWarningInterfaceDao; - @Resource - private ISysWarningConfigDao sysWarningConfigDao; - @Resource - private ISysMessageTemplateDao sysMessageTemplateDao; - @Resource - private ISysUserDao sysUserDao; - @Resource - private ISysApplicationApiDao sysApplicationApiDao; - @Resource - private ISysApplicationApiParaDao sysApplicationApiParaDao; - @Value("${zt.url}") - private String url ; - private ISysSendMessageLogDao sysSendMessageLogDao; + @Resource + private ApplicationCache applicationCache; + @Resource + private ISysWarningInterfaceDao sysWarningInterfaceDao; + @Resource + private ISysWarningConfigDao sysWarningConfigDao; + @Resource + private ISysMessageTemplateDao sysMessageTemplateDao; + @Resource + private ISysUserDao sysUserDao; + @Resource + private ISysPersonDao sysPersonsDao; - @Autowired - public void setSysSendMessageLogDao(ISysSendMessageLogDao dao) { - this.sysSendMessageLogDao = dao; - this.dao = dao; - } + @Resource + private ISysApplicationApiDao sysApplicationApiDao; + @Resource + private ISysApplicationApiParaDao sysApplicationApiParaDao; - @Override - public JsonResultEntity queryEntityPage(JSONObject jsonObject) { - SysSendMessageLogEntity entity = getData("jsonStr", jsonObject, SysSendMessageLogEntity.class); - if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { - return BaseResult.getFailureMessageEntity("分页查询参数不存在"); - } - PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); - List list = sysSendMessageLogDao.queryByLike(entity); - PageInfo pageInfo = new PageInfo(list); - return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); - } + @Value("${zt.url}") + private String url ; - @Override - public JsonResultEntity queryEntity(JSONObject jsonObject) { - SysSendMessageLogEntity entity = getData("jsonStr", jsonObject, SysSendMessageLogEntity.class); - if (entity == null) { - entity = new SysSendMessageLogEntity(); - } - List list = sysSendMessageLogDao.queryByLike(entity); - return BaseResult.getSuccessMessageEntity("查询数据成功", list); - } + private ISysSendMessageLogDao sysSendMessageLogDao; - @Override - public JsonResultEntity getEntity(JSONObject jsonObject) { - SysSendMessageLogEntity entity = getData("jsonStr", jsonObject, SysSendMessageLogEntity.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不能为空"); - } - if (entity.getId() == null || "".equals(entity.getId())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - entity = sysSendMessageLogDao.get(entity.getId()); - if (entity == null) { - return BaseResult.getFailureMessageEntity("获取发送消息日志失败"); - } - return BaseResult.getSuccessMessageEntity("获取发送消息日志成功", entity); - } + @Autowired + public void setSysSendMessageLogDao(ISysSendMessageLogDao dao) { + this.sysSendMessageLogDao = dao; + this.dao = dao; + } - @Override - public JsonResultEntity saveEntity(JSONObject jsonObject) { - SysSendMessageLogEntity entity = getData("jsonStr", jsonObject, SysSendMessageLogEntity.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不能为空"); - } - if (entity.getBillId() == null || "".equals(entity.getBillId())) { - return BaseResult.getFailureMessageEntity("来源业务单据不能为空"); - } - entity.setCreate(); - sysSendMessageLogDao.save(entity); - return BaseResult.getSuccessMessageEntity("保存发送消息日志成功", entity); - } + @Override + public JsonResultEntity queryEntityPage(JSONObject jsonObject) { + SysSendMessageLogEntity entity = getData("jsonStr", jsonObject, SysSendMessageLogEntity.class); + if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) { + return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + } + PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + List list = sysSendMessageLogDao.queryByLike(entity); + PageInfo pageInfo = new PageInfo(list); + return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + } - @Override - public JsonResultEntity updateEntity(JSONObject jsonObject){ - SysSendMessageLogEntity entity = getData("jsonStr", jsonObject, SysSendMessageLogEntity.class); - if (entity == null) { - return BaseResult.getFailureMessageEntity("参数不能为空"); - } - if (entity.getId() == null || "".equals(entity.getId())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - if (entity.getBillId() == null || "".equals(entity.getBillId())) { - return BaseResult.getFailureMessageEntity("来源业务单据不能为空"); - } - entity.setUpdate(); - sysSendMessageLogDao.update(entity); - return BaseResult.getSuccessMessageEntity("修改发送消息日志成功", entity); - } + @Override + public JsonResultEntity queryEntity(JSONObject jsonObject) { + SysSendMessageLogEntity entity = getData("jsonStr", jsonObject, SysSendMessageLogEntity.class); + if (entity == null) { + entity = new SysSendMessageLogEntity(); + } + List list = sysSendMessageLogDao.queryByLike(entity); + return BaseResult.getSuccessMessageEntity("查询数据成功", list); + } - @Override - public JsonResultEntity deleteEntity(JSONObject jsonObject){ - SysSendMessageLogEntity entity = getData("jsonStr", jsonObject, SysSendMessageLogEntity.class); - if(entity == null){ - return BaseResult.getFailureMessageEntity("参数不能为空"); - } - if (entity.getId() == null || "".equals(entity.getId())) { - return BaseResult.getFailureMessageEntity("系统错误"); - } - entity.setUpdate();; - sysSendMessageLogDao.logicRemove(entity); - return BaseResult.getSuccessMessageEntity("删除发送消息日志成功", entity); - } + @Override + public JsonResultEntity getEntity(JSONObject jsonObject) { + SysSendMessageLogEntity entity = getData("jsonStr", jsonObject, SysSendMessageLogEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不能为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity = sysSendMessageLogDao.get(entity.getId()); + if (entity == null) { + return BaseResult.getFailureMessageEntity("获取发送消息日志失败"); + } + return BaseResult.getSuccessMessageEntity("获取发送消息日志成功", entity); + } + + @Override + public JsonResultEntity markRead(JSONObject jsonObject) { + SysSendMessageLogEntity entity = getData("jsonStr", jsonObject, SysSendMessageLogEntity.class); + if (entity.getAppId() == null || "".equals(entity.getAppId())) { + return BaseResult.getFailureMessageEntity("传入appId不能为空"); + } + List list = sysSendMessageLogDao.queryBase(entity); + if (list == null || list.size() == 0) { + return BaseResult.getSuccessMessageEntity("未找到需要标记已读的消息日志", list); + } + for (SysSendMessageLogEntity log : list) { + log.setState(1); + log.setUpdate(); + sysSendMessageLogDao.update(log); + } + return BaseResult.getSuccessMessageEntity("标记已读成功", list); + } + + @Override + public JsonResultEntity saveEntity(JSONObject jsonObject) { + SysSendMessageLogEntity entity = getData("jsonStr", jsonObject, SysSendMessageLogEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不能为空"); + } + entity.setCreate(); + sysSendMessageLogDao.save(entity); + return BaseResult.getSuccessMessageEntity("保存发送消息日志成功", entity); + } + + @Override + public JsonResultEntity updateEntity(JSONObject jsonObject) { + SysSendMessageLogEntity entity = getData("jsonStr", jsonObject, SysSendMessageLogEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不能为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setUpdate(); + sysSendMessageLogDao.update(entity); + return BaseResult.getSuccessMessageEntity("修改发送消息日志成功", entity); + } + + @Override + public JsonResultEntity deleteEntity(JSONObject jsonObject) { + SysSendMessageLogEntity entity = getData("jsonStr", jsonObject, SysSendMessageLogEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不能为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setUpdate(); + ; + sysSendMessageLogDao.logicRemove(entity); + return BaseResult.getSuccessMessageEntity("删除发送消息日志成功", entity); + } - /** - * sendMessage方法:根据请求错误消息,组装成消息模版,推送到三方业务系统 - * 1、先获取接口调用的日志数据 - * 2、如果日志状态为失败,且该接口预警状态为启用,则进行消息推送 - * 3、根据预警配置,找到消息模版,并生成消息内容 - * 4、根据预警配置,找到预警应用,并推送消息 - * 5、保存消息推送日志 - * */ - @Override - public boolean sendMessage(SysPushMessageEntity entity){ - String status = entity.getStatus(); - Long receiveApiCode = entity.getReceiveApiCode(); - String sendAppName = entity.getSendAppName(); - String receiveApiName = entity.getReceiveApiName(); - String recieveAppName = entity.getReceiveAppName(); - String returnData = entity.getReturnData(); - String warningAppType = entity.getWarningAppType(); - Long warningAppCode = entity.getWarningAppCode(); - Long warningApiCode = entity.getWarningApiCode(); - String sendMsgContent = ""; + /** + * sendMessage方法:根据请求错误消息,组装成消息模版,推送到三方业务系统 + * 1、先获取接口调用的日志数据 + * 2、如果日志状态为失败,且该接口预警状态为启用,则进行消息推送 + * 3、根据预警配置,找到消息模版,并生成消息内容 + * 4、根据预警配置,找到预警应用,并推送消息 + * 5、保存消息推送日志 + */ + @Override + public boolean sendMessage(SysPushMessageEntity entity) { + String status = entity.getStatus(); + Long receiveApiCode = entity.getReceiveApiCode(); + String sendAppName = entity.getSendAppName(); + String receiveApiName = entity.getReceiveApiName(); + String recieveAppName = entity.getReceiveAppName(); + String returnData = entity.getReturnData(); + String sendMsgContent = ""; - SysWarningInterfaceEntity interfaceEntity = new SysWarningInterfaceEntity(); - SysWarningConfigEntity configEntity = new SysWarningConfigEntity(); - SysMessageTemplateEntity templateEntity = new SysMessageTemplateEntity(); - SysApplicationApiParaEntity sysApplicationApiParaEntity = new SysApplicationApiParaEntity(); + //SysWarningInterfaceEntity interfaceEntityApi = new SysWarningInterfaceEntity(); + SysWarningInterfaceEntity interfaceEntity = new SysWarningInterfaceEntity(); + SysWarningConfigEntity configEntity = new SysWarningConfigEntity(); + SysMessageTemplateEntity templateEntity = new SysMessageTemplateEntity(); + SysApplicationApiParaEntity sysApplicationApiParaEntity = new SysApplicationApiParaEntity(); - interfaceEntity.setApiCode(receiveApiCode); + //interfaceEntityApi.setApiCode(receiveApiCode); + interfaceEntity.setApiCode(receiveApiCode); + if (status == null) { + logger.error("日志状态为空"); + return false; + } + //只有发送失败的日志才会推送消息,成功的日志不推送消息 + if ("4".equals(status)) { + try { + interfaceEntity = sysWarningInterfaceDao.queryOne(interfaceEntity); + } catch (Exception e) { + logger.error("API接口预警信息可能配置了多个"); + return false; + } + //List interfaceEntityList =sysWarningInterfaceDao.queryByLike(interfaceEntityApi); + //for(SysWarningInterfaceEntity interfaceEntity : interfaceEntityList){ + if (interfaceEntity == null) { + logger.error("未找到API接口预警信息"); + return false; + } + //只有预警接口状态为启用,才会进行消息推送 + if (interfaceEntity.getStatus() == null || interfaceEntity.getStatus().equals("1") == false) { + logger.error("API接口未启用推送"); + return false; + } + //根据主表id,找到主表记录中的消息模版id + String warningConfigId = interfaceEntity.getWarningConfigId(); + SysWarningConfigEntity statusEntity = new SysWarningConfigEntity(); + statusEntity.setStatus("1"); + statusEntity.setId(warningConfigId); + if (warningConfigId == null || "".equals(warningConfigId)) { + logger.error("未找到该接口预警配置信息的主表id"); + return false; + } + configEntity = sysWarningConfigDao.queryOne(statusEntity); + if (configEntity == null) { + logger.error("未找到该接口预警配置信息"); + return false; + } + String messageTemplateId = configEntity.getMessageTemplateId(); + if (messageTemplateId == null || "".equals(messageTemplateId)) { + logger.error("未找到该接口预警配置信息的消息模版id"); + return false; + } + templateEntity = sysMessageTemplateDao.get(messageTemplateId); + if (templateEntity == null) { + logger.error("未找到该接口预警配置信息的消息模版信息"); + return false; + } + if(templateEntity.getState() == null || !"1".equals(templateEntity.getState())){ + logger.error("当前预警配置中消息模版状态为禁用"); + return false; + } - if(status == null){ - logger.error("日志状态为空"); - return false; - } - //只有发送失败的日志才会推送消息,成功的日志不推送消息 - if ("4".equals(status)) { - interfaceEntity = sysWarningInterfaceDao.queryOne(interfaceEntity); - if(interfaceEntity == null){ - logger.error("未找到API接口预警信息"); - return false; - } - //只有预警接口状态为启用,才会进行消息推送 - if(interfaceEntity.getStatus() == null || interfaceEntity.getStatus().equals("1") == false){ - logger.error("API接口未启用推送"); - return false; - } - //根据主表id,找到主表记录中的消息模版id - String warningConfigId = interfaceEntity.getWarningConfigId(); - if(warningConfigId == null || "".equals(warningConfigId)){ - logger.error("未找到该接口预警配置信息的主表id"); - return false; - } - configEntity = sysWarningConfigDao.get(warningConfigId); - if(configEntity == null){ - logger.error("未找到该接口预警配置信息"); - return false; - } - String messageTemplateId = configEntity.getMessageTemplateId(); - if(messageTemplateId == null || "".equals(messageTemplateId)){ - logger.error("未找到该接口预警配置信息的消息模版id"); - return false; - } - templateEntity = sysMessageTemplateDao.get(messageTemplateId); - if(templateEntity == null){ - logger.error("未找到该接口预警配置信息的消息模版信息"); - return false; - } + String messageContent = templateEntity.getMessageContents(); + if (messageContent == null || "".equals(messageContent)) { + logger.error("未找到该接口预警配置信息的消息模版内容"); + return false; + } + //推送消息内容拼接 + sendMsgContent = messageContent.replace("${receive_app_name}", recieveAppName); + sendMsgContent = sendMsgContent.replace("${send_app_name}", sendAppName); + sendMsgContent = sendMsgContent.replace("${receive_api_name}", receiveApiName); + sendMsgContent = sendMsgContent.replace("${return_data}", returnData); + //消息模版名称 + String templateName = templateEntity.getTemplateName(); + String type = ""; + String bodyParams = ""; + String warningAppId = configEntity.getWarningAppId(); - String messageContent = templateEntity.getMessageContents(); - if(messageContent == null || "".equals(messageContent)){ - logger.error("未找到该接口预警配置信息的消息模版内容"); - return false; - } - //推送消息内容拼接 - sendMsgContent = messageContent.replace("${reciecveAppName}",recieveAppName); - sendMsgContent = sendMsgContent.replace("${sendAppName}",sendAppName); - sendMsgContent = sendMsgContent.replace("${receiveApiName}",receiveApiName); - sendMsgContent = sendMsgContent.replace("${returnData}",returnData); - //消息模版名称 - String templateName = templateEntity.getTemplateName(); - String type = ""; - String bodyParams = ""; - String warningAppId = configEntity.getWarningAppId(); + Long warningApiCode = configEntity.getAcceptMessageApiCode(); + String appCode = String.valueOf(warningApiCode).substring(0, 6); + SysApplicationEntity warningApp = getAppByAppId(appCode); + String warningAppType = warningApp.getAppType(); + Integer warningAppCode = warningApp.getAppId(); - //查询预警人员id列表 - String recipientIdList = configEntity.getRecipientId(); - //根据预警人员id列表,获取预警应用人员id列表 - String warningAppReceiverIdList = getWarningAppReceiverIdList(warningAppType,recipientIdList); + //查询预警人员id列表 + String recipientIdList = configEntity.getRecipientIdList(); + //根据预警人员id列表,获取预警应用人员id列表 + String warningAppReceiverIdList = getWarningAppReceiverIdList(warningAppType, recipientIdList); - switch (warningAppType){ - case "6WX": - //调用微信推送消息 - break; - case "5DD": - //消息类型:3表示钉钉 - type = "3"; - //获取钉钉发送消息时使用的微应用的AgentID - sysApplicationApiParaEntity.setAppId(warningAppId); - sysApplicationApiParaEntity.setInterfaceKey("agentId"); - String agentId = sysApplicationApiParaDao.queryOne(sysApplicationApiParaEntity).getInterfaceValue(); - //拼接调用钉钉接口的body参数 - bodyParams = splicingDDBody(sendMsgContent,agentId,warningAppReceiverIdList).toString(); - break; - default: - logger.error("未找到该应用类型"); - break; - } - String result = HttpRequest.post(url). - header("appId",warningAppCode.toString()). - header("apiCode",warningApiCode.toString()). - header("publicKey","ZJYA7v6DubGMm8EdBPGo+Jj9wCpUeCGJEpfBRLiInq4dvDlCe7eDIk+3zDUT+v578prj"). - header("secretKey","bsAMm6tvJs/BV1SO/9ZzjlW+OQaK0mwyv6rLvktyNy/OdltLuG2zze9bT7ttfAA9j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). - body(bodyParams). - execute(). - body(); - JSONObject resultJson = JSONObject.parseObject(result); - String body = resultJson.getString("attribute"); + switch (warningAppType) { + case "6WX": + //调用微信推送消息 + break; + case "5DD": + //消息类型:3表示钉钉 + type = "3"; + //获取钉钉发送消息时使用的微应用的AgentID + sysApplicationApiParaEntity.setAppId(warningAppId); + sysApplicationApiParaEntity.setInterfaceKey("agentId"); + String agentId = sysApplicationApiParaDao.queryOne(sysApplicationApiParaEntity).getInterfaceValue(); + //拼接调用钉钉接口的body参数 + bodyParams = splicingDDBody(sendMsgContent, agentId, warningAppReceiverIdList).toString(); + break; + default: + logger.error("未找到该应用类型"); + break; + } + String result = HttpRequest.post(url). + header("appId", warningAppCode.toString()). + header("apiCode", warningApiCode.toString()). + header("publicKey", "ZJYA7v6DubGMm8EdBPGo+Jj9wCpUeCGJEpfBRLiInq4dvDlCe7eDIk+3zDUT+v578prj"). + header("secretKey", "bsAMm6tvJs/BV1SO/9ZzjlW+OQaK0mwyv6rLvktyNy/OdltLuG2zze9bT7ttfAA9j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). + body(bodyParams). + execute(). + body(); + JSONObject resultJson = JSONObject.parseObject(result); + String body = resultJson.getString("attribute"); + SysApplicationApiEntity warningApiEntity = getApiByAppIdApiCode(warningAppId, warningApiCode.toString()); - SysApplicationApiEntity sysApplicationApiEntity = new SysApplicationApiEntity(); - sysApplicationApiEntity.setApiCode(warningApiCode); - SysApplicationApiEntity warningApiEntity = sysApplicationApiDao.queryOne(sysApplicationApiEntity); + //根据预警接口编码,以及返回数据,判断消息推送是否成功 + if (warningApiEntity.getReturnSuccessField() != null && !"".equals(warningApiEntity.getReturnSuccessField()) + && warningApiEntity.getReturnSuccessValue() != null && !"".equals(warningApiEntity.getReturnSuccessValue())) { + //先判断返回值是否为JSON格式 + if (JSONUtil.isTypeJSON(body)) { + JSONObject cheackdatas = JSONObject.parseObject(body); + JSONObject datas = JSONObject.parseObject(body); + String checkdata = cheackdatas.getString(warningApiEntity.getReturnSuccessField()); + //判断返回值是否为预警接口预期的返回值(1、返回值匹配2、返回值配置的就是not null3、返回值带.) + if (checkdata != null && warningApiEntity.getReturnSuccessValue().equals(checkdata)) { + logger.info("推送消息成功,开始保存日志"); + } else if (warningApiEntity.getReturnSuccessValue().equals("not null") && checkdata != null) { + logger.info("推送消息成功,开始保存日志"); + } else { + String fieldname = warningApiEntity.getReturnSuccessField(); + if (fieldname.contains(".")) { + String[] fileds = fieldname.split("\\."); + boolean flags = false; + for (int i = 0; i < fileds.length; i++) { + if (JSONUtil.isTypeJSON(datas.getString(fileds[i]))) { + datas = datas.getJSONObject(fileds[i]); + if (fileds.length - 2 == i) { + String a = datas.getString(fileds[i + 1]); + if (a != null && warningApiEntity.getReturnSuccessValue().equals(a)) { + flags = true; + break; + } else if (warningApiEntity.getReturnSuccessValue().equals("not null") && a != null) { + flags = true; + break; + } else { + break; + } + } + } + } + if (flags) { + logger.info("推送消息成功,开始保存日志"); + } else { + logger.error("推送消息失败,返回值错误"); + } - //根据预警接口编码,以及返回数据,判断消息推送是否成功 - if(warningApiEntity.getReturnSuccessField() != null && !"".equals(warningApiEntity.getReturnSuccessField()) - && warningApiEntity.getReturnSuccessValue() != null && !"".equals(warningApiEntity.getReturnSuccessValue())){ - //先判断返回值是否为JSON格式 - if (JSONUtil.isTypeJSON(body)){ - JSONObject cheackdatas = JSONObject.parseObject(body); - JSONObject datas = JSONObject.parseObject(body); - String checkdata = cheackdatas.getString(warningApiEntity.getReturnSuccessField()); - //判断返回值是否为预警接口预期的返回值(1、返回值匹配2、返回值配置的就是not null3、返回值带.) - if (checkdata != null && warningApiEntity.getReturnSuccessValue().equals(checkdata)) { - logger.info("推送消息成功,开始保存日志"); - }else if(warningApiEntity.getReturnSuccessValue().equals("not null") && checkdata != null){ - logger.info("推送消息成功,开始保存日志"); - }else { - String fieldname = warningApiEntity.getReturnSuccessField(); - if(fieldname.contains(".")){ - String[] fileds = fieldname.split("\\."); - boolean flags = false; - for (int i = 0; i < fileds.length; i++) { - if (JSONUtil.isTypeJSON(datas.getString(fileds[i]))) { - datas = datas.getJSONObject(fileds[i]); - if(fileds.length-2 == i ){ - String a = datas.getString(fileds[i+1]); - if (a != null && warningApiEntity.getReturnSuccessValue().equals(a)) { - flags = true; - break; - }else if(warningApiEntity.getReturnSuccessValue().equals("not null") && a != null){ - flags = true; - break; - }else { - break; - } - } - } - } - if(flags){ - logger.info("推送消息成功,开始保存日志"); - }else { - logger.error("推送消息失败,返回值错误"); - } + } else { + logger.error("推送消息失败,返回值错误"); + } + } + } else { + logger.error("接口调用失败,返回格式错误,不是JSON"); + } + } else { + logger.error("api返回信息字段未配置,开始保存日志"); + } + saveLog(sendMsgContent, type, resultJson.toString(), templateName, recipientIdList, warningAppReceiverIdList, interfaceEntity.getId()); + logger.info("保存日志成功"); + //} - }else { - logger.error("推送消息失败,返回值错误"); - } - } - }else{ - logger.error("接口调用失败,返回格式错误,不是JSON"); - } - }else{ - logger.error("api返回信息字段未配置,开始保存日志"); - } - saveLog(sendMsgContent,type,resultJson.toString(),templateName,recipientIdList,warningAppReceiverIdList); - logger.info("保存日志成功"); - }else{ - logger.error("日志状态为成功,不需要推送消息"); - return false; - } - return true; - } + } else { + logger.error("日志状态为成功,不需要推送消息"); + return false; + } + return true; + } + /** + * 根据appCode查询缓存中的应用信息 + */ + private SysApplicationEntity getAppByAppId(String appId) { + String str = "appId" + appId; + Object o = applicationCache.get("1", str); + if (o != null) { + return (SysApplicationEntity) o; + } + return null; + } - /**保存推送消息日志时,需要循环预警应用人员id列表*/ - public void saveLog(String sendMsgContent,String type,String resultMessage,String templateName,String recipientIdList,String warningAppReceiverIdList){ - SysSendMessageLogEntity logEntity = new SysSendMessageLogEntity(); - logEntity.setSendCount(sendMsgContent); - logEntity.setType(type); - logEntity.setBillId("test1411"); - logEntity.setSendDatetime(new Date()); + /** + * 根据appId和apiCode查询缓存中的api信息 + */ + private SysApplicationApiEntity getApiByAppIdApiCode(String appId, String apiCode) { - logEntity.setSts("Y"); - logEntity.setCreate_user_id("1"); - logEntity.setModify_user_id("1"); - logEntity.setCreate_time(new Date()); - logEntity.setModify_time(new Date()); - logEntity.setOrg_id("0"); - logEntity.setCompanyId("0"); + String str = "appId" + appId + "apiCode" + apiCode; + Object o = applicationCache.get("2", str); + if (o != null) { + return (SysApplicationApiEntity) o; + } + return null; + } + + /** + * 保存推送消息日志时,需要循环预警应用人员id列表 + */ + public void saveLog(String sendMsgContent, String type, String resultMessage, String templateName, String recipientIdList, String warningAppReceiverIdList,String warningInterfaceId) { + SysSendMessageLogEntity logEntity = new SysSendMessageLogEntity(); + logEntity.setSendCount(sendMsgContent); + logEntity.setType(type); + logEntity.setSendDatetime(new Date()); + + logEntity.setSts("Y"); + logEntity.setCreate_user_id("1"); + logEntity.setModify_user_id("1"); + logEntity.setCreate_time(new Date()); + logEntity.setModify_time(new Date()); + logEntity.setOrg_id("0"); + logEntity.setCompanyId("0"); logEntity.setSendPersonId("1"); - logEntity.setResultMessage(resultMessage); - logEntity.setSourceModelName(templateName); + logEntity.setResultMessage(resultMessage); + logEntity.setSourceModelName(templateName); + logEntity.setState(0); + logEntity.setWarningInterfaceId(warningInterfaceId); + String[] recipientsInteriorIdList = warningAppReceiverIdList.split(","); + String[] recipientsPersonIdList = recipientIdList.split(","); - String[] personIdList = warningAppReceiverIdList.split(","); - String[] userIdList = recipientIdList.split(","); + for (int i = 0; i < recipientsInteriorIdList.length; i++) { + logEntity.setRecipientsInteriorId(recipientsInteriorIdList[i]); + logEntity.setRecipientsPersonId(recipientsPersonIdList[i]); + logEntity.setId(UUIDUtils.getUUID()); + sysSendMessageLogDao.save(logEntity); + } + } - for(int i=0;i sysUserList = new ArrayList<>(); - for(String userId : userIdArray){ - sysUserList.add(sysUserDao.get(userId)); - } - switch (warningAppType){ - case "6WX": - //获取微信预警人员id列表 - break; - case "5DD": - //获取钉钉预警人员id列表 - for(SysUserEntity sysUser : sysUserList){ - if(sysUser.getDdUserId()!= null && !"".equals(sysUser.getDdUserId())){ - if(!warningAppReceiverIdList.isEmpty()){ - warningAppReceiverIdList += ","; - } - warningAppReceiverIdList += sysUser.getDdUserId(); - } - } - break; - default: - logger.error("未找到该应用类型"); - break; - } + String[] personIdArray = personIdList.split(","); + List sysUserList = new ArrayList<>(); + SysUserEntity sysUserEntity = new SysUserEntity(); + for (String personId : personIdArray) { + sysUserEntity.setPersonId(personId); + sysUserList.add(sysUserDao.queryOne(sysUserEntity)); + } + String warningAppReceiverIdList = ""; + switch (warningAppType) { + case "6WX": + //获取微信预警人员id列表 + break; + case "5DD": + //获取钉钉预警人员id列表 + for (SysUserEntity sysUser : sysUserList) { + if (sysUser.getDdUserId() == null || "".equals(sysUser.getDdUserId())) { + String personName = sysPersonsDao.get(sysUser.getPersonId()).getPersonName(); + logger.error("接收人:" +personName + "未配置钉钉用户id"); + } + if (sysUser.getDdUserId() != null && !"".equals(sysUser.getDdUserId())) { + if (!warningAppReceiverIdList.isEmpty()) { + warningAppReceiverIdList += ","; + } + warningAppReceiverIdList += sysUser.getDdUserId(); + } + } + break; + default: + logger.error("未找到该应用类型"); + break; + } return warningAppReceiverIdList; - } + } } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/warningConfig/entity/SysWarningConfigEntity.java b/base-service/src/main/java/com/hzya/frame/sysnew/warningConfig/entity/SysWarningConfigEntity.java index 11be0abe..61d21a2e 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/warningConfig/entity/SysWarningConfigEntity.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/warningConfig/entity/SysWarningConfigEntity.java @@ -14,8 +14,8 @@ public class SysWarningConfigEntity extends BaseEntity { private String companyId; /** 消息模版id */ private String messageTemplateId; - /** 应用id */ - private String appId; + /** 应用id列表 */ + private String appIdList; /** 预警应用id */ private String warningAppId; /** 接收推送消息的api编码 */ @@ -25,8 +25,63 @@ public class SysWarningConfigEntity extends BaseEntity { /** 是否启用(0:停用、1:启用) */ private String status; /** 接收人id(存表sys_user的id) */ - private String recipientId; + private String recipientIdList; + /** 模版名称 */ + private String templateName; + /** 应用名称 */ + private String appNameList; + /** 预警应用名称 */ + private String warningAppNameList; + /** 接收人名称列表 */ + private String recipientNameList; + public String getWarningAppNameList() { + return warningAppNameList; + } + + public void setWarningAppNameList(String warningAppNameList) { + this.warningAppNameList = warningAppNameList; + } + + public String getTemplateName() { + return templateName; + } + + public void setTemplateName(String templateName) { + this.templateName = templateName; + } + + public String getAppNameList() { + return appNameList; + } + + public void setAppNameList(String appNameList) { + this.appNameList = appNameList; + } + + public String getRecipientNameList() { + return recipientNameList; + } + + public void setRecipientNameList(String recipientNameList) { + this.recipientNameList = recipientNameList; + } + + public String getAppIdList() { + return appIdList; + } + + public void setAppIdList(String appIdList) { + this.appIdList = appIdList; + } + + public String getRecipientIdList() { + return recipientIdList; + } + + public void setRecipientIdList(String recipientIdList) { + this.recipientIdList = recipientIdList; + } public String getCompanyId() { return companyId; @@ -44,13 +99,6 @@ public class SysWarningConfigEntity extends BaseEntity { this.messageTemplateId = messageTemplateId; } - public String getAppId() { - return appId; - } - - public void setAppId(String appId) { - this.appId = appId; - } public String getWarningAppId() { return warningAppId; @@ -84,13 +132,5 @@ public class SysWarningConfigEntity extends BaseEntity { this.status = status; } - public String getRecipientId() { - return recipientId; - } - - public void setRecipientId(String recipientId) { - this.recipientId = recipientId; - } - } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/warningConfig/entity/SysWarningConfigEntity.xml b/base-service/src/main/java/com/hzya/frame/sysnew/warningConfig/entity/SysWarningConfigEntity.xml index c7ff7a11..ac4fcc10 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/warningConfig/entity/SysWarningConfigEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sysnew/warningConfig/entity/SysWarningConfigEntity.xml @@ -13,12 +13,13 @@ - + - + + @@ -32,19 +33,22 @@ ,org_id ,company_id ,message_template_id - ,app_id + ,app_id_list ,warning_app_id ,accept_message_api_code ,remark ,status - ,recipient_id + ,recipient_id_list select - - from sys_warning_config + config.* + ,template.template_name + from sys_warning_config config + LEFT JOIN sys_message_template template ON template.id = config.message_template_id - and id like concat('%',#{id},'%') - and sorts like concat('%',#{sorts},'%') - and create_user_id like concat('%',#{create_user_id},'%') - and create_time like concat('%',#{create_time},'%') - and modify_user_id like concat('%',#{modify_user_id},'%') - and modify_time like concat('%',#{modify_time},'%') - and sts like concat('%',#{sts},'%') - and org_id like concat('%',#{org_id},'%') - and company_id like concat('%',#{companyId},'%') - and message_template_id like concat('%',#{messageTemplateId},'%') - and app_id like concat('%',#{appId},'%') - and warning_app_id like concat('%',#{warningAppId},'%') - and accept_message_api_code like concat('%',#{acceptMessageApiCode},'%') - and remark like concat('%',#{remark},'%') - and status like concat('%',#{status},'%') - and recipient_id like concat('%',#{recipientId},'%') - and sts='Y' + and config.id like concat('%',#{id},'%') + and config.sorts like concat('%',#{sorts},'%') + and config.create_user_id like concat('%',#{create_user_id},'%') + and config.create_time like concat('%',#{create_time},'%') + and config.modify_user_id like concat('%',#{modify_user_id},'%') + and config.modify_time like concat('%',#{modify_time},'%') + and config.sts like concat('%',#{sts},'%') + and config.org_id like concat('%',#{org_id},'%') + and config.company_id like concat('%',#{companyId},'%') + and config.message_template_id like concat('%',#{messageTemplateId},'%') + and config.app_id_list like concat('%',#{appIdList},'%') + and config.warning_app_id like concat('%',#{warningAppId},'%') + and config.accept_message_api_code like concat('%',#{acceptMessageApiCode},'%') + and config.remark like concat('%',#{remark},'%') + and config.status like concat('%',#{status},'%') + and config.recipient_id_list like concat('%',#{recipientIdList},'%') + and config.sts='Y' + and template.sts='Y' - order by sorts asc + order by config.sorts asc order by ${sort} ${order} @@ -144,12 +151,12 @@ or org_id = #{org_id} or company_id = #{companyId} or message_template_id = #{messageTemplateId} - or app_id = #{appId} + or app_id_list = #{appIdList} or warning_app_id = #{warningAppId} or accept_message_api_code = #{acceptMessageApiCode} or remark = #{remark} or status = #{status} - or recipient_id = #{recipientId} + or recipient_id_list = #{recipientIdList} and sts='Y' order by sorts asc @@ -170,12 +177,12 @@ org_id , company_id , message_template_id , - app_id , + app_id_list , warning_app_id , accept_message_api_code , remark , status , - recipient_id , + recipient_id_list , sts, )values( @@ -190,30 +197,30 @@ #{org_id} , #{companyId} , #{messageTemplateId} , - #{appId} , + #{appIdList} , #{warningAppId} , #{acceptMessageApiCode} , #{remark} , #{status} , - #{recipientId} , + #{recipientIdList} , 'Y', ) - insert into sys_warning_config(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, message_template_id, app_id, warning_app_id, accept_message_api_code, remark, status, recipient_id, sts) + insert into sys_warning_config(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, message_template_id, app_id_list, warning_app_id, accept_message_api_code, remark, status, recipient_id_list, sts) values - (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.messageTemplateId},#{entity.appId},#{entity.warningAppId},#{entity.acceptMessageApiCode},#{entity.remark},#{entity.status},#{entity.recipientId}, 'Y') + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.messageTemplateId},#{entity.appIdList},#{entity.warningAppId},#{entity.acceptMessageApiCode},#{entity.remark},#{entity.status},#{entity.recipientIdList}, 'Y') - insert into sys_warning_config(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, message_template_id, app_id, warning_app_id, accept_message_api_code, remark, status, recipient_id) + insert into sys_warning_config(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, message_template_id, app_id_list, warning_app_id, accept_message_api_code, remark, status, recipient_id_list) values - (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.messageTemplateId},#{entity.appId},#{entity.warningAppId},#{entity.acceptMessageApiCode},#{entity.remark},#{entity.status},#{entity.recipientId}) + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.messageTemplateId},#{entity.appIdList},#{entity.warningAppId},#{entity.acceptMessageApiCode},#{entity.remark},#{entity.status},#{entity.recipientIdList}) on duplicate key update create_user_id = values(create_user_id), @@ -224,12 +231,12 @@ org_id = values(org_id), company_id = values(company_id), message_template_id = values(message_template_id), - app_id = values(app_id), + app_id_list = values(app_id_list), warning_app_id = values(warning_app_id), accept_message_api_code = values(accept_message_api_code), remark = values(remark), status = values(status), - recipient_id = values(recipient_id) + recipient_id_list = values(recipient_id_list) update sys_warning_config set @@ -242,12 +249,12 @@ update sys_warning_config set org_id = #{org_id}, company_id = #{companyId}, message_template_id = #{messageTemplateId}, - app_id = #{appId}, + app_id_list = #{appIdList}, warning_app_id = #{warningAppId}, accept_message_api_code = #{acceptMessageApiCode}, remark = #{remark}, status = #{status}, - recipient_id = #{recipientId}, + recipient_id_list = #{recipientIdList}, where id = #{id} @@ -265,12 +272,12 @@ update sys_warning_config set sts= 'N' ,modify_time = #{modify_time},modify_use and sts = #{sts} and company_id = #{companyId} and message_template_id = #{messageTemplateId} - and app_id = #{appId} + and app_id_list = #{appIdList} and warning_app_id = #{warningAppId} and accept_message_api_code = #{acceptMessageApiCode} and remark = #{remark} and status = #{status} - and recipient_id = #{recipientId} + and recipient_id_list = #{recipientIdList} and sts='Y' diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/warningConfig/service/impl/SysWarningConfigServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/warningConfig/service/impl/SysWarningConfigServiceImpl.java index 7634e93f..541d44f1 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/warningConfig/service/impl/SysWarningConfigServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/warningConfig/service/impl/SysWarningConfigServiceImpl.java @@ -1,11 +1,22 @@ package com.hzya.frame.sysnew.warningConfig.service.impl; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import com.hzya.frame.sysnew.application.dao.ISysApplicationDao; +import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; +import com.hzya.frame.sysnew.messageTemplate.dao.ISysMessageTemplateDao; +import com.hzya.frame.sysnew.messageTemplate.entity.SysMessageTemplateEntity; +import com.hzya.frame.sysnew.person.dao.ISysPersonDao; +import com.hzya.frame.sysnew.person.entity.SysPersonEntity; +import com.hzya.frame.sysnew.user.dao.ISysUserDao; +import com.hzya.frame.sysnew.user.entity.SysUserEntity; import com.hzya.frame.sysnew.warningConfig.entity.SysWarningConfigEntity; import com.hzya.frame.sysnew.warningConfig.dao.ISysWarningConfigDao; import com.hzya.frame.sysnew.warningConfig.service.ISysWarningConfigService; +import com.hzya.frame.sysnew.warningInterface.dao.ISysWarningInterfaceDao; +import com.hzya.frame.sysnew.warningInterface.entity.SysWarningInterfaceEntity; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import org.springframework.stereotype.Service; @@ -13,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired; import javax.annotation.Resource; import com.hzya.frame.basedao.service.impl.BaseService; +import java.util.ArrayList; import java.util.List; /** @@ -23,7 +35,20 @@ import java.util.List; */ @Service(value = "sysWarningConfigService") public class SysWarningConfigServiceImpl extends BaseService implements ISysWarningConfigService { - + + @Resource + private ISysWarningInterfaceDao sysWarningInterfaceDao; + @Resource + private ISysUserDao sysUserDao; + @Resource + private ISysPersonDao sysPersonDao; + + @Resource + private ISysApplicationDao sysApplicationDao; + + @Resource + private ISysMessageTemplateDao sysMessageTemplateDao; + private ISysWarningConfigDao sysWarningConfigDao; @Autowired @@ -40,7 +65,9 @@ public class SysWarningConfigServiceImpl extends BaseService list = sysWarningConfigDao.queryByLike(entity); - PageInfo pageInfo = new PageInfo(list); + //查询并记录应用名称、预警应用名称、接收者名称列表 + List resultList = queryNameList(list); + PageInfo pageInfo = new PageInfo(resultList); return BaseResult.getSuccessMessageEntity("查询数据成功",pageInfo); } @@ -51,8 +78,11 @@ public class SysWarningConfigServiceImpl extends BaseService list = sysWarningConfigDao.queryByLike(entity); - return BaseResult.getSuccessMessageEntity("查询数据成功",list); + //查询并记录应用名称、预警应用名称、接收者名称列表 + List resultList = queryNameList(list); + return BaseResult.getSuccessMessageEntity("查询数据成功",resultList); } + /**查询应用名称、预警应用名称、接收者名称列表*/ @Override public JsonResultEntity getEntity(JSONObject jsonObject){ @@ -63,23 +93,51 @@ public class SysWarningConfigServiceImpl extends BaseService list = new ArrayList<>(); + list.add(entity); + //查询并记录应用名称、预警应用名称、接收者名称列表 + List resultList = queryNameList(list); + String warningConfigId = resultList.get(0).getId(); + //查询子表信息 + SysWarningInterfaceEntity interfaceEntity = new SysWarningInterfaceEntity(); + interfaceEntity.setWarningConfigId(warningConfigId); + List interfaceList = sysWarningInterfaceDao.queryByLike(interfaceEntity); + //拼接主子表信息并返回 + JSONObject father = (JSONObject) JSONObject.toJSON(resultList.get(0)); + JSONArray sonArray = new JSONArray(); + for(SysWarningInterfaceEntity interfaceOne : interfaceList){ + JSONObject interfaceJson = (JSONObject) JSONObject.toJSON(interfaceOne); + sonArray.add(interfaceJson); + } + JSONObject resultJson = new JSONObject(); + resultJson.put("father", father); + resultJson.put("son", sonArray); + return BaseResult.getSuccessMessageEntity("获取预警配置成功",resultJson); } @Override public JsonResultEntity saveEntity(JSONObject jsonObject){ - SysWarningConfigEntity entity = getData("jsonStr", jsonObject, SysWarningConfigEntity.class); + JSONObject jsonStr = jsonObject.getJSONObject("jsonStr"); + JSONArray sonArray = jsonStr.getJSONArray("son"); + List interfaceEntities = new ArrayList<>(); + for(int i=0;i interfaceEntities = new ArrayList<>(); + for(int i=0;i oldInterfaceList = sysWarningInterfaceDao.queryBase(oldInterfaceEntity); + //更新子表数据 + for(SysWarningInterfaceEntity interfaceEntity : interfaceEntities){ + interfaceEntity.setWarningConfigId(warningConfigId); + if(interfaceEntity.getApiCode() == null || "".equals(interfaceEntity.getApiCode())){ + return BaseResult.getFailureMessageEntity("接口编码不能为空"); + } + if(interfaceEntity.getPushMethod() == null || "".equals(interfaceEntity.getPushMethod())){ + return BaseResult.getFailureMessageEntity("推送方式不能为空"); + } + if(interfaceEntity.getStatus() == null || "".equals(interfaceEntity.getStatus())){ + return BaseResult.getFailureMessageEntity("状态不能为空"); + } + if(interfaceEntity.getWarningConfigId() == null || "".equals(interfaceEntity.getWarningConfigId())){ + return BaseResult.getFailureMessageEntity("预警配置id不能为空"); + } + if(interfaceEntity.getId() == null || "".equals(interfaceEntity.getId())){ + //新增 + interfaceEntity.setCreate(); + sysWarningInterfaceDao.save(interfaceEntity); + }else{ + //修改 + interfaceEntity.setUpdate(); + interfaceEntity.setSts("Y"); + sysWarningInterfaceDao.update(interfaceEntity); + } + } + //删除多余的子表数据 + boolean isDelete = true; + for(SysWarningInterfaceEntity oldInterface : oldInterfaceList){ + isDelete = true; + for(SysWarningInterfaceEntity interfaceEntity : interfaceEntities){ + if(oldInterface.getId().equals(interfaceEntity.getId())){ + isDelete = false; + break; + } + } + if(isDelete){ + sysWarningInterfaceDao.logicRemove(oldInterface); + } + + } + return BaseResult.getSuccessMessageEntity("修改预警配置成功",entity); } + /** + * 删除主表时,同时删除子表数据*/ @Override public JsonResultEntity deleteEntity(JSONObject jsonObject) { SysWarningConfigEntity entity = getData("jsonStr", jsonObject, SysWarningConfigEntity.class); @@ -134,8 +278,14 @@ public class SysWarningConfigServiceImpl extends BaseService queryNameList(List list){ + for(SysWarningConfigEntity configEntity : list){ + //拼接应用名称列表 + String appIds = configEntity.getAppIdList(); + String[] appIdList = appIds.split(","); + String appNameList = ""; + for(String appId : appIdList){ + SysApplicationEntity appEntity = sysApplicationDao.get(appId); + String appName = appEntity.getName(); + if(!"".equals(appNameList)){ + appNameList += ","; + } + appNameList += appName; + } + configEntity.setAppNameList(appNameList); + //拼接预警应用名称列表 + String warningAppIds = configEntity.getWarningAppId(); + String[] warningAppIdList = warningAppIds.split(","); + String warningAppNameList = ""; + for(String warningAppId : warningAppIdList){ + SysApplicationEntity warningAppEntity = sysApplicationDao.get(warningAppId); + String warningAppName = warningAppEntity.getName(); + if(!"".equals(warningAppNameList)){ + warningAppNameList += ","; + } + warningAppNameList += warningAppName; + } + configEntity.setWarningAppNameList(warningAppNameList); + //拼接接收者名称列表 + String recipientIds = configEntity.getRecipientIdList(); + String[] recipientIdList = recipientIds.split(","); + String recipientNameList = ""; + for(String recipientId : recipientIdList){ +// SysUserEntity userEntity = sysUserDao.get(recipientId); +// String personId = userEntity.getPersonId(); + SysPersonEntity personEntity = sysPersonDao.get(recipientId); + String recipientName = personEntity.getPersonName(); + if(!"".equals(recipientNameList)){ + recipientNameList += ","; + } + recipientNameList += recipientName; + } + configEntity.setRecipientNameList(recipientNameList); + + } + return list; + } + } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/warningInterface/dao/ISysWarningInterfaceDao.java b/base-service/src/main/java/com/hzya/frame/sysnew/warningInterface/dao/ISysWarningInterfaceDao.java index 544241f6..61a64efa 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/warningInterface/dao/ISysWarningInterfaceDao.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/warningInterface/dao/ISysWarningInterfaceDao.java @@ -1,7 +1,9 @@ package com.hzya.frame.sysnew.warningInterface.dao; import com.hzya.frame.sysnew.warningInterface.entity.SysWarningInterfaceEntity; -import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.basedao.dao.IBaseDao; + +import java.util.List; /** * 预警接口表(sys_warning_interface: table)表数据库访问层 @@ -11,5 +13,6 @@ import com.hzya.frame.basedao.dao.IBaseDao; */ public interface ISysWarningInterfaceDao extends IBaseDao { + List getWarningAppList(); } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/warningInterface/dao/impl/SysWarningInterfaceDaoImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/warningInterface/dao/impl/SysWarningInterfaceDaoImpl.java index 655eb183..fdcbb1f2 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/warningInterface/dao/impl/SysWarningInterfaceDaoImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/warningInterface/dao/impl/SysWarningInterfaceDaoImpl.java @@ -4,6 +4,9 @@ import com.hzya.frame.sysnew.warningInterface.entity.SysWarningInterfaceEntity; import com.hzya.frame.sysnew.warningInterface.dao.ISysWarningInterfaceDao; import org.springframework.stereotype.Repository; import com.hzya.frame.basedao.dao.MybatisGenericDao; + +import java.util.List; + /** * 预警接口表(SysWarningInterface)表数据库访问层 * @@ -12,6 +15,10 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao; */ @Repository(value = "SysWarningInterfaceDaoImpl") public class SysWarningInterfaceDaoImpl extends MybatisGenericDao implements ISysWarningInterfaceDao{ - + @Override + public List getWarningAppList(){ + List tempList = (List)super.selectList(getSqlIdPrifx() + "warning_app_list", null); + return tempList; + } } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.java b/base-service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.java index fa2181c9..c9abb5c7 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.java @@ -9,7 +9,11 @@ import com.hzya.frame.web.entity.BaseEntity; * @since 2024-09-03 10:06:19 */ public class SysWarningInterfaceEntity extends BaseEntity { - + + /** 应用id */ + private String appId; + /** 应用名称 */ + private String appName; /** 公司id */ private String companyId; /** api名称 */ @@ -23,6 +27,21 @@ public class SysWarningInterfaceEntity extends BaseEntity { /** 主表id(预警配置表id) */ private String warningConfigId; + public String getAppName() { + return appName; + } + + public void setAppName(String appName) { + this.appName = appName; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } public String getCompanyId() { return companyId; diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.xml b/base-service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.xml index 663e7cd1..f43f9f82 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.xml @@ -17,7 +17,10 @@ + + + id @@ -33,7 +36,8 @@ ,api_code ,push_method ,status - ,warning_config_id + ,warning_config_id + ,app_id + + @@ -155,6 +180,7 @@ push_method , status , warning_config_id , + app_id , sts, )values( @@ -173,6 +199,7 @@ #{pushMethod} , #{status} , #{warningConfigId} , + #{appId} , 'Y', ) diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/warningInterface/service/ISysWarningInterfaceService.java b/base-service/src/main/java/com/hzya/frame/sysnew/warningInterface/service/ISysWarningInterfaceService.java index 09f2ff30..b8514bc7 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/warningInterface/service/ISysWarningInterfaceService.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/warningInterface/service/ISysWarningInterfaceService.java @@ -17,6 +17,8 @@ public interface ISysWarningInterfaceService extends IBaseService implements ISysWarningInterfaceService { private ISysWarningInterfaceDao sysWarningInterfaceDao; - + + @Resource + private ISysApplicationDao sysApplicationDao; + + @Resource + private ISysSendMessageLogDao sysSendMessageLogDao; + + @Autowired public void setSysWarningInterfaceDao(ISysWarningInterfaceDao dao) { this.sysWarningInterfaceDao = dao; @@ -75,10 +89,7 @@ public class SysWarningInterfaceServiceImpl extends BaseService appIdList = sysWarningInterfaceDao.getWarningAppList(); + List appList = new ArrayList<>(); + for (SysWarningInterfaceEntity entity : appIdList) { + if (entity == null) { + continue; + } + String appId = entity.getAppId(); + SysApplicationEntity app = sysApplicationDao.get(appId); + if (app == null) { + continue; + } + SysSendMessageLogEntity logEntity = new SysSendMessageLogEntity(); + logEntity.setAppId(appId); + logEntity.setState(0); + List list = sysSendMessageLogDao.queryByLike(logEntity); + app.setNewMessageCount(list.size()); + if (app != null) { + appList.add(app); + } + } + return BaseResult.getSuccessMessageEntity("查询预警应用列表成功",appList); + } + } From 61b0cdfaeecd4c9a3ca5555135c235f07ee12994 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Fri, 20 Sep 2024 09:54:27 +0800 Subject: [PATCH 08/67] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=9F=A5=E7=9C=8B=E6=95=B0=E6=8D=AE=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/dingtalk/enums/OrgEventEnum.java | 48 +++++ .../dingtalk/service/IDingTalkExtService.java | 32 +++ .../dingtalk/service/IDingTalkService.java | 66 ++++++ .../service/impl/DingTalkExtServiceImpl.java | 100 +++++++++ .../service/impl/DingTalkServiceImpl.java | 164 +++++++++++++++ .../dingtalk/util/DingTalkAccessToken.java | 103 ++++++++++ .../home/service/impl/HomeServiceImpl.java | 1 + .../frame/mdm/entity/MdmFiledsRuleDto.java | 77 +++++++ .../mdm/mdmModule/dao/IMdmModuleDao.java | 3 + .../mdmModule/dao/impl/MdmModuleDaoImpl.java | 7 + .../mdm/mdmModule/entity/MdmModuleEntity.xml | 9 + .../service/impl/MdmModuleServiceImpl.java | 15 +- .../hzya/frame/mdm/service/IMdmService.java | 9 + .../mdm/service/impl/MdmServiceImpl.java | 193 ++++++++++++++++-- .../service/ISysApplicationService.java | 5 + .../impl/SysApplicationServiceImpl.java | 36 ++++ .../sysnew/login/impl/LoginServiceImpl.java | 30 ++- .../entity/SysMessageManageLogEntity.java | 12 +- .../impl/SysMessageManageLogServiceImpl.java | 13 +- .../sysnew/user/entity/SysUserEntity.xml | 2 + .../controler/EntranceController.java | 1 - 21 files changed, 899 insertions(+), 27 deletions(-) create mode 100755 base-service/src/main/java/com/hzya/frame/dingtalk/enums/OrgEventEnum.java create mode 100755 base-service/src/main/java/com/hzya/frame/dingtalk/service/IDingTalkExtService.java create mode 100755 base-service/src/main/java/com/hzya/frame/dingtalk/service/IDingTalkService.java create mode 100755 base-service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkExtServiceImpl.java create mode 100755 base-service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkServiceImpl.java create mode 100755 base-service/src/main/java/com/hzya/frame/dingtalk/util/DingTalkAccessToken.java create mode 100644 base-service/src/main/java/com/hzya/frame/mdm/entity/MdmFiledsRuleDto.java diff --git a/base-service/src/main/java/com/hzya/frame/dingtalk/enums/OrgEventEnum.java b/base-service/src/main/java/com/hzya/frame/dingtalk/enums/OrgEventEnum.java new file mode 100755 index 00000000..f01431f0 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/dingtalk/enums/OrgEventEnum.java @@ -0,0 +1,48 @@ +package com.hzya.frame.dingtalk.enums; + +/** + * @Description 通讯录事件类型 + * @Author xiangerlin + * @Date 2024/8/27 15:58 + **/ +public enum OrgEventEnum { + USER_ADD_ORG("user_add_org","通讯录用户新增"), + USER_MODIFY_ORG("user_modify_org","通讯录用户更改"), + USER_LEAVE_ORG("user_leave_org","通讯录用户离职"), + USER_ACTIVE_ORG("user_active_org","加入企业后用户激活"), + ORG_DEPT_CREATE("org_dept_create","通讯录企业部门创建"), + ORG_DEPT_MODIFY("org_dept_modify","通讯录企业部门更改"), + ORG_DEPT_REMOVE("org_dept_remove","通讯录企业部门删除"), + ; + + + private String code; + private String explain; + + OrgEventEnum(String code, String explain) { + this.code = code; + this.explain = explain; + } + + public String getCode() { + return code; + } + + public String getExplain() { + return explain; + } + + /** + * 根据code获取事件类型 + * @param code + * @return + */ + public static OrgEventEnum getByCode(String code){ + for (OrgEventEnum org : OrgEventEnum.values()) { + if (org.getCode().equals(code)){ + return org; + } + } + return null; + } +} diff --git a/base-service/src/main/java/com/hzya/frame/dingtalk/service/IDingTalkExtService.java b/base-service/src/main/java/com/hzya/frame/dingtalk/service/IDingTalkExtService.java new file mode 100755 index 00000000..ffbba432 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/dingtalk/service/IDingTalkExtService.java @@ -0,0 +1,32 @@ +package com.hzya.frame.dingtalk.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; + +/** + * @Description 钉钉集成扩展类 + * @Author xiangerlin + * @Date 2024/8/28 14:25 + **/ +public interface IDingTalkExtService { + + /** + * 调用这个方法初始化钉钉参数 + * @param entity + * @return + */ + SysExtensionApiEntity init(SysExtensionApiEntity entity); + + /** + * 查询配置在应用上的钉钉参数 + * @param sysApplication + * @return + */ + JSONObject getDingTalkConfig(SysApplicationEntity sysApplication); + + /** + * 清空配置缓存 + */ + void clearDingTalkConfigCatch(); +} diff --git a/base-service/src/main/java/com/hzya/frame/dingtalk/service/IDingTalkService.java b/base-service/src/main/java/com/hzya/frame/dingtalk/service/IDingTalkService.java new file mode 100755 index 00000000..be742955 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/dingtalk/service/IDingTalkService.java @@ -0,0 +1,66 @@ +package com.hzya.frame.dingtalk.service; + +import com.dingtalk.api.request.OapiV2UserListRequest; +import com.dingtalk.api.response.OapiV2DepartmentGetResponse; +import com.dingtalk.api.response.OapiV2DepartmentListsubResponse; +import com.dingtalk.api.response.OapiV2UserGetResponse; +import com.dingtalk.api.response.OapiV2UserListResponse; + +import java.util.List; + +/** + * @Description 钉钉service + * @Author xiangerlin + * @Date 2024/8/27 16:17 + **/ +public interface IDingTalkService { + + /** + * 根据userid获取用户详情 + * @param userId 钉钉userid + * @param appKey + * @param appSecret + * @return + */ + OapiV2UserGetResponse.UserGetResponse getUserById(String userId, String appKey, String appSecret); + + /** + * 根据userid获取用户详情 + * @param userId + * @return + */ + OapiV2UserGetResponse.UserGetResponse getUserById(String userId); + + /** + * 获取部门用户列表 + * @param req 请求参数 + * @param appKey + * @param appSecret + * @return + */ + OapiV2UserListResponse.PageResult getUserListByDeptId(OapiV2UserListRequest req, String appKey, String appSecret); + /** + * 根据部门id获取部门详情 + * @param deptId 钉钉部门id + * @param appKey + * @param appSecret + * @return + */ + OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId, String appKey, String appSecret); + + /** + * 根据部门id获取部门详情 + * @param deptId + * @return + */ + OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId); + + /** + * 获取部门列表,此接口只会返回下一级部门信息 + * @param deptId 部门id,如果不传则查询一级部门 + * @param appKey + * @param appSecret + * @return + */ + List getDeptList(Long deptId, String appKey, String appSecret); +} diff --git a/base-service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkExtServiceImpl.java b/base-service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkExtServiceImpl.java new file mode 100755 index 00000000..dd0267f8 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkExtServiceImpl.java @@ -0,0 +1,100 @@ +package com.hzya.frame.dingtalk.service.impl; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.dingtalk.service.IDingTalkExtService; +import com.hzya.frame.dingtalk.util.DingTalkAccessToken; +import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity; +import com.hzya.frame.sysnew.application.apiPara.dao.ISysApplicationApiParaDao; +import com.hzya.frame.sysnew.application.apiPara.entity.SysApplicationApiParaEntity; +import com.hzya.frame.sysnew.application.apiPara.service.ISysApplicationApiParaService; +import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import org.apache.commons.collections.CollectionUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * @Description 钉钉集成扩展类 + * @Author xiangerlin + * @Date 2024/8/28 14:25 + **/ +@Service(value = "dingTalkExtService") +public class DingTalkExtServiceImpl implements IDingTalkExtService { + + + @Resource + private ISysApplicationApiParaDao sysApplicationApiParaDao; + private final ConcurrentHashMap dingTalkMap = new ConcurrentHashMap<>(); + /** + * 调用这个方法初始化钉钉参数 + * + * @param entity + * @return + */ + @Override + public SysExtensionApiEntity init(SysExtensionApiEntity entity) { + Map headers = entity.getHeaders(); + if (null == headers){ + headers = new HashMap<>(); + } + SysApplicationEntity receiveApp = entity.getReceiveApp(); + //查询应用上配置的参数 + JSONObject dingTalkConfig = getDingTalkConfig(receiveApp); + //给token赋值 + entity.setQuerys("access_token="+DingTalkAccessToken.getAccessToken(dingTalkConfig.getString("appKey"),dingTalkConfig.getString("appSecret"))); + return entity; + } + + /** + * 查询配置在应用上的钉钉参数 + * + * @param sysApplication + * @return + */ + @Override + public JSONObject getDingTalkConfig(SysApplicationEntity sysApplication) { + if (null != sysApplication && StrUtil.isNotEmpty(sysApplication.getId()) && null != sysApplication.getAppId()){ + JSONObject jsonObject = new JSONObject(); + String key = sysApplication.getAppId()+"dingTalk"; + if (null != dingTalkMap.get(key)){ + return dingTalkMap.get(key); + }else { + //查询应用上配置的参数 + SysApplicationApiParaEntity paraEntity = new SysApplicationApiParaEntity(); + paraEntity.setAppId(sysApplication.getId()); + List paraList = sysApplicationApiParaDao.query(paraEntity); + if (CollectionUtils.isNotEmpty(paraList)) { + List appKeyList = paraList.stream().filter(p -> p.getInterfaceKey().equals("appKey")).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(appKeyList)) { + jsonObject.put("appKey", appKeyList.get(0).getInterfaceValue()); + } + List appSecretList = paraList.stream().filter(p -> p.getInterfaceKey().equals("appSecret")).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(appSecretList)) { + jsonObject.put("appSecret", appSecretList.get(0).getInterfaceValue()); + } + dingTalkMap.put(key,jsonObject); + return dingTalkMap.get(key); + } + } + } + return null; + } + + /** + * 清空配置缓存 + */ + @Override + public void clearDingTalkConfigCatch() { + dingTalkMap.clear(); + } +} diff --git a/base-service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkServiceImpl.java b/base-service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkServiceImpl.java new file mode 100755 index 00000000..8e74ae9d --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkServiceImpl.java @@ -0,0 +1,164 @@ +package com.hzya.frame.dingtalk.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.dingtalk.api.DefaultDingTalkClient; +import com.dingtalk.api.DingTalkClient; +import com.dingtalk.api.request.OapiV2DepartmentGetRequest; +import com.dingtalk.api.request.OapiV2DepartmentListsubRequest; +import com.dingtalk.api.request.OapiV2UserGetRequest; +import com.dingtalk.api.request.OapiV2UserListRequest; +import com.dingtalk.api.response.OapiV2DepartmentGetResponse; +import com.dingtalk.api.response.OapiV2DepartmentListsubResponse; +import com.dingtalk.api.response.OapiV2UserGetResponse; +import com.dingtalk.api.response.OapiV2UserListResponse; +import com.hzya.frame.dingtalk.service.IDingTalkService; +import com.hzya.frame.dingtalk.util.DingTalkAccessToken; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description 钉钉service + * @Author xiangerlin + * @Date 2024/8/27 16:17 + **/ +@Service(value = "dingTalkService") +public class DingTalkServiceImpl implements IDingTalkService { + Logger logger = LoggerFactory.getLogger(getClass()); + @Value("${dingtalk.appKey:}") + private String dAppKey; + @Value("${dingtalk.appSecret:}") + private String dAppSecret; + + + /** + * 根据userid获取用户详情 + * + * @param userId 钉钉userid + * @param appKey + * @param appSecret + * @return + */ + @Override + public OapiV2UserGetResponse.UserGetResponse getUserById(String userId, String appKey, String appSecret) { + DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/get"); + OapiV2UserGetRequest req = new OapiV2UserGetRequest(); + req.setUserid(userId); + req.setLanguage("zh_CN"); + try { + OapiV2UserGetResponse rsp = client.execute(req, DingTalkAccessToken.getAccessToken(appKey,appSecret)); + if (rsp.isSuccess()){ + OapiV2UserGetResponse.UserGetResponse result = rsp.getResult(); + String s = JSONObject.toJSONString(result); + logger.info("人员详情信息:{}",s); + return result; + } + }catch (Exception e){ + logger.error("根据部门id获取钉钉用户详情出错:{}",e); + } + return null; + } + + /** + * 根据userid获取用户详情 + * + * @param userId + * @return + */ + @Override + public OapiV2UserGetResponse.UserGetResponse getUserById(String userId) { + return getUserById(userId,dAppKey,dAppSecret); + } + + /** + * 获取部门用户列表 + * + * @param req 请求参数 + * @param appKey + * @param appSecret + * @return + */ + @Override + public OapiV2UserListResponse.PageResult getUserListByDeptId(OapiV2UserListRequest req, String appKey, String appSecret) { + try { + DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/list"); + req.setSize(100L);//每页最大只能查100条 + req.setOrderField("modify_desc"); + req.setContainAccessLimit(false); + req.setLanguage("zh_CN"); + OapiV2UserListResponse rsp = client.execute(req, DingTalkAccessToken.getAccessToken(appKey,appSecret)); + OapiV2UserListResponse.PageResult result = rsp.getResult(); + return result; + }catch (Exception e){ + e.printStackTrace(); + } + return null; + } + + /** + * 根据部门id获取部门详情 + * + * @param deptId 钉钉部门id + * @param appKey + * @param appSecret + * @return + */ + @Override + public OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId, String appKey, String appSecret) { + DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/department/get"); + OapiV2DepartmentGetRequest req = new OapiV2DepartmentGetRequest(); + req.setDeptId(deptId); + req.setLanguage("zh_CN"); + try { + OapiV2DepartmentGetResponse rsp = client.execute(req, DingTalkAccessToken.getAccessToken(appKey,appSecret)); + if (rsp.isSuccess()){ + OapiV2DepartmentGetResponse.DeptGetResponse result = rsp.getResult(); + String s = JSONObject.toJSONString(result); + logger.info("部门详情信息:{}",s); + return result; + } + }catch(Exception e){ + logger.error("根据部门id获取钉钉部门出错:{}",e); + } + return null; + } + + /** + * 根据部门id获取部门详情 + * + * @param deptId + * @return + */ + @Override + public OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId) { + return getDeptById(deptId,dAppKey,dAppSecret); + } + + /** + * 获取部门列表,此接口只会返回下一级部门信息 + * @param deptId 部门id,如果不传则查询一级部门 + * @param appKey + * @param appSecret + * @return + */ + @Override + public List getDeptList(Long deptId,String appKey,String appSecret) { + try { + DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/department/listsub"); + OapiV2DepartmentListsubRequest req = new OapiV2DepartmentListsubRequest(); + req.setDeptId(deptId); + req.setLanguage("zh_CN"); + OapiV2DepartmentListsubResponse rsp = client.execute(req, DingTalkAccessToken.getAccessToken(appKey,appSecret)); + if (rsp.isSuccess()){ + List result = rsp.getResult(); + return result; + } + }catch (Exception e){ + logger.error("获取部门列表接口出错:{}",e); + } + return null; + } +} diff --git a/base-service/src/main/java/com/hzya/frame/dingtalk/util/DingTalkAccessToken.java b/base-service/src/main/java/com/hzya/frame/dingtalk/util/DingTalkAccessToken.java new file mode 100755 index 00000000..eb951180 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/dingtalk/util/DingTalkAccessToken.java @@ -0,0 +1,103 @@ +package com.hzya.frame.dingtalk.util; + +import cn.hutool.core.util.StrUtil; +import com.aliyun.dingtalkoauth2_1_0.models.GetAccessTokenResponse; +import com.aliyun.tea.TeaException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; + +import java.time.Instant; + +/** + * @Description 钉钉获取accessToken + * @Author xiangerlin + * @Date 2024/8/27 14:05 + **/ +public class DingTalkAccessToken { + static Logger logger = LoggerFactory.getLogger(DingTalkAccessToken.class); + //token + private static String accessToken; + //过期时间 + private static Instant expireTime; + private static final Long CACHE_EXPIRY_TIME = 7000L; // 缓存有效时间(秒) + //应用key + private static String appKey; + //应用密钥 + private static String appSecret; + @Value("${dingtalk.appKey:}") + public static void setAppKey(String appKey) { + DingTalkAccessToken.appKey = appKey; + } + @Value("${dingtalk.appSecret:}") + public static void setAppSecret(String appSecret) { + DingTalkAccessToken.appSecret = appSecret; + } + + /** + * 获取token + * @return + */ + public static String getAccessToken(){ + return getAccessToken(appKey,appSecret); + } + /** + * 获取accessToken + * + * @param appKey + * @param appSecret + * @return + */ + public static String getAccessToken(String appKey,String appSecret) { + //判断是否过期 如果没过期直接返回 + if (null != accessToken && expireTime != null && Instant.now().isBefore(expireTime)) { + return accessToken; + } + //获取新的accessToken + accessToken = fetchNewAccessToken(appKey,appSecret); + //过期时间设置成当前事件+7000s,预留200s的时间 + expireTime = Instant.now().plusSeconds(CACHE_EXPIRY_TIME); + return accessToken; + } + + /** + * 获取新的accessToken + * + * @return + */ + private static String fetchNewAccessToken(String appKey,String appSecret) { + try { + //查询应用上配置的钉钉信息 + if (StrUtil.isNotEmpty(appKey) && StrUtil.isNotEmpty(appSecret)) { + //查询应用上的信息 + com.aliyun.dingtalkoauth2_1_0.Client client = DingTalkAccessToken.createClient(); + com.aliyun.dingtalkoauth2_1_0.models.GetAccessTokenRequest getAccessTokenRequest = new com.aliyun.dingtalkoauth2_1_0.models.GetAccessTokenRequest() + .setAppKey(appKey) + .setAppSecret(appSecret); + GetAccessTokenResponse accessToken = client.getAccessToken(getAccessTokenRequest); + String accessToken1 = accessToken.getBody().getAccessToken(); + return accessToken1; + } + } catch (Exception _err) { + TeaException err = new TeaException(_err.getMessage(), _err); + if (!com.aliyun.teautil.Common.empty(err.code) && !com.aliyun.teautil.Common.empty(err.message)) { + // err 中含有 code 和 message 属性,可帮助开发定位问题 + } + logger.error("获取钉钉token出错:{}", _err); + } + return null; + } + + /** + * 使用 Token 初始化账号Client + * + * @return Client + * @throws Exception + */ + private static com.aliyun.dingtalkoauth2_1_0.Client createClient() throws Exception { + com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config(); + config.protocol = "https"; + config.regionId = "central"; + return new com.aliyun.dingtalkoauth2_1_0.Client(config); + } +} diff --git a/base-service/src/main/java/com/hzya/frame/home/service/impl/HomeServiceImpl.java b/base-service/src/main/java/com/hzya/frame/home/service/impl/HomeServiceImpl.java index 6ee65aa3..cda6cf9c 100644 --- a/base-service/src/main/java/com/hzya/frame/home/service/impl/HomeServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/home/service/impl/HomeServiceImpl.java @@ -50,6 +50,7 @@ public class HomeServiceImpl extends BaseService implements for (int a = 0; a < sysApplicationEntities.size(); a++) { if(homeEntities.get(i).getAppId()!= null && sysApplicationEntities.get(a).getId().equals(homeEntities.get(i).getAppId())){ homeEntities.get(i).setPath(sysApplicationEntities.get(a).getAppLogo()); + homeEntities.get(i).setName(sysApplicationEntities.get(a).getName()); continue; } } diff --git a/base-service/src/main/java/com/hzya/frame/mdm/entity/MdmFiledsRuleDto.java b/base-service/src/main/java/com/hzya/frame/mdm/entity/MdmFiledsRuleDto.java new file mode 100644 index 00000000..f6bd998b --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/mdm/entity/MdmFiledsRuleDto.java @@ -0,0 +1,77 @@ +package com.hzya.frame.mdm.entity; + + +public class MdmFiledsRuleDto { + /** 主数据模版ID */ + private String mdmId; + /** 模版数据库id */ + private String dbId; + /** 模版数据库字段id */ + private String filedId; + /** 字段类型 1、select 2、treeselect */ + private String filedType; + /** 字段服务 */ + private String typeFiled; + /** 字段服务 */ + private String id; + /** 字段服务 */ + private String dataId; + + public String getMdmId() { + return mdmId; + } + + public void setMdmId(String mdmId) { + this.mdmId = mdmId; + } + + public String getDbId() { + return dbId; + } + + public void setDbId(String dbId) { + this.dbId = dbId; + } + + public String getFiledId() { + return filedId; + } + + public void setFiledId(String filedId) { + this.filedId = filedId; + } + + public String getFiledType() { + return filedType; + } + + public void setFiledType(String filedType) { + this.filedType = filedType; + } + + public String getTypeFiled() { + return typeFiled; + } + + public void setTypeFiled(String typeFiled) { + this.typeFiled = typeFiled; + } + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getDataId() { + return dataId; + } + + public void setDataId(String dataId) { + this.dataId = dataId; + } +} + diff --git a/base-service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java b/base-service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java index 1940d472..7c936af7 100644 --- a/base-service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java +++ b/base-service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/IMdmModuleDao.java @@ -3,6 +3,7 @@ package com.hzya.frame.mdm.mdmModule.dao; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.mdm.entity.MdmDataDto; import com.hzya.frame.mdm.entity.MdmDto; +import com.hzya.frame.mdm.entity.MdmFiledsRuleDto; import com.hzya.frame.mdm.entity.MdmQuery; import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; import com.hzya.frame.basedao.dao.IBaseDao; @@ -68,5 +69,7 @@ public interface IMdmModuleDao extends IBaseDao { void updataTreeUpData(Map updateMaps); void updataTreeUpDataDetail(Map updateMaps); + + MdmFiledsRuleDto queryDataId(MdmFiledsRuleDto mdmFiledsRuleDto); } diff --git a/base-service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java b/base-service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java index c9d4ea70..56e4777e 100644 --- a/base-service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java +++ b/base-service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; import com.hzya.frame.basedao.dao.MybatisGenericDao; import com.hzya.frame.mdm.entity.MdmDataDto; import com.hzya.frame.mdm.entity.MdmDto; +import com.hzya.frame.mdm.entity.MdmFiledsRuleDto; import com.hzya.frame.mdm.entity.MdmQuery; import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao; import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; @@ -181,6 +182,12 @@ public class MdmModuleDaoImpl extends MybatisGenericDao super.update(getSqlIdPrifx() + "updataTreeUpDataDetail", maps); } + @Override + public MdmFiledsRuleDto queryDataId(MdmFiledsRuleDto mdmFiledsRuleDto) { + MdmFiledsRuleDto o = (MdmFiledsRuleDto) super.selectOne(getSqlIdPrifx() + "queryDataId", mdmFiledsRuleDto); + return o; + } + @Override public List queryMdMFields(Map maps) { List o = (List) super.selectList(getSqlIdPrifx() + "queryMdMFields", maps); diff --git a/base-service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml b/base-service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml index 629067a8..8403c031 100644 --- a/base-service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml @@ -1086,5 +1086,14 @@ where id = #{id} AND b.sts = 'Y' AND b.data_status != 'N' + + + + diff --git a/base-service/src/main/java/com/hzya/frame/mdm/mdmModule/service/impl/MdmModuleServiceImpl.java b/base-service/src/main/java/com/hzya/frame/mdm/mdmModule/service/impl/MdmModuleServiceImpl.java index 7169f57f..c32080d1 100644 --- a/base-service/src/main/java/com/hzya/frame/mdm/mdmModule/service/impl/MdmModuleServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/mdm/mdmModule/service/impl/MdmModuleServiceImpl.java @@ -2340,7 +2340,20 @@ public class MdmModuleServiceImpl extends BaseService i xf.setCreate(); sysButtonConfigDao.save(xf); } - + if ("viewData".equals(mdmModuleViewButtonEntities.get(i).getButtonValue())) { + SysButtonConfigEntity xf = new SysButtonConfigEntity(); + xf.setCode("viewData"); + xf.setNameCh("查看数据格式"); + xf.setNameEn("viewData"); + xf.setMenuId(module.getId()); + xf.setIconName(""); + xf.setStyles(""); + xf.setBtnFunction("viewData"); + xf.setRemark("查看数据格式"); + xf.setSorts(i + 1L); + xf.setCreate(); + sysButtonConfigDao.save(xf); + } } } diff --git a/base-service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java b/base-service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java index fff31302..70de4325 100644 --- a/base-service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java +++ b/base-service/src/main/java/com/hzya/frame/mdm/service/IMdmService.java @@ -87,6 +87,15 @@ public interface IMdmService { * @Date 9:40 上午 2023/10/18 **/ JsonResultEntity queryMdmShowDetailsData(JSONObject jsonObject); + + /** + * @param jsonObject + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据字典 + * @Date 9:40 上午 2023/10/18 + **/ + JsonResultEntity queryMdmShowDetailsDictionary(JSONObject jsonObject); // /** * @param jsonObject diff --git a/base-service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java b/base-service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java index fcb46154..b5d7e716 100644 --- a/base-service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java @@ -101,12 +101,6 @@ public class MdmServiceImpl implements IMdmService { @Resource private IMdmServiceCache mdmServiceCache; @Resource - private ISysMenuConfigDao sysMenuConfigDao; - @Resource - private ISysButtonConfigDao sysButtonConfigDao; - @Resource - private ISysPopedomOperateDao sysPopedomOperateDao; - @Resource private IMdmModuleDbDao mdmModuleDbDao; @Resource private ISysUserDao sysUserDao; @@ -1381,15 +1375,188 @@ public class MdmServiceImpl implements IMdmService { } } - //if (tablename != null && !"".equals(tablename)) { - // Map queryData = new HashMap<>(); - // queryData.put("tableName", tablename);//表名 - // queryData.put("id", entity.getId());//字段 - // List> datas = mdmModuleDbDao.getServiceByDistributeId(queryData); - // jsonObject.put(tablename, datas); - //} + + return BaseResult.getSuccessMessageEntity("获取数据成功", jsonObject); + } + + + /** + * @param object + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 主数据详情数据字典 + * @Date 9:40 上午 2023/10/18 + **/ + @Override + public JsonResultEntity queryMdmShowDetailsDictionary(JSONObject object) { + MdmDto entity = getData("jsonStr", object, MdmDto.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getMdmCode() == null || "".equals(entity.getMdmCode())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询模版 + + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode()); + if (mdmModuleEntity == null) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //查询数据源主表 + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbEntity.setSts("Y"); + List mdmModuleDbEntityList = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + MdmModuleDbFiledsEntity queryFild = new MdmModuleDbFiledsEntity(); + queryFild.setMdmId(mdmModuleEntity.getId()); + queryFild.setSts("Y"); + List mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(queryFild); + + MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity(); + mdmModuleDbFiledsRuleEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDbFiledsRuleEntity.setSts("Y"); + List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(mdmModuleDbFiledsRuleEntity); + + List mdmFiledsRuleDtos = new ArrayList<>(); + if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){ + for (int i = 0; i < mdmModuleDbFiledsRuleEntities.size(); i++) { + if("treeselect".equals(mdmModuleDbFiledsRuleEntities.get(i).getRuleValue()) || "select".equals(mdmModuleDbFiledsRuleEntities.get(i).getRuleValue())){ + MdmFiledsRuleDto mdmFiledsRuleDto = new MdmFiledsRuleDto(); + mdmFiledsRuleDto.setDbId(mdmModuleDbFiledsRuleEntities.get(i).getDbId()); + mdmFiledsRuleDto.setFiledId(mdmModuleDbFiledsRuleEntities.get(i).getFiledId()); + mdmFiledsRuleDto.setMdmId(mdmModuleDbFiledsRuleEntities.get(i).getMdmId()); + mdmFiledsRuleDto.setFiledType(mdmModuleDbFiledsRuleEntities.get(i).getRuleValue()); + mdmFiledsRuleDtos.add(mdmFiledsRuleDto); + } + } + } + + if(mdmFiledsRuleDtos != null && mdmFiledsRuleDtos.size() > 0){ + for (int i = 0; i < mdmFiledsRuleDtos.size(); i++) { + for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntities.size(); i1++) { + if(mdmFiledsRuleDtos.get(i).getFiledId().equals(mdmModuleDbFiledsRuleEntities.get(i1).getFiledId()) + && "service".equals(mdmModuleDbFiledsRuleEntities.get(i1).getRuleCode())){ + mdmFiledsRuleDtos.get(i).setTypeFiled(mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue()); + } + } + } + } + + //String tablename = null; + JSONObject jsonObject = new JSONObject(); + jsonObject.put("appName","数智中台"); + jsonObject.put("appCode","800004"); + jsonObject.put("mdmCode",entity.getMdmCode()); + jsonObject.put("optionName","admin"); + for (int i = 0; i < mdmModuleDbEntityList.size(); i++) { + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType()) || "2".equals(mdmModuleDbEntityList.get(i).getDbType())) { + //查询数据 + Map queryData = new HashMap<>(); + queryData.put("tableName", mdmModuleDbEntityList.get(i).getDbName());//表名 + if ("1".equals(mdmModuleDbEntityList.get(i).getDbType())) { + queryData.put("detailFlag", false);//是否明细 + queryData.put("id", entity.getId());//字段 + HashMap datas = mdmModuleDbDao.getServiceDataById(queryData); + convertKeysToLowerCase(datas); + JSONObject zbdata = new JSONObject(); + if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){ + for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) { + if(mdmModuleDbFiledsEntities.get(i2).getDbId().equals(mdmModuleDbEntityList.get(i).getId())){ + if("1".equals(mdmModuleDbFiledsEntities.get(i2).getViewType())){ + //判断是否是下拉类型 + Object data = datas.get(mdmModuleDbFiledsEntities.get(i2).getEnName()); + if(mdmFiledsRuleDtos != null && mdmFiledsRuleDtos.size() > 0){ + for (int i1 = 0; i1 < mdmFiledsRuleDtos.size(); i1++) { + if(mdmModuleDbFiledsEntities.get(i2).getId().equals(mdmFiledsRuleDtos.get(i1).getFiledId())){ + //查询对应的data_id + String strData = String.valueOf(data); + int index = strData.lastIndexOf(','); + if (index!= -1) { + strData = strData.substring(index + 1); + } + mdmFiledsRuleDtos.get(i1).setId(strData); + MdmFiledsRuleDto mdmFiledsRuleDto = mdmModuleDao.queryDataId(mdmFiledsRuleDtos.get(i1)); + if(mdmFiledsRuleDto != null && mdmFiledsRuleDto.getDataId() != null && !"".equals(mdmFiledsRuleDto.getDataId())){ + data = mdmFiledsRuleDto.getDataId(); + }else { + data = null; + } + } + } + } + zbdata.put(mdmModuleDbFiledsEntities.get(i2).getEnName(),data); + } + } + } + } + jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), zbdata); + } else { + queryData.put("detailFlag", true);//是否明细 + queryData.put("id", entity.getId());//字段 + List> datas = mdmModuleDbDao.getServiceByFormmainId(queryData); + convertKeysToLowerCase(datas); + List mxDataList = new ArrayList<>(); + if(datas != null && datas.size() > 0){ + for (int i1 = 0; i1 < datas.size(); i1++) { + JSONObject mxData = new JSONObject(); + if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){ + for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) { + if(mdmModuleDbFiledsEntities.get(i2).getDbId().equals(mdmModuleDbEntityList.get(i).getId())){ + if("1".equals(mdmModuleDbFiledsEntities.get(i2).getViewType())){ + + //判断是否是下拉类型 + Object data = datas.get(i1).get(mdmModuleDbFiledsEntities.get(i2).getEnName()); + if(mdmFiledsRuleDtos != null && mdmFiledsRuleDtos.size() > 0){ + for (int b = 0; b < mdmFiledsRuleDtos.size(); b++) { + if(mdmModuleDbFiledsEntities.get(i2).getId().equals(mdmFiledsRuleDtos.get(b).getFiledId())){ + //查询对应的data_id + String strData = String.valueOf(data); + int index = strData.lastIndexOf(','); + if (index!= -1) { + strData = strData.substring(index + 1); + } + mdmFiledsRuleDtos.get(b).setId(strData); + MdmFiledsRuleDto mdmFiledsRuleDto = mdmModuleDao.queryDataId(mdmFiledsRuleDtos.get(b)); + if(mdmFiledsRuleDto != null && mdmFiledsRuleDto.getDataId() != null && !"".equals(mdmFiledsRuleDto.getDataId())){ + data = mdmFiledsRuleDto.getDataId(); + }else { + data = null; + } + } + } + } + mxData.put(mdmModuleDbFiledsEntities.get(i2).getEnName(),data); + } + } + } + } + mxDataList.add(mxData); + } + }else { + JSONObject mxData = new JSONObject(); + if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){ + for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) { + if(mdmModuleDbFiledsEntities.get(i2).getDbId().equals(mdmModuleDbEntityList.get(i).getId())){ + if("1".equals(mdmModuleDbFiledsEntities.get(i2).getViewType())){ + mxData.put(mdmModuleDbFiledsEntities.get(i2).getEnName(),null); + } + } + } + } + mxDataList.add(mxData); + } + jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), mxDataList); + } + } + } return BaseResult.getSuccessMessageEntity("获取数据成功", jsonObject); } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java index 25ec9090..f8dd60b1 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java @@ -3,6 +3,7 @@ package com.hzya.frame.sysnew.application.service; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity; import com.hzya.frame.web.entity.JsonResultEntity; @@ -432,4 +433,8 @@ public interface ISysApplicationService extends IBaseService 0) { + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject object1 = jsonArray.getJSONObject(i); + if(i > 0){ + stringBuilder.append("&"); + } + stringBuilder.append(object1.getString("parameterName")).append("=").append(object1.getString("example")); + } + } + } + sysExtensionApiEntity.setQuerys(stringBuilder.toString()); + return sysExtensionApiEntity; + } + + @Override + public SysExtensionApiEntity setDDUserId(SysExtensionApiEntity sysExtensionApiEntity) { + String bodys = sysExtensionApiEntity.getBodys(); + StringBuilder stringBuilder = new StringBuilder(); + JSONObject jsonObject = JSONObject.parseObject(bodys); + stringBuilder.append("userid=").append(jsonObject.getString("userid")); + stringBuilder.append("&"); + stringBuilder.append("access_token=").append(jsonObject.getString("access_token")); + sysExtensionApiEntity.setQuerys(stringBuilder.toString()); + return sysExtensionApiEntity; + } + + } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java index 985b999d..80a7fc3a 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java @@ -181,7 +181,7 @@ public class LoginServiceImpl implements ILoginService { String requestType = entity.getString("UserAgent");// pc端还是移动端 JSONObject bodyParams = new JSONObject(); bodyParams.put("code",code); - String result = HttpRequest.post("url"). + String result = HttpRequest.post(url). header("appId",appId). header("apiCode",userApiCode). header("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"). @@ -192,26 +192,24 @@ public class LoginServiceImpl implements ILoginService { JSONObject resultJson = JSONObject.parseObject(result); boolean flag = resultJson.getBoolean("flag"); if(!flag){ - throw new BaseSystemException("请求错误:"+resultJson.getString("msg")); + return BaseResult.getFailureMessageEntity("请求错误:"+resultJson.getString("msg")); } - String userid = resultJson.getString("userid"); + String userid = resultJson.getJSONObject("attribute").getJSONObject("result").getString("userid"); if(StrUtil.isEmpty(userid)){ - return BaseResult.getFailureMessageEntity("认证失败!当前用户未绑定钉钉","1005"); + return BaseResult.getFailureMessageEntity("认证失败!获取钉钉userid错误","1006"); } userEntity.setDdUserId( userid); userEntity = sysUserDao.queryOne(userEntity); if(null == userEntity ){ - if(StrUtil.isEmpty(userid)){ - JSONObject object = new JSONObject(); - object.put("userid",userid); - return BaseResult.getFailureMessageEntity("认证失败!当前用户未绑定钉钉","1005",object); - } + JSONObject object = new JSONObject(); + object.put("userid",userid); + return BaseResult.getFailureMessageEntity("认证失败!当前用户未绑定钉钉","1005",object); } break; case "weChat": break; default: - throw new BaseSystemException("错误的App类型:"+appType+" 支持的app类型有:DD,weChat"); + return BaseResult.getFailureMessageEntity("错误的App类型:"+appType+" 支持的app类型有:DD,weChat"); } //登录 @@ -266,6 +264,18 @@ public class LoginServiceImpl implements ILoginService { } + private JSONObject getAccess_token(String appId,String apiCode) { + String result = HttpRequest.post(url). + header("appId",appId). + header("apiCode",apiCode). + header("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"). + header("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). + execute(). + body(); + JSONObject resultJson = JSONObject.parseObject(result); + return resultJson; + } + protected T getData(String key, JSONObject jsonObject, Class clz) { if (checkStr(jsonObject.getString(key))) { diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/messageManageLog/entity/SysMessageManageLogEntity.java b/base-service/src/main/java/com/hzya/frame/sysnew/messageManageLog/entity/SysMessageManageLogEntity.java index c6218dc0..67bb5e5a 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/messageManageLog/entity/SysMessageManageLogEntity.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/messageManageLog/entity/SysMessageManageLogEntity.java @@ -21,7 +21,9 @@ public class SysMessageManageLogEntity extends BaseEntity { private String messageCode; /** 发送者应用 */ private String sendApp; - /** 发送者 */ + private String sendAppName; + + /** 发送者 */ private String sendApi; /** 接收者编码 */ private String receiveCode; @@ -196,5 +198,13 @@ public class SysMessageManageLogEntity extends BaseEntity { public void setCreateTimeEnd(Date createTimeEnd) { this.createTimeEnd = createTimeEnd; } + + public String getSendAppName() { + return sendAppName; + } + + public void setSendAppName(String sendAppName) { + this.sendAppName = sendAppName; + } } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/messageManageLog/service/impl/SysMessageManageLogServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/messageManageLog/service/impl/SysMessageManageLogServiceImpl.java index e8fbb850..2813a75e 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/messageManageLog/service/impl/SysMessageManageLogServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/messageManageLog/service/impl/SysMessageManageLogServiceImpl.java @@ -6,6 +6,8 @@ import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.sysnew.application.dao.ISysApplicationDao; +import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; import com.hzya.frame.sysnew.messageManageLogBack.detail.server.ISysMessageManageLogDetailBackService; import com.hzya.frame.sysnew.messageManageLogBack.service.ISysMessageManageLogBackService; import com.hzya.frame.sysnew.messageManageLogDetail.dao.ISysMessageManageLogDetailDao; @@ -41,7 +43,8 @@ public class SysMessageManageLogServiceImpl extends BaseServiceand sts = #{sts} and org_id = #{org_id} and company_id = #{companyId} + and dd_user_id = #{ddUserId} + and wx_user_id = #{wxUserId} and sts='Y' order by sorts asc diff --git a/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java b/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java index 75e73ca6..1227f020 100644 --- a/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java +++ b/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java @@ -52,7 +52,6 @@ public class EntranceController { protected ISysApplicationService sysApplicationService; @RequestMapping(value = "/option") @ResponseBody - @CrossOrigin(origins = "*") public JsonResultEntity option(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception { return entranceService.doBusiness(servletRequest, servletResponse); } From a778197694ddc210c2a16fae51b32b730b4edb65 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Fri, 20 Sep 2024 15:50:29 +0800 Subject: [PATCH 09/67] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=82=E9=85=8D?= =?UTF-8?q?=E9=92=89=E9=92=89=E5=8D=95=E7=82=B9=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-llg.yml | 6 ++- .../sysnew/login/impl/LoginServiceImpl.java | 10 ++++- .../webapp/web/corsconfig/CorsConfig.java | 24 +++++++++++ pom.xml | 40 ++++++++++++++----- 4 files changed, 66 insertions(+), 14 deletions(-) create mode 100644 base-webapp/src/main/java/com/hzya/frame/webapp/web/corsconfig/CorsConfig.java diff --git a/base-buildpackage/src/main/resources/application-llg.yml b/base-buildpackage/src/main/resources/application-llg.yml index 5953ca0d..d3a1ebfd 100644 --- a/base-buildpackage/src/main/resources/application-llg.yml +++ b/base-buildpackage/src/main/resources/application-llg.yml @@ -45,7 +45,7 @@ savefile: tomcatpath: /Users/apple/Desktop/log/local pluginpath: /Users/apple/Desktop/log/local zt: - url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface + url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface cbs8: appId: 1P4AGrpz appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a @@ -59,4 +59,6 @@ cbs8: #电子回单下载临时存放位置 elec_path: /Users/xiangerlin/Downloads/ OA: - data_source_code: yc_oa \ No newline at end of file + data_source_code: yc_oa +server: + port: 10086 \ No newline at end of file diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java index 80a7fc3a..d5883b07 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java @@ -85,7 +85,10 @@ public class LoginServiceImpl implements ILoginService { return BaseResult.getFailureMessageEntity("请输入用户名或密码"); } entity.setPassword(AESUtil.encrypt(entity.getLoginCode() + "-" + entity.getPassword())); - SysUserEntity sysUserEntity = sysUserDao.queryOne(entity); + SysUserEntity sysUserEntity = new SysUserEntity(); + sysUserEntity.setLoginCode(entity.getLoginCode()); + sysUserEntity.setPassword(entity.getPassword()); + sysUserEntity = sysUserDao.queryOne(sysUserEntity); if (sysUserEntity == null || sysUserEntity.getId() == null || "".equals(sysUserEntity.getId())) { return BaseResult.getFailureMessageEntity("用户名或密码错误"); } @@ -169,6 +172,11 @@ public class LoginServiceImpl implements ILoginService { public JsonResultEntity appDoLogin(JSONObject jsonObject) { //移动端类型 JSONObject entity = getData("jsonStr", jsonObject, JSONObject.class); + logger.error(entity.toString()); + //boolean f = true; + //if(f){ + // return BaseResult.getFailureMessageEntity("cuowu",entity); + //} //DD,weChat String appType = entity.getString("appType"); String appId = entity.getString("appId"); diff --git a/base-webapp/src/main/java/com/hzya/frame/webapp/web/corsconfig/CorsConfig.java b/base-webapp/src/main/java/com/hzya/frame/webapp/web/corsconfig/CorsConfig.java new file mode 100644 index 00000000..45ea4e9f --- /dev/null +++ b/base-webapp/src/main/java/com/hzya/frame/webapp/web/corsconfig/CorsConfig.java @@ -0,0 +1,24 @@ +package com.hzya.frame.webapp.web.corsconfig; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2024-09-14 17:10 + */ +@Configuration +public class CorsConfig implements WebMvcConfigurer { + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedOrigins("*") + .allowedMethods("GET", "POST", "PUT", "DELETE") + .allowedHeaders("*") + .allowCredentials(false); + } +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index fc53bd54..1e7fa67d 100644 --- a/pom.xml +++ b/pom.xml @@ -7,17 +7,17 @@ base-common base-webapp base-core - - - - - - - - - - - + fw-bip + fw-cbs + fw-dd + fw-grpU8 + fw-nc + fw-ncc + fw-ningbobank + fw-oa + fw-u8 + fw-u8c + fw-u9c com.hzya.frame kangarooDataCenterV3 @@ -464,6 +464,24 @@ **/*.jar + + ${basedir}/../fw-bip/src/main/webapp/WEB-INF/lib + WEB-INF/lib/ + false + + + **/*.jar + + + + ${basedir}/../fw-ningbobank/src/main/webapp/WEB-INF/lib + WEB-INF/lib/ + false + + + **/*.jar + + From cff92f2399d2788c0ee181060c1491a9fc9d9b7b Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Tue, 24 Sep 2024 08:54:44 +0800 Subject: [PATCH 10/67] =?UTF-8?q?=E4=BF=AE=E6=94=B9master=E4=BE=9D?= =?UTF-8?q?=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index 1e7fa67d..b19c6573 100644 --- a/pom.xml +++ b/pom.xml @@ -7,17 +7,17 @@ base-common base-webapp base-core - fw-bip - fw-cbs - fw-dd - fw-grpU8 - fw-nc - fw-ncc - fw-ningbobank - fw-oa - fw-u8 - fw-u8c - fw-u9c + + + + + + + + + + + com.hzya.frame kangarooDataCenterV3 From 5ff781e1336374505403df1285f82b0d600b2ffb Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 24 Sep 2024 08:42:44 +0800 Subject: [PATCH 11/67] =?UTF-8?q?feat:=20=E4=BC=81=E4=B8=9A=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fw-weixin/pom.xml | 54 ++++ .../src/main/java/com/hzya/frame/Main.java | 5 + .../frame/wecom/service/IWeComService.java | 54 ++++ .../wecom/service/impl/WeComServiceImpl.java | 243 ++++++++++++++++++ .../frame/wecom/util/WeComAccessToken.java | 67 +++++ .../target/classes/com/hzya/frame/Main.class | Bin 0 -> 576 bytes .../classes/com/hzya/frame/wecom/Test.class | Bin 0 -> 279 bytes .../frame/wecom/service/IWeComService.class | Bin 0 -> 428 bytes .../wecom/service/impl/WeComServiceImpl.class | Bin 0 -> 5880 bytes .../frame/wecom/util/WeComAccessToken.class | Bin 0 -> 2807 bytes 10 files changed, 423 insertions(+) create mode 100644 fw-weixin/pom.xml create mode 100644 fw-weixin/src/main/java/com/hzya/frame/Main.java create mode 100644 fw-weixin/src/main/java/com/hzya/frame/wecom/service/IWeComService.java create mode 100644 fw-weixin/src/main/java/com/hzya/frame/wecom/service/impl/WeComServiceImpl.java create mode 100644 fw-weixin/src/main/java/com/hzya/frame/wecom/util/WeComAccessToken.java create mode 100644 fw-weixin/target/classes/com/hzya/frame/Main.class create mode 100644 fw-weixin/target/classes/com/hzya/frame/wecom/Test.class create mode 100644 fw-weixin/target/classes/com/hzya/frame/wecom/service/IWeComService.class create mode 100644 fw-weixin/target/classes/com/hzya/frame/wecom/service/impl/WeComServiceImpl.class create mode 100644 fw-weixin/target/classes/com/hzya/frame/wecom/util/WeComAccessToken.class diff --git a/fw-weixin/pom.xml b/fw-weixin/pom.xml new file mode 100644 index 00000000..5a3c515b --- /dev/null +++ b/fw-weixin/pom.xml @@ -0,0 +1,54 @@ + + + + com.hzya.frame + kangarooDataCenterV3 + ${revision} + + + 4.0.0 + fw-weixin + jar + ${revision} + + + + com.hzya.frame + base-service + ${revision} + + + mysql + mysql-connector-java + ${mysql-connector-java} + + + + + 8 + 8 + UTF-8 + + + + + org.springframework.boot + spring-boot-maven-plugin + + none + execute + true + + + + + repackage + + + + + + + \ No newline at end of file diff --git a/fw-weixin/src/main/java/com/hzya/frame/Main.java b/fw-weixin/src/main/java/com/hzya/frame/Main.java new file mode 100644 index 00000000..1817eb3e --- /dev/null +++ b/fw-weixin/src/main/java/com/hzya/frame/Main.java @@ -0,0 +1,5 @@ +package com.hzya.frame;public class Main { + public static void main(String[] args) { + System.out.println("Hello world!"); + } +} \ No newline at end of file diff --git a/fw-weixin/src/main/java/com/hzya/frame/wecom/service/IWeComService.java b/fw-weixin/src/main/java/com/hzya/frame/wecom/service/IWeComService.java new file mode 100644 index 00000000..aec0dd6d --- /dev/null +++ b/fw-weixin/src/main/java/com/hzya/frame/wecom/service/IWeComService.java @@ -0,0 +1,54 @@ +package com.hzya.frame.wecom.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * @Description 企业微信service + * @Author xiangerlin + * @Date 2024/9/23 14:23 + **/ +public interface IWeComService { + /** + * 获取accessToken + * 该方法会缓存accessToken + * https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=ID&corpsecret=SECRET + * @param jsonObject + * @return + */ + JSONObject accessToken(JSONObject jsonObject); + + /** + * 发送消息 + * https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=ACCESS_TOKEN + * @param jsonObject + * @return + */ + JSONObject messageSend(JSONObject jsonObject); + + /** + * 根据授权码获取用户信息 + * 单点登录的时候用 + * https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token=ACCESS_TOKEN&code=CODE + * @param jsonObject + * @return + */ + JSONObject getUserInfoByAuthCode(JSONObject jsonObject); + + /** + * 根据userid读取成员信息 + * https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&userid=USERID + * @param jsonObject + * @return + */ + JSONObject getUserInfoByUserId(JSONObject jsonObject); + + /** + * 根据手机号获取userid + * https://qyapi.weixin.qq.com/cgi-bin/user/getuserid?access_token=ACCESS_TOKEN + * @param jsonObject + * @return + */ + JSONObject getUserIdByMobile(JSONObject jsonObject); +} diff --git a/fw-weixin/src/main/java/com/hzya/frame/wecom/service/impl/WeComServiceImpl.java b/fw-weixin/src/main/java/com/hzya/frame/wecom/service/impl/WeComServiceImpl.java new file mode 100644 index 00000000..f8b36791 --- /dev/null +++ b/fw-weixin/src/main/java/com/hzya/frame/wecom/service/impl/WeComServiceImpl.java @@ -0,0 +1,243 @@ +package com.hzya.frame.wecom.service.impl; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import com.hzya.frame.wecom.service.IWeComService; +import com.hzya.frame.wecom.util.WeComAccessToken; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +/** + * @Description 企业微信service + * @Author xiangerlin + * @Date 2024/9/23 14:24 + **/ +@Service(value = "weComServiceImpl") +public class WeComServiceImpl implements IWeComService { + static Logger logger = LoggerFactory.getLogger(WeComServiceImpl.class); + /** + * 获取accessToken + * https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=ID&corpsecret=SECRET + * @param json + * @return + */ + @Override + public JSONObject accessToken(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if (null == jsonObject){ + return this.error("参数不能为空"); + } + String corpid = jsonObject.getString("corpid"); + String corpsecret = jsonObject.getString("corpsecret"); + if (StrUtil.isEmpty(corpid)) { + return this.error("corpid不能为空"); + } + if (StrUtil.isEmpty(corpsecret)) { + return this.error("corpsecret不能为空"); + } + try { + String accessToken = WeComAccessToken.getAccessToken(corpid, corpsecret); + return this.ok(accessToken); + }catch(Exception e){ + logger.error("获取accessToken出错",e); + } + return this.error("系统异常"); + } + + /** + * 发送消息 + * https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=ACCESS_TOKEN + * @param json + * @return + */ + @Override + public JSONObject messageSend(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if (null == jsonObject){ + return this.error("参数不能为空"); + } + String agentid = jsonObject.getString("agentid"); + String text = jsonObject.getString("text"); + String access_token = jsonObject.getString("access_token"); + if (StrUtil.isEmpty(agentid)){ + return this.error("agentid不能为空"); + } + if (StrUtil.isEmpty(text)){ + return this.error("消息内容不能为空"); + } + if (StrUtil.isEmpty(access_token)){ + return this.error("access_token不能为空"); + } + String url = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token="+access_token; + jsonObject.remove("access_token"); + String param = jsonObject.toString(); + String res = HttpRequest.post(url).body(param).timeout(30000).execute().body(); + if (StrUtil.isNotEmpty(res)){ + JSONObject msgResponse = JSONObject.parseObject(res); + String errcode = msgResponse.getString("errcode"); + String errmsg = msgResponse.getString("errmsg"); + if ("0".equals(errcode)){ + return ok(); + }else { + return error(errmsg); + } + } + return this.error("操作失败"); + } + + /** + * 根据授权码获取用户信息 + * 单点登录的时候用 + * https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token=ACCESS_TOKEN&code=CODE + * + * @param json + * @return + */ + @Override + public JSONObject getUserInfoByAuthCode(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if (null == jsonObject){ + return this.error("参数不能为空"); + } + String access_token = jsonObject.getString("access_token"); + String code = jsonObject.getString("code"); + if (StrUtil.isEmpty(access_token)){ + return error("access_token不能为空"); + } + if (StrUtil.isEmpty(code)){ + return error("code不能为空"); + } + String url = "https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token="+access_token+"&code="+code; + String res = HttpRequest.get(url).timeout(30000).execute().body(); + if (StrUtil.isNotEmpty(res)){ + JSONObject msgResponse = JSONObject.parseObject(res); + String errcode = msgResponse.getString("errcode"); + String errmsg = msgResponse.getString("errmsg"); + String userid = msgResponse.getString("userid"); + if ("0".equals(errcode)){ + return ok(userid); + }else { + return error(errmsg); + } + } + return null; + } + + /** + * 根据userid读取成员信息 + * https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&userid=USERID + * + * @param json + * @return + */ + @Override + public JSONObject getUserInfoByUserId(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if (null == jsonObject){ + return this.error("参数不能为空"); + } + String access_token = jsonObject.getString("access_token"); + String userid = jsonObject.getString("userid"); + if (StrUtil.isEmpty(access_token)){ + return error("access_token不能为空"); + } + if (StrUtil.isEmpty(userid)){ + return error("userid不能为空"); + } + String url = "https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token="+access_token+"&userid="+userid; + String res = HttpRequest.get(url).timeout(30000).execute().body(); + if (StrUtil.isNotEmpty(res)){ + JSONObject msgResponse = JSONObject.parseObject(res); + String errcode = msgResponse.getString("errcode"); + String errmsg = msgResponse.getString("errmsg"); + if ("0".equals(errcode)){ + return ok(res); + }else { + return error(errmsg); + } + } + return null; + } + + /** + * 根据手机号获取userid + * https://qyapi.weixin.qq.com/cgi-bin/user/getuserid?access_token=ACCESS_TOKEN + * + * @param json + * @return + */ + @Override + public JSONObject getUserIdByMobile(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + if (null == jsonObject){ + return this.error("参数不能为空"); + } + String access_token = jsonObject.getString("access_token"); + String mobile = jsonObject.getString("mobile"); + if (StrUtil.isEmpty(access_token)){ + return error("access_token不能为空"); + } + if (StrUtil.isEmpty(mobile)){ + return error("mobile不能为空"); + } + String url = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserid?access_token="+access_token; + jsonObject.remove("access_token"); + String param = jsonObject.toString(); + String res = HttpRequest.post(url).body(param).timeout(30000).execute().body(); + if (StrUtil.isNotEmpty(res)){ + JSONObject msgResponse = JSONObject.parseObject(res); + String errcode = msgResponse.getString("errcode"); + String errmsg = msgResponse.getString("errmsg"); + String userid = msgResponse.getString("userid"); + if ("0".equals(errcode)){ + return ok(userid); + }else { + return error(errmsg); + } + } + return null; + } + + /** + * 成功 + * @return + */ + private static JSONObject ok(){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("code","200"); + jsonObject.put("msg","成功"); + jsonObject.put("data",""); + return jsonObject; + } + + /** + * 成功 + * @param data 返回数据 + * @return + */ + private static JSONObject ok(String data){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("code","200"); + jsonObject.put("msg","成功"); + jsonObject.put("data",data); + return jsonObject; + } + + /** + * 失败 + * @param msg 失败原因 + * @return + */ + private static JSONObject error(String msg){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("code","500"); + jsonObject.put("msg",msg); + jsonObject.put("data",""); + return jsonObject; + } +} diff --git a/fw-weixin/src/main/java/com/hzya/frame/wecom/util/WeComAccessToken.java b/fw-weixin/src/main/java/com/hzya/frame/wecom/util/WeComAccessToken.java new file mode 100644 index 00000000..78b6dc19 --- /dev/null +++ b/fw-weixin/src/main/java/com/hzya/frame/wecom/util/WeComAccessToken.java @@ -0,0 +1,67 @@ +package com.hzya.frame.wecom.util; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import java.time.Instant; + +/** + * @Description 获取企业微信accesToken + * @Author xiangerlin + * @Date 2024/9/23 14:08 + **/ +public class WeComAccessToken { + + static Logger logger = LoggerFactory.getLogger(WeComAccessToken.class); + //token + private static String accessToken; + //过期时间 + private static Instant expireTime; + private static final Long CACHE_EXPIRY_TIME = 7000L; // 缓存有效时间(秒) + + + /** + * 获取accessToken + * + * @param corpid 企业ID + * @param corpsecret 应用的凭证密钥 + * @return + */ + public static String getAccessToken(String corpid,String corpsecret) { + //判断是否过期 如果没过期直接返回 + if (null != accessToken && expireTime != null && Instant.now().isBefore(expireTime)) { + return accessToken; + } + //获取新的accessToken + accessToken = fetchNewAccessToken(corpid,corpsecret); + //过期时间设置成当前事件+7000s,预留200s的时间 + expireTime = Instant.now().plusSeconds(CACHE_EXPIRY_TIME); + return accessToken; + } + + /** + * 获取信的token + * @param corpid + * @param corpsecret + * @return + */ + private static String fetchNewAccessToken(String corpid, String corpsecret) { + String url = " https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid="+corpid+"&corpsecret="+corpsecret; + String response = HttpRequest.get(url).timeout(30000).execute().body(); + if (StrUtil.isNotEmpty(response)){ + JSONObject json = JSONObject.parseObject(response); + String accessToken = json.getString("access_token"); + return accessToken; + } + return null; + } + + public static void main(String[] args) { + for (int i=0; i<2; i++){ + String accessToken1 = WeComAccessToken.getAccessToken("wwb46c3f5e6ffe3e2b", "oON2ELxNVyl7wc37LeA9bNOsv_jyuFXdrvD9e0yogbQ"); + System.out.println(accessToken1); + } + } +} diff --git a/fw-weixin/target/classes/com/hzya/frame/Main.class b/fw-weixin/target/classes/com/hzya/frame/Main.class new file mode 100644 index 0000000000000000000000000000000000000000..fcf604dc32d90998f8f726d809a0b84c22d4e9c1 GIT binary patch literal 576 zcmZuuyH3ME5S+`)u`whB!ut`R2^6?Nq5#n#A&T&jg3?f3k|Q}}`;g;+;IE(niGmN{ zqYz_*6p&)cyWZKonH}Hf*ZT*6J#0BBplV|d^F=H;Sj3WrWeY0;g+m?c_(&jI-);%y zj!jnylo~oz=fj|_qAS_FT9bh410 zi0mf3E-Vx+th!jkx`2DCeBaa_OyqYrEYw_VV3R6icBIN^v5WSt>csz`=Hnn%0soB| zvQhnUp^bM*3o(r-8PMiT%JCl-uQYZI^#6}s@#4CLBG|xmw Ij2X;+1H{>R5C8xG literal 0 HcmV?d00001 diff --git a/fw-weixin/target/classes/com/hzya/frame/wecom/Test.class b/fw-weixin/target/classes/com/hzya/frame/wecom/Test.class new file mode 100644 index 0000000000000000000000000000000000000000..32e87025ee472c7091e1e997a4904190ce3d2942 GIT binary patch literal 279 zcmZ{ey>7xl5QJxqe}XZ=qC=_ZAVsc87nBBx%7Oxm{(Ky8$Ul-XLFBDcMWWyV@=#Is z5N&p)(axvc(f<5it^i&UhiIW2;4wgt;7?3xns-8LG+q(hX|>jbUSdi;KNgv;Q<>#V z`bni^zLK@E{tn${XAXp?L{){@eV(P*)Uwdxq%BDGp?M>O%j#GwJu^0@ZQ;vae#i(e zJi_4LQ$lR_L@vv%SY&&x8Vup^^R|ea16X}_;^qPG`5W}bz(K(3GX@^Gf#^1SXd`4t J=&(A7{s5q@I*0%O literal 0 HcmV?d00001 diff --git a/fw-weixin/target/classes/com/hzya/frame/wecom/service/IWeComService.class b/fw-weixin/target/classes/com/hzya/frame/wecom/service/IWeComService.class new file mode 100644 index 0000000000000000000000000000000000000000..4914de8e1c430e2b1ec33525303f9954a4e994d7 GIT binary patch literal 428 zcmaiwy-veG5QOJK5`)7(;vIm3Yv`y*BBUTfkPMNz zGt&0@{9lK_;goD*qDNJ!f-F_FfbVkF5nNhurHUz_G7>nA$v)RqP0G0$Ha82Kj7&rV zCmVd_VE554jfTzCglW!BKQN0*)9p$ePhMzbih!zRs_8OQOC@mO&Pv`JzRB$*-^c+j zbso7f!RxyjnX59E>y7&Y0v&!F(CZ3pq074Glt3R~e| literal 0 HcmV?d00001 diff --git a/fw-weixin/target/classes/com/hzya/frame/wecom/service/impl/WeComServiceImpl.class b/fw-weixin/target/classes/com/hzya/frame/wecom/service/impl/WeComServiceImpl.class new file mode 100644 index 0000000000000000000000000000000000000000..cab0982e9d8e6924e4e2052c54105b875784532b GIT binary patch literal 5880 zcmb7IX?RrS6@G7$nR{n42n-M$!6G7Q$ihU5ttKoI76Ah&0isl^H;Fqu1})vaftY2a=&xG<(%`K z_dVzPX5RUv|78F(@kc)v;F}t5@Z%zUOT!jFnsB3rR(Zck!xetqj9WB(Tf?n>+=i_( zzD>n{4-;A0bhGx3u@jW4EZiS00q^!~OEu zBaa8<@t_|M;bF1(h)mh5;aUy4hVS|DC>|5b-`B8D!v+nHYj{G#ld|du8rEyrui+^T zPiu&4ct*psDxMP^wEn!by&5bH2Q(x#9Mo_~#S4DCh>VKED*6<7V`fK(kyH?DHj^FU zRBYYM_2Fi_uaTp(qVcFTM?q=Tv^5IK=9}$?f|1S9xUoFl)n+7D>1{FgaB)PBtWt8ZpAru0$-{YRosgTAZFG?4ap# zJrXfesa56%Bd%aUm90gOMcec?D$-Nd`ji@Xp_GS%^gfs2^QM6_LjUxbtqNg9@d z5iOP;*|1Dc*byR9Dvpp+3Pvq6tWLB2GF<{>8A*n%yo)y0$7?(#uRuGVu5fbjTD){eRmkvYC^Fj zzRqmwnU}UY9f-YYcG}t;J7Wsw*(+#jbhfv>sb`tl78NRZyIi5f+@N4e)#<=;K~-M( zU0hCQU0J(s>D(2AV3NY6b|kb}k(kR`e~Xz;MvO(aW8;RBY`SnkL1<-~f$K8XL{m|c zcV0YhTDrhb5UQM{NC;DG@@_Jd8^S3fWSCY@!U(&ZB~v^b^;nwwAGK)+mjhUgB?L(5 z!Mz30k8Uz?VCT&zcK06d+kWzvW5@gYKi=OTKnmRf9K}m2js@^CUg0!{NBPqfR19(| ze?Y~n0lbFS12DzHm_e%N7#+YOT%ut7$sLCWcHWzpVFO$H|8~zF6>o?WZ<0M9A3FN+ z(Y*sN-8|68Dlx`oSH3v~XP(GxJ8{$V1Gn8e@Z6ChL;37092!69mjiWEIvQ)25;UjN zvJ$C=aJaiiPeiA0GNPNK@#)>&)1_WSI-+%L(RkQR3)YW#``mmhvjg}c-U{GHcsqa} z;~f?62JjQS7r;;D@iY89fM4K!6(2|s=X{7)0{EqbN~vce2JkCA}@RcAhhnIm>GF~bV|Wv*0;Vmkh7yhp5^oGY}`a5{Emq1YL! zU#oOf&ZcrFEen-j{6&;Is)m}FB-jj7mYJ0^>gxme4Svi0p4fKh!0me#fZZ3=*DIJI z%fHy!pyGD{{2qTGEQ3tS*4^r1^)1OS0R`(FCbB{^ii2m00w3SAW0gg#)SwT}JeGn9 zk$AW>ZJA~)%uF@HX)79&<7PEm7J_JMVOPTH;k^E>rqi_x7n;t`{9+FAw0w_@wE zw=pmOd_04G7Ia*guiN#kSdlH_{-~iB0s1n$wpE=;bCaC>jdDxy>WPGXXw?;2HSIG_ zxarThX_lFd^;n)8MO^bHjV^N|t84)lxeLJH3b#waS%X*z*~5$ZSSevn@r*1>n9|f2 z_4CvVxg;v*k)ATL{P%KedW95hUI)yumYEH78fg(DCJC`vnE)QLFqE3_6d|%w+74l;OVUm zdNWX$*9J8<4P|wG@a?fj{W2Qj9QVCk-s_|z(BP?V4SD)7qPM|w5F>-5LY^ZST?*<9 z$}C!M!sS?rGiX`-Y@h^8f{JtK=VXk<6imQ*d`?9*Dlr39oHLE9YUyzuS5C(&Zu(lB zZ|`j}S1x5}R#2;lBLU86p~OA8`xR*wR@1Ty9cw6+(84mbaz!caEW{O*%5WvuRG{p? z7^`CK|8Ta7uk$lp;tR24E;5cbLgJG-~ z62|fNJA>zj^-Os`iqMsZaaM3b1`|UbJ~BAF!D}n~QfqAnlN!{Jw-4up)C?w%PSWw2ldicHuyrm;FrY%KZPn0%7fEF{tT-3Kl^}fF~c{Hfonny<`bX=1ZWZ8E+G(082+VLOK1`d@g@@P212u&5qp?H z-pA2r2~UQRe3d}FNf6$#X9L$!`#u7G4f}nZbv7ZsoLtY)qE4w?;+%u@{T!t4<{&+c zHqH}BpGSmJ8U1?_?UX$9rVR!qFa24Kb(BO!|!I9FE~A)3}Nzs zlP3lV_ry?{%LGq3q5#% zFz>_lc#1Ie;zm1z6O7CjX0rgVa%PncJbx@;RS@8PTvdVfl>8FG90d;MDDZTS0{7W) z3k7!4JE6eU)GELW1)6NQy*Auy;K^qC1P8zopK?k0DWG;iwsHQH%G9Fs=wAT=VmSi5 zNCJra`-dffjl?Mk@RfW5%*+ztg3~0xj8hUI4|j5;2=2=5Z>5KA^ZYYLy8~jBP%;k8IbneQcS)#dhzkgUX zzdB4he=Q%)3tcp&w0rVPyH_&$oDh%U!qUz>cGH?|rBr$+t$h^iwDwc5$s{%2=cYC5 zJK?nt@4U2L%j5!+QN;nmdyw$HKzLsyyj+IEg!c&H?I*l1v2q_{wSJjky+VjzWdgs3 zt$3Y;c!R*diO2Xg^BKHFEpMX_@7hpHUEk`aH-7|l)7!`SPI~*f%1Li2ko`H(`*WZl z%7MN&2l{<1IFjBi1lmdOYw4NPbuT@05?!?u{iF)4PI;uQevG;TLmi%@BvSx4>6kG zzt7_L?kV`lj-y=SG@gobfss2Pf5_k}G1f_AC2Y@gjWyR~jn!n0)dc5Oi>;cWw*Ew& zf2OU!(AHmZE{@x_Dja=CGM?a!iMCZGyW6Dg0DqAg&VhNhz2I!eZqVKAXB_xD)&GMI z{FA=~|BDX%yTAdfxC55$RXTSEo@@sj@CBRtF#ixn$~{=gy9djLHnOjTXVGT1KA6#j-?m}MM;E`mWM-l72%#t3Kxqfta%vn(n|G&eFk^e%(5JIl;07jsWE z_xs&kUQ(6HtI?{JN~-dhhdkte*gs zg{L5%biJ(MJDJ{TBN@sD6s$5WOZfhndqL!-%CtFa8jhLI8l!<{=d)DN#C*Z_#F(8E z3L48A0Y8jH-Ve-tK$W$FhX+p#O$?nol{j;LVk|K{q+m^zt)v@Tsykrk?ckt-NPEY) zg6N<-Ns|ppJ1IOL6t9|wGNLsE}uqPQ2x$uSMi9o^X(ZIAW z44Z`t&Nag#m~tminG#(fJYsIlh`^dkiMeG+qSL<1m~ROkG95c@rs_@MTPV7`MuVVoh zbv%pb6s*6UVMmI#Gb#Dmw|OcE3Vy#~%q*A%yL(R9^LD;_W~N&v*vi^nX*+K)pMfOn zp>i@F*6}=Eptn1gazfdQcuB>}I$pu6IxgX|j@R(IiZ^t;DR zO@x+pe1H#0!nwJ0?_R4X(VsCFfJ)3(medt7l(Q9NwQ!jrg+@ z(+kC8=O(?`qx;3~1vi^Mt)mCMDn8QjF+Nf8sgBR^xq{CB&tDZ^=(vI}b=;5bI=;f! zEUTsXmFcleR3e8=l43F2KO!=&$80xON@STv$Kx!frMqQC zE2wukjhjx9r&!Y`*-r{i(H~_=<|oOr=Jt~--&SW93L?)^>RO>3?<~FwMs=BxzWfIo{G38d)x8rV3KYVQXw!>1KAu^|!x+$4o15Jw{LBE527i|rvJ!$%KW_$+VZlN?1%Rxwwa?3m%qrpbAO?2?>o z!PgC49J~2ta8{(W^9Gb3xTv8Bs0)P+*v++GR=|VU!>@YTZm1;>Uq*y0;34H2YQ96u zHAH?v<07J5lu&yGD&T0*RZ`s;|uEuM{p_caq1uoW$IqK&|}v(xty zw!FW&dHhEvcyl&&fmbQxL(5QPX6Ne zaM;OT2@S)$7O`e+ad!!8ONf`ynCe=@x+`en)YKnsiN>2tSl?gUQhQZdf_xuT8tx(7 zUIwF&|Mp^lppFvHarB4K5AyN>2C$!Flsl0yC(_l#Eq4+XciNbh19VJ=wiOR^6$xEj z1?4XsS8as&|3Q~?v39YZ&}2K;cIB!Rl>$git_zGzsn3) zNBkh2ID`foX{Pm!I1<9%Oq~Yq91h{skUB>&7_y*^P7Kk8jD0<7{zQ%P2a_f Date: Tue, 24 Sep 2024 10:28:17 +0800 Subject: [PATCH 12/67] =?UTF-8?q?fix:=E6=8E=88=E6=9D=83=E7=A0=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E9=BB=98=E8=AE=A4=E8=AE=BE=E7=BD=AEtoken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/wecom/service/impl/WeComServiceImpl.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fw-weixin/src/main/java/com/hzya/frame/wecom/service/impl/WeComServiceImpl.java b/fw-weixin/src/main/java/com/hzya/frame/wecom/service/impl/WeComServiceImpl.java index f8b36791..70f26871 100644 --- a/fw-weixin/src/main/java/com/hzya/frame/wecom/service/impl/WeComServiceImpl.java +++ b/fw-weixin/src/main/java/com/hzya/frame/wecom/service/impl/WeComServiceImpl.java @@ -107,7 +107,16 @@ public class WeComServiceImpl implements IWeComService { String access_token = jsonObject.getString("access_token"); String code = jsonObject.getString("code"); if (StrUtil.isEmpty(access_token)){ - return error("access_token不能为空"); + //如果token为空,手动获取一次 + String corpid = jsonObject.getString("corpid"); + String corpsecret = jsonObject.getString("corpsecret"); + if (StrUtil.isEmpty(corpid)){ + this.error("corpid不能为空"); + } + if (StrUtil.isEmpty(corpsecret)){ + this.error("corpsecret不能为空"); + } + access_token = WeComAccessToken.getAccessToken(corpid, corpsecret); } if (StrUtil.isEmpty(code)){ return error("code不能为空"); From 0baa4e0bf31f2745d582bc5a46363d7965b1a3ce Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 24 Sep 2024 11:11:38 +0800 Subject: [PATCH 13/67] =?UTF-8?q?feat:=20=E4=BC=81=E4=B8=9A=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E5=8D=95=E7=82=B9=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sysnew/login/impl/LoginServiceImpl.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java index d5883b07..95ff3251 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java @@ -215,6 +215,35 @@ public class LoginServiceImpl implements ILoginService { } break; case "weChat": + String authCode = entity.getString("code");//授权码 + JSONObject params = new JSONObject(); + params.put("code",authCode); + params.put("corpid",entity.getString("corpid")); + params.put("corpsecret",entity.getString("corpsecret")); + params.put("access_token",entity.getString("access_token")); + String res = HttpRequest.post(url). + header("appId",appId). + header("apiCode",userApiCode). + header("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"). + header("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). + body(params.toJSONString()). + execute(). + body(); + JSONObject resJsonObject = JSONObject.parseObject(res); + JSONObject attribute = resJsonObject.getJSONObject("attribute"); + String errcode = attribute.getString("errcode"); + String errmsg = attribute.getString("errmsg"); + if(!"0".equals(errcode)){ + return BaseResult.getFailureMessageEntity("请求错误:"+errmsg); + } + String weComUserid = attribute.getString("userid"); + userEntity.setWxUserId(weComUserid); + userEntity = sysUserDao.queryOne(userEntity); + if(null == userEntity ){ + JSONObject object = new JSONObject(); + object.put("userid",weComUserid); + return BaseResult.getFailureMessageEntity("认证失败!当前用户未绑定企业微信","1005",object); + } break; default: return BaseResult.getFailureMessageEntity("错误的App类型:"+appType+" 支持的app类型有:DD,weChat"); From c398ecde8bfcdde333648aa84614371db9c74640 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 24 Sep 2024 11:12:43 +0800 Subject: [PATCH 14/67] =?UTF-8?q?feat:=20=E4=BE=9D=E8=B5=96fw-weixin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base-webapp/pom.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/base-webapp/pom.xml b/base-webapp/pom.xml index 79bd4cf9..05ae9e2e 100644 --- a/base-webapp/pom.xml +++ b/base-webapp/pom.xml @@ -76,7 +76,11 @@ - + + com.hzya.frame + fw-weixin + ${revision} + From f582a9601c0f552d65c99fff843db9c694fab921 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 24 Sep 2024 11:13:13 +0800 Subject: [PATCH 15/67] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=AD=90?= =?UTF-8?q?=E6=A8=A1=E5=9D=97fw-weixin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index b19c6573..912bc2a8 100644 --- a/pom.xml +++ b/pom.xml @@ -18,6 +18,7 @@ + fw-weixin com.hzya.frame kangarooDataCenterV3 From 5f6648144ca979c23bdc06d8da25507003a226a3 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 24 Sep 2024 11:14:37 +0800 Subject: [PATCH 16/67] =?UTF-8?q?fix:=20=E5=8E=BB=E6=8E=89=E6=B2=A1?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fw-weixin/pom.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/fw-weixin/pom.xml b/fw-weixin/pom.xml index 5a3c515b..51dce4e6 100644 --- a/fw-weixin/pom.xml +++ b/fw-weixin/pom.xml @@ -19,12 +19,6 @@ base-service ${revision} - - mysql - mysql-connector-java - ${mysql-connector-java} - - 8 From 351a7e7a7aee72c7ed62fa481ad077c39ddeb529 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 24 Sep 2024 11:34:27 +0800 Subject: [PATCH 17/67] =?UTF-8?q?fix:=20=E6=B3=A8=E9=87=8A=20fw-weixin?= =?UTF-8?q?=E7=9A=84=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base-webapp/pom.xml | 10 +++++----- pom.xml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/base-webapp/pom.xml b/base-webapp/pom.xml index 05ae9e2e..afa4acb1 100644 --- a/base-webapp/pom.xml +++ b/base-webapp/pom.xml @@ -76,11 +76,11 @@ - - com.hzya.frame - fw-weixin - ${revision} - + + + + + diff --git a/pom.xml b/pom.xml index 912bc2a8..6f230720 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ - fw-weixin + com.hzya.frame kangarooDataCenterV3 From 62cf8661119d91fc2e8e8c7a895023b85e8d12c9 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 24 Sep 2024 11:36:23 +0800 Subject: [PATCH 18/67] =?UTF-8?q?=E5=88=A0=E9=99=A4fw-weixin=E5=9C=A8maste?= =?UTF-8?q?r=E4=B8=8A=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fw-weixin/pom.xml | 48 ---- .../src/main/java/com/hzya/frame/Main.java | 5 - .../frame/wecom/service/IWeComService.java | 54 ---- .../wecom/service/impl/WeComServiceImpl.java | 252 ------------------ .../frame/wecom/util/WeComAccessToken.java | 67 ----- .../target/classes/com/hzya/frame/Main.class | Bin 576 -> 0 bytes .../classes/com/hzya/frame/wecom/Test.class | Bin 279 -> 0 bytes .../frame/wecom/service/IWeComService.class | Bin 428 -> 0 bytes .../wecom/service/impl/WeComServiceImpl.class | Bin 5880 -> 0 bytes .../frame/wecom/util/WeComAccessToken.class | Bin 2807 -> 0 bytes 10 files changed, 426 deletions(-) delete mode 100644 fw-weixin/pom.xml delete mode 100644 fw-weixin/src/main/java/com/hzya/frame/Main.java delete mode 100644 fw-weixin/src/main/java/com/hzya/frame/wecom/service/IWeComService.java delete mode 100644 fw-weixin/src/main/java/com/hzya/frame/wecom/service/impl/WeComServiceImpl.java delete mode 100644 fw-weixin/src/main/java/com/hzya/frame/wecom/util/WeComAccessToken.java delete mode 100644 fw-weixin/target/classes/com/hzya/frame/Main.class delete mode 100644 fw-weixin/target/classes/com/hzya/frame/wecom/Test.class delete mode 100644 fw-weixin/target/classes/com/hzya/frame/wecom/service/IWeComService.class delete mode 100644 fw-weixin/target/classes/com/hzya/frame/wecom/service/impl/WeComServiceImpl.class delete mode 100644 fw-weixin/target/classes/com/hzya/frame/wecom/util/WeComAccessToken.class diff --git a/fw-weixin/pom.xml b/fw-weixin/pom.xml deleted file mode 100644 index 51dce4e6..00000000 --- a/fw-weixin/pom.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - com.hzya.frame - kangarooDataCenterV3 - ${revision} - - - 4.0.0 - fw-weixin - jar - ${revision} - - - - com.hzya.frame - base-service - ${revision} - - - - 8 - 8 - UTF-8 - - - - - org.springframework.boot - spring-boot-maven-plugin - - none - execute - true - - - - - repackage - - - - - - - \ No newline at end of file diff --git a/fw-weixin/src/main/java/com/hzya/frame/Main.java b/fw-weixin/src/main/java/com/hzya/frame/Main.java deleted file mode 100644 index 1817eb3e..00000000 --- a/fw-weixin/src/main/java/com/hzya/frame/Main.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.hzya.frame;public class Main { - public static void main(String[] args) { - System.out.println("Hello world!"); - } -} \ No newline at end of file diff --git a/fw-weixin/src/main/java/com/hzya/frame/wecom/service/IWeComService.java b/fw-weixin/src/main/java/com/hzya/frame/wecom/service/IWeComService.java deleted file mode 100644 index aec0dd6d..00000000 --- a/fw-weixin/src/main/java/com/hzya/frame/wecom/service/IWeComService.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.hzya.frame.wecom.service; - -import com.alibaba.fastjson.JSONObject; -import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; -import com.hzya.frame.web.entity.JsonResultEntity; - -/** - * @Description 企业微信service - * @Author xiangerlin - * @Date 2024/9/23 14:23 - **/ -public interface IWeComService { - /** - * 获取accessToken - * 该方法会缓存accessToken - * https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=ID&corpsecret=SECRET - * @param jsonObject - * @return - */ - JSONObject accessToken(JSONObject jsonObject); - - /** - * 发送消息 - * https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=ACCESS_TOKEN - * @param jsonObject - * @return - */ - JSONObject messageSend(JSONObject jsonObject); - - /** - * 根据授权码获取用户信息 - * 单点登录的时候用 - * https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token=ACCESS_TOKEN&code=CODE - * @param jsonObject - * @return - */ - JSONObject getUserInfoByAuthCode(JSONObject jsonObject); - - /** - * 根据userid读取成员信息 - * https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&userid=USERID - * @param jsonObject - * @return - */ - JSONObject getUserInfoByUserId(JSONObject jsonObject); - - /** - * 根据手机号获取userid - * https://qyapi.weixin.qq.com/cgi-bin/user/getuserid?access_token=ACCESS_TOKEN - * @param jsonObject - * @return - */ - JSONObject getUserIdByMobile(JSONObject jsonObject); -} diff --git a/fw-weixin/src/main/java/com/hzya/frame/wecom/service/impl/WeComServiceImpl.java b/fw-weixin/src/main/java/com/hzya/frame/wecom/service/impl/WeComServiceImpl.java deleted file mode 100644 index 70f26871..00000000 --- a/fw-weixin/src/main/java/com/hzya/frame/wecom/service/impl/WeComServiceImpl.java +++ /dev/null @@ -1,252 +0,0 @@ -package com.hzya.frame.wecom.service.impl; - -import cn.hutool.core.util.StrUtil; -import cn.hutool.http.HttpRequest; -import com.alibaba.fastjson.JSONObject; -import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; -import com.hzya.frame.web.entity.BaseResult; -import com.hzya.frame.web.entity.JsonResultEntity; -import com.hzya.frame.wecom.service.IWeComService; -import com.hzya.frame.wecom.util.WeComAccessToken; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -/** - * @Description 企业微信service - * @Author xiangerlin - * @Date 2024/9/23 14:24 - **/ -@Service(value = "weComServiceImpl") -public class WeComServiceImpl implements IWeComService { - static Logger logger = LoggerFactory.getLogger(WeComServiceImpl.class); - /** - * 获取accessToken - * https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=ID&corpsecret=SECRET - * @param json - * @return - */ - @Override - public JSONObject accessToken(JSONObject json) { - JSONObject jsonObject = json.getJSONObject("jsonStr"); - if (null == jsonObject){ - return this.error("参数不能为空"); - } - String corpid = jsonObject.getString("corpid"); - String corpsecret = jsonObject.getString("corpsecret"); - if (StrUtil.isEmpty(corpid)) { - return this.error("corpid不能为空"); - } - if (StrUtil.isEmpty(corpsecret)) { - return this.error("corpsecret不能为空"); - } - try { - String accessToken = WeComAccessToken.getAccessToken(corpid, corpsecret); - return this.ok(accessToken); - }catch(Exception e){ - logger.error("获取accessToken出错",e); - } - return this.error("系统异常"); - } - - /** - * 发送消息 - * https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=ACCESS_TOKEN - * @param json - * @return - */ - @Override - public JSONObject messageSend(JSONObject json) { - JSONObject jsonObject = json.getJSONObject("jsonStr"); - if (null == jsonObject){ - return this.error("参数不能为空"); - } - String agentid = jsonObject.getString("agentid"); - String text = jsonObject.getString("text"); - String access_token = jsonObject.getString("access_token"); - if (StrUtil.isEmpty(agentid)){ - return this.error("agentid不能为空"); - } - if (StrUtil.isEmpty(text)){ - return this.error("消息内容不能为空"); - } - if (StrUtil.isEmpty(access_token)){ - return this.error("access_token不能为空"); - } - String url = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token="+access_token; - jsonObject.remove("access_token"); - String param = jsonObject.toString(); - String res = HttpRequest.post(url).body(param).timeout(30000).execute().body(); - if (StrUtil.isNotEmpty(res)){ - JSONObject msgResponse = JSONObject.parseObject(res); - String errcode = msgResponse.getString("errcode"); - String errmsg = msgResponse.getString("errmsg"); - if ("0".equals(errcode)){ - return ok(); - }else { - return error(errmsg); - } - } - return this.error("操作失败"); - } - - /** - * 根据授权码获取用户信息 - * 单点登录的时候用 - * https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token=ACCESS_TOKEN&code=CODE - * - * @param json - * @return - */ - @Override - public JSONObject getUserInfoByAuthCode(JSONObject json) { - JSONObject jsonObject = json.getJSONObject("jsonStr"); - if (null == jsonObject){ - return this.error("参数不能为空"); - } - String access_token = jsonObject.getString("access_token"); - String code = jsonObject.getString("code"); - if (StrUtil.isEmpty(access_token)){ - //如果token为空,手动获取一次 - String corpid = jsonObject.getString("corpid"); - String corpsecret = jsonObject.getString("corpsecret"); - if (StrUtil.isEmpty(corpid)){ - this.error("corpid不能为空"); - } - if (StrUtil.isEmpty(corpsecret)){ - this.error("corpsecret不能为空"); - } - access_token = WeComAccessToken.getAccessToken(corpid, corpsecret); - } - if (StrUtil.isEmpty(code)){ - return error("code不能为空"); - } - String url = "https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token="+access_token+"&code="+code; - String res = HttpRequest.get(url).timeout(30000).execute().body(); - if (StrUtil.isNotEmpty(res)){ - JSONObject msgResponse = JSONObject.parseObject(res); - String errcode = msgResponse.getString("errcode"); - String errmsg = msgResponse.getString("errmsg"); - String userid = msgResponse.getString("userid"); - if ("0".equals(errcode)){ - return ok(userid); - }else { - return error(errmsg); - } - } - return null; - } - - /** - * 根据userid读取成员信息 - * https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&userid=USERID - * - * @param json - * @return - */ - @Override - public JSONObject getUserInfoByUserId(JSONObject json) { - JSONObject jsonObject = json.getJSONObject("jsonStr"); - if (null == jsonObject){ - return this.error("参数不能为空"); - } - String access_token = jsonObject.getString("access_token"); - String userid = jsonObject.getString("userid"); - if (StrUtil.isEmpty(access_token)){ - return error("access_token不能为空"); - } - if (StrUtil.isEmpty(userid)){ - return error("userid不能为空"); - } - String url = "https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token="+access_token+"&userid="+userid; - String res = HttpRequest.get(url).timeout(30000).execute().body(); - if (StrUtil.isNotEmpty(res)){ - JSONObject msgResponse = JSONObject.parseObject(res); - String errcode = msgResponse.getString("errcode"); - String errmsg = msgResponse.getString("errmsg"); - if ("0".equals(errcode)){ - return ok(res); - }else { - return error(errmsg); - } - } - return null; - } - - /** - * 根据手机号获取userid - * https://qyapi.weixin.qq.com/cgi-bin/user/getuserid?access_token=ACCESS_TOKEN - * - * @param json - * @return - */ - @Override - public JSONObject getUserIdByMobile(JSONObject json) { - JSONObject jsonObject = json.getJSONObject("jsonStr"); - if (null == jsonObject){ - return this.error("参数不能为空"); - } - String access_token = jsonObject.getString("access_token"); - String mobile = jsonObject.getString("mobile"); - if (StrUtil.isEmpty(access_token)){ - return error("access_token不能为空"); - } - if (StrUtil.isEmpty(mobile)){ - return error("mobile不能为空"); - } - String url = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserid?access_token="+access_token; - jsonObject.remove("access_token"); - String param = jsonObject.toString(); - String res = HttpRequest.post(url).body(param).timeout(30000).execute().body(); - if (StrUtil.isNotEmpty(res)){ - JSONObject msgResponse = JSONObject.parseObject(res); - String errcode = msgResponse.getString("errcode"); - String errmsg = msgResponse.getString("errmsg"); - String userid = msgResponse.getString("userid"); - if ("0".equals(errcode)){ - return ok(userid); - }else { - return error(errmsg); - } - } - return null; - } - - /** - * 成功 - * @return - */ - private static JSONObject ok(){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("code","200"); - jsonObject.put("msg","成功"); - jsonObject.put("data",""); - return jsonObject; - } - - /** - * 成功 - * @param data 返回数据 - * @return - */ - private static JSONObject ok(String data){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("code","200"); - jsonObject.put("msg","成功"); - jsonObject.put("data",data); - return jsonObject; - } - - /** - * 失败 - * @param msg 失败原因 - * @return - */ - private static JSONObject error(String msg){ - JSONObject jsonObject = new JSONObject(); - jsonObject.put("code","500"); - jsonObject.put("msg",msg); - jsonObject.put("data",""); - return jsonObject; - } -} diff --git a/fw-weixin/src/main/java/com/hzya/frame/wecom/util/WeComAccessToken.java b/fw-weixin/src/main/java/com/hzya/frame/wecom/util/WeComAccessToken.java deleted file mode 100644 index 78b6dc19..00000000 --- a/fw-weixin/src/main/java/com/hzya/frame/wecom/util/WeComAccessToken.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.hzya.frame.wecom.util; - -import cn.hutool.core.util.StrUtil; -import cn.hutool.http.HttpRequest; -import com.alibaba.fastjson.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import java.time.Instant; - -/** - * @Description 获取企业微信accesToken - * @Author xiangerlin - * @Date 2024/9/23 14:08 - **/ -public class WeComAccessToken { - - static Logger logger = LoggerFactory.getLogger(WeComAccessToken.class); - //token - private static String accessToken; - //过期时间 - private static Instant expireTime; - private static final Long CACHE_EXPIRY_TIME = 7000L; // 缓存有效时间(秒) - - - /** - * 获取accessToken - * - * @param corpid 企业ID - * @param corpsecret 应用的凭证密钥 - * @return - */ - public static String getAccessToken(String corpid,String corpsecret) { - //判断是否过期 如果没过期直接返回 - if (null != accessToken && expireTime != null && Instant.now().isBefore(expireTime)) { - return accessToken; - } - //获取新的accessToken - accessToken = fetchNewAccessToken(corpid,corpsecret); - //过期时间设置成当前事件+7000s,预留200s的时间 - expireTime = Instant.now().plusSeconds(CACHE_EXPIRY_TIME); - return accessToken; - } - - /** - * 获取信的token - * @param corpid - * @param corpsecret - * @return - */ - private static String fetchNewAccessToken(String corpid, String corpsecret) { - String url = " https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid="+corpid+"&corpsecret="+corpsecret; - String response = HttpRequest.get(url).timeout(30000).execute().body(); - if (StrUtil.isNotEmpty(response)){ - JSONObject json = JSONObject.parseObject(response); - String accessToken = json.getString("access_token"); - return accessToken; - } - return null; - } - - public static void main(String[] args) { - for (int i=0; i<2; i++){ - String accessToken1 = WeComAccessToken.getAccessToken("wwb46c3f5e6ffe3e2b", "oON2ELxNVyl7wc37LeA9bNOsv_jyuFXdrvD9e0yogbQ"); - System.out.println(accessToken1); - } - } -} diff --git a/fw-weixin/target/classes/com/hzya/frame/Main.class b/fw-weixin/target/classes/com/hzya/frame/Main.class deleted file mode 100644 index fcf604dc32d90998f8f726d809a0b84c22d4e9c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 576 zcmZuuyH3ME5S+`)u`whB!ut`R2^6?Nq5#n#A&T&jg3?f3k|Q}}`;g;+;IE(niGmN{ zqYz_*6p&)cyWZKonH}Hf*ZT*6J#0BBplV|d^F=H;Sj3WrWeY0;g+m?c_(&jI-);%y zj!jnylo~oz=fj|_qAS_FT9bh410 zi0mf3E-Vx+th!jkx`2DCeBaa_OyqYrEYw_VV3R6icBIN^v5WSt>csz`=Hnn%0soB| zvQhnUp^bM*3o(r-8PMiT%JCl-uQYZI^#6}s@#4CLBG|xmw Ij2X;+1H{>R5C8xG diff --git a/fw-weixin/target/classes/com/hzya/frame/wecom/Test.class b/fw-weixin/target/classes/com/hzya/frame/wecom/Test.class deleted file mode 100644 index 32e87025ee472c7091e1e997a4904190ce3d2942..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 279 zcmZ{ey>7xl5QJxqe}XZ=qC=_ZAVsc87nBBx%7Oxm{(Ky8$Ul-XLFBDcMWWyV@=#Is z5N&p)(axvc(f<5it^i&UhiIW2;4wgt;7?3xns-8LG+q(hX|>jbUSdi;KNgv;Q<>#V z`bni^zLK@E{tn${XAXp?L{){@eV(P*)Uwdxq%BDGp?M>O%j#GwJu^0@ZQ;vae#i(e zJi_4LQ$lR_L@vv%SY&&x8Vup^^R|ea16X}_;^qPG`5W}bz(K(3GX@^Gf#^1SXd`4t J=&(A7{s5q@I*0%O diff --git a/fw-weixin/target/classes/com/hzya/frame/wecom/service/IWeComService.class b/fw-weixin/target/classes/com/hzya/frame/wecom/service/IWeComService.class deleted file mode 100644 index 4914de8e1c430e2b1ec33525303f9954a4e994d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 428 zcmaiwy-veG5QOJK5`)7(;vIm3Yv`y*BBUTfkPMNz zGt&0@{9lK_;goD*qDNJ!f-F_FfbVkF5nNhurHUz_G7>nA$v)RqP0G0$Ha82Kj7&rV zCmVd_VE554jfTzCglW!BKQN0*)9p$ePhMzbih!zRs_8OQOC@mO&Pv`JzRB$*-^c+j zbso7f!RxyjnX59E>y7&Y0v&!F(CZ3pq074Glt3R~e| diff --git a/fw-weixin/target/classes/com/hzya/frame/wecom/service/impl/WeComServiceImpl.class b/fw-weixin/target/classes/com/hzya/frame/wecom/service/impl/WeComServiceImpl.class deleted file mode 100644 index cab0982e9d8e6924e4e2052c54105b875784532b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5880 zcmb7IX?RrS6@G7$nR{n42n-M$!6G7Q$ihU5ttKoI76Ah&0isl^H;Fqu1})vaftY2a=&xG<(%`K z_dVzPX5RUv|78F(@kc)v;F}t5@Z%zUOT!jFnsB3rR(Zck!xetqj9WB(Tf?n>+=i_( zzD>n{4-;A0bhGx3u@jW4EZiS00q^!~OEu zBaa8<@t_|M;bF1(h)mh5;aUy4hVS|DC>|5b-`B8D!v+nHYj{G#ld|du8rEyrui+^T zPiu&4ct*psDxMP^wEn!by&5bH2Q(x#9Mo_~#S4DCh>VKED*6<7V`fK(kyH?DHj^FU zRBYYM_2Fi_uaTp(qVcFTM?q=Tv^5IK=9}$?f|1S9xUoFl)n+7D>1{FgaB)PBtWt8ZpAru0$-{YRosgTAZFG?4ap# zJrXfesa56%Bd%aUm90gOMcec?D$-Nd`ji@Xp_GS%^gfs2^QM6_LjUxbtqNg9@d z5iOP;*|1Dc*byR9Dvpp+3Pvq6tWLB2GF<{>8A*n%yo)y0$7?(#uRuGVu5fbjTD){eRmkvYC^Fj zzRqmwnU}UY9f-YYcG}t;J7Wsw*(+#jbhfv>sb`tl78NRZyIi5f+@N4e)#<=;K~-M( zU0hCQU0J(s>D(2AV3NY6b|kb}k(kR`e~Xz;MvO(aW8;RBY`SnkL1<-~f$K8XL{m|c zcV0YhTDrhb5UQM{NC;DG@@_Jd8^S3fWSCY@!U(&ZB~v^b^;nwwAGK)+mjhUgB?L(5 z!Mz30k8Uz?VCT&zcK06d+kWzvW5@gYKi=OTKnmRf9K}m2js@^CUg0!{NBPqfR19(| ze?Y~n0lbFS12DzHm_e%N7#+YOT%ut7$sLCWcHWzpVFO$H|8~zF6>o?WZ<0M9A3FN+ z(Y*sN-8|68Dlx`oSH3v~XP(GxJ8{$V1Gn8e@Z6ChL;37092!69mjiWEIvQ)25;UjN zvJ$C=aJaiiPeiA0GNPNK@#)>&)1_WSI-+%L(RkQR3)YW#``mmhvjg}c-U{GHcsqa} z;~f?62JjQS7r;;D@iY89fM4K!6(2|s=X{7)0{EqbN~vce2JkCA}@RcAhhnIm>GF~bV|Wv*0;Vmkh7yhp5^oGY}`a5{Emq1YL! zU#oOf&ZcrFEen-j{6&;Is)m}FB-jj7mYJ0^>gxme4Svi0p4fKh!0me#fZZ3=*DIJI z%fHy!pyGD{{2qTGEQ3tS*4^r1^)1OS0R`(FCbB{^ii2m00w3SAW0gg#)SwT}JeGn9 zk$AW>ZJA~)%uF@HX)79&<7PEm7J_JMVOPTH;k^E>rqi_x7n;t`{9+FAw0w_@wE zw=pmOd_04G7Ia*guiN#kSdlH_{-~iB0s1n$wpE=;bCaC>jdDxy>WPGXXw?;2HSIG_ zxarThX_lFd^;n)8MO^bHjV^N|t84)lxeLJH3b#waS%X*z*~5$ZSSevn@r*1>n9|f2 z_4CvVxg;v*k)ATL{P%KedW95hUI)yumYEH78fg(DCJC`vnE)QLFqE3_6d|%w+74l;OVUm zdNWX$*9J8<4P|wG@a?fj{W2Qj9QVCk-s_|z(BP?V4SD)7qPM|w5F>-5LY^ZST?*<9 z$}C!M!sS?rGiX`-Y@h^8f{JtK=VXk<6imQ*d`?9*Dlr39oHLE9YUyzuS5C(&Zu(lB zZ|`j}S1x5}R#2;lBLU86p~OA8`xR*wR@1Ty9cw6+(84mbaz!caEW{O*%5WvuRG{p? z7^`CK|8Ta7uk$lp;tR24E;5cbLgJG-~ z62|fNJA>zj^-Os`iqMsZaaM3b1`|UbJ~BAF!D}n~QfqAnlN!{Jw-4up)C?w%PSWw2ldicHuyrm;FrY%KZPn0%7fEF{tT-3Kl^}fF~c{Hfonny<`bX=1ZWZ8E+G(082+VLOK1`d@g@@P212u&5qp?H z-pA2r2~UQRe3d}FNf6$#X9L$!`#u7G4f}nZbv7ZsoLtY)qE4w?;+%u@{T!t4<{&+c zHqH}BpGSmJ8U1?_?UX$9rVR!qFa24Kb(BO!|!I9FE~A)3}Nzs zlP3lV_ry?{%LGq3q5#% zFz>_lc#1Ie;zm1z6O7CjX0rgVa%PncJbx@;RS@8PTvdVfl>8FG90d;MDDZTS0{7W) z3k7!4JE6eU)GELW1)6NQy*Auy;K^qC1P8zopK?k0DWG;iwsHQH%G9Fs=wAT=VmSi5 zNCJra`-dffjl?Mk@RfW5%*+ztg3~0xj8hUI4|j5;2=2=5Z>5KA^ZYYLy8~jBP%;k8IbneQcS)#dhzkgUX zzdB4he=Q%)3tcp&w0rVPyH_&$oDh%U!qUz>cGH?|rBr$+t$h^iwDwc5$s{%2=cYC5 zJK?nt@4U2L%j5!+QN;nmdyw$HKzLsyyj+IEg!c&H?I*l1v2q_{wSJjky+VjzWdgs3 zt$3Y;c!R*diO2Xg^BKHFEpMX_@7hpHUEk`aH-7|l)7!`SPI~*f%1Li2ko`H(`*WZl z%7MN&2l{<1IFjBi1lmdOYw4NPbuT@05?!?u{iF)4PI;uQevG;TLmi%@BvSx4>6kG zzt7_L?kV`lj-y=SG@gobfss2Pf5_k}G1f_AC2Y@gjWyR~jn!n0)dc5Oi>;cWw*Ew& zf2OU!(AHmZE{@x_Dja=CGM?a!iMCZGyW6Dg0DqAg&VhNhz2I!eZqVKAXB_xD)&GMI z{FA=~|BDX%yTAdfxC55$RXTSEo@@sj@CBRtF#ixn$~{=gy9djLHnOjTXVGT1KA6#j-?m}MM;E`mWM-l72%#t3Kxqfta%vn(n|G&eFk^e%(5JIl;07jsWE z_xs&kUQ(6HtI?{JN~-dhhdkte*gs zg{L5%biJ(MJDJ{TBN@sD6s$5WOZfhndqL!-%CtFa8jhLI8l!<{=d)DN#C*Z_#F(8E z3L48A0Y8jH-Ve-tK$W$FhX+p#O$?nol{j;LVk|K{q+m^zt)v@Tsykrk?ckt-NPEY) zg6N<-Ns|ppJ1IOL6t9|wGNLsE}uqPQ2x$uSMi9o^X(ZIAW z44Z`t&Nag#m~tminG#(fJYsIlh`^dkiMeG+qSL<1m~ROkG95c@rs_@MTPV7`MuVVoh zbv%pb6s*6UVMmI#Gb#Dmw|OcE3Vy#~%q*A%yL(R9^LD;_W~N&v*vi^nX*+K)pMfOn zp>i@F*6}=Eptn1gazfdQcuB>}I$pu6IxgX|j@R(IiZ^t;DR zO@x+pe1H#0!nwJ0?_R4X(VsCFfJ)3(medt7l(Q9NwQ!jrg+@ z(+kC8=O(?`qx;3~1vi^Mt)mCMDn8QjF+Nf8sgBR^xq{CB&tDZ^=(vI}b=;5bI=;f! zEUTsXmFcleR3e8=l43F2KO!=&$80xON@STv$Kx!frMqQC zE2wukjhjx9r&!Y`*-r{i(H~_=<|oOr=Jt~--&SW93L?)^>RO>3?<~FwMs=BxzWfIo{G38d)x8rV3KYVQXw!>1KAu^|!x+$4o15Jw{LBE527i|rvJ!$%KW_$+VZlN?1%Rxwwa?3m%qrpbAO?2?>o z!PgC49J~2ta8{(W^9Gb3xTv8Bs0)P+*v++GR=|VU!>@YTZm1;>Uq*y0;34H2YQ96u zHAH?v<07J5lu&yGD&T0*RZ`s;|uEuM{p_caq1uoW$IqK&|}v(xty zw!FW&dHhEvcyl&&fmbQxL(5QPX6Ne zaM;OT2@S)$7O`e+ad!!8ONf`ynCe=@x+`en)YKnsiN>2tSl?gUQhQZdf_xuT8tx(7 zUIwF&|Mp^lppFvHarB4K5AyN>2C$!Flsl0yC(_l#Eq4+XciNbh19VJ=wiOR^6$xEj z1?4XsS8as&|3Q~?v39YZ&}2K;cIB!Rl>$git_zGzsn3) zNBkh2ID`foX{Pm!I1<9%Oq~Yq91h{skUB>&7_y*^P7Kk8jD0<7{zQ%P2a_f Date: Tue, 24 Sep 2024 16:17:58 +0800 Subject: [PATCH 19/67] =?UTF-8?q?=E6=8F=92=E4=BB=B6=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8F=92=E4=BB=B6=E7=B1=BB=E5=9E=8B=E3=80=81?= =?UTF-8?q?=E9=9B=86=E6=88=90=E4=BB=BB=E5=8A=A1=E6=97=A5=E5=BF=97=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E6=A0=B9=E6=8D=AE=E6=8F=92=E4=BB=B6=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E4=BB=BB=E5=8A=A1=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/SysApplicationPluginDto.java | 10 + .../entity/SysApplicationPluginEntity.java | 22 +- .../entity/SysApplicationPluginEntity.xml | 77 ++++--- .../dao/ISysApplicationPluginTypeDao.java | 15 ++ .../impl/SysApplicationPluginTypeDaoImpl.java | 17 ++ .../SysApplicationPluginTypeEntity.java | 25 +++ .../entity/SysApplicationPluginTypeEntity.xml | 201 ++++++++++++++++++ .../ISysApplicationPluginTypeService.java | 22 ++ .../SysApplicationPluginTypeServiceImpl.java | 106 +++++++++ 9 files changed, 463 insertions(+), 32 deletions(-) create mode 100644 base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/dao/ISysApplicationPluginTypeDao.java create mode 100644 base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/dao/impl/SysApplicationPluginTypeDaoImpl.java create mode 100644 base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/entity/SysApplicationPluginTypeEntity.java create mode 100644 base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/entity/SysApplicationPluginTypeEntity.xml create mode 100644 base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/service/ISysApplicationPluginTypeService.java create mode 100644 base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/service/impl/SysApplicationPluginTypeServiceImpl.java diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginDto.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginDto.java index 54a3dc3f..8825215f 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginDto.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginDto.java @@ -20,6 +20,16 @@ public class SysApplicationPluginDto { private Integer pageNum; private Integer pageSize; + private String typeId; + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + public String getAppId() { return appId; } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.java index 5929e14b..79b8c326 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.java @@ -22,13 +22,33 @@ public class SysApplicationPluginEntity extends BaseEntity { private String pluginVersion; /** 描述 */ private String pluginRemark; + /** 插件类型id */ + private String typeId; + /** 插件类型名称 */ + private String typeName; /** 发布日期 */ private Date releaseDate; /** 启用停用(1启用2停用) */ private String pluginStatus; - + /** 附件id */ private String attachmentId; + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public String getTypeId() { + return typeId; + } + + public void setTypeId(String typeId) { + this.typeId = typeId; + } + public String getPluginPackageName() { return pluginPackageName; } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.xml b/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.xml index 90b5444d..5ba4c199 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/plugin/entity/SysApplicationPluginEntity.xml @@ -20,6 +20,8 @@ + + @@ -40,6 +42,7 @@ ,org_id ,attachment_id ,plugin_package_name + ,type_id - select - - from sys_application_plugin + SELECT + p.*, + type.NAME AS type_name + FROM + sys_application_plugin p + LEFT JOIN sys_application_plugin_type type ON p.type_id = type.id - and id like concat('%',#{id},'%') - and app_id like concat('%',#{appId},'%') - and plugin_name like concat('%',#{pluginName},'%') - and plugin_code like concat('%',#{pluginCode},'%') - and plugin_version like concat('%',#{pluginVersion},'%') - and plugin_remark like concat('%',#{pluginRemark},'%') - and release_date like concat('%',#{releaseDate},'%') - and plugin_status like concat('%',#{pluginStatus},'%') - and sorts like concat('%',#{sorts},'%') - and create_user_id like concat('%',#{create_user_id},'%') - and create_time like concat('%',#{create_time},'%') - and modify_user_id like concat('%',#{modify_user_id},'%') - and modify_time like concat('%',#{modify_time},'%') - and sts like concat('%',#{sts},'%') - and org_id like concat('%',#{org_id},'%') - and attachment_id like concat('%',#{attachmentId},'%') - and plugin_package_name like concat('%',#{pluginPackageName},'%') - and sts='Y' + and p.id like concat('%',#{id},'%') + and p.app_id like concat('%',#{appId},'%') + and p.plugin_name like concat('%',#{pluginName},'%') + and p.plugin_code like concat('%',#{pluginCode},'%') + and p.plugin_version like concat('%',#{pluginVersion},'%') + and p.plugin_remark like concat('%',#{pluginRemark},'%') + and p.release_date like concat('%',#{releaseDate},'%') + and p.plugin_status like concat('%',#{pluginStatus},'%') + and p.sorts like concat('%',#{sorts},'%') + and p.create_user_id like concat('%',#{create_user_id},'%') + and p.create_time like concat('%',#{create_time},'%') + and p.modify_user_id like concat('%',#{modify_user_id},'%') + and p.modify_time like concat('%',#{modify_time},'%') + and p.sts like concat('%',#{sts},'%') + and p.org_id like concat('%',#{org_id},'%') + and p.attachment_id like concat('%',#{attachmentId},'%') + and p.plugin_package_name like concat('%',#{pluginPackageName},'%') + and p.type_id like concat('%',#{typeId},'%') + and p.sts='Y' - order by sorts asc + order by p.sorts asc order by ${sort} ${order} @@ -182,6 +190,7 @@ org_id , attachment_id , plugin_package_name , + type_id , sts, )values( @@ -203,6 +212,7 @@ #{org_id} , #{attachmentId} , #{pluginPackageName} , + #{typeId} , 'Y', ) @@ -254,9 +264,10 @@ update sys_application_plugin set modify_user_id = #{modify_user_id}, modify_time = #{modify_time}, sts = #{sts}, - org_id = #{org_id}, + org_id = #{org_id}, attachment_id = #{attachmentId}, plugin_package_name = #{pluginPackageName}, + type_id = #{typeId}, where id = #{id} @@ -291,16 +302,20 @@ update sys_application_plugin set sts= 'N' ,modify_time = #{modify_time},modify diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/dao/ISysApplicationPluginTypeDao.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/dao/ISysApplicationPluginTypeDao.java new file mode 100644 index 00000000..2578639c --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/dao/ISysApplicationPluginTypeDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.sysnew.application.pluginType.dao; + +import com.hzya.frame.sysnew.application.pluginType.entity.SysApplicationPluginTypeEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 插件类型表(sys_application_plugin_type: table)表数据库访问层 + * + * @author makejava + * @since 2024-09-19 09:56:24 + */ +public interface ISysApplicationPluginTypeDao extends IBaseDao { + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/dao/impl/SysApplicationPluginTypeDaoImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/dao/impl/SysApplicationPluginTypeDaoImpl.java new file mode 100644 index 00000000..78e7ac17 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/dao/impl/SysApplicationPluginTypeDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.sysnew.application.pluginType.dao.impl; + +import com.hzya.frame.sysnew.application.pluginType.entity.SysApplicationPluginTypeEntity; +import com.hzya.frame.sysnew.application.pluginType.dao.ISysApplicationPluginTypeDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 插件类型表(SysApplicationPluginType)表数据库访问层 + * + * @author makejava + * @since 2024-09-19 09:56:24 + */ +@Repository(value = "SysApplicationPluginTypeDaoImpl") +public class SysApplicationPluginTypeDaoImpl extends MybatisGenericDao implements ISysApplicationPluginTypeDao{ + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/entity/SysApplicationPluginTypeEntity.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/entity/SysApplicationPluginTypeEntity.java new file mode 100644 index 00000000..b8362993 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/entity/SysApplicationPluginTypeEntity.java @@ -0,0 +1,25 @@ +package com.hzya.frame.sysnew.application.pluginType.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 插件类型表(SysApplicationPluginType)实体类 + * + * @author makejava + * @since 2024-09-19 09:56:24 + */ +public class SysApplicationPluginTypeEntity extends BaseEntity { + + /** 插件类型名称 */ + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/entity/SysApplicationPluginTypeEntity.xml b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/entity/SysApplicationPluginTypeEntity.xml new file mode 100644 index 00000000..f48b07c9 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/entity/SysApplicationPluginTypeEntity.xml @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + id + ,name + ,sorts + ,org_id + ,sts + ,create_time + ,create_user_id + ,modify_time + ,modify_user_id + + + + + + + + + + + + + + + + insert into sys_application_plugin_type( + + id , + name , + sorts , + org_id , + sts , + create_time , + create_user_id , + modify_time , + modify_user_id , + sts, + + )values( + + #{id} , + #{name} , + #{sorts} , + #{org_id} , + #{sts} , + #{create_time} , + #{create_user_id} , + #{modify_time} , + #{modify_user_id} , + 'Y', + + ) + + + + insert into sys_application_plugin_type(app_id, name, org_id, sts, create_time, create_user_id, modify_time, modify_user_id, sts) + values + + (#{entity.appId},#{entity.name},#{entity.org_id},#{entity.sts},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id}, 'Y') + + + + + insert into sys_application_plugin_type(app_id, name, org_id, sts, create_time, create_user_id, modify_time, modify_user_id) + values + + (#{entity.appId},#{entity.name},#{entity.org_id},#{entity.sts},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id}) + + on duplicate key update + app_id = values(app_id), + name = values(name), + org_id = values(org_id), + sts = values(sts), + create_time = values(create_time), + create_user_id = values(create_user_id), + modify_time = values(modify_time), + modify_user_id = values(modify_user_id) + + +update sys_application_plugin_type set + + name = #{name}, + org_id = #{org_id}, + sts = #{sts}, + create_time = #{create_time}, + create_user_id = #{create_user_id}, + modify_time = #{modify_time}, + modify_user_id = #{modify_user_id}, + +where id = #{id} + + + +update sys_application_plugin_type set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update sys_application_plugin_type set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and name = #{name} + and sorts = #{sorts} + and sts = #{sts} + and sts='Y' + + + + + delete from sys_application_plugin_type where id = #{id} + + + + diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/service/ISysApplicationPluginTypeService.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/service/ISysApplicationPluginTypeService.java new file mode 100644 index 00000000..dfee99d3 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/service/ISysApplicationPluginTypeService.java @@ -0,0 +1,22 @@ +package com.hzya.frame.sysnew.application.pluginType.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.application.pluginType.entity.SysApplicationPluginTypeEntity; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * 插件类型表(SysApplicationPluginType)表服务接口 + * + * @author makejava + * @since 2024-09-19 09:56:24 + */ +public interface ISysApplicationPluginTypeService extends IBaseService{ + JsonResultEntity queryPluginType(JSONObject jsonObject); + + JsonResultEntity savePluginType(JSONObject jsonObject); + + JsonResultEntity updatePluginType(JSONObject jsonObject); + + JsonResultEntity deletePluginType(JSONObject jsonObject); +} diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/service/impl/SysApplicationPluginTypeServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/service/impl/SysApplicationPluginTypeServiceImpl.java new file mode 100644 index 00000000..d6c00bc1 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/pluginType/service/impl/SysApplicationPluginTypeServiceImpl.java @@ -0,0 +1,106 @@ +package com.hzya.frame.sysnew.application.pluginType.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; +import com.hzya.frame.sysnew.application.plugin.dao.ISysApplicationPluginDao; +import com.hzya.frame.sysnew.application.plugin.entity.SysApplicationPluginEntity; +import com.hzya.frame.sysnew.application.pluginType.entity.SysApplicationPluginTypeEntity; +import com.hzya.frame.sysnew.application.pluginType.dao.ISysApplicationPluginTypeDao; +import com.hzya.frame.sysnew.application.pluginType.service.ISysApplicationPluginTypeService; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 插件类型表(SysApplicationPluginType)表服务实现类 + * + * @author makejava + * @since 2024-09-19 09:56:24 + */ +@Service(value = "sysApplicationPluginTypeService") +public class SysApplicationPluginTypeServiceImpl extends BaseService implements ISysApplicationPluginTypeService { + + private ISysApplicationPluginTypeDao sysApplicationPluginTypeDao; + + @Resource + private ISysApplicationPluginDao sysApplicationPluginDao; + + @Autowired + public void setSysApplicationPluginTypeDao(ISysApplicationPluginTypeDao dao) { + this.sysApplicationPluginTypeDao = dao; + this.dao = dao; + } + + @Override + public JsonResultEntity queryPluginType(JSONObject jsonObject){ + SysApplicationPluginTypeEntity entity = getData("jsonStr", jsonObject, SysApplicationPluginTypeEntity.class); + if(entity == null){ + entity = new SysApplicationPluginTypeEntity(); + } + List list = sysApplicationPluginTypeDao.queryByLike(entity); + return BaseResult.getSuccessMessageEntity("查询数据成功",list); + } + + @Override + public JsonResultEntity savePluginType(JSONObject jsonObject) { + SysApplicationPluginTypeEntity entity = getData("jsonStr", jsonObject, SysApplicationPluginTypeEntity.class); + if(entity == null){ + return BaseResult.getFailureMessageEntity("参数错误"); + } + if(entity.getName() == null || "".equals(entity.getName())){ + return BaseResult.getFailureMessageEntity("插件类型名称不能为空"); + } + entity.setCreate(); + sysApplicationPluginTypeDao.save(entity); + return BaseResult.getSuccessMessageEntity("保存数据成功",entity); + } + + @Override + public JsonResultEntity updatePluginType(JSONObject jsonObject) { + SysApplicationPluginTypeEntity entity = getData("jsonStr", jsonObject, SysApplicationPluginTypeEntity.class); + if(entity == null){ + return BaseResult.getFailureMessageEntity("参数错误"); + } + if(entity.getId() == null || "".equals(entity.getId())){ + return BaseResult.getFailureMessageEntity("ID不能为空"); + } + if(entity.getName() == null || "".equals(entity.getName())){ + return BaseResult.getFailureMessageEntity("插件类型名称不能为空"); + } + entity.setUpdate(); + sysApplicationPluginTypeDao.update(entity); + return BaseResult.getSuccessMessageEntity("更新数据成功",entity); + } + + @Transactional + @Override + public JsonResultEntity deletePluginType(JSONObject jsonObject) { + SysApplicationPluginTypeEntity entity = getData("jsonStr", jsonObject, SysApplicationPluginTypeEntity.class); + if(entity == null){ + return BaseResult.getFailureMessageEntity("参数错误"); + } + if(entity.getId() == null || "".equals(entity.getId())){ + return BaseResult.getFailureMessageEntity("ID不能为空"); + } + // 同步删除匹配插件中的插件类型,将其赋值为null + SysApplicationPluginEntity pluginEntity = new SysApplicationPluginEntity(); + pluginEntity.setTypeId(entity.getId()); + List pluginList = sysApplicationPluginDao.queryBase(pluginEntity); + for(SysApplicationPluginEntity plugin : pluginList){ + plugin.setTypeId("无"); + plugin.setUpdate(); + sysApplicationPluginDao.update(plugin); + } + entity.setUpdate(); + sysApplicationPluginTypeDao.logicRemove(entity); + return BaseResult.getSuccessMessageEntity("删除数据成功"); + } + + +} From aa591dc1ff252a99a69085de799aeee620c71d04 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 25 Sep 2024 15:19:16 +0800 Subject: [PATCH 20/67] =?UTF-8?q?fix:=20=E8=B0=83=E7=94=A8=E5=AE=8C?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=8E=88=E6=9D=83=E7=A0=81=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E5=90=8E=20=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E8=BF=94=E5=9B=9E=E6=8A=A5=E6=96=87=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sysnew/login/impl/LoginServiceImpl.java | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java index 95ff3251..c0ba52e8 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java @@ -221,22 +221,15 @@ public class LoginServiceImpl implements ILoginService { params.put("corpid",entity.getString("corpid")); params.put("corpsecret",entity.getString("corpsecret")); params.put("access_token",entity.getString("access_token")); - String res = HttpRequest.post(url). - header("appId",appId). - header("apiCode",userApiCode). - header("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"). - header("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). - body(params.toJSONString()). - execute(). - body(); + String res = ""; JSONObject resJsonObject = JSONObject.parseObject(res); JSONObject attribute = resJsonObject.getJSONObject("attribute"); - String errcode = attribute.getString("errcode"); - String errmsg = attribute.getString("errmsg"); - if(!"0".equals(errcode)){ - return BaseResult.getFailureMessageEntity("请求错误:"+errmsg); + String attributeCode = attribute.getString("code"); + String attributeMsg = attribute.getString("msg"); + if(!"200".equals(attributeCode)){ + return BaseResult.getFailureMessageEntity("请求错误:"+attributeMsg); } - String weComUserid = attribute.getString("userid"); + String weComUserid = attribute.getString("data"); userEntity.setWxUserId(weComUserid); userEntity = sysUserDao.queryOne(userEntity); if(null == userEntity ){ From 90386c59a5aaf7a39403b284fb112801db23a5a0 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 25 Sep 2024 15:26:41 +0800 Subject: [PATCH 21/67] =?UTF-8?q?fix:=20=E8=B0=83=E7=94=A8=E5=AE=8C?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=8E=88=E6=9D=83=E7=A0=81=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E5=90=8E=20=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E8=BF=94=E5=9B=9E=E6=8A=A5=E6=96=87=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzya/frame/sysnew/login/impl/LoginServiceImpl.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java index c0ba52e8..053d3976 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java @@ -221,7 +221,14 @@ public class LoginServiceImpl implements ILoginService { params.put("corpid",entity.getString("corpid")); params.put("corpsecret",entity.getString("corpsecret")); params.put("access_token",entity.getString("access_token")); - String res = ""; + String res = HttpRequest.post(url). + header("appId",appId). + header("apiCode",userApiCode). + header("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"). + header("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). + body(params.toJSONString()). + execute(). + body(); JSONObject resJsonObject = JSONObject.parseObject(res); JSONObject attribute = resJsonObject.getJSONObject("attribute"); String attributeCode = attribute.getString("code"); From 5eea8dfb96b4c6136c6646fbcad643d46dd2dac7 Mon Sep 17 00:00:00 2001 From: username Date: Wed, 25 Sep 2024 16:15:11 +0800 Subject: [PATCH 22/67] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=EF=BC=8C=E5=8E=86=E5=8F=B2=E6=B6=88=E6=81=AF=E6=8C=89=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E6=97=B6=E9=97=B4=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/SysSendMessageLogEntity.xml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.xml b/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.xml index b0e9b621..01decd67 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.xml @@ -94,14 +94,15 @@ and log.source_model_name = #{sourceModelName} and log.state = #{state} and log.result_message = #{resultMessage} - and app_id = #{appId} + and i.app_id = #{appId} and log.sts='Y' and p1.sts='Y' and p2.sts='Y' and i.sts='Y' - order by log.sorts asc - order by ${sort} ${order} + + + order by log.send_datetime desc @@ -178,8 +179,9 @@ and p2.sts='Y' and app.sts='Y' - order by log.sorts asc - order by ${sort} ${order} + + + order by log.send_datetime desc From 23d06b59bb6b1afa7230d4ad2d45d04d9343b1cd Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Wed, 25 Sep 2024 16:52:00 +0800 Subject: [PATCH 23/67] =?UTF-8?q?=E9=9B=86=E6=88=90=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=8A=B6=E6=80=81=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ysIntegratedForegroundTaskServiceImpl.java | 15 +++++++++++ ...tegratedForegroundTaskParameterEntity.java | 11 +++++++- ...ntegratedForegroundTaskParameterEntity.xml | 26 ++++++++++++++----- 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTask/service/impl/SysIntegratedForegroundTaskServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTask/service/impl/SysIntegratedForegroundTaskServiceImpl.java index 7ca8544c..5a9fa93e 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTask/service/impl/SysIntegratedForegroundTaskServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTask/service/impl/SysIntegratedForegroundTaskServiceImpl.java @@ -106,17 +106,24 @@ public class SysIntegratedForegroundTaskServiceImpl extends BaseService { try { pluginBaseEntity.executeBusiness(jsonObject); + sysIntegratedForegroundTaskParameterEntity.setStatus("2"); + sysIntegratedForegroundTaskParameterEntity.setModify_time(new Date()); + sysIntegratedForegroundTaskParameterDao.update(sysIntegratedForegroundTaskParameterEntity); } catch (Exception e) { logger.error("插件:"+entity.getPlugId()+"执行失败:"+e.getMessage()); } }); }else { + sysIntegratedForegroundTaskParameterEntity.setStatus("2"); + sysIntegratedForegroundTaskParameterEntity.setModify_time(new Date()); + sysIntegratedForegroundTaskParameterDao.update(sysIntegratedForegroundTaskParameterEntity); return BaseResult.getSuccessMessageEntity("提交成功,当前任务执行失败,请联系系统管理员"); } return BaseResult.getSuccessMessageEntity("提交成功,执行结果请去查看任务日志"); @@ -171,17 +178,25 @@ public class SysIntegratedForegroundTaskServiceImpl extends BaseService { try { pluginBaseEntity.executeBusiness(jsonObject); + sysIntegratedForegroundTaskParameterEntity.setStatus("2"); + sysIntegratedForegroundTaskParameterEntity.setModify_time(new Date()); + sysIntegratedForegroundTaskParameterDao.update(sysIntegratedForegroundTaskParameterEntity); } catch (Exception e) { logger.error("插件:"+entity.getPlugId()+"执行失败:"+e.getMessage()); } }); }else { + sysIntegratedForegroundTaskParameterEntity.setStatus("2"); + sysIntegratedForegroundTaskParameterEntity.setModify_time(new Date()); + sysIntegratedForegroundTaskParameterDao.update(sysIntegratedForegroundTaskParameterEntity); return BaseResult.getSuccessMessageEntity("提交成功,当前任务执行失败,请联系系统管理员"); } return BaseResult.getSuccessMessageEntity("提交成功,执行结果请去查看任务日志"); diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTaskParameter/entity/SysIntegratedForegroundTaskParameterEntity.java b/base-service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTaskParameter/entity/SysIntegratedForegroundTaskParameterEntity.java index 3ae60fda..f4907e2b 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTaskParameter/entity/SysIntegratedForegroundTaskParameterEntity.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTaskParameter/entity/SysIntegratedForegroundTaskParameterEntity.java @@ -20,7 +20,8 @@ public class SysIntegratedForegroundTaskParameterEntity extends BaseEntity { private String inParameter; /** 备注 */ private String remark; - + /** 任务状态 1、执行中 2、执行完成 */ + private String status; public String getFormmainId() { return formmainId; @@ -53,5 +54,13 @@ public class SysIntegratedForegroundTaskParameterEntity extends BaseEntity { this.setCreate_time(new Date()); this.setModify_time(new Date()); } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTaskParameter/entity/SysIntegratedForegroundTaskParameterEntity.xml b/base-service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTaskParameter/entity/SysIntegratedForegroundTaskParameterEntity.xml index 4421e1d0..fc6a59bf 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTaskParameter/entity/SysIntegratedForegroundTaskParameterEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sysnew/integratedForegroundTaskParameter/entity/SysIntegratedForegroundTaskParameterEntity.xml @@ -7,7 +7,9 @@ - + + + @@ -21,7 +23,8 @@ ,formmain_id ,in_parameter ,remark - ,sorts + ,status + ,sorts ,create_user_id ,create_time ,modify_user_id @@ -39,6 +42,7 @@ and formmain_id = #{formmainId} and in_parameter = #{inParameter} and remark = #{remark} + and status = #{status} and sorts = #{sorts} and create_user_id = #{create_user_id} and create_time = #{create_time} @@ -60,6 +64,7 @@ and formmain_id = #{formmainId} and in_parameter = #{inParameter} and remark = #{remark} + and status = #{status} and sorts = #{sorts} and create_user_id = #{create_user_id} and create_time = #{create_time} @@ -83,6 +88,7 @@ and formmain_id like concat('%',#{formmainId},'%') and in_parameter like concat('%',#{inParameter},'%') and remark like concat('%',#{remark},'%') + and status like concat('%',#{status},'%') and sorts like concat('%',#{sorts},'%') and create_user_id like concat('%',#{create_user_id},'%') and create_time like concat('%',#{create_time},'%') @@ -106,6 +112,7 @@ or formmain_id = #{formmainId} or in_parameter = #{inParameter} or remark = #{remark} + or status = #{status} or sorts = #{sorts} or create_user_id = #{create_user_id} or create_time = #{create_time} @@ -127,6 +134,7 @@ formmain_id , in_parameter , remark , + status , sorts , create_user_id , create_time , @@ -142,6 +150,7 @@ #{formmainId} , #{inParameter} , #{remark} , + #{status} , #{sorts} , #{create_user_id} , #{create_time} , @@ -155,23 +164,24 @@ - insert into sys_integrated_foreground_task_parameter(formmain_id, in_parameter, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts) + insert into sys_integrated_foreground_task_parameter(formmain_id, in_parameter, remark, status, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, sts) values - (#{entity.formmainId},#{entity.inParameter},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}, 'Y') + (#{entity.formmainId},#{entity.inParameter},#{entity.remark},#{entity.status},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}, 'Y') - insert into sys_integrated_foreground_task_parameter(formmain_id, in_parameter, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) + insert into sys_integrated_foreground_task_parameter(formmain_id, in_parameter, remark,status, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id) values - (#{entity.formmainId},#{entity.inParameter},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}) + (#{entity.formmainId},#{entity.inParameter},#{entity.remark},#{entity.status},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id}) on duplicate key update formmain_id = values(formmain_id), in_parameter = values(in_parameter), remark = values(remark), + status = values(status), sorts = values(sorts), create_user_id = values(create_user_id), create_time = values(create_time), @@ -186,6 +196,7 @@ update sys_integrated_foreground_task_parameter set formmain_id = #{formmainId}, in_parameter = #{inParameter}, remark = #{remark}, + status = #{status}, sorts = #{sorts}, create_user_id = #{create_user_id}, create_time = #{create_time}, @@ -209,6 +220,7 @@ update sys_integrated_foreground_task_parameter set sts= 'N' ,modify_time = #{m and formmain_id = #{formmainId} and in_parameter = #{inParameter} and remark = #{remark} + and status = #{status} and sorts = #{sorts} and sts = #{sts} and sts='Y' @@ -226,6 +238,7 @@ update sys_integrated_foreground_task_parameter set sts= 'N' ,modify_time = #{m ,a.formmain_id ,a.in_parameter ,a.remark + ,a.status ,a.sorts ,p.person_name as create_user_id ,a.create_time @@ -241,6 +254,7 @@ update sys_integrated_foreground_task_parameter set sts= 'N' ,modify_time = #{m and a.formmain_id = #{formmainId} and a.in_parameter = #{inParameter} and a.remark = #{remark} + and a.status = #{status} and a.sorts = #{sorts} and a.create_user_id = #{create_user_id} and a.create_time = #{create_time} From ed5d7fff6906471d6017d91c7daa3249db53878d Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Mon, 30 Sep 2024 11:20:30 +0800 Subject: [PATCH 24/67] =?UTF-8?q?feat:=20token=E5=90=8D=E5=AD=97=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=EF=BC=8C=E7=94=B1token=E5=8F=98=E6=9B=B4=E4=B8=BAzt-t?= =?UTF-8?q?oken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzya/frame/sysnew/login/impl/LoginServiceImpl.java | 2 +- .../webapp/entrance/service/impl/EntranceServiceImpl.java | 4 ++-- .../frame/webapp/web/exception/ExceptionController.java | 8 ++++---- .../hzya/frame/webapp/web/filter/SaTokenConfigure.java | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java index 053d3976..211a2be2 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java @@ -151,7 +151,7 @@ public class LoginServiceImpl implements ILoginService { List sysOrganEntities = sysOrganDao.queryUserCompany(sysOrganEntity); //返回值 JSONObject res = new JSONObject(); - res.put("token", token); + res.put("zt-token", token); res.put("userInfo", sysUserEntity); res.put("company", sysOrganEntities); diff --git a/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java b/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java index ea5f4c44..3370c059 100644 --- a/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java +++ b/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java @@ -117,8 +117,8 @@ public class EntranceServiceImpl implements IEntranceService { //} // 接口权限验证 结束 } catch (NotLoginException e) { - logger.error("token无效"); - return BaseResult.getFailureMessageEntity("token无效"); + logger.error("zt-token无效"); + return BaseResult.getFailureMessageEntity("zt-token无效"); } } JSONObject jsonObject = new JSONObject(); diff --git a/base-webapp/src/main/java/com/hzya/frame/webapp/web/exception/ExceptionController.java b/base-webapp/src/main/java/com/hzya/frame/webapp/web/exception/ExceptionController.java index 3e966cf1..6488d4fd 100644 --- a/base-webapp/src/main/java/com/hzya/frame/webapp/web/exception/ExceptionController.java +++ b/base-webapp/src/main/java/com/hzya/frame/webapp/web/exception/ExceptionController.java @@ -63,13 +63,13 @@ public class ExceptionController { if (notLoginException.getType().equals(NotLoginException.NOT_TOKEN)) { message = "未提供token"; } else if (notLoginException.getType().equals(NotLoginException.INVALID_TOKEN)) { - message = "token无效"; + message = "zt-token无效"; } else if (notLoginException.getType().equals(NotLoginException.TOKEN_TIMEOUT)) { - message = "token已过期"; + message = "zt-token已过期"; } else if (notLoginException.getType().equals(NotLoginException.BE_REPLACED)) { - message = "token已被顶下线"; + message = "zt-token已被顶下线"; } else if (notLoginException.getType().equals(NotLoginException.KICK_OUT)) { - message = "token已被踢下线"; + message = "zt-token已被踢下线"; } else { message = "当前会话未登录"; } diff --git a/base-webapp/src/main/java/com/hzya/frame/webapp/web/filter/SaTokenConfigure.java b/base-webapp/src/main/java/com/hzya/frame/webapp/web/filter/SaTokenConfigure.java index b325e29f..3411d439 100644 --- a/base-webapp/src/main/java/com/hzya/frame/webapp/web/filter/SaTokenConfigure.java +++ b/base-webapp/src/main/java/com/hzya/frame/webapp/web/filter/SaTokenConfigure.java @@ -18,7 +18,7 @@ public class SaTokenConfigure { @Primary public SaTokenConfig getSaTokenConfigPrimary() { SaTokenConfig config = new SaTokenConfig(); - config.setTokenName("token"); // token名称 (同时也是cookie名称) + config.setTokenName("zt-token"); // token名称 (同时也是cookie名称) config.setTimeout(30 * 24 * 60 * 60); // token有效期,单位s 默认30天 config.setActivityTimeout(-1); // token临时有效期 (指定时间内无操作就视为token过期) 单位: 秒 config.setIsConcurrent(true); // 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录) From c943cd82fb9481ed0124b1ccc0ff86d77a893519 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Tue, 22 Oct 2024 14:33:30 +0800 Subject: [PATCH 25/67] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E5=A4=87=E4=BB=BD=EF=BC=8C=E5=A4=87=E4=BB=BD=E5=90=8E?= =?UTF-8?q?=E7=94=A8sftp=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + .../plugin/BackUpDatabaseInitializer.java | 386 ++++++++++++++++++ .../src/main/resources/application-llg.yml | 20 +- .../src/main/resources/application.yml | 14 + .../plugin/BackUpDatabase/pluginCfg.xml | 6 + .../spring/spring-buildpackage-plugin.xml | 5 + pom.xml | 10 + 7 files changed, 442 insertions(+), 1 deletion(-) create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/BackUpDatabase/plugin/BackUpDatabaseInitializer.java create mode 100644 base-buildpackage/src/main/resources/cfgHome/plugin/BackUpDatabase/pluginCfg.xml create mode 100644 base-buildpackage/src/main/resources/cfgHome/plugin/BackUpDatabase/spring/spring-buildpackage-plugin.xml diff --git a/.gitignore b/.gitignore index b6cc5cd0..b252f4db 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,5 @@ $RECYCLE.BIN/ /base-common/target/ /base-core/target/ /base-webapp/target/classes/com/hzya/frame/ +/fw-weixin/target/ +/E:/yongansystem/log/2024-10-15/ diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/BackUpDatabase/plugin/BackUpDatabaseInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/BackUpDatabase/plugin/BackUpDatabaseInitializer.java new file mode 100644 index 00000000..7a98112a --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/BackUpDatabase/plugin/BackUpDatabaseInitializer.java @@ -0,0 +1,386 @@ +package com.hzya.frame.plugin.BackUpDatabase.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; + +import com.jcraft.jsch.Channel; +import com.jcraft.jsch.ChannelSftp; +import com.jcraft.jsch.JSch; +import com.jcraft.jsch.Session; +import com.jcraft.jsch.SftpATTRS; +import com.jcraft.jsch.SftpException; +import org.apache.commons.net.ftp.FTPClient; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.nio.file.Files; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Properties; + + +/** + * 主数据模版(MdmModule)表服务接口 + * + * @author makejava + * @since 2024-06-18 10:33:32 + */ +public class BackUpDatabaseInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(BackUpDatabaseInitializer.class); + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "BackUpDatabasePlugin"; + } + + @Override + public String getPluginName() { + return "数据库备份下发"; + } + + @Override + public String getPluginLabel() { + return "BackUpDatabasePlugin"; + } + + @Override + public String getPluginType() { + return "1"; + } + + @Value("${database.filePase:}") + private String filePase;//文件保存路径 + + @Value("${database.fileName:data.sql}") + private String fileName;//文件保存名称 + + @Value("${database.databaseName:}") + private String databaseName;//库名 + + @Value("${database.host:}") + private String host;//地址 + + @Value("${database.port:}") + private String port;//端口 + + @Value("${database.username:}") + private String username;//用户名 + + @Value("${database.password:}") + private String password;//密码 + + + @Value("${sftp.host:}") + private String sftpHost; + + @Value("${sftp.port:}") + private Integer sftpPort; + + @Value("${sftp.username:}") + private String sftpUsername; + + @Value("${sftp.password:}") + private String sftpPassword; + + @Value("${sftp.filePase:}") + private String sftpFilePase; + + + private ChannelSftp sftp = null; + private Session sshSession = null; + + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + if(filePase == null || "".equals(filePase) + || databaseName == null || "".equals(databaseName) + || fileName == null || "".equals(fileName) + || host == null || "".equals(host) + || port == null || "".equals(port) + || username == null || "".equals(username) + || password == null || "".equals(password) + ){ + return BaseResult.getSuccessMessageEntity("系统参数未配置不执行,数据库备份"); + } + //查找是否存在当天数据库 + //格式化日期 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String data = sdf.format(new Date()); + //当天路径 + String nowDatabasePase = filePase + File.separator + data; + //不判断文件是否存在,直接执行 + if(!backFile(nowDatabasePase)){ + return BaseResult.getFailureMessageEntity("备份失败"); + } + //判断是否有sftp配置,有的备份,没有的不备份 + if(sftpHost != null && !"".equals(sftpHost) + && sftpPort != null && !"".equals(sftpPort) + && sftpUsername != null && !"".equals(sftpUsername) + && sftpPassword != null && !"".equals(sftpPassword) + && sftpFilePase != null && !"".equals(sftpFilePase) + ){ + String sftpnowDatabasePase = sftpFilePase + File.separator + data; + if(!sendFile(nowDatabasePase,sftpnowDatabasePase)){ + return BaseResult.getFailureMessageEntity("备份失败"); + } + } + logger.info("执行成功"); + return BaseResult.getSuccessMessageEntity("执行成功"); + } catch (Exception e) { + logger.error("执行失败{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("备份失败"); + } + } + + private boolean backFile(String nowDatabasePase) { + try { + // 构建 mysqldump 命令 + ProcessBuilder processBuilder = new ProcessBuilder( + "mysqldump", + "--ssl-mode=DISABLED", + "-h", host, + "-u", username, + "-p" + password, + "-P" + port, + databaseName); + // 启动进程并获取输入流 + Process process = processBuilder.start(); + BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); + File f = creatFile(nowDatabasePase,fileName); + // 将备份内容写入文件 + FileWriter writer = new FileWriter(f); + String line; + while ((line = reader.readLine())!= null) { + writer.write(line + "\n"); + } + // 关闭资源 + reader.close(); + writer.close(); + process.waitFor(); + logger.info("文件备份成功路径:"+nowDatabasePase+ File.separator +fileName); + return true; + } catch (IOException | InterruptedException e) { + logger.info("文件备份失败:"+e.getMessage()); + return false; + } + } + /** + * @Author lvleigang + * @Description 创建目录及文件 + * @Date 8:59 上午 2024/10/22 + * @param filePath + * @param fileName + * @return java.io.File + **/ + public File creatFile(String filePath, String fileName) { + File folder = new File(filePath); + //文件夹路径不存在 + if (!folder.exists()) { + boolean mkdirs = folder.mkdirs(); + } + // 如果文件不存在就创建 + File file = new File(filePath + File.separator + fileName); + if (!file.exists()) { + try { + file.createNewFile(); + } catch (IOException e) { + logger.error("创建备份文件失败:"+e.getMessage()); + } + } + return file; + } + + private boolean sendFile(String localFilePath,String remoteFileName) { + try { + connect(); + uploadFile(remoteFileName,fileName,localFilePath,fileName); + disconnect(); + return true; + } catch (Exception e) { + logger.error("sftp文件上传失败:"+e.getMessage()); + return false; + } + } + + public void connect() { + try { + JSch jsch = new JSch(); + jsch.getSession(sftpUsername, sftpHost, sftpPort); + sshSession = jsch.getSession(sftpUsername, sftpHost, sftpPort); + if (logger.isInfoEnabled()) { + logger.info("Session created."); + } + sshSession.setPassword(sftpPassword); + Properties sshConfig = new Properties(); + sshConfig.put("StrictHostKeyChecking", "no"); + sshSession.setConfig(sshConfig); + sshSession.connect(); + if (logger.isInfoEnabled()) { + logger.info("Session connected."); + } + Channel channel = sshSession.openChannel("sftp"); + channel.connect(); + if (logger.isInfoEnabled()) { + logger.info("Opening Channel."); + } + sftp = (ChannelSftp) channel; + if (logger.isInfoEnabled()) { + logger.info("Connected to " + host + "."); + } + } catch (Exception e) { + } + } + + /** + * 关闭连接 + */ + public void disconnect() { + if (this.sftp != null) { + if (this.sftp.isConnected()) { + this.sftp.disconnect(); + if (logger.isInfoEnabled()) { + logger.info("sftp is closed already"); + } + } + } + if (this.sshSession != null) { + if (this.sshSession.isConnected()) { + this.sshSession.disconnect(); + if (logger.isInfoEnabled()) { + logger.info("sshSession is closed already"); + } + } + } + } + + /** + * 上传单个文件 + * + * @param remotePath:远程保存目录 + * @param remoteFileName:保存文件名 + * @param localPath:本地上传目录(以路径符号结束) + * @param localFileName:上传的文件名 + * @return + */ + public boolean uploadFile(String remotePath, String remoteFileName, String localPath, String localFileName) { + FileInputStream in = null; + try { + createDir(remotePath); + File file = new File(localPath + File.separator + localFileName); + in = new FileInputStream(file); + sftp.put(in, remoteFileName, 65536); + return true; + } catch (FileNotFoundException e) { + } catch (SftpException e) { + } finally { + if (in != null) { + try { + in.close(); + } catch (IOException e) { + } + } + } + return false; + } + + /** + * 创建目录 + * + * @param createpath + * @return + */ + public boolean createDir(String createpath) { + try { + if (isDirExist(createpath)) { + this.sftp.cd(createpath); + return true; + } + String pathArry[] = createpath.split("/"); + StringBuffer filePath = new StringBuffer("/"); + for (String path : pathArry) { + if (path.equals("")) { + continue; + } + filePath.append(path + "/"); + if (isDirExist(filePath.toString())) { + sftp.cd(filePath.toString()); + } else { + // 建立目录 + sftp.mkdir(filePath.toString()); + // 进入并设置为当前目录 + sftp.cd(filePath.toString()); + } + + } + this.sftp.cd(createpath); + return true; + } catch (SftpException e) { + } + return false; + } + + /** + * 判断目录是否存在 + * + * @param directory + * @return + */ + public boolean isDirExist(String directory) { + boolean isDirExistFlag = false; + try { + SftpATTRS sftpATTRS = sftp.lstat(directory); + isDirExistFlag = true; + return sftpATTRS.isDir(); + } catch (Exception e) { + if (e.getMessage().toLowerCase().equals("no such file")) { + isDirExistFlag = false; + } + } + return isDirExistFlag; + } + + + + /** + * 如果目录不存在就创建目录 + * + * @param path + */ + public void mkdirs(String path) { + File f = new File(path); + + String fs = f.getParent(); + + f = new File(fs); + + if (!f.exists()) { + f.mkdirs(); + } + } + + + + + +} diff --git a/base-buildpackage/src/main/resources/application-llg.yml b/base-buildpackage/src/main/resources/application-llg.yml index d3a1ebfd..11273505 100644 --- a/base-buildpackage/src/main/resources/application-llg.yml +++ b/base-buildpackage/src/main/resources/application-llg.yml @@ -61,4 +61,22 @@ cbs8: OA: data_source_code: yc_oa server: - port: 10086 \ No newline at end of file + port: 10086 + +# mysqldump -d mylm -hhzya.ufyct.com -p9096 -uroot -phzya1314 >%dirName%\table_view.sql + + +database: + databaseName: businesscenter + host: 192.168.2.237 + port: 3306 + username: root + password: hzya@1314 + filePase: /Users/apple/Desktop/log + fileName: data.sql +#sftp: +# host: 192.168.2.237 +# port: 9091 +# username: cs237 +# password: hzya@1314 +# filePase: /databaseBack diff --git a/base-buildpackage/src/main/resources/application.yml b/base-buildpackage/src/main/resources/application.yml index 821ad1c1..b87e5bf7 100644 --- a/base-buildpackage/src/main/resources/application.yml +++ b/base-buildpackage/src/main/resources/application.yml @@ -126,3 +126,17 @@ jeecg : bucketName: ?? data: use: true +database: + databaseName: + host: + port: + username: + password: + filePase: + fileName: +sftp: + host: + port: + username: + password: + filePase: \ No newline at end of file diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/BackUpDatabase/pluginCfg.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/BackUpDatabase/pluginCfg.xml new file mode 100644 index 00000000..774971d0 --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/BackUpDatabase/pluginCfg.xml @@ -0,0 +1,6 @@ + + +BackUpDatabasePlugin +BackUpDatabasePlugin插件 +20241021 + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/BackUpDatabase/spring/spring-buildpackage-plugin.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/BackUpDatabase/spring/spring-buildpackage-plugin.xml new file mode 100644 index 00000000..29896996 --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/BackUpDatabase/spring/spring-buildpackage-plugin.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pom.xml b/pom.xml index 6f230720..5f4df023 100644 --- a/pom.xml +++ b/pom.xml @@ -406,6 +406,16 @@ alibaba-dingtalk-service-sdk 2.0.0 + + commons-net + commons-net + 3.8.0 + + + com.jcraft + jsch + 0.1.53 + From 21007598a9bcfb00455a3ad0144a94bf3604ee48 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Thu, 24 Oct 2024 15:02:47 +0800 Subject: [PATCH 26/67] =?UTF-8?q?=E9=92=89=E9=92=89=E4=BB=A3=E5=8A=9E?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/java/com/hzya/frame/temButtom.java | 120 +++++++++++++++++- 1 file changed, 118 insertions(+), 2 deletions(-) diff --git a/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java b/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java index 68701ee7..825925b0 100644 --- a/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java +++ b/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java @@ -1,19 +1,37 @@ package com.hzya.frame; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSONObject; import com.hzya.frame.util.AESUtil; +import org.apache.http.HttpEntity; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * @ClassName dsasas * @Description * @Author llg * Date 2023/7/16 8:18 上午 */ -@RunWith(SpringRunner.class) -@SpringBootTest(classes = {WebappApplication.class}) +//@RunWith(SpringRunner.class) +//@SpringBootTest(classes = {WebappApplication.class}) public class temButtom { @Test @@ -25,6 +43,104 @@ public class temButtom { } + @Test + public void test02() { +// 1056162015172640840 -7858803986346327947 3178176833471791293 合同评审-待办测试(bdmanager 2024-10-22 16:45) 7743552636545550897 bdmanager 18058147870 pending start success 新增成功! +// success 更新待办为已办成功! +// task7803207f54ff047d6008dcce31c2628f 新增成功! +// 2024-10-24 2024-10-24 + + String phone ="19357235324"; + String taskid ="task8b0c7ca72439bc9b0c1c89e8866c8275"; + //token + Map headers = new HashMap<>(); + String token ="https://oapi.dingtalk.com/gettoken?appkey=dingxewtjaserj292ggu&appsecret=DuRw6EEEvhGXfr6Q8wN_x4025qKjrffIGCXF9KeCKKIID-LVSsR6_8KWMei6sug1"; + String body = sendGet(token,headers); + JSONObject tokenobject = JSONObject.parseObject(body); + + //钉钉id + headers = new HashMap<>(); + //https://oapi.dingtalk.com/user/get_by_mobile?access_token=9abd3996cb103ba48dd8c69fea5473e7&mobile=15700100840 + String ddid ="https://oapi.dingtalk.com/user/get_by_mobile?access_token="+tokenobject.get("access_token")+"&mobile="+phone; + String ddidbody = sendGet(ddid,headers); + JSONObject ddidobject = JSONObject.parseObject(ddidbody); + + //人员id + headers = new HashMap<>(); + //https://oapi.dingtalk.com/user/get?userid=111336474727636213&access_token=3d21a6614fb037a98542a537336e8149 + String userid ="https://oapi.dingtalk.com/user/get?userid="+ddidobject.get("userid")+"&access_token="+tokenobject.get("access_token"); + String useridbody = sendGet(userid,headers); + JSONObject useridobject = JSONObject.parseObject(useridbody); + + + + CloseableHttpClient httpClient = HttpClients.createDefault(); + HttpPut httpPut = new HttpPut("https://api.dingtalk.com/v1.0/todo/users/"+useridobject.get("unionid")+"/tasks/"+taskid); + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000).setConnectionRequestTimeout(35000).setSocketTimeout(60000).build(); + httpPut.setConfig(requestConfig); + httpPut.setHeader("Content-type", "application/json"); + httpPut.setHeader("x-acs-dingtalk-access-token", tokenobject.getString("access_token")); + Map dataMap = new HashMap(); + dataMap.put("done", true); + CloseableHttpResponse httpResponse = null; + + try { + httpPut.setEntity(new StringEntity("{\"done\": true}")); + httpResponse = httpClient.execute(httpPut); + HttpEntity entity = httpResponse.getEntity(); + String results = EntityUtils.toString(entity); + System.out.println(results); + } catch (Exception var15) { + } finally { + try { + httpResponse.close(); + httpClient.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + } + + private String sendGet(String url, Map headers) { + HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); + // HttpClient + CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build(); + HttpGet get = new HttpGet(url.toString()); + CloseableHttpResponse response = null; + + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(60000).build(); + get.setConfig(requestConfig);//设置请求参数【超时时间】 + if (headers != null && headers.size() > 0) { + for (String key : headers.keySet()) { + get.setHeader(key, headers.get(key)); + } + } + StringBuilder body = new StringBuilder(); + + try { + + response = closeableHttpClient.execute(get); + HttpEntity entity = response.getEntity(); + body.append(EntityUtils.toString(entity,"UTF-8")); + } catch (Exception e) { + body.append(e.getMessage()); + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + return body.toString(); + } } From 5a63afd7d83977e3e183086302fee845c51d9d31 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Thu, 7 Nov 2024 10:03:03 +0800 Subject: [PATCH 27/67] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BD=AC=E5=8F=91?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mdm/service/impl/MdmServiceImpl.java | 3 +- .../impl/SysApplicationServiceImpl.java | 35 +++++++++++++++---- .../entity/SysMessageManageLogEntity.java | 9 +++++ 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/base-service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java b/base-service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java index b5d7e716..8550e8cb 100644 --- a/base-service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java @@ -2111,7 +2111,8 @@ public class MdmServiceImpl implements IMdmService { return BaseResult.getSuccessMessageEntity("发送成功"); } else { saveMdmModuleSendLogEntity(mdmModuleEntity.getMdmCode(), mdmModuleDistributeEntity.getId(), "2", "转发失败:"+jsonResultEntity.getAttribute(), dbname, object.getString("id"), sysApplicationEntity.getName(), sysApplicationEntity.getId(), apiEntity.getApiName(), apiEntity.getId(), object.toJSONString(), type); - return BaseResult.getFailureMessageEntity("发送错误:" + jsonResultEntity.getAttribute()); + JSONObject object1 = JSONObject.parseObject(jsonResultEntity.getAttribute().toString()); + return BaseResult.getFailureMessageEntity("发送错误:" +object1.getString("msg")); } } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java index da9db62f..acacbfee 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java @@ -125,7 +125,7 @@ public class SysApplicationServiceImpl extends BaseService Date: Wed, 13 Nov 2024 10:49:00 +0800 Subject: [PATCH 28/67] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=8A=B6=E6=80=81=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/MdmModulePluginInitializer.java | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java index ebff9dc2..beb4c48e 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java @@ -452,6 +452,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { } } } catch (Exception e) { + logger.info("执行异常错误原因:"+e); logger.error("新增返回脚本解析保存三方id错误"+jsonResultEntity.getAttribute()); taskDetailEntity.setResult("新增返回脚本解析保存三方id错误"); taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); @@ -543,7 +544,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { map1.put("tableName",mainDb); map1.put("dataStatus", "N"); map1.put("deleteStatus", "0"); - map1.put("size", 10); + map1.put("size", 50); objects = mdmModuleDao.queryMdmSTs(map1); objects = toLowerCaseKeys(objects); @@ -738,7 +739,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { map1.put("tableName",mainDb); //map1.put("dataStatus", "F"); map1.put("updateStatus", "0"); - map1.put("size", 10); + map1.put("size", 50); objects = mdmModuleDao.queryMdmSTs(map1); objects = toLowerCaseKeys(objects); @@ -926,7 +927,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { map1.put("tableName",mainDb); //map1.put("dataStatus", "Y"); map1.put("addStatus", "0"); - map1.put("size", 100); + map1.put("size", 50); objects = mdmModuleDao.queryMdmSTs(map1); objects = toLowerCaseKeys(objects); @@ -991,6 +992,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { mdmModuleSendLogEntity.setTableName(mainDb+"_send_log"); mdmModuleSendLogEntity.setFormmainId(doObjects.get(i).getString("id")); mdmModuleSendLogEntity.setSts("Y"); + mdmModuleSendLogEntity.setDataType("1"); mdmModuleSendLogEntity.setAppId(sysApplicationEntity.getId()); mdmModuleSendLogEntity.setApiId(apiEntity.getId()); //mdmModuleSendLogEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId()); @@ -1121,10 +1123,12 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { } //保存日志 saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + objects.get(i).put("sendsanfzt123",true); continue; }else { //保存日志 saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败:"+jsonResultEntity.getAttribute(),mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + objects.get(i).put("sendsanfzt123",false); continue; } } @@ -1132,12 +1136,14 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { //所有下发发送完成,修改数据状态 for (int i = 0; i < objects.size(); i++) { - Map updateMap = new HashMap<>(); - updateMap.put("tableName",mainDb); - //updateMap.put("dataStatus", "Y"); - updateMap.put("addStatus", "1"); - updateMap.put("id", objects.get(i).getString("id")); - mdmModuleDao.updateMdmSTs(updateMap); + if(objects.get(i).getBoolean("sendsanfzt123")){ + Map updateMap = new HashMap<>(); + updateMap.put("tableName",mainDb); + //updateMap.put("dataStatus", "Y"); + updateMap.put("addStatus", "1"); + updateMap.put("id", objects.get(i).getString("id")); + mdmModuleDao.updateMdmSTs(updateMap); + } } } From ffb86f43fa59630b28207991699e70c98460480a Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Mon, 9 Dec 2024 15:45:16 +0800 Subject: [PATCH 29/67] =?UTF-8?q?esb=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ISysApplicationService.java | 1 + .../impl/SysApplicationServiceImpl.java | 395 +++++++++++++++++- .../controler/EntranceController.java | 18 +- pom.xml | 5 + 4 files changed, 417 insertions(+), 2 deletions(-) diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java index f8dd60b1..363f69c4 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java @@ -309,6 +309,7 @@ public interface ISysApplicationService extends IBaseService oldheaderMap = ServletUtil.getHeaderMap(request); + //应用key + String publicKey = request.getHeader("publicKey"); + //应用密钥 + String secretKey = request.getHeader("secretKey"); + //appId + String appId = request.getHeader("appId"); + //apiCode + String apiCode = request.getHeader("apiCode"); + + Enumeration bodyname = multipartRequest.getParameterNames(); + JSONObject bodysss = new JSONObject(); + if (bodyname.hasMoreElements()) { + while (bodyname.hasMoreElements()) { + String headerName = bodyname.nextElement(); + String headerValue = multipartRequest.getParameter(headerName); + bodysss.put( headerName,headerValue); + } + } + String oldquerys = multipartRequest.getQueryString(); + String oldbodys = bodysss.toJSONString(); + Iterator filenemes = multipartRequest.getFileNames(); + Map> files = new HashMap<>(); + + if (filenemes.hasNext()) { + filenemes.forEachRemaining(element -> files.put(element,multipartRequest.getFiles(element))); + } + + String ip = IPHelper.getIpAddr(multipartRequest); + if (publicKey == null || "".equals(publicKey)) { + return BaseResult.getFailureMessageEntity("请先传递公钥"); + } + if (secretKey == null || "".equals(secretKey)) { + return BaseResult.getFailureMessageEntity("请先传递密钥"); + } + if (appId == null || "".equals(appId)) { + return BaseResult.getFailureMessageEntity("请先传递接收方应用"); + } + if (apiCode == null || "".equals(apiCode)) { + return BaseResult.getFailureMessageEntity("请先传递发送接口"); + } + + logger.info("请求参数:publicKey:【" + publicKey + "】secretKey:【" + secretKey + "】appId:【" + appId + "】apiCode:【" + apiCode); + //根据请求a应用的公钥、密钥是否能查找到一条数据 + + SysApplicationEntity sendApp = getAppByPublicKeySecretKey(publicKey, secretKey); + if (sendApp == null) { + return BaseResult.getFailureMessageEntity("公钥、密钥错误,请联系管理员"); + } + //判断应用是否启用 + if (sendApp.getAppStatus() == null || !"1".equals(sendApp.getAppStatus())) { + saveLog(sendApp, new SysApplicationEntity(), new SysApplicationApiEntity(), oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,sendApp.getName() + "应用未启用"); + return BaseResult.getFailureMessageEntity(sendApp.getName() + "应用未启用,请联系管理员"); + } + + + SysApplicationEntity receiveApp = getAppByAppId(appId); + if (receiveApp == null) { + saveLog(sendApp, new SysApplicationEntity(), new SysApplicationApiEntity(), oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,"根据appId:" + appId + "未匹配到应用"); + return BaseResult.getFailureMessageEntity("根据appId:" + appId + "未匹配到应用,请联系管理员"); + } + //判断应用是否启用 + if (receiveApp.getAppStatus() == null || !"1".equals(receiveApp.getAppStatus())) { + saveLog(sendApp, receiveApp, new SysApplicationApiEntity(), oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,receiveApp.getName() + "应用未启用" ); + return BaseResult.getFailureMessageEntity(receiveApp.getName() + "应用未启用,请联系管理员"); + } + //判断应用接口是否启用 + if (receiveApp.getInterfaceStatus() == null || !"1".equals(receiveApp.getInterfaceStatus())) { + saveLog(sendApp, receiveApp, new SysApplicationApiEntity(), oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,receiveApp.getName() + "应用接口环境未启用" ); + return BaseResult.getFailureMessageEntity(receiveApp.getName() + "应用接口环境未启用,请联系管理员"); + } + + SysApplicationApiEntity receiveApi = getApiByAppIdApiCode(receiveApp.getId(), apiCode); + if (receiveApi == null) { + saveLog(sendApp, receiveApp, new SysApplicationApiEntity(), oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,receiveApp.getName() + ":" + apiCode + "未启用或者未创建" ); + return BaseResult.getFailureMessageEntity(receiveApp.getName() + ":" + apiCode + "未启用或者未创建"); + } + + SysApplicationApiAuthEntity sysApplicationApiAuthEntity = getApiAuthByNameAppId(sendApp.getId(), receiveApp.getId()); + if (sysApplicationApiAuthEntity == null) { + saveLog(sendApp, receiveApp, receiveApi, oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,receiveApp.getName() + "应用权限配置错误" ); + return BaseResult.getFailureMessageEntity(receiveApp.getName() + "应用权限配置错误"); + } + if (sysApplicationApiAuthEntity.getSystemAddress() != null && !"".equals(sysApplicationApiAuthEntity.getSystemAddress()) + && !sysApplicationApiAuthEntity.getSystemAddress().contains(ip)) { + saveLog(sendApp, receiveApp, receiveApi, oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,receiveApp.getName() + "发送应用" + receiveApp.getName() + "的ip白名单配置错误" ); + return BaseResult.getFailureMessageEntity(receiveApp.getName() + "发送应用" + receiveApp.getName() + "的ip白名单配置错误"); + } + + SysApplicationApiAuthDetailEntity sysApplicationApiAuthDetailEntity = getApiAuthDetailByAppIdApiIdTripartiteSystemId(receiveApp.getId(), receiveApi.getId(), sysApplicationApiAuthEntity.getId()); + if (sysApplicationApiAuthDetailEntity == null) { + saveLog(sendApp, receiveApp, receiveApi, oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,receiveApi.getApiName() + "未授权给" + sendApp.getName() ); + return BaseResult.getFailureMessageEntity(receiveApi.getApiName() + "未授权给" + sendApp.getName() + ",请联系管理员"); + } + SysExtensionApiEntity sysExtensionApiEntity = new SysExtensionApiEntity(); + + + List a = Arrays.asList(new String[]{"apicode", "appid", "secretkey", "publickey", "x-forwarded-for", "cookie", "x-forwarded-proto", "x-real-ip", "content-length", "accept-language", "host", "content-type", "connection", "cache-control", "accept-encoding", "pragma", "accept", "user-agent"}); + Map headers = new HashMap<>(); + if (receiveApi.getHeaderIn() != null && !"".equals(receiveApi.getHeaderIn())) { + JSONArray jsonArray = JSONArray.parseArray(receiveApi.getHeaderIn()); + if (jsonArray != null && jsonArray.size() > 0) { + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject object1 = jsonArray.getJSONObject(i); + headers.put(object1.getString("parameterName"), object1.getString("example")); + } + } + } + if (oldheaderMap != null && oldheaderMap.size() > 0) { + for (Map.Entry entry : oldheaderMap.entrySet()) { + if (!a.contains(entry.getKey())) { + headers.put(entry.getKey(), entry.getValue()); + } + } + } + + + + sysExtensionApiEntity.setSendApp(sendApp); + sysExtensionApiEntity.setReceiveApp(receiveApp); + sysExtensionApiEntity.setReceiveApi(receiveApi); + sysExtensionApiEntity.setHeaders(headers); + sysExtensionApiEntity.setQuerys(oldquerys); + sysExtensionApiEntity.setBodys(oldbodys); + Method[] methods = null; + Object object = null; + + + + + // 判断是否有内部api 是否扩展api 1、启用 2、停用 + if (receiveApi.getExtensionApi() != null && "1".equals(receiveApi.getExtensionApi()) + && receiveApi.getBeanName() != null && !"".equals(receiveApi.getBeanName()) + && receiveApi.getFunName() != null && !"".equals(receiveApi.getFunName()) + ) { + //获取类 + try { + object = ApplicationContextUtil.getBeanByName(receiveApi.getBeanName()); + } catch (SecurityException e) { + + } + //获取类下面的方法 + methods = object.getClass().getMethods(); + if (methods == null || methods.length == 0) { + return BaseResult.getFailureMessageEntity("未找到内部方法,请联系管理员"); + } + for (Method m : methods) { + if (null != m) { + if (m.getName().equals(receiveApi.getFunName().trim())) { + try { + logger.info("invoke开始>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + sysExtensionApiEntity = (SysExtensionApiEntity) m.invoke(object, sysExtensionApiEntity); + logger.info("invoke结束>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + break; + } catch (Exception e) { + logger.error("invokeException{}", e.getMessage()); + return BaseResult.getFailureMessageEntity("内部方法执行错误,请联系管理员"); + } + } + } + } + + } + headers = sysExtensionApiEntity.getHeaders(); + String querys = sysExtensionApiEntity.getQuerys(); + String bodys = sysExtensionApiEntity.getBodys(); + //设置参数获取参数 + StringBuffer url = new StringBuffer(); + if(!receiveApi.getDestinationAddress().toLowerCase().startsWith("http")){ + url.append(receiveApp.getInterfaceAddress()); + } + url.append(receiveApi.getDestinationAddress()); + if (querys != null) { + url.append("?"); + url.append(querys); + } + Integer outTime = 6000; + if (receiveApi.getTimeoutPeriod() != null && !"".equals(receiveApi.getTimeoutPeriod())) { + outTime = Integer.valueOf(receiveApi.getTimeoutPeriod()); + } + //1、POST 2、GET + String method = "POST"; + if ("2".equals(receiveApi.getRequestMethod())) { + method = "GET"; + } + + if ("POST".equals(method)) { + StringBuilder body = new StringBuilder(); + boolean flag = true; + + try { + HttpPost httpPost = new HttpPost(url.toString()); + MultipartEntityBuilder builder = MultipartEntityBuilder.create(); + if(!files.isEmpty()){ + for (Map.Entry> entry : files.entrySet()) { + String key = entry.getKey(); + List multipartFile = entry.getValue(); + if(multipartFile != null && multipartFile.size() > 0){ + for (int i = 0; i < multipartFile.size(); i++) { + File file = new File(multipartFile.get(i).getOriginalFilename()); + Files.write(Paths.get(file.getAbsolutePath()), multipartFile.get(i).getBytes()); + builder.addBinaryBody(key, file, ContentType.APPLICATION_OCTET_STREAM, file.getName()); + } + } + } + } + if (headers != null && headers.size() > 0) { + for (String key : headers.keySet()) { + httpPost.setHeader(key, headers.get(key)); + } + } + //if (bodys != null && !"".equals(bodys)) { + // builder.addTextBody("fileFlag", "true", ContentType.TEXT_PLAIN); + // builder.addTextBody("businessType", "application", ContentType.TEXT_PLAIN); + //} + HttpEntity entity = builder.build(); + httpPost.setEntity(entity); + + HttpResponse response = null; + response = HttpClientBuilder.create().build().execute(httpPost); + + HttpEntity entity1 = response.getEntity(); + synchronized (lock) { + body.append(EntityUtils.toString(entity1,"UTF-8")); + } + flag = true; + logger.info("返回结果:" + body); + } catch (Exception e) { + logger.error("请求错误:" + e.getMessage()); + body.append(e.getMessage()); + flag = false; + } + logger.info("保存日志开始"); + SysMessageManageLogEntity sysMessageManageLogEntity = saveLog(sendApp, receiveApp, receiveApi, oldbodys,bodys, oldheaderMap,headers, headers, oldquerys,querys, body.toString(),true,null); + if (methods != null && methods.length > 0) { + for (Method m : methods) { + if (null != m) { + if (m.getName().equals(receiveApi.getFunName().trim()+"CallBack")) { + try { + logger.info("invoke开始>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + m.invoke(object, sysMessageManageLogEntity); + logger.info("invoke结束>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + } catch (Exception e) { + logger.error("invokeException{}", e.getMessage()); + } + } + } + } + } + logger.info("保存日志结束"); + if (flag) { + if (JSONUtil.isTypeJSON(body.toString())) { + JSONObject jsonObject = JSONObject.parseObject(body.toString()); + if(sysMessageManageLogEntity.getStatus() != null && "3".equals(sysMessageManageLogEntity.getStatus())){ + return BaseResult.getSuccessMessageEntity("转发成功", jsonObject); + }else { + if(sysMessageManageLogEntity.getReturnMsg()!= null&& !"".equals(sysMessageManageLogEntity.getReturnMsg())){ + return BaseResult.getFailureMessageEntity("转发失败:"+sysMessageManageLogEntity.getReturnMsg(), jsonObject); + }else { + return BaseResult.getFailureMessageEntity("转发失败", jsonObject); + } + } + } else { + if(sysMessageManageLogEntity.getStatus() != null && "3".equals(sysMessageManageLogEntity.getStatus())){ + return BaseResult.getSuccessMessageEntity("转发成功", body); + }else { + if(sysMessageManageLogEntity.getReturnMsg()!= null&& !"".equals(sysMessageManageLogEntity.getReturnMsg())){ + return BaseResult.getFailureMessageEntity("转发失败:"+sysMessageManageLogEntity.getReturnMsg(), body); + }else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + } + } + } else { + if(sysMessageManageLogEntity.getReturnMsg()!= null&& !"".equals(sysMessageManageLogEntity.getReturnMsg())){ + return BaseResult.getFailureMessageEntity("转发失败:"+sysMessageManageLogEntity.getReturnMsg(), body); + }else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + } + } else {//GET + + HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); + // HttpClient + CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build(); + HttpGet get = new HttpGet(url.toString()); + CloseableHttpResponse response = null; + + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(outTime).build(); + get.setConfig(requestConfig);//设置请求参数【超时时间】 + if (headers != null && headers.size() > 0) { + for (String key : headers.keySet()) { + get.setHeader(key, headers.get(key)); + } + } + StringBuilder body = new StringBuilder(); + + boolean flag = true; + try { + + response = closeableHttpClient.execute(get); + HttpEntity entity = response.getEntity(); + synchronized (lock) { + body.append(EntityUtils.toString(entity,"UTF-8")); + } + flag = true; + logger.info("返回结果:" + body); + } catch (Exception e) { + logger.error("请求错误:" + e.getMessage()); + body.append(e.getMessage()); + flag = false; + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + logger.info("保存日志开始"); + SysMessageManageLogEntity sysMessageManageLogEntity = saveLog(sendApp, receiveApp, receiveApi, oldbodys,bodys, oldheaderMap,headers, headers, oldquerys,querys, body.toString(), true,null); + if (methods != null && methods.length > 0) { + for (Method m : methods) { + if (null != m) { + if (m.getName().equals(receiveApi.getFunName().trim()+"CallBack")) { + try { + logger.info("invoke开始>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + m.invoke(object, sysMessageManageLogEntity); + logger.info("invoke结束>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + } catch (Exception e) { + logger.error("invokeException{}", e.getMessage()); + } + } + } + } + } + logger.info("保存日志结束"); + if (flag) { + if (JSONUtil.isTypeJSON(body.toString())) { + JSONObject jsonObject = JSONObject.parseObject(body.toString()); + if(sysMessageManageLogEntity.getStatus() != null && "3".equals(sysMessageManageLogEntity.getStatus())){ + return BaseResult.getSuccessMessageEntity("转发成功", jsonObject); + }else { + if(sysMessageManageLogEntity.getReturnMsg()!= null&& !"".equals(sysMessageManageLogEntity.getReturnMsg())){ + return BaseResult.getFailureMessageEntity("转发失败:"+sysMessageManageLogEntity.getReturnMsg(), jsonObject); + }else { + return BaseResult.getFailureMessageEntity("转发失败", jsonObject); + } + } + } else { + if(sysMessageManageLogEntity.getStatus() != null && "3".equals(sysMessageManageLogEntity.getStatus())){ + return BaseResult.getSuccessMessageEntity("转发成功", body); + }else { + if(sysMessageManageLogEntity.getReturnMsg()!= null&& !"".equals(sysMessageManageLogEntity.getReturnMsg())){ + return BaseResult.getFailureMessageEntity("转发失败:"+sysMessageManageLogEntity.getReturnMsg(), body); + }else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + } + } + } else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + } + } + @Override @DSTransactional() public JsonResultEntity externalCallInterfaceResend(SysMessageManageLogEntity resendLogEntity) { diff --git a/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java b/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java index 1227f020..253ef940 100644 --- a/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java +++ b/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java @@ -102,7 +102,17 @@ public class EntranceController { logger.info("-------------------结束调用上传文件upload接口-------------------"); return jsonResultEntity; } - + /*** + * 文件上传接口 + * @param + * @return@@ + */ + @RequestMapping(value = "/fileUploadlist", method = RequestMethod.POST) + @ResponseBody + public JsonResultEntity fileUploadlist(MultipartFile[] file, FileUploadDto entity, ServletRequest servletRequest, ServletResponse servletResponse) { + entity.getBusinessType(); + return BaseResult.getSuccessMessageEntity("gc"); + } @RequestMapping(value = "/pluginfileUpload", method = RequestMethod.POST) @ResponseBody public JsonResultEntity pluginfileUpload(MultipartFile file, FileUploadDto entity,String pluginPackageName, ServletRequest servletRequest, ServletResponse servletResponse) { @@ -195,6 +205,12 @@ public class EntranceController { return sysApplicationService.externalCallInterface(servletRequest,servletResponse); } + @RequestMapping(value = "/externalCallInterfacefileUpload") + @ResponseBody + public JsonResultEntity externalCallInterfacefileUpload(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception { + return sysApplicationService.externalCallInterfacefileUpload(servletRequest,servletResponse); + } + @RequestMapping(value = "/externalCallInterfaceResend") @ResponseBody public JsonResultEntity externalCallInterfaceResend(SysMessageManageLogEntity resendLogEntity) throws Exception { diff --git a/pom.xml b/pom.xml index 5f4df023..303e6fd7 100644 --- a/pom.xml +++ b/pom.xml @@ -114,6 +114,11 @@ httpclient ${httpclient.version} + + org.apache.httpcomponents + httpmime + 4.5.13 + org.springframework.boot spring-boot-starter-cache From f9b2ebaa7f92ba76f32405c5eca84ee7c634259c Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Thu, 19 Dec 2024 14:08:08 +0800 Subject: [PATCH 30/67] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E5=8F=91like?= =?UTF-8?q?=E6=8B=BC=E6=8E=A5=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base-service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml b/base-service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml index 8403c031..822bd239 100644 --- a/base-service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml @@ -974,10 +974,10 @@ where id = #{id} < #{item.filedVaule} - like concat('%',#{item.filedVaule},'%') + like #{item.filedVaule} - not like concat('%',#{item.filedVaule},'%') + not like #{item.filedVaule} From 6b0232e12d04318ab4205bb712ada3b4b63f5f5b Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Tue, 18 Feb 2025 16:36:56 +0800 Subject: [PATCH 31/67] =?UTF-8?q?post=E8=BD=AC=E5=8F=91ssl=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E5=8E=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SysApplicationServiceImpl.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java index 23026b1c..ad9976a0 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java @@ -61,11 +61,15 @@ import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; +import org.apache.http.conn.ssl.NoopHostnameVerifier; +import org.apache.http.conn.ssl.TrustAllStrategy; import org.apache.http.entity.ByteArrayEntity; import org.apache.http.entity.ContentType; import org.apache.http.entity.mime.MultipartEntityBuilder; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.ssl.SSLContextBuilder; import org.apache.http.util.EntityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -76,6 +80,7 @@ import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; import javax.annotation.Resource; +import javax.net.ssl.SSLContext; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; @@ -1888,9 +1893,28 @@ public class SysApplicationServiceImpl extends BaseService Date: Mon, 7 Apr 2025 16:49:25 +0800 Subject: [PATCH 32/67] =?UTF-8?q?=E8=B0=83=E6=95=B4OA=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../seeyon/service/ISeeYonInterFace.java | 22 +- .../service/impl/SeeYonInterFaceImpl.java | 393 +++++++++++------- 2 files changed, 250 insertions(+), 165 deletions(-) diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java index 762023b7..5dc53395 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java @@ -6,6 +6,7 @@ import com.hzya.frame.web.entity.JsonResultEntity; /** * 致远OA接口类 + * * @author 👻👻👻👻👻👻👻👻👻👻 gjh * @version 1.0 * @content @@ -17,18 +18,17 @@ public interface ISeeYonInterFace { * 发起OA表单方法 * @content: * @author 👻👻👻👻👻👻👻👻 gjh - * @date 2023-08-22 9:31 + * @date 2023-08-22 9:31 * @param requestData 请求json * @return com.hzya.frame.web.entity.JsonResultEntity **/ JsonResultEntity thirdInterfaceSend(JSONObject requestData); - /*** * @Content: 提供给OA的标准接口方法,包含参数 entity 为OA 的data信息, , eventType 为事件类型 * @Author 👻👻👻👻👻👻👻👻 gjh - * @Date 2020-12-24 10:36 + * @Date 2020-12-24 10:36 * @Param [entity, eventType] * eventType: * 发起前事件 onBeforeStart , @@ -59,26 +59,36 @@ public interface ISeeYonInterFace { /** * seeyon流程事件监听前置方法,绑定数据源 + * * @param sysExtensionApi * @return * @throws Exception */ - SysExtensionApiEntity colEventPre(SysExtensionApiEntity sysExtensionApi)throws Exception; + SysExtensionApiEntity colEventPre(SysExtensionApiEntity sysExtensionApi) throws Exception; + /** * seeyon流程事件监听 + * * @param jsonObject * @return * @throws Exception */ - JsonResultEntity colEventListener(JSONObject jsonObject)throws Exception; + JsonResultEntity colEventListener(JSONObject jsonObject) throws Exception; /** * seeyon流程事件监听后置方法,调用三方接口 + * * @param jsonStr * @param formAppId * @param eventType * @return * @throws Exception */ - String colEventPost(String jsonStr,String formAppId,String eventType)throws Exception; + JsonResultEntity colEventPost(String jsonStr, String formAppId, String eventType) throws Exception; + + + JsonResultEntity chengeBody(JSONObject jsonObject) throws Exception; + + SysExtensionApiEntity chengeBodySetPlug(SysExtensionApiEntity entity); + } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java index 8e8be89e..b2e196b3 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java @@ -2,13 +2,13 @@ package com.hzya.frame.seeyon.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.map.MapBuilder; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; import com.hzya.frame.seeyon.dao.ISeeYonInterFaceDao; import com.hzya.frame.seeyon.entity.OAWorkflowEventDataEntity; import com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity; @@ -19,6 +19,7 @@ import com.hzya.frame.sysnew.application.database.dao.ISysApplicationDatabaseDao import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity; import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.util.PluginUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import com.hzya.frame.web.exception.BaseSystemException; @@ -28,6 +29,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; + import javax.annotation.Resource; import java.util.HashMap; import java.util.List; @@ -50,14 +52,30 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { private static final String sendUrl = "http://60.204.152.210/seeyon/"; //速网esb地址 private static final String baseUrl = "http://hzya.ufyct.com:9067/kangarooDataCenter/entranceController/externalCallInterface"; - @Resource - private ISysApplicationDatabaseDao sysApplicationDatabaseDao; - @Autowired - private ISysApplicationApiService sysApplicationApiService; /** * 定义所支持的事件静态代码块 */ private static final StringBuffer eventTypeBuffer = new StringBuffer(); + //基础档案类型 + private final String ARCHIVESTYPE = "archives"; + //流程表单类型 + private final String FLOWTYPE = "flow"; + //创建基础档案 + private final String CREATEARCHIVES = "create"; + //更新基础档案 + private final String UPDATEARCHIVES = "update"; + //创建基础档案 + private final String CREATEARCHIVESURL = "rest/form/import/"; + //创建基础档案 + private final String UPDATEARCHIVESURL = "rest/form/update"; + @Resource + private ISysApplicationDatabaseDao sysApplicationDatabaseDao; + @Autowired + private ISysApplicationApiService sysApplicationApiService; + @Resource + private ISeeYonInterFaceDao seeYonInterFaceDao; + //上一次同步时间 + private final String LAST_SYNCHRONISED_TIME = ""; { eventTypeBuffer.append("发起前事件 onBeforeStart ,"); @@ -75,24 +93,6 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { eventTypeBuffer.append("取回事件 onTakeBack,"); } - //基础档案类型 - private final String ARCHIVESTYPE = "archives"; - //流程表单类型 - private final String FLOWTYPE = "flow"; - //创建基础档案 - private final String CREATEARCHIVES = "create"; - //更新基础档案 - private final String UPDATEARCHIVES = "update"; - //创建基础档案 - private final String CREATEARCHIVESURL = "rest/form/import/"; - //创建基础档案 - private final String UPDATEARCHIVESURL = "rest/form/update"; - @Resource - private ISeeYonInterFaceDao seeYonInterFaceDao; - - - //上一次同步时间 - private String LAST_SYNCHRONISED_TIME = ""; /**** * @Content:发起无流程表单接口实现 * @Author 👻👻👻👻👻👻👻👻 gjh @@ -100,7 +100,7 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { * @Param [templateCode 模版编码, sendLoginName 发送人登录帐号 ,xmlData ] * @return java.lang.Integer **/ - public static JsonResultEntity saveNoProcess(String templateCode , String interfaceUrl,String sendLoginName, String xmlData) { + public static JsonResultEntity saveNoProcess(String templateCode, String interfaceUrl, String sendLoginName, String xmlData) { String token = getToken(RESTUSERNAME, RESTPASSWORD, sendLoginName); Map res = new HashMap(); res.put("loginName", sendLoginName); @@ -119,7 +119,7 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { res.put("token", token); res.put("moduleId", moduleId); res.put("templateCode", templateCode); - logger.info("更新无流程表单参数:{}",JSON.toJSONString(res)); + logger.info("更新无流程表单参数:{}", JSON.toJSONString(res)); String result = HttpRequest.put(sendUrl + interfaceUrl).header("token", token).body(JSON.toJSONString(res)).execute().body(); logger.info("更新无流程表单执行结果:" + result); return BaseResult.getFailureMessageEntity("执行成功", result); @@ -185,7 +185,7 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { List attributeArray = JSON.parseArray(attributeArrayStr, JSONObject.class); JsonResultEntity result = null; if (ARCHIVESTYPE.equalsIgnoreCase(type)) { - switch (templateCode){ + switch (templateCode) { //预留的 case "abc123": break; @@ -198,13 +198,13 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { @Override - public JsonResultEntity thirdInterfaceSeeYonPlugInInterfaceEntrance(JSONObject requestData){ + public JsonResultEntity thirdInterfaceSeeYonPlugInInterfaceEntrance(JSONObject requestData) { String jsonStr = requestData.getString("jsonStr"); JSONObject jsonObject = requestData.getJSONObject("jsonStr"); - OAWorkflowEventDataEntity entity = JSON.parseObject(jsonStr,OAWorkflowEventDataEntity.class); - logger.info("监听OA事件入参:"+jsonObject.toJSONString()); + OAWorkflowEventDataEntity entity = JSON.parseObject(jsonStr, OAWorkflowEventDataEntity.class); + logger.info("监听OA事件入参:" + jsonObject.toJSONString()); JSONObject formBeanData = jsonObject.getJSONObject("businessDataStr"); - String eventType = jsonObject.getString("eventType") ; + String eventType = jsonObject.getString("eventType"); /** 流程ID*/ String summaryId = entity.getSummaryId(); /** 节点ID*/ @@ -223,73 +223,74 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { //formApp 最好过滤一下 - String result = null; + JsonResultEntity result = null; try { //流程事件处理 result = colEventPost(jsonStr, formApp, eventType); - }catch (Exception e){ - return BaseResult.getFailureMessageEntity("传递失败",e.getMessage()); - } - try { - /** 根据事件类型处理相关事件*/ - switch (eventType) { - /** 发起前事件*/ - case "onBeforeStart": - break; - /** 发起事件*/ - case "onStart": - //流程发起 新增grpu8单据 - break; - /** 终止前事件*/ - case "onBeforeStop": - break; - /** 终止事件*/ - case "onStop": - //流程终止,更新grpu8单据 - break; - /** 撤销前事件*/ - case "onBeforeCancel": - break; - /** 撤销事件*/ - case "onCancel": - //流程撤销,更新grpu8单据 - break; - /** 结束事件*/ - case "onProcessFinished": - break; - /** 处理前事件*/ - case "onBeforeFinishWorkitem": - /** 根据form处理相关业务表单的数据*/ - switch (formApp) { - case "abc123": - break; - default: - return BaseResult.getFailureMessageEntity("未匹配到表单!当前formID:" + formApp, ""); - } - break; - /** 处理事件*/ - case "onFinishWorkitem": - break; - /** 回退前事件*/ - case "onBeforeStepBack": - break; - /** 回退事件*/ - case "onStepBack": - break; - /** 取回前事件*/ - case "onBeforeTakeBack": - break; - /** 取回事件*/ - case "onTakeBack": - break; - default: -// throw new RuntimeException("传入了非法事件类型!请参照:" + eventTypeBuffer.toString()); - return BaseResult.getFailureMessageEntity("传入了非法事件类型!请参照:" + eventTypeBuffer.toString(), "", ""); - } - return BaseResult.getSuccessMessageEntity("传递成功", result); - }catch (Exception e){ - return BaseResult.getFailureMessageEntity("传递失败",e.getMessage()); + } catch (Exception e) { + return BaseResult.getFailureMessageEntity("传递失败", e.getMessage()); } + return result; +// try { +// /** 根据事件类型处理相关事件*/ +// switch (eventType) { +// /** 发起前事件*/ +// case "onBeforeStart": +// break; +// /** 发起事件*/ +// case "onStart": +// //流程发起 新增grpu8单据 +// break; +// /** 终止前事件*/ +// case "onBeforeStop": +// break; +// /** 终止事件*/ +// case "onStop": +// //流程终止,更新grpu8单据 +// break; +// /** 撤销前事件*/ +// case "onBeforeCancel": +// break; +// /** 撤销事件*/ +// case "onCancel": +// //流程撤销,更新grpu8单据 +// break; +// /** 结束事件*/ +// case "onProcessFinished": +// break; +// /** 处理前事件*/ +// case "onBeforeFinishWorkitem": +// /** 根据form处理相关业务表单的数据*/ +// switch (formApp) { +// case "abc123": +// break; +// default: +// return BaseResult.getFailureMessageEntity("未匹配到表单!当前formID:" + formApp, ""); +// } +// break; +// /** 处理事件*/ +// case "onFinishWorkitem": +// break; +// /** 回退前事件*/ +// case "onBeforeStepBack": +// break; +// /** 回退事件*/ +// case "onStepBack": +// break; +// /** 取回前事件*/ +// case "onBeforeTakeBack": +// break; +// /** 取回事件*/ +// case "onTakeBack": +// break; +// default: +//// throw new RuntimeException("传入了非法事件类型!请参照:" + eventTypeBuffer.toString()); +// return BaseResult.getFailureMessageEntity("传入了非法事件类型!请参照:" + eventTypeBuffer.toString(), "", ""); +// } +// return BaseResult.getSuccessMessageEntity("传递成功", result); +// }catch (Exception e){ +// return BaseResult.getFailureMessageEntity("传递失败",e.getMessage()); +// } } @@ -297,8 +298,8 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { public JsonResultEntity thirdInterfaceSeeYonDefinitionRePush(JSONObject jsonObject) throws Exception { JSONObject requestData = jsonObject.getJSONObject("jsonStr"); JSONArray resultEntityArray = new JSONArray(); - if(null == requestData){ - throw new BaseSystemException("参数传递错误需要jsonStr!"); + if (null == requestData) { + throw new BaseSystemException("参数传递错误需要jsonStr!"); } //表单模版ID String formAppId = requestData.getString("formAppId"); @@ -308,24 +309,24 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { String dataSourceCode = requestData.getString("dataSourceCode"); //主表ID集合 formMainIds JSONArray formMainIds = requestData.getJSONArray("formMainIds"); - if(StrUtil.isEmpty(eventType)){ - throw new BaseSystemException("需要传递eventType 参照致远OA事件!"); + if (StrUtil.isEmpty(eventType)) { + throw new BaseSystemException("需要传递eventType 参照致远OA事件!"); } - if(StrUtil.isEmpty(formAppId)){ - throw new BaseSystemException("需要传递formAppId 参照致远OA 表 CAP_FORM_DEFINITION!"); + if (StrUtil.isEmpty(formAppId)) { + throw new BaseSystemException("需要传递formAppId 参照致远OA 表 CAP_FORM_DEFINITION!"); } - if(StrUtil.isEmpty(dataSourceCode)){ - throw new BaseSystemException("需要传递dataSourceCode 参照中台表 sys_data_source!"); + if (StrUtil.isEmpty(dataSourceCode)) { + throw new BaseSystemException("需要传递dataSourceCode 参照中台表 sys_data_source!"); } - if(null == formMainIds || formMainIds.size() == 0){ - throw new BaseSystemException("需要传递业务主表数据id集合,不允许全量推送!"); + if (null == formMainIds || formMainIds.size() == 0) { + throw new BaseSystemException("需要传递业务主表数据id集合,不允许全量推送!"); } SeeYonInterFaceEntity seeYonInterFaceEntity = new SeeYonInterFaceEntity(); - BeanUtil.copyProperties(requestData,seeYonInterFaceEntity); + BeanUtil.copyProperties(requestData, seeYonInterFaceEntity); List seeYonInterFaceEntityList = seeYonInterFaceDao.queryDefinitionInfo(seeYonInterFaceEntity); - if(null != seeYonInterFaceEntityList && seeYonInterFaceEntityList.size() >0){ - for(SeeYonInterFaceEntity interFaceEntity : seeYonInterFaceEntityList){ + if (null != seeYonInterFaceEntityList && seeYonInterFaceEntityList.size() > 0) { + for (SeeYonInterFaceEntity interFaceEntity : seeYonInterFaceEntityList) { String field_info = interFaceEntity.getField_info(); JSONObject infoJson = JSON.parseObject(field_info); //获取主表信息 @@ -338,7 +339,7 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { /** 设置主表查询条件*/ interFaceEntity.setTabName(formMainTableName); interFaceEntity.setDataSourceCode(dataSourceCode); - interFaceEntity.setFormMainIds( formMainIds.toJavaList(String.class) ); + interFaceEntity.setFormMainIds(formMainIds.toJavaList(String.class)); List> forMainList = seeYonInterFaceDao.queryDefinitionData(interFaceEntity); for (Map forMainRow : forMainList) { @@ -350,11 +351,11 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { String forMainId = String.valueOf(forMainRow.get("ID")); //组装主表数据 for (Map.Entry entry : forMainRow.entrySet()) { - formMainObj.put(entry.getKey().toLowerCase(),entry.getValue()); - } + formMainObj.put(entry.getKey().toLowerCase(), entry.getValue()); + } //组装明细表数据 - if(null != formSons && formSons.size() > 0){ - for(Object formSon : formSons){ + if (null != formSons && formSons.size() > 0) { + for (Object formSon : formSons) { JSONObject son = JSON.parseObject(JSON.toJSONString(formSon)); //明细数据 String sonTableName = son.getString("tableName"); @@ -368,38 +369,38 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { //组装明细数据 JSONObject forSonJson = new JSONObject(); for (Map.Entry entry : forSons.entrySet()) { - forSonJson.put(entry.getKey().toLowerCase(),entry.getValue()); - } + forSonJson.put(entry.getKey().toLowerCase(), entry.getValue()); + } jsonArray.add(forSonJson); } //设置明细表数据 - seeYonBean.put(sonTableName,jsonArray); + seeYonBean.put(sonTableName, jsonArray); } } - seeYonBean.put(formMainTableName,formMainObj); + seeYonBean.put(formMainTableName, formMainObj); JSONObject rePushRequestData = new JSONObject(); JSONObject object = new JSONObject(); - object.put("formApp",formAppId); - object.put("eventType",eventType); - object.put("businessDataStr",seeYonBean.toJSONString()); - object.put("affairId",""); - object.put("summaryId",requestData.getString("summaryId")); - object.put("currentActivityId",""); - object.put("id",forMainId); - object.put("hzyaExtData",requestData.getJSONObject("hzyaExtData")); - logger.info("Method:thirdInterfaceSeeYonDefinitionRePush 组装seeYonBean DATA: {}",seeYonBean.toJSONString()); + object.put("formApp", formAppId); + object.put("eventType", eventType); + object.put("businessDataStr", seeYonBean.toJSONString()); + object.put("affairId", ""); + object.put("summaryId", requestData.getString("summaryId")); + object.put("currentActivityId", ""); + object.put("id", forMainId); + object.put("hzyaExtData", requestData.getJSONObject("hzyaExtData")); + logger.info("Method:thirdInterfaceSeeYonDefinitionRePush 组装seeYonBean DATA: {}", seeYonBean.toJSONString()); - rePushRequestData.put("jsonStr",object); + rePushRequestData.put("jsonStr", object); - JsonResultEntity resultEntity = thirdInterfaceSeeYonPlugInInterfaceEntrance(rePushRequestData); - if(null != resultEntity){ + JsonResultEntity resultEntity = thirdInterfaceSeeYonPlugInInterfaceEntrance(rePushRequestData); + if (null != resultEntity) { resultEntityArray.add(resultEntity.getAttribute()); - }else{ - JSONObject jsonResultEntity = new JSONObject(); - jsonResultEntity.put("msg","从新推送失败"); - jsonResultEntity.put("id",forMainId); + } else { + JSONObject jsonResultEntity = new JSONObject(); + jsonResultEntity.put("msg", "从新推送失败"); + jsonResultEntity.put("id", forMainId); resultEntityArray.add(jsonResultEntity); } @@ -407,11 +408,12 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { } } } - return BaseResult.getSuccessMessageEntity("从新推送执行结束",resultEntityArray); + return BaseResult.getSuccessMessageEntity("从新推送执行结束", resultEntityArray); } /** * seeyon流程事件监听前置方法,绑定数据源 + * * @param entity * @return * @throws Exception @@ -426,10 +428,10 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { sysApplicationDatabaseEntity.setAppId(applicationEntity.getId()); sysApplicationDatabaseEntity.setDataSourceCode("master"); List sysDataSourceEntities = sysApplicationDatabaseDao.queryDSBase(sysApplicationDatabaseEntity); - if(sysDataSourceEntities != null && sysDataSourceEntities.size() > 0){ + if (sysDataSourceEntities != null && sysDataSourceEntities.size() > 0) { String parm = entity.getBodys(); JSONObject jsonObject = JSONObject.parseObject(parm); - jsonObject.put("dataSourceCode",sysDataSourceEntities.get(0).getSourceCode()); + jsonObject.put("dataSourceCode", sysDataSourceEntities.get(0).getSourceCode()); entity.setBodys(jsonObject.toJSONString()); } } catch (Exception e) { @@ -448,24 +450,24 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { @Override public JsonResultEntity colEventListener(JSONObject jsonObject) throws Exception { try { - if (null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("jsonStr"))){ + if (null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("jsonStr"))) { SeeYonInterFaceEntity entity = jsonObject.getJSONObject("jsonStr").toJavaObject(SeeYonInterFaceEntity.class); JSONObject requestData = new JSONObject(); //表单模版ID requestData.put("formAppId", entity.getFormAppId()); //事件事件类型 - requestData.put("eventType",entity.getEventType()); + requestData.put("eventType", entity.getEventType()); //数据源编码 - requestData.put("dataSourceCode",entity.getDataSourceCode()); - requestData.put("formMainIds",entity.getFormMainIds()); - requestData.put("summaryId",entity.getSummaryId()); + requestData.put("dataSourceCode", entity.getDataSourceCode()); + requestData.put("formMainIds", entity.getFormMainIds()); + requestData.put("summaryId", entity.getSummaryId()); JSONObject jsonStr = new JSONObject(); - jsonStr.put("jsonStr",requestData); + jsonStr.put("jsonStr", requestData); thirdInterfaceSeeYonDefinitionRePush(jsonStr); } - }catch (Exception e){ - logger.error("流程事件通知接口出错:{}",e); - return BaseResult.getSuccessMessageEntity("失败",e.getMessage()); + } catch (Exception e) { + logger.error("流程事件通知接口出错:{}", e); + return BaseResult.getSuccessMessageEntity("失败", e.getMessage()); } return BaseResult.getSuccessMessageEntity("成功"); } @@ -480,28 +482,101 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { * @throws Exception */ @Override - public String colEventPost(String jsonStr, String formAppId, String eventType) throws Exception { - if (StrUtil.isNotEmpty(jsonStr) && StrUtil.isNotEmpty(formAppId) && StrUtil.isNotEmpty(eventType)){ + public JsonResultEntity colEventPost(String jsonStr, String formAppId, String eventType) throws Exception { + if (StrUtil.isNotEmpty(jsonStr) && StrUtil.isNotEmpty(formAppId) && StrUtil.isNotEmpty(eventType)) { SysApplicationApiEntity sysApplicationApiEntity = new SysApplicationApiEntity(); - sysApplicationApiEntity.setHeaderIn(formAppId+"_"+eventType); + sysApplicationApiEntity.setHeaderIn(formAppId + "_" + eventType); List applist = sysApplicationApiService.queryLike(sysApplicationApiEntity); - if (CollectionUtil.isNotEmpty(applist)){ - if (applist.size() > 1){ - throw new BaseSystemException("根据formID:" + formAppId+"查询出多条数据"); + if (CollectionUtil.isNotEmpty(applist)) { + if (applist.size() > 1) { + throw new BaseSystemException("根据formID:" + formAppId + "查询出多条数据"); + } + if (applist.size() == 0 ) { + throw new BaseSystemException("根据formID:" + formAppId + "eventType:"+eventType+"未查询到API配置"); } SysApplicationApiEntity sysApp = applist.get(0); - Map headerMap = MapBuilder.create(true) - .put("apiCode", String.valueOf(sysApp.getApiCode())) - //这里用中台做为发送方 - .put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj") - .put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") - .put("appId",String.valueOf(sysApp.getAppCode())) - .build(); - String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(jsonStr).timeout(60000).execute().body(); - logger.info("调用中台返回的参数:{}",body); - return body; + JSONArray headerArray = JSONArray.parseArray(sysApp.getHeaderIn()); + if (null != headerArray && headerArray.size() > 0) { + String plugId = null; + for (int i = 0; i < headerArray.size(); i++) { + JSONObject querys = headerArray.getJSONObject(i); + //query 只有基本类型,不用循环判断下级 + //判断参数是否有值 + //获取对象下面的层级数据 + String parameterName = querys.getString("parameterName"); + if (null != parameterName && "plugId".equals(parameterName)) { + plugId = querys.getString("example"); + break; + } + } + if (null == plugId) { + throw new BaseSystemException("根据formID:" + formAppId + "未获取到head参数"); + } else { + PluginBaseEntity pluginBaseEntity = null; + JsonResultEntity result; + pluginBaseEntity = PluginUtils.getPluginsById(plugId); + if (null == pluginBaseEntity) { + throw new BaseSystemException("根据ID获取插件错误!请传入正确的 pluginId"); + } else { + //执行业务逻辑代码 + JSONObject reqJson = new JSONObject(); + reqJson.put("jsonStr",jsonStr); + reqJson.put("formAppId",formAppId); + reqJson.put("eventType",eventType); + result = pluginBaseEntity.executeBusiness(reqJson); + return result; + } + } + + + } else { + throw new BaseSystemException("根据formID:" + formAppId + "未获取到head参数"); + } + + +// Map headerMap = MapBuilder.create(true) +// .put("apiCode", String.valueOf(sysApp.getApiCode())) +// //这里用中台做为发送方 +// .put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj") +// .put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") +// .put("appId",String.valueOf(sysApp.getAppCode())) +// .build(); +// String body = HttpRequest.post("http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(jsonStr).timeout(60000).execute().body(); +// logger.info("调用中台返回的参数:{}",body); +// return body; } + }else{ + // StrUtil.isNotEmpty(jsonStr) && StrUtil.isNotEmpty(formAppId) && StrUtil.isNotEmpty(eventType) + logger.info("jsonStr,formAppId,eventType为空!执行错误"+jsonStr+formAppId+eventType); + throw new BaseSystemException("jsonStr,formAppId,eventType为空!执行错误"); } return null; } + + @Override + public JsonResultEntity chengeBody(JSONObject object) throws Exception { + JSONObject jsonstr = object.getJSONObject("jsonStr"); + PluginBaseEntity pluginBaseEntity = null; + JsonResultEntity result; + String pluginId = jsonstr.getString("plugId"); + pluginBaseEntity = PluginUtils.getPluginsById(pluginId); + if (null == pluginBaseEntity) { + throw new BaseSystemException("根据ID获取插件错误!请传入正确的 pluginId"); + } else { + //执行业务逻辑代码 + result = pluginBaseEntity.executeBusiness(object); + } + return result; + } + + @Override + public SysExtensionApiEntity chengeBodySetPlug(SysExtensionApiEntity entity) { + Map headers = entity.getHeaders(); + JSONObject jsonObject = JSONObject.parseObject(entity.getBodys()); + jsonObject.put("plugId", headers.get("plugId")); + entity.setBodys(jsonObject.toJSONString()); + return entity; + } + + } From d9feee5a28b5a44a79215479400b07fe81d9c68b Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Mon, 28 Apr 2025 16:19:13 +0800 Subject: [PATCH 33/67] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base-buildpackage/pom.xml | 6 ++++++ .../src/main/resources/application-xel.yml | 14 -------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/base-buildpackage/pom.xml b/base-buildpackage/pom.xml index 1a317d04..2467d45d 100644 --- a/base-buildpackage/pom.xml +++ b/base-buildpackage/pom.xml @@ -38,6 +38,12 @@ llg + + xel + + xel + + zqtlocal diff --git a/base-buildpackage/src/main/resources/application-xel.yml b/base-buildpackage/src/main/resources/application-xel.yml index e53ca4c4..6deabd35 100644 --- a/base-buildpackage/src/main/resources/application-xel.yml +++ b/base-buildpackage/src/main/resources/application-xel.yml @@ -19,17 +19,3 @@ spring: savefile: # 文件保存路径 path: /Users/xiangerlin/work/app/file/dev -cbs8: - appId: 1P4AGrpz - appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a - url: https://cbs8-openapi-reprd.csuat.cmburl.cn - # 测试用这个 这个是银行给的,和下面的公钥不是一对密钥 - ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44 - # 这个私钥到时候上传到cbs,和下面到是同一对 - #ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46 - ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde - cbs_public_key: 0469146F06BF3B01236E84632441E826F3067A6B93BC3839C836A06007869CD351FBBE388B51F742859388BBC1DE089923AAFBC69E448F15141DDF30EE6CE90185 - #电子回单下载临时存放位置 - elec_path: /Users/xiangerlin/Downloads/ -OA: - data_source_code: yc-test From d2c824e64d004511a1c0444471a4cd9e61aac121 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 29 Apr 2025 18:18:27 +0800 Subject: [PATCH 34/67] =?UTF-8?q?=E7=BB=91=E5=AE=9A=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E8=B0=83=E6=95=B4=EF=BC=8Cupdate=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E6=97=B6=20=E4=B8=8D=E5=A4=84=E7=90=86create=5Fuser?= =?UTF-8?q?=5Fid=E5=92=8Ccreate=5Ftime=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hzya/frame/web/aop/BindUserIdAop.java | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/base-service/src/main/java/com/hzya/frame/web/aop/BindUserIdAop.java b/base-service/src/main/java/com/hzya/frame/web/aop/BindUserIdAop.java index ba79308d..ae6c0199 100644 --- a/base-service/src/main/java/com/hzya/frame/web/aop/BindUserIdAop.java +++ b/base-service/src/main/java/com/hzya/frame/web/aop/BindUserIdAop.java @@ -10,6 +10,7 @@ import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; @@ -38,6 +39,9 @@ public class BindUserIdAop { if (StpUtil.isLogin()) { Object loginId = StpUtil.getLoginId(); Object obj = objs[0]; + // 获取方法签名 + MethodSignature signature = (MethodSignature) point.getSignature(); + String methodName = signature.getName(); if (obj instanceof HashMap) { ((HashMap) obj).put("create_user_id",loginId); ((HashMap) obj).put("modify_user_id",loginId); @@ -51,20 +55,24 @@ public class BindUserIdAop { jsonStrObj = JSON.parseObject(jsonStr); } if(null != jsonStrObj){ - if (jsonStrObj.getString("create_user_id") == null) { - jsonStrObj.put("create_user_id",loginId); - } + //如果是update的方法,则不处理create_user_id 和 create_time if (jsonStrObj.getString("modify_user_id") == null) { jsonStrObj.put("modify_user_id",loginId); } - if (jsonStrObj.getString("create_time") == null) { - jsonStrObj.put("create_time",DateUtil.now()); - } if (jsonStrObj.getString("modify_time") == null) { jsonStrObj.put("modify_time",DateUtil.now()); } - if (jsonStrObj.getString("id") == null) { - jsonStrObj.put("id",UUIDLong.longUUID()); + //save方法才要赋值create_user_id 和 creat_time id + if (methodName.startsWith("save")){ + if (jsonStrObj.getString("create_user_id") == null) { + jsonStrObj.put("create_user_id",loginId); + } + if (jsonStrObj.getString("create_time") == null) { + jsonStrObj.put("create_time",DateUtil.now()); + } + if (jsonStrObj.getString("id") == null) { + jsonStrObj.put("id",UUIDLong.longUUID()); + } } }else{ jsonStrObj = new JSONObject(); From 234a2e4efb1f4d5514a285efd762b10f9bce216c Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 6 May 2025 09:31:02 +0800 Subject: [PATCH 35/67] =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E5=99=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/sys/flow/dao/ISysFlowClassDao.java | 15 + .../sys/flow/dao/ISysFlowClassRuleDao.java | 15 + .../hzya/frame/sys/flow/dao/ISysFlowDao.java | 15 + .../sys/flow/dao/ISysFlowNifiConstantDao.java | 15 + .../sys/flow/dao/ISysFlowStepAccountDao.java | 15 + .../sys/flow/dao/ISysFlowStepConfigBDao.java | 15 + .../sys/flow/dao/ISysFlowStepConfigDao.java | 15 + .../frame/sys/flow/dao/ISysFlowStepDao.java | 15 + .../sys/flow/dao/ISysFlowStepRelationDao.java | 15 + .../flow/dao/impl/SysFlowClassDaoImpl.java | 17 + .../dao/impl/SysFlowClassRuleDaoImpl.java | 17 + .../sys/flow/dao/impl/SysFlowDaoImpl.java | 17 + .../dao/impl/SysFlowNifiConstantDaoImpl.java | 17 + .../dao/impl/SysFlowStepAccountDaoImpl.java | 17 + .../dao/impl/SysFlowStepConfigBDaoImpl.java | 17 + .../dao/impl/SysFlowStepConfigDaoImpl.java | 17 + .../sys/flow/dao/impl/SysFlowStepDaoImpl.java | 17 + .../dao/impl/SysFlowStepRelationDaoImpl.java | 17 + .../sys/flow/entity/SysFlowClassEntity.java | 36 +++ .../sys/flow/entity/SysFlowClassEntity.xml | 193 +++++++++++ .../flow/entity/SysFlowClassRuleEntity.java | 75 +++++ .../flow/entity/SysFlowClassRuleEntity.xml | 247 ++++++++++++++ .../frame/sys/flow/entity/SysFlowEntity.java | 74 +++++ .../frame/sys/flow/entity/SysFlowEntity.xml | 234 ++++++++++++++ .../entity/SysFlowNifiConstantEntity.java | 66 ++++ .../flow/entity/SysFlowNifiConstantEntity.xml | 226 +++++++++++++ .../flow/entity/SysFlowStepAccountEntity.java | 126 ++++++++ .../flow/entity/SysFlowStepAccountEntity.xml | 292 +++++++++++++++++ .../flow/entity/SysFlowStepConfigBEntity.java | 126 ++++++++ .../flow/entity/SysFlowStepConfigBEntity.xml | 292 +++++++++++++++++ .../flow/entity/SysFlowStepConfigEntity.java | 136 ++++++++ .../flow/entity/SysFlowStepConfigEntity.xml | 303 ++++++++++++++++++ .../sys/flow/entity/SysFlowStepEntity.java | 116 +++++++ .../sys/flow/entity/SysFlowStepEntity.xml | 281 ++++++++++++++++ .../entity/SysFlowStepRelationEntity.java | 76 +++++ .../flow/entity/SysFlowStepRelationEntity.xml | 237 ++++++++++++++ .../service/ISysFlowClassRuleService.java | 50 +++ .../flow/service/ISysFlowClassService.java | 36 +++ .../service/ISysFlowNifiConstantService.java | 36 +++ .../sys/flow/service/ISysFlowService.java | 12 + .../service/ISysFlowStepAccountService.java | 12 + .../service/ISysFlowStepConfigBService.java | 12 + .../service/ISysFlowStepConfigService.java | 12 + .../service/ISysFlowStepRelationService.java | 12 + .../sys/flow/service/ISysFlowStepService.java | 12 + .../impl/SysFlowClassRuleServiceImpl.java | 174 ++++++++++ .../service/impl/SysFlowClassServiceImpl.java | 136 ++++++++ .../impl/SysFlowNifiConstantServiceImpl.java | 135 ++++++++ .../flow/service/impl/SysFlowServiceImpl.java | 26 ++ .../impl/SysFlowStepAccountServiceImpl.java | 26 ++ .../impl/SysFlowStepConfigBServiceImpl.java | 26 ++ .../impl/SysFlowStepConfigServiceImpl.java | 26 ++ .../impl/SysFlowStepRelationServiceImpl.java | 26 ++ .../service/impl/SysFlowStepServiceImpl.java | 26 ++ 54 files changed, 4219 insertions(+) create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowClassDao.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowClassRuleDao.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowDao.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowNifiConstantDao.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowStepAccountDao.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowStepConfigBDao.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowStepConfigDao.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowStepDao.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowStepRelationDao.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowClassDaoImpl.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowClassRuleDaoImpl.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowDaoImpl.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowNifiConstantDaoImpl.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowStepAccountDaoImpl.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowStepConfigBDaoImpl.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowStepConfigDaoImpl.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowStepDaoImpl.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowStepRelationDaoImpl.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowClassEntity.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowClassEntity.xml create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowClassRuleEntity.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowClassRuleEntity.xml create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowEntity.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowEntity.xml create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowNifiConstantEntity.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowNifiConstantEntity.xml create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepAccountEntity.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepAccountEntity.xml create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigBEntity.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigBEntity.xml create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigEntity.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigEntity.xml create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.xml create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepRelationEntity.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepRelationEntity.xml create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowClassRuleService.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowClassService.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowNifiConstantService.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowService.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowStepAccountService.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowStepConfigBService.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowStepConfigService.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowStepRelationService.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowStepService.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowClassRuleServiceImpl.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowClassServiceImpl.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowNifiConstantServiceImpl.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowServiceImpl.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowStepAccountServiceImpl.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowStepConfigBServiceImpl.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowStepConfigServiceImpl.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowStepRelationServiceImpl.java create mode 100644 base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowStepServiceImpl.java diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowClassDao.java b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowClassDao.java new file mode 100644 index 00000000..9437bf82 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowClassDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.sys.flow.dao; + +import com.hzya.frame.sys.flow.entity.SysFlowClassEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 流程分类;对应数环通项目分类(sys_flow_class: table)表数据库访问层 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +public interface ISysFlowClassDao extends IBaseDao { + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowClassRuleDao.java b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowClassRuleDao.java new file mode 100644 index 00000000..6359bb58 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowClassRuleDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.sys.flow.dao; + +import com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 流程分类权限表(sys_flow_class_rule: table)表数据库访问层 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +public interface ISysFlowClassRuleDao extends IBaseDao { + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowDao.java b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowDao.java new file mode 100644 index 00000000..985be186 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.sys.flow.dao; + +import com.hzya.frame.sys.flow.entity.SysFlowEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 流程主表;流程就是数环通的Linkup(sys_flow: table)表数据库访问层 + * + * @author xiang2lin + * @since 2025-04-29 10:16:19 + */ +public interface ISysFlowDao extends IBaseDao { + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowNifiConstantDao.java b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowNifiConstantDao.java new file mode 100644 index 00000000..b7c829ce --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowNifiConstantDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.sys.flow.dao; + +import com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * nifi常量(sys_flow_nifi_constant: table)表数据库访问层 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +public interface ISysFlowNifiConstantDao extends IBaseDao { + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowStepAccountDao.java b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowStepAccountDao.java new file mode 100644 index 00000000..d5a3c40f --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowStepAccountDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.sys.flow.dao; + +import com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 流程步骤账户表(sys_flow_step_account: table)表数据库访问层 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +public interface ISysFlowStepAccountDao extends IBaseDao { + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowStepConfigBDao.java b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowStepConfigBDao.java new file mode 100644 index 00000000..68042e35 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowStepConfigBDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.sys.flow.dao; + +import com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 映射信息表体(sys_flow_step_config_b: table)表数据库访问层 + * + * @author xiang2lin + * @since 2025-04-29 10:16:28 + */ +public interface ISysFlowStepConfigBDao extends IBaseDao { + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowStepConfigDao.java b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowStepConfigDao.java new file mode 100644 index 00000000..70f0cd14 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowStepConfigDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.sys.flow.dao; + +import com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 映射信息主表(sys_flow_step_config: table)表数据库访问层 + * + * @author xiang2lin + * @since 2025-04-29 10:16:28 + */ +public interface ISysFlowStepConfigDao extends IBaseDao { + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowStepDao.java b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowStepDao.java new file mode 100644 index 00000000..52f0a3d5 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowStepDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.sys.flow.dao; + +import com.hzya.frame.sys.flow.entity.SysFlowStepEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 流程步骤信息(sys_flow_step: table)表数据库访问层 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +public interface ISysFlowStepDao extends IBaseDao { + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowStepRelationDao.java b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowStepRelationDao.java new file mode 100644 index 00000000..41bbb415 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/ISysFlowStepRelationDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.sys.flow.dao; + +import com.hzya.frame.sys.flow.entity.SysFlowStepRelationEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 步骤关联关系表(sys_flow_step_relation: table)表数据库访问层 + * + * @author xiang2lin + * @since 2025-04-29 10:16:28 + */ +public interface ISysFlowStepRelationDao extends IBaseDao { + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowClassDaoImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowClassDaoImpl.java new file mode 100644 index 00000000..ef35f356 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowClassDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.sys.flow.dao.impl; + +import com.hzya.frame.sys.flow.entity.SysFlowClassEntity; +import com.hzya.frame.sys.flow.dao.ISysFlowClassDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 流程分类;对应数环通项目分类(SysFlowClass)表数据库访问层 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +@Repository(value = "SysFlowClassDaoImpl") +public class SysFlowClassDaoImpl extends MybatisGenericDao implements ISysFlowClassDao{ + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowClassRuleDaoImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowClassRuleDaoImpl.java new file mode 100644 index 00000000..02ace295 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowClassRuleDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.sys.flow.dao.impl; + +import com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity; +import com.hzya.frame.sys.flow.dao.ISysFlowClassRuleDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 流程分类权限表(SysFlowClassRule)表数据库访问层 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +@Repository(value = "SysFlowClassRuleDaoImpl") +public class SysFlowClassRuleDaoImpl extends MybatisGenericDao implements ISysFlowClassRuleDao{ + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowDaoImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowDaoImpl.java new file mode 100644 index 00000000..9bd21c11 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.sys.flow.dao.impl; + +import com.hzya.frame.sys.flow.entity.SysFlowEntity; +import com.hzya.frame.sys.flow.dao.ISysFlowDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 流程主表;流程就是数环通的Linkup(SysFlow)表数据库访问层 + * + * @author xiang2lin + * @since 2025-04-29 10:16:21 + */ +@Repository(value = "SysFlowDaoImpl") +public class SysFlowDaoImpl extends MybatisGenericDao implements ISysFlowDao{ + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowNifiConstantDaoImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowNifiConstantDaoImpl.java new file mode 100644 index 00000000..628b92fb --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowNifiConstantDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.sys.flow.dao.impl; + +import com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity; +import com.hzya.frame.sys.flow.dao.ISysFlowNifiConstantDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * nifi常量(SysFlowNifiConstant)表数据库访问层 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +@Repository(value = "SysFlowNifiConstantDaoImpl") +public class SysFlowNifiConstantDaoImpl extends MybatisGenericDao implements ISysFlowNifiConstantDao{ + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowStepAccountDaoImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowStepAccountDaoImpl.java new file mode 100644 index 00000000..2c9f580a --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowStepAccountDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.sys.flow.dao.impl; + +import com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity; +import com.hzya.frame.sys.flow.dao.ISysFlowStepAccountDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 流程步骤账户表(SysFlowStepAccount)表数据库访问层 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +@Repository(value = "SysFlowStepAccountDaoImpl") +public class SysFlowStepAccountDaoImpl extends MybatisGenericDao implements ISysFlowStepAccountDao{ + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowStepConfigBDaoImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowStepConfigBDaoImpl.java new file mode 100644 index 00000000..377098c8 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowStepConfigBDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.sys.flow.dao.impl; + +import com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity; +import com.hzya.frame.sys.flow.dao.ISysFlowStepConfigBDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 映射信息表体(SysFlowStepConfigB)表数据库访问层 + * + * @author xiang2lin + * @since 2025-04-29 10:16:28 + */ +@Repository(value = "SysFlowStepConfigBDaoImpl") +public class SysFlowStepConfigBDaoImpl extends MybatisGenericDao implements ISysFlowStepConfigBDao{ + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowStepConfigDaoImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowStepConfigDaoImpl.java new file mode 100644 index 00000000..b3be492c --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowStepConfigDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.sys.flow.dao.impl; + +import com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity; +import com.hzya.frame.sys.flow.dao.ISysFlowStepConfigDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 映射信息主表(SysFlowStepConfig)表数据库访问层 + * + * @author xiang2lin + * @since 2025-04-29 10:16:28 + */ +@Repository(value = "SysFlowStepConfigDaoImpl") +public class SysFlowStepConfigDaoImpl extends MybatisGenericDao implements ISysFlowStepConfigDao{ + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowStepDaoImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowStepDaoImpl.java new file mode 100644 index 00000000..f25dc8fc --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowStepDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.sys.flow.dao.impl; + +import com.hzya.frame.sys.flow.entity.SysFlowStepEntity; +import com.hzya.frame.sys.flow.dao.ISysFlowStepDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 流程步骤信息(SysFlowStep)表数据库访问层 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +@Repository(value = "SysFlowStepDaoImpl") +public class SysFlowStepDaoImpl extends MybatisGenericDao implements ISysFlowStepDao{ + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowStepRelationDaoImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowStepRelationDaoImpl.java new file mode 100644 index 00000000..c47941b2 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/dao/impl/SysFlowStepRelationDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.sys.flow.dao.impl; + +import com.hzya.frame.sys.flow.entity.SysFlowStepRelationEntity; +import com.hzya.frame.sys.flow.dao.ISysFlowStepRelationDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * 步骤关联关系表(SysFlowStepRelation)表数据库访问层 + * + * @author xiang2lin + * @since 2025-04-29 10:16:28 + */ +@Repository(value = "SysFlowStepRelationDaoImpl") +public class SysFlowStepRelationDaoImpl extends MybatisGenericDao implements ISysFlowStepRelationDao{ + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowClassEntity.java b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowClassEntity.java new file mode 100644 index 00000000..ff75dbcc --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowClassEntity.java @@ -0,0 +1,36 @@ +package com.hzya.frame.sys.flow.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 流程分类;对应数环通项目分类(SysFlowClass)实体类 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +public class SysFlowClassEntity extends BaseEntity { + + /** 分类名称 */ + private String name; + /** 上级id */ + private String parentId; + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getParentId() { + return parentId; + } + + public void setParentId(String parentId) { + this.parentId = parentId; + } + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowClassEntity.xml b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowClassEntity.xml new file mode 100644 index 00000000..7cdda3a1 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowClassEntity.xml @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + id + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,name + ,parent_id + + + + + + + + + + + + + + + + insert into sys_flow_class( + + id , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + name , + parent_id , + sorts, + sts, + + )values( + + #{id} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{name} , + #{parentId} , + COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_class a WHERE a.sts = 'Y' ),1), + 'Y', + + ) + + + + insert into sys_flow_class(create_user_id, create_time, modify_user_id, modify_time, sts, name, parent_id, sts) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.parentId}, 'Y') + + + + + insert into sys_flow_class(create_user_id, create_time, modify_user_id, modify_time, sts, name, parent_id) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.parentId}) + + on duplicate key update + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + name = values(name), + parent_id = values(parent_id) + + +update sys_flow_class set + + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + name = #{name}, + parent_id = #{parentId}, + +where id = #{id} + + + +update sys_flow_class set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update sys_flow_class set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and sts = #{sts} + and name = #{name} + and parent_id = #{parentId} + and sts='Y' + + + + + delete from sys_flow_class where id = #{id} + + + + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowClassRuleEntity.java b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowClassRuleEntity.java new file mode 100644 index 00000000..cea32985 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowClassRuleEntity.java @@ -0,0 +1,75 @@ +package com.hzya.frame.sys.flow.entity; + +import java.util.Date; +import java.util.List; + +import com.hzya.frame.web.entity.BaseEntity; +/** + * 流程分类权限表(SysFlowClassRule)实体类 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +public class SysFlowClassRuleEntity extends BaseEntity { + + /** 流程分类id */ + private String flowClassId; + /** 用户id */ + private String userId; + /** 用户名 */ + private String userName; + /** 用户编码 */ + private String userCode; + /** 头像 */ + private String profileIcon; + //权限列表 + List ruleList; + public String getFlowClassId() { + return flowClassId; + } + + public void setFlowClassId(String flowClassId) { + this.flowClassId = flowClassId; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getUserCode() { + return userCode; + } + + public void setUserCode(String userCode) { + this.userCode = userCode; + } + + public String getProfileIcon() { + return profileIcon; + } + + public void setProfileIcon(String profileIcon) { + this.profileIcon = profileIcon; + } + + public List getRuleList() { + return ruleList; + } + + public void setRuleList(List ruleList) { + this.ruleList = ruleList; + } +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowClassRuleEntity.xml b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowClassRuleEntity.xml new file mode 100644 index 00000000..8ef807fe --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowClassRuleEntity.xml @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + + + + + id + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,flow_class_id + ,user_id + ,user_name + ,user_code + ,profile_icon + + + + + + + + + + + + + + + + insert into sys_flow_class_rule( + + id , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + flow_class_id , + user_id , + user_name , + user_code , + profile_icon , + sorts, + sts, + + )values( + + #{id} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{flowClassId} , + #{userId} , + #{userName} , + #{userCode} , + #{profileIcon} , + COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_class_rule a WHERE a.sts = 'Y' ),1), + 'Y', + + ) + + + + insert into sys_flow_class_rule(create_user_id, create_time, modify_user_id, modify_time, sts, flow_class_id, + user_id, user_name, user_code, profile_icon, sts) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.flowClassId},#{entity.userId},#{entity.userName},#{entity.userCode},#{entity.profileIcon}, + 'Y') + + + + + insert into sys_flow_class_rule(create_user_id, create_time, modify_user_id, modify_time, sts, flow_class_id, + user_id, user_name, user_code, profile_icon) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.flowClassId},#{entity.userId},#{entity.userName},#{entity.userCode},#{entity.profileIcon}) + + on duplicate key update + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + flow_class_id = values(flow_class_id), + user_id = values(user_id), + user_name = values(user_name), + user_code = values(user_code), + profile_icon = values(profile_icon) + + + + update sys_flow_class_rule set + + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + flow_class_id = #{flowClassId}, + user_id = #{userId}, + user_name = #{userName}, + user_code = #{userCode}, + profile_icon = #{profileIcon}, + + where id = #{id} + + + + update sys_flow_class_rule + set sts= 'N', + modify_time = #{modify_time}, + modify_user_id = #{modify_user_id} + where id = #{id} + + + + update sys_flow_class_rule set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and sts = #{sts} + and flow_class_id = #{flowClassId} + and user_id = #{userId} + and user_name = #{userName} + and user_code = #{userCode} + and profile_icon = #{profileIcon} + and sts='Y' + + + + + delete + from sys_flow_class_rule + where id = #{id} + + + + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowEntity.java b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowEntity.java new file mode 100644 index 00000000..d8527213 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowEntity.java @@ -0,0 +1,74 @@ +package com.hzya.frame.sys.flow.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 流程主表;流程就是数环通的Linkup(SysFlow)实体类 + * + * @author xiang2lin + * @since 2025-04-29 10:16:23 + */ +public class SysFlowEntity extends BaseEntity { + + /** 流程名称 */ + private String name; + /** 流程分类id */ + private String classId; + /** 触发方式id */ + private String triggerModeId; + /** 应用组id */ + private String nifiGroupId; + /** 流程描述 */ + private String description; + + //状态, 启动/停止 + private String status; + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getClassId() { + return classId; + } + + public void setClassId(String classId) { + this.classId = classId; + } + + public String getTriggerModeId() { + return triggerModeId; + } + + public void setTriggerModeId(String triggerModeId) { + this.triggerModeId = triggerModeId; + } + + public String getNifiGroupId() { + return nifiGroupId; + } + + public void setNifiGroupId(String nifiGroupId) { + this.nifiGroupId = nifiGroupId; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowEntity.xml b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowEntity.xml new file mode 100644 index 00000000..ff41d4bd --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowEntity.xml @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + + + id + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,name + ,status + ,class_id + ,trigger_mode_id + ,nifi_group_id + ,description + + + + + + + + + + + + + + + + insert into sys_flow( + + id , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + name , + status , + class_id , + trigger_mode_id , + nifi_group_id , + description , + sorts, + sts, + + )values( + + #{id} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{name} , + #{classId} , + #{triggerModeId} , + #{nifiGroupId} , + #{description} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into sys_flow(create_user_id, create_time, modify_user_id, modify_time, sts, name,status, class_id, trigger_mode_id, nifi_group_id, description, sts) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},${entity.status},#{entity.classId},#{entity.triggerModeId},#{entity.nifiGroupId},#{entity.description}, 'Y') + + + + + insert into sys_flow(create_user_id, create_time, modify_user_id, modify_time, sts, name, status,class_id, trigger_mode_id, nifi_group_id, description) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.status},#{entity.classId},#{entity.triggerModeId},#{entity.nifiGroupId},#{entity.description}) + + on duplicate key update + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + name = values(name), + class_id = values(class_id), + trigger_mode_id = values(trigger_mode_id), + nifi_group_id = values(nifi_group_id), + description = values(description) + + +update sys_flow set + + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + name = #{name}, + status = #{status}, + class_id = #{classId}, + trigger_mode_id = #{triggerModeId}, + nifi_group_id = #{nifiGroupId}, + description = #{description}, + +where id = #{id} + + + +update sys_flow set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update sys_flow set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and sts = #{sts} + and name = #{name} + and class_id = #{classId} + and trigger_mode_id = #{triggerModeId} + and nifi_group_id = #{nifiGroupId} + and description = #{description} + and sts='Y' + + + + + delete from sys_flow where id = #{id} + + + + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowNifiConstantEntity.java b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowNifiConstantEntity.java new file mode 100644 index 00000000..1935fe3a --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowNifiConstantEntity.java @@ -0,0 +1,66 @@ +package com.hzya.frame.sys.flow.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * nifi常量(SysFlowNifiConstant)实体类 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +public class SysFlowNifiConstantEntity extends BaseEntity { + + /** 键 */ + private String nifiKey; + /** 值 */ + private String nifiValue; + /** 显示值 */ + private String showValue; + /** 描述 */ + private String description; + /** 分类 */ + private String type; + + + public String getNifiKey() { + return nifiKey; + } + + public void setNifiKey(String nifiKey) { + this.nifiKey = nifiKey; + } + + public String getNifiValue() { + return nifiValue; + } + + public void setNifiValue(String nifiValue) { + this.nifiValue = nifiValue; + } + + public String getShowValue() { + return showValue; + } + + public void setShowValue(String showValue) { + this.showValue = showValue; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowNifiConstantEntity.xml b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowNifiConstantEntity.xml new file mode 100644 index 00000000..08a53105 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowNifiConstantEntity.xml @@ -0,0 +1,226 @@ + + + + + + + + + + + + + + + + + + + + id + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,nifi_key + ,nifi_value + ,show_value + ,description + ,type + + + + + + + + + + + + + + + + insert into sys_flow_nifi_constant( + + id , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + nifi_key , + nifi_value , + show_value , + description , + type , + sorts, + sts, + + )values( + + #{id} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{nifiKey} , + #{nifiValue} , + #{showValue} , + #{description} , + #{type} , + COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_nifi_constant a WHERE a.sts = 'Y' ),1), + 'Y', + + ) + + + + insert into sys_flow_nifi_constant(create_user_id, create_time, modify_user_id, modify_time, sts, nifi_key, nifi_value, show_value, description, type, sts) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.nifiKey},#{entity.nifiValue},#{entity.showValue},#{entity.description},#{entity.type}, 'Y') + + + + + insert into sys_flow_nifi_constant(create_user_id, create_time, modify_user_id, modify_time, sts, nifi_key, nifi_value, show_value, description, type) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.nifiKey},#{entity.nifiValue},#{entity.showValue},#{entity.description},#{entity.type}) + + on duplicate key update + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + nifi_key = values(nifiKey), + nifi_value = values(nifiValue), + show_value = values(show_value), + description = values(description), + type = values(type) + + +update sys_flow_nifi_constant set + + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + nifi_key = #{nifiKey}, + nifi_value = #{nifiValue}, + show_value = #{showValue}, + description = #{description}, + type = #{type}, + +where id = #{id} + + + +update sys_flow_nifi_constant set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update sys_flow_nifi_constant set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and sts = #{sts} + andnifi_ key = #{nifiKey} + and nifi_value = #{nifiValue} + and show_value = #{showValue} + and description = #{description} + and type = #{type} + and sts='Y' + + + + + delete from sys_flow_nifi_constant where id = #{id} + + + + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepAccountEntity.java b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepAccountEntity.java new file mode 100644 index 00000000..246f11f4 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepAccountEntity.java @@ -0,0 +1,126 @@ +package com.hzya.frame.sys.flow.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 流程步骤账户表(SysFlowStepAccount)实体类 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +public class SysFlowStepAccountEntity extends BaseEntity { + + /** 账户名称 */ + private String name; + /** ip地址 */ + private String ipAddress; + /** 端口 */ + private String port; + /** 数据库名称 */ + private String dbName; + /** 用户名 */ + private String userName; + /** 密码 */ + private String password; + /** 数据库类型 */ + private String dbType; + /** 应用key */ + private String appKey; + /** 应用密钥 */ + private String appSecret; + /** 企业id */ + private String corpid; + /** 应用id */ + private String agentid; + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getIpAddress() { + return ipAddress; + } + + public void setIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + } + + public String getPort() { + return port; + } + + public void setPort(String port) { + this.port = port; + } + + public String getDbName() { + return dbName; + } + + public void setDbName(String dbName) { + this.dbName = dbName; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getDbType() { + return dbType; + } + + public void setDbType(String dbType) { + this.dbType = dbType; + } + + public String getAppKey() { + return appKey; + } + + public void setAppKey(String appKey) { + this.appKey = appKey; + } + + public String getAppSecret() { + return appSecret; + } + + public void setAppSecret(String appSecret) { + this.appSecret = appSecret; + } + + public String getCorpid() { + return corpid; + } + + public void setCorpid(String corpid) { + this.corpid = corpid; + } + + public String getAgentid() { + return agentid; + } + + public void setAgentid(String agentid) { + this.agentid = agentid; + } + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepAccountEntity.xml b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepAccountEntity.xml new file mode 100644 index 00000000..777a9aaa --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepAccountEntity.xml @@ -0,0 +1,292 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + id + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,name + ,ip_address + ,port + ,db_name + ,user_name + ,password + ,db_type + ,app_key + ,app_secret + ,corpId + ,agentId + + + + + + + + + + + + + + + + insert into sys_flow_step_account( + + id , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + name , + ip_address , + port , + db_name , + user_name , + password , + db_type , + app_key , + app_secret , + corpId , + agentId , + sorts, + sts, + + )values( + + #{id} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{name} , + #{ipAddress} , + #{port} , + #{dbName} , + #{userName} , + #{password} , + #{dbType} , + #{appKey} , + #{appSecret} , + #{corpid} , + #{agentid} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step_account a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into sys_flow_step_account(create_user_id, create_time, modify_user_id, modify_time, sts, name, ip_address, port, db_name, user_name, password, db_type, app_key, app_secret, corpId, agentId, sts) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.ipAddress},#{entity.port},#{entity.dbName},#{entity.userName},#{entity.password},#{entity.dbType},#{entity.appKey},#{entity.appSecret},#{entity.corpid},#{entity.agentid}, 'Y') + + + + + insert into sys_flow_step_account(create_user_id, create_time, modify_user_id, modify_time, sts, name, ip_address, port, db_name, user_name, password, db_type, app_key, app_secret, corpId, agentId) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.ipAddress},#{entity.port},#{entity.dbName},#{entity.userName},#{entity.password},#{entity.dbType},#{entity.appKey},#{entity.appSecret},#{entity.corpid},#{entity.agentid}) + + on duplicate key update + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + name = values(name), + ip_address = values(ip_address), + port = values(port), + db_name = values(db_name), + user_name = values(user_name), + password = values(password), + db_type = values(db_type), + app_key = values(app_key), + app_secret = values(app_secret), + corpId = values(corpId), + agentId = values(agentId) + + +update sys_flow_step_account set + + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + name = #{name}, + ip_address = #{ipAddress}, + port = #{port}, + db_name = #{dbName}, + user_name = #{userName}, + password = #{password}, + db_type = #{dbType}, + app_key = #{appKey}, + app_secret = #{appSecret}, + corpId = #{corpid}, + agentId = #{agentid}, + +where id = #{id} + + + +update sys_flow_step_account set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update sys_flow_step_account set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and sts = #{sts} + and name = #{name} + and ip_address = #{ipAddress} + and port = #{port} + and db_name = #{dbName} + and user_name = #{userName} + and password = #{password} + and db_type = #{dbType} + and app_key = #{appKey} + and app_secret = #{appSecret} + and corpId = #{corpid} + and agentId = #{agentid} + and sts='Y' + + + + + delete from sys_flow_step_account where id = #{id} + + + + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigBEntity.java b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigBEntity.java new file mode 100644 index 00000000..89e9bcda --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigBEntity.java @@ -0,0 +1,126 @@ +package com.hzya.frame.sys.flow.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 映射信息表体(SysFlowStepConfigB)实体类 + * + * @author xiang2lin + * @since 2025-04-29 10:16:28 + */ +public class SysFlowStepConfigBEntity extends BaseEntity { + + /** 主表id */ + private String mainId; + /** 流程id */ + private String flowId; + /** 步骤id */ + private String stepId; + /** 是否主键 */ + private String primaryKeyFlag; + /** 字段名 */ + private String fieldName; + /** 字段备注 */ + private String fieldDescription; + /** 字段类型 */ + private String fieldType; + /** 查询条件 */ + private String whereCondition; + /** 源字段名称;适用于插入场景 */ + private String sourceFieldName; + /** 源字段类型;适用于插入场景 */ + private String sourceFieldType; + /** 源字段描述;适用于插入场景 */ + private String sourceFieldDescription; + + + public String getMainId() { + return mainId; + } + + public void setMainId(String mainId) { + this.mainId = mainId; + } + + public String getFlowId() { + return flowId; + } + + public void setFlowId(String flowId) { + this.flowId = flowId; + } + + public String getStepId() { + return stepId; + } + + public void setStepId(String stepId) { + this.stepId = stepId; + } + + public String getPrimaryKeyFlag() { + return primaryKeyFlag; + } + + public void setPrimaryKeyFlag(String primaryKeyFlag) { + this.primaryKeyFlag = primaryKeyFlag; + } + + public String getFieldName() { + return fieldName; + } + + public void setFieldName(String fieldName) { + this.fieldName = fieldName; + } + + public String getFieldDescription() { + return fieldDescription; + } + + public void setFieldDescription(String fieldDescription) { + this.fieldDescription = fieldDescription; + } + + public String getFieldType() { + return fieldType; + } + + public void setFieldType(String fieldType) { + this.fieldType = fieldType; + } + + public String getWhereCondition() { + return whereCondition; + } + + public void setWhereCondition(String whereCondition) { + this.whereCondition = whereCondition; + } + + public String getSourceFieldName() { + return sourceFieldName; + } + + public void setSourceFieldName(String sourceFieldName) { + this.sourceFieldName = sourceFieldName; + } + + public String getSourceFieldType() { + return sourceFieldType; + } + + public void setSourceFieldType(String sourceFieldType) { + this.sourceFieldType = sourceFieldType; + } + + public String getSourceFieldDescription() { + return sourceFieldDescription; + } + + public void setSourceFieldDescription(String sourceFieldDescription) { + this.sourceFieldDescription = sourceFieldDescription; + } + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigBEntity.xml b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigBEntity.xml new file mode 100644 index 00000000..dece2c36 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigBEntity.xml @@ -0,0 +1,292 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + id + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,main_id + ,flow_id + ,step_id + ,primary_key_flag + ,field_name + ,field_description + ,field_type + ,where_condition + ,source_field_name + ,source_field_type + ,source_field_description + + + + + + + + + + + + + + + + insert into sys_flow_step_config_b( + + id , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + main_id , + flow_id , + step_id , + primary_key_flag , + field_name , + field_description , + field_type , + where_condition , + source_field_name , + source_field_type , + source_field_description , + sorts, + sts, + + )values( + + #{id} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{mainId} , + #{flowId} , + #{stepId} , + #{primaryKeyFlag} , + #{fieldName} , + #{fieldDescription} , + #{fieldType} , + #{whereCondition} , + #{sourceFieldName} , + #{sourceFieldType} , + #{sourceFieldDescription} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step_config_b a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into sys_flow_step_config_b(create_user_id, create_time, modify_user_id, modify_time, sts, main_id, flow_id, step_id, primary_key_flag, field_name, field_description, field_type, where_condition, source_field_name, source_field_type, source_field_description, sts) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.mainId},#{entity.flowId},#{entity.stepId},#{entity.primaryKeyFlag},#{entity.fieldName},#{entity.fieldDescription},#{entity.fieldType},#{entity.whereCondition},#{entity.sourceFieldName},#{entity.sourceFieldType},#{entity.sourceFieldDescription}, 'Y') + + + + + insert into sys_flow_step_config_b(create_user_id, create_time, modify_user_id, modify_time, sts, main_id, flow_id, step_id, primary_key_flag, field_name, field_description, field_type, where_condition, source_field_name, source_field_type, source_field_description) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.mainId},#{entity.flowId},#{entity.stepId},#{entity.primaryKeyFlag},#{entity.fieldName},#{entity.fieldDescription},#{entity.fieldType},#{entity.whereCondition},#{entity.sourceFieldName},#{entity.sourceFieldType},#{entity.sourceFieldDescription}) + + on duplicate key update + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + main_id = values(main_id), + flow_id = values(flow_id), + step_id = values(step_id), + primary_key_flag = values(primary_key_flag), + field_name = values(field_name), + field_description = values(field_description), + field_type = values(field_type), + where_condition = values(where_condition), + source_field_name = values(source_field_name), + source_field_type = values(source_field_type), + source_field_description = values(source_field_description) + + +update sys_flow_step_config_b set + + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + main_id = #{mainId}, + flow_id = #{flowId}, + step_id = #{stepId}, + primary_key_flag = #{primaryKeyFlag}, + field_name = #{fieldName}, + field_description = #{fieldDescription}, + field_type = #{fieldType}, + where_condition = #{whereCondition}, + source_field_name = #{sourceFieldName}, + source_field_type = #{sourceFieldType}, + source_field_description = #{sourceFieldDescription}, + +where id = #{id} + + + +update sys_flow_step_config_b set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update sys_flow_step_config_b set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and sts = #{sts} + and main_id = #{mainId} + and flow_id = #{flowId} + and step_id = #{stepId} + and primary_key_flag = #{primaryKeyFlag} + and field_name = #{fieldName} + and field_description = #{fieldDescription} + and field_type = #{fieldType} + and where_condition = #{whereCondition} + and source_field_name = #{sourceFieldName} + and source_field_type = #{sourceFieldType} + and source_field_description = #{sourceFieldDescription} + and sts='Y' + + + + + delete from sys_flow_step_config_b where id = #{id} + + + + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigEntity.java b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigEntity.java new file mode 100644 index 00000000..e8e426d9 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigEntity.java @@ -0,0 +1,136 @@ +package com.hzya.frame.sys.flow.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 映射信息主表(SysFlowStepConfig)实体类 + * + * @author xiang2lin + * @since 2025-04-29 10:16:28 + */ +public class SysFlowStepConfigEntity extends BaseEntity { + + /** 流程id */ + private String flowId; + /** 步骤id */ + private String stepId; + /** 流程操作步骤配置表id */ + private String setpConfigId; + /** 操作类型 */ + private String actionName; + /** 数据库类型;数据库类型+版本 */ + private String dbType; + /** 表名称 */ + private String tableName; + /** 页码 */ + private String rowNum; + /** 每页条数 */ + private String pageLimit; + /** 增量数据字段;例如ts */ + private String maxValueField; + /** 是否建表 */ + private String createTableFlag; + /** 写入模式;覆盖写入/增量写入 */ + private String writeType; + /** 动态sql语句 */ + private String sqlStatement; + + + public String getFlowId() { + return flowId; + } + + public void setFlowId(String flowId) { + this.flowId = flowId; + } + + public String getStepId() { + return stepId; + } + + public void setStepId(String stepId) { + this.stepId = stepId; + } + + public String getSetpConfigId() { + return setpConfigId; + } + + public void setSetpConfigId(String setpConfigId) { + this.setpConfigId = setpConfigId; + } + + public String getActionName() { + return actionName; + } + + public void setActionName(String actionName) { + this.actionName = actionName; + } + + public String getDbType() { + return dbType; + } + + public void setDbType(String dbType) { + this.dbType = dbType; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getRowNum() { + return rowNum; + } + + public void setRowNum(String rowNum) { + this.rowNum = rowNum; + } + + public String getpageLimit() { + return pageLimit; + } + + public void setpageLimit(String pageLimit) { + this.pageLimit = pageLimit; + } + + public String getMaxValueField() { + return maxValueField; + } + + public void setMaxValueField(String maxValueField) { + this.maxValueField = maxValueField; + } + + public String getCreateTableFlag() { + return createTableFlag; + } + + public void setCreateTableFlag(String createTableFlag) { + this.createTableFlag = createTableFlag; + } + + public String getWriteType() { + return writeType; + } + + public void setWriteType(String writeType) { + this.writeType = writeType; + } + + public String getSqlStatement() { + return sqlStatement; + } + + public void setSqlStatement(String sqlStatement) { + this.sqlStatement = sqlStatement; + } + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigEntity.xml b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigEntity.xml new file mode 100644 index 00000000..2316ff22 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigEntity.xml @@ -0,0 +1,303 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + id + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,flow_id + ,step_id + ,setp_config_id + ,action_name + ,db_type + ,table_name + ,row_num + ,page_limit + ,max_value_field + ,create_table_flag + ,write_type + ,sql_statement + + + + + + + + + + + + + + + + insert into sys_flow_step_config( + + id , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + flow_id , + step_id , + setp_config_id , + action_name , + db_type , + table_name , + row_num , + page_limit , + max_value_field , + create_table_flag , + write_type , + sql_statement , + sorts, + sts, + + )values( + + #{id} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{flowId} , + #{stepId} , + #{setpConfigId} , + #{actionName} , + #{dbType} , + #{tableName} , + #{rowNum} , + #{pageLimit} , + #{maxValueField} , + #{createTableFlag} , + #{writeType} , + #{sqlStatement} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step_config a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into sys_flow_step_config(create_user_id, create_time, modify_user_id, modify_time, sts, flow_id, step_id, setp_config_id, action_name, db_type, table_name, row_num, page_limit, max_value_field, create_table_flag, write_type, sql_statement, sts) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.flowId},#{entity.stepId},#{entity.setpConfigId},#{entity.actionName},#{entity.dbType},#{entity.tableName},#{entity.rowNum},#{entity.pageLimit},#{entity.maxValueField},#{entity.createTableFlag},#{entity.writeType},#{entity.sqlStatement}, 'Y') + + + + + insert into sys_flow_step_config(create_user_id, create_time, modify_user_id, modify_time, sts, flow_id, step_id, setp_config_id, action_name, db_type, table_name, row_num, page_limit, max_value_field, create_table_flag, write_type, sql_statement) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.flowId},#{entity.stepId},#{entity.setpConfigId},#{entity.actionName},#{entity.dbType},#{entity.tableName},#{entity.rowNum},#{entity.pageLimit},#{entity.maxValueField},#{entity.createTableFlag},#{entity.writeType},#{entity.sqlStatement}) + + on duplicate key update + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + flow_id = values(flow_id), + step_id = values(step_id), + setp_config_id = values(setp_config_id), + action_name = values(action_name), + db_type = values(db_type), + table_name = values(table_name), + row_num = values(row_num), + page_limit = values(page_limit), + max_value_field = values(max_value_field), + create_table_flag = values(create_table_flag), + write_type = values(write_type), + sql_statement = values(sql_statement) + + +update sys_flow_step_config set + + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + flow_id = #{flowId}, + step_id = #{stepId}, + setp_config_id = #{setpConfigId}, + action_name = #{actionName}, + db_type = #{dbType}, + table_name = #{tableName}, + row_num = #{rowNum}, + page_limit = #{pageLimit}, + max_value_field = #{maxValueField}, + create_table_flag = #{createTableFlag}, + write_type = #{writeType}, + sql_statement = #{sqlStatement}, + +where id = #{id} + + + +update sys_flow_step_config set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update sys_flow_step_config set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and sts = #{sts} + and flow_id = #{flowId} + and step_id = #{stepId} + and setp_config_id = #{setpConfigId} + and action_name = #{actionName} + and db_type = #{dbType} + and table_name = #{tableName} + and row_num = #{rowNum} + and page_limit = #{pageLimit} + and max_value_field = #{maxValueField} + and create_table_flag = #{createTableFlag} + and write_type = #{writeType} + and sql_statement = #{sqlStatement} + and sts='Y' + + + + + delete from sys_flow_step_config where id = #{id} + + + + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.java b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.java new file mode 100644 index 00000000..52e7b316 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.java @@ -0,0 +1,116 @@ +package com.hzya.frame.sys.flow.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 流程步骤信息(SysFlowStep)实体类 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +public class SysFlowStepEntity extends BaseEntity { + + /** 步骤序号 */ + private Integer step; + /** 步骤类型;1定时任务2数据库3应用 */ + private String stepType; + /** 描述 */ + private String description; + /** 操作动作(名称);api名称/插件名称 */ + private String apiName; + /** 操作动作类型;api/插件 */ + private String actionType; + /** 应用id */ + private String appId; + /** 操作动作id;api_id,根据操作动作类型来决定是查api还是插件 */ + private String apiId; + /** nifi返回的应用id;刘工接口返回的nifi应用id,不确定要不要 */ + private String nifiAppId; + /** nifi的apiId */ + private String nifiApiId; + /** nifi应用排序模式;先进先出/先进后出 */ + private String sortMode; + + + public Integer getStep() { + return step; + } + + public void setStep(Integer step) { + this.step = step; + } + + public String getStepType() { + return stepType; + } + + public void setStepType(String stepType) { + this.stepType = stepType; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getApiName() { + return apiName; + } + + public void setApiName(String apiName) { + this.apiName = apiName; + } + + public String getActionType() { + return actionType; + } + + public void setActionType(String actionType) { + this.actionType = actionType; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getApiId() { + return apiId; + } + + public void setApiId(String apiId) { + this.apiId = apiId; + } + + public String getNifiAppId() { + return nifiAppId; + } + + public void setNifiAppId(String nifiAppId) { + this.nifiAppId = nifiAppId; + } + + public String getNifiApiId() { + return nifiApiId; + } + + public void setNifiApiId(String nifiApiId) { + this.nifiApiId = nifiApiId; + } + + public String getSortMode() { + return sortMode; + } + + public void setSortMode(String sortMode) { + this.sortMode = sortMode; + } + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.xml b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.xml new file mode 100644 index 00000000..814ec1d4 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.xml @@ -0,0 +1,281 @@ + + + + + + + + + + + + + + + + + + + + + + + + + id + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,step + ,step_type + ,description + ,api_name + ,action_type + ,app_id + ,api_id + ,nifi_app_id + ,nifi_api_id + ,sort_mode + + + + + + + + + + + + + + + + insert into sys_flow_step( + + id , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + step , + step_type , + description , + api_name , + action_type , + app_id , + api_id , + nifi_app_id , + nifi_api_id , + sort_mode , + sorts, + sts, + + )values( + + #{id} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{step} , + #{stepType} , + #{description} , + #{apiName} , + #{actionType} , + #{appId} , + #{apiId} , + #{nifiAppId} , + #{nifiApiId} , + #{sortMode} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into sys_flow_step(create_user_id, create_time, modify_user_id, modify_time, sts, step, step_type, description, api_name, action_type, app_id, api_id, nifi_app_id, nifi_api_id, sort_mode, sts) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.step},#{entity.stepType},#{entity.description},#{entity.apiName},#{entity.actionType},#{entity.appId},#{entity.apiId},#{entity.nifiAppId},#{entity.nifiApiId},#{entity.sortMode}, 'Y') + + + + + insert into sys_flow_step(create_user_id, create_time, modify_user_id, modify_time, sts, step, step_type, description, api_name, action_type, app_id, api_id, nifi_app_id, nifi_api_id, sort_mode) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.step},#{entity.stepType},#{entity.description},#{entity.apiName},#{entity.actionType},#{entity.appId},#{entity.apiId},#{entity.nifiAppId},#{entity.nifiApiId},#{entity.sortMode}) + + on duplicate key update + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + step = values(step), + step_type = values(step_type), + description = values(description), + api_name = values(api_name), + action_type = values(action_type), + app_id = values(app_id), + api_id = values(api_id), + nifi_app_id = values(nifi_app_id), + nifi_api_id = values(nifi_api_id), + sort_mode = values(sort_mode) + + +update sys_flow_step set + + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + step = #{step}, + step_type = #{stepType}, + description = #{description}, + api_name = #{apiName}, + action_type = #{actionType}, + app_id = #{appId}, + api_id = #{apiId}, + nifi_app_id = #{nifiAppId}, + nifi_api_id = #{nifiApiId}, + sort_mode = #{sortMode}, + +where id = #{id} + + + +update sys_flow_step set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update sys_flow_step set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and sts = #{sts} + and step = #{step} + and step_type = #{stepType} + and description = #{description} + and api_name = #{apiName} + and action_type = #{actionType} + and app_id = #{appId} + and api_id = #{apiId} + and nifi_app_id = #{nifiAppId} + and nifi_api_id = #{nifiApiId} + and sort_mode = #{sortMode} + and sts='Y' + + + + + delete from sys_flow_step where id = #{id} + + + + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepRelationEntity.java b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepRelationEntity.java new file mode 100644 index 00000000..71db7af2 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepRelationEntity.java @@ -0,0 +1,76 @@ +package com.hzya.frame.sys.flow.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 步骤关联关系表(SysFlowStepRelation)实体类 + * + * @author xiang2lin + * @since 2025-04-29 10:16:28 + */ +public class SysFlowStepRelationEntity extends BaseEntity { + + /** 输入步骤 */ + private String inputStepId; + /** 输出步骤 */ + private String outputStepId; + /** 输入nifi app id */ + private String inputNifiAppId; + /** 输出nifiidapp id */ + private String outputNifiAppId; + /** 输入nifi api id */ + private String inputNifiApiId; + /** 输出nifiidapi id */ + private String outputNifiApiId; + + + public String getInputStepId() { + return inputStepId; + } + + public void setInputStepId(String inputStepId) { + this.inputStepId = inputStepId; + } + + public String getOutputStepId() { + return outputStepId; + } + + public void setOutputStepId(String outputStepId) { + this.outputStepId = outputStepId; + } + + public String getInputNifiAppId() { + return inputNifiAppId; + } + + public void setInputNifiAppId(String inputNifiAppId) { + this.inputNifiAppId = inputNifiAppId; + } + + public String getOutputNifiAppId() { + return outputNifiAppId; + } + + public void setOutputNifiAppId(String outputNifiAppId) { + this.outputNifiAppId = outputNifiAppId; + } + + public String getInputNifiApiId() { + return inputNifiApiId; + } + + public void setInputNifiApiId(String inputNifiApiId) { + this.inputNifiApiId = inputNifiApiId; + } + + public String getOutputNifiApiId() { + return outputNifiApiId; + } + + public void setOutputNifiApiId(String outputNifiApiId) { + this.outputNifiApiId = outputNifiApiId; + } + +} + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepRelationEntity.xml b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepRelationEntity.xml new file mode 100644 index 00000000..c0a560fe --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepRelationEntity.xml @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + id + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,input_step_id + ,output_step_id + ,input_nifi_app_id + ,output_nifi_app_id + ,input_nifi_api_id + ,output_nifi_api_id + + + + + + + + + + + + + + + + insert into sys_flow_step_relation( + + id , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + input_step_id , + output_step_id , + input_nifi_app_id , + output_nifi_app_id , + input_nifi_api_id , + output_nifi_api_id , + sorts, + sts, + + )values( + + #{id} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{inputStepId} , + #{outputStepId} , + #{inputNifiAppId} , + #{outputNifiAppId} , + #{inputNifiApiId} , + #{outputNifiApiId} , + (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step_relation a WHERE a.sts = 'Y' ), + 'Y', + + ) + + + + insert into sys_flow_step_relation(create_user_id, create_time, modify_user_id, modify_time, sts, input_step_id, output_step_id, input_nifi_app_id, output_nifi_app_id, input_nifi_api_id, output_nifi_api_id, sts) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.inputStepId},#{entity.outputStepId},#{entity.inputNifiAppId},#{entity.outputNifiAppId},#{entity.inputNifiApiId},#{entity.outputNifiApiId}, 'Y') + + + + + insert into sys_flow_step_relation(create_user_id, create_time, modify_user_id, modify_time, sts, input_step_id, output_step_id, input_nifi_app_id, output_nifi_app_id, input_nifi_api_id, output_nifi_api_id) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.inputStepId},#{entity.outputStepId},#{entity.inputNifiAppId},#{entity.outputNifiAppId},#{entity.inputNifiApiId},#{entity.outputNifiApiId}) + + on duplicate key update + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + input_step_id = values(input_step_id), + output_step_id = values(output_step_id), + input_nifi_app_id = values(input_nifi_app_id), + output_nifi_app_id = values(output_nifi_app_id), + input_nifi_api_id = values(input_nifi_api_id), + output_nifi_api_id = values(output_nifi_api_id) + + +update sys_flow_step_relation set + + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + input_step_id = #{inputStepId}, + output_step_id = #{outputStepId}, + input_nifi_app_id = #{inputNifiAppId}, + output_nifi_app_id = #{outputNifiAppId}, + input_nifi_api_id = #{inputNifiApiId}, + output_nifi_api_id = #{outputNifiApiId}, + +where id = #{id} + + + +update sys_flow_step_relation set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update sys_flow_step_relation set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and sts = #{sts} + and input_step_id = #{inputStepId} + and output_step_id = #{outputStepId} + and input_nifi_app_id = #{inputNifiAppId} + and output_nifi_app_id = #{outputNifiAppId} + and input_nifi_api_id = #{inputNifiApiId} + and output_nifi_api_id = #{outputNifiApiId} + and sts='Y' + + + + + delete from sys_flow_step_relation where id = #{id} + + + + diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowClassRuleService.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowClassRuleService.java new file mode 100644 index 00000000..4994c591 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowClassRuleService.java @@ -0,0 +1,50 @@ +package com.hzya.frame.sys.flow.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * 流程分类权限表(SysFlowClassRule)表服务接口 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +public interface ISysFlowClassRuleService extends IBaseService{ + + /** + * 新增流程分类权限 + * @param object + * @return + */ + JsonResultEntity saveFlowClassRule(JSONObject object); + + /** + * 修改流程分类权限 + * @param object + * @return + */ + JsonResultEntity updateFlowClassRule(JSONObject object); + + /** + * 删除流程分类权限 + * @param object + * @return + */ + JsonResultEntity deleteFlowClassRule(JSONObject object); + + /** + * 列表查询 + * @param object + * @return + */ + JsonResultEntity queryRuleList(JSONObject object); + + /** + * 分页查询 + * @param object + * @return + */ + JsonResultEntity queryRulePagedInfo(JSONObject object); +} diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowClassService.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowClassService.java new file mode 100644 index 00000000..905dcfce --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowClassService.java @@ -0,0 +1,36 @@ +package com.hzya.frame.sys.flow.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sys.flow.entity.SysFlowClassEntity; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * 流程分类;对应数环通项目分类(SysFlowClass)表服务接口 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +public interface ISysFlowClassService extends IBaseService{ + + /** + * 新增流程分类 + * @param object + * @return + */ + JsonResultEntity saveFlowClass(JSONObject object); + + /** + * 修改流程分类 + * @param object + * @return + */ + JsonResultEntity updateFlowClass(JSONObject object); + + /** + * 删除流程分类 + * @param object + * @return + */ + JsonResultEntity deleteFlowClass(JSONObject object); +} diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowNifiConstantService.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowNifiConstantService.java new file mode 100644 index 00000000..f4e3a8fe --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowNifiConstantService.java @@ -0,0 +1,36 @@ +package com.hzya.frame.sys.flow.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * nifi常量(SysFlowNifiConstant)表服务接口 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +public interface ISysFlowNifiConstantService extends IBaseService{ + + /** + * 保存nifi常量 + * @param object + * @return + */ + JsonResultEntity saveNifiConstant(JSONObject object); + + /** + * 更新nifi常量 + * @param object + * @return + */ + JsonResultEntity updateNifiConstant(JSONObject object); + + /** + * 更新nifi常量 + * @param object + * @return + */ + JsonResultEntity deleteNifiConstant(JSONObject object); +} diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowService.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowService.java new file mode 100644 index 00000000..7f2f4af8 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.sys.flow.service; + +import com.hzya.frame.sys.flow.entity.SysFlowEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * 流程主表;流程就是数环通的Linkup(SysFlow)表服务接口 + * + * @author xiang2lin + * @since 2025-04-29 10:16:24 + */ +public interface ISysFlowService extends IBaseService{ +} diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowStepAccountService.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowStepAccountService.java new file mode 100644 index 00000000..eb7f5df1 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowStepAccountService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.sys.flow.service; + +import com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * 流程步骤账户表(SysFlowStepAccount)表服务接口 + * + * @author xiang2lin + * @since 2025-04-29 10:16:28 + */ +public interface ISysFlowStepAccountService extends IBaseService{ +} diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowStepConfigBService.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowStepConfigBService.java new file mode 100644 index 00000000..80f74441 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowStepConfigBService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.sys.flow.service; + +import com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * 映射信息表体(SysFlowStepConfigB)表服务接口 + * + * @author xiang2lin + * @since 2025-04-29 10:16:28 + */ +public interface ISysFlowStepConfigBService extends IBaseService{ +} diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowStepConfigService.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowStepConfigService.java new file mode 100644 index 00000000..385d92c4 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowStepConfigService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.sys.flow.service; + +import com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * 映射信息主表(SysFlowStepConfig)表服务接口 + * + * @author xiang2lin + * @since 2025-04-29 10:16:28 + */ +public interface ISysFlowStepConfigService extends IBaseService{ +} diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowStepRelationService.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowStepRelationService.java new file mode 100644 index 00000000..f5358083 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowStepRelationService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.sys.flow.service; + +import com.hzya.frame.sys.flow.entity.SysFlowStepRelationEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * 步骤关联关系表(SysFlowStepRelation)表服务接口 + * + * @author xiang2lin + * @since 2025-04-29 10:16:28 + */ +public interface ISysFlowStepRelationService extends IBaseService{ +} diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowStepService.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowStepService.java new file mode 100644 index 00000000..9d3e226f --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowStepService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.sys.flow.service; + +import com.hzya.frame.sys.flow.entity.SysFlowStepEntity; +import com.hzya.frame.basedao.service.IBaseService; +/** + * 流程步骤信息(SysFlowStep)表服务接口 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +public interface ISysFlowStepService extends IBaseService{ +} diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowClassRuleServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowClassRuleServiceImpl.java new file mode 100644 index 00000000..b51a3dae --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowClassRuleServiceImpl.java @@ -0,0 +1,174 @@ +package com.hzya.frame.sys.flow.service.impl; + +import cn.hutool.core.convert.Convert; +import cn.hutool.core.lang.Assert; +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hzya.frame.sys.flow.entity.SysFlowClassRuleEntity; +import com.hzya.frame.sys.flow.dao.ISysFlowClassRuleDao; +import com.hzya.frame.sys.flow.service.ISysFlowClassRuleService; +import com.hzya.frame.uuid.UUIDUtils; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; + +import java.util.List; + +/** + * 流程分类权限表(SysFlowClassRule)表服务实现类 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +@Service(value = "sysFlowClassRuleService") +public class SysFlowClassRuleServiceImpl extends BaseService implements ISysFlowClassRuleService { + + private ISysFlowClassRuleDao sysFlowClassRuleDao; + + @Autowired + public void setSysFlowClassRuleDao(ISysFlowClassRuleDao dao) { + this.sysFlowClassRuleDao = dao; + this.dao = dao; + } + + + /** + * 新增流程分类权限 + * + * @param object + * @return + */ + @Override + public JsonResultEntity saveFlowClassRule(JSONObject object) { + SysFlowClassRuleEntity ruleEntity = getData("jsonStr",object,SysFlowClassRuleEntity.class); + try { + this.checkParams(ruleEntity,"save"); + }catch(Exception e){ + return BaseResult.getFailureMessageEntity(e.getMessage()); + } + addRule(ruleEntity); + return BaseResult.getSuccessMessageEntity("保存成功"); + } + + //保存 + private void addRule(SysFlowClassRuleEntity ruleEntity) { + List ruleList = ruleEntity.getRuleList(); + for (SysFlowClassRuleEntity r : ruleList) { + r.setId(UUIDUtils.getUUID()); + r.setCreate_time(Convert.toDate(ruleEntity.getCreate_time(),ruleEntity.getModify_time())); + r.setCreate_user_id(Convert.toStr(ruleEntity.getCreate_user_id(),ruleEntity.getModify_user_id())); + r.setModify_time(r.getCreate_time()); + r.setModify_user_id(r.getCreate_user_id()); + r.setFlowClassId(ruleEntity.getFlowClassId()); + sysFlowClassRuleDao.save(r); + } + } + + /** + * 修改流程分类权限 + * + * @param object + * @return + */ + @Override + public JsonResultEntity updateFlowClassRule(JSONObject object) { + SysFlowClassRuleEntity ruleEntity = getData("jsonStr",object,SysFlowClassRuleEntity.class); + try { + this.checkParams(ruleEntity,"update"); + }catch(Exception e){ + return BaseResult.getFailureMessageEntity(e.getMessage()); + } + //先删除 再重新保存 + SysFlowClassRuleEntity rule = new SysFlowClassRuleEntity(); + rule.setFlowClassId(ruleEntity.getFlowClassId()); + sysFlowClassRuleDao.logicRemoveMultiCondition(rule); + addRule(ruleEntity); + return BaseResult.getSuccessMessageEntity("更新成功"); + } + + /** + * 删除流程分类权限 + * + * @param object + * @return + */ + @Override + public JsonResultEntity deleteFlowClassRule(JSONObject object) { + SysFlowClassRuleEntity ruleEntity = getData("jsonStr",object,SysFlowClassRuleEntity.class); + try { + this.checkParams(ruleEntity,"delete"); + }catch (Exception e){ + return BaseResult.getFailureMessageEntity(e.getMessage()); + } + SysFlowClassRuleEntity deleteRuleEntity = new SysFlowClassRuleEntity(); + deleteRuleEntity.setFlowClassId(ruleEntity.getFlowClassId()); + sysFlowClassRuleDao.logicRemoveMultiCondition(deleteRuleEntity); + return BaseResult.getSuccessMessageEntity("删除成功"); + } + + /** + * 列表查询 + * + * @param object + * @return + */ + @Override + public JsonResultEntity queryRuleList(JSONObject object) { + SysFlowClassRuleEntity ruleEntity = getData("jsonStr",object,SysFlowClassRuleEntity.class); + try { + checkParams(ruleEntity,"queryList"); + }catch(Exception e){ + return BaseResult.getFailureMessageEntity(e.getMessage()); + } + List sysFlowClassRuleEntities = sysFlowClassRuleDao.queryByLike(ruleEntity); + SysFlowClassRuleEntity reuslt = new SysFlowClassRuleEntity(); + reuslt.setFlowClassId(ruleEntity.getFlowClassId()); + reuslt.setRuleList(sysFlowClassRuleEntities); + return BaseResult.getSuccessMessageEntity("查询数据成功",reuslt); + } + + /** + * 分页查询 + * + * @param object + * @return + */ + @Override + public JsonResultEntity queryRulePagedInfo(JSONObject object) { + SysFlowClassRuleEntity ruleEntity = getData("jsonStr",object,SysFlowClassRuleEntity.class); + try { + checkParams(ruleEntity,"queryPaged"); + }catch(Exception e){ + return BaseResult.getFailureMessageEntity(e.getMessage()); + } + PageHelper.startPage(ruleEntity.getPageNum(), ruleEntity.getPageSize()); + List queryByLike = this.dao.queryByLike(ruleEntity); + PageInfo pageInfo = new PageInfo(queryByLike); + return BaseResult.getSuccessMessageEntity("查询数据成功",pageInfo); + } + + /** + * 检查参数 + * @param entity 参数对象 + * @param type 操作;类型 + */ + private void checkParams(SysFlowClassRuleEntity entity,String type){ + Assert.notNull(entity,"请求参数不能为空"); + Assert.notEmpty(entity.getFlowClassId(),"flowClassId不能为空"); + if ("save".equals(type)){ + Assert.notEmpty(entity.getRuleList(),"ruleList不能为空"); + }else if ("update".equals(type)){ + Assert.notEmpty(entity.getRuleList(),"ruleList不能为空"); + }else if ("delete".equals(type)){ + + }else if ("queryPaged".equals(type)){ + Assert.notNull(entity.getPageNum(),"pageNum不能为空"); + Assert.notNull(entity.getPageSize(),"pageSize不能为空"); + } + + } +} diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowClassServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowClassServiceImpl.java new file mode 100644 index 00000000..5b710436 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowClassServiceImpl.java @@ -0,0 +1,136 @@ +package com.hzya.frame.sys.flow.service.impl; + +import cn.hutool.core.lang.Assert; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sys.flow.dao.ISysFlowDao; +import com.hzya.frame.sys.flow.entity.SysFlowClassEntity; +import com.hzya.frame.sys.flow.dao.ISysFlowClassDao; +import com.hzya.frame.sys.flow.entity.SysFlowEntity; +import com.hzya.frame.sys.flow.service.ISysFlowClassService; +import com.hzya.frame.uuid.UUIDUtils; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import com.hzya.frame.web.exception.BaseSystemException; +import org.apache.commons.collections.CollectionUtils; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; + +import java.util.List; + +/** + * 流程分类;对应数环通项目分类(SysFlowClass)表服务实现类 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +@Service(value = "sysFlowClassService") +public class SysFlowClassServiceImpl extends BaseService implements ISysFlowClassService { + + private ISysFlowClassDao sysFlowClassDao; + @Autowired + private ISysFlowDao sysFlowDao; + + @Autowired + public void setSysFlowClassDao(ISysFlowClassDao dao) { + this.sysFlowClassDao = dao; + this.dao = dao; + } + + /** + * 新增流程分类 + * + * @param object + * @return + */ + @Override + public JsonResultEntity saveFlowClass(JSONObject object) { + SysFlowClassEntity flowClass = getData("jsonStr",object,SysFlowClassEntity.class); + try { + this.checkParams(flowClass,"add"); + }catch(Exception e){ + return BaseResult.getFailureMessageEntity(e.getMessage()); + } + flowClass.setId(UUIDUtils.getUUID()); + sysFlowClassDao.save(flowClass); + return BaseResult.getSuccessMessageEntity("新增成功"); + } + + /** + * 修改流程分类 + * + * @param object + * @return + */ + @Override + public JsonResultEntity updateFlowClass(JSONObject object) { + SysFlowClassEntity flowClass = getData("jsonStr",object,SysFlowClassEntity.class); + try { + this.checkParams(flowClass,"update"); + }catch(Exception e){ + return BaseResult.getFailureMessageEntity(e.getMessage()); + } + sysFlowClassDao.update(flowClass); + return BaseResult.getSuccessMessageEntity("更新成功"); + } + + /** + * 删除流程分类 + * + * @param object + * @return + */ + @Override + public JsonResultEntity deleteFlowClass(JSONObject object) { + SysFlowClassEntity flowClass = getData("jsonStr",object,SysFlowClassEntity.class); + try { + this.checkParams(flowClass,"delete"); + }catch(Exception e){ + return BaseResult.getFailureMessageEntity(e.getMessage()); + } + sysFlowClassDao.logicRemove(flowClass); + return BaseResult.getSuccessMessageEntity("删除成功"); + } + + /** + * 参数检查 + * @param flowClass + * @param type + */ + private void checkParams(SysFlowClassEntity flowClass,String type){ + Assert.notNull(flowClass,"请求参数不能为空"); + if ("add".equals(type)){//新增 + Assert.notEmpty(flowClass.getName(),"名称不能为空"); + //查询是否有同名的 + SysFlowClassEntity flowQuery = new SysFlowClassEntity(); + flowQuery.setName(flowClass.getName()); + List query = sysFlowClassDao.query(flowQuery); + if (CollectionUtils.isNotEmpty(query)){ + throw new BaseSystemException(flowClass.getName()+"已存在"); + } + }else if ("update".equals(type)){//更新 + Assert.notEmpty(flowClass.getId(),"id不能为空"); + //查一下有没有同名的 + SysFlowClassEntity flowQuery = new SysFlowClassEntity(); + flowQuery.setName(flowClass.getName()); + List query = sysFlowClassDao.query(flowQuery); + if (CollectionUtils.isNotEmpty(query)){ + for (SysFlowClassEntity f : query) { + if (!f.getId().equals(flowClass.getId())){ + throw new BaseSystemException(flowClass.getName()+"已存在"); + } + } + } + }else if ("delete".equals(type)){//删除 + Assert.notEmpty(flowClass.getId(),"id不能为空"); + //查一下这个分类有没有被引用 + SysFlowEntity sysFlowEntity = new SysFlowEntity(); + sysFlowEntity.setClassId(flowClass.getId()); + List query = sysFlowDao.query(sysFlowEntity); + if (CollectionUtils.isNotEmpty(query)){ + throw new BaseSystemException("该分类已被引用,删除失败"); + } + } + } +} diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowNifiConstantServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowNifiConstantServiceImpl.java new file mode 100644 index 00000000..42c3f193 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowNifiConstantServiceImpl.java @@ -0,0 +1,135 @@ +package com.hzya.frame.sys.flow.service.impl; + +import cn.hutool.core.lang.Assert; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sys.flow.entity.SysFlowNifiConstantEntity; +import com.hzya.frame.sys.flow.dao.ISysFlowNifiConstantDao; +import com.hzya.frame.sys.flow.service.ISysFlowNifiConstantService; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import com.hzya.frame.web.exception.BaseSystemException; +import org.apache.commons.collections.CollectionUtils; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; + +import java.util.List; + +/** + * nifi常量(SysFlowNifiConstant)表服务实现类 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +@Service(value = "sysFlowNifiConstantService") +public class SysFlowNifiConstantServiceImpl extends BaseService implements ISysFlowNifiConstantService { + + private ISysFlowNifiConstantDao sysFlowNifiConstantDao; + + @Autowired + public void setSysFlowNifiConstantDao(ISysFlowNifiConstantDao dao) { + this.sysFlowNifiConstantDao = dao; + this.dao = dao; + } + + /** + * 保存nifi常量 + * + * @param object + * @return + */ + @Override + public JsonResultEntity saveNifiConstant(JSONObject object) { + SysFlowNifiConstantEntity sysFlowNifiConstantEntity = null; + try { + sysFlowNifiConstantEntity = preCheck(object,"save"); + }catch(Exception e){ + return BaseResult.getFailureMessageEntity(e.getMessage()); + } + sysFlowNifiConstantDao.save(sysFlowNifiConstantEntity); + return BaseResult.getSuccessMessageEntity("保存成功"); + } + + /** + * 更新nifi常量 + * + * @param object + * @return + */ + @Override + public JsonResultEntity updateNifiConstant(JSONObject object) { + SysFlowNifiConstantEntity sysFlowNifiConstantEntity = null; + try { + sysFlowNifiConstantEntity = preCheck(object,"update"); + }catch(Exception e){ + return BaseResult.getFailureMessageEntity(e.getMessage()); + } + sysFlowNifiConstantDao.update(sysFlowNifiConstantEntity); + return BaseResult.getSuccessMessageEntity("更新成功"); + } + + /** + * 更新nifi常量 + * + * @param object + * @return + */ + @Override + public JsonResultEntity deleteNifiConstant(JSONObject object) { + SysFlowNifiConstantEntity sysFlowNifiConstantEntity = null; + try { + sysFlowNifiConstantEntity = preCheck(object,"delete"); + }catch(Exception e){ + return BaseResult.getFailureMessageEntity(e.getMessage()); + } + sysFlowNifiConstantDao.logicRemove(sysFlowNifiConstantEntity); + return BaseResult.getSuccessMessageEntity("删除成功"); + } + + + /** + * 参数校验 + * @param entity + * @param type + */ + private void checkParams(SysFlowNifiConstantEntity entity,String type){ + Assert.notNull(entity,"请求参数不能为空"); + if ("save".equals(type)){ + Assert.notEmpty(entity.getNifiKey(),"nifiKey不能为空"); + Assert.notEmpty(entity.getNifiValue(),"nifiValue不能为空"); + //检查是否有重名的key + SysFlowNifiConstantEntity nifi = new SysFlowNifiConstantEntity(); + nifi.setNifiKey(entity.getNifiKey()); + List query = sysFlowNifiConstantDao.query(nifi); + if (CollectionUtils.isNotEmpty(query)){ + throw new BaseSystemException(nifi.getNifiKey()+"重复"); + } + }else if ("update".equals(type)){ + Assert.notEmpty(entity.getId(),"id不能为空"); + Assert.notEmpty(entity.getNifiKey(),"key不能为空"); + Assert.notEmpty(entity.getNifiValue(),"value不能为空"); + SysFlowNifiConstantEntity nifi = new SysFlowNifiConstantEntity(); + nifi.setNifiKey(entity.getNifiKey()); + List query = sysFlowNifiConstantDao.query(nifi); + if (CollectionUtils.isNotEmpty(query)){ + for (SysFlowNifiConstantEntity n : query) { + if (!n.getId().equals(entity.getId())){ + throw new BaseSystemException(entity.getNifiKey()+"重复"); + } + } + } + }else if ("delete".equals(type)){ + Assert.notEmpty(entity.getId(),"id不能为空"); + } + } + + //前置操作 + private SysFlowNifiConstantEntity preCheck(JSONObject object,String type){ + SysFlowNifiConstantEntity entity = getData("jsonStr", object,SysFlowNifiConstantEntity.class); + checkParams(entity,type); + return entity; + } +} diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowServiceImpl.java new file mode 100644 index 00000000..5a1a55e8 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowServiceImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.sys.flow.service.impl; + +import com.hzya.frame.sys.flow.entity.SysFlowEntity; +import com.hzya.frame.sys.flow.dao.ISysFlowDao; +import com.hzya.frame.sys.flow.service.ISysFlowService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 流程主表;流程就是数环通的Linkup(SysFlow)表服务实现类 + * + * @author xiang2lin + * @since 2025-04-29 10:16:26 + */ +@Service(value = "sysFlowService") +public class SysFlowServiceImpl extends BaseService implements ISysFlowService { + + private ISysFlowDao sysFlowDao; + + @Autowired + public void setSysFlowDao(ISysFlowDao dao) { + this.sysFlowDao = dao; + this.dao = dao; + } +} diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowStepAccountServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowStepAccountServiceImpl.java new file mode 100644 index 00000000..a82cac3a --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowStepAccountServiceImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.sys.flow.service.impl; + +import com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity; +import com.hzya.frame.sys.flow.dao.ISysFlowStepAccountDao; +import com.hzya.frame.sys.flow.service.ISysFlowStepAccountService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 流程步骤账户表(SysFlowStepAccount)表服务实现类 + * + * @author xiang2lin + * @since 2025-04-29 10:16:28 + */ +@Service(value = "sysFlowStepAccountService") +public class SysFlowStepAccountServiceImpl extends BaseService implements ISysFlowStepAccountService { + + private ISysFlowStepAccountDao sysFlowStepAccountDao; + + @Autowired + public void setSysFlowStepAccountDao(ISysFlowStepAccountDao dao) { + this.sysFlowStepAccountDao = dao; + this.dao = dao; + } +} diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowStepConfigBServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowStepConfigBServiceImpl.java new file mode 100644 index 00000000..3addfd52 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowStepConfigBServiceImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.sys.flow.service.impl; + +import com.hzya.frame.sys.flow.entity.SysFlowStepConfigBEntity; +import com.hzya.frame.sys.flow.dao.ISysFlowStepConfigBDao; +import com.hzya.frame.sys.flow.service.ISysFlowStepConfigBService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 映射信息表体(SysFlowStepConfigB)表服务实现类 + * + * @author xiang2lin + * @since 2025-04-29 10:16:28 + */ +@Service(value = "sysFlowStepConfigBService") +public class SysFlowStepConfigBServiceImpl extends BaseService implements ISysFlowStepConfigBService { + + private ISysFlowStepConfigBDao sysFlowStepConfigBDao; + + @Autowired + public void setSysFlowStepConfigBDao(ISysFlowStepConfigBDao dao) { + this.sysFlowStepConfigBDao = dao; + this.dao = dao; + } +} diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowStepConfigServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowStepConfigServiceImpl.java new file mode 100644 index 00000000..4c06c479 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowStepConfigServiceImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.sys.flow.service.impl; + +import com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity; +import com.hzya.frame.sys.flow.dao.ISysFlowStepConfigDao; +import com.hzya.frame.sys.flow.service.ISysFlowStepConfigService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 映射信息主表(SysFlowStepConfig)表服务实现类 + * + * @author xiang2lin + * @since 2025-04-29 10:16:28 + */ +@Service(value = "sysFlowStepConfigService") +public class SysFlowStepConfigServiceImpl extends BaseService implements ISysFlowStepConfigService { + + private ISysFlowStepConfigDao sysFlowStepConfigDao; + + @Autowired + public void setSysFlowStepConfigDao(ISysFlowStepConfigDao dao) { + this.sysFlowStepConfigDao = dao; + this.dao = dao; + } +} diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowStepRelationServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowStepRelationServiceImpl.java new file mode 100644 index 00000000..a34d3d43 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowStepRelationServiceImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.sys.flow.service.impl; + +import com.hzya.frame.sys.flow.entity.SysFlowStepRelationEntity; +import com.hzya.frame.sys.flow.dao.ISysFlowStepRelationDao; +import com.hzya.frame.sys.flow.service.ISysFlowStepRelationService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 步骤关联关系表(SysFlowStepRelation)表服务实现类 + * + * @author xiang2lin + * @since 2025-04-29 10:16:28 + */ +@Service(value = "sysFlowStepRelationService") +public class SysFlowStepRelationServiceImpl extends BaseService implements ISysFlowStepRelationService { + + private ISysFlowStepRelationDao sysFlowStepRelationDao; + + @Autowired + public void setSysFlowStepRelationDao(ISysFlowStepRelationDao dao) { + this.sysFlowStepRelationDao = dao; + this.dao = dao; + } +} diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowStepServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowStepServiceImpl.java new file mode 100644 index 00000000..0c9a1b29 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowStepServiceImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.sys.flow.service.impl; + +import com.hzya.frame.sys.flow.entity.SysFlowStepEntity; +import com.hzya.frame.sys.flow.dao.ISysFlowStepDao; +import com.hzya.frame.sys.flow.service.ISysFlowStepService; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 流程步骤信息(SysFlowStep)表服务实现类 + * + * @author xiang2lin + * @since 2025-04-29 10:16:27 + */ +@Service(value = "sysFlowStepService") +public class SysFlowStepServiceImpl extends BaseService implements ISysFlowStepService { + + private ISysFlowStepDao sysFlowStepDao; + + @Autowired + public void setSysFlowStepDao(ISysFlowStepDao dao) { + this.sysFlowStepDao = dao; + this.dao = dao; + } +} From 4c40538ae18b379e29caa6868de98ed37cab0a00 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 6 May 2025 09:31:34 +0800 Subject: [PATCH 36/67] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base-buildpackage/src/main/resources/application-xel.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/base-buildpackage/src/main/resources/application-xel.yml b/base-buildpackage/src/main/resources/application-xel.yml index 6deabd35..e5d2197f 100644 --- a/base-buildpackage/src/main/resources/application-xel.yml +++ b/base-buildpackage/src/main/resources/application-xel.yml @@ -14,8 +14,10 @@ spring: master: url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true username: root - password: 62e4295b615a30dbf3b8ee96f41c820b + password: bd993088e8a7c3dc5f44441617f9b4bf driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 savefile: # 文件保存路径 path: /Users/xiangerlin/work/app/file/dev + pluginpath: /Users/xiangerlin/work/app/file/dev + tomcatpath: /Users/xiangerlin/work/app/file/dev From 6e3a47706aadc1750814fea2f3f63f13b8320926 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 7 May 2025 14:28:48 +0800 Subject: [PATCH 37/67] =?UTF-8?q?crud=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/flow/entity/SysFlowClassEntity.xml | 54 +++---- .../frame/sys/flow/entity/SysFlowEntity.xml | 68 +++++---- .../flow/entity/SysFlowStepAccountEntity.xml | 2 +- .../flow/entity/SysFlowStepConfigBEntity.xml | 2 +- .../flow/entity/SysFlowStepConfigEntity.xml | 2 +- .../sys/flow/entity/SysFlowStepEntity.xml | 2 +- .../flow/entity/SysFlowStepRelationEntity.xml | 2 +- .../sys/flow/service/ISysFlowService.java | 37 +++++ .../flow/service/impl/SysFlowServiceImpl.java | 144 +++++++++++++++++- 9 files changed, 248 insertions(+), 65 deletions(-) diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowClassEntity.xml b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowClassEntity.xml index 7cdda3a1..0c6ab408 100644 --- a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowClassEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowClassEntity.xml @@ -104,32 +104,34 @@ insert into sys_flow_class( - - id , - create_user_id , - create_time , - modify_user_id , - modify_time , - sts , - name , - parent_id , - sorts, - sts, - - )values( - - #{id} , - #{create_user_id} , - #{create_time} , - #{modify_user_id} , - #{modify_time} , - #{sts} , - #{name} , - #{parentId} , - COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_class a WHERE a.sts = 'Y' ),1), - 'Y', - - ) + + id , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + name , + parent_id , + sorts, + sts, + + )values( + + #{id} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{name} , + #{parentId} , + COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_class a WHERE + a.sts = 'Y' ),1), + + 'Y', + + ) diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowEntity.xml b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowEntity.xml index ff41d4bd..db8a222b 100644 --- a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowEntity.xml @@ -128,39 +128,41 @@ insert into sys_flow( - - id , - create_user_id , - create_time , - modify_user_id , - modify_time , - sts , - name , - status , - class_id , - trigger_mode_id , - nifi_group_id , - description , - sorts, - sts, - - )values( - - #{id} , - #{create_user_id} , - #{create_time} , - #{modify_user_id} , - #{modify_time} , - #{sts} , - #{name} , - #{classId} , - #{triggerModeId} , - #{nifiGroupId} , - #{description} , - (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow a WHERE a.sts = 'Y' ), - 'Y', - - ) + + id , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + name , + status , + class_id , + trigger_mode_id , + nifi_group_id , + description , + sorts, + sts, + + )values( + + #{id} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{name} , + #{status} , + #{classId} , + #{triggerModeId} , + #{nifiGroupId} , + #{description} , + COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow a WHERE a.sts = 'Y' ),1), + + 'Y', + + ) diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepAccountEntity.xml b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepAccountEntity.xml index 777a9aaa..acf594f0 100644 --- a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepAccountEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepAccountEntity.xml @@ -198,7 +198,7 @@ #{appSecret} , #{corpid} , #{agentid} , - (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step_account a WHERE a.sts = 'Y' ), + COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step_account a WHERE a.sts = 'Y' ),1), 'Y', ) diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigBEntity.xml b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigBEntity.xml index dece2c36..0af1386b 100644 --- a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigBEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigBEntity.xml @@ -198,7 +198,7 @@ #{sourceFieldName} , #{sourceFieldType} , #{sourceFieldDescription} , - (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step_config_b a WHERE a.sts = 'Y' ), + COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step_config_b a WHERE a.sts = 'Y' ),1), 'Y', ) diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigEntity.xml b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigEntity.xml index 2316ff22..9137ef34 100644 --- a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepConfigEntity.xml @@ -206,7 +206,7 @@ #{createTableFlag} , #{writeType} , #{sqlStatement} , - (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step_config a WHERE a.sts = 'Y' ), + COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step_config a WHERE a.sts = 'Y' ),1), 'Y', ) diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.xml b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.xml index 814ec1d4..795c9c7a 100644 --- a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.xml @@ -190,7 +190,7 @@ #{nifiAppId} , #{nifiApiId} , #{sortMode} , - (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step a WHERE a.sts = 'Y' ), + COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step a WHERE a.sts = 'Y' ),1), 'Y', ) diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepRelationEntity.xml b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepRelationEntity.xml index c0a560fe..39e19cda 100644 --- a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepRelationEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepRelationEntity.xml @@ -158,7 +158,7 @@ #{outputNifiAppId} , #{inputNifiApiId} , #{outputNifiApiId} , - (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step_relation a WHERE a.sts = 'Y' ), + COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step_relation a WHERE a.sts = 'Y' ),1), 'Y', ) diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowService.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowService.java index 7f2f4af8..e2792bff 100644 --- a/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowService.java +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/ISysFlowService.java @@ -1,7 +1,10 @@ package com.hzya.frame.sys.flow.service; +import com.alibaba.fastjson.JSONObject; import com.hzya.frame.sys.flow.entity.SysFlowEntity; import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.web.entity.JsonResultEntity; + /** * 流程主表;流程就是数环通的Linkup(SysFlow)表服务接口 * @@ -9,4 +12,38 @@ import com.hzya.frame.basedao.service.IBaseService; * @since 2025-04-29 10:16:24 */ public interface ISysFlowService extends IBaseService{ + /** + * 保存流程主表 + * @param object + * @return + */ + JsonResultEntity saveFlow(JSONObject object); + + /** + * 更新流程主表 + * @param object + * @return + */ + JsonResultEntity updateFlow(JSONObject object); + + /** + * 删除流程主表 + * @param object + * @return + */ + JsonResultEntity deleteFlow(JSONObject object); + + /** + * 列表查询 + * @param object + * @return + */ + JsonResultEntity queryFlowList(JSONObject object); + + /** + * 分页查询 + * @param object + * @return + */ + JsonResultEntity queryFlowPagedInfo(JSONObject object); } diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowServiceImpl.java index 5a1a55e8..61531d47 100644 --- a/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowServiceImpl.java @@ -1,12 +1,23 @@ package com.hzya.frame.sys.flow.service.impl; +import cn.hutool.core.lang.Assert; +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import com.hzya.frame.sys.flow.entity.SysFlowEntity; import com.hzya.frame.sys.flow.dao.ISysFlowDao; import com.hzya.frame.sys.flow.service.ISysFlowService; -import org.springframework.stereotype.Service; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import com.hzya.frame.web.exception.BaseSystemException; +import org.apache.commons.collections.CollectionUtils; +import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; import javax.annotation.Resource; import com.hzya.frame.basedao.service.impl.BaseService; + +import java.util.List; + /** * 流程主表;流程就是数环通的Linkup(SysFlow)表服务实现类 * @@ -23,4 +34,135 @@ public class SysFlowServiceImpl extends BaseService imple this.sysFlowDao = dao; this.dao = dao; } + + /** + * 保存流程主表 + * + * @param object + * @return + */ + @Override + public JsonResultEntity saveFlow(JSONObject object) { + SysFlowEntity flowEntity = getData("jsonStr",object,SysFlowEntity.class); + try { + checkParams(flowEntity,"save"); + } catch (Exception e) { + return BaseResult.getFailureMessageEntity(e.getMessage()); + } + sysFlowDao.save(flowEntity); + return BaseResult.getSuccessMessageEntity("保存成功"); + } + + /** + * 更新流程主表 + * + * @param object + * @return + */ + @Override + public JsonResultEntity updateFlow(JSONObject object) { + SysFlowEntity flowEntity = getData("jsonStr",object,SysFlowEntity.class); + try { + checkParams(flowEntity,"update"); + } catch (Exception e) { + return BaseResult.getFailureMessageEntity(e.getMessage()); + } + sysFlowDao.update(flowEntity); + return BaseResult.getSuccessMessageEntity("更新成功"); + } + + /** + * 删除流程主表 + * + * @param object + * @return + */ + @Override + public JsonResultEntity deleteFlow(JSONObject object) { + SysFlowEntity flowEntity = getData("jsonStr",object,SysFlowEntity.class); + try { + checkParams(flowEntity,"delete"); + } catch (Exception e) { + return BaseResult.getFailureMessageEntity(e.getMessage()); + } + //删除主表 + sysFlowDao.logicRemove(flowEntity); + //删除子表 + return BaseResult.getSuccessMessageEntity("删除成功"); + } + + /** + * 列表查询 + * + * @param object + * @return + */ + @Override + public JsonResultEntity queryFlowList(JSONObject object) { + SysFlowEntity flowEntity = getData("jsonStr",object,SysFlowEntity.class); + try { + checkParams(flowEntity,"queryList"); + } catch (Exception e) { + return BaseResult.getFailureMessageEntity(e.getMessage()); + } + List list = sysFlowDao.query(flowEntity); + return BaseResult.getSuccessMessageEntity("查询数据成功",list); + } + + /** + * 分页查询 + * + * @param object + * @return + */ + @Override + public JsonResultEntity queryFlowPagedInfo(JSONObject object) { + SysFlowEntity flowEntity = getData("jsonStr",object,SysFlowEntity.class); + try { + checkParams(flowEntity,"queryPaged"); + } catch (Exception e) { + return BaseResult.getFailureMessageEntity(e.getMessage()); + } + PageHelper.startPage(flowEntity.getPageNum(),flowEntity.getPageSize()); + List queryByLike = sysFlowDao.queryByLike(flowEntity); + PageInfo pageInfo = new PageInfo(queryByLike); + return BaseResult.getSuccessMessageEntity("pageInfo",pageInfo); + } + + /** + * 参数检查 + * @param entity + * @param type + */ + private void checkParams(SysFlowEntity entity,String type){ + Assert.notNull(entity,"请求参数不能为空"); + if ("save".equals(type)){ + Assert.notEmpty(entity.getClassId(),"classId不能为空"); + Assert.notEmpty(entity.getName(),"name不能为空"); + SysFlowEntity flow = new SysFlowEntity(); + flow.setName(entity.getName()); + List flowList = sysFlowDao.query(flow); + if (CollectionUtils.isNotEmpty(flowList)){ + throw new BaseSystemException(entity.getName()+"重复"); + } + }else if("update".equals(type)){ + Assert.notEmpty(entity.getId(),"Id不能为空"); + SysFlowEntity flow = new SysFlowEntity(); + flow.setName(entity.getName()); + List flowList = sysFlowDao.query(flow); + if (CollectionUtils.isNotEmpty(flowList)){ + for (SysFlowEntity sysFlowEntity : flowList) { + if (!sysFlowEntity.getId().equals(entity.getId())){ + throw new BaseSystemException(entity.getName()+"重复"); + } + } + } + }else if ("delete".equals(type)){ + Assert.notEmpty(entity.getId(),"Id不能为空"); + + }else if ("queryPaged".equals(type)){ + Assert.notNull(entity.getPageNum(),"pageNum不能为空"); + Assert.notNull(entity.getPageSize(),"pageSize不能为空"); + } + } } From 70c6f8adf3e1b7fee131696b0ebce287064105ba Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 8 May 2025 08:48:18 +0800 Subject: [PATCH 38/67] =?UTF-8?q?=E5=A2=9E=E5=8A=A0flow=5Fid=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzya/frame/sys/flow/entity/SysFlowStepEntity.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.java b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.java index 52e7b316..bbef689c 100644 --- a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.java +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.java @@ -12,6 +12,8 @@ public class SysFlowStepEntity extends BaseEntity { /** 步骤序号 */ private Integer step; + //流程id + private String flowId; /** 步骤类型;1定时任务2数据库3应用 */ private String stepType; /** 描述 */ @@ -112,5 +114,12 @@ public class SysFlowStepEntity extends BaseEntity { this.sortMode = sortMode; } + public String getFlowId() { + return flowId; + } + + public void setFlowId(String flowId) { + this.flowId = flowId; + } } From bfd18dce39a71c891323ae09dc27321440a576fe Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 8 May 2025 08:50:07 +0800 Subject: [PATCH 39/67] =?UTF-8?q?=E5=A2=9E=E5=8A=A0flow=5Fid=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/flow/entity/SysFlowStepEntity.xml | 529 +++++++++--------- 1 file changed, 280 insertions(+), 249 deletions(-) diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.xml b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.xml index 795c9c7a..adc6a741 100644 --- a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowStepEntity.xml @@ -2,280 +2,311 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - + id - ,create_user_id + ,create_user_id ,create_time ,modify_user_id ,modify_time ,sts ,step ,step_type - ,description + ,flowId + ,description ,api_name ,action_type ,app_id ,api_id ,nifi_app_id ,nifi_api_id - ,sort_mode - - - + select + + from sys_flow_step + + and id = #{id} + and create_user_id = #{create_user_id} + and create_time = #{create_time} + and modify_user_id = #{modify_user_id} + and modify_time = #{modify_time} + and sts = #{sts} + and step = #{step} + and step_type = #{stepType} + and flow_id = #{flowId} + and description = #{description} + and api_name = #{apiName} + and action_type = #{actionType} + and app_id = #{appId} + and api_id = #{apiId} + and nifi_app_id = #{nifiAppId} + and nifi_api_id = #{nifiApiId} + and sort_mode = #{sortMode} and sts='Y' - - order by sorts asc - order by ${sort} ${order} - - - - + + + - + select + + from sys_flow_step + + and id like concat('%',#{id},'%') + and create_user_id like + concat('%',#{create_user_id},'%') + + and create_time like concat('%',#{create_time},'%') + and modify_user_id like + concat('%',#{modify_user_id},'%') + + and modify_time like concat('%',#{modify_time},'%') + and sts like concat('%',#{sts},'%') + and step like concat('%',#{step},'%') + and step_type like concat('%',#{stepType},'%') + and flow_id like concat('%',#{flowId},'%') + and description like concat('%',#{description},'%') + + and api_name like concat('%',#{apiName},'%') + and action_type like concat('%',#{actionType},'%') + and app_id like concat('%',#{appId},'%') + and api_id like concat('%',#{apiId},'%') + and nifi_app_id like concat('%',#{nifiAppId},'%') + and nifi_api_id like concat('%',#{nifiApiId},'%') + and sort_mode like concat('%',#{sortMode},'%') and sts='Y' - - order by sorts asc - order by ${sort} ${order} - + + order by sorts asc + order by ${sort} ${order} + - - + select + + from sys_flow_step + + or id = #{id} + or create_user_id = #{create_user_id} + or create_time = #{create_time} + or modify_user_id = #{modify_user_id} + or modify_time = #{modify_time} + or sts = #{sts} + or step = #{step} + or step_type = #{stepType} + or flow_id = #{flowId} + or description = #{description} + or api_name = #{apiName} + or action_type = #{actionType} + or app_id = #{appId} + or api_id = #{apiId} + or nifi_app_id = #{nifiAppId} + or nifi_api_id = #{nifiApiId} + or sort_mode = #{sortMode} and sts='Y' - - order by sorts asc - order by ${sort} ${order} - + + order by sorts asc + order by ${sort} ${order} + - - - insert into sys_flow_step( - - id , - create_user_id , - create_time , - modify_user_id , - modify_time , - sts , - step , - step_type , - description , - api_name , - action_type , - app_id , - api_id , - nifi_app_id , - nifi_api_id , - sort_mode , + + + insert into sys_flow_step( + + id , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + step , + step_type , + flow_id , + description , + api_name , + action_type , + app_id , + api_id , + nifi_app_id , + nifi_api_id , + sort_mode , sorts, - sts, - - )values( - - #{id} , - #{create_user_id} , - #{create_time} , - #{modify_user_id} , - #{modify_time} , - #{sts} , - #{step} , - #{stepType} , - #{description} , - #{apiName} , - #{actionType} , - #{appId} , - #{apiId} , - #{nifiAppId} , - #{nifiApiId} , - #{sortMode} , - COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step a WHERE a.sts = 'Y' ),1), - 'Y', - - ) - - - - insert into sys_flow_step(create_user_id, create_time, modify_user_id, modify_time, sts, step, step_type, description, api_name, action_type, app_id, api_id, nifi_app_id, nifi_api_id, sort_mode, sts) - values - - (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.step},#{entity.stepType},#{entity.description},#{entity.apiName},#{entity.actionType},#{entity.appId},#{entity.apiId},#{entity.nifiAppId},#{entity.nifiApiId},#{entity.sortMode}, 'Y') - - - - - insert into sys_flow_step(create_user_id, create_time, modify_user_id, modify_time, sts, step, step_type, description, api_name, action_type, app_id, api_id, nifi_app_id, nifi_api_id, sort_mode) - values - - (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.step},#{entity.stepType},#{entity.description},#{entity.apiName},#{entity.actionType},#{entity.appId},#{entity.apiId},#{entity.nifiAppId},#{entity.nifiApiId},#{entity.sortMode}) - - on duplicate key update - create_user_id = values(create_user_id), - create_time = values(create_time), - modify_user_id = values(modify_user_id), - modify_time = values(modify_time), - sts = values(sts), - step = values(step), - step_type = values(step_type), - description = values(description), - api_name = values(api_name), - action_type = values(action_type), - app_id = values(app_id), - api_id = values(api_id), - nifi_app_id = values(nifi_app_id), - nifi_api_id = values(nifi_api_id), - sort_mode = values(sort_mode) - - -update sys_flow_step set - - create_user_id = #{create_user_id}, - create_time = #{create_time}, - modify_user_id = #{modify_user_id}, - modify_time = #{modify_time}, - sts = #{sts}, - step = #{step}, - step_type = #{stepType}, - description = #{description}, - api_name = #{apiName}, - action_type = #{actionType}, - app_id = #{appId}, - api_id = #{apiId}, - nifi_app_id = #{nifiAppId}, - nifi_api_id = #{nifiApiId}, - sort_mode = #{sortMode}, - -where id = #{id} - - - -update sys_flow_step set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} -where id = #{id} - - - -update sys_flow_step set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} - - and id = #{id} - and sts = #{sts} - and step = #{step} - and step_type = #{stepType} - and description = #{description} - and api_name = #{apiName} - and action_type = #{actionType} - and app_id = #{appId} - and api_id = #{apiId} - and nifi_app_id = #{nifiAppId} - and nifi_api_id = #{nifiApiId} - and sort_mode = #{sortMode} + sts, + + )values( + + #{id} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{step} , + #{stepType} , + #{flowId} , + #{description} , + #{apiName} , + #{actionType} , + #{appId} , + #{apiId} , + #{nifiAppId} , + #{nifiApiId} , + #{sortMode} , + COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_flow_step a + WHERE a.sts = 'Y' ),1), + + 'Y', + + ) + + + + insert into sys_flow_step(create_user_id, create_time, modify_user_id, modify_time, sts, step, + step_type,flow_id, description, api_name, action_type, app_id, api_id, nifi_app_id, nifi_api_id, sort_mode, sts) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.step},#{entity.stepType},#{entity.flowId},#{entity.description},#{entity.apiName},#{entity.actionType},#{entity.appId},#{entity.apiId},#{entity.nifiAppId},#{entity.nifiApiId},#{entity.sortMode}, + 'Y') + + + + + insert into sys_flow_step(create_user_id, create_time, modify_user_id, modify_time, sts, step, step_type, + flow_id,description, api_name, action_type, app_id, api_id, nifi_app_id, nifi_api_id, sort_mode) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.step},#{entity.stepType},#{entity.flowId},#{entity.description},#{entity.apiName},#{entity.actionType},#{entity.appId},#{entity.apiId},#{entity.nifiAppId},#{entity.nifiApiId},#{entity.sortMode}) + + on duplicate key update + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + step = values(step), + step_type = values(step_type), + flow_id = values(flow_id), + description = values(description), + api_name = values(api_name), + action_type = values(action_type), + app_id = values(app_id), + api_id = values(api_id), + nifi_app_id = values(nifi_app_id), + nifi_api_id = values(nifi_api_id), + sort_mode = values(sort_mode) + + + + update sys_flow_step set + + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + step = #{step}, + step_type = #{stepType}, + flow_id = #{flowId}, + description = #{description}, + api_name = #{apiName}, + action_type = #{actionType}, + app_id = #{appId}, + api_id = #{apiId}, + nifi_app_id = #{nifiAppId}, + nifi_api_id = #{nifiApiId}, + sort_mode = #{sortMode}, + + where id = #{id} + + + + update sys_flow_step + set sts= 'N', + modify_time = #{modify_time}, + modify_user_id = #{modify_user_id} + where id = #{id} + + + + update sys_flow_step set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and sts = #{sts} + and step = #{step} + and step_type = #{stepType} + and flow_id = #{flowId} + and description = #{description} + and api_name = #{apiName} + and action_type = #{actionType} + and app_id = #{appId} + and api_id = #{apiId} + and nifi_app_id = #{nifiAppId} + and nifi_api_id = #{nifiApiId} + and sort_mode = #{sortMode} and sts='Y' - - - - - delete from sys_flow_step where id = #{id} - + + + + + delete + from sys_flow_step + where id = #{id} + From 257e7c22358640b853890e7876dd4f6d123de339 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Fri, 9 May 2025 15:44:55 +0800 Subject: [PATCH 40/67] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=81=94=E6=9F=A5sys?= =?UTF-8?q?=5Fflow=E6=A8=A1=E5=9D=97=E7=9A=84sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sysnew/user/entity/SysUserEntity.java | 10 +++ .../sysnew/user/entity/SysUserEntity.xml | 62 +++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.java b/base-service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.java index 8358eb94..3001bd91 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.java @@ -69,6 +69,8 @@ public class SysUserEntity extends BaseEntity { * 人员姓名 */ private String personName; + //编码 + private String personCode; /** * 关联组织机构名称 */ @@ -237,5 +239,13 @@ public class SysUserEntity extends BaseEntity { public void setOldPassword(String oldPassword) { OldPassword = oldPassword; } + + public String getPersonCode() { + return personCode; + } + + public void setPersonCode(String personCode) { + this.personCode = personCode; + } } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.xml b/base-service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.xml index 44badcb8..a17d774e 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.xml @@ -22,6 +22,7 @@ + @@ -72,6 +73,7 @@ ,a.org_id ,a.company_id ,p.person_Name + ,p.person_code ,a.wx_user_id ,a.dd_user_id from @@ -266,6 +268,66 @@ order by ${sort} ${order} + + + From adb4a566d43d3d0d5f563e41116815b8ec84e746 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Fri, 9 May 2025 17:38:34 +0800 Subject: [PATCH 41/67] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ISysDictionaryshopNewService.java | 9 +++++++++ .../impl/SysDictionaryshopNewServiceImpl.java | 16 ++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/base-service/src/main/java/com/hzya/frame/sys/dictionaryshopNew/service/ISysDictionaryshopNewService.java b/base-service/src/main/java/com/hzya/frame/sys/dictionaryshopNew/service/ISysDictionaryshopNewService.java index 252971c5..9bc3fe1d 100644 --- a/base-service/src/main/java/com/hzya/frame/sys/dictionaryshopNew/service/ISysDictionaryshopNewService.java +++ b/base-service/src/main/java/com/hzya/frame/sys/dictionaryshopNew/service/ISysDictionaryshopNewService.java @@ -13,4 +13,13 @@ import com.hzya.frame.sys.dictionaryshopNew.entity.SysDictionaryshopNew; public interface ISysDictionaryshopNewService { JsonResultEntity test(SysDictionaryshopNew object); + + /** + * 查询数据字典 + * @param tabName 表名 + * @param columnName 字段名 + * @param columnValue 字典值 + * @return + */ + SysDictionaryshopNew getDictionaryshopByValue(String tabName, String columnName, String columnValue); } \ No newline at end of file diff --git a/base-service/src/main/java/com/hzya/frame/sys/dictionaryshopNew/service/impl/SysDictionaryshopNewServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sys/dictionaryshopNew/service/impl/SysDictionaryshopNewServiceImpl.java index 92ac11cf..72dac9f1 100644 --- a/base-service/src/main/java/com/hzya/frame/sys/dictionaryshopNew/service/impl/SysDictionaryshopNewServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sys/dictionaryshopNew/service/impl/SysDictionaryshopNewServiceImpl.java @@ -33,4 +33,20 @@ public class SysDictionaryshopNewServiceImpl extends ServiceUtil implements ISy return BaseResult.getSuccessMessageEntity("获取应用成功"); } + /** + * 查询数据字典 + * + * @param tabName 表名 + * @param columnName 字段名 + * @param columnValue 字典值 + * @return + */ + @Override + public SysDictionaryshopNew getDictionaryshopByValue(String tabName, String columnName, String columnValue) { + SysDictionaryshopNew sysDictionaryshopNew = new SysDictionaryshopNew(); + sysDictionaryshopNew.setTabName(tabName); + sysDictionaryshopNew.setColumnName(columnName); + sysDictionaryshopNew.setColumnValue(columnValue); + return sysdictionaryshopnewMapper.entity_get_by_value(sysDictionaryshopNew); + } } From 97840df6a1068c133c730f95003c5715454df815 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Fri, 9 May 2025 17:38:53 +0800 Subject: [PATCH 42/67] =?UTF-8?q?=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/sys/flow/entity/SysFlowEntity.java | 18 +++ .../frame/sys/flow/entity/SysFlowEntity.xml | 117 +++++++++--------- .../service/ISysFlowClassRuleService.java | 7 ++ .../flow/service/ISysFlowClassService.java | 6 + .../service/ISysFlowNifiConstantService.java | 7 ++ .../impl/SysFlowClassRuleServiceImpl.java | 18 ++- .../service/impl/SysFlowClassServiceImpl.java | 47 ++++++- .../impl/SysFlowNifiConstantServiceImpl.java | 20 +++ .../flow/service/impl/SysFlowServiceImpl.java | 24 +++- 9 files changed, 202 insertions(+), 62 deletions(-) diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowEntity.java b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowEntity.java index d8527213..fe3b4ce1 100644 --- a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowEntity.java +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowEntity.java @@ -14,8 +14,10 @@ public class SysFlowEntity extends BaseEntity { private String name; /** 流程分类id */ private String classId; + private String className; /** 触发方式id */ private String triggerModeId; + private String triggerModeName; /** 应用组id */ private String nifiGroupId; /** 流程描述 */ @@ -70,5 +72,21 @@ public class SysFlowEntity extends BaseEntity { public void setStatus(String status) { this.status = status; } + + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + public String getTriggerModeName() { + return triggerModeName; + } + + public void setTriggerModeName(String triggerModeName) { + this.triggerModeName = triggerModeName; + } } diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowEntity.xml b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowEntity.xml index db8a222b..fb84024c 100644 --- a/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/entity/SysFlowEntity.xml @@ -12,46 +12,49 @@ + - id - ,create_user_id - ,create_time - ,modify_user_id - ,modify_time - ,sts - ,name - ,status - ,class_id - ,trigger_mode_id - ,nifi_group_id - ,description + sf.id + ,sf.create_user_id + ,sf.create_time + ,sf.modify_user_id + ,sf.modify_time + ,sf.sts + ,sf.name + ,sf.status + ,sf.class_id + ,sfc.name as className + ,sf.trigger_mode_id + ,sf.nifi_group_id + ,sf.description @@ -81,23 +84,24 @@ @@ -105,21 +109,22 @@ + select + + from sys_application_account + + and id = #{id} + and create_user_id = #{create_user_id} + and create_time = #{create_time} + and modify_user_id = #{modify_user_id} + and modify_time = #{modify_time} + and sts = #{sts} + and sorts = #{sorts} + and app_id = #{appId} + and name = #{name} + and ip_address = #{ipAddress} + and port = #{port} + and db_name = #{dbName} + and user_name = #{userName} + and password = #{password} + and db_type = #{dbType} + and app_key = #{appKey} + and app_secret = #{appSecret} + and corpId = #{corpid} + and agentId = #{agentid} + and sts='Y' + + order by sorts asc + order by ${sort} ${order} + + + + + + + + + + + + + + insert into sys_application_account( + + id , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + sorts , + name , + ip_address , + port , + db_name , + user_name , + password , + db_type , + app_key , + app_secret , + corpId , + agentId , + sorts, + sts, + + )values( + + #{id} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{sorts} , + #{name} , + #{ipAddress} , + #{port} , + #{dbName} , + #{userName} , + #{password} , + #{dbType} , + #{appKey} , + #{appSecret} , + #{corpid} , + #{agentid} , + COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_application_account a + WHERE a.sts = 'Y' )1), + + 'Y', + + ) + + + + insert into sys_application_account(create_user_id, create_time, modify_user_id, modify_time, sts, sorts, name, + ip_address, port, db_name, user_name, password, db_type, app_key, app_secret, corpId, agentId, sts) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.sorts},#{entity.name},#{entity.ipAddress},#{entity.port},#{entity.dbName},#{entity.userName},#{entity.password},#{entity.dbType},#{entity.appKey},#{entity.appSecret},#{entity.corpid},#{entity.agentid}, + 'Y') + + + + + insert into sys_application_account(create_user_id, create_time, modify_user_id, modify_time, sts, sorts, name, + ip_address, port, db_name, user_name, password, db_type, app_key, app_secret, corpId, agentId) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.sorts},#{entity.name},#{entity.ipAddress},#{entity.port},#{entity.dbName},#{entity.userName},#{entity.password},#{entity.dbType},#{entity.appKey},#{entity.appSecret},#{entity.corpid},#{entity.agentid}) + + on duplicate key update + create_user_id = values(create_user_id), + create_time = values(create_time), + modify_user_id = values(modify_user_id), + modify_time = values(modify_time), + sts = values(sts), + sorts = values(sorts), + name = values(name), + ip_address = values(ip_address), + port = values(port), + db_name = values(db_name), + user_name = values(user_name), + password = values(password), + db_type = values(db_type), + app_key = values(app_key), + app_secret = values(app_secret), + corpId = values(corpId), + agentId = values(agentId) + + + + update sys_application_account set + + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + sorts = #{sorts}, + name = #{name}, + ip_address = #{ipAddress}, + port = #{port}, + db_name = #{dbName}, + user_name = #{userName}, + password = #{password}, + db_type = #{dbType}, + app_key = #{appKey}, + app_secret = #{appSecret}, + corpId = #{corpid}, + agentId = #{agentid}, + + where id = #{id} + + + + update sys_application_account + set sts= 'N', + modify_time = #{modify_time}, + modify_user_id = #{modify_user_id} + where id = #{id} + + + + update sys_application_account set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and sts = #{sts} + and sorts = #{sorts} + and name = #{name} + and ip_address = #{ipAddress} + and port = #{port} + and db_name = #{dbName} + and user_name = #{userName} + and password = #{password} + and db_type = #{dbType} + and app_key = #{appKey} + and app_secret = #{appSecret} + and corpId = #{corpid} + and agentId = #{agentid} + and sts='Y' + + + + + delete + from sys_application_account + where id = #{id} + + + + diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/appAcount/service/ISysApplicationAccountService.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/appAcount/service/ISysApplicationAccountService.java new file mode 100644 index 00000000..c06d2ed8 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/appAcount/service/ISysApplicationAccountService.java @@ -0,0 +1,57 @@ +package com.hzya.frame.sysnew.application.appAcount.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.application.appAcount.entity.SysApplicationAccountEntity; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * 应用账户表(SysApplicationAccount)表服务接口 + * + * @author xiang2lin + * @since 2025-05-10 15:52:25 + */ +public interface ISysApplicationAccountService extends IBaseService{ + + /** + * 保存账户信息 + * @param object + * @return + */ + JsonResultEntity saveAccount(JSONObject object); + + /** + * 更新账户信息 + * @param object + * @return + */ + JsonResultEntity updateAccount(JSONObject object); + + /** + * 删除账户信息 + * @param object + * @return + */ + JsonResultEntity deleteAccount(JSONObject object); + + /** + * 查询账户详情 + * @param object + * @return + */ + JsonResultEntity getAccount(JSONObject object); + + /** + * 查询账户列表数据 + * @param object + * @return + */ + JsonResultEntity queryAccountList(JSONObject object); + + /** + * 查询账户分页数据 + * @param object + * @return + */ + JsonResultEntity queryAccountPaged(JSONObject object); +} diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/appAcount/service/impl/SysApplicationAccountServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/appAcount/service/impl/SysApplicationAccountServiceImpl.java new file mode 100644 index 00000000..486e4526 --- /dev/null +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/appAcount/service/impl/SysApplicationAccountServiceImpl.java @@ -0,0 +1,107 @@ +package com.hzya.frame.sysnew.application.appAcount.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.application.appAcount.entity.SysApplicationAccountEntity; +import com.hzya.frame.sysnew.application.appAcount.dao.ISysApplicationAccountDao; +import com.hzya.frame.sysnew.application.appAcount.service.ISysApplicationAccountService; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import javax.annotation.Resource; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * 应用账户表(SysApplicationAccount)表服务实现类 + * + * @author xiang2lin + * @since 2025-05-10 15:52:26 + */ +@Service(value = "sysApplicationAccountService") +public class SysApplicationAccountServiceImpl extends BaseService implements ISysApplicationAccountService { + + private ISysApplicationAccountDao sysApplicationAccountDao; + + @Autowired + public void setSysApplicationAccountDao(ISysApplicationAccountDao dao) { + this.sysApplicationAccountDao = dao; + this.dao = dao; + } + + /** + * 保存账户信息 + * + * @param object + * @return + */ + @Override + public JsonResultEntity saveAccount(JSONObject object) { + SysApplicationAccountEntity entity = getData("jsonStr", object, SysApplicationAccountEntity.class); + try { + checkParam(entity,"save"); + }catch (Exception e){ + return BaseResult.getFailureMessageEntity(e.getMessage()); + } + sysApplicationAccountDao.save(entity); + return BaseResult.getSuccessMessageEntity("新增成功"); + } + + /** + * 更新账户信息 + * + * @param object + * @return + */ + @Override + public JsonResultEntity updateAccount(JSONObject object) { + return null; + } + + /** + * 删除账户信息 + * + * @param object + * @return + */ + @Override + public JsonResultEntity deleteAccount(JSONObject object) { + return null; + } + + /** + * 查询账户详情 + * + * @param object + * @return + */ + @Override + public JsonResultEntity getAccount(JSONObject object) { + return null; + } + + /** + * 查询账户列表数据 + * + * @param object + * @return + */ + @Override + public JsonResultEntity queryAccountList(JSONObject object) { + return null; + } + + /** + * 查询账户分页数据 + * + * @param object + * @return + */ + @Override + public JsonResultEntity queryAccountPaged(JSONObject object) { + return null; + } + + //数据检查 + private void checkParam(SysApplicationAccountEntity entity,String type){ + + } +} From a0ab2e87ba8e7cb931ee09ffe20581aa323718e5 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Mon, 12 May 2025 13:45:33 +0800 Subject: [PATCH 44/67] =?UTF-8?q?=E5=88=86=E7=B1=BB=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/flow/service/impl/SysFlowClassRuleServiceImpl.java | 5 +++++ .../frame/sys/flow/service/impl/SysFlowClassServiceImpl.java | 2 ++ 2 files changed, 7 insertions(+) diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowClassRuleServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowClassRuleServiceImpl.java index 23b72134..ed3a58c8 100644 --- a/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowClassRuleServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowClassRuleServiceImpl.java @@ -2,6 +2,7 @@ package com.hzya.frame.sys.flow.service.impl; import cn.hutool.core.convert.Convert; import cn.hutool.core.lang.Assert; +import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -109,6 +110,7 @@ public class SysFlowClassRuleServiceImpl extends BaseService sysUserEntities = sysUserDao.queryList(userEntity, "com.hzya.frame.sysnew.user.dao.impl.SysUserDaoImpl.entity_list_notin_sys_flowClass"); return BaseResult.getSuccessMessageEntity("查询成功",sysUserEntities); } diff --git a/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowClassServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowClassServiceImpl.java index dc776677..ced25510 100644 --- a/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowClassServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sys/flow/service/impl/SysFlowClassServiceImpl.java @@ -12,6 +12,7 @@ import com.hzya.frame.sys.flow.entity.SysFlowEntity; import com.hzya.frame.sys.flow.service.ISysFlowClassService; import com.hzya.frame.sysnew.user.dao.ISysUserDao; import com.hzya.frame.sysnew.user.entity.SysUserEntity; +import com.hzya.frame.uuid.UUIDLong; import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; @@ -93,6 +94,7 @@ public class SysFlowClassServiceImpl extends BaseService Date: Mon, 12 May 2025 13:46:04 +0800 Subject: [PATCH 45/67] =?UTF-8?q?=E5=A2=9E=E5=8A=A0nifi=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/entity/SysApplicationDto.java | 10 ++++++++++ .../entity/SysApplicationEntity.java | 10 ++++++++++ .../entity/SysApplicationEntity.xml | 20 +++++++++++++++---- .../impl/SysApplicationServiceImpl.java | 1 + 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationDto.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationDto.java index e619ae21..87e28f54 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationDto.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationDto.java @@ -61,6 +61,8 @@ public class SysApplicationDto { private List apiParas; /** 系统类型 1、致远OA 2、用友U8C 3、用友BIP */ private String appType; + //nifi的id + private String nifiAppId; //数据源 private SysApplicationDatabaseEntity databaseEntity; private Integer pageNum; @@ -271,5 +273,13 @@ public class SysApplicationDto { public void setAppType(String appType) { this.appType = appType; } + + public String getNifiAppId() { + return nifiAppId; + } + + public void setNifiAppId(String nifiAppId) { + this.nifiAppId = nifiAppId; + } } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.java index 3be0953f..ee1f05fe 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.java @@ -44,6 +44,8 @@ public class SysApplicationEntity extends BaseEntity { private String dbStatus; /** 新消息数 */ private int newMessageCount; + //nifi的appid + private String nifiAppId; public int getNewMessageCount() { return newMessageCount; @@ -211,5 +213,13 @@ public class SysApplicationEntity extends BaseEntity { public void setAppType(String appType) { this.appType = appType; } + + public String getNifiAppId() { + return nifiAppId; + } + + public void setNifiAppId(String nifiAppId) { + this.nifiAppId = nifiAppId; + } } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.xml b/base-service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.xml index e9852749..ecfc0d3f 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/entity/SysApplicationEntity.xml @@ -23,6 +23,7 @@ + @@ -53,6 +54,7 @@ ,interface_status ,db_status ,app_type + ,nifi_app_id ,sorts ,org_id ,sts @@ -93,6 +95,7 @@ and interface_status = #{interfaceStatus} and db_status = #{dbStatus} and app_type = #{appType} + and nifi_app_id = #{nifiAppId} and sorts = #{sorts} and org_id = #{org_id} and sts = #{sts} @@ -130,6 +133,7 @@ and interface_status = #{interfaceStatus} and db_status = #{dbStatus} and app_type = #{appType} + and nifi_app_id = #{nifiAppId} and sorts = #{sorts} and org_id = #{org_id} and sts = #{sts} @@ -169,6 +173,7 @@ and interface_status like concat('%',#{interfaceStatus},'%') and db_status like concat('%',#{dbStatus},'%') and app_type like concat('%',#{appType},'%') + and nifi_app_id like concat('%',#{nifiAppId},'%') and sorts like concat('%',#{sorts},'%') and org_id like concat('%',#{org_id},'%') and sts like concat('%',#{sts},'%') @@ -208,6 +213,7 @@ or interface_status = #{interfaceStatus} or db_status = #{dbStatus} or app_type = #{appType} + or nifi_app_id = #{nifiAppId} or sorts = #{sorts} or org_id = #{org_id} or sts = #{sts} @@ -246,6 +252,7 @@ interface_status , db_status , app_type , + nifi_app_id , sorts , org_id , sts , @@ -278,6 +285,7 @@ #{interfaceStatus} , #{dbStatus} , #{appType} , + #{nifiAppId} , #{sorts} , #{org_id} , #{sts} , @@ -291,18 +299,18 @@ - insert into sys_application(app_logo, app_status, name, version_number, app_id, system_address, access_mode, affiliation_field, manufacturer, app_introduction, client_path, web_path, program_path, public_key, secret_key, interface_address, interface_status, db_status,app_type, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id, sts) + insert into sys_application(app_logo, app_status, name, version_number, app_id, system_address, access_mode, affiliation_field, manufacturer, app_introduction, client_path, web_path, program_path, public_key, secret_key, interface_address, interface_status, db_status,app_type,nifi_app_id, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id, sts) values - (#{entity.appLogo},#{entity.appStatus},#{entity.name},#{entity.versionNumber},#{entity.appId},#{entity.systemAddress},#{entity.accessMode},#{entity.affiliationField},#{entity.manufacturer},#{entity.appIntroduction},#{entity.clientPath},#{entity.webPath},#{entity.programPath},#{entity.publicKey},#{entity.secretKey},#{entity.interfaceAddress},#{entity.interfaceStatus},#{entity.dbStatus},#{entity.appType},#{entity.sorts},#{entity.org_id},#{entity.sts},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id}, 'Y') + (#{entity.appLogo},#{entity.appStatus},#{entity.name},#{entity.versionNumber},#{entity.appId},#{entity.systemAddress},#{entity.accessMode},#{entity.affiliationField},#{entity.manufacturer},#{entity.appIntroduction},#{entity.clientPath},#{entity.webPath},#{entity.programPath},#{entity.publicKey},#{entity.secretKey},#{entity.interfaceAddress},#{entity.interfaceStatus},#{entity.dbStatus},#{entity.appType},#{entity.nifiAppId},#{entity.sorts},#{entity.org_id},#{entity.sts},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id}, 'Y') - insert into sys_application(app_logo, app_status, name, version_number,app_id,system_address, access_mode, affiliation_field, manufacturer, app_introduction, client_path, web_path, program_path, public_key, secret_key, interface_address, interface_status, db_status,app_type, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id) + insert into sys_application(app_logo, app_status, name, version_number,app_id,system_address, access_mode, affiliation_field, manufacturer, app_introduction, client_path, web_path, program_path, public_key, secret_key, interface_address, interface_status, db_status,app_type,nifi_app_id, sorts, org_id, sts, create_time, create_user_id, modify_time, modify_user_id) values - (#{entity.appLogo},#{entity.appStatus},#{entity.name},#{entity.versionNumber},#{entity.appId},#{entity.systemAddress},#{entity.accessMode},#{entity.affiliationField},#{entity.manufacturer},#{entity.appIntroduction},#{entity.clientPath},#{entity.webPath},#{entity.programPath},#{entity.publicKey},#{entity.secretKey},#{entity.interfaceAddress},#{entity.interfaceStatus},#{entity.dbStatus},#{entity.appType},#{entity.sorts},#{entity.org_id},#{entity.sts},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id}) + (#{entity.appLogo},#{entity.appStatus},#{entity.name},#{entity.versionNumber},#{entity.appId},#{entity.systemAddress},#{entity.accessMode},#{entity.affiliationField},#{entity.manufacturer},#{entity.appIntroduction},#{entity.clientPath},#{entity.webPath},#{entity.programPath},#{entity.publicKey},#{entity.secretKey},#{entity.interfaceAddress},#{entity.interfaceStatus},#{entity.dbStatus},#{entity.appType},#{entity.nifiAppId},#{entity.sorts},#{entity.org_id},#{entity.sts},#{entity.create_time},#{entity.create_user_id},#{entity.modify_time},#{entity.modify_user_id}) on duplicate key update app_logo = values(app_logo), @@ -324,6 +332,7 @@ interface_status = values(interface_status), db_status = values(db_status), app_type = values(app_type), + nifi_app_id = values(nifi_app_id), sorts = values(sorts), org_id = values(org_id), sts = values(sts), @@ -354,6 +363,7 @@ update sys_application set interface_status = #{interfaceStatus}, db_status = #{dbStatus}, app_type = #{appType}, + nifi_app_id = #{nifiAppId}, sorts = #{sorts}, org_id = #{org_id}, sts = #{sts}, @@ -393,6 +403,7 @@ update sys_application set sts= 'N' ,modify_time = #{modify_time},modify_user_i and interface_status = #{interfaceStatus} and db_status = #{dbStatus} and app_type = #{appType} + and nifi_app_id = #{nifiAppId} and sorts = #{sorts} and sts = #{sts} and sts='Y' @@ -421,6 +432,7 @@ update sys_application set sts= 'N' ,modify_time = #{modify_time},modify_user_i ,a.interface_status as interfaceStatus ,a.db_status as dbStatus ,a.app_type as appType + ,a.nifi_app_id as nifiAppId from sys_application a and a.affiliation_field = #{affiliationField} diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java index ad9976a0..5afcadef 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java @@ -718,6 +718,7 @@ public class SysApplicationServiceImpl extends BaseService Date: Mon, 12 May 2025 13:46:43 +0800 Subject: [PATCH 46/67] =?UTF-8?q?=E8=81=94=E6=9F=A5=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E5=99=A8=E7=9B=B8=E5=85=B3=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzya/frame/sysnew/user/entity/SysUserEntity.java | 11 +++++++++++ .../hzya/frame/sysnew/user/entity/SysUserEntity.xml | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.java b/base-service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.java index 3001bd91..7280a09d 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.java @@ -88,6 +88,9 @@ public class SysUserEntity extends BaseEntity { private String wxUserId; + //sys_flow模块用 + private String flowClassId; + public String getDdUserId() { return ddUserId; } @@ -247,5 +250,13 @@ public class SysUserEntity extends BaseEntity { public void setPersonCode(String personCode) { this.personCode = personCode; } + + public String getFlowClassId() { + return flowClassId; + } + + public void setFlowClassId(String flowClassId) { + this.flowClassId = flowClassId; + } } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.xml b/base-service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.xml index a17d774e..3642ff41 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.xml @@ -291,6 +291,7 @@ ,a.org_id ,a.company_id ,p.person_Name + ,p.person_code ,p.mobile_phone ,o.organ_name from @@ -323,8 +324,10 @@ and a.org_id like concat('%',#{org_id},'%') and a.company_id like concat('%',#{companyId},'%') and p.organ_id = #{organId} + and p.mobile_phone like concat('%',#{mobilePhone},'%') + and p.person_Name like concat('%',#{personName},'%') and a.sts='Y' - and a.id not in (select user_id from sys_flow_class_rule where sts = 'Y') + and a.id not in (select user_id from sys_flow_class_rule where sts = 'Y' and flow_class_id = #{flowClassId}) From 25be18824e9dfa42939ddf947d945fce9b77d7f8 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 22 May 2025 14:20:38 +0800 Subject: [PATCH 47/67] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E8=AF=B7?= =?UTF-8?q?=E8=B4=AD=E5=8D=95=E6=8F=92=E4=BB=B6=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RequisitionOrderPluginInitializer.java | 102 ++++++++++++++++++ .../IRequisitionOrderPluginService.java | 19 ++++ .../RequisitionOrderPluginServiceImpl.java | 44 ++++++++ .../cfgHome/plugin/ncc/pluginCfg.xml | 6 ++ .../ncc/spring/spring-buildpackage-dao.xml | 4 + .../ncc/spring/spring-buildpackage-plugin.xml | 5 + .../spring/spring-buildpackage-service.xml | 5 + 7 files changed, 185 insertions(+) create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/plugin/RequisitionOrderPluginInitializer.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/IRequisitionOrderPluginService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/RequisitionOrderPluginServiceImpl.java create mode 100644 base-buildpackage/src/main/resources/cfgHome/plugin/ncc/pluginCfg.xml create mode 100644 base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-dao.xml create mode 100644 base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-plugin.xml create mode 100644 base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-service.xml diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/plugin/RequisitionOrderPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/plugin/RequisitionOrderPluginInitializer.java new file mode 100644 index 00000000..f6c9e3e0 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/plugin/RequisitionOrderPluginInitializer.java @@ -0,0 +1,102 @@ +package com.hzya.frame.plugin.ncc.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @Description 请购单传NCC + * @Author xiangerlin + * @Date 2025/5/21 16:50 + **/ +public class RequisitionOrderPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(RequisitionOrderPluginInitializer.class); + /*** + * 插件初始化方法 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 10:48 + * @Param [] + * @return void + **/ + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + /**** + * 插件销毁方法 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + /**** + * 插件的ID + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginId() { + return "RequisitionOrderPlugin"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "请购单传NCC插件"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "请购单传NCC插件"; + } + + /*** + * 插件类型 1、场景插件 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 14:01 + * @Param [] + * @return java.lang.String + **/ + @Override + public String getPluginType() { + return "1"; + } + + /*** + * 执行业务代码 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-07 11:20 + * @param requestJson 执行业务代码的参数 + * @return void + **/ + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + try { + logger.info("======开始执行请购单传NCC插件======"); + }catch (Exception e){ + logger.info("======执行请购单传NCC插件出错======{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("请购单传NCC插件执行失败",e.getMessage()); + } + return BaseResult.getSuccessMessageEntity("请购单传NCC插件执行成功"); + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/IRequisitionOrderPluginService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/IRequisitionOrderPluginService.java new file mode 100644 index 00000000..ef13b03f --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/IRequisitionOrderPluginService.java @@ -0,0 +1,19 @@ +package com.hzya.frame.plugin.ncc.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * @Description 请购单传nCC + * @Author xiangerlin + * @Date 2025/5/21 17:44 + **/ +public interface IRequisitionOrderPluginService { + + /** + * 请购单同步到ncc + * @param requestJson + * @return + */ + JsonResultEntity sync2ncc(JSONObject requestJson); +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/RequisitionOrderPluginServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/RequisitionOrderPluginServiceImpl.java new file mode 100644 index 00000000..ca29ecae --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/RequisitionOrderPluginServiceImpl.java @@ -0,0 +1,44 @@ +package com.hzya.frame.plugin.ncc.service.impl; + +import cn.hutool.core.lang.Assert; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.ncc.service.IRequisitionOrderPluginService; +import com.hzya.frame.seeyon.enums.ColEventTypeEnum; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @Description 请购单传NCC + * @Author xiangerlin + * @Date 2025/5/21 17:44 + **/ +public class RequisitionOrderPluginServiceImpl implements IRequisitionOrderPluginService { + Logger logger = LoggerFactory.getLogger(IRequisitionOrderPluginService.class); + /** + * 请购单同步到ncc + * + * @param requestJson + * @return + */ + @Override + public JsonResultEntity sync2ncc(JSONObject requestJson) { + //数据源编码 + String datasourceCode = requestJson.getString("sourceCode"); + String headersStr = requestJson.getString("headers");//请求头 + String formAppId = requestJson.getString("formApp"); + String eventType = requestJson.getString("eventType"); + JSONObject formmainData = requestJson.getJSONObject("formmainTableName"); + JSONArray forsonData = requestJson.getJSONArray("forsonTableName"); + Assert.notEmpty(formAppId,"formAppId不能为空"); + Assert.notEmpty(eventType,"eventType不能为空"); + Assert.notEmpty(headersStr,"headers不能为空"); + //流程发起 + if (ColEventTypeEnum.ONSTART.getType().equals(eventType)){ + + } + return BaseResult.getSuccessMessageEntity("请购单推NCC成功"); + } +} diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/pluginCfg.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/pluginCfg.xml new file mode 100644 index 00000000..76cf338f --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/pluginCfg.xml @@ -0,0 +1,6 @@ + + +JHNCCPlugin +建辉NCC插件 +202505210001 + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-dao.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-dao.xml new file mode 100644 index 00000000..f857d7fc --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-dao.xml @@ -0,0 +1,4 @@ + + + + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-plugin.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-plugin.xml new file mode 100644 index 00000000..df9ac20d --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-plugin.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-service.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-service.xml new file mode 100644 index 00000000..c7c87be7 --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-service.xml @@ -0,0 +1,5 @@ + + + + + From fc2512bfa9eb2900d0bd381bc43200210447cc5b Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Fri, 23 May 2025 14:08:48 +0800 Subject: [PATCH 48/67] =?UTF-8?q?NCC=E4=BB=98=E6=AC=BE=E5=8D=95=E4=BC=A0?= =?UTF-8?q?=E9=80=92OA=E4=BB=A5=E5=8F=8AOA=E4=BB=98=E6=AC=BE=E5=8D=95?= =?UTF-8?q?=E6=8E=A8=E9=80=81CBS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/oa/payment/dao/IPaymentDao.java | 39 + .../oa/payment/dao/IPaymentDetailsDao.java | 18 + .../oa/payment/dao/impl/PaymentDaoImpl.java | 28 + .../dao/impl/PaymentDetailsDaoImpl.java | 16 + .../payment/entity/PaymentDetailsEntity.java | 1402 +++++++++++++++++ .../payment/entity/PaymentDetailsEntity.xml | 168 ++ .../oa/payment/entity/PaymentEntity.java | 1098 +++++++++++++ .../oa/payment/entity/PaymentEntity.xml | 153 ++ .../CbsResultToOAPluginInitializer.java | 145 ++ .../OAApprovedToCbsPluginInitializer.java | 155 ++ .../plugin/PaymentToOAPluginInitializer.java | 222 +++ .../oa/payment/service/IPaymentService.java | 7 + .../service/impl/PaymentServiceImpl.java | 8 + .../cfgHome/plugin/oa/payment/pluginCfg.xml | 6 + .../spring/spring-buildpackage-dao.xml | 6 + .../spring/spring-buildpackage-plugin.xml | 7 + .../spring/spring-buildpackage-service.xml | 5 + 17 files changed, 3483 insertions(+) create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/IPaymentDao.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/IPaymentDetailsDao.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/impl/PaymentDaoImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/impl/PaymentDetailsDaoImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentDetailsEntity.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentDetailsEntity.xml create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentEntity.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentEntity.xml create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/CbsResultToOAPluginInitializer.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/OAApprovedToCbsPluginInitializer.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/PaymentToOAPluginInitializer.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/IPaymentService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/impl/PaymentServiceImpl.java create mode 100644 base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/pluginCfg.xml create mode 100644 base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-dao.xml create mode 100644 base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-plugin.xml create mode 100644 base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-service.xml diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/IPaymentDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/IPaymentDao.java new file mode 100644 index 00000000..223f3442 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/IPaymentDao.java @@ -0,0 +1,39 @@ +package com.hzya.frame.plugin.oa.payment.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.oa.payment.entity.PaymentEntity; + +import java.util.List; + +public interface IPaymentDao extends IBaseDao { + + /** + * 查询OA审批完成的单据传递CBS + * @content + * @Param + * @Return + * @Author hecan + * @Date 2025-05-22 10:03 + * **/ + List queryPaymentOAToCbs(PaymentEntity entity); + + /** + * + * @content 查询OA需要查询支付状态的数据 + * @Param + * @Return + * @Author hecan + * @Date 2025-05-22 11:33 + * **/ + List queryPaymentOAResult(PaymentEntity entity); + + /** + * + * @content 更新OA支付结果 + * @Param + * @Return + * @Author hecan + * @Date 2025-05-23 11:44 + * **/ + Integer updatePaymentOAResult(PaymentEntity entity); +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/IPaymentDetailsDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/IPaymentDetailsDao.java new file mode 100644 index 00000000..aaf24d3b --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/IPaymentDetailsDao.java @@ -0,0 +1,18 @@ +package com.hzya.frame.plugin.oa.payment.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.oa.payment.entity.PaymentDetailsEntity; + +import java.util.List; + +public interface IPaymentDetailsDao extends IBaseDao { + /** + * + * @content 查询OA付款单明细数据 + * @Param + * @Return + * @Author hecan + * @Date 2025-05-23 10:37 + * **/ + List queryPaymentDetails(PaymentDetailsEntity entity); +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/impl/PaymentDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/impl/PaymentDaoImpl.java new file mode 100644 index 00000000..0c7b763c --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/impl/PaymentDaoImpl.java @@ -0,0 +1,28 @@ +package com.hzya.frame.plugin.oa.payment.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.oa.payment.dao.IPaymentDao; +import com.hzya.frame.plugin.oa.payment.entity.PaymentEntity; + +import java.util.List; + +public class PaymentDaoImpl extends MybatisGenericDao implements IPaymentDao { + @DS("#entity.dataSourceCode") + @Override + public List queryPaymentOAToCbs(PaymentEntity entity) { + return (List) super.selectList("queryPaymentOAToCbs",entity); + } + + @DS("#entity.dataSourceCode") + @Override + public List queryPaymentOAResult(PaymentEntity entity) { + return (List) super.selectList("queryPaymentOAResult",entity); + } + + @DS("#entity.dataSourceCode") + @Override + public Integer updatePaymentOAResult(PaymentEntity entity) { + return super.update("updatePaymentOAResult",entity); + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/impl/PaymentDetailsDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/impl/PaymentDetailsDaoImpl.java new file mode 100644 index 00000000..05621d63 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/impl/PaymentDetailsDaoImpl.java @@ -0,0 +1,16 @@ +package com.hzya.frame.plugin.oa.payment.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.oa.payment.dao.IPaymentDetailsDao; +import com.hzya.frame.plugin.oa.payment.entity.PaymentDetailsEntity; + +import java.util.List; + +public class PaymentDetailsDaoImpl extends MybatisGenericDao implements IPaymentDetailsDao { + @DS("#entity.dataSourceCode") + @Override + public List queryPaymentDetails(PaymentDetailsEntity entity) { + return (List) super.selectList("queryPaymentDetails",entity); + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentDetailsEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentDetailsEntity.java new file mode 100644 index 00000000..c5264a34 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentDetailsEntity.java @@ -0,0 +1,1402 @@ +package com.hzya.frame.plugin.oa.payment.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +public class PaymentDetailsEntity extends BaseEntity { + private String pkPayitem;//付款单行标识 + private String settOrg;// 结算财务组织 + private String pkOrg;// 付款财务组织 + private String pkFiorg;// 财务组织 + private String pkPcorg;// 利润中心 + private String puOrg;// 业务组织 + private String puOrgV;//业务组织版本主键 + private String settOrgV;// 结算财务组织版本主键 + private String pkPcorgV;// 利润中心版本主键 + private String pkOrgV;// 付款财务组织版本主键 + private String pkfiorgv;// 财务组织版本主键 + private String pupsndoc;// 业务人员 + private String puDeptid;// 业务部门 + private String puDeptidV;// 业务部门版本 + private String prepay;// 付款性质 + private String material;// 物料 + private String supplier;// 供应商 + private String postunit;// 报价计量单位 + private String postpricenotax;// 报价单位无税单价 + private String postquantity;// 报价单位数量 + private String postprice;// 报价单位含税单价 + private String checkdirection;// 票据方向 + private String coordflag;// 单据协同状态 + private String equipmentcode;// 设备编码 + private String productline ;//产品线 + private String cashitem;// 现金流量项目 + private String payflag;// 支付状态 + private String bankrollprojet;// 资金计划项目 + private String pausetransact ;//挂起标志 + private String billdate;// 单据日期 + private String payman;// 支付人 + private String paydate;// 支付日期 + private String pkGroup;// 所属集团 + private String pkBilltype;// 单据类型编码 + private String billclass;// 单据大类 + private String pkTradetype ;//付款类型code + private String pkTradetypeid;// 付款类型 + private String busidate;// 起算日期 + private String pkSubjcode;// 收支项目 + private String billno;// 单据号 + private String objtype;// 往来对象 + private String rowno;// 单据分录号 + private String rowtype;// 行类型 + private String direction;// 方向 + private String checktype;// 票据类型 + private String pkSsitem;// 事项审批单 + private String scomment ;//摘要 + private String subjcode;// 科目 + private String pkCurrtype ;//币种 + private String rate;// 组织本币汇率 + private String pkDeptid ;//部门 + private String pkDeptidV;// 部 门 + private String pkPsndoc;// 业务员 + private String moneyDe;// 借方原币金额 + private String localMoneyDe;// 组织本币金额(借方) + private String quantityDe;// 借方数量 + private String quantityCr ;//贷方数量 + private String moneyBal ;//原币余额 + private String localMoneyBal;// 组织本币余额 + private String quantityBal;// 数量余额 + private String localTaxDe;// 税额 + private String notaxDe;// 借方原币无税金额 + private String localNotaxDe;// 组织本币无税金额(借方) + private String price ;//单价 + private String taxprice ;//含税单价 + private String taxrate ;//税率 + private String taxnum;// 税号 + private String pkBalatype;// 结算方式 + private String topBillid;// 上层单据主键 + private String topItemid ;//上层单据行主键 + private String topBilltype;// 上层单据类型 + private String topChangets;// 上层单据主表ts + private String topTradetype;// 上层交易类型 + private String srcTradetype;// 源头交易类型 + private String srcBilltype;// 源头单据类型 + private String srcBillid;// 源头单据主键 + private String srcItemid;// 源头单据行主键 + private String pkPayterm;//付款协议 + private String topTermch;// 来源付款协议行 + private String checkno ;//票据号 + private String payaccount;// 付款银行账户 + private String recaccount;// 收款银行账户 + private String cashaccount ;//现金账户 + private String ordercubasdoc;// 订单供应商 + private String innerorderno;// 调拨订单号 + private String assetpactno;// 资产合同号 + private String contractno;// 合同号 + private String freecust;// 散户 + private String facard;// 固定资产卡片号 + private String purchaseorder;// 订单号 + private String invoiceno;// 发票号 + private String outstoreno;// 出库单号 + private String checkelement ;//责任核算要素 + private String grouprate ;//集团本币汇率 + private String globalrate;// 全局本币汇率 + private String groupdebit;// 集团本币金额(借方) + private String globaldebit;// 全局本币金额(借方) + private String groupbalance ;//集团本币余额 + private String globalbalance;// 全局本币余额 + private String groupnotaxDe;// 集团本币无税金额(借方) + private String globalnotaxDe;// 全局本币无税金额(借方) + private String occupationmny ;//预占用核销原币余额 + private String bankrelatedCode;// 对账标识码 + private String project;// 项目 + private String projectTask;// 项目任务 + private String commpaytype ;//承付类型 + private String commpaystatus;// 承付状态 + private String refuseReason;// 拒付理由 + private String agentreceiveprimal;// 托收原币金额 + private String agentreceivelocal;// 托收组织本币 + private String groupagentreceivelocal;// 托收集团本币 + private String globalagentreceivelocal ;//托收全局本币 + private String commpayer ;//承付人 + private String isrefused;// 是否被拒付 + private String localPrice;// 本币单价 + private String localTaxprice;// 本币含税单价 + private String confernum;// 内部交易结算号 + private String costcenter;// 成本中心 + private String customer;// 客户 + private String payreason;// 支付原因 + private String pkPaybill ;//付款单标识 + private String materialSrc;// 原始物料 + private String settlemoney ;//应付金额 + private String settlecurr ;//应付币种 + private String isdiscount;// 是否抵扣金额 + private String comment;// 摘要c + private String pkRecpaytype;// 付款业务类型 + private String isurgent;// 紧急 + private String transerial ;//银行流水号 + private String sendcountryid;// 发货国 + private String vatcode ;//VAT注册码 + private String taxcodeid;// 税码 + private String taxtype ;//扣税类别 + private String buysellflag;// 购销类型 + private String nosubtaxrate;// 不可抵扣税率 + private String nosubtax ;//不可抵扣税额 + private String vendorvatcode ;//供应商VAT注册码 + private String directCheckno ;//直联电票 + private String topChangeitemts ;//上层单据子表ts + private String pkRatetype ;//组织汇率类型 + private String ratedate ;//组织汇率来源日期 + private String customerV ;//客户版本 + private String ordercubasdocV ;//订单供应商版本 + private String supplierV ;//供应商版本 + private String def10;// 自定义项10 + private String def9 ;//自定义项9 + private String def8 ;//自定义项8 + private String def7;// 自定义项7 + private String def6 ;//自定义项6 + private String def5;// 自定义项5 + private String def4 ;//自定义项4 + private String def3 ;//自定义项3 + private String def2 ;//自定义项2 + private String def1;// 自定义项1 + private String formmainId;// OA主表id + + + public String getFormmainId() { + return formmainId; + } + + public void setFormmainId(String formmainId) { + this.formmainId = formmainId; + } + + public String getPkPayitem() { + return pkPayitem; + } + + public void setPkPayitem(String pkPayitem) { + this.pkPayitem = pkPayitem; + } + + public String getSettOrg() { + return settOrg; + } + + public void setSettOrg(String settOrg) { + this.settOrg = settOrg; + } + + public String getPkOrg() { + return pkOrg; + } + + public void setPkOrg(String pkOrg) { + this.pkOrg = pkOrg; + } + + public String getPkFiorg() { + return pkFiorg; + } + + public void setPkFiorg(String pkFiorg) { + this.pkFiorg = pkFiorg; + } + + public String getPkPcorg() { + return pkPcorg; + } + + public void setPkPcorg(String pkPcorg) { + this.pkPcorg = pkPcorg; + } + + public String getPuOrg() { + return puOrg; + } + + public void setPuOrg(String puOrg) { + this.puOrg = puOrg; + } + + public String getPuOrgV() { + return puOrgV; + } + + public void setPuOrgV(String puOrgV) { + this.puOrgV = puOrgV; + } + + public String getSettOrgV() { + return settOrgV; + } + + public void setSettOrgV(String settOrgV) { + this.settOrgV = settOrgV; + } + + public String getPkPcorgV() { + return pkPcorgV; + } + + public void setPkPcorgV(String pkPcorgV) { + this.pkPcorgV = pkPcorgV; + } + + public String getPkOrgV() { + return pkOrgV; + } + + public void setPkOrgV(String pkOrgV) { + this.pkOrgV = pkOrgV; + } + + public String getPkfiorgv() { + return pkfiorgv; + } + + public void setPkfiorgv(String pkfiorgv) { + this.pkfiorgv = pkfiorgv; + } + + public String getPupsndoc() { + return pupsndoc; + } + + public void setPupsndoc(String pupsndoc) { + this.pupsndoc = pupsndoc; + } + + public String getPuDeptid() { + return puDeptid; + } + + public void setPuDeptid(String puDeptid) { + this.puDeptid = puDeptid; + } + + public String getPuDeptidV() { + return puDeptidV; + } + + public void setPuDeptidV(String puDeptidV) { + this.puDeptidV = puDeptidV; + } + + public String getPrepay() { + return prepay; + } + + public void setPrepay(String prepay) { + this.prepay = prepay; + } + + public String getMaterial() { + return material; + } + + public void setMaterial(String material) { + this.material = material; + } + + public String getSupplier() { + return supplier; + } + + public void setSupplier(String supplier) { + this.supplier = supplier; + } + + public String getPostunit() { + return postunit; + } + + public void setPostunit(String postunit) { + this.postunit = postunit; + } + + public String getPostpricenotax() { + return postpricenotax; + } + + public void setPostpricenotax(String postpricenotax) { + this.postpricenotax = postpricenotax; + } + + public String getPostquantity() { + return postquantity; + } + + public void setPostquantity(String postquantity) { + this.postquantity = postquantity; + } + + public String getPostprice() { + return postprice; + } + + public void setPostprice(String postprice) { + this.postprice = postprice; + } + + public String getCheckdirection() { + return checkdirection; + } + + public void setCheckdirection(String checkdirection) { + this.checkdirection = checkdirection; + } + + public String getCoordflag() { + return coordflag; + } + + public void setCoordflag(String coordflag) { + this.coordflag = coordflag; + } + + public String getEquipmentcode() { + return equipmentcode; + } + + public void setEquipmentcode(String equipmentcode) { + this.equipmentcode = equipmentcode; + } + + public String getProductline() { + return productline; + } + + public void setProductline(String productline) { + this.productline = productline; + } + + public String getCashitem() { + return cashitem; + } + + public void setCashitem(String cashitem) { + this.cashitem = cashitem; + } + + public String getPayflag() { + return payflag; + } + + public void setPayflag(String payflag) { + this.payflag = payflag; + } + + public String getBankrollprojet() { + return bankrollprojet; + } + + public void setBankrollprojet(String bankrollprojet) { + this.bankrollprojet = bankrollprojet; + } + + public String getPausetransact() { + return pausetransact; + } + + public void setPausetransact(String pausetransact) { + this.pausetransact = pausetransact; + } + + public String getBilldate() { + return billdate; + } + + public void setBilldate(String billdate) { + this.billdate = billdate; + } + + public String getPayman() { + return payman; + } + + public void setPayman(String payman) { + this.payman = payman; + } + + public String getPaydate() { + return paydate; + } + + public void setPaydate(String paydate) { + this.paydate = paydate; + } + + public String getPkGroup() { + return pkGroup; + } + + public void setPkGroup(String pkGroup) { + this.pkGroup = pkGroup; + } + + public String getPkBilltype() { + return pkBilltype; + } + + public void setPkBilltype(String pkBilltype) { + this.pkBilltype = pkBilltype; + } + + public String getBillclass() { + return billclass; + } + + public void setBillclass(String billclass) { + this.billclass = billclass; + } + + public String getPkTradetype() { + return pkTradetype; + } + + public void setPkTradetype(String pkTradetype) { + this.pkTradetype = pkTradetype; + } + + public String getPkTradetypeid() { + return pkTradetypeid; + } + + public void setPkTradetypeid(String pkTradetypeid) { + this.pkTradetypeid = pkTradetypeid; + } + + public String getBusidate() { + return busidate; + } + + public void setBusidate(String busidate) { + this.busidate = busidate; + } + + public String getPkSubjcode() { + return pkSubjcode; + } + + public void setPkSubjcode(String pkSubjcode) { + this.pkSubjcode = pkSubjcode; + } + + public String getBillno() { + return billno; + } + + public void setBillno(String billno) { + this.billno = billno; + } + + public String getObjtype() { + return objtype; + } + + public void setObjtype(String objtype) { + this.objtype = objtype; + } + + public String getRowno() { + return rowno; + } + + public void setRowno(String rowno) { + this.rowno = rowno; + } + + public String getRowtype() { + return rowtype; + } + + public void setRowtype(String rowtype) { + this.rowtype = rowtype; + } + + public String getDirection() { + return direction; + } + + public void setDirection(String direction) { + this.direction = direction; + } + + public String getChecktype() { + return checktype; + } + + public void setChecktype(String checktype) { + this.checktype = checktype; + } + + public String getPkSsitem() { + return pkSsitem; + } + + public void setPkSsitem(String pkSsitem) { + this.pkSsitem = pkSsitem; + } + + public String getScomment() { + return scomment; + } + + public void setScomment(String scomment) { + this.scomment = scomment; + } + + public String getSubjcode() { + return subjcode; + } + + public void setSubjcode(String subjcode) { + this.subjcode = subjcode; + } + + public String getPkCurrtype() { + return pkCurrtype; + } + + public void setPkCurrtype(String pkCurrtype) { + this.pkCurrtype = pkCurrtype; + } + + public String getRate() { + return rate; + } + + public void setRate(String rate) { + this.rate = rate; + } + + public String getPkDeptid() { + return pkDeptid; + } + + public void setPkDeptid(String pkDeptid) { + this.pkDeptid = pkDeptid; + } + + public String getPkDeptidV() { + return pkDeptidV; + } + + public void setPkDeptidV(String pkDeptidV) { + this.pkDeptidV = pkDeptidV; + } + + public String getPkPsndoc() { + return pkPsndoc; + } + + public void setPkPsndoc(String pkPsndoc) { + this.pkPsndoc = pkPsndoc; + } + + public String getMoneyDe() { + return moneyDe; + } + + public void setMoneyDe(String moneyDe) { + this.moneyDe = moneyDe; + } + + public String getLocalMoneyDe() { + return localMoneyDe; + } + + public void setLocalMoneyDe(String localMoneyDe) { + this.localMoneyDe = localMoneyDe; + } + + public String getQuantityDe() { + return quantityDe; + } + + public void setQuantityDe(String quantityDe) { + this.quantityDe = quantityDe; + } + + public String getQuantityCr() { + return quantityCr; + } + + public void setQuantityCr(String quantityCr) { + this.quantityCr = quantityCr; + } + + public String getMoneyBal() { + return moneyBal; + } + + public void setMoneyBal(String moneyBal) { + this.moneyBal = moneyBal; + } + + public String getLocalMoneyBal() { + return localMoneyBal; + } + + public void setLocalMoneyBal(String localMoneyBal) { + this.localMoneyBal = localMoneyBal; + } + + public String getQuantityBal() { + return quantityBal; + } + + public void setQuantityBal(String quantityBal) { + this.quantityBal = quantityBal; + } + + public String getLocalTaxDe() { + return localTaxDe; + } + + public void setLocalTaxDe(String localTaxDe) { + this.localTaxDe = localTaxDe; + } + + public String getNotaxDe() { + return notaxDe; + } + + public void setNotaxDe(String notaxDe) { + this.notaxDe = notaxDe; + } + + public String getLocalNotaxDe() { + return localNotaxDe; + } + + public void setLocalNotaxDe(String localNotaxDe) { + this.localNotaxDe = localNotaxDe; + } + + public String getPrice() { + return price; + } + + public void setPrice(String price) { + this.price = price; + } + + public String getTaxprice() { + return taxprice; + } + + public void setTaxprice(String taxprice) { + this.taxprice = taxprice; + } + + public String getTaxrate() { + return taxrate; + } + + public void setTaxrate(String taxrate) { + this.taxrate = taxrate; + } + + public String getTaxnum() { + return taxnum; + } + + public void setTaxnum(String taxnum) { + this.taxnum = taxnum; + } + + public String getPkBalatype() { + return pkBalatype; + } + + public void setPkBalatype(String pkBalatype) { + this.pkBalatype = pkBalatype; + } + + public String getTopBillid() { + return topBillid; + } + + public void setTopBillid(String topBillid) { + this.topBillid = topBillid; + } + + public String getTopItemid() { + return topItemid; + } + + public void setTopItemid(String topItemid) { + this.topItemid = topItemid; + } + + public String getTopBilltype() { + return topBilltype; + } + + public void setTopBilltype(String topBilltype) { + this.topBilltype = topBilltype; + } + + public String getTopChangets() { + return topChangets; + } + + public void setTopChangets(String topChangets) { + this.topChangets = topChangets; + } + + public String getTopTradetype() { + return topTradetype; + } + + public void setTopTradetype(String topTradetype) { + this.topTradetype = topTradetype; + } + + public String getSrcTradetype() { + return srcTradetype; + } + + public void setSrcTradetype(String srcTradetype) { + this.srcTradetype = srcTradetype; + } + + public String getSrcBilltype() { + return srcBilltype; + } + + public void setSrcBilltype(String srcBilltype) { + this.srcBilltype = srcBilltype; + } + + public String getSrcBillid() { + return srcBillid; + } + + public void setSrcBillid(String srcBillid) { + this.srcBillid = srcBillid; + } + + public String getSrcItemid() { + return srcItemid; + } + + public void setSrcItemid(String srcItemid) { + this.srcItemid = srcItemid; + } + + public String getPkPayterm() { + return pkPayterm; + } + + public void setPkPayterm(String pkPayterm) { + this.pkPayterm = pkPayterm; + } + + public String getTopTermch() { + return topTermch; + } + + public void setTopTermch(String topTermch) { + this.topTermch = topTermch; + } + + public String getCheckno() { + return checkno; + } + + public void setCheckno(String checkno) { + this.checkno = checkno; + } + + public String getPayaccount() { + return payaccount; + } + + public void setPayaccount(String payaccount) { + this.payaccount = payaccount; + } + + public String getRecaccount() { + return recaccount; + } + + public void setRecaccount(String recaccount) { + this.recaccount = recaccount; + } + + public String getCashaccount() { + return cashaccount; + } + + public void setCashaccount(String cashaccount) { + this.cashaccount = cashaccount; + } + + public String getOrdercubasdoc() { + return ordercubasdoc; + } + + public void setOrdercubasdoc(String ordercubasdoc) { + this.ordercubasdoc = ordercubasdoc; + } + + public String getInnerorderno() { + return innerorderno; + } + + public void setInnerorderno(String innerorderno) { + this.innerorderno = innerorderno; + } + + public String getAssetpactno() { + return assetpactno; + } + + public void setAssetpactno(String assetpactno) { + this.assetpactno = assetpactno; + } + + public String getContractno() { + return contractno; + } + + public void setContractno(String contractno) { + this.contractno = contractno; + } + + public String getFreecust() { + return freecust; + } + + public void setFreecust(String freecust) { + this.freecust = freecust; + } + + public String getFacard() { + return facard; + } + + public void setFacard(String facard) { + this.facard = facard; + } + + public String getPurchaseorder() { + return purchaseorder; + } + + public void setPurchaseorder(String purchaseorder) { + this.purchaseorder = purchaseorder; + } + + public String getInvoiceno() { + return invoiceno; + } + + public void setInvoiceno(String invoiceno) { + this.invoiceno = invoiceno; + } + + public String getOutstoreno() { + return outstoreno; + } + + public void setOutstoreno(String outstoreno) { + this.outstoreno = outstoreno; + } + + public String getCheckelement() { + return checkelement; + } + + public void setCheckelement(String checkelement) { + this.checkelement = checkelement; + } + + public String getGrouprate() { + return grouprate; + } + + public void setGrouprate(String grouprate) { + this.grouprate = grouprate; + } + + public String getGlobalrate() { + return globalrate; + } + + public void setGlobalrate(String globalrate) { + this.globalrate = globalrate; + } + + public String getGroupdebit() { + return groupdebit; + } + + public void setGroupdebit(String groupdebit) { + this.groupdebit = groupdebit; + } + + public String getGlobaldebit() { + return globaldebit; + } + + public void setGlobaldebit(String globaldebit) { + this.globaldebit = globaldebit; + } + + public String getGroupbalance() { + return groupbalance; + } + + public void setGroupbalance(String groupbalance) { + this.groupbalance = groupbalance; + } + + public String getGlobalbalance() { + return globalbalance; + } + + public void setGlobalbalance(String globalbalance) { + this.globalbalance = globalbalance; + } + + public String getGroupnotaxDe() { + return groupnotaxDe; + } + + public void setGroupnotaxDe(String groupnotaxDe) { + this.groupnotaxDe = groupnotaxDe; + } + + public String getGlobalnotaxDe() { + return globalnotaxDe; + } + + public void setGlobalnotaxDe(String globalnotaxDe) { + this.globalnotaxDe = globalnotaxDe; + } + + public String getOccupationmny() { + return occupationmny; + } + + public void setOccupationmny(String occupationmny) { + this.occupationmny = occupationmny; + } + + public String getBankrelatedCode() { + return bankrelatedCode; + } + + public void setBankrelatedCode(String bankrelatedCode) { + this.bankrelatedCode = bankrelatedCode; + } + + public String getProject() { + return project; + } + + public void setProject(String project) { + this.project = project; + } + + public String getProjectTask() { + return projectTask; + } + + public void setProjectTask(String projectTask) { + this.projectTask = projectTask; + } + + public String getCommpaytype() { + return commpaytype; + } + + public void setCommpaytype(String commpaytype) { + this.commpaytype = commpaytype; + } + + public String getCommpaystatus() { + return commpaystatus; + } + + public void setCommpaystatus(String commpaystatus) { + this.commpaystatus = commpaystatus; + } + + public String getRefuseReason() { + return refuseReason; + } + + public void setRefuseReason(String refuseReason) { + this.refuseReason = refuseReason; + } + + public String getAgentreceiveprimal() { + return agentreceiveprimal; + } + + public void setAgentreceiveprimal(String agentreceiveprimal) { + this.agentreceiveprimal = agentreceiveprimal; + } + + public String getAgentreceivelocal() { + return agentreceivelocal; + } + + public void setAgentreceivelocal(String agentreceivelocal) { + this.agentreceivelocal = agentreceivelocal; + } + + public String getGroupagentreceivelocal() { + return groupagentreceivelocal; + } + + public void setGroupagentreceivelocal(String groupagentreceivelocal) { + this.groupagentreceivelocal = groupagentreceivelocal; + } + + public String getGlobalagentreceivelocal() { + return globalagentreceivelocal; + } + + public void setGlobalagentreceivelocal(String globalagentreceivelocal) { + this.globalagentreceivelocal = globalagentreceivelocal; + } + + public String getCommpayer() { + return commpayer; + } + + public void setCommpayer(String commpayer) { + this.commpayer = commpayer; + } + + public String getIsrefused() { + return isrefused; + } + + public void setIsrefused(String isrefused) { + this.isrefused = isrefused; + } + + public String getLocalPrice() { + return localPrice; + } + + public void setLocalPrice(String localPrice) { + this.localPrice = localPrice; + } + + public String getLocalTaxprice() { + return localTaxprice; + } + + public void setLocalTaxprice(String localTaxprice) { + this.localTaxprice = localTaxprice; + } + + public String getConfernum() { + return confernum; + } + + public void setConfernum(String confernum) { + this.confernum = confernum; + } + + public String getCostcenter() { + return costcenter; + } + + public void setCostcenter(String costcenter) { + this.costcenter = costcenter; + } + + public String getCustomer() { + return customer; + } + + public void setCustomer(String customer) { + this.customer = customer; + } + + public String getPayreason() { + return payreason; + } + + public void setPayreason(String payreason) { + this.payreason = payreason; + } + + public String getPkPaybill() { + return pkPaybill; + } + + public void setPkPaybill(String pkPaybill) { + this.pkPaybill = pkPaybill; + } + + public String getMaterialSrc() { + return materialSrc; + } + + public void setMaterialSrc(String materialSrc) { + this.materialSrc = materialSrc; + } + + public String getSettlemoney() { + return settlemoney; + } + + public void setSettlemoney(String settlemoney) { + this.settlemoney = settlemoney; + } + + public String getSettlecurr() { + return settlecurr; + } + + public void setSettlecurr(String settlecurr) { + this.settlecurr = settlecurr; + } + + public String getIsdiscount() { + return isdiscount; + } + + public void setIsdiscount(String isdiscount) { + this.isdiscount = isdiscount; + } + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + public String getPkRecpaytype() { + return pkRecpaytype; + } + + public void setPkRecpaytype(String pkRecpaytype) { + this.pkRecpaytype = pkRecpaytype; + } + + public String getIsurgent() { + return isurgent; + } + + public void setIsurgent(String isurgent) { + this.isurgent = isurgent; + } + + public String getTranserial() { + return transerial; + } + + public void setTranserial(String transerial) { + this.transerial = transerial; + } + + public String getSendcountryid() { + return sendcountryid; + } + + public void setSendcountryid(String sendcountryid) { + this.sendcountryid = sendcountryid; + } + + public String getVatcode() { + return vatcode; + } + + public void setVatcode(String vatcode) { + this.vatcode = vatcode; + } + + public String getTaxcodeid() { + return taxcodeid; + } + + public void setTaxcodeid(String taxcodeid) { + this.taxcodeid = taxcodeid; + } + + public String getTaxtype() { + return taxtype; + } + + public void setTaxtype(String taxtype) { + this.taxtype = taxtype; + } + + public String getBuysellflag() { + return buysellflag; + } + + public void setBuysellflag(String buysellflag) { + this.buysellflag = buysellflag; + } + + public String getNosubtaxrate() { + return nosubtaxrate; + } + + public void setNosubtaxrate(String nosubtaxrate) { + this.nosubtaxrate = nosubtaxrate; + } + + public String getNosubtax() { + return nosubtax; + } + + public void setNosubtax(String nosubtax) { + this.nosubtax = nosubtax; + } + + public String getVendorvatcode() { + return vendorvatcode; + } + + public void setVendorvatcode(String vendorvatcode) { + this.vendorvatcode = vendorvatcode; + } + + public String getDirectCheckno() { + return directCheckno; + } + + public void setDirectCheckno(String directCheckno) { + this.directCheckno = directCheckno; + } + + public String getTopChangeitemts() { + return topChangeitemts; + } + + public void setTopChangeitemts(String topChangeitemts) { + this.topChangeitemts = topChangeitemts; + } + + public String getPkRatetype() { + return pkRatetype; + } + + public void setPkRatetype(String pkRatetype) { + this.pkRatetype = pkRatetype; + } + + public String getRatedate() { + return ratedate; + } + + public void setRatedate(String ratedate) { + this.ratedate = ratedate; + } + + public String getCustomerV() { + return customerV; + } + + public void setCustomerV(String customerV) { + this.customerV = customerV; + } + + public String getOrdercubasdocV() { + return ordercubasdocV; + } + + public void setOrdercubasdocV(String ordercubasdocV) { + this.ordercubasdocV = ordercubasdocV; + } + + public String getSupplierV() { + return supplierV; + } + + public void setSupplierV(String supplierV) { + this.supplierV = supplierV; + } + + public String getDef10() { + return def10; + } + + public void setDef10(String def10) { + this.def10 = def10; + } + + public String getDef9() { + return def9; + } + + public void setDef9(String def9) { + this.def9 = def9; + } + + public String getDef8() { + return def8; + } + + public void setDef8(String def8) { + this.def8 = def8; + } + + public String getDef7() { + return def7; + } + + public void setDef7(String def7) { + this.def7 = def7; + } + + public String getDef6() { + return def6; + } + + public void setDef6(String def6) { + this.def6 = def6; + } + + public String getDef5() { + return def5; + } + + public void setDef5(String def5) { + this.def5 = def5; + } + + public String getDef4() { + return def4; + } + + public void setDef4(String def4) { + this.def4 = def4; + } + + public String getDef3() { + return def3; + } + + public void setDef3(String def3) { + this.def3 = def3; + } + + public String getDef2() { + return def2; + } + + public void setDef2(String def2) { + this.def2 = def2; + } + + public String getDef1() { + return def1; + } + + public void setDef1(String def1) { + this.def1 = def1; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentDetailsEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentDetailsEntity.xml new file mode 100644 index 00000000..1df04d35 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentDetailsEntity.xml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + ,pk_payitem as pkPayitem + ,sett_org as settOrg + ,pk_org as pkOrg + ,pk_fiorg as pkFiorg + ,pu_org as puOrg + ,pu_psndoc as puPsndoc + ,pu_deptid as puDeptid + ,prepay as prepay + ,material as material + ,supplier as supplier + ,checkdirection as checkdirection + ,payflag as payflag + ,pausetransact as pausetransact + ,billdate as billdate + ,payman as payman + ,paydate as paydate + ,pk_billtype as pkBilltype + ,billclass as billclass + ,pk_tradetype as pkTradetype + ,billno as billno + ,objtype as objtype + ,rowno as rowno + ,rowtype as rowtype + ,direction as direction + ,checktype as checktype + ,scomment as scomment + ,pk_currtype as pkcurrtype + ,rate as rate + ,pk_deptid as pkDeptid + ,pk_psndoc as pkPsndoc + ,money_de as moneyDe + ,local_money_de as localMoneyDe + ,quantity_bal as quantityBal + ,local_tax_de as localTaxDe + ,price as price + ,taxprice as taxprice + ,taxrate as taxrate + ,taxnum as taxnum + ,pk_balatype as pkBalatype + ,top_billid as topBillid + ,top_itemid as topItemid + ,checkno as checkno + ,payaccount as payaccount + ,recaccount as recaccount + ,cashaccount as cashaccount + ,contractno as contractno + ,purchaseorder as purchaseorder + ,invoiceno as invoiceno + ,outstoreno as outstoreno + ,project as project + ,groupnotax_de as groupnotaxDe + ,globalnotax_de as globalnotaxDe + ,commpaytype as commpaytype + ,commpaystatus as commpaystatus + ,customer as customer + ,payreason as payreason + ,pk_paybill as pkPaybill + ,comment as comment + ,pk_recpaytype as pkRecpaytype + ,taxcodeid as taxcodeid + ,taxtype as taxtype + ,buysellflag as buysellflag + ,direct_checkno as directCheckno + ,direct_checkno as directCheckno + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentEntity.java new file mode 100644 index 00000000..6409318f --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentEntity.java @@ -0,0 +1,1098 @@ +package com.hzya.frame.plugin.oa.payment.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +public class PaymentEntity extends BaseEntity { + private String pkPaybill;//付款单标识 + private String pkPcorg;//利润中心 + private String pkFiorg;//财务组织 + private String pkOrg;//付款财务组织 + private String settOrg;//结算财务组织 + private String puOrg;//业务组织 + private String puOrgV;//业务组织版本主键 + private String pkFiorgV;//财务组织版本主键 + private String pkPcorgV;//利润中心版本主键 + private String pkOrgV;//付款财务组织版本主键 + private String settOrgV;//结算财务组织版本主键 + private String isreded;//是否红冲过 + private String outbusitype;//外系统业务类型 + private String payman;//支付人 + private String paydate;//支付日期 + private String isonlinepay;//是否网上支付 + private String officialprintuser;//正式打印人 + private String officialprintdate;//正式打印日期 + private String settlenum;//结算号 + private String pkGroup;//所属集团 + private String pkBilltype;//单据类型编码 + private String ismandatepay;//提交资金组织结算 + private String custdelegate;//代垫单位 + private String pkCorp;//单位编码 + private String pkTradetype;//付款类型code + private String pkTradetypeid;//付款类型 + private String billclass;//单据大类 + private String accessorynum;//附件张数 + private String subjcode;//科目 + private String isflowbill;//是否流程单据 + private String confirmuser;//单据确认人 + private String isinit;//期初标志 + private String billno;//单据号 + private String billdate;//单据日期 + private String syscode;//单据所属系统 + private String srcSyscode;//单据来源系统 + private String billstatus;//单据状态 + private String billmaker;//制单人 + private String approver;//审核人 + private String approvedate;//审核时间 + private String signuser;//签字确认人 + private String signyear;//签字确认年度 + private String signperiod;//签字确认期间 + private String signdate;//签字确认日期 + private String pkBusitype;//业务流程 + private String money;//原币金额 + private String localMoney;//组织本币金额 + private String billyear;//单据会计年度 + private String billperiod;//单据会计期间 + private String scomment;//摘要 + private String settleflag;//结算状态 + private String settletype;//结算类型 + private String effectstatus;//生效状态 + private String effectuser;//生效人 + private String effectdate;//生效日期 + + + private String lastapproveid;//最终审批人 + private String bodys;//付款单行 + private String grouplocal;//集团本币金额 + private String globallocal;//全局本币金额 + private String rate;//组织本币汇率 + private String grouprate;//集团本币汇率 + private String globalrate;//全局本币汇率 + private String checkelement;//责任核算要素 + private String puDeptid;//业务部门 + private String puDeptidV;//业务部门版本 + private String puPsndoc;//业务人员 + private String cashitem;//现金流量项目 + private String bankrollprojet;//资金计划项目 + private String pkDeptid;//部门 + private String pkDeptidV;//部 门 + private String pkPsndoc;//业务员 + private String supplier;//供应商 + private String pkCurrtype;//币种 + private String pkSubjcode;//收支项目 + private String pkBalatype;//结算方式 + private String objtype;//往来对象 + private String payaccount;//付款银行账户 + private String recaccount;//收款银行账户 + private String cashaccount;//现金账户 + private String coordflag;//单据协同标志 + private String busidate;//起算日期 + private String isforce;//承付 + private String commpaybegindate;//承付开始日期 + private String commpayenddate;//承付截止日期 + private String approvestatus;//审批状态 + private String approvedated;//审核日期 + private String isfromindependent;//是否独立结算信息 + private String customer;//客户 + private String expectdealdate;//期望处理日 + private String invoiceno;//发票号 + private String consignagreement;//托收协议号 + private String creditorreference;//债权人参考号 + private String sddreversalflag;//直接借记退回标记 + private String reversalreason;//退回原因 + private String ailurereason;//失败原因 + private String payreason;//支付原因 + private String creditrefstd;//贷方引用信息标准 + private String isurgent;//紧急 + private String isrefund;//是否退款 + private String rececountryid;//收货国 + private String taxcountryid;//报税国 + private String sagaFrozen;//冻结状态 + private String pkRatetype;//组织汇率类型 + private String ratedate;//组织汇率来源日期 + private String customerV;//客户版本 + private String supplierV;//供应商版本 + private String def10;//自定义项10 + private String def9;//自定义项9 + private String def8;//自定义项8 + private String def7;//自定义项7 + private String def6;//自定义项6 + private String def5;//自定义项5 + private String def4;//自定义项4 + private String def3;//自定义项3 + private String def2;//自定义项2 + private String modifiedtime;//最后修改时间 + private String creationtime;//创建时间 + private String creator;//创建人 + private String modifier;//最后修改人 + + private String oaResult;//OA支付结果 + private String oaPushStatus;//OA推送状态 + + public String getOaResult() { + return oaResult; + } + + public void setOaResult(String oaResult) { + this.oaResult = oaResult; + } + + public String getOaPushStatus() { + return oaPushStatus; + } + + public void setOaPushStatus(String oaPushStatus) { + this.oaPushStatus = oaPushStatus; + } + + public String getPkPaybill() { + return pkPaybill; + } + + public void setPkPaybill(String pkPaybill) { + this.pkPaybill = pkPaybill; + } + + public String getPkPcorg() { + return pkPcorg; + } + + public void setPkPcorg(String pkPcorg) { + this.pkPcorg = pkPcorg; + } + + public String getPkFiorg() { + return pkFiorg; + } + + public void setPkFiorg(String pkFiorg) { + this.pkFiorg = pkFiorg; + } + + public String getPkOrg() { + return pkOrg; + } + + public void setPkOrg(String pkOrg) { + this.pkOrg = pkOrg; + } + + public String getSettOrg() { + return settOrg; + } + + public void setSettOrg(String settOrg) { + this.settOrg = settOrg; + } + + public String getPuOrg() { + return puOrg; + } + + public void setPuOrg(String puOrg) { + this.puOrg = puOrg; + } + + public String getPuOrgV() { + return puOrgV; + } + + public void setPuOrgV(String puOrgV) { + this.puOrgV = puOrgV; + } + + public String getPkFiorgV() { + return pkFiorgV; + } + + public void setPkFiorgV(String pkFiorgV) { + this.pkFiorgV = pkFiorgV; + } + + public String getPkPcorgV() { + return pkPcorgV; + } + + public void setPkPcorgV(String pkPcorgV) { + this.pkPcorgV = pkPcorgV; + } + + public String getPkOrgV() { + return pkOrgV; + } + + public void setPkOrgV(String pkOrgV) { + this.pkOrgV = pkOrgV; + } + + public String getSettOrgV() { + return settOrgV; + } + + public void setSettOrgV(String settOrgV) { + this.settOrgV = settOrgV; + } + + public String getIsreded() { + return isreded; + } + + public void setIsreded(String isreded) { + this.isreded = isreded; + } + + public String getOutbusitype() { + return outbusitype; + } + + public void setOutbusitype(String outbusitype) { + this.outbusitype = outbusitype; + } + + public String getPayman() { + return payman; + } + + public void setPayman(String payman) { + this.payman = payman; + } + + public String getPaydate() { + return paydate; + } + + public void setPaydate(String paydate) { + this.paydate = paydate; + } + + public String getIsonlinepay() { + return isonlinepay; + } + + public void setIsonlinepay(String isonlinepay) { + this.isonlinepay = isonlinepay; + } + + public String getOfficialprintuser() { + return officialprintuser; + } + + public void setOfficialprintuser(String officialprintuser) { + this.officialprintuser = officialprintuser; + } + + public String getOfficialprintdate() { + return officialprintdate; + } + + public void setOfficialprintdate(String officialprintdate) { + this.officialprintdate = officialprintdate; + } + + public String getSettlenum() { + return settlenum; + } + + public void setSettlenum(String settlenum) { + this.settlenum = settlenum; + } + + public String getPkGroup() { + return pkGroup; + } + + public void setPkGroup(String pkGroup) { + this.pkGroup = pkGroup; + } + + public String getPkBilltype() { + return pkBilltype; + } + + public void setPkBilltype(String pkBilltype) { + this.pkBilltype = pkBilltype; + } + + public String getIsmandatepay() { + return ismandatepay; + } + + public void setIsmandatepay(String ismandatepay) { + this.ismandatepay = ismandatepay; + } + + public String getCustdelegate() { + return custdelegate; + } + + public void setCustdelegate(String custdelegate) { + this.custdelegate = custdelegate; + } + + public String getPkCorp() { + return pkCorp; + } + + public void setPkCorp(String pkCorp) { + this.pkCorp = pkCorp; + } + + public String getPkTradetype() { + return pkTradetype; + } + + public void setPkTradetype(String pkTradetype) { + this.pkTradetype = pkTradetype; + } + + public String getPkTradetypeid() { + return pkTradetypeid; + } + + public void setPkTradetypeid(String pkTradetypeid) { + this.pkTradetypeid = pkTradetypeid; + } + + public String getBillclass() { + return billclass; + } + + public void setBillclass(String billclass) { + this.billclass = billclass; + } + + public String getAccessorynum() { + return accessorynum; + } + + public void setAccessorynum(String accessorynum) { + this.accessorynum = accessorynum; + } + + public String getSubjcode() { + return subjcode; + } + + public void setSubjcode(String subjcode) { + this.subjcode = subjcode; + } + + public String getIsflowbill() { + return isflowbill; + } + + public void setIsflowbill(String isflowbill) { + this.isflowbill = isflowbill; + } + + public String getConfirmuser() { + return confirmuser; + } + + public void setConfirmuser(String confirmuser) { + this.confirmuser = confirmuser; + } + + public String getIsinit() { + return isinit; + } + + public void setIsinit(String isinit) { + this.isinit = isinit; + } + + public String getBillno() { + return billno; + } + + public void setBillno(String billno) { + this.billno = billno; + } + + public String getBilldate() { + return billdate; + } + + public void setBilldate(String billdate) { + this.billdate = billdate; + } + + public String getSyscode() { + return syscode; + } + + public void setSyscode(String syscode) { + this.syscode = syscode; + } + + public String getSrcSyscode() { + return srcSyscode; + } + + public void setSrcSyscode(String srcSyscode) { + this.srcSyscode = srcSyscode; + } + + public String getBillstatus() { + return billstatus; + } + + public void setBillstatus(String billstatus) { + this.billstatus = billstatus; + } + + public String getBillmaker() { + return billmaker; + } + + public void setBillmaker(String billmaker) { + this.billmaker = billmaker; + } + + public String getApprover() { + return approver; + } + + public void setApprover(String approver) { + this.approver = approver; + } + + public String getApprovedate() { + return approvedate; + } + + public void setApprovedate(String approvedate) { + this.approvedate = approvedate; + } + + public String getSignuser() { + return signuser; + } + + public void setSignuser(String signuser) { + this.signuser = signuser; + } + + public String getSignyear() { + return signyear; + } + + public void setSignyear(String signyear) { + this.signyear = signyear; + } + + public String getSignperiod() { + return signperiod; + } + + public void setSignperiod(String signperiod) { + this.signperiod = signperiod; + } + + public String getSigndate() { + return signdate; + } + + public void setSigndate(String signdate) { + this.signdate = signdate; + } + + public String getPkBusitype() { + return pkBusitype; + } + + public void setPkBusitype(String pkBusitype) { + this.pkBusitype = pkBusitype; + } + + public String getMoney() { + return money; + } + + public void setMoney(String money) { + this.money = money; + } + + public String getLocalMoney() { + return localMoney; + } + + public void setLocalMoney(String localMoney) { + this.localMoney = localMoney; + } + + public String getBillyear() { + return billyear; + } + + public void setBillyear(String billyear) { + this.billyear = billyear; + } + + public String getBillperiod() { + return billperiod; + } + + public void setBillperiod(String billperiod) { + this.billperiod = billperiod; + } + + public String getScomment() { + return scomment; + } + + public void setScomment(String scomment) { + this.scomment = scomment; + } + + public String getSettleflag() { + return settleflag; + } + + public void setSettleflag(String settleflag) { + this.settleflag = settleflag; + } + + public String getSettletype() { + return settletype; + } + + public void setSettletype(String settletype) { + this.settletype = settletype; + } + + public String getEffectstatus() { + return effectstatus; + } + + public void setEffectstatus(String effectstatus) { + this.effectstatus = effectstatus; + } + + public String getEffectuser() { + return effectuser; + } + + public void setEffectuser(String effectuser) { + this.effectuser = effectuser; + } + + public String getEffectdate() { + return effectdate; + } + + public void setEffectdate(String effectdate) { + this.effectdate = effectdate; + } + + public String getLastapproveid() { + return lastapproveid; + } + + public void setLastapproveid(String lastapproveid) { + this.lastapproveid = lastapproveid; + } + + public String getBodys() { + return bodys; + } + + public void setBodys(String bodys) { + this.bodys = bodys; + } + + public String getGrouplocal() { + return grouplocal; + } + + public void setGrouplocal(String grouplocal) { + this.grouplocal = grouplocal; + } + + public String getGloballocal() { + return globallocal; + } + + public void setGloballocal(String globallocal) { + this.globallocal = globallocal; + } + + public String getRate() { + return rate; + } + + public void setRate(String rate) { + this.rate = rate; + } + + public String getGrouprate() { + return grouprate; + } + + public void setGrouprate(String grouprate) { + this.grouprate = grouprate; + } + + public String getGlobalrate() { + return globalrate; + } + + public void setGlobalrate(String globalrate) { + this.globalrate = globalrate; + } + + public String getCheckelement() { + return checkelement; + } + + public void setCheckelement(String checkelement) { + this.checkelement = checkelement; + } + + public String getPuDeptid() { + return puDeptid; + } + + public void setPuDeptid(String puDeptid) { + this.puDeptid = puDeptid; + } + + public String getPuDeptidV() { + return puDeptidV; + } + + public void setPuDeptidV(String puDeptidV) { + this.puDeptidV = puDeptidV; + } + + public String getPuPsndoc() { + return puPsndoc; + } + + public void setPuPsndoc(String puPsndoc) { + this.puPsndoc = puPsndoc; + } + + public String getCashitem() { + return cashitem; + } + + public void setCashitem(String cashitem) { + this.cashitem = cashitem; + } + + public String getBankrollprojet() { + return bankrollprojet; + } + + public void setBankrollprojet(String bankrollprojet) { + this.bankrollprojet = bankrollprojet; + } + + public String getPkDeptid() { + return pkDeptid; + } + + public void setPkDeptid(String pkDeptid) { + this.pkDeptid = pkDeptid; + } + + public String getPkDeptidV() { + return pkDeptidV; + } + + public void setPkDeptidV(String pkDeptidV) { + this.pkDeptidV = pkDeptidV; + } + + public String getPkPsndoc() { + return pkPsndoc; + } + + public void setPkPsndoc(String pkPsndoc) { + this.pkPsndoc = pkPsndoc; + } + + public String getSupplier() { + return supplier; + } + + public void setSupplier(String supplier) { + this.supplier = supplier; + } + + public String getPkCurrtype() { + return pkCurrtype; + } + + public void setPkCurrtype(String pkCurrtype) { + this.pkCurrtype = pkCurrtype; + } + + public String getPkSubjcode() { + return pkSubjcode; + } + + public void setPkSubjcode(String pkSubjcode) { + this.pkSubjcode = pkSubjcode; + } + + public String getPkBalatype() { + return pkBalatype; + } + + public void setPkBalatype(String pkBalatype) { + this.pkBalatype = pkBalatype; + } + + public String getObjtype() { + return objtype; + } + + public void setObjtype(String objtype) { + this.objtype = objtype; + } + + public String getPayaccount() { + return payaccount; + } + + public void setPayaccount(String payaccount) { + this.payaccount = payaccount; + } + + public String getRecaccount() { + return recaccount; + } + + public void setRecaccount(String recaccount) { + this.recaccount = recaccount; + } + + public String getCashaccount() { + return cashaccount; + } + + public void setCashaccount(String cashaccount) { + this.cashaccount = cashaccount; + } + + public String getCoordflag() { + return coordflag; + } + + public void setCoordflag(String coordflag) { + this.coordflag = coordflag; + } + + public String getBusidate() { + return busidate; + } + + public void setBusidate(String busidate) { + this.busidate = busidate; + } + + public String getIsforce() { + return isforce; + } + + public void setIsforce(String isforce) { + this.isforce = isforce; + } + + public String getCommpaybegindate() { + return commpaybegindate; + } + + public void setCommpaybegindate(String commpaybegindate) { + this.commpaybegindate = commpaybegindate; + } + + public String getCommpayenddate() { + return commpayenddate; + } + + public void setCommpayenddate(String commpayenddate) { + this.commpayenddate = commpayenddate; + } + + public String getApprovestatus() { + return approvestatus; + } + + public void setApprovestatus(String approvestatus) { + this.approvestatus = approvestatus; + } + + public String getApprovedated() { + return approvedated; + } + + public void setApprovedated(String approvedated) { + this.approvedated = approvedated; + } + + public String getIsfromindependent() { + return isfromindependent; + } + + public void setIsfromindependent(String isfromindependent) { + this.isfromindependent = isfromindependent; + } + + public String getCustomer() { + return customer; + } + + public void setCustomer(String customer) { + this.customer = customer; + } + + public String getExpectdealdate() { + return expectdealdate; + } + + public void setExpectdealdate(String expectdealdate) { + this.expectdealdate = expectdealdate; + } + + public String getInvoiceno() { + return invoiceno; + } + + public void setInvoiceno(String invoiceno) { + this.invoiceno = invoiceno; + } + + public String getConsignagreement() { + return consignagreement; + } + + public void setConsignagreement(String consignagreement) { + this.consignagreement = consignagreement; + } + + public String getCreditorreference() { + return creditorreference; + } + + public void setCreditorreference(String creditorreference) { + this.creditorreference = creditorreference; + } + + public String getSddreversalflag() { + return sddreversalflag; + } + + public void setSddreversalflag(String sddreversalflag) { + this.sddreversalflag = sddreversalflag; + } + + public String getReversalreason() { + return reversalreason; + } + + public void setReversalreason(String reversalreason) { + this.reversalreason = reversalreason; + } + + public String getAilurereason() { + return ailurereason; + } + + public void setAilurereason(String ailurereason) { + this.ailurereason = ailurereason; + } + + public String getPayreason() { + return payreason; + } + + public void setPayreason(String payreason) { + this.payreason = payreason; + } + + public String getCreditrefstd() { + return creditrefstd; + } + + public void setCreditrefstd(String creditrefstd) { + this.creditrefstd = creditrefstd; + } + + public String getIsurgent() { + return isurgent; + } + + public void setIsurgent(String isurgent) { + this.isurgent = isurgent; + } + + public String getIsrefund() { + return isrefund; + } + + public void setIsrefund(String isrefund) { + this.isrefund = isrefund; + } + + public String getRececountryid() { + return rececountryid; + } + + public void setRececountryid(String rececountryid) { + this.rececountryid = rececountryid; + } + + public String getTaxcountryid() { + return taxcountryid; + } + + public void setTaxcountryid(String taxcountryid) { + this.taxcountryid = taxcountryid; + } + + public String getSagaFrozen() { + return sagaFrozen; + } + + public void setSagaFrozen(String sagaFrozen) { + this.sagaFrozen = sagaFrozen; + } + + public String getPkRatetype() { + return pkRatetype; + } + + public void setPkRatetype(String pkRatetype) { + this.pkRatetype = pkRatetype; + } + + public String getRatedate() { + return ratedate; + } + + public void setRatedate(String ratedate) { + this.ratedate = ratedate; + } + + public String getCustomerV() { + return customerV; + } + + public void setCustomerV(String customerV) { + this.customerV = customerV; + } + + public String getSupplierV() { + return supplierV; + } + + public void setSupplierV(String supplierV) { + this.supplierV = supplierV; + } + + public String getDef10() { + return def10; + } + + public void setDef10(String def10) { + this.def10 = def10; + } + + public String getDef9() { + return def9; + } + + public void setDef9(String def9) { + this.def9 = def9; + } + + public String getDef8() { + return def8; + } + + public void setDef8(String def8) { + this.def8 = def8; + } + + public String getDef7() { + return def7; + } + + public void setDef7(String def7) { + this.def7 = def7; + } + + public String getDef6() { + return def6; + } + + public void setDef6(String def6) { + this.def6 = def6; + } + + public String getDef5() { + return def5; + } + + public void setDef5(String def5) { + this.def5 = def5; + } + + public String getDef4() { + return def4; + } + + public void setDef4(String def4) { + this.def4 = def4; + } + + public String getDef3() { + return def3; + } + + public void setDef3(String def3) { + this.def3 = def3; + } + + public String getDef2() { + return def2; + } + + public void setDef2(String def2) { + this.def2 = def2; + } + + public String getModifiedtime() { + return modifiedtime; + } + + public void setModifiedtime(String modifiedtime) { + this.modifiedtime = modifiedtime; + } + + public String getCreationtime() { + return creationtime; + } + + public void setCreationtime(String creationtime) { + this.creationtime = creationtime; + } + + public String getCreator() { + return creator; + } + + public void setCreator(String creator) { + this.creator = creator; + } + + public String getModifier() { + return modifier; + } + + public void setModifier(String modifier) { + this.modifier = modifier; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentEntity.xml new file mode 100644 index 00000000..8aa114cb --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentEntity.xml @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + pk_org as pkOrg + ,isreded as isreded + ,pk_paybill as pkPaybill + ,pk_fiorg as pkFiorg + ,pu_org as puOrg + ,pk_group as pkGroup + ,pk_billtype as pkBilltype + ,pk_corp as pkCorp + ,pk_tradetype as pkTradetype + ,billclass as billclass + ,pk_tradetypeid as pkTradetypeid + ,billno as billno + ,billdate as billdate + ,syscode as syscode + ,src_syscode as srcSyscode + ,billstatus as billstatus + ,billmaker as billmaker + ,approver as approver + ,approvedate as approvedate + ,pk_busitype as pkBusitype + ,money as money + ,local_money as localMoney + ,scomment as scomment + ,settleflag as settleflag + ,settletype as settletype + ,effectstatus as effectstatus + ,pu_deptid as puDeptid + ,pu_psndoc as puPsndoc + ,pk_deptid as pkDeptid + ,pk_psndoc as pkPsndoc + ,supplier as supplier + ,pk_currtype as pkCurrtype + ,pk_subjcode as pkSubjcode + ,pk_balatype as pkBalatype + ,objtype as objtype + ,payaccount as payaccount + ,recaccount as recaccount + ,cashaccount as cashaccount + ,approvestatus as approvestatus + ,customer as customer + ,invoiceno as invoiceno + ,reversalreason as reversalreason + ,failurereason as failurereason + ,payreason as payreason + ,modifiedtime as modifiedtime + ,creationtime as creationtime + ,creator as creator + ,modifier as modifier + + + + + + + + + + + + + + update formmain_0260 set xxx =#{oaResult} where id=#{id} + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/CbsResultToOAPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/CbsResultToOAPluginInitializer.java new file mode 100644 index 00000000..f5fd2665 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/CbsResultToOAPluginInitializer.java @@ -0,0 +1,145 @@ +package com.hzya.frame.plugin.oa.payment.plugin; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.oa.payment.dao.IPaymentDao; +import com.hzya.frame.plugin.oa.payment.dao.IPaymentDetailsDao; +import com.hzya.frame.plugin.oa.payment.entity.PaymentDetailsEntity; +import com.hzya.frame.plugin.oa.payment.entity.PaymentEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.uuid.UUIDUtils; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; + +import java.util.Date; +import java.util.List; + +public class CbsResultToOAPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(CbsResultToOAPluginInitializer.class); + + @Autowired + private IPaymentDao paymentDao; + @Autowired + private IPaymentDetailsDao paymentDetailsDao; + + @Value("${zt.url}") + private String url; + + @Autowired + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "CbsResultToOAPluginInitializer"; + } + + @Override + public String getPluginName() { + return "CBS支付结果回写OA"; + } + + @Override + public String getPluginLabel() { + return "CbsResultToOAPluginInitializer"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + logger.info("======开始执行CBS支付结果回写OA========"); + //重试方法 + if (null != requestJson) { + //如果这个id不为空,说明是重试的 + String id = requestJson.getString("integration_task_living_details_id"); + //执行重新发送 + PaymentEntity paymentEntity = new PaymentEntity(); + paymentEntity.setDataSourceCode(""); + if (StrUtil.isNotEmpty(id)) { + paymentEntity.setId(id); + } + //查询没有支付成功的数据 + List paymentEntities = paymentDao.queryPaymentOAResult(paymentEntity); + if(paymentEntities == null || paymentEntities.size() == 0){ + logger.info("=====OA中没有需要查询支付状态的数据=========="); + return BaseResult.getSuccessMessageEntity("查询成功"); + } + for (PaymentEntity payment : paymentEntities) { + payment.setDataSourceCode(""); + JSONObject jsonObject=new JSONObject(); + + + String result = HttpRequest.post(url). + header("appId", ""). + header("apiCode", ""). + header("publicKey", "ZJYAQ/VtQ66PqKXlV0EowrrlKkhBHYgS/Zk39Q5ezIQne51Ce7eDIk+3zDUT+v578prj"). + header("secretKey", "iLLk424Bmzknbu+ROeJoiVDMYY5EFXtbZY/aU13HmVYIiQrIw9c0Ag4ipxbfpUqqj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). + body(jsonObject.toString()). + execute(). + body(); + logger.info("========CBS支付结果回写OA的返回参数为:{}=========",result); + JSONObject resultJson = JSONObject.parseObject(result); + if(!resultJson.getBoolean("flag")){ + JSONObject attribute = resultJson.getJSONObject("attribute"); + if("".equals(attribute.getString(""))){ + //修改oa付款单支付状态 + payment.setOaResult(""); + paymentDao.updatePaymentOAResult(payment); + } + } + } + } + }catch(Exception e){ + logger.info("======执行CBS支付结果回写OA失败:{}========", e.getMessage()); + e.printStackTrace(); + } + return BaseResult.getFailureMessageEntity("CBS支付结果回写OA执行失败"); + } + + private void saveTaskLivingDetails(String rootAppPk,String rootAppBill,String rootAppNewData,String newTransmitInfo,boolean flag) { + try { + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); + integrationTaskLivingDetailsEntity.setId(UUIDUtils.getUUID()); + integrationTaskLivingDetailsEntity.setSts("Y"); + integrationTaskLivingDetailsEntity.setCreate_user_id("1"); + integrationTaskLivingDetailsEntity.setModify_user_id("1"); + integrationTaskLivingDetailsEntity.setCreate_time(new Date()); + integrationTaskLivingDetailsEntity.setModify_time(new Date()); + integrationTaskLivingDetailsEntity.setOrg_id("0"); + integrationTaskLivingDetailsEntity.setCompanyId("0"); + integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk); + integrationTaskLivingDetailsEntity.setRootAppBill(rootAppBill); + integrationTaskLivingDetailsEntity.setPluginId("CbsResultToOAPluginInitializer"); + integrationTaskLivingDetailsEntity.setRootAppNewData(rootAppNewData); + integrationTaskLivingDetailsEntity.setNewTransmitInfo(newTransmitInfo); + if(flag){ + taskLivingDetailsService.saveLogToSuccess(integrationTaskLivingDetailsEntity); + }else { + taskLivingDetailsService.saveLogToFail(integrationTaskLivingDetailsEntity); + } + }catch (Exception e){ + logger.info("保存日志到集成任务日志明细中失败:{}",e.getMessage()); + } + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/OAApprovedToCbsPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/OAApprovedToCbsPluginInitializer.java new file mode 100644 index 00000000..9a9bb8c7 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/OAApprovedToCbsPluginInitializer.java @@ -0,0 +1,155 @@ +package com.hzya.frame.plugin.oa.payment.plugin; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.oa.payment.dao.IPaymentDao; +import com.hzya.frame.plugin.oa.payment.dao.IPaymentDetailsDao; +import com.hzya.frame.plugin.oa.payment.entity.PaymentDetailsEntity; +import com.hzya.frame.plugin.oa.payment.entity.PaymentEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.uuid.UUIDUtils; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; + +import java.util.Date; +import java.util.List; + +public class OAApprovedToCbsPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(PaymentToOAPluginInitializer.class); + + @Autowired + private IPaymentDao paymentDao; + @Autowired + private IPaymentDetailsDao paymentDetailsDao; + + @Value("${zt.url}") + private String url; + + @Autowired + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "OAApprovedToCbsPluginInitializer"; + } + + @Override + public String getPluginName() { + return "OA已审批单据传递CBS"; + } + + @Override + public String getPluginLabel() { + return "OAApprovedToCbsPluginInitializer"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + logger.info("======开始执行OA审批完成单据推送CBS========"); + //重试方法 + if (null != requestJson) { + //如果这个id不为空,说明是重试的 + String id = requestJson.getString("integration_task_living_details_id"); + //执行重新发送 + PaymentEntity paymentEntity = new PaymentEntity(); + paymentEntity.setDataSourceCode(""); + if (StrUtil.isNotEmpty(id)) { + paymentEntity.setId(id); + } + //查询OA审批完成单据推送CBS的数据 + List paymentEntities = paymentDao.queryPaymentOAToCbs(paymentEntity); + if(paymentEntities == null || paymentEntities.size() == 0){ + logger.info("=====OA中没有已审批完成需要推送CBS的单据=========="); + return BaseResult.getSuccessMessageEntity("查询成功"); + } + for (PaymentEntity payment : paymentEntities) { + JSONObject jsonObject=new JSONObject(); + + //查询OA明细数据 + PaymentDetailsEntity paymentDetailsEntity=new PaymentDetailsEntity(); + paymentDetailsEntity.setDataSourceCode(""); + paymentDetailsEntity.setFormmainId(payment.getId()); + List paymentDetailsEntities = paymentDetailsDao.queryPaymentDetails(paymentDetailsEntity); + if(paymentDetailsEntities == null || paymentDetailsEntities.size() == 0){ + logger.info("=====没有需要从OA传递CBS的明细数据=========="); + }else{ + for (PaymentDetailsEntity detailsEntity : paymentDetailsEntities) { + + } + } + + + String result = HttpRequest.post(url). + header("appId", ""). + header("apiCode", ""). + header("publicKey", "ZJYAQ/VtQ66PqKXlV0EowrrlKkhBHYgS/Zk39Q5ezIQne51Ce7eDIk+3zDUT+v578prj"). + header("secretKey", "iLLk424Bmzknbu+ROeJoiVDMYY5EFXtbZY/aU13HmVYIiQrIw9c0Ag4ipxbfpUqqj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). + body(jsonObject.toString()). + execute(). + body(); + logger.info("========OA审批完成单据推送CBS的返回参数为:{}=========",result); + JSONObject resultJson = JSONObject.parseObject(result); + if(!resultJson.getBoolean("flag")){ + JSONObject attribute = resultJson.getJSONObject("attribute"); + if("".equals(attribute.getString(""))){ + //修改oa付款单推送状态 + } + } + } + } + }catch(Exception e){ + logger.info("======执行OA审批完成单据推送CBS失败:{}========", e.getMessage()); + e.printStackTrace(); + } + return BaseResult.getFailureMessageEntity("OA审批完成单据推送CBS执行失败"); + } + + private void saveTaskLivingDetails(String rootAppPk,String rootAppBill,String rootAppNewData,String newTransmitInfo,boolean flag) { + try { + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); + integrationTaskLivingDetailsEntity.setId(UUIDUtils.getUUID()); + integrationTaskLivingDetailsEntity.setSts("Y"); + integrationTaskLivingDetailsEntity.setCreate_user_id("1"); + integrationTaskLivingDetailsEntity.setModify_user_id("1"); + integrationTaskLivingDetailsEntity.setCreate_time(new Date()); + integrationTaskLivingDetailsEntity.setModify_time(new Date()); + integrationTaskLivingDetailsEntity.setOrg_id("0"); + integrationTaskLivingDetailsEntity.setCompanyId("0"); + integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk); + integrationTaskLivingDetailsEntity.setRootAppBill(rootAppBill); + integrationTaskLivingDetailsEntity.setPluginId("OAApprovedToCbsPluginInitializer"); + integrationTaskLivingDetailsEntity.setRootAppNewData(rootAppNewData); + integrationTaskLivingDetailsEntity.setNewTransmitInfo(newTransmitInfo); + if(flag){ + taskLivingDetailsService.saveLogToSuccess(integrationTaskLivingDetailsEntity); + }else { + taskLivingDetailsService.saveLogToFail(integrationTaskLivingDetailsEntity); + } + }catch (Exception e){ + logger.info("保存日志到集成任务日志明细中失败:{}",e.getMessage()); + } + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/PaymentToOAPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/PaymentToOAPluginInitializer.java new file mode 100644 index 00000000..22d06e54 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/PaymentToOAPluginInitializer.java @@ -0,0 +1,222 @@ +package com.hzya.frame.plugin.oa.payment.plugin; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.oa.payment.dao.IPaymentDao; +import com.hzya.frame.plugin.oa.payment.dao.IPaymentDetailsDao; +import com.hzya.frame.plugin.oa.payment.entity.PaymentDetailsEntity; +import com.hzya.frame.plugin.oa.payment.entity.PaymentEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.uuid.UUIDUtils; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PaymentToOAPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(PaymentToOAPluginInitializer.class); + + @Autowired + private IPaymentDao paymentDao; + @Autowired + private IPaymentDetailsDao paymentDetailsDao; + + @Value("${zt.url}") + private String url; + + @Autowired + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "PaymentToOAPluginInitializer"; + } + + @Override + public String getPluginName() { + return "NCC付款单传递OA"; + } + + @Override + public String getPluginLabel() { + return "PaymentToOAPluginInitializer"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + logger.info("======开始执行NCC付款单传递OA========"); + //重试方法 + if (null != requestJson) { + //如果这个id不为空,说明是重试的 + String id = requestJson.getString("integration_task_living_details_id"); + //执行重新发送 + PaymentEntity paymentEntity = new PaymentEntity(); + paymentEntity.setDataSourceCode(""); + if (StrUtil.isNotEmpty(id)) { + paymentEntity.setId(id); + } + //查询ncc需要传递OA的数据 + List paymentEntities = paymentDao.query(paymentEntity); + if(paymentEntities == null || paymentEntities.size() == 0){ + logger.info("=====没有需要从NCC传递到OA的付款单=========="); + return BaseResult.getSuccessMessageEntity("查询成功"); + } + for (PaymentEntity payment : paymentEntities) { + JSONObject jsonObject=new JSONObject(); + JSONObject jsonMain=new JSONObject(); + JSONArray jsonArray=new JSONArray(); + jsonObject.put("应付财务组织",payment.getPkOrg()); + jsonObject.put("红冲标志",payment.getIsreded()); + jsonObject.put("付款类型",payment.getPkTradetypeid()); + jsonObject.put("单据编号",payment.getBillno()); + jsonObject.put("单据日期",payment.getBilldate()); + jsonObject.put("单据状态",payment.getBillstatus()); + jsonObject.put("发起人",payment.getBillmaker()); + jsonObject.put("业务流程",payment.getPkBusitype()); + jsonObject.put("原币金额",payment.getMoney()); + jsonObject.put("组织本币金额",payment.getLocalMoney()); + jsonObject.put("生效状态",payment.getEffectstatus()); + jsonObject.put("部门",payment.getPkDeptid()); + jsonObject.put("业务员",payment.getPkPsndoc()); + jsonObject.put("供应商",payment.getSupplier()); + jsonObject.put("币种",payment.getPkCurrtype()); + jsonObject.put("收支项目",payment.getPkSubjcode()); + jsonObject.put("结算方式",payment.getPkBalatype()); + jsonObject.put("往来对象",payment.getObjtype()); + jsonObject.put("付款银行账户",payment.getPayaccount()); + jsonObject.put("收款银行账户",payment.getRecaccount()); + jsonObject.put("现金账户",payment.getCashaccount()); + jsonObject.put("审批状态",payment.getApprovestatus()); + jsonObject.put("客户",payment.getCustomer()); + jsonMain.put("formmain_0260",jsonObject); + PaymentDetailsEntity paymentDetailsEntity=new PaymentDetailsEntity(); + paymentDetailsEntity.setDataSourceCode(""); + paymentDetailsEntity.setTopBillid(payment.getPkPaybill()); + //查询NCC付款单明细 + List paymentDetailsEntities = paymentDetailsDao.query(paymentDetailsEntity); + if(paymentDetailsEntities == null || paymentDetailsEntities.size() == 0){ + logger.info("=====没有需要从NCC传递到OA的付款单明细数据=========="); + }else{ + for (PaymentDetailsEntity detailsEntity : paymentDetailsEntities) { + JSONObject jsonDetails=new JSONObject(); + jsonDetails.put("付款性质",detailsEntity.getPrepay()); + jsonDetails.put("物料",detailsEntity.getMaterial()); + jsonDetails.put("供应商-明细表",detailsEntity.getSupplier()); + jsonDetails.put("挂起标志",detailsEntity.getPausetransact()); + jsonDetails.put("往来对象-明细表",detailsEntity.getObjtype()); + jsonDetails.put("票据类型",detailsEntity.getChecktype()); + jsonDetails.put("摘要",detailsEntity.getScomment()); + jsonDetails.put("币种-明细表",detailsEntity.getPkCurrtype()); + jsonDetails.put("组织本币汇率-明细表",detailsEntity.getRate()); + jsonDetails.put("部门-明细表",detailsEntity.getPkDeptid()); + jsonDetails.put("业务员-明细表",detailsEntity.getPkPsndoc()); + jsonDetails.put("借方原币金额",detailsEntity.getMoneyDe()); + jsonDetails.put("组织本币金额-借方",detailsEntity.getLocalMoneyDe()); + jsonDetails.put("借方原币无税金额",detailsEntity.getNotaxDe()); + jsonDetails.put("税率",detailsEntity.getTaxrate()); + jsonDetails.put("结算方式-明细表",detailsEntity.getPkBalatype()); + jsonDetails.put("票据号",detailsEntity.getCheckno()); + jsonDetails.put("付款银行账户-明细表",detailsEntity.getPayaccount()); + jsonDetails.put("收款银行账户-明细表",detailsEntity.getRecaccount()); + jsonDetails.put("现金账户-明细表",detailsEntity.getCashaccount()); + jsonDetails.put("集团本币无税金额-借方",detailsEntity.getGroupnotaxDe()); + jsonDetails.put("全局本币无税金额-借方",detailsEntity.getGlobalnotaxDe()); + jsonDetails.put("客户-明细表",detailsEntity.getCustomer()); + jsonDetails.put("付款业务类型",detailsEntity.getPkRecpaytype()); + jsonDetails.put("税码",detailsEntity.getTaxcodeid()); + jsonDetails.put("直联电票",detailsEntity.getDirectCheckno()); + jsonArray.add(jsonDetails); + } + } + jsonMain.put("formson_0261",jsonArray); + Map map = new HashMap(); + map.put("appName", "collaboration"); + Map data1 = new HashMap(); + data1.put("templateCode", "formmain_0260"); + data1.put("draft", "1"); + data1.put("data", jsonMain); + map.put("data", data1); + logger.info("========NCC付款单传递OA的请求参数为:{}=========",map); + //发送数据 + String result = HttpRequest.post(url). + header("appId", "800064"). + header("apiCode", "8000640000"). + header("publicKey", "ZJYAQ/VtQ66PqKXlV0EowrrlKkhBHYgS/Zk39Q5ezIQne51Ce7eDIk+3zDUT+v578prj"). + header("secretKey", "iLLk424Bmzknbu+ROeJoiVDMYY5EFXtbZY/aU13HmVYIiQrIw9c0Ag4ipxbfpUqqj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). + body(map.toString()). + execute(). + body(); + logger.info("========NCC付款单传递OA的返回参数为:{}=========",result); + JSONObject resultJson = JSONObject.parseObject(result); + if(!resultJson.getBoolean("flag")){ + JSONObject attribute = resultJson.getJSONObject("attribute"); + if("0".equals(attribute.getString("code"))){ + //修改NCC付款单推送状态 + } + } + } + logger.info("=======NCC付款单传递OA执行成功======="); + return BaseResult.getSuccessMessageEntity("NCC付款单传递OA执行成功"); + } + }catch (Exception e){ + logger.info("======执行NCC付款单传递OA失败:{}========", e.getMessage()); + e.printStackTrace(); + } + return BaseResult.getFailureMessageEntity("NCC付款单传递OA执行失败"); + } + + + private void saveTaskLivingDetails(String rootAppPk,String rootAppBill,String rootAppNewData,String newTransmitInfo,boolean flag) { + try { + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); + integrationTaskLivingDetailsEntity.setId(UUIDUtils.getUUID()); + integrationTaskLivingDetailsEntity.setSts("Y"); + integrationTaskLivingDetailsEntity.setCreate_user_id("1"); + integrationTaskLivingDetailsEntity.setModify_user_id("1"); + integrationTaskLivingDetailsEntity.setCreate_time(new Date()); + integrationTaskLivingDetailsEntity.setModify_time(new Date()); + integrationTaskLivingDetailsEntity.setOrg_id("0"); + integrationTaskLivingDetailsEntity.setCompanyId("0"); + integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk); + integrationTaskLivingDetailsEntity.setRootAppBill(rootAppBill); + integrationTaskLivingDetailsEntity.setPluginId("PaymentToOAPluginInitializer"); + integrationTaskLivingDetailsEntity.setRootAppNewData(rootAppNewData); + integrationTaskLivingDetailsEntity.setNewTransmitInfo(newTransmitInfo); + if(flag){ + taskLivingDetailsService.saveLogToSuccess(integrationTaskLivingDetailsEntity); + }else { + taskLivingDetailsService.saveLogToFail(integrationTaskLivingDetailsEntity); + } + }catch (Exception e){ + logger.info("保存日志到集成任务日志明细中失败:{}",e.getMessage()); + } + } + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/IPaymentService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/IPaymentService.java new file mode 100644 index 00000000..d9a56218 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/IPaymentService.java @@ -0,0 +1,7 @@ +package com.hzya.frame.plugin.oa.payment.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.payment.entity.PaymentEntity; + +public interface IPaymentService extends IBaseService { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/impl/PaymentServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/impl/PaymentServiceImpl.java new file mode 100644 index 00000000..20b2408b --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/impl/PaymentServiceImpl.java @@ -0,0 +1,8 @@ +package com.hzya.frame.plugin.oa.payment.service.impl; + +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.plugin.payment.entity.PaymentEntity; +import com.hzya.frame.plugin.payment.service.IPaymentService; + +public class PaymentServiceImpl extends BaseService implements IPaymentService { +} diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/pluginCfg.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/pluginCfg.xml new file mode 100644 index 00000000..294b6b5e --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/pluginCfg.xml @@ -0,0 +1,6 @@ + + +JHOAPlugin +建辉OA插件 +202505230001 + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-dao.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-dao.xml new file mode 100644 index 00000000..e5afe641 --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-dao.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-plugin.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-plugin.xml new file mode 100644 index 00000000..5b9d1b9f --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-plugin.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-service.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-service.xml new file mode 100644 index 00000000..dc366931 --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-service.xml @@ -0,0 +1,5 @@ + + + + + From 5626ab90cb4dfb48e76e3c1c001d768aae6ee12a Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Fri, 23 May 2025 14:09:34 +0800 Subject: [PATCH 49/67] =?UTF-8?q?NCC=E4=BB=98=E6=AC=BE=E5=8D=95=E4=BC=A0?= =?UTF-8?q?=E9=80=92OA=E4=BB=A5=E5=8F=8AOA=E4=BB=98=E6=AC=BE=E5=8D=95?= =?UTF-8?q?=E6=8E=A8=E9=80=81CBS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzya/frame/plugin/oa/payment/service/IPaymentService.java | 2 +- .../plugin/oa/payment/service/impl/PaymentServiceImpl.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/IPaymentService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/IPaymentService.java index d9a56218..fd053dc6 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/IPaymentService.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/IPaymentService.java @@ -1,7 +1,7 @@ package com.hzya.frame.plugin.oa.payment.service; import com.hzya.frame.basedao.service.IBaseService; -import com.hzya.frame.plugin.payment.entity.PaymentEntity; +import com.hzya.frame.plugin.oa.payment.entity.PaymentEntity; public interface IPaymentService extends IBaseService { } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/impl/PaymentServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/impl/PaymentServiceImpl.java index 20b2408b..15a97a30 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/impl/PaymentServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/impl/PaymentServiceImpl.java @@ -1,8 +1,8 @@ package com.hzya.frame.plugin.oa.payment.service.impl; import com.hzya.frame.basedao.service.impl.BaseService; -import com.hzya.frame.plugin.payment.entity.PaymentEntity; -import com.hzya.frame.plugin.payment.service.IPaymentService; +import com.hzya.frame.plugin.oa.payment.entity.PaymentEntity; +import com.hzya.frame.plugin.oa.payment.service.IPaymentService; public class PaymentServiceImpl extends BaseService implements IPaymentService { } From 569a8943076d8a69a9a839a57b5363e25f189866 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 27 May 2025 10:21:08 +0800 Subject: [PATCH 50/67] zt_url --- .../frame/cbs8/service/impl/Cbs8ServiceImpl.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/impl/Cbs8ServiceImpl.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/impl/Cbs8ServiceImpl.java index 8949397e..a46db478 100644 --- a/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/impl/Cbs8ServiceImpl.java +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/impl/Cbs8ServiceImpl.java @@ -17,6 +17,7 @@ import com.hzya.frame.web.entity.JsonResultEntity; import org.apache.commons.collections.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.util.ArrayList; @@ -32,7 +33,8 @@ import java.util.Map; @Service public class Cbs8ServiceImpl implements ICbs8Service { Logger logger = LoggerFactory.getLogger(getClass()); - + @Value("${zt.url}") + private String zt_url; @Override public PayResponseDTO payApply(PaymentEntity paymentEntity) { Map headerMap = MapBuilder.create(true) @@ -41,7 +43,7 @@ public class Cbs8ServiceImpl implements ICbs8Service { .put("secretKey","7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") .put("appId","800026") .build(); - String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfaceToESB").addHeaders(headerMap).body(JSONObject.toJSONString(paymentEntity)).timeout(60000).execute().body(); + String body = HttpRequest.post(zt_url).addHeaders(headerMap).body(JSONObject.toJSONString(paymentEntity)).timeout(60000).execute().body(); //解密响应报文 String result = decryptResBody(body); if (StrUtil.isNotEmpty(result)){ @@ -71,7 +73,7 @@ public class Cbs8ServiceImpl implements ICbs8Service { .put("secretKey","7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") .put("appId","800026") .build(); - String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfaceToESB").addHeaders(headerMap).body(JSONObject.toJSONString(resultRequestDTO)).timeout(60000).execute().body(); + String body = HttpRequest.post(zt_url).addHeaders(headerMap).body(JSONObject.toJSONString(resultRequestDTO)).timeout(60000).execute().body(); String result = decryptResBody(body); CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class); if (CollectionUtils.isNotEmpty(cbsResponseDTO.getData())){ @@ -113,7 +115,7 @@ public class Cbs8ServiceImpl implements ICbs8Service { .put("secretKey","7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") .put("appId","800026") .build(); - String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfaceToESB").addHeaders(headerMap).body(params).timeout(60000).execute().body(); + String body = HttpRequest.post(zt_url).addHeaders(headerMap).body(params).timeout(60000).execute().body(); String result = decryptResBody(body); if (StrUtil.isNotEmpty(result)){ CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class); @@ -165,7 +167,7 @@ public class Cbs8ServiceImpl implements ICbs8Service { .put("secretKey","7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") .put("appId","800026") .build(); - String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfaceToESB").addHeaders(headerMap).body(params).timeout(60000).execute().body(); + String body = HttpRequest.post(zt_url).addHeaders(headerMap).body(params).timeout(60000).execute().body(); String result = decryptResBody(body); if (StrUtil.isNotEmpty(result)){ CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class); @@ -200,7 +202,7 @@ public class Cbs8ServiceImpl implements ICbs8Service { .put("secretKey","7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") .put("appId","800026") .build(); - String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfaceToESB").addHeaders(headerMap).body(params).timeout(60000).execute().body(); + String body = HttpRequest.post(zt_url).addHeaders(headerMap).body(params).timeout(60000).execute().body(); String result = decryptResBody(body); if (StrUtil.isNotEmpty(result)){ CbsResponseDTO cbsResponseDTO = JSONObject.parseObject(result, CbsResponseDTO.class); @@ -229,7 +231,7 @@ public class Cbs8ServiceImpl implements ICbs8Service { .put("appId","800026") .build(); String params = JSON.toJSONString(agentPayResultRequestDTO); - String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfaceToESB").addHeaders(headerMap).body(params).timeout(60000).execute().body(); + String body = HttpRequest.post(zt_url).addHeaders(headerMap).body(params).timeout(60000).execute().body(); //解密报文 String result = decryptResBody(body); if (StrUtil.isNotEmpty(result)){ From 313e72d5b8ca9fac1d67a2cc52431da2566586bf Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 27 May 2025 10:21:29 +0800 Subject: [PATCH 51/67] =?UTF-8?q?cbs=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-xel.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/base-buildpackage/src/main/resources/application-xel.yml b/base-buildpackage/src/main/resources/application-xel.yml index e5d2197f..9b81c4da 100644 --- a/base-buildpackage/src/main/resources/application-xel.yml +++ b/base-buildpackage/src/main/resources/application-xel.yml @@ -21,3 +21,17 @@ savefile: path: /Users/xiangerlin/work/app/file/dev pluginpath: /Users/xiangerlin/work/app/file/dev tomcatpath: /Users/xiangerlin/work/app/file/dev +zt: + url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface +cbs8: + appId: 1P4AGrpz + appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a + url: https://cbs8-openapi-reprd.csuat.cmburl.cn + # 测试用这个 这个是银行给的,和下面的公钥不是一对密钥 + ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44 + # 这个私钥到时候上传到cbs,和下面到是同一对 + #ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46 + ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde + cbs_public_key: 0469146F06BF3B01236E84632441E826 + #电子回单下载临时存放位置 + elec_path: /Users/xiangerlin/Downloads/ \ No newline at end of file From 1c9963aab89d7e671bbd2610787497fec7636b28 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 29 May 2025 18:57:45 +0800 Subject: [PATCH 52/67] =?UTF-8?q?=E6=94=AF=E4=BB=98=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=85=A5=E5=8F=82=E6=94=B9=E6=88=90JSON?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hzya/frame/cbs8/service/ICbs8Service.java | 5 +++-- .../com/hzya/frame/cbs8/service/impl/Cbs8ServiceImpl.java | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/ICbs8Service.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/ICbs8Service.java index 9693e554..670cd66f 100644 --- a/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/ICbs8Service.java +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/ICbs8Service.java @@ -1,5 +1,6 @@ package com.hzya.frame.cbs8.service; +import com.alibaba.fastjson.JSONObject; import com.hzya.frame.cbs8.dto.req.*; import com.hzya.frame.cbs8.dto.res.*; import com.hzya.frame.cbs8.entity.PaymentEntity; @@ -15,9 +16,9 @@ public interface ICbs8Service { /** * 支付申请 - * @param paymentEntity + * @param payJsonStr */ - PayResponseDTO payApply(PaymentEntity paymentEntity); + PayResponseDTO payApply(String payJsonStr); /** * 通过业务参考号查询交易结果 3.2.6 diff --git a/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/impl/Cbs8ServiceImpl.java b/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/impl/Cbs8ServiceImpl.java index a46db478..f70359cc 100644 --- a/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/impl/Cbs8ServiceImpl.java +++ b/fw-cbs/src/main/java/com/hzya/frame/cbs8/service/impl/Cbs8ServiceImpl.java @@ -36,14 +36,14 @@ public class Cbs8ServiceImpl implements ICbs8Service { @Value("${zt.url}") private String zt_url; @Override - public PayResponseDTO payApply(PaymentEntity paymentEntity) { + public PayResponseDTO payApply(String payJsonStr) { Map headerMap = MapBuilder.create(true) .put("apiCode", "8000260001") .put("publicKey","ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj") .put("secretKey","7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") .put("appId","800026") .build(); - String body = HttpRequest.post(zt_url).addHeaders(headerMap).body(JSONObject.toJSONString(paymentEntity)).timeout(60000).execute().body(); + String body = HttpRequest.post(zt_url).addHeaders(headerMap).body(payJsonStr).timeout(60000).execute().body(); //解密响应报文 String result = decryptResBody(body); if (StrUtil.isNotEmpty(result)){ From 2baa228f10d3ea38a693fa5baa4774c74c07c609 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 29 May 2025 18:58:07 +0800 Subject: [PATCH 53/67] =?UTF-8?q?=E8=B0=83=E7=94=A8=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=A2=9E=E5=8A=A0=E6=95=B0=E6=8D=AE=E6=BA=90?= =?UTF-8?q?=E3=80=81=E8=AF=B7=E6=B1=82=E5=A4=B4=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbs8/service/impl/CbsLogServiceImpl.java | 7 +-- .../service/impl/SeeYonInterFaceImpl.java | 60 ++++++++----------- 2 files changed, 28 insertions(+), 39 deletions(-) diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java index 07a89a52..5ff114e9 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java @@ -38,8 +38,7 @@ public class CbsLogServiceImpl extends BaseService implemen Logger log = LoggerFactory.getLogger(getClass()); private ICbsLogDao cbsLogDao; - @Value("${OA.data_source_code:}") - private String oa_data_source_code; + @Autowired public void setCbsLogDao(ICbsLogDao cbsLogDao) { this.cbsLogDao = cbsLogDao; @@ -84,7 +83,7 @@ public class CbsLogServiceImpl extends BaseService implemen //根据oaid判断是否在日志表中存在,如果存在,则更新,如果不存在,则新增 CbsLogEntity cbsLogEntityResend=new CbsLogEntity(); cbsLogEntityResend.setOa_id(cbsLogEntity.getOa_id()); - cbsLogEntityResend.setDataSourceCode(oa_data_source_code); + cbsLogEntityResend.setDataSourceCode(cbsLogEntity.getDataSourceCode()); List queryList = query(cbsLogEntityResend); if(CollectionUtils.isEmpty(queryList)){ String data = StrUtil.format(getXmlTemplate(),title,pay_company,payee,amount,cbs_apply_code,bill_code,oa_id,tab_name_ch,tab_name_en,pay_state,message,apply_state,successed); @@ -108,7 +107,7 @@ public class CbsLogServiceImpl extends BaseService implemen logEntity.setApply_state(apply_state); logEntity.setSuccessed(successed); logEntity.setBill_code(cbsLogEntity.getBill_code()); - logEntity.setDataSourceCode(oa_data_source_code); + logEntity.setDataSourceCode(cbsLogEntity.getDataSourceCode()); try { update(logEntity); }catch (Exception e){ diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java index b2e196b3..3c183aee 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java @@ -23,6 +23,7 @@ import com.hzya.frame.util.PluginUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import com.hzya.frame.web.exception.BaseSystemException; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -495,55 +496,44 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { throw new BaseSystemException("根据formID:" + formAppId + "eventType:"+eventType+"未查询到API配置"); } SysApplicationApiEntity sysApp = applist.get(0); + //数据源配置 + SysApplicationDatabaseEntity sysApiDatabase = new SysApplicationDatabaseEntity(); + sysApiDatabase.setAppId(sysApp.getAppId()); + List apiDataBaseList = sysApplicationDatabaseDao.queryDSBase(sysApiDatabase); + if (CollectionUtils.isNotEmpty(apiDataBaseList) && apiDataBaseList.size() == 1){ + sysApiDatabase = apiDataBaseList.get(0); + } JSONArray headerArray = JSONArray.parseArray(sysApp.getHeaderIn()); + Map headerMap = new HashMap<>(); if (null != headerArray && headerArray.size() > 0) { - String plugId = null; for (int i = 0; i < headerArray.size(); i++) { JSONObject querys = headerArray.getJSONObject(i); //query 只有基本类型,不用循环判断下级 //判断参数是否有值 //获取对象下面的层级数据 String parameterName = querys.getString("parameterName"); - if (null != parameterName && "plugId".equals(parameterName)) { - plugId = querys.getString("example"); - break; - } + String example = querys.getString("example"); + headerMap.put(parameterName,example); } - if (null == plugId) { + if (headerMap.isEmpty()){ throw new BaseSystemException("根据formID:" + formAppId + "未获取到head参数"); - } else { - PluginBaseEntity pluginBaseEntity = null; - JsonResultEntity result; - pluginBaseEntity = PluginUtils.getPluginsById(plugId); - if (null == pluginBaseEntity) { - throw new BaseSystemException("根据ID获取插件错误!请传入正确的 pluginId"); - } else { - //执行业务逻辑代码 - JSONObject reqJson = new JSONObject(); - reqJson.put("jsonStr",jsonStr); - reqJson.put("formAppId",formAppId); - reqJson.put("eventType",eventType); - result = pluginBaseEntity.executeBusiness(reqJson); - return result; - } } - - + PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(headerMap.get("plugId")); + if (null == pluginBaseEntity) { + throw new BaseSystemException("根据ID获取插件错误!请传入正确的 pluginId"); + } + //执行业务逻辑代码 + JSONObject reqJson = new JSONObject(); + reqJson.put("jsonStr",jsonStr); + reqJson.put("formAppId",formAppId); + reqJson.put("eventType",eventType); + reqJson.put("headers",JSON.toJSONString(headerMap)); + reqJson.put("sourceCode",sysApiDatabase.getSourceCode());//数据源编码,参数名和定时任务调用插件保持一致 + JsonResultEntity result = pluginBaseEntity.executeBusiness(reqJson); + return result; } else { throw new BaseSystemException("根据formID:" + formAppId + "未获取到head参数"); } - - -// Map headerMap = MapBuilder.create(true) -// .put("apiCode", String.valueOf(sysApp.getApiCode())) -// //这里用中台做为发送方 -// .put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj") -// .put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") -// .put("appId",String.valueOf(sysApp.getAppCode())) -// .build(); -// String body = HttpRequest.post("http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(jsonStr).timeout(60000).execute().body(); -// logger.info("调用中台返回的参数:{}",body); -// return body; } }else{ // StrUtil.isNotEmpty(jsonStr) && StrUtil.isNotEmpty(formAppId) && StrUtil.isNotEmpty(eventType) From 972f8189bb1905504c2e8ecdb6f999118fd96b8d Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 29 May 2025 18:58:30 +0800 Subject: [PATCH 54/67] =?UTF-8?q?=E5=A2=9E=E5=8A=A0ds=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hzya/frame/basedao/dao/MybatisGenericDao.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base-common/src/main/java/com/hzya/frame/basedao/dao/MybatisGenericDao.java b/base-common/src/main/java/com/hzya/frame/basedao/dao/MybatisGenericDao.java index 95e43393..3852d256 100644 --- a/base-common/src/main/java/com/hzya/frame/basedao/dao/MybatisGenericDao.java +++ b/base-common/src/main/java/com/hzya/frame/basedao/dao/MybatisGenericDao.java @@ -96,7 +96,7 @@ public abstract class MybatisGenericDao queryList(E o, String stamentID) { List tempList = this.sqlSession.selectList(stamentID, o); From 4fe3292240af86310e9cbe3fa9a16174153ce154 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 29 May 2025 19:02:37 +0800 Subject: [PATCH 55/67] =?UTF-8?q?1=E3=80=81=E5=88=A0=E9=99=A4=E4=BD=95?= =?UTF-8?q?=E7=81=BF=E4=B9=8B=E5=89=8D=E7=9A=84=E4=BB=A3=E7=A0=81=EF=BC=88?= =?UTF-8?q?NCC=E5=8F=91=E8=B5=B7=E5=8D=95=E6=8D=AE=E8=A6=81=E5=8E=BBNCC?= =?UTF-8?q?=E5=BC=80=E5=8F=91=EF=BC=8C=E4=B8=8D=E7=94=A8=E5=86=99=E5=88=B0?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E9=87=8C=EF=BC=89=202=E3=80=81=E9=87=8D?= =?UTF-8?q?=E5=86=99CBS=E6=94=AF=E4=BB=98=E7=94=B3=E8=AF=B7=E3=80=81?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BA=A4=E6=98=93=E7=BB=93=E6=9E=9C=E6=8F=92?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/oa/payment/dao/IPaymentDao.java | 39 - .../oa/payment/dao/IPaymentDetailsDao.java | 18 - .../oa/payment/dao/impl/PaymentDaoImpl.java | 28 - .../dao/impl/PaymentDetailsDaoImpl.java | 16 - .../payment/entity/PaymentDetailsEntity.java | 1402 ----------------- .../payment/entity/PaymentDetailsEntity.xml | 168 -- .../oa/payment/entity/PaymentEntity.java | 1098 ------------- .../oa/payment/entity/PaymentEntity.xml | 153 -- .../CbsResultToOAPluginInitializer.java | 145 -- .../OAApprovedToCbsPluginInitializer.java | 155 -- .../plugin/PayResultPluginInitializer.java | 102 ++ .../PaymentRequestPluginInitializer.java | 107 ++ .../plugin/PaymentToOAPluginInitializer.java | 222 --- .../service/IPaymentPluginService.java | 24 + .../oa/payment/service/IPaymentService.java | 7 - .../impl/PaymentPluginServiceImpl.java | 181 +++ .../service/impl/PaymentServiceImpl.java | 8 - 17 files changed, 414 insertions(+), 3459 deletions(-) delete mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/IPaymentDao.java delete mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/IPaymentDetailsDao.java delete mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/impl/PaymentDaoImpl.java delete mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/impl/PaymentDetailsDaoImpl.java delete mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentDetailsEntity.java delete mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentDetailsEntity.xml delete mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentEntity.java delete mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentEntity.xml delete mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/CbsResultToOAPluginInitializer.java delete mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/OAApprovedToCbsPluginInitializer.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/PayResultPluginInitializer.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/PaymentRequestPluginInitializer.java delete mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/PaymentToOAPluginInitializer.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/IPaymentPluginService.java delete mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/IPaymentService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/impl/PaymentPluginServiceImpl.java delete mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/impl/PaymentServiceImpl.java diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/IPaymentDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/IPaymentDao.java deleted file mode 100644 index 223f3442..00000000 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/IPaymentDao.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.hzya.frame.plugin.oa.payment.dao; - -import com.hzya.frame.basedao.dao.IBaseDao; -import com.hzya.frame.plugin.oa.payment.entity.PaymentEntity; - -import java.util.List; - -public interface IPaymentDao extends IBaseDao { - - /** - * 查询OA审批完成的单据传递CBS - * @content - * @Param - * @Return - * @Author hecan - * @Date 2025-05-22 10:03 - * **/ - List queryPaymentOAToCbs(PaymentEntity entity); - - /** - * - * @content 查询OA需要查询支付状态的数据 - * @Param - * @Return - * @Author hecan - * @Date 2025-05-22 11:33 - * **/ - List queryPaymentOAResult(PaymentEntity entity); - - /** - * - * @content 更新OA支付结果 - * @Param - * @Return - * @Author hecan - * @Date 2025-05-23 11:44 - * **/ - Integer updatePaymentOAResult(PaymentEntity entity); -} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/IPaymentDetailsDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/IPaymentDetailsDao.java deleted file mode 100644 index aaf24d3b..00000000 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/IPaymentDetailsDao.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.hzya.frame.plugin.oa.payment.dao; - -import com.hzya.frame.basedao.dao.IBaseDao; -import com.hzya.frame.plugin.oa.payment.entity.PaymentDetailsEntity; - -import java.util.List; - -public interface IPaymentDetailsDao extends IBaseDao { - /** - * - * @content 查询OA付款单明细数据 - * @Param - * @Return - * @Author hecan - * @Date 2025-05-23 10:37 - * **/ - List queryPaymentDetails(PaymentDetailsEntity entity); -} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/impl/PaymentDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/impl/PaymentDaoImpl.java deleted file mode 100644 index 0c7b763c..00000000 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/impl/PaymentDaoImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.hzya.frame.plugin.oa.payment.dao.impl; - -import com.baomidou.dynamic.datasource.annotation.DS; -import com.hzya.frame.basedao.dao.MybatisGenericDao; -import com.hzya.frame.plugin.oa.payment.dao.IPaymentDao; -import com.hzya.frame.plugin.oa.payment.entity.PaymentEntity; - -import java.util.List; - -public class PaymentDaoImpl extends MybatisGenericDao implements IPaymentDao { - @DS("#entity.dataSourceCode") - @Override - public List queryPaymentOAToCbs(PaymentEntity entity) { - return (List) super.selectList("queryPaymentOAToCbs",entity); - } - - @DS("#entity.dataSourceCode") - @Override - public List queryPaymentOAResult(PaymentEntity entity) { - return (List) super.selectList("queryPaymentOAResult",entity); - } - - @DS("#entity.dataSourceCode") - @Override - public Integer updatePaymentOAResult(PaymentEntity entity) { - return super.update("updatePaymentOAResult",entity); - } -} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/impl/PaymentDetailsDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/impl/PaymentDetailsDaoImpl.java deleted file mode 100644 index 05621d63..00000000 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/dao/impl/PaymentDetailsDaoImpl.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.hzya.frame.plugin.oa.payment.dao.impl; - -import com.baomidou.dynamic.datasource.annotation.DS; -import com.hzya.frame.basedao.dao.MybatisGenericDao; -import com.hzya.frame.plugin.oa.payment.dao.IPaymentDetailsDao; -import com.hzya.frame.plugin.oa.payment.entity.PaymentDetailsEntity; - -import java.util.List; - -public class PaymentDetailsDaoImpl extends MybatisGenericDao implements IPaymentDetailsDao { - @DS("#entity.dataSourceCode") - @Override - public List queryPaymentDetails(PaymentDetailsEntity entity) { - return (List) super.selectList("queryPaymentDetails",entity); - } -} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentDetailsEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentDetailsEntity.java deleted file mode 100644 index c5264a34..00000000 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentDetailsEntity.java +++ /dev/null @@ -1,1402 +0,0 @@ -package com.hzya.frame.plugin.oa.payment.entity; - -import com.hzya.frame.web.entity.BaseEntity; - -public class PaymentDetailsEntity extends BaseEntity { - private String pkPayitem;//付款单行标识 - private String settOrg;// 结算财务组织 - private String pkOrg;// 付款财务组织 - private String pkFiorg;// 财务组织 - private String pkPcorg;// 利润中心 - private String puOrg;// 业务组织 - private String puOrgV;//业务组织版本主键 - private String settOrgV;// 结算财务组织版本主键 - private String pkPcorgV;// 利润中心版本主键 - private String pkOrgV;// 付款财务组织版本主键 - private String pkfiorgv;// 财务组织版本主键 - private String pupsndoc;// 业务人员 - private String puDeptid;// 业务部门 - private String puDeptidV;// 业务部门版本 - private String prepay;// 付款性质 - private String material;// 物料 - private String supplier;// 供应商 - private String postunit;// 报价计量单位 - private String postpricenotax;// 报价单位无税单价 - private String postquantity;// 报价单位数量 - private String postprice;// 报价单位含税单价 - private String checkdirection;// 票据方向 - private String coordflag;// 单据协同状态 - private String equipmentcode;// 设备编码 - private String productline ;//产品线 - private String cashitem;// 现金流量项目 - private String payflag;// 支付状态 - private String bankrollprojet;// 资金计划项目 - private String pausetransact ;//挂起标志 - private String billdate;// 单据日期 - private String payman;// 支付人 - private String paydate;// 支付日期 - private String pkGroup;// 所属集团 - private String pkBilltype;// 单据类型编码 - private String billclass;// 单据大类 - private String pkTradetype ;//付款类型code - private String pkTradetypeid;// 付款类型 - private String busidate;// 起算日期 - private String pkSubjcode;// 收支项目 - private String billno;// 单据号 - private String objtype;// 往来对象 - private String rowno;// 单据分录号 - private String rowtype;// 行类型 - private String direction;// 方向 - private String checktype;// 票据类型 - private String pkSsitem;// 事项审批单 - private String scomment ;//摘要 - private String subjcode;// 科目 - private String pkCurrtype ;//币种 - private String rate;// 组织本币汇率 - private String pkDeptid ;//部门 - private String pkDeptidV;// 部 门 - private String pkPsndoc;// 业务员 - private String moneyDe;// 借方原币金额 - private String localMoneyDe;// 组织本币金额(借方) - private String quantityDe;// 借方数量 - private String quantityCr ;//贷方数量 - private String moneyBal ;//原币余额 - private String localMoneyBal;// 组织本币余额 - private String quantityBal;// 数量余额 - private String localTaxDe;// 税额 - private String notaxDe;// 借方原币无税金额 - private String localNotaxDe;// 组织本币无税金额(借方) - private String price ;//单价 - private String taxprice ;//含税单价 - private String taxrate ;//税率 - private String taxnum;// 税号 - private String pkBalatype;// 结算方式 - private String topBillid;// 上层单据主键 - private String topItemid ;//上层单据行主键 - private String topBilltype;// 上层单据类型 - private String topChangets;// 上层单据主表ts - private String topTradetype;// 上层交易类型 - private String srcTradetype;// 源头交易类型 - private String srcBilltype;// 源头单据类型 - private String srcBillid;// 源头单据主键 - private String srcItemid;// 源头单据行主键 - private String pkPayterm;//付款协议 - private String topTermch;// 来源付款协议行 - private String checkno ;//票据号 - private String payaccount;// 付款银行账户 - private String recaccount;// 收款银行账户 - private String cashaccount ;//现金账户 - private String ordercubasdoc;// 订单供应商 - private String innerorderno;// 调拨订单号 - private String assetpactno;// 资产合同号 - private String contractno;// 合同号 - private String freecust;// 散户 - private String facard;// 固定资产卡片号 - private String purchaseorder;// 订单号 - private String invoiceno;// 发票号 - private String outstoreno;// 出库单号 - private String checkelement ;//责任核算要素 - private String grouprate ;//集团本币汇率 - private String globalrate;// 全局本币汇率 - private String groupdebit;// 集团本币金额(借方) - private String globaldebit;// 全局本币金额(借方) - private String groupbalance ;//集团本币余额 - private String globalbalance;// 全局本币余额 - private String groupnotaxDe;// 集团本币无税金额(借方) - private String globalnotaxDe;// 全局本币无税金额(借方) - private String occupationmny ;//预占用核销原币余额 - private String bankrelatedCode;// 对账标识码 - private String project;// 项目 - private String projectTask;// 项目任务 - private String commpaytype ;//承付类型 - private String commpaystatus;// 承付状态 - private String refuseReason;// 拒付理由 - private String agentreceiveprimal;// 托收原币金额 - private String agentreceivelocal;// 托收组织本币 - private String groupagentreceivelocal;// 托收集团本币 - private String globalagentreceivelocal ;//托收全局本币 - private String commpayer ;//承付人 - private String isrefused;// 是否被拒付 - private String localPrice;// 本币单价 - private String localTaxprice;// 本币含税单价 - private String confernum;// 内部交易结算号 - private String costcenter;// 成本中心 - private String customer;// 客户 - private String payreason;// 支付原因 - private String pkPaybill ;//付款单标识 - private String materialSrc;// 原始物料 - private String settlemoney ;//应付金额 - private String settlecurr ;//应付币种 - private String isdiscount;// 是否抵扣金额 - private String comment;// 摘要c - private String pkRecpaytype;// 付款业务类型 - private String isurgent;// 紧急 - private String transerial ;//银行流水号 - private String sendcountryid;// 发货国 - private String vatcode ;//VAT注册码 - private String taxcodeid;// 税码 - private String taxtype ;//扣税类别 - private String buysellflag;// 购销类型 - private String nosubtaxrate;// 不可抵扣税率 - private String nosubtax ;//不可抵扣税额 - private String vendorvatcode ;//供应商VAT注册码 - private String directCheckno ;//直联电票 - private String topChangeitemts ;//上层单据子表ts - private String pkRatetype ;//组织汇率类型 - private String ratedate ;//组织汇率来源日期 - private String customerV ;//客户版本 - private String ordercubasdocV ;//订单供应商版本 - private String supplierV ;//供应商版本 - private String def10;// 自定义项10 - private String def9 ;//自定义项9 - private String def8 ;//自定义项8 - private String def7;// 自定义项7 - private String def6 ;//自定义项6 - private String def5;// 自定义项5 - private String def4 ;//自定义项4 - private String def3 ;//自定义项3 - private String def2 ;//自定义项2 - private String def1;// 自定义项1 - private String formmainId;// OA主表id - - - public String getFormmainId() { - return formmainId; - } - - public void setFormmainId(String formmainId) { - this.formmainId = formmainId; - } - - public String getPkPayitem() { - return pkPayitem; - } - - public void setPkPayitem(String pkPayitem) { - this.pkPayitem = pkPayitem; - } - - public String getSettOrg() { - return settOrg; - } - - public void setSettOrg(String settOrg) { - this.settOrg = settOrg; - } - - public String getPkOrg() { - return pkOrg; - } - - public void setPkOrg(String pkOrg) { - this.pkOrg = pkOrg; - } - - public String getPkFiorg() { - return pkFiorg; - } - - public void setPkFiorg(String pkFiorg) { - this.pkFiorg = pkFiorg; - } - - public String getPkPcorg() { - return pkPcorg; - } - - public void setPkPcorg(String pkPcorg) { - this.pkPcorg = pkPcorg; - } - - public String getPuOrg() { - return puOrg; - } - - public void setPuOrg(String puOrg) { - this.puOrg = puOrg; - } - - public String getPuOrgV() { - return puOrgV; - } - - public void setPuOrgV(String puOrgV) { - this.puOrgV = puOrgV; - } - - public String getSettOrgV() { - return settOrgV; - } - - public void setSettOrgV(String settOrgV) { - this.settOrgV = settOrgV; - } - - public String getPkPcorgV() { - return pkPcorgV; - } - - public void setPkPcorgV(String pkPcorgV) { - this.pkPcorgV = pkPcorgV; - } - - public String getPkOrgV() { - return pkOrgV; - } - - public void setPkOrgV(String pkOrgV) { - this.pkOrgV = pkOrgV; - } - - public String getPkfiorgv() { - return pkfiorgv; - } - - public void setPkfiorgv(String pkfiorgv) { - this.pkfiorgv = pkfiorgv; - } - - public String getPupsndoc() { - return pupsndoc; - } - - public void setPupsndoc(String pupsndoc) { - this.pupsndoc = pupsndoc; - } - - public String getPuDeptid() { - return puDeptid; - } - - public void setPuDeptid(String puDeptid) { - this.puDeptid = puDeptid; - } - - public String getPuDeptidV() { - return puDeptidV; - } - - public void setPuDeptidV(String puDeptidV) { - this.puDeptidV = puDeptidV; - } - - public String getPrepay() { - return prepay; - } - - public void setPrepay(String prepay) { - this.prepay = prepay; - } - - public String getMaterial() { - return material; - } - - public void setMaterial(String material) { - this.material = material; - } - - public String getSupplier() { - return supplier; - } - - public void setSupplier(String supplier) { - this.supplier = supplier; - } - - public String getPostunit() { - return postunit; - } - - public void setPostunit(String postunit) { - this.postunit = postunit; - } - - public String getPostpricenotax() { - return postpricenotax; - } - - public void setPostpricenotax(String postpricenotax) { - this.postpricenotax = postpricenotax; - } - - public String getPostquantity() { - return postquantity; - } - - public void setPostquantity(String postquantity) { - this.postquantity = postquantity; - } - - public String getPostprice() { - return postprice; - } - - public void setPostprice(String postprice) { - this.postprice = postprice; - } - - public String getCheckdirection() { - return checkdirection; - } - - public void setCheckdirection(String checkdirection) { - this.checkdirection = checkdirection; - } - - public String getCoordflag() { - return coordflag; - } - - public void setCoordflag(String coordflag) { - this.coordflag = coordflag; - } - - public String getEquipmentcode() { - return equipmentcode; - } - - public void setEquipmentcode(String equipmentcode) { - this.equipmentcode = equipmentcode; - } - - public String getProductline() { - return productline; - } - - public void setProductline(String productline) { - this.productline = productline; - } - - public String getCashitem() { - return cashitem; - } - - public void setCashitem(String cashitem) { - this.cashitem = cashitem; - } - - public String getPayflag() { - return payflag; - } - - public void setPayflag(String payflag) { - this.payflag = payflag; - } - - public String getBankrollprojet() { - return bankrollprojet; - } - - public void setBankrollprojet(String bankrollprojet) { - this.bankrollprojet = bankrollprojet; - } - - public String getPausetransact() { - return pausetransact; - } - - public void setPausetransact(String pausetransact) { - this.pausetransact = pausetransact; - } - - public String getBilldate() { - return billdate; - } - - public void setBilldate(String billdate) { - this.billdate = billdate; - } - - public String getPayman() { - return payman; - } - - public void setPayman(String payman) { - this.payman = payman; - } - - public String getPaydate() { - return paydate; - } - - public void setPaydate(String paydate) { - this.paydate = paydate; - } - - public String getPkGroup() { - return pkGroup; - } - - public void setPkGroup(String pkGroup) { - this.pkGroup = pkGroup; - } - - public String getPkBilltype() { - return pkBilltype; - } - - public void setPkBilltype(String pkBilltype) { - this.pkBilltype = pkBilltype; - } - - public String getBillclass() { - return billclass; - } - - public void setBillclass(String billclass) { - this.billclass = billclass; - } - - public String getPkTradetype() { - return pkTradetype; - } - - public void setPkTradetype(String pkTradetype) { - this.pkTradetype = pkTradetype; - } - - public String getPkTradetypeid() { - return pkTradetypeid; - } - - public void setPkTradetypeid(String pkTradetypeid) { - this.pkTradetypeid = pkTradetypeid; - } - - public String getBusidate() { - return busidate; - } - - public void setBusidate(String busidate) { - this.busidate = busidate; - } - - public String getPkSubjcode() { - return pkSubjcode; - } - - public void setPkSubjcode(String pkSubjcode) { - this.pkSubjcode = pkSubjcode; - } - - public String getBillno() { - return billno; - } - - public void setBillno(String billno) { - this.billno = billno; - } - - public String getObjtype() { - return objtype; - } - - public void setObjtype(String objtype) { - this.objtype = objtype; - } - - public String getRowno() { - return rowno; - } - - public void setRowno(String rowno) { - this.rowno = rowno; - } - - public String getRowtype() { - return rowtype; - } - - public void setRowtype(String rowtype) { - this.rowtype = rowtype; - } - - public String getDirection() { - return direction; - } - - public void setDirection(String direction) { - this.direction = direction; - } - - public String getChecktype() { - return checktype; - } - - public void setChecktype(String checktype) { - this.checktype = checktype; - } - - public String getPkSsitem() { - return pkSsitem; - } - - public void setPkSsitem(String pkSsitem) { - this.pkSsitem = pkSsitem; - } - - public String getScomment() { - return scomment; - } - - public void setScomment(String scomment) { - this.scomment = scomment; - } - - public String getSubjcode() { - return subjcode; - } - - public void setSubjcode(String subjcode) { - this.subjcode = subjcode; - } - - public String getPkCurrtype() { - return pkCurrtype; - } - - public void setPkCurrtype(String pkCurrtype) { - this.pkCurrtype = pkCurrtype; - } - - public String getRate() { - return rate; - } - - public void setRate(String rate) { - this.rate = rate; - } - - public String getPkDeptid() { - return pkDeptid; - } - - public void setPkDeptid(String pkDeptid) { - this.pkDeptid = pkDeptid; - } - - public String getPkDeptidV() { - return pkDeptidV; - } - - public void setPkDeptidV(String pkDeptidV) { - this.pkDeptidV = pkDeptidV; - } - - public String getPkPsndoc() { - return pkPsndoc; - } - - public void setPkPsndoc(String pkPsndoc) { - this.pkPsndoc = pkPsndoc; - } - - public String getMoneyDe() { - return moneyDe; - } - - public void setMoneyDe(String moneyDe) { - this.moneyDe = moneyDe; - } - - public String getLocalMoneyDe() { - return localMoneyDe; - } - - public void setLocalMoneyDe(String localMoneyDe) { - this.localMoneyDe = localMoneyDe; - } - - public String getQuantityDe() { - return quantityDe; - } - - public void setQuantityDe(String quantityDe) { - this.quantityDe = quantityDe; - } - - public String getQuantityCr() { - return quantityCr; - } - - public void setQuantityCr(String quantityCr) { - this.quantityCr = quantityCr; - } - - public String getMoneyBal() { - return moneyBal; - } - - public void setMoneyBal(String moneyBal) { - this.moneyBal = moneyBal; - } - - public String getLocalMoneyBal() { - return localMoneyBal; - } - - public void setLocalMoneyBal(String localMoneyBal) { - this.localMoneyBal = localMoneyBal; - } - - public String getQuantityBal() { - return quantityBal; - } - - public void setQuantityBal(String quantityBal) { - this.quantityBal = quantityBal; - } - - public String getLocalTaxDe() { - return localTaxDe; - } - - public void setLocalTaxDe(String localTaxDe) { - this.localTaxDe = localTaxDe; - } - - public String getNotaxDe() { - return notaxDe; - } - - public void setNotaxDe(String notaxDe) { - this.notaxDe = notaxDe; - } - - public String getLocalNotaxDe() { - return localNotaxDe; - } - - public void setLocalNotaxDe(String localNotaxDe) { - this.localNotaxDe = localNotaxDe; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - - public String getTaxprice() { - return taxprice; - } - - public void setTaxprice(String taxprice) { - this.taxprice = taxprice; - } - - public String getTaxrate() { - return taxrate; - } - - public void setTaxrate(String taxrate) { - this.taxrate = taxrate; - } - - public String getTaxnum() { - return taxnum; - } - - public void setTaxnum(String taxnum) { - this.taxnum = taxnum; - } - - public String getPkBalatype() { - return pkBalatype; - } - - public void setPkBalatype(String pkBalatype) { - this.pkBalatype = pkBalatype; - } - - public String getTopBillid() { - return topBillid; - } - - public void setTopBillid(String topBillid) { - this.topBillid = topBillid; - } - - public String getTopItemid() { - return topItemid; - } - - public void setTopItemid(String topItemid) { - this.topItemid = topItemid; - } - - public String getTopBilltype() { - return topBilltype; - } - - public void setTopBilltype(String topBilltype) { - this.topBilltype = topBilltype; - } - - public String getTopChangets() { - return topChangets; - } - - public void setTopChangets(String topChangets) { - this.topChangets = topChangets; - } - - public String getTopTradetype() { - return topTradetype; - } - - public void setTopTradetype(String topTradetype) { - this.topTradetype = topTradetype; - } - - public String getSrcTradetype() { - return srcTradetype; - } - - public void setSrcTradetype(String srcTradetype) { - this.srcTradetype = srcTradetype; - } - - public String getSrcBilltype() { - return srcBilltype; - } - - public void setSrcBilltype(String srcBilltype) { - this.srcBilltype = srcBilltype; - } - - public String getSrcBillid() { - return srcBillid; - } - - public void setSrcBillid(String srcBillid) { - this.srcBillid = srcBillid; - } - - public String getSrcItemid() { - return srcItemid; - } - - public void setSrcItemid(String srcItemid) { - this.srcItemid = srcItemid; - } - - public String getPkPayterm() { - return pkPayterm; - } - - public void setPkPayterm(String pkPayterm) { - this.pkPayterm = pkPayterm; - } - - public String getTopTermch() { - return topTermch; - } - - public void setTopTermch(String topTermch) { - this.topTermch = topTermch; - } - - public String getCheckno() { - return checkno; - } - - public void setCheckno(String checkno) { - this.checkno = checkno; - } - - public String getPayaccount() { - return payaccount; - } - - public void setPayaccount(String payaccount) { - this.payaccount = payaccount; - } - - public String getRecaccount() { - return recaccount; - } - - public void setRecaccount(String recaccount) { - this.recaccount = recaccount; - } - - public String getCashaccount() { - return cashaccount; - } - - public void setCashaccount(String cashaccount) { - this.cashaccount = cashaccount; - } - - public String getOrdercubasdoc() { - return ordercubasdoc; - } - - public void setOrdercubasdoc(String ordercubasdoc) { - this.ordercubasdoc = ordercubasdoc; - } - - public String getInnerorderno() { - return innerorderno; - } - - public void setInnerorderno(String innerorderno) { - this.innerorderno = innerorderno; - } - - public String getAssetpactno() { - return assetpactno; - } - - public void setAssetpactno(String assetpactno) { - this.assetpactno = assetpactno; - } - - public String getContractno() { - return contractno; - } - - public void setContractno(String contractno) { - this.contractno = contractno; - } - - public String getFreecust() { - return freecust; - } - - public void setFreecust(String freecust) { - this.freecust = freecust; - } - - public String getFacard() { - return facard; - } - - public void setFacard(String facard) { - this.facard = facard; - } - - public String getPurchaseorder() { - return purchaseorder; - } - - public void setPurchaseorder(String purchaseorder) { - this.purchaseorder = purchaseorder; - } - - public String getInvoiceno() { - return invoiceno; - } - - public void setInvoiceno(String invoiceno) { - this.invoiceno = invoiceno; - } - - public String getOutstoreno() { - return outstoreno; - } - - public void setOutstoreno(String outstoreno) { - this.outstoreno = outstoreno; - } - - public String getCheckelement() { - return checkelement; - } - - public void setCheckelement(String checkelement) { - this.checkelement = checkelement; - } - - public String getGrouprate() { - return grouprate; - } - - public void setGrouprate(String grouprate) { - this.grouprate = grouprate; - } - - public String getGlobalrate() { - return globalrate; - } - - public void setGlobalrate(String globalrate) { - this.globalrate = globalrate; - } - - public String getGroupdebit() { - return groupdebit; - } - - public void setGroupdebit(String groupdebit) { - this.groupdebit = groupdebit; - } - - public String getGlobaldebit() { - return globaldebit; - } - - public void setGlobaldebit(String globaldebit) { - this.globaldebit = globaldebit; - } - - public String getGroupbalance() { - return groupbalance; - } - - public void setGroupbalance(String groupbalance) { - this.groupbalance = groupbalance; - } - - public String getGlobalbalance() { - return globalbalance; - } - - public void setGlobalbalance(String globalbalance) { - this.globalbalance = globalbalance; - } - - public String getGroupnotaxDe() { - return groupnotaxDe; - } - - public void setGroupnotaxDe(String groupnotaxDe) { - this.groupnotaxDe = groupnotaxDe; - } - - public String getGlobalnotaxDe() { - return globalnotaxDe; - } - - public void setGlobalnotaxDe(String globalnotaxDe) { - this.globalnotaxDe = globalnotaxDe; - } - - public String getOccupationmny() { - return occupationmny; - } - - public void setOccupationmny(String occupationmny) { - this.occupationmny = occupationmny; - } - - public String getBankrelatedCode() { - return bankrelatedCode; - } - - public void setBankrelatedCode(String bankrelatedCode) { - this.bankrelatedCode = bankrelatedCode; - } - - public String getProject() { - return project; - } - - public void setProject(String project) { - this.project = project; - } - - public String getProjectTask() { - return projectTask; - } - - public void setProjectTask(String projectTask) { - this.projectTask = projectTask; - } - - public String getCommpaytype() { - return commpaytype; - } - - public void setCommpaytype(String commpaytype) { - this.commpaytype = commpaytype; - } - - public String getCommpaystatus() { - return commpaystatus; - } - - public void setCommpaystatus(String commpaystatus) { - this.commpaystatus = commpaystatus; - } - - public String getRefuseReason() { - return refuseReason; - } - - public void setRefuseReason(String refuseReason) { - this.refuseReason = refuseReason; - } - - public String getAgentreceiveprimal() { - return agentreceiveprimal; - } - - public void setAgentreceiveprimal(String agentreceiveprimal) { - this.agentreceiveprimal = agentreceiveprimal; - } - - public String getAgentreceivelocal() { - return agentreceivelocal; - } - - public void setAgentreceivelocal(String agentreceivelocal) { - this.agentreceivelocal = agentreceivelocal; - } - - public String getGroupagentreceivelocal() { - return groupagentreceivelocal; - } - - public void setGroupagentreceivelocal(String groupagentreceivelocal) { - this.groupagentreceivelocal = groupagentreceivelocal; - } - - public String getGlobalagentreceivelocal() { - return globalagentreceivelocal; - } - - public void setGlobalagentreceivelocal(String globalagentreceivelocal) { - this.globalagentreceivelocal = globalagentreceivelocal; - } - - public String getCommpayer() { - return commpayer; - } - - public void setCommpayer(String commpayer) { - this.commpayer = commpayer; - } - - public String getIsrefused() { - return isrefused; - } - - public void setIsrefused(String isrefused) { - this.isrefused = isrefused; - } - - public String getLocalPrice() { - return localPrice; - } - - public void setLocalPrice(String localPrice) { - this.localPrice = localPrice; - } - - public String getLocalTaxprice() { - return localTaxprice; - } - - public void setLocalTaxprice(String localTaxprice) { - this.localTaxprice = localTaxprice; - } - - public String getConfernum() { - return confernum; - } - - public void setConfernum(String confernum) { - this.confernum = confernum; - } - - public String getCostcenter() { - return costcenter; - } - - public void setCostcenter(String costcenter) { - this.costcenter = costcenter; - } - - public String getCustomer() { - return customer; - } - - public void setCustomer(String customer) { - this.customer = customer; - } - - public String getPayreason() { - return payreason; - } - - public void setPayreason(String payreason) { - this.payreason = payreason; - } - - public String getPkPaybill() { - return pkPaybill; - } - - public void setPkPaybill(String pkPaybill) { - this.pkPaybill = pkPaybill; - } - - public String getMaterialSrc() { - return materialSrc; - } - - public void setMaterialSrc(String materialSrc) { - this.materialSrc = materialSrc; - } - - public String getSettlemoney() { - return settlemoney; - } - - public void setSettlemoney(String settlemoney) { - this.settlemoney = settlemoney; - } - - public String getSettlecurr() { - return settlecurr; - } - - public void setSettlecurr(String settlecurr) { - this.settlecurr = settlecurr; - } - - public String getIsdiscount() { - return isdiscount; - } - - public void setIsdiscount(String isdiscount) { - this.isdiscount = isdiscount; - } - - public String getComment() { - return comment; - } - - public void setComment(String comment) { - this.comment = comment; - } - - public String getPkRecpaytype() { - return pkRecpaytype; - } - - public void setPkRecpaytype(String pkRecpaytype) { - this.pkRecpaytype = pkRecpaytype; - } - - public String getIsurgent() { - return isurgent; - } - - public void setIsurgent(String isurgent) { - this.isurgent = isurgent; - } - - public String getTranserial() { - return transerial; - } - - public void setTranserial(String transerial) { - this.transerial = transerial; - } - - public String getSendcountryid() { - return sendcountryid; - } - - public void setSendcountryid(String sendcountryid) { - this.sendcountryid = sendcountryid; - } - - public String getVatcode() { - return vatcode; - } - - public void setVatcode(String vatcode) { - this.vatcode = vatcode; - } - - public String getTaxcodeid() { - return taxcodeid; - } - - public void setTaxcodeid(String taxcodeid) { - this.taxcodeid = taxcodeid; - } - - public String getTaxtype() { - return taxtype; - } - - public void setTaxtype(String taxtype) { - this.taxtype = taxtype; - } - - public String getBuysellflag() { - return buysellflag; - } - - public void setBuysellflag(String buysellflag) { - this.buysellflag = buysellflag; - } - - public String getNosubtaxrate() { - return nosubtaxrate; - } - - public void setNosubtaxrate(String nosubtaxrate) { - this.nosubtaxrate = nosubtaxrate; - } - - public String getNosubtax() { - return nosubtax; - } - - public void setNosubtax(String nosubtax) { - this.nosubtax = nosubtax; - } - - public String getVendorvatcode() { - return vendorvatcode; - } - - public void setVendorvatcode(String vendorvatcode) { - this.vendorvatcode = vendorvatcode; - } - - public String getDirectCheckno() { - return directCheckno; - } - - public void setDirectCheckno(String directCheckno) { - this.directCheckno = directCheckno; - } - - public String getTopChangeitemts() { - return topChangeitemts; - } - - public void setTopChangeitemts(String topChangeitemts) { - this.topChangeitemts = topChangeitemts; - } - - public String getPkRatetype() { - return pkRatetype; - } - - public void setPkRatetype(String pkRatetype) { - this.pkRatetype = pkRatetype; - } - - public String getRatedate() { - return ratedate; - } - - public void setRatedate(String ratedate) { - this.ratedate = ratedate; - } - - public String getCustomerV() { - return customerV; - } - - public void setCustomerV(String customerV) { - this.customerV = customerV; - } - - public String getOrdercubasdocV() { - return ordercubasdocV; - } - - public void setOrdercubasdocV(String ordercubasdocV) { - this.ordercubasdocV = ordercubasdocV; - } - - public String getSupplierV() { - return supplierV; - } - - public void setSupplierV(String supplierV) { - this.supplierV = supplierV; - } - - public String getDef10() { - return def10; - } - - public void setDef10(String def10) { - this.def10 = def10; - } - - public String getDef9() { - return def9; - } - - public void setDef9(String def9) { - this.def9 = def9; - } - - public String getDef8() { - return def8; - } - - public void setDef8(String def8) { - this.def8 = def8; - } - - public String getDef7() { - return def7; - } - - public void setDef7(String def7) { - this.def7 = def7; - } - - public String getDef6() { - return def6; - } - - public void setDef6(String def6) { - this.def6 = def6; - } - - public String getDef5() { - return def5; - } - - public void setDef5(String def5) { - this.def5 = def5; - } - - public String getDef4() { - return def4; - } - - public void setDef4(String def4) { - this.def4 = def4; - } - - public String getDef3() { - return def3; - } - - public void setDef3(String def3) { - this.def3 = def3; - } - - public String getDef2() { - return def2; - } - - public void setDef2(String def2) { - this.def2 = def2; - } - - public String getDef1() { - return def1; - } - - public void setDef1(String def1) { - this.def1 = def1; - } -} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentDetailsEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentDetailsEntity.xml deleted file mode 100644 index 1df04d35..00000000 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentDetailsEntity.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - - - - - - - - - - - - ,pk_payitem as pkPayitem - ,sett_org as settOrg - ,pk_org as pkOrg - ,pk_fiorg as pkFiorg - ,pu_org as puOrg - ,pu_psndoc as puPsndoc - ,pu_deptid as puDeptid - ,prepay as prepay - ,material as material - ,supplier as supplier - ,checkdirection as checkdirection - ,payflag as payflag - ,pausetransact as pausetransact - ,billdate as billdate - ,payman as payman - ,paydate as paydate - ,pk_billtype as pkBilltype - ,billclass as billclass - ,pk_tradetype as pkTradetype - ,billno as billno - ,objtype as objtype - ,rowno as rowno - ,rowtype as rowtype - ,direction as direction - ,checktype as checktype - ,scomment as scomment - ,pk_currtype as pkcurrtype - ,rate as rate - ,pk_deptid as pkDeptid - ,pk_psndoc as pkPsndoc - ,money_de as moneyDe - ,local_money_de as localMoneyDe - ,quantity_bal as quantityBal - ,local_tax_de as localTaxDe - ,price as price - ,taxprice as taxprice - ,taxrate as taxrate - ,taxnum as taxnum - ,pk_balatype as pkBalatype - ,top_billid as topBillid - ,top_itemid as topItemid - ,checkno as checkno - ,payaccount as payaccount - ,recaccount as recaccount - ,cashaccount as cashaccount - ,contractno as contractno - ,purchaseorder as purchaseorder - ,invoiceno as invoiceno - ,outstoreno as outstoreno - ,project as project - ,groupnotax_de as groupnotaxDe - ,globalnotax_de as globalnotaxDe - ,commpaytype as commpaytype - ,commpaystatus as commpaystatus - ,customer as customer - ,payreason as payreason - ,pk_paybill as pkPaybill - ,comment as comment - ,pk_recpaytype as pkRecpaytype - ,taxcodeid as taxcodeid - ,taxtype as taxtype - ,buysellflag as buysellflag - ,direct_checkno as directCheckno - ,direct_checkno as directCheckno - - - - - - - - - - - diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentEntity.java deleted file mode 100644 index 6409318f..00000000 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentEntity.java +++ /dev/null @@ -1,1098 +0,0 @@ -package com.hzya.frame.plugin.oa.payment.entity; - -import com.hzya.frame.web.entity.BaseEntity; - -public class PaymentEntity extends BaseEntity { - private String pkPaybill;//付款单标识 - private String pkPcorg;//利润中心 - private String pkFiorg;//财务组织 - private String pkOrg;//付款财务组织 - private String settOrg;//结算财务组织 - private String puOrg;//业务组织 - private String puOrgV;//业务组织版本主键 - private String pkFiorgV;//财务组织版本主键 - private String pkPcorgV;//利润中心版本主键 - private String pkOrgV;//付款财务组织版本主键 - private String settOrgV;//结算财务组织版本主键 - private String isreded;//是否红冲过 - private String outbusitype;//外系统业务类型 - private String payman;//支付人 - private String paydate;//支付日期 - private String isonlinepay;//是否网上支付 - private String officialprintuser;//正式打印人 - private String officialprintdate;//正式打印日期 - private String settlenum;//结算号 - private String pkGroup;//所属集团 - private String pkBilltype;//单据类型编码 - private String ismandatepay;//提交资金组织结算 - private String custdelegate;//代垫单位 - private String pkCorp;//单位编码 - private String pkTradetype;//付款类型code - private String pkTradetypeid;//付款类型 - private String billclass;//单据大类 - private String accessorynum;//附件张数 - private String subjcode;//科目 - private String isflowbill;//是否流程单据 - private String confirmuser;//单据确认人 - private String isinit;//期初标志 - private String billno;//单据号 - private String billdate;//单据日期 - private String syscode;//单据所属系统 - private String srcSyscode;//单据来源系统 - private String billstatus;//单据状态 - private String billmaker;//制单人 - private String approver;//审核人 - private String approvedate;//审核时间 - private String signuser;//签字确认人 - private String signyear;//签字确认年度 - private String signperiod;//签字确认期间 - private String signdate;//签字确认日期 - private String pkBusitype;//业务流程 - private String money;//原币金额 - private String localMoney;//组织本币金额 - private String billyear;//单据会计年度 - private String billperiod;//单据会计期间 - private String scomment;//摘要 - private String settleflag;//结算状态 - private String settletype;//结算类型 - private String effectstatus;//生效状态 - private String effectuser;//生效人 - private String effectdate;//生效日期 - - - private String lastapproveid;//最终审批人 - private String bodys;//付款单行 - private String grouplocal;//集团本币金额 - private String globallocal;//全局本币金额 - private String rate;//组织本币汇率 - private String grouprate;//集团本币汇率 - private String globalrate;//全局本币汇率 - private String checkelement;//责任核算要素 - private String puDeptid;//业务部门 - private String puDeptidV;//业务部门版本 - private String puPsndoc;//业务人员 - private String cashitem;//现金流量项目 - private String bankrollprojet;//资金计划项目 - private String pkDeptid;//部门 - private String pkDeptidV;//部 门 - private String pkPsndoc;//业务员 - private String supplier;//供应商 - private String pkCurrtype;//币种 - private String pkSubjcode;//收支项目 - private String pkBalatype;//结算方式 - private String objtype;//往来对象 - private String payaccount;//付款银行账户 - private String recaccount;//收款银行账户 - private String cashaccount;//现金账户 - private String coordflag;//单据协同标志 - private String busidate;//起算日期 - private String isforce;//承付 - private String commpaybegindate;//承付开始日期 - private String commpayenddate;//承付截止日期 - private String approvestatus;//审批状态 - private String approvedated;//审核日期 - private String isfromindependent;//是否独立结算信息 - private String customer;//客户 - private String expectdealdate;//期望处理日 - private String invoiceno;//发票号 - private String consignagreement;//托收协议号 - private String creditorreference;//债权人参考号 - private String sddreversalflag;//直接借记退回标记 - private String reversalreason;//退回原因 - private String ailurereason;//失败原因 - private String payreason;//支付原因 - private String creditrefstd;//贷方引用信息标准 - private String isurgent;//紧急 - private String isrefund;//是否退款 - private String rececountryid;//收货国 - private String taxcountryid;//报税国 - private String sagaFrozen;//冻结状态 - private String pkRatetype;//组织汇率类型 - private String ratedate;//组织汇率来源日期 - private String customerV;//客户版本 - private String supplierV;//供应商版本 - private String def10;//自定义项10 - private String def9;//自定义项9 - private String def8;//自定义项8 - private String def7;//自定义项7 - private String def6;//自定义项6 - private String def5;//自定义项5 - private String def4;//自定义项4 - private String def3;//自定义项3 - private String def2;//自定义项2 - private String modifiedtime;//最后修改时间 - private String creationtime;//创建时间 - private String creator;//创建人 - private String modifier;//最后修改人 - - private String oaResult;//OA支付结果 - private String oaPushStatus;//OA推送状态 - - public String getOaResult() { - return oaResult; - } - - public void setOaResult(String oaResult) { - this.oaResult = oaResult; - } - - public String getOaPushStatus() { - return oaPushStatus; - } - - public void setOaPushStatus(String oaPushStatus) { - this.oaPushStatus = oaPushStatus; - } - - public String getPkPaybill() { - return pkPaybill; - } - - public void setPkPaybill(String pkPaybill) { - this.pkPaybill = pkPaybill; - } - - public String getPkPcorg() { - return pkPcorg; - } - - public void setPkPcorg(String pkPcorg) { - this.pkPcorg = pkPcorg; - } - - public String getPkFiorg() { - return pkFiorg; - } - - public void setPkFiorg(String pkFiorg) { - this.pkFiorg = pkFiorg; - } - - public String getPkOrg() { - return pkOrg; - } - - public void setPkOrg(String pkOrg) { - this.pkOrg = pkOrg; - } - - public String getSettOrg() { - return settOrg; - } - - public void setSettOrg(String settOrg) { - this.settOrg = settOrg; - } - - public String getPuOrg() { - return puOrg; - } - - public void setPuOrg(String puOrg) { - this.puOrg = puOrg; - } - - public String getPuOrgV() { - return puOrgV; - } - - public void setPuOrgV(String puOrgV) { - this.puOrgV = puOrgV; - } - - public String getPkFiorgV() { - return pkFiorgV; - } - - public void setPkFiorgV(String pkFiorgV) { - this.pkFiorgV = pkFiorgV; - } - - public String getPkPcorgV() { - return pkPcorgV; - } - - public void setPkPcorgV(String pkPcorgV) { - this.pkPcorgV = pkPcorgV; - } - - public String getPkOrgV() { - return pkOrgV; - } - - public void setPkOrgV(String pkOrgV) { - this.pkOrgV = pkOrgV; - } - - public String getSettOrgV() { - return settOrgV; - } - - public void setSettOrgV(String settOrgV) { - this.settOrgV = settOrgV; - } - - public String getIsreded() { - return isreded; - } - - public void setIsreded(String isreded) { - this.isreded = isreded; - } - - public String getOutbusitype() { - return outbusitype; - } - - public void setOutbusitype(String outbusitype) { - this.outbusitype = outbusitype; - } - - public String getPayman() { - return payman; - } - - public void setPayman(String payman) { - this.payman = payman; - } - - public String getPaydate() { - return paydate; - } - - public void setPaydate(String paydate) { - this.paydate = paydate; - } - - public String getIsonlinepay() { - return isonlinepay; - } - - public void setIsonlinepay(String isonlinepay) { - this.isonlinepay = isonlinepay; - } - - public String getOfficialprintuser() { - return officialprintuser; - } - - public void setOfficialprintuser(String officialprintuser) { - this.officialprintuser = officialprintuser; - } - - public String getOfficialprintdate() { - return officialprintdate; - } - - public void setOfficialprintdate(String officialprintdate) { - this.officialprintdate = officialprintdate; - } - - public String getSettlenum() { - return settlenum; - } - - public void setSettlenum(String settlenum) { - this.settlenum = settlenum; - } - - public String getPkGroup() { - return pkGroup; - } - - public void setPkGroup(String pkGroup) { - this.pkGroup = pkGroup; - } - - public String getPkBilltype() { - return pkBilltype; - } - - public void setPkBilltype(String pkBilltype) { - this.pkBilltype = pkBilltype; - } - - public String getIsmandatepay() { - return ismandatepay; - } - - public void setIsmandatepay(String ismandatepay) { - this.ismandatepay = ismandatepay; - } - - public String getCustdelegate() { - return custdelegate; - } - - public void setCustdelegate(String custdelegate) { - this.custdelegate = custdelegate; - } - - public String getPkCorp() { - return pkCorp; - } - - public void setPkCorp(String pkCorp) { - this.pkCorp = pkCorp; - } - - public String getPkTradetype() { - return pkTradetype; - } - - public void setPkTradetype(String pkTradetype) { - this.pkTradetype = pkTradetype; - } - - public String getPkTradetypeid() { - return pkTradetypeid; - } - - public void setPkTradetypeid(String pkTradetypeid) { - this.pkTradetypeid = pkTradetypeid; - } - - public String getBillclass() { - return billclass; - } - - public void setBillclass(String billclass) { - this.billclass = billclass; - } - - public String getAccessorynum() { - return accessorynum; - } - - public void setAccessorynum(String accessorynum) { - this.accessorynum = accessorynum; - } - - public String getSubjcode() { - return subjcode; - } - - public void setSubjcode(String subjcode) { - this.subjcode = subjcode; - } - - public String getIsflowbill() { - return isflowbill; - } - - public void setIsflowbill(String isflowbill) { - this.isflowbill = isflowbill; - } - - public String getConfirmuser() { - return confirmuser; - } - - public void setConfirmuser(String confirmuser) { - this.confirmuser = confirmuser; - } - - public String getIsinit() { - return isinit; - } - - public void setIsinit(String isinit) { - this.isinit = isinit; - } - - public String getBillno() { - return billno; - } - - public void setBillno(String billno) { - this.billno = billno; - } - - public String getBilldate() { - return billdate; - } - - public void setBilldate(String billdate) { - this.billdate = billdate; - } - - public String getSyscode() { - return syscode; - } - - public void setSyscode(String syscode) { - this.syscode = syscode; - } - - public String getSrcSyscode() { - return srcSyscode; - } - - public void setSrcSyscode(String srcSyscode) { - this.srcSyscode = srcSyscode; - } - - public String getBillstatus() { - return billstatus; - } - - public void setBillstatus(String billstatus) { - this.billstatus = billstatus; - } - - public String getBillmaker() { - return billmaker; - } - - public void setBillmaker(String billmaker) { - this.billmaker = billmaker; - } - - public String getApprover() { - return approver; - } - - public void setApprover(String approver) { - this.approver = approver; - } - - public String getApprovedate() { - return approvedate; - } - - public void setApprovedate(String approvedate) { - this.approvedate = approvedate; - } - - public String getSignuser() { - return signuser; - } - - public void setSignuser(String signuser) { - this.signuser = signuser; - } - - public String getSignyear() { - return signyear; - } - - public void setSignyear(String signyear) { - this.signyear = signyear; - } - - public String getSignperiod() { - return signperiod; - } - - public void setSignperiod(String signperiod) { - this.signperiod = signperiod; - } - - public String getSigndate() { - return signdate; - } - - public void setSigndate(String signdate) { - this.signdate = signdate; - } - - public String getPkBusitype() { - return pkBusitype; - } - - public void setPkBusitype(String pkBusitype) { - this.pkBusitype = pkBusitype; - } - - public String getMoney() { - return money; - } - - public void setMoney(String money) { - this.money = money; - } - - public String getLocalMoney() { - return localMoney; - } - - public void setLocalMoney(String localMoney) { - this.localMoney = localMoney; - } - - public String getBillyear() { - return billyear; - } - - public void setBillyear(String billyear) { - this.billyear = billyear; - } - - public String getBillperiod() { - return billperiod; - } - - public void setBillperiod(String billperiod) { - this.billperiod = billperiod; - } - - public String getScomment() { - return scomment; - } - - public void setScomment(String scomment) { - this.scomment = scomment; - } - - public String getSettleflag() { - return settleflag; - } - - public void setSettleflag(String settleflag) { - this.settleflag = settleflag; - } - - public String getSettletype() { - return settletype; - } - - public void setSettletype(String settletype) { - this.settletype = settletype; - } - - public String getEffectstatus() { - return effectstatus; - } - - public void setEffectstatus(String effectstatus) { - this.effectstatus = effectstatus; - } - - public String getEffectuser() { - return effectuser; - } - - public void setEffectuser(String effectuser) { - this.effectuser = effectuser; - } - - public String getEffectdate() { - return effectdate; - } - - public void setEffectdate(String effectdate) { - this.effectdate = effectdate; - } - - public String getLastapproveid() { - return lastapproveid; - } - - public void setLastapproveid(String lastapproveid) { - this.lastapproveid = lastapproveid; - } - - public String getBodys() { - return bodys; - } - - public void setBodys(String bodys) { - this.bodys = bodys; - } - - public String getGrouplocal() { - return grouplocal; - } - - public void setGrouplocal(String grouplocal) { - this.grouplocal = grouplocal; - } - - public String getGloballocal() { - return globallocal; - } - - public void setGloballocal(String globallocal) { - this.globallocal = globallocal; - } - - public String getRate() { - return rate; - } - - public void setRate(String rate) { - this.rate = rate; - } - - public String getGrouprate() { - return grouprate; - } - - public void setGrouprate(String grouprate) { - this.grouprate = grouprate; - } - - public String getGlobalrate() { - return globalrate; - } - - public void setGlobalrate(String globalrate) { - this.globalrate = globalrate; - } - - public String getCheckelement() { - return checkelement; - } - - public void setCheckelement(String checkelement) { - this.checkelement = checkelement; - } - - public String getPuDeptid() { - return puDeptid; - } - - public void setPuDeptid(String puDeptid) { - this.puDeptid = puDeptid; - } - - public String getPuDeptidV() { - return puDeptidV; - } - - public void setPuDeptidV(String puDeptidV) { - this.puDeptidV = puDeptidV; - } - - public String getPuPsndoc() { - return puPsndoc; - } - - public void setPuPsndoc(String puPsndoc) { - this.puPsndoc = puPsndoc; - } - - public String getCashitem() { - return cashitem; - } - - public void setCashitem(String cashitem) { - this.cashitem = cashitem; - } - - public String getBankrollprojet() { - return bankrollprojet; - } - - public void setBankrollprojet(String bankrollprojet) { - this.bankrollprojet = bankrollprojet; - } - - public String getPkDeptid() { - return pkDeptid; - } - - public void setPkDeptid(String pkDeptid) { - this.pkDeptid = pkDeptid; - } - - public String getPkDeptidV() { - return pkDeptidV; - } - - public void setPkDeptidV(String pkDeptidV) { - this.pkDeptidV = pkDeptidV; - } - - public String getPkPsndoc() { - return pkPsndoc; - } - - public void setPkPsndoc(String pkPsndoc) { - this.pkPsndoc = pkPsndoc; - } - - public String getSupplier() { - return supplier; - } - - public void setSupplier(String supplier) { - this.supplier = supplier; - } - - public String getPkCurrtype() { - return pkCurrtype; - } - - public void setPkCurrtype(String pkCurrtype) { - this.pkCurrtype = pkCurrtype; - } - - public String getPkSubjcode() { - return pkSubjcode; - } - - public void setPkSubjcode(String pkSubjcode) { - this.pkSubjcode = pkSubjcode; - } - - public String getPkBalatype() { - return pkBalatype; - } - - public void setPkBalatype(String pkBalatype) { - this.pkBalatype = pkBalatype; - } - - public String getObjtype() { - return objtype; - } - - public void setObjtype(String objtype) { - this.objtype = objtype; - } - - public String getPayaccount() { - return payaccount; - } - - public void setPayaccount(String payaccount) { - this.payaccount = payaccount; - } - - public String getRecaccount() { - return recaccount; - } - - public void setRecaccount(String recaccount) { - this.recaccount = recaccount; - } - - public String getCashaccount() { - return cashaccount; - } - - public void setCashaccount(String cashaccount) { - this.cashaccount = cashaccount; - } - - public String getCoordflag() { - return coordflag; - } - - public void setCoordflag(String coordflag) { - this.coordflag = coordflag; - } - - public String getBusidate() { - return busidate; - } - - public void setBusidate(String busidate) { - this.busidate = busidate; - } - - public String getIsforce() { - return isforce; - } - - public void setIsforce(String isforce) { - this.isforce = isforce; - } - - public String getCommpaybegindate() { - return commpaybegindate; - } - - public void setCommpaybegindate(String commpaybegindate) { - this.commpaybegindate = commpaybegindate; - } - - public String getCommpayenddate() { - return commpayenddate; - } - - public void setCommpayenddate(String commpayenddate) { - this.commpayenddate = commpayenddate; - } - - public String getApprovestatus() { - return approvestatus; - } - - public void setApprovestatus(String approvestatus) { - this.approvestatus = approvestatus; - } - - public String getApprovedated() { - return approvedated; - } - - public void setApprovedated(String approvedated) { - this.approvedated = approvedated; - } - - public String getIsfromindependent() { - return isfromindependent; - } - - public void setIsfromindependent(String isfromindependent) { - this.isfromindependent = isfromindependent; - } - - public String getCustomer() { - return customer; - } - - public void setCustomer(String customer) { - this.customer = customer; - } - - public String getExpectdealdate() { - return expectdealdate; - } - - public void setExpectdealdate(String expectdealdate) { - this.expectdealdate = expectdealdate; - } - - public String getInvoiceno() { - return invoiceno; - } - - public void setInvoiceno(String invoiceno) { - this.invoiceno = invoiceno; - } - - public String getConsignagreement() { - return consignagreement; - } - - public void setConsignagreement(String consignagreement) { - this.consignagreement = consignagreement; - } - - public String getCreditorreference() { - return creditorreference; - } - - public void setCreditorreference(String creditorreference) { - this.creditorreference = creditorreference; - } - - public String getSddreversalflag() { - return sddreversalflag; - } - - public void setSddreversalflag(String sddreversalflag) { - this.sddreversalflag = sddreversalflag; - } - - public String getReversalreason() { - return reversalreason; - } - - public void setReversalreason(String reversalreason) { - this.reversalreason = reversalreason; - } - - public String getAilurereason() { - return ailurereason; - } - - public void setAilurereason(String ailurereason) { - this.ailurereason = ailurereason; - } - - public String getPayreason() { - return payreason; - } - - public void setPayreason(String payreason) { - this.payreason = payreason; - } - - public String getCreditrefstd() { - return creditrefstd; - } - - public void setCreditrefstd(String creditrefstd) { - this.creditrefstd = creditrefstd; - } - - public String getIsurgent() { - return isurgent; - } - - public void setIsurgent(String isurgent) { - this.isurgent = isurgent; - } - - public String getIsrefund() { - return isrefund; - } - - public void setIsrefund(String isrefund) { - this.isrefund = isrefund; - } - - public String getRececountryid() { - return rececountryid; - } - - public void setRececountryid(String rececountryid) { - this.rececountryid = rececountryid; - } - - public String getTaxcountryid() { - return taxcountryid; - } - - public void setTaxcountryid(String taxcountryid) { - this.taxcountryid = taxcountryid; - } - - public String getSagaFrozen() { - return sagaFrozen; - } - - public void setSagaFrozen(String sagaFrozen) { - this.sagaFrozen = sagaFrozen; - } - - public String getPkRatetype() { - return pkRatetype; - } - - public void setPkRatetype(String pkRatetype) { - this.pkRatetype = pkRatetype; - } - - public String getRatedate() { - return ratedate; - } - - public void setRatedate(String ratedate) { - this.ratedate = ratedate; - } - - public String getCustomerV() { - return customerV; - } - - public void setCustomerV(String customerV) { - this.customerV = customerV; - } - - public String getSupplierV() { - return supplierV; - } - - public void setSupplierV(String supplierV) { - this.supplierV = supplierV; - } - - public String getDef10() { - return def10; - } - - public void setDef10(String def10) { - this.def10 = def10; - } - - public String getDef9() { - return def9; - } - - public void setDef9(String def9) { - this.def9 = def9; - } - - public String getDef8() { - return def8; - } - - public void setDef8(String def8) { - this.def8 = def8; - } - - public String getDef7() { - return def7; - } - - public void setDef7(String def7) { - this.def7 = def7; - } - - public String getDef6() { - return def6; - } - - public void setDef6(String def6) { - this.def6 = def6; - } - - public String getDef5() { - return def5; - } - - public void setDef5(String def5) { - this.def5 = def5; - } - - public String getDef4() { - return def4; - } - - public void setDef4(String def4) { - this.def4 = def4; - } - - public String getDef3() { - return def3; - } - - public void setDef3(String def3) { - this.def3 = def3; - } - - public String getDef2() { - return def2; - } - - public void setDef2(String def2) { - this.def2 = def2; - } - - public String getModifiedtime() { - return modifiedtime; - } - - public void setModifiedtime(String modifiedtime) { - this.modifiedtime = modifiedtime; - } - - public String getCreationtime() { - return creationtime; - } - - public void setCreationtime(String creationtime) { - this.creationtime = creationtime; - } - - public String getCreator() { - return creator; - } - - public void setCreator(String creator) { - this.creator = creator; - } - - public String getModifier() { - return modifier; - } - - public void setModifier(String modifier) { - this.modifier = modifier; - } -} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentEntity.xml deleted file mode 100644 index 8aa114cb..00000000 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/entity/PaymentEntity.xml +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - - - - - - - - - - pk_org as pkOrg - ,isreded as isreded - ,pk_paybill as pkPaybill - ,pk_fiorg as pkFiorg - ,pu_org as puOrg - ,pk_group as pkGroup - ,pk_billtype as pkBilltype - ,pk_corp as pkCorp - ,pk_tradetype as pkTradetype - ,billclass as billclass - ,pk_tradetypeid as pkTradetypeid - ,billno as billno - ,billdate as billdate - ,syscode as syscode - ,src_syscode as srcSyscode - ,billstatus as billstatus - ,billmaker as billmaker - ,approver as approver - ,approvedate as approvedate - ,pk_busitype as pkBusitype - ,money as money - ,local_money as localMoney - ,scomment as scomment - ,settleflag as settleflag - ,settletype as settletype - ,effectstatus as effectstatus - ,pu_deptid as puDeptid - ,pu_psndoc as puPsndoc - ,pk_deptid as pkDeptid - ,pk_psndoc as pkPsndoc - ,supplier as supplier - ,pk_currtype as pkCurrtype - ,pk_subjcode as pkSubjcode - ,pk_balatype as pkBalatype - ,objtype as objtype - ,payaccount as payaccount - ,recaccount as recaccount - ,cashaccount as cashaccount - ,approvestatus as approvestatus - ,customer as customer - ,invoiceno as invoiceno - ,reversalreason as reversalreason - ,failurereason as failurereason - ,payreason as payreason - ,modifiedtime as modifiedtime - ,creationtime as creationtime - ,creator as creator - ,modifier as modifier - - - - - - - - - - - - - - update formmain_0260 set xxx =#{oaResult} where id=#{id} - - - - diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/CbsResultToOAPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/CbsResultToOAPluginInitializer.java deleted file mode 100644 index f5fd2665..00000000 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/CbsResultToOAPluginInitializer.java +++ /dev/null @@ -1,145 +0,0 @@ -package com.hzya.frame.plugin.oa.payment.plugin; - -import cn.hutool.core.util.StrUtil; -import cn.hutool.http.HttpRequest; -import com.alibaba.fastjson.JSONObject; -import com.hzya.frame.base.PluginBaseEntity; -import com.hzya.frame.plugin.oa.payment.dao.IPaymentDao; -import com.hzya.frame.plugin.oa.payment.dao.IPaymentDetailsDao; -import com.hzya.frame.plugin.oa.payment.entity.PaymentDetailsEntity; -import com.hzya.frame.plugin.oa.payment.entity.PaymentEntity; -import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; -import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; -import com.hzya.frame.uuid.UUIDUtils; -import com.hzya.frame.web.entity.BaseResult; -import com.hzya.frame.web.entity.JsonResultEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; - -import java.util.Date; -import java.util.List; - -public class CbsResultToOAPluginInitializer extends PluginBaseEntity { - Logger logger = LoggerFactory.getLogger(CbsResultToOAPluginInitializer.class); - - @Autowired - private IPaymentDao paymentDao; - @Autowired - private IPaymentDetailsDao paymentDetailsDao; - - @Value("${zt.url}") - private String url; - - @Autowired - private IIntegrationTaskLivingDetailsService taskLivingDetailsService; - - - @Override - public void initialize() { - logger.info(getPluginLabel() + "執行初始化方法initialize()"); - } - - @Override - public void destroy() { - logger.info(getPluginLabel() + "執行銷毀方法destroy()"); - } - - @Override - public String getPluginId() { - return "CbsResultToOAPluginInitializer"; - } - - @Override - public String getPluginName() { - return "CBS支付结果回写OA"; - } - - @Override - public String getPluginLabel() { - return "CbsResultToOAPluginInitializer"; - } - - @Override - public String getPluginType() { - return "1"; - } - @Override - public JsonResultEntity executeBusiness(JSONObject requestJson) { - try { - logger.info("======开始执行CBS支付结果回写OA========"); - //重试方法 - if (null != requestJson) { - //如果这个id不为空,说明是重试的 - String id = requestJson.getString("integration_task_living_details_id"); - //执行重新发送 - PaymentEntity paymentEntity = new PaymentEntity(); - paymentEntity.setDataSourceCode(""); - if (StrUtil.isNotEmpty(id)) { - paymentEntity.setId(id); - } - //查询没有支付成功的数据 - List paymentEntities = paymentDao.queryPaymentOAResult(paymentEntity); - if(paymentEntities == null || paymentEntities.size() == 0){ - logger.info("=====OA中没有需要查询支付状态的数据=========="); - return BaseResult.getSuccessMessageEntity("查询成功"); - } - for (PaymentEntity payment : paymentEntities) { - payment.setDataSourceCode(""); - JSONObject jsonObject=new JSONObject(); - - - String result = HttpRequest.post(url). - header("appId", ""). - header("apiCode", ""). - header("publicKey", "ZJYAQ/VtQ66PqKXlV0EowrrlKkhBHYgS/Zk39Q5ezIQne51Ce7eDIk+3zDUT+v578prj"). - header("secretKey", "iLLk424Bmzknbu+ROeJoiVDMYY5EFXtbZY/aU13HmVYIiQrIw9c0Ag4ipxbfpUqqj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). - body(jsonObject.toString()). - execute(). - body(); - logger.info("========CBS支付结果回写OA的返回参数为:{}=========",result); - JSONObject resultJson = JSONObject.parseObject(result); - if(!resultJson.getBoolean("flag")){ - JSONObject attribute = resultJson.getJSONObject("attribute"); - if("".equals(attribute.getString(""))){ - //修改oa付款单支付状态 - payment.setOaResult(""); - paymentDao.updatePaymentOAResult(payment); - } - } - } - } - }catch(Exception e){ - logger.info("======执行CBS支付结果回写OA失败:{}========", e.getMessage()); - e.printStackTrace(); - } - return BaseResult.getFailureMessageEntity("CBS支付结果回写OA执行失败"); - } - - private void saveTaskLivingDetails(String rootAppPk,String rootAppBill,String rootAppNewData,String newTransmitInfo,boolean flag) { - try { - IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); - integrationTaskLivingDetailsEntity.setId(UUIDUtils.getUUID()); - integrationTaskLivingDetailsEntity.setSts("Y"); - integrationTaskLivingDetailsEntity.setCreate_user_id("1"); - integrationTaskLivingDetailsEntity.setModify_user_id("1"); - integrationTaskLivingDetailsEntity.setCreate_time(new Date()); - integrationTaskLivingDetailsEntity.setModify_time(new Date()); - integrationTaskLivingDetailsEntity.setOrg_id("0"); - integrationTaskLivingDetailsEntity.setCompanyId("0"); - integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk); - integrationTaskLivingDetailsEntity.setRootAppBill(rootAppBill); - integrationTaskLivingDetailsEntity.setPluginId("CbsResultToOAPluginInitializer"); - integrationTaskLivingDetailsEntity.setRootAppNewData(rootAppNewData); - integrationTaskLivingDetailsEntity.setNewTransmitInfo(newTransmitInfo); - if(flag){ - taskLivingDetailsService.saveLogToSuccess(integrationTaskLivingDetailsEntity); - }else { - taskLivingDetailsService.saveLogToFail(integrationTaskLivingDetailsEntity); - } - }catch (Exception e){ - logger.info("保存日志到集成任务日志明细中失败:{}",e.getMessage()); - } - } -} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/OAApprovedToCbsPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/OAApprovedToCbsPluginInitializer.java deleted file mode 100644 index 9a9bb8c7..00000000 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/OAApprovedToCbsPluginInitializer.java +++ /dev/null @@ -1,155 +0,0 @@ -package com.hzya.frame.plugin.oa.payment.plugin; - -import cn.hutool.core.util.StrUtil; -import cn.hutool.http.HttpRequest; -import com.alibaba.fastjson.JSONObject; -import com.hzya.frame.base.PluginBaseEntity; -import com.hzya.frame.plugin.oa.payment.dao.IPaymentDao; -import com.hzya.frame.plugin.oa.payment.dao.IPaymentDetailsDao; -import com.hzya.frame.plugin.oa.payment.entity.PaymentDetailsEntity; -import com.hzya.frame.plugin.oa.payment.entity.PaymentEntity; -import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; -import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; -import com.hzya.frame.uuid.UUIDUtils; -import com.hzya.frame.web.entity.BaseResult; -import com.hzya.frame.web.entity.JsonResultEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; - -import java.util.Date; -import java.util.List; - -public class OAApprovedToCbsPluginInitializer extends PluginBaseEntity { - Logger logger = LoggerFactory.getLogger(PaymentToOAPluginInitializer.class); - - @Autowired - private IPaymentDao paymentDao; - @Autowired - private IPaymentDetailsDao paymentDetailsDao; - - @Value("${zt.url}") - private String url; - - @Autowired - private IIntegrationTaskLivingDetailsService taskLivingDetailsService; - - - @Override - public void initialize() { - logger.info(getPluginLabel() + "執行初始化方法initialize()"); - } - - @Override - public void destroy() { - logger.info(getPluginLabel() + "執行銷毀方法destroy()"); - } - - @Override - public String getPluginId() { - return "OAApprovedToCbsPluginInitializer"; - } - - @Override - public String getPluginName() { - return "OA已审批单据传递CBS"; - } - - @Override - public String getPluginLabel() { - return "OAApprovedToCbsPluginInitializer"; - } - - @Override - public String getPluginType() { - return "1"; - } - @Override - public JsonResultEntity executeBusiness(JSONObject requestJson) { - try { - logger.info("======开始执行OA审批完成单据推送CBS========"); - //重试方法 - if (null != requestJson) { - //如果这个id不为空,说明是重试的 - String id = requestJson.getString("integration_task_living_details_id"); - //执行重新发送 - PaymentEntity paymentEntity = new PaymentEntity(); - paymentEntity.setDataSourceCode(""); - if (StrUtil.isNotEmpty(id)) { - paymentEntity.setId(id); - } - //查询OA审批完成单据推送CBS的数据 - List paymentEntities = paymentDao.queryPaymentOAToCbs(paymentEntity); - if(paymentEntities == null || paymentEntities.size() == 0){ - logger.info("=====OA中没有已审批完成需要推送CBS的单据=========="); - return BaseResult.getSuccessMessageEntity("查询成功"); - } - for (PaymentEntity payment : paymentEntities) { - JSONObject jsonObject=new JSONObject(); - - //查询OA明细数据 - PaymentDetailsEntity paymentDetailsEntity=new PaymentDetailsEntity(); - paymentDetailsEntity.setDataSourceCode(""); - paymentDetailsEntity.setFormmainId(payment.getId()); - List paymentDetailsEntities = paymentDetailsDao.queryPaymentDetails(paymentDetailsEntity); - if(paymentDetailsEntities == null || paymentDetailsEntities.size() == 0){ - logger.info("=====没有需要从OA传递CBS的明细数据=========="); - }else{ - for (PaymentDetailsEntity detailsEntity : paymentDetailsEntities) { - - } - } - - - String result = HttpRequest.post(url). - header("appId", ""). - header("apiCode", ""). - header("publicKey", "ZJYAQ/VtQ66PqKXlV0EowrrlKkhBHYgS/Zk39Q5ezIQne51Ce7eDIk+3zDUT+v578prj"). - header("secretKey", "iLLk424Bmzknbu+ROeJoiVDMYY5EFXtbZY/aU13HmVYIiQrIw9c0Ag4ipxbfpUqqj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). - body(jsonObject.toString()). - execute(). - body(); - logger.info("========OA审批完成单据推送CBS的返回参数为:{}=========",result); - JSONObject resultJson = JSONObject.parseObject(result); - if(!resultJson.getBoolean("flag")){ - JSONObject attribute = resultJson.getJSONObject("attribute"); - if("".equals(attribute.getString(""))){ - //修改oa付款单推送状态 - } - } - } - } - }catch(Exception e){ - logger.info("======执行OA审批完成单据推送CBS失败:{}========", e.getMessage()); - e.printStackTrace(); - } - return BaseResult.getFailureMessageEntity("OA审批完成单据推送CBS执行失败"); - } - - private void saveTaskLivingDetails(String rootAppPk,String rootAppBill,String rootAppNewData,String newTransmitInfo,boolean flag) { - try { - IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); - integrationTaskLivingDetailsEntity.setId(UUIDUtils.getUUID()); - integrationTaskLivingDetailsEntity.setSts("Y"); - integrationTaskLivingDetailsEntity.setCreate_user_id("1"); - integrationTaskLivingDetailsEntity.setModify_user_id("1"); - integrationTaskLivingDetailsEntity.setCreate_time(new Date()); - integrationTaskLivingDetailsEntity.setModify_time(new Date()); - integrationTaskLivingDetailsEntity.setOrg_id("0"); - integrationTaskLivingDetailsEntity.setCompanyId("0"); - integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk); - integrationTaskLivingDetailsEntity.setRootAppBill(rootAppBill); - integrationTaskLivingDetailsEntity.setPluginId("OAApprovedToCbsPluginInitializer"); - integrationTaskLivingDetailsEntity.setRootAppNewData(rootAppNewData); - integrationTaskLivingDetailsEntity.setNewTransmitInfo(newTransmitInfo); - if(flag){ - taskLivingDetailsService.saveLogToSuccess(integrationTaskLivingDetailsEntity); - }else { - taskLivingDetailsService.saveLogToFail(integrationTaskLivingDetailsEntity); - } - }catch (Exception e){ - logger.info("保存日志到集成任务日志明细中失败:{}",e.getMessage()); - } - } -} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/PayResultPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/PayResultPluginInitializer.java new file mode 100644 index 00000000..a3a24a08 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/PayResultPluginInitializer.java @@ -0,0 +1,102 @@ +package com.hzya.frame.plugin.oa.payment.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.oa.payment.service.IPaymentPluginService; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @Description 查询交易结果 + * @Author xiangerlin + * @Date 2025/5/29 17:19 + **/ +public class PayResultPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(PayResultPluginInitializer.class); + @Autowired + private IPaymentPluginService paymentPluginService; + /*** + * 插件初始化方法 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 10:48 + * @Param [] + * @return void + **/ + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + /**** + * 插件销毁方法 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + /**** + * 插件的ID + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginId() { + return "PayResultPlugin"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "查询CBS交易结果"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "查询CBS交易结果"; + } + + /*** + * 插件类型 1、场景插件 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 14:01 + * @Param [] + * @return java.lang.String + **/ + @Override + public String getPluginType() { + return "0"; + } + + /*** + * 执行业务代码 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-07 11:20 + * @param requestJson 执行业务代码的参数 + * @return void + **/ + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + logger.info("======开始查询CBS交易结果======"); + paymentPluginService.payRequest(requestJson); + return BaseResult.getSuccessMessageEntity("执行成功"); + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/PaymentRequestPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/PaymentRequestPluginInitializer.java new file mode 100644 index 00000000..2ba565fb --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/PaymentRequestPluginInitializer.java @@ -0,0 +1,107 @@ +package com.hzya.frame.plugin.oa.payment.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.oa.payment.service.IPaymentPluginService; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @Description 支付申请 + * @Author xiangerlin + * @Date 2025/5/29 15:40 + **/ +public class PaymentRequestPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(PaymentRequestPluginInitializer.class); + @Autowired + private IPaymentPluginService paymentPluginService; + /*** + * 插件初始化方法 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 10:48 + * @Param [] + * @return void + **/ + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + /**** + * 插件销毁方法 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + /**** + * 插件的ID + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginId() { + return "PaymentRequestPlugin"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "OA支付申请CBS插件"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "OA支付申请CBS插件"; + } + + /*** + * 插件类型 1、场景插件 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 14:01 + * @Param [] + * @return java.lang.String + **/ + @Override + public String getPluginType() { + return "1"; + } + + /*** + * 执行业务代码 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-07 11:20 + * @param requestJson 执行业务代码的参数 + * @return void + **/ + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + try { + logger.info("======开始执行OA支付申请CBS插件======"); + JsonResultEntity jsonResultEntity = paymentPluginService.payRequest(requestJson); + return BaseResult.getSuccessMessageEntity("OA支付申请CBS插件执行成功",jsonResultEntity); + }catch (Exception e){ + logger.info("======执行OA支付申请CBS插件出错======{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("OA支付申请CBS插件执行失败",e.getMessage()); + } + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/PaymentToOAPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/PaymentToOAPluginInitializer.java deleted file mode 100644 index 22d06e54..00000000 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/plugin/PaymentToOAPluginInitializer.java +++ /dev/null @@ -1,222 +0,0 @@ -package com.hzya.frame.plugin.oa.payment.plugin; - -import cn.hutool.core.util.StrUtil; -import cn.hutool.http.HttpRequest; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.hzya.frame.base.PluginBaseEntity; -import com.hzya.frame.plugin.oa.payment.dao.IPaymentDao; -import com.hzya.frame.plugin.oa.payment.dao.IPaymentDetailsDao; -import com.hzya.frame.plugin.oa.payment.entity.PaymentDetailsEntity; -import com.hzya.frame.plugin.oa.payment.entity.PaymentEntity; -import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; -import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; -import com.hzya.frame.uuid.UUIDUtils; -import com.hzya.frame.web.entity.BaseResult; -import com.hzya.frame.web.entity.JsonResultEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class PaymentToOAPluginInitializer extends PluginBaseEntity { - Logger logger = LoggerFactory.getLogger(PaymentToOAPluginInitializer.class); - - @Autowired - private IPaymentDao paymentDao; - @Autowired - private IPaymentDetailsDao paymentDetailsDao; - - @Value("${zt.url}") - private String url; - - @Autowired - private IIntegrationTaskLivingDetailsService taskLivingDetailsService; - - - @Override - public void initialize() { - logger.info(getPluginLabel() + "執行初始化方法initialize()"); - } - - @Override - public void destroy() { - logger.info(getPluginLabel() + "執行銷毀方法destroy()"); - } - - @Override - public String getPluginId() { - return "PaymentToOAPluginInitializer"; - } - - @Override - public String getPluginName() { - return "NCC付款单传递OA"; - } - - @Override - public String getPluginLabel() { - return "PaymentToOAPluginInitializer"; - } - - @Override - public String getPluginType() { - return "1"; - } - @Override - public JsonResultEntity executeBusiness(JSONObject requestJson) { - try { - logger.info("======开始执行NCC付款单传递OA========"); - //重试方法 - if (null != requestJson) { - //如果这个id不为空,说明是重试的 - String id = requestJson.getString("integration_task_living_details_id"); - //执行重新发送 - PaymentEntity paymentEntity = new PaymentEntity(); - paymentEntity.setDataSourceCode(""); - if (StrUtil.isNotEmpty(id)) { - paymentEntity.setId(id); - } - //查询ncc需要传递OA的数据 - List paymentEntities = paymentDao.query(paymentEntity); - if(paymentEntities == null || paymentEntities.size() == 0){ - logger.info("=====没有需要从NCC传递到OA的付款单=========="); - return BaseResult.getSuccessMessageEntity("查询成功"); - } - for (PaymentEntity payment : paymentEntities) { - JSONObject jsonObject=new JSONObject(); - JSONObject jsonMain=new JSONObject(); - JSONArray jsonArray=new JSONArray(); - jsonObject.put("应付财务组织",payment.getPkOrg()); - jsonObject.put("红冲标志",payment.getIsreded()); - jsonObject.put("付款类型",payment.getPkTradetypeid()); - jsonObject.put("单据编号",payment.getBillno()); - jsonObject.put("单据日期",payment.getBilldate()); - jsonObject.put("单据状态",payment.getBillstatus()); - jsonObject.put("发起人",payment.getBillmaker()); - jsonObject.put("业务流程",payment.getPkBusitype()); - jsonObject.put("原币金额",payment.getMoney()); - jsonObject.put("组织本币金额",payment.getLocalMoney()); - jsonObject.put("生效状态",payment.getEffectstatus()); - jsonObject.put("部门",payment.getPkDeptid()); - jsonObject.put("业务员",payment.getPkPsndoc()); - jsonObject.put("供应商",payment.getSupplier()); - jsonObject.put("币种",payment.getPkCurrtype()); - jsonObject.put("收支项目",payment.getPkSubjcode()); - jsonObject.put("结算方式",payment.getPkBalatype()); - jsonObject.put("往来对象",payment.getObjtype()); - jsonObject.put("付款银行账户",payment.getPayaccount()); - jsonObject.put("收款银行账户",payment.getRecaccount()); - jsonObject.put("现金账户",payment.getCashaccount()); - jsonObject.put("审批状态",payment.getApprovestatus()); - jsonObject.put("客户",payment.getCustomer()); - jsonMain.put("formmain_0260",jsonObject); - PaymentDetailsEntity paymentDetailsEntity=new PaymentDetailsEntity(); - paymentDetailsEntity.setDataSourceCode(""); - paymentDetailsEntity.setTopBillid(payment.getPkPaybill()); - //查询NCC付款单明细 - List paymentDetailsEntities = paymentDetailsDao.query(paymentDetailsEntity); - if(paymentDetailsEntities == null || paymentDetailsEntities.size() == 0){ - logger.info("=====没有需要从NCC传递到OA的付款单明细数据=========="); - }else{ - for (PaymentDetailsEntity detailsEntity : paymentDetailsEntities) { - JSONObject jsonDetails=new JSONObject(); - jsonDetails.put("付款性质",detailsEntity.getPrepay()); - jsonDetails.put("物料",detailsEntity.getMaterial()); - jsonDetails.put("供应商-明细表",detailsEntity.getSupplier()); - jsonDetails.put("挂起标志",detailsEntity.getPausetransact()); - jsonDetails.put("往来对象-明细表",detailsEntity.getObjtype()); - jsonDetails.put("票据类型",detailsEntity.getChecktype()); - jsonDetails.put("摘要",detailsEntity.getScomment()); - jsonDetails.put("币种-明细表",detailsEntity.getPkCurrtype()); - jsonDetails.put("组织本币汇率-明细表",detailsEntity.getRate()); - jsonDetails.put("部门-明细表",detailsEntity.getPkDeptid()); - jsonDetails.put("业务员-明细表",detailsEntity.getPkPsndoc()); - jsonDetails.put("借方原币金额",detailsEntity.getMoneyDe()); - jsonDetails.put("组织本币金额-借方",detailsEntity.getLocalMoneyDe()); - jsonDetails.put("借方原币无税金额",detailsEntity.getNotaxDe()); - jsonDetails.put("税率",detailsEntity.getTaxrate()); - jsonDetails.put("结算方式-明细表",detailsEntity.getPkBalatype()); - jsonDetails.put("票据号",detailsEntity.getCheckno()); - jsonDetails.put("付款银行账户-明细表",detailsEntity.getPayaccount()); - jsonDetails.put("收款银行账户-明细表",detailsEntity.getRecaccount()); - jsonDetails.put("现金账户-明细表",detailsEntity.getCashaccount()); - jsonDetails.put("集团本币无税金额-借方",detailsEntity.getGroupnotaxDe()); - jsonDetails.put("全局本币无税金额-借方",detailsEntity.getGlobalnotaxDe()); - jsonDetails.put("客户-明细表",detailsEntity.getCustomer()); - jsonDetails.put("付款业务类型",detailsEntity.getPkRecpaytype()); - jsonDetails.put("税码",detailsEntity.getTaxcodeid()); - jsonDetails.put("直联电票",detailsEntity.getDirectCheckno()); - jsonArray.add(jsonDetails); - } - } - jsonMain.put("formson_0261",jsonArray); - Map map = new HashMap(); - map.put("appName", "collaboration"); - Map data1 = new HashMap(); - data1.put("templateCode", "formmain_0260"); - data1.put("draft", "1"); - data1.put("data", jsonMain); - map.put("data", data1); - logger.info("========NCC付款单传递OA的请求参数为:{}=========",map); - //发送数据 - String result = HttpRequest.post(url). - header("appId", "800064"). - header("apiCode", "8000640000"). - header("publicKey", "ZJYAQ/VtQ66PqKXlV0EowrrlKkhBHYgS/Zk39Q5ezIQne51Ce7eDIk+3zDUT+v578prj"). - header("secretKey", "iLLk424Bmzknbu+ROeJoiVDMYY5EFXtbZY/aU13HmVYIiQrIw9c0Ag4ipxbfpUqqj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). - body(map.toString()). - execute(). - body(); - logger.info("========NCC付款单传递OA的返回参数为:{}=========",result); - JSONObject resultJson = JSONObject.parseObject(result); - if(!resultJson.getBoolean("flag")){ - JSONObject attribute = resultJson.getJSONObject("attribute"); - if("0".equals(attribute.getString("code"))){ - //修改NCC付款单推送状态 - } - } - } - logger.info("=======NCC付款单传递OA执行成功======="); - return BaseResult.getSuccessMessageEntity("NCC付款单传递OA执行成功"); - } - }catch (Exception e){ - logger.info("======执行NCC付款单传递OA失败:{}========", e.getMessage()); - e.printStackTrace(); - } - return BaseResult.getFailureMessageEntity("NCC付款单传递OA执行失败"); - } - - - private void saveTaskLivingDetails(String rootAppPk,String rootAppBill,String rootAppNewData,String newTransmitInfo,boolean flag) { - try { - IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); - integrationTaskLivingDetailsEntity.setId(UUIDUtils.getUUID()); - integrationTaskLivingDetailsEntity.setSts("Y"); - integrationTaskLivingDetailsEntity.setCreate_user_id("1"); - integrationTaskLivingDetailsEntity.setModify_user_id("1"); - integrationTaskLivingDetailsEntity.setCreate_time(new Date()); - integrationTaskLivingDetailsEntity.setModify_time(new Date()); - integrationTaskLivingDetailsEntity.setOrg_id("0"); - integrationTaskLivingDetailsEntity.setCompanyId("0"); - integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk); - integrationTaskLivingDetailsEntity.setRootAppBill(rootAppBill); - integrationTaskLivingDetailsEntity.setPluginId("PaymentToOAPluginInitializer"); - integrationTaskLivingDetailsEntity.setRootAppNewData(rootAppNewData); - integrationTaskLivingDetailsEntity.setNewTransmitInfo(newTransmitInfo); - if(flag){ - taskLivingDetailsService.saveLogToSuccess(integrationTaskLivingDetailsEntity); - }else { - taskLivingDetailsService.saveLogToFail(integrationTaskLivingDetailsEntity); - } - }catch (Exception e){ - logger.info("保存日志到集成任务日志明细中失败:{}",e.getMessage()); - } - } - -} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/IPaymentPluginService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/IPaymentPluginService.java new file mode 100644 index 00000000..764ed390 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/IPaymentPluginService.java @@ -0,0 +1,24 @@ +package com.hzya.frame.plugin.oa.payment.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * @Description 支付申请 + * @Author xiangerlin + * @Date 2025/5/29 15:43 + **/ +public interface IPaymentPluginService { + /** + * 支付申请 + * @param requestJson + * @return + */ + JsonResultEntity payRequest(JSONObject requestJson); + + /** + * 查询交易结果 + * @param requestJson + */ + void queryPayResult(JSONObject requestJson); +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/IPaymentService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/IPaymentService.java deleted file mode 100644 index fd053dc6..00000000 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/IPaymentService.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.hzya.frame.plugin.oa.payment.service; - -import com.hzya.frame.basedao.service.IBaseService; -import com.hzya.frame.plugin.oa.payment.entity.PaymentEntity; - -public interface IPaymentService extends IBaseService { -} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/impl/PaymentPluginServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/impl/PaymentPluginServiceImpl.java new file mode 100644 index 00000000..5a315624 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/impl/PaymentPluginServiceImpl.java @@ -0,0 +1,181 @@ +package com.hzya.frame.plugin.oa.payment.service.impl; + +import cn.hutool.core.convert.Convert; +import cn.hutool.core.lang.Assert; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.cbs8.dto.req.PayResultRequestDTO; +import com.hzya.frame.cbs8.dto.res.PayResponseDTO; +import com.hzya.frame.cbs8.dto.res.PayResultResDTO; +import com.hzya.frame.cbs8.service.ICbs8Service; +import com.hzya.frame.cbs8.util.CBSUtil; +import com.hzya.frame.cbs8.util.PayState; +import com.hzya.frame.plugin.oa.payment.service.IPaymentPluginService; +import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; +import com.hzya.frame.seeyon.cbs8.service.ICbsLogService; +import com.hzya.frame.seeyon.cbs8.service.IPaymentService; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.commons.collections.CollectionUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.List; + +/** + * @Description 支付申请 + * @Author xiangerlin + * @Date 2025/5/29 15:43 + **/ +public class PaymentPluginServiceImpl implements IPaymentPluginService { + + Logger logger = LoggerFactory.getLogger(PaymentPluginServiceImpl.class); + @Autowired + private IPaymentService paymentService; + @Autowired + private ICbs8Service cbs8Service; + @Autowired + private ICbsLogService cbsLogService;; + /** + * 支付申请 + * + * @param requestJson + * @return + */ + @Override + public JsonResultEntity payRequest(JSONObject requestJson) { + String headersStr = requestJson.getString("headers");//请求头 + String formAppId = requestJson.getString("formAppId"); + String eventType = requestJson.getString("eventType"); + String id = requestJson.getString("id"); + String dataSouceCode = requestJson.getString("sourceCode"); + Assert.notEmpty(id,"id不能为空"); + Assert.notEmpty(formAppId,"formAppId不能为空"); + Assert.notEmpty(eventType,"eventType不能为空"); + Assert.notEmpty(headersStr,"headers不能为空"); + Assert.notEmpty(dataSouceCode,"数据源编码不能为空"); + logger.info("准备开始查询待支付的单据"); + PaymentEntity paymentEntity = new PaymentEntity(); + paymentEntity.setId(id); + paymentEntity.setDataSourceCode(dataSouceCode); + try { + //查询OA待支付的数据 + List paymentList = paymentService.queryUnpaid(paymentEntity); + if (CollectionUtils.isNotEmpty(paymentList) && paymentList.size() == 1){ + PaymentEntity pay = paymentList.get(0); + PayResponseDTO payResponseDTO = cbs8Service.payApply(JSONObject.toJSONString(pay)); + String payResStr = JSONObject.toJSONString(payResponseDTO); + logger.info("支付申请响应结果:{}",payResStr); + if (null != payResponseDTO){ + //保存支付日志 + saveCbsLog(pay,payResponseDTO,dataSouceCode); + if (payResponseDTO.getSuccessed()) { + return BaseResult.getSuccessMessageEntity("支付申请成功",payResponseDTO.getBusNum()); + }else { + BaseResult.getFailureMessageEntity("支付申请失败:{}",payResStr); + } + }else { + BaseResult.getFailureMessageEntity("支付申请失败"); + } + return BaseResult.getSuccessMessageEntity("",payResponseDTO); + } + }catch (Exception e){ + logger.error("OA单据推CBS支付申请失败:{}",e); + } + + return null; + } + + /** + * 查询交易结果 + * + * @param requestJson + */ + @Override + public void queryPayResult(JSONObject requestJson) { + String dataSourceCode = requestJson.getString("sourceCode"); + Assert.notEmpty(dataSourceCode,"数据源编码不能为空"); + try { + CbsLogEntity cbsLogEntity = new CbsLogEntity(); + cbsLogEntity.setDataSourceCode(dataSourceCode); + List queryList = cbsLogService.queryInPayment(cbsLogEntity); + if (CollectionUtils.isNotEmpty(queryList)){ + for (CbsLogEntity entity : queryList) { + List payResultResDTOList = cbs8Service.queryPayResult(new PayResultRequestDTO(entity.getBill_code())); + if (CollectionUtils.isNotEmpty(payResultResDTOList)){ + PayResultResDTO payResultResDTO = payResultResDTOList.get(0); + String status = payResultResDTO.getStatus();//支付申请状态 + String pay_status = payResultResDTO.getPayStatus();//支付状态 + if (!PayState.p.getType().equals(pay_status)){//不等于支付中的时候才更新 + //如果支付状态为空,保存支付申请状态,如果支付状态不为空,则保存支付状态 + PaymentEntity paymentEntity = new PaymentEntity(); + paymentEntity.setOaId(entity.getOa_id()); + paymentEntity.setDataSourceCode(dataSourceCode); + List paymentList = paymentService.query(paymentEntity); + if (CollectionUtils.isNotEmpty(paymentList)){ + paymentEntity = paymentList.get(0); + if (StrUtil.isEmpty(pay_status)) { + paymentEntity.setPayResult(PayState.payStateGetValue(status));//支付申请状态 支付状态和支付申请状态用一个 + } else { + paymentEntity.setPayResult(PayState.payStateGetValue(pay_status));//支付状态 支付状态和支付申请状态用一个 + } + if (StrUtil.isNotEmpty(pay_status) && pay_status.equals(PayState.g.getType())) { + paymentEntity.setPayDate(CBSUtil.convertTimestampToString(payResultResDTO.getPayDate()));//支付时间 + } + paymentService.updatePayState(paymentEntity); + //更新日志表状态 + entity.setPay_state(paymentEntity.getPayResult()); + entity.setApply_state(PayState.payStateGetValue(status)); + entity.setDataSourceCode(dataSourceCode); + cbsLogService.update(entity); + } + } + } + } + } + }catch (Exception e){ + logger.error("查询交易结果出错:{}",e); + } + } + + /** + * 保存支付日志 + * @param entity 支付参数 + * @param payResponseDTO cbs返回参数 + * @param dataSourceCode 数据源编码 + * @throws Exception + */ + private void saveCbsLog(PaymentEntity entity,PayResponseDTO payResponseDTO,String dataSourceCode)throws Exception{ + if (null != payResponseDTO){ + //4. 保存日志 + CbsLogEntity cbsLogEntity = new CbsLogEntity(); + cbsLogEntity.setTitle(entity.getTitle()); + cbsLogEntity.setPay_company(entity.getPayCompany()); + cbsLogEntity.setPayee(entity.getRevAccountName()); + cbsLogEntity.setAmount(entity.getAmount()); + cbsLogEntity.setOa_id(entity.getOaId()); + cbsLogEntity.setBill_code(Convert.toStr(entity.getReferenceNumNew(),entity.getReferenceNum())); + cbsLogEntity.setTab_name_ch(entity.getBillName()); + cbsLogEntity.setTab_name_en(entity.getTableName()); + Boolean successed = payResponseDTO.getSuccessed(); + if (successed){ + cbsLogEntity.setPay_state(PayState.p.getValue()); + cbsLogEntity.setApply_state(PayState.two.getValue()); + cbsLogEntity.setCbs_apply_code(payResponseDTO.getBusNum()); + cbsLogEntity.setSuccessed("true"); + entity.setPayResult(PayState.p.getValue()); + }else { + cbsLogEntity.setPay_state("推送失败"); + cbsLogEntity.setMessage(payResponseDTO.getErrorMsg()); + cbsLogEntity.setSuccessed("false"); + entity.setPayResult("推送失败"); + } + cbsLogEntity.setDataSourceCode(dataSourceCode); + cbsLogService.saveLog(cbsLogEntity); + //5.更新视图的支付状态 + paymentService.updatePayState(entity); + } + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/impl/PaymentServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/impl/PaymentServiceImpl.java deleted file mode 100644 index 15a97a30..00000000 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/payment/service/impl/PaymentServiceImpl.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.hzya.frame.plugin.oa.payment.service.impl; - -import com.hzya.frame.basedao.service.impl.BaseService; -import com.hzya.frame.plugin.oa.payment.entity.PaymentEntity; -import com.hzya.frame.plugin.oa.payment.service.IPaymentService; - -public class PaymentServiceImpl extends BaseService implements IPaymentService { -} From 09df8bcc6c06ca5dfdb0d7d225766ae4106778de Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 29 May 2025 19:02:47 +0800 Subject: [PATCH 56/67] =?UTF-8?q?1=E3=80=81=E5=88=A0=E9=99=A4=E4=BD=95?= =?UTF-8?q?=E7=81=BF=E4=B9=8B=E5=89=8D=E7=9A=84=E4=BB=A3=E7=A0=81=EF=BC=88?= =?UTF-8?q?NCC=E5=8F=91=E8=B5=B7=E5=8D=95=E6=8D=AE=E8=A6=81=E5=8E=BBNCC?= =?UTF-8?q?=E5=BC=80=E5=8F=91=EF=BC=8C=E4=B8=8D=E7=94=A8=E5=86=99=E5=88=B0?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E9=87=8C=EF=BC=89=202=E3=80=81=E9=87=8D?= =?UTF-8?q?=E5=86=99CBS=E6=94=AF=E4=BB=98=E7=94=B3=E8=AF=B7=E3=80=81?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BA=A4=E6=98=93=E7=BB=93=E6=9E=9C=E6=8F=92?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/oa/payment/spring/spring-buildpackage-dao.xml | 3 +-- .../plugin/oa/payment/spring/spring-buildpackage-plugin.xml | 5 ++--- .../plugin/oa/payment/spring/spring-buildpackage-service.xml | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-dao.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-dao.xml index e5afe641..c7c87be7 100644 --- a/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-dao.xml +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-dao.xml @@ -1,6 +1,5 @@ - - + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-plugin.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-plugin.xml index 5b9d1b9f..18b699e5 100644 --- a/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-plugin.xml +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-plugin.xml @@ -1,7 +1,6 @@ - - - + + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-service.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-service.xml index dc366931..0a778465 100644 --- a/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-service.xml +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/oa/payment/spring/spring-buildpackage-service.xml @@ -1,5 +1,5 @@ - + From 8f2ea8d28cae6a1eb302b0c8b3abb4fccb59319a Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 3 Jun 2025 16:32:12 +0800 Subject: [PATCH 57/67] =?UTF-8?q?OA=E6=B5=81=E7=A8=8B=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E6=8F=92=E4=BB=B6=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=BA=90=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java index 3c183aee..7475c8f4 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java @@ -528,17 +528,13 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { reqJson.put("formAppId",formAppId); reqJson.put("eventType",eventType); reqJson.put("headers",JSON.toJSONString(headerMap)); - reqJson.put("sourceCode",sysApiDatabase.getSourceCode());//数据源编码,参数名和定时任务调用插件保持一致 + reqJson.put("sourceCode",sysApiDatabase.getSourceCode()); JsonResultEntity result = pluginBaseEntity.executeBusiness(reqJson); return result; } else { throw new BaseSystemException("根据formID:" + formAppId + "未获取到head参数"); } } - }else{ - // StrUtil.isNotEmpty(jsonStr) && StrUtil.isNotEmpty(formAppId) && StrUtil.isNotEmpty(eventType) - logger.info("jsonStr,formAppId,eventType为空!执行错误"+jsonStr+formAppId+eventType); - throw new BaseSystemException("jsonStr,formAppId,eventType为空!执行错误"); } return null; } From ed5b67a8d345ec36630ac658b1e0f255062c2d75 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 4 Jun 2025 08:44:49 +0800 Subject: [PATCH 58/67] =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=EF=BC=8C=E8=AF=B7=E8=B4=AD=E5=8D=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/plugin/ncc/dao/IPOrderBDao.java | 16 + .../frame/plugin/ncc/dao/IPOrderHDao.java | 16 + .../plugin/ncc/dao/impl/POrderBDaoImpl.java | 19 + .../plugin/ncc/dao/impl/POrderHDaoImpl.java | 19 + .../plugin/ncc/entity/POrderBEntity.java | 869 ++++++++++++++++++ .../frame/plugin/ncc/entity/POrderBEntity.xml | 183 ++++ .../plugin/ncc/entity/POrderHEntity.java | 163 ++++ .../frame/plugin/ncc/entity/POrderHEntity.xml | 168 ++++ .../ncc/plugin/PoOrderPluginInitializer.java | 102 ++ .../plugin/ncc/service/IPOrderBService.java | 24 + .../plugin/ncc/service/IPOrderHService.java | 24 + .../ncc/service/IPoOrderPluginInService.java | 19 + .../ncc/service/impl/POrderBServiceImpl.java | 44 + .../ncc/service/impl/POrderHServiceImpl.java | 53 ++ .../impl/PoOrderPluginInServiceImpl.java | 41 + .../RequisitionOrderPluginServiceImpl.java | 44 - .../RequisitionOrderPluginInitializer.java | 2 +- .../IRequisitionOrderPluginService.java | 2 +- .../RequisitionOrderPluginServiceImpl.java | 61 ++ .../ncc/spring/spring-buildpackage-plugin.xml | 3 +- .../spring/spring-buildpackage-service.xml | 3 +- 21 files changed, 1827 insertions(+), 48 deletions(-) create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/dao/IPOrderBDao.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/dao/IPOrderHDao.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/dao/impl/POrderBDaoImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/dao/impl/POrderHDaoImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/entity/POrderBEntity.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/entity/POrderBEntity.xml create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/entity/POrderHEntity.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/entity/POrderHEntity.xml create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/plugin/PoOrderPluginInitializer.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/IPOrderBService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/IPOrderHService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/IPoOrderPluginInService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/POrderBServiceImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/POrderHServiceImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/PoOrderPluginInServiceImpl.java delete mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/RequisitionOrderPluginServiceImpl.java rename base-buildpackage/src/main/java/com/hzya/frame/plugin/{ncc => oa/praybill}/plugin/RequisitionOrderPluginInitializer.java (98%) rename base-buildpackage/src/main/java/com/hzya/frame/plugin/{ncc => oa/praybill}/service/IRequisitionOrderPluginService.java (88%) create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/service/impl/RequisitionOrderPluginServiceImpl.java diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/dao/IPOrderBDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/dao/IPOrderBDao.java new file mode 100644 index 00000000..432e5217 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/dao/IPOrderBDao.java @@ -0,0 +1,16 @@ +package com.hzya.frame.plugin.ncc.dao; + + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.ncc.entity.POrderBEntity; + +/** + * @description: 采购订单子表 dao + * @tableName: po_order_b + * @entityName: POrderBEntity + * @author: code_generator + * @history: 1.0 + */ +public interface IPOrderBDao extends IBaseDao { + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/dao/IPOrderHDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/dao/IPOrderHDao.java new file mode 100644 index 00000000..a1b38e75 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/dao/IPOrderHDao.java @@ -0,0 +1,16 @@ +package com.hzya.frame.plugin.ncc.dao; + + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.ncc.entity.POrderHEntity; + +/** + * @description: 采购订单主表 dao + * @tableName: po_order + * @entityName: POrderHEntity + * @author: code_generator + * @history: 1.0 + */ +public interface IPOrderHDao extends IBaseDao { + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/dao/impl/POrderBDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/dao/impl/POrderBDaoImpl.java new file mode 100644 index 00000000..c4798dc4 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/dao/impl/POrderBDaoImpl.java @@ -0,0 +1,19 @@ +package com.hzya.frame.plugin.ncc.dao.impl; + + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.ncc.dao.IPOrderBDao; +import com.hzya.frame.plugin.ncc.entity.POrderBEntity; +import org.springframework.stereotype.Repository; + +/** + * @description: 采购订单子表 dao + * @tableName: po_order_b + * @entityName: POrderBEntity + * @author: code_generator + * @history:1.0 + */ +@Repository("po_order_bdao") +public class POrderBDaoImpl extends MybatisGenericDao implements IPOrderBDao { + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/dao/impl/POrderHDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/dao/impl/POrderHDaoImpl.java new file mode 100644 index 00000000..06d51814 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/dao/impl/POrderHDaoImpl.java @@ -0,0 +1,19 @@ +package com.hzya.frame.plugin.ncc.dao.impl; + + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.ncc.dao.IPOrderHDao; +import com.hzya.frame.plugin.ncc.entity.POrderHEntity; +import org.springframework.stereotype.Repository; + +/** + * @description: 采购订单主表 dao + * @tableName: po_order + * @entityName: POrderHEntity + * @author: code_generator + * @history:1.0 + */ +@Repository("po_orderdao") +public class POrderHDaoImpl extends MybatisGenericDao implements IPOrderHDao { + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/entity/POrderBEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/entity/POrderBEntity.java new file mode 100644 index 00000000..112ddc71 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/entity/POrderBEntity.java @@ -0,0 +1,869 @@ +package com.hzya.frame.plugin.ncc.entity; +import com.hzya.frame.web.entity.BaseEntity; + +import java.math.BigDecimal; +/** + * @description: 采购订单子表 + * @tableName: po_order_b + * @entityName: POrderBEntity + * @author: code_generator + * @history: 1.0 + */ + +public class POrderBEntity extends BaseEntity { + + /** */ + private String pk_order; + /** */ + private String pk_order_b; + /** 集团 */ + private String pk_group; + /** 组织 */ + private String pk_org; + /** 行号 */ + private String crowno; + /** 物料 */ + private String pk_material; + /** 物料编码 */ + private String material_code; + /** 物料名称 */ + private String material_name; + private String material_class_id; + /** 主单位 */ + private String cunitid; + /** 主单位名称 */ + private String cunitid_name; + /** 辅单位 */ + private String castunitid; + /** 副单位名称 */ + private String castunitid_name; + /** 吨数 */ + private BigDecimal nnum; + /** 件数 */ + private BigDecimal nastnum; + /** 换算率 */ + private String vchangerate; + /** 无税单价 */ + private BigDecimal norigprice; + /** 含税单价 */ + private BigDecimal norigtaxprice; + /** 无税金额 */ + private BigDecimal norignetprice; + /** 含税金额 */ + private BigDecimal norigtaxnetprice; + /** 税额 */ + private BigDecimal ntax; + /** 价税合计 */ + private BigDecimal norigtaxmny; + /** 税率 */ + private BigDecimal ntaxrate; + /** 币种 */ + private String corigcurrencyid; + private String corigcurrencyid_name; + /** 来源单据类型 */ + private String csourcetypecode; + /** 来源单据 */ + private String csourceid; + /** 来源单据明细 */ + private String csourcebid; + /** 源头单据类型 */ + private String cfirsttypecode; + /** 源头单据 */ + private String cfirstid; + /** 源头单据明细 */ + private String cfirstbid; + /** 是否赠品 */ + private String blargess; + /** 源头交易类型 */ + private String vfirsttrantype; + /** 源头单据号 */ + private String vfirstcode; + /** 源头单据行号 */ + private String vfirstrowno; + /** 来源交易类型 */ + private String vsourcetrantype; + /** 来源单据号 */ + private String vsourcecode; + /** 来源单据行号 */ + private String vsourcerowno; + /** 自由辅助属性1 */ + private String vfree1; + /** 自由辅助属性2 */ + private String vfree2; + /** 自由辅助属性3 */ + private String vfree3; + /** 自由辅助属性4 */ + private String vfree4; + /** 自由辅助属性5 */ + private String vfree5; + /** 自由辅助属性6 */ + private String vfree6; + private String pk_grade; + /** 自由辅助属性7 */ + private String vfree7; + /** FSC/EUDR主键 */ + + private String pk_vfree8; + /** FSC/EUDR */ + + private String vfree8; + /** 自由辅助属性9 */ + private String vfree9; + /** 品牌主键 */ + + private String pk_vfree10; + /** 品牌 */ + + private String vfree10; + /** 自定义项1 */ + private String vbdef1; + /** 自定义项2 */ + private String vbdef2; + /** 自定义项3 */ + private String vbdef3; + /** 自定义项4 */ + private String vbdef4; + /** 自定义项5 */ + private String vbdef5; + /** 自定义项6 */ + private String vbdef6; + /** 自定义项7 */ + private String vbdef7; + /** 自定义项8 */ + private String vbdef8; + /** 自定义项9 */ + private String vbdef9; + /** 自定义项10 */ + private String vbdef10; + /** 自定义项11 */ + private String vbdef11; + /** 自定义项12 */ + private String vbdef12; + /** 自定义项13 */ + private String vbdef13; + /** 自定义项14 */ + private String vbdef14; + /** 自定义项15 */ + private String vbdef15; + /** 自定义项16 */ + private String vbdef16; + /** 自定义项17 */ + private String vbdef17; + /** 自定义项18 */ + private String vbdef18; + /** 自定义项19 */ + private String vbdef19; + /** 自定义项20 */ + private String vbdef20; + private String vbmemo; + private String external_material_spec; + /** 报价单位 */ + private String cqtunitid; + private String cqtunitid_name; + /** 报价数量 */ + private BigDecimal nqtunitnum; + /** 折本汇率 */ + private BigDecimal nexchangerate; + /** 收货仓库 */ + private String pk_recvstordoc; + private String recvstordoc_name; + /** 计划到货日期 */ + private String dplanarrvdate; + + private String special_type; + private String vbatchcode; + + private String ic_id; + + private BigDecimal price; + private BigDecimal taxprice; + private String material_id; + + public String getPk_order() { + return pk_order; + } + + public void setPk_order(String pk_order) { + this.pk_order = pk_order; + } + + public String getPk_order_b() { + return pk_order_b; + } + + public void setPk_order_b(String pk_order_b) { + this.pk_order_b = pk_order_b; + } + + public String getPk_group() { + return pk_group; + } + + public void setPk_group(String pk_group) { + this.pk_group = pk_group; + } + + public String getPk_org() { + return pk_org; + } + + public void setPk_org(String pk_org) { + this.pk_org = pk_org; + } + + public String getCrowno() { + return crowno; + } + + public void setCrowno(String crowno) { + this.crowno = crowno; + } + + public String getPk_material() { + return pk_material; + } + + public void setPk_material(String pk_material) { + this.pk_material = pk_material; + } + + public String getMaterial_code() { + return material_code; + } + + public void setMaterial_code(String material_code) { + this.material_code = material_code; + } + + public String getMaterial_name() { + return material_name; + } + + public void setMaterial_name(String material_name) { + this.material_name = material_name; + } + + public String getMaterial_class_id() { + return material_class_id; + } + + public void setMaterial_class_id(String material_class_id) { + this.material_class_id = material_class_id; + } + + public String getCunitid() { + return cunitid; + } + + public void setCunitid(String cunitid) { + this.cunitid = cunitid; + } + + public String getCunitid_name() { + return cunitid_name; + } + + public void setCunitid_name(String cunitid_name) { + this.cunitid_name = cunitid_name; + } + + public String getCastunitid() { + return castunitid; + } + + public void setCastunitid(String castunitid) { + this.castunitid = castunitid; + } + + public String getCastunitid_name() { + return castunitid_name; + } + + public void setCastunitid_name(String castunitid_name) { + this.castunitid_name = castunitid_name; + } + + public BigDecimal getNnum() { + return nnum; + } + + public void setNnum(BigDecimal nnum) { + this.nnum = nnum; + } + + public BigDecimal getNastnum() { + return nastnum; + } + + public void setNastnum(BigDecimal nastnum) { + this.nastnum = nastnum; + } + + public String getVchangerate() { + return vchangerate; + } + + public void setVchangerate(String vchangerate) { + this.vchangerate = vchangerate; + } + + public BigDecimal getNorigprice() { + return norigprice; + } + + public void setNorigprice(BigDecimal norigprice) { + this.norigprice = norigprice; + } + + public BigDecimal getNorigtaxprice() { + return norigtaxprice; + } + + public void setNorigtaxprice(BigDecimal norigtaxprice) { + this.norigtaxprice = norigtaxprice; + } + + public BigDecimal getNorignetprice() { + return norignetprice; + } + + public void setNorignetprice(BigDecimal norignetprice) { + this.norignetprice = norignetprice; + } + + public BigDecimal getNorigtaxnetprice() { + return norigtaxnetprice; + } + + public void setNorigtaxnetprice(BigDecimal norigtaxnetprice) { + this.norigtaxnetprice = norigtaxnetprice; + } + + public BigDecimal getNtax() { + return ntax; + } + + public void setNtax(BigDecimal ntax) { + this.ntax = ntax; + } + + public BigDecimal getNorigtaxmny() { + return norigtaxmny; + } + + public void setNorigtaxmny(BigDecimal norigtaxmny) { + this.norigtaxmny = norigtaxmny; + } + + public BigDecimal getNtaxrate() { + return ntaxrate; + } + + public void setNtaxrate(BigDecimal ntaxrate) { + this.ntaxrate = ntaxrate; + } + + public String getCorigcurrencyid() { + return corigcurrencyid; + } + + public void setCorigcurrencyid(String corigcurrencyid) { + this.corigcurrencyid = corigcurrencyid; + } + + public String getCorigcurrencyid_name() { + return corigcurrencyid_name; + } + + public void setCorigcurrencyid_name(String corigcurrencyid_name) { + this.corigcurrencyid_name = corigcurrencyid_name; + } + + public String getCsourcetypecode() { + return csourcetypecode; + } + + public void setCsourcetypecode(String csourcetypecode) { + this.csourcetypecode = csourcetypecode; + } + + public String getCsourceid() { + return csourceid; + } + + public void setCsourceid(String csourceid) { + this.csourceid = csourceid; + } + + public String getCsourcebid() { + return csourcebid; + } + + public void setCsourcebid(String csourcebid) { + this.csourcebid = csourcebid; + } + + public String getCfirsttypecode() { + return cfirsttypecode; + } + + public void setCfirsttypecode(String cfirsttypecode) { + this.cfirsttypecode = cfirsttypecode; + } + + public String getCfirstid() { + return cfirstid; + } + + public void setCfirstid(String cfirstid) { + this.cfirstid = cfirstid; + } + + public String getCfirstbid() { + return cfirstbid; + } + + public void setCfirstbid(String cfirstbid) { + this.cfirstbid = cfirstbid; + } + + public String getBlargess() { + return blargess; + } + + public void setBlargess(String blargess) { + this.blargess = blargess; + } + + public String getVfirsttrantype() { + return vfirsttrantype; + } + + public void setVfirsttrantype(String vfirsttrantype) { + this.vfirsttrantype = vfirsttrantype; + } + + public String getVfirstcode() { + return vfirstcode; + } + + public void setVfirstcode(String vfirstcode) { + this.vfirstcode = vfirstcode; + } + + public String getVfirstrowno() { + return vfirstrowno; + } + + public void setVfirstrowno(String vfirstrowno) { + this.vfirstrowno = vfirstrowno; + } + + public String getVsourcetrantype() { + return vsourcetrantype; + } + + public void setVsourcetrantype(String vsourcetrantype) { + this.vsourcetrantype = vsourcetrantype; + } + + public String getVsourcecode() { + return vsourcecode; + } + + public void setVsourcecode(String vsourcecode) { + this.vsourcecode = vsourcecode; + } + + public String getVsourcerowno() { + return vsourcerowno; + } + + public void setVsourcerowno(String vsourcerowno) { + this.vsourcerowno = vsourcerowno; + } + + public String getVfree1() { + return vfree1; + } + + public void setVfree1(String vfree1) { + this.vfree1 = vfree1; + } + + public String getVfree2() { + return vfree2; + } + + public void setVfree2(String vfree2) { + this.vfree2 = vfree2; + } + + public String getVfree3() { + return vfree3; + } + + public void setVfree3(String vfree3) { + this.vfree3 = vfree3; + } + + public String getVfree4() { + return vfree4; + } + + public void setVfree4(String vfree4) { + this.vfree4 = vfree4; + } + + public String getVfree5() { + return vfree5; + } + + public void setVfree5(String vfree5) { + this.vfree5 = vfree5; + } + + public String getVfree6() { + return vfree6; + } + + public void setVfree6(String vfree6) { + this.vfree6 = vfree6; + } + + public String getPk_grade() { + return pk_grade; + } + + public void setPk_grade(String pk_grade) { + this.pk_grade = pk_grade; + } + + public String getVfree7() { + return vfree7; + } + + public void setVfree7(String vfree7) { + this.vfree7 = vfree7; + } + + public String getPk_vfree8() { + return pk_vfree8; + } + + public void setPk_vfree8(String pk_vfree8) { + this.pk_vfree8 = pk_vfree8; + } + + public String getVfree8() { + return vfree8; + } + + public void setVfree8(String vfree8) { + this.vfree8 = vfree8; + } + + public String getVfree9() { + return vfree9; + } + + public void setVfree9(String vfree9) { + this.vfree9 = vfree9; + } + + public String getPk_vfree10() { + return pk_vfree10; + } + + public void setPk_vfree10(String pk_vfree10) { + this.pk_vfree10 = pk_vfree10; + } + + public String getVfree10() { + return vfree10; + } + + public void setVfree10(String vfree10) { + this.vfree10 = vfree10; + } + + public String getVbdef1() { + return vbdef1; + } + + public void setVbdef1(String vbdef1) { + this.vbdef1 = vbdef1; + } + + public String getVbdef2() { + return vbdef2; + } + + public void setVbdef2(String vbdef2) { + this.vbdef2 = vbdef2; + } + + public String getVbdef3() { + return vbdef3; + } + + public void setVbdef3(String vbdef3) { + this.vbdef3 = vbdef3; + } + + public String getVbdef4() { + return vbdef4; + } + + public void setVbdef4(String vbdef4) { + this.vbdef4 = vbdef4; + } + + public String getVbdef5() { + return vbdef5; + } + + public void setVbdef5(String vbdef5) { + this.vbdef5 = vbdef5; + } + + public String getVbdef6() { + return vbdef6; + } + + public void setVbdef6(String vbdef6) { + this.vbdef6 = vbdef6; + } + + public String getVbdef7() { + return vbdef7; + } + + public void setVbdef7(String vbdef7) { + this.vbdef7 = vbdef7; + } + + public String getVbdef8() { + return vbdef8; + } + + public void setVbdef8(String vbdef8) { + this.vbdef8 = vbdef8; + } + + public String getVbdef9() { + return vbdef9; + } + + public void setVbdef9(String vbdef9) { + this.vbdef9 = vbdef9; + } + + public String getVbdef10() { + return vbdef10; + } + + public void setVbdef10(String vbdef10) { + this.vbdef10 = vbdef10; + } + + public String getVbdef11() { + return vbdef11; + } + + public void setVbdef11(String vbdef11) { + this.vbdef11 = vbdef11; + } + + public String getVbdef12() { + return vbdef12; + } + + public void setVbdef12(String vbdef12) { + this.vbdef12 = vbdef12; + } + + public String getVbdef13() { + return vbdef13; + } + + public void setVbdef13(String vbdef13) { + this.vbdef13 = vbdef13; + } + + public String getVbdef14() { + return vbdef14; + } + + public void setVbdef14(String vbdef14) { + this.vbdef14 = vbdef14; + } + + public String getVbdef15() { + return vbdef15; + } + + public void setVbdef15(String vbdef15) { + this.vbdef15 = vbdef15; + } + + public String getVbdef16() { + return vbdef16; + } + + public void setVbdef16(String vbdef16) { + this.vbdef16 = vbdef16; + } + + public String getVbdef17() { + return vbdef17; + } + + public void setVbdef17(String vbdef17) { + this.vbdef17 = vbdef17; + } + + public String getVbdef18() { + return vbdef18; + } + + public void setVbdef18(String vbdef18) { + this.vbdef18 = vbdef18; + } + + public String getVbdef19() { + return vbdef19; + } + + public void setVbdef19(String vbdef19) { + this.vbdef19 = vbdef19; + } + + public String getVbdef20() { + return vbdef20; + } + + public void setVbdef20(String vbdef20) { + this.vbdef20 = vbdef20; + } + + public String getVbmemo() { + return vbmemo; + } + + public void setVbmemo(String vbmemo) { + this.vbmemo = vbmemo; + } + + public String getExternal_material_spec() { + return external_material_spec; + } + + public void setExternal_material_spec(String external_material_spec) { + this.external_material_spec = external_material_spec; + } + + public String getCqtunitid() { + return cqtunitid; + } + + public void setCqtunitid(String cqtunitid) { + this.cqtunitid = cqtunitid; + } + + public String getCqtunitid_name() { + return cqtunitid_name; + } + + public void setCqtunitid_name(String cqtunitid_name) { + this.cqtunitid_name = cqtunitid_name; + } + + public BigDecimal getNqtunitnum() { + return nqtunitnum; + } + + public void setNqtunitnum(BigDecimal nqtunitnum) { + this.nqtunitnum = nqtunitnum; + } + + public BigDecimal getNexchangerate() { + return nexchangerate; + } + + public void setNexchangerate(BigDecimal nexchangerate) { + this.nexchangerate = nexchangerate; + } + + public String getPk_recvstordoc() { + return pk_recvstordoc; + } + + public void setPk_recvstordoc(String pk_recvstordoc) { + this.pk_recvstordoc = pk_recvstordoc; + } + + public String getRecvstordoc_name() { + return recvstordoc_name; + } + + public void setRecvstordoc_name(String recvstordoc_name) { + this.recvstordoc_name = recvstordoc_name; + } + + public String getDplanarrvdate() { + return dplanarrvdate; + } + + public void setDplanarrvdate(String dplanarrvdate) { + this.dplanarrvdate = dplanarrvdate; + } + + public String getSpecial_type() { + return special_type; + } + + public void setSpecial_type(String special_type) { + this.special_type = special_type; + } + + public String getVbatchcode() { + return vbatchcode; + } + + public void setVbatchcode(String vbatchcode) { + this.vbatchcode = vbatchcode; + } + + public String getIc_id() { + return ic_id; + } + + public void setIc_id(String ic_id) { + this.ic_id = ic_id; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public BigDecimal getTaxprice() { + return taxprice; + } + + public void setTaxprice(BigDecimal taxprice) { + this.taxprice = taxprice; + } + + public String getMaterial_id() { + return material_id; + } + + public void setMaterial_id(String material_id) { + this.material_id = material_id; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/entity/POrderBEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/entity/POrderBEntity.xml new file mode 100644 index 00000000..ae72f7f0 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/entity/POrderBEntity.xml @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/entity/POrderHEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/entity/POrderHEntity.java new file mode 100644 index 00000000..912ffd17 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/entity/POrderHEntity.java @@ -0,0 +1,163 @@ +package com.hzya.frame.plugin.ncc.entity; + + + +import com.hzya.frame.web.entity.BaseEntity; + +import java.util.List; +import java.util.Map; + +/** + * @description: 采购订单主表 + * @tableName: po_order + * @entityName: POrderHEntity + * @author: code_generator + * @history: 1.0 + */ + +public class POrderHEntity extends BaseEntity { + + /** 采购订单 */ + private String pk_order; + /** 集团 */ + private String pk_group; + /** 集团名称 */ + private String group_name; + /** 采购组织 */ + private String pk_org; + private String pk_orgs; + private String pk_org_search; + /** 采购组织版本信息 */ + private String pk_org_v; + /** 组织名称 */ + private String org_name; + /** 订单编号 */ + private String vbillcode; + /** 订单日期 */ + private String dbilldate; + /** 供应商 */ + private String pk_supplier; + /** 供应商版本 */ + private String pk_supplier_v; + /** 供应商名称 */ + private String supplier_name; + /** 采购部门 */ + private String pk_dept; + /** 部门名称 */ + private String dept_name; + /** 采购员 */ + private String cemployeeid; + /** 采购员名称 */ + private String cemployeeid_name; + /** 订单类型编码 */ + private String vtrantypecode; + /** 订单类型名称 */ + private String vtrantypecode_name; + /** 供应商发货地址 */ + private String pk_deliveradd; + /** 供应商发货地址 */ + private String deliveradd_name; + /** 单据状态 */ + private String forderstatus; + private String forderstatus_name; + /** 备注 */ + private String vmemo; + /** 运输方式 */ + private String pk_transporttype; + /** 运输方式 */ + private String transporttype_name; + /** 付款协议 */ + private String pk_payterm; + /** 付款协议名称 */ + private String payterm_name; + /** 最新版本 */ + private String bislatest; + private String bislatest_name; + /** 总数量 */ + private String ntotalastnum; + /** 总件数 */ + private String ntotalpiece; + /** 价税合计 */ + private String ntotalorigmny; + /** 业务流程 */ + private String pk_busitype; + /** 结算方式 */ + private String pk_balatype; + /** 币种 */ + private String corigcurrencyid; + private String corigcurrencyid_name; + /** 进口合同号*/ + private String vdef1; + /** */ + private String vdef2; + /** 提单号 */ + private String vdef3; + /** */ + private String vdef4; + /** */ + private String vdef5; + /** */ + private String vdef6; + /** 承运商 */ + private String vdef7; + private String vdef7_name; + /** */ + private String vdef8; + /** */ + private String vdef9; + /** */ + private String vdef10; + /** */ + private String vdef11; + /** */ + private String vdef12; + /** */ + private String vdef13; + /** 合同号 */ + private String vdef14; + /** */ + private String vdef15; + /** */ + private String vdef16; + /** */ + private String vdef17; + /** */ + private String vdef18; + /** */ + private String vdef19; + /** */ + private String vdef20; + private String breturn; + /** 推送状态 */ + private String push_status; + /** 项目 */ + private String pk_project; + /** 项目名称 */ + private String project_name; + + private String type; + + private String systate = "0"; + + private List rowIds; + + private List detailList; + + private Map icMap; + + private String ic_id; + private String it_type; + private Boolean exempted_flag; + private Boolean isNotPo; + + + private String tms_bill_code; + + private String bill_code_search; + + // 是否关闭 + private String bfinalclose; + + // 发货地址 + private String ship_address; +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/entity/POrderHEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/entity/POrderHEntity.xml new file mode 100644 index 00000000..fa55b988 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/entity/POrderHEntity.xml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/plugin/PoOrderPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/plugin/PoOrderPluginInitializer.java new file mode 100644 index 00000000..2a304941 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/plugin/PoOrderPluginInitializer.java @@ -0,0 +1,102 @@ +package com.hzya.frame.plugin.ncc.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @Description NCC采购订单传发起OA审批 + * @Author xiangerlin + * @Date 2025/6/3 19:01 + **/ +public class PoOrderPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(PoOrderPluginInitializer.class); + /*** + * 插件初始化方法 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 10:48 + * @Param [] + * @return void + **/ + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + /**** + * 插件销毁方法 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + /**** + * 插件的ID + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginId() { + return "PoOrderPluginInitializer"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "NCC采购订单传OA"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "NCC采购订单传OA"; + } + + /*** + * 插件类型 1、场景插件 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 14:01 + * @Param [] + * @return java.lang.String + **/ + @Override + public String getPluginType() { + return "1"; + } + + /*** + * 执行业务代码 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-07 11:20 + * @param requestJson 执行业务代码的参数 + * @return void + **/ + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + try { + logger.info("======开始执行NCC采购订单传OA插件======"); + }catch (Exception e){ + logger.info("======执行NCC采购订单传OA插件出错======{}",e.getMessage()); + return BaseResult.getFailureMessageEntity("请NCC采购订单传OA插件执行失败",e.getMessage()); + } + return BaseResult.getSuccessMessageEntity("NCC采购订单传OA插件执行成功"); + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/IPOrderBService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/IPOrderBService.java new file mode 100644 index 00000000..297d0814 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/IPOrderBService.java @@ -0,0 +1,24 @@ +package com.hzya.frame.plugin.ncc.service; + + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.ncc.entity.POrderBEntity; + +import java.util.List; + +/** + * @description: 采购订单子表 service + * @tableName: po_order_b + * @entityName: POrderBEntity + * @author: code_generator + * @history: 1.0 + */ +public interface IPOrderBService extends IBaseService { + + /** + * 查询采购订单子表 + * @param entity + * @return + */ + List queryList(POrderBEntity entity); +} \ No newline at end of file diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/IPOrderHService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/IPOrderHService.java new file mode 100644 index 00000000..fec9123b --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/IPOrderHService.java @@ -0,0 +1,24 @@ +package com.hzya.frame.plugin.ncc.service; + + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.ncc.entity.POrderHEntity; + +import java.util.List; + +/** + * @description: 采购订单主表 service + * @tableName: po_order + * @entityName: POrderHEntity + * @author: code_generator + * @history: 1.0 + */ +public interface IPOrderHService extends IBaseService { + + /** + * 查询采购订单主表 + * @param entity + * @return + */ + List queryList(POrderHEntity entity); +} \ No newline at end of file diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/IPoOrderPluginInService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/IPoOrderPluginInService.java new file mode 100644 index 00000000..da120eb2 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/IPoOrderPluginInService.java @@ -0,0 +1,19 @@ +package com.hzya.frame.plugin.ncc.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * @Description NCC采购订单 + * @Author xiangerlin + * @Date 2025/6/3 19:09 + **/ +public interface IPoOrderPluginInService { + + /** + * NCC采购订单传到OA走审批流 + * @param requestJson + * @return + */ + JsonResultEntity sync2oa(JSONObject requestJson); +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/POrderBServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/POrderBServiceImpl.java new file mode 100644 index 00000000..eb4d80a8 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/POrderBServiceImpl.java @@ -0,0 +1,44 @@ +package com.hzya.frame.plugin.ncc.service.impl; + + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.plugin.ncc.dao.IPOrderBDao; +import com.hzya.frame.plugin.ncc.entity.POrderBEntity; +import com.hzya.frame.plugin.ncc.service.IPOrderBService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @description: 采购订单子表 service + * @tableName: po_order_b + * @entityName: POrderBEntity + * @author: code_generator + * @history: 1.0 + */ +@Service(value="po_order_bService") +public class POrderBServiceImpl extends BaseService implements IPOrderBService { + + protected IPOrderBDao porderbDao; + + @Autowired + public void setPOrderBDao(IPOrderBDao dao) { + this.porderbDao = dao; + this.dao=dao; + } + + /** + * 查询采购订单子表 + * + * @param entity + * @return + */ + @DS(value = "#entity.dataSourceCode") + @Override + public List queryList(POrderBEntity entity) { + List queryList = porderbDao.query(entity); + return queryList; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/POrderHServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/POrderHServiceImpl.java new file mode 100644 index 00000000..5f64606c --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/POrderHServiceImpl.java @@ -0,0 +1,53 @@ +package com.hzya.frame.plugin.ncc.service.impl; + +import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.core.lang.Assert; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.plugin.ncc.dao.IPOrderHDao; +import com.hzya.frame.plugin.ncc.entity.POrderHEntity; +import com.hzya.frame.plugin.ncc.service.IPOrderHService; +import org.apache.ibatis.session.SqlSession; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @description: 采购订单主表 service + * @tableName: po_order + * @entityName: POrderHEntity + * @author: code_generator + * @history: 1.0 + */ +@Service(value="po_orderService") +public class POrderHServiceImpl extends BaseService implements IPOrderHService { + + protected IPOrderHDao porderhDao; + + + @Autowired + public void setPOrderHDao(IPOrderHDao dao) { + + this.porderhDao = dao; + this.dao=dao; + } + + /** + * 查询采购订单主表 + * + * @param entity + * @return + */ + @DS(value = "#entity.dataSourceCode") + @Override + public List queryList(POrderHEntity entity) { + List queryList = porderhDao.query(entity); + return queryList; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/PoOrderPluginInServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/PoOrderPluginInServiceImpl.java new file mode 100644 index 00000000..4ac6b31e --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/PoOrderPluginInServiceImpl.java @@ -0,0 +1,41 @@ +package com.hzya.frame.plugin.ncc.service.impl; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.ncc.service.IPOrderBService; +import com.hzya.frame.plugin.ncc.service.IPOrderHService; +import com.hzya.frame.plugin.ncc.service.IPoOrderPluginInService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @Description NCC采购订单 + * @Author xiangerlin + * @Date 2025/6/3 19:09 + **/ +public class PoOrderPluginInServiceImpl implements IPoOrderPluginInService { + + @Autowired + private IPOrderHService pOrderHService; + @Autowired + private IPOrderBService pOrderBService; + + + /** + * NCC采购订单传到OA走审批流 + * + * @param requestJson + * @return + */ + @Override + public JsonResultEntity sync2oa(JSONObject requestJson) { + //数据源编码 + String datasourceCode = requestJson.getString("sourceCode"); + if (StrUtil.isNotEmpty(datasourceCode)){ + //查NCC单据 + //组装参数 + //调用OA接口 + } + return null; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/RequisitionOrderPluginServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/RequisitionOrderPluginServiceImpl.java deleted file mode 100644 index ca29ecae..00000000 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/RequisitionOrderPluginServiceImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.hzya.frame.plugin.ncc.service.impl; - -import cn.hutool.core.lang.Assert; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.hzya.frame.plugin.ncc.service.IRequisitionOrderPluginService; -import com.hzya.frame.seeyon.enums.ColEventTypeEnum; -import com.hzya.frame.web.entity.BaseResult; -import com.hzya.frame.web.entity.JsonResultEntity; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @Description 请购单传NCC - * @Author xiangerlin - * @Date 2025/5/21 17:44 - **/ -public class RequisitionOrderPluginServiceImpl implements IRequisitionOrderPluginService { - Logger logger = LoggerFactory.getLogger(IRequisitionOrderPluginService.class); - /** - * 请购单同步到ncc - * - * @param requestJson - * @return - */ - @Override - public JsonResultEntity sync2ncc(JSONObject requestJson) { - //数据源编码 - String datasourceCode = requestJson.getString("sourceCode"); - String headersStr = requestJson.getString("headers");//请求头 - String formAppId = requestJson.getString("formApp"); - String eventType = requestJson.getString("eventType"); - JSONObject formmainData = requestJson.getJSONObject("formmainTableName"); - JSONArray forsonData = requestJson.getJSONArray("forsonTableName"); - Assert.notEmpty(formAppId,"formAppId不能为空"); - Assert.notEmpty(eventType,"eventType不能为空"); - Assert.notEmpty(headersStr,"headers不能为空"); - //流程发起 - if (ColEventTypeEnum.ONSTART.getType().equals(eventType)){ - - } - return BaseResult.getSuccessMessageEntity("请购单推NCC成功"); - } -} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/plugin/RequisitionOrderPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/plugin/RequisitionOrderPluginInitializer.java similarity index 98% rename from base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/plugin/RequisitionOrderPluginInitializer.java rename to base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/plugin/RequisitionOrderPluginInitializer.java index f6c9e3e0..2f97b802 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/plugin/RequisitionOrderPluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/plugin/RequisitionOrderPluginInitializer.java @@ -1,4 +1,4 @@ -package com.hzya.frame.plugin.ncc.plugin; +package com.hzya.frame.plugin.oa.praybill.plugin; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.base.PluginBaseEntity; diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/IRequisitionOrderPluginService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/service/IRequisitionOrderPluginService.java similarity index 88% rename from base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/IRequisitionOrderPluginService.java rename to base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/service/IRequisitionOrderPluginService.java index ef13b03f..893c97ad 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/IRequisitionOrderPluginService.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/service/IRequisitionOrderPluginService.java @@ -1,4 +1,4 @@ -package com.hzya.frame.plugin.ncc.service; +package com.hzya.frame.plugin.oa.praybill.service; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.web.entity.JsonResultEntity; diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/service/impl/RequisitionOrderPluginServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/service/impl/RequisitionOrderPluginServiceImpl.java new file mode 100644 index 00000000..15822c6e --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/service/impl/RequisitionOrderPluginServiceImpl.java @@ -0,0 +1,61 @@ +package com.hzya.frame.plugin.oa.praybill.service.impl; + +import cn.hutool.core.lang.Assert; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.oa.praybill.service.IRequisitionOrderPluginService; +import com.hzya.frame.seeyon.enums.ColEventTypeEnum; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.LinkedList; +import java.util.List; + +/** + * @Description OA请购单传NCC + * @Author xiangerlin + * @Date 2025/5/21 17:44 + **/ +public class RequisitionOrderPluginServiceImpl implements IRequisitionOrderPluginService { + Logger logger = LoggerFactory.getLogger(IRequisitionOrderPluginService.class); + /** + * 请购单同步到ncc + * + * @param requestJson + * @return + */ + @Override + public JsonResultEntity sync2ncc(JSONObject requestJson) { + //数据源编码 + String datasourceCode = requestJson.getString("sourceCode"); + String headersStr = requestJson.getString("headers");//请求头 + String formAppId = requestJson.getString("formApp"); + String eventType = requestJson.getString("eventType"); + JSONObject formmainData = requestJson.getJSONObject("formmainTableName"); + JSONArray forsonData = requestJson.getJSONArray("forsonTableName"); + Assert.notEmpty(formAppId,"formAppId不能为空"); + Assert.notEmpty(eventType,"eventType不能为空"); + Assert.notEmpty(headersStr,"headers不能为空"); + //流程结束 + if (ColEventTypeEnum.ONPROCESSFINISHED.getType().equals(eventType)){ + JSONObject praybill = new JSONObject(); + praybill.put("pk_org",formmainData.getString("field0005"));//库存组织 + praybill.put("vbillcode",formmainData.getString("field0001"));//请购单号 + praybill.put("dbilldate",formmainData.getString("field0004"));//请购日期 + praybill.put("bsctype",formmainData.getString("field0009"));//委外 + praybill.put("pk_planpsn",formmainData.getString("field0010"));//计划员 + praybill.put("pk_plandept_v",formmainData.getString("field0011"));//计划部门 + praybill.put("vmemo",formmainData.getString("field0013"));//备注 + praybill.put("fbillstatus",formmainData.getString("field0012"));//单据状态 + praybill.put("billmaker", formmainData.getString("field0002"));//制单人 + praybill.put("dmakedate", formmainData.getString(""));//制单日期 + praybill.put("ctrantypeid", formmainData.getString("field0006"));//请购类型 + List parybillList = new LinkedList<>(); + praybill.put("pk_praybill_b",parybillList); + + } + return BaseResult.getSuccessMessageEntity("请购单推NCC成功"); + } +} diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-plugin.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-plugin.xml index df9ac20d..a1c8db1a 100644 --- a/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-plugin.xml +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-plugin.xml @@ -1,5 +1,6 @@ - + + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-service.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-service.xml index c7c87be7..f013d0cd 100644 --- a/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-service.xml +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-service.xml @@ -1,5 +1,6 @@ - + + From a5823872cbe6b7322ffdee45e082a310643e627a Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 5 Jun 2025 13:33:13 +0800 Subject: [PATCH 59/67] =?UTF-8?q?=E5=8F=91=E8=B5=B7=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzya/frame/seeyon/util/OARestUtil.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java index 84b42102..56ef19e3 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java @@ -18,6 +18,7 @@ import org.springframework.stereotype.Component; import java.io.File; import java.util.HashMap; +import java.util.LinkedList; import java.util.List; /** @@ -206,4 +207,42 @@ public class OARestUtil { } return null; } + + + + /** + * seeyon/rest/bpm/process/start 发起流程参数组装 + * @param formmainData 主表参数 + * @param formsonDatas 子表参数 + * @param templateCode 模板编号 + * @param formmainTableName 主表表名 + * @param formsonTableName 子表表名 + * @return + */ + public String processParamValueOf(JSONObject formmainData, List formsonDatas,String templateCode,String formmainTableName,String formsonTableName){ + JSONObject param = new JSONObject(); + JSONObject data = new JSONObject(); + param.put("data",data); + param.put("appName","collaboration"); + JSONObject formData = new JSONObject(); + data.put("data", formData);//表单数据 + data.put("draft", "0"); + data.put("templateCode", templateCode);//模板编号 + formData.put(formmainTableName,formmainData);//主表数据 + formData.put(formsonTableName,formsonDatas);//子表数据 + String jsonStr = param.toString(); + return jsonStr; + } + + public static void main(String[] args) { + JSONObject formmainData = new JSONObject(); + formmainData.put("单据编号","123456"); + JSONObject formsonData = new JSONObject(); + formsonData.put("物料编码", "001"); + LinkedList formsonDatas = new LinkedList<>(); + formsonDatas.add(formsonData); + OARestUtil oaRestUtil = new OARestUtil(); + String s = oaRestUtil.processParamValueOf(formmainData, formsonDatas, "formmain_0001_dev", "formmain_0001", "formson_0002"); + System.out.println(s); + } } From 3a03ccbce0ef7da87df3d82c7f820575eff0c836 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 5 Jun 2025 13:33:29 +0800 Subject: [PATCH 60/67] =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=BB=84=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PoOrderPluginInServiceImpl.java | 67 ++++++++++++++++++- 1 file changed, 65 insertions(+), 2 deletions(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/PoOrderPluginInServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/PoOrderPluginInServiceImpl.java index 4ac6b31e..06fab256 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/PoOrderPluginInServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ncc/service/impl/PoOrderPluginInServiceImpl.java @@ -1,12 +1,20 @@ package com.hzya.frame.plugin.ncc.service.impl; import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.plugin.ncc.service.IPOrderBService; import com.hzya.frame.plugin.ncc.service.IPOrderHService; import com.hzya.frame.plugin.ncc.service.IPoOrderPluginInService; +import com.hzya.frame.seeyon.util.OARestUtil; import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; + +import java.util.LinkedList; +import java.util.List; /** * @Description NCC采购订单 @@ -15,12 +23,15 @@ import org.springframework.beans.factory.annotation.Autowired; **/ public class PoOrderPluginInServiceImpl implements IPoOrderPluginInService { + Logger logger = LoggerFactory.getLogger(PoOrderPluginInServiceImpl.class); @Autowired private IPOrderHService pOrderHService; @Autowired private IPOrderBService pOrderBService; - - + @Value("${zt.url}") + private String interfaceUrl; + @Autowired + private OARestUtil oaRestUtil; /** * NCC采购订单传到OA走审批流 * @@ -34,7 +45,59 @@ public class PoOrderPluginInServiceImpl implements IPoOrderPluginInService { if (StrUtil.isNotEmpty(datasourceCode)){ //查NCC单据 //组装参数 + JSONObject formmain_0256 = new JSONObject();//主表数据 + List formson_0257_list = new LinkedList<>();//子表数据 + formmain_0256.put("采购组织",""); + formmain_0256.put("订单编号",""); + formmain_0256.put("订单日期",""); + formmain_0256.put("供应商",""); + formmain_0256.put("采购员",""); + formmain_0256.put("开票供应商",""); + formmain_0256.put("付款协议",""); + formmain_0256.put("发起人",""); + formmain_0256.put("单据状态",""); + formmain_0256.put("备注",""); + formmain_0256.put("补货",""); + formmain_0256.put("退货",""); + formmain_0256.put("总数量",""); + formmain_0256.put("总价税合计",""); + formmain_0256.put("币种",""); + formmain_0256.put("退货退库基于原订单补货",""); + formmain_0256.put("最终关闭",""); + formmain_0256.put("采购部门",""); + formmain_0256.put("订单类型",""); + //子表 + JSONObject formson_0257 = new JSONObject(); + formson_0257.put("收货库存组织",""); + formson_0257.put("行号",""); + formson_0257.put("物料编码",""); + formson_0257.put("物料名称",""); + formson_0257.put("单位",""); + formson_0257.put("数量",""); + formson_0257.put("换算率",""); + formson_0257.put("无税单价",""); + formson_0257.put("含税单价",""); + formson_0257.put("集团本币无税金额",""); + formson_0257.put("集团本币价税合计",""); + formson_0257.put("计划收货日期",""); + formson_0257.put("收货仓库",""); + formson_0257.put("税率",""); + formson_0257_list.add(formson_0257); + String param = oaRestUtil.processParamValueOf(formmain_0256, formson_0257_list, "模板编号", "formmain_0256", "formson_0257"); + String token = oaRestUtil.getToken("hzyaRest", "8000640001"); + logger.info("NCC发起OA采购订单请求参数{}",param); //调用OA接口 + String result = HttpRequest.post(interfaceUrl) + .header("token",token)// token + .header("appId","800064")// 建辉OA应用 + .header("apiCode","8000640000")//流程表单接口 + .header("publicKey","ZJYAAr9TeFduBYu7uJeie2KYdQsnBaEYZHmOjPWMMVZmzelCe7eDIk+3zDUT+v578prj")//NCC应用key + .header("secretKey","f4SSnYcDQmdkwwuGJd2+934q6lM1NnUm5dmOw/4Wvy2mo6PgkKsI/drXYyyLWQCaj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//NCC应用密钥 + .body(param).execute().body(); + // JsonResultEntity resultEntity = (JsonResultEntity) oerDjmlService.handleOerDjml(paramJSON); + // logger.info("保存GRPU8响应参数:{}",JSONObject.toJSON(resultEntity)); + logger.info("NCC发起OA采购订单响应参数:{}",result); + //更新NCC推送状态 } return null; } From a619f68db7dbd4a059e3abfdf4a0de57c06be6d6 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Mon, 9 Jun 2025 13:19:03 +0800 Subject: [PATCH 61/67] =?UTF-8?q?OA=E8=AF=B7=E8=B4=AD=E5=8D=95=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E7=BB=93=E6=9D=9F=E4=BC=A0NCC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oa/praybill/dao/IRequisitionOrderDao.java | 12 ++ .../dao/impl/RequisitionOrderDaoImpl.java | 15 ++ .../entity/RequisitionOrderEntity.java | 31 +++ .../entity/RequisitionOrderEntity.xml | 8 + .../RequisitionOrderPluginInitializer.java | 8 +- .../service/IRequisitionOrderService.java | 19 ++ .../RequisitionOrderPluginServiceImpl.java | 193 ++++++++++++++++-- .../impl/RequisitionOrderServiceImpl.java | 42 ++++ 8 files changed, 312 insertions(+), 16 deletions(-) create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/dao/IRequisitionOrderDao.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/dao/impl/RequisitionOrderDaoImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/entity/RequisitionOrderEntity.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/entity/RequisitionOrderEntity.xml create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/service/IRequisitionOrderService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/service/impl/RequisitionOrderServiceImpl.java diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/dao/IRequisitionOrderDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/dao/IRequisitionOrderDao.java new file mode 100644 index 00000000..a347bea7 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/dao/IRequisitionOrderDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.plugin.oa.praybill.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.oa.praybill.entity.RequisitionOrderEntity; + +/** + * @Description OA请购单 + * @Author xiangerlin + * @Date 2025/6/8 17:06 + **/ +public interface IRequisitionOrderDao extends IBaseDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/dao/impl/RequisitionOrderDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/dao/impl/RequisitionOrderDaoImpl.java new file mode 100644 index 00000000..dfa2a381 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/dao/impl/RequisitionOrderDaoImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.plugin.oa.praybill.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.oa.praybill.dao.IRequisitionOrderDao; +import com.hzya.frame.plugin.oa.praybill.entity.RequisitionOrderEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description OA请购单 + * @Author xiangerlin + * @Date 2025/6/8 17:08 + **/ +@Repository("requisitionOrderDaoImpl") +public class RequisitionOrderDaoImpl extends MybatisGenericDao implements IRequisitionOrderDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/entity/RequisitionOrderEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/entity/RequisitionOrderEntity.java new file mode 100644 index 00000000..6d6beb5a --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/entity/RequisitionOrderEntity.java @@ -0,0 +1,31 @@ +package com.hzya.frame.plugin.oa.praybill.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description OA请购单 + * + * @Author xiangerlin + * @Date 2025/6/8 17:04 + **/ +public class RequisitionOrderEntity extends BaseEntity { + + private String field0001;//单据号 + private String field0059;//NCC + + public String getField0001() { + return field0001; + } + + public void setField0001(String field0001) { + this.field0001 = field0001; + } + + public String getField0059() { + return field0059; + } + + public void setField0059(String field0059) { + this.field0059 = field0059; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/entity/RequisitionOrderEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/entity/RequisitionOrderEntity.xml new file mode 100644 index 00000000..88f2528f --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/entity/RequisitionOrderEntity.xml @@ -0,0 +1,8 @@ + + + + + + update formmain_0254 set field0059 = #{field0059} where id = #{id} + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/plugin/RequisitionOrderPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/plugin/RequisitionOrderPluginInitializer.java index 2f97b802..480b81ba 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/plugin/RequisitionOrderPluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/plugin/RequisitionOrderPluginInitializer.java @@ -2,10 +2,12 @@ package com.hzya.frame.plugin.oa.praybill.plugin; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.oa.praybill.service.IRequisitionOrderPluginService; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; /** * @Description 请购单传NCC @@ -14,6 +16,8 @@ import org.slf4j.LoggerFactory; **/ public class RequisitionOrderPluginInitializer extends PluginBaseEntity { Logger logger = LoggerFactory.getLogger(RequisitionOrderPluginInitializer.class); + @Autowired + private IRequisitionOrderPluginService requisitionOrderPluginService; /*** * 插件初始化方法 * @Author 👻👻👻👻👻👻👻👻 gjh @@ -92,8 +96,10 @@ public class RequisitionOrderPluginInitializer extends PluginBaseEntity { @Override public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { try { - logger.info("======开始执行请购单传NCC插件======"); + logger.info("======开始执行请购单传NCC插件======{}",JSONObject.toJSONString(requestJson)); + requisitionOrderPluginService.sync2ncc(requestJson); }catch (Exception e){ + e.printStackTrace(); logger.info("======执行请购单传NCC插件出错======{}",e.getMessage()); return BaseResult.getFailureMessageEntity("请购单传NCC插件执行失败",e.getMessage()); } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/service/IRequisitionOrderService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/service/IRequisitionOrderService.java new file mode 100644 index 00000000..3a09ff4c --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/service/IRequisitionOrderService.java @@ -0,0 +1,19 @@ +package com.hzya.frame.plugin.oa.praybill.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.oa.praybill.entity.RequisitionOrderEntity; + +/** + * @Description OA 请购单 + * @Author xiangerlin + * @Date 2025/6/8 17:10 + **/ +public interface IRequisitionOrderService extends IBaseService { + + /** + * 更新OA单据 + * @param entity + * @return + */ + int updateOrder(RequisitionOrderEntity entity); +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/service/impl/RequisitionOrderPluginServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/service/impl/RequisitionOrderPluginServiceImpl.java index 15822c6e..49b42f3f 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/service/impl/RequisitionOrderPluginServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/service/impl/RequisitionOrderPluginServiceImpl.java @@ -1,15 +1,25 @@ package com.hzya.frame.plugin.oa.praybill.service.impl; import cn.hutool.core.lang.Assert; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.oa.praybill.entity.RequisitionOrderEntity; import com.hzya.frame.plugin.oa.praybill.service.IRequisitionOrderPluginService; +import com.hzya.frame.plugin.oa.praybill.service.IRequisitionOrderService; import com.hzya.frame.seeyon.enums.ColEventTypeEnum; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import java.util.Date; import java.util.LinkedList; import java.util.List; @@ -19,6 +29,12 @@ import java.util.List; * @Date 2025/5/21 17:44 **/ public class RequisitionOrderPluginServiceImpl implements IRequisitionOrderPluginService { + @Value("${zt.url}") + private String baseUrl; + @Autowired + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + @Autowired + private IRequisitionOrderService requisitionOrderService; Logger logger = LoggerFactory.getLogger(IRequisitionOrderPluginService.class); /** * 请购单同步到ncc @@ -30,32 +46,179 @@ public class RequisitionOrderPluginServiceImpl implements IRequisitionOrderPlugi public JsonResultEntity sync2ncc(JSONObject requestJson) { //数据源编码 String datasourceCode = requestJson.getString("sourceCode"); + String task_living_details_id = requestJson.getString("integration_task_living_details_id"); String headersStr = requestJson.getString("headers");//请求头 - String formAppId = requestJson.getString("formApp"); + //String formAppId = requestJson.getString("formApp"); String eventType = requestJson.getString("eventType"); - JSONObject formmainData = requestJson.getJSONObject("formmainTableName"); - JSONArray forsonData = requestJson.getJSONArray("forsonTableName"); - Assert.notEmpty(formAppId,"formAppId不能为空"); + JSONObject headers = requestJson.getJSONObject("headers"); + // Assert.notEmpty(formAppId,"formAppId不能为空"); Assert.notEmpty(eventType,"eventType不能为空"); Assert.notEmpty(headersStr,"headers不能为空"); + String formmainTableName = headers.getString("formmainTableName"); + String forsonTableName = headers.getString("forsonTableName"); + JSONObject jsonStrObj = requestJson.getJSONObject("jsonStr"); + JSONObject businessData = jsonStrObj.getJSONObject("businessDataStr"); + JSONObject formmainData = businessData.getJSONObject(formmainTableName); + JSONArray forsonData = businessData.getJSONArray(forsonTableName); //流程结束 if (ColEventTypeEnum.ONPROCESSFINISHED.getType().equals(eventType)){ + JSONObject paramObj = new JSONObject(); JSONObject praybill = new JSONObject(); - praybill.put("pk_org",formmainData.getString("field0005"));//库存组织 - praybill.put("vbillcode",formmainData.getString("field0001"));//请购单号 + paramObj.put("head", praybill); + praybill.put("pk_group",formmainData.getString("field0058"));//集团 + praybill.put("pk_org",formmainData.getString("field0027"));//库存组织 + praybill.put("pk_org_v",formmainData.getString("field0051"));//库存组织v + //praybill.put("vbillcode",formmainData.getString("field0001"));//请购单号 praybill.put("dbilldate",formmainData.getString("field0004"));//请购日期 - praybill.put("bsctype",formmainData.getString("field0009"));//委外 - praybill.put("pk_planpsn",formmainData.getString("field0010"));//计划员 - praybill.put("pk_plandept_v",formmainData.getString("field0011"));//计划部门 + boolean bsctype = false; + if ("1".equals(formmainData.getString("field0009"))){ + bsctype = true; + } + praybill.put("bsctype",bsctype);//委外 + praybill.put("pk_planpsn",formmainData.getString("field0030"));//计划员 + praybill.put("pk_plandept",formmainData.getString("field0052"));//计划部门 + praybill.put("pk_plandept_v",formmainData.getString("field0053"));//计划部门v praybill.put("vmemo",formmainData.getString("field0013"));//备注 - praybill.put("fbillstatus",formmainData.getString("field0012"));//单据状态 - praybill.put("billmaker", formmainData.getString("field0002"));//制单人 - praybill.put("dmakedate", formmainData.getString(""));//制单日期 - praybill.put("ctrantypeid", formmainData.getString("field0006"));//请购类型 + praybill.put("fbillstatus",headers.getString("fbillstatus"));//单据状态 + praybill.put("bdirecttransit",false);//zhiyun + praybill.put("billmaker", headers.getString("billmaker"));//制单人 yonyou99 + praybill.put("dmakedate", formmainData.getString("field0004"));//制单日期 + praybill.put("ctrantypeid", formmainData.getString("field0039"));//请购类型 + praybill.put("bislatest", true);//最新版本 + praybill.put("vdef1",formmainData.getString("field0002")); + praybill.put("creator",headers.getString("creator"));// + praybill.put("fpraysource",headers.getString("fpraysource"));// + praybill.put("ccurrencyid",headers.getString("ccurrencyid"));// + praybill.put("nversion",headers.getString("nversion"));// + praybill.put("nversion",headers.getString("nversion"));// List parybillList = new LinkedList<>(); - praybill.put("pk_praybill_b",parybillList); - + paramObj.put("body",parybillList); + String pk_org = formmainData.getString("field0027"); + String pk_org_v = formmainData.getString("field0051"); + for(int i=0; i implements IRequisitionOrderService { + + private IRequisitionOrderDao requisitionOrderDao; + + @Autowired + public void setRequisitionOrderDao(IRequisitionOrderDao dao) { + this.requisitionOrderDao = dao; + this.dao = dao; + } + + /** + * 更新OA单据 + * + * @param entity + * @return + */ + @DS(value = "#entity.dataSourceCode") + @Override + public int updateOrder(RequisitionOrderEntity entity) { + if (null != entity && StrUtil.isNotEmpty(entity.getId())){ + requisitionOrderDao.update(entity); + } + return 0; + } +} From 92f4f0be46a1d9f04a48731a72edb38b77651b98 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Mon, 9 Jun 2025 13:25:29 +0800 Subject: [PATCH 62/67] =?UTF-8?q?=E5=BB=BA=E8=BE=89=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/application-jianhui.yml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 base-buildpackage/src/main/resources/application-jianhui.yml diff --git a/base-buildpackage/src/main/resources/application-jianhui.yml b/base-buildpackage/src/main/resources/application-jianhui.yml new file mode 100644 index 00000000..c96136ce --- /dev/null +++ b/base-buildpackage/src/main/resources/application-jianhui.yml @@ -0,0 +1,29 @@ +#######################本地环境####################### +logging: + #日志级别 指定目录级别 + level: + root: info + encodings: UTF-8 + file: +# 日志保存路径 + path: D:\yongansystem\kangarooDataCenter\v3\logs +spring: + datasource: + dynamic: + datasource: + master: +# url: jdbc:mysql://ufidahz.com.cn:9096/businesscenternew?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true +# username: root +# password: bd993088e8a7c3dc5f44441617f9b4bf +# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 + url: jdbc:mysql://127.0.0.1:3307/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true + username: root + password: bd993088e8a7c3dc5f44441617f9b4bf + driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 +savefile: + # 文件保存路径 + path: D:\yongansystem\kangarooDataCenter\v3\logs + tomcatpath: D:\yongansystem\kangarooDataCenter\v3\tomcat + pluginpath: D:\yongansystem\kangarooDataCenter\v3\plugin +zt: + url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface From 5fa3cf64aa5fe15f12acde9a6920387a8cbd3dbe Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 11 Jun 2025 16:47:15 +0800 Subject: [PATCH 63/67] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/test/java/com/hzya/frame/Test1.java | 30 +++++++++++++++++++ .../test/java/com/hzya/frame/temButtom.java | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 base-buildpackage/src/test/java/com/hzya/frame/Test1.java diff --git a/base-buildpackage/src/test/java/com/hzya/frame/Test1.java b/base-buildpackage/src/test/java/com/hzya/frame/Test1.java new file mode 100644 index 00000000..3bc330ac --- /dev/null +++ b/base-buildpackage/src/test/java/com/hzya/frame/Test1.java @@ -0,0 +1,30 @@ +package com.hzya.frame; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.oa.praybill.service.impl.RequisitionOrderPluginServiceImpl; +import com.hzya.frame.util.AESUtil; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +/** + * @Description + * @Author xiangerlin + * @Date 2025/6/11 10:20 + **/ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {WebappApplication.class}) +public class Test1 { + + @Autowired + private RequisitionOrderPluginServiceImpl requisitionOrderPluginService; + @Test + public void test01() { + JSONObject headers =new JSONObject(); + headers.put("creator","1001P1100000000NUULI"); + RequisitionOrderPluginServiceImpl service = new RequisitionOrderPluginServiceImpl(); + requisitionOrderPluginService.uploadFile("-333447786976688302",headers,"8000640001","1001A3100000001B4COB"); + } +} diff --git a/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java b/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java index 825925b0..96cdde01 100644 --- a/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java +++ b/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java @@ -36,7 +36,7 @@ public class temButtom { @Test public void test01() { - String a = AESUtil.encrypt("hzya@1314"); + String a = AESUtil.encrypt("hzya1314"); System.out.println(a); String b = AESUtil.decrypt("62e4295b615a30dbf3b8ee96f41c820b"); System.out.println(b); From 91a768bae5c7a3992355bf83c4e98dfc026db73b Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 12 Jun 2025 10:26:59 +0800 Subject: [PATCH 64/67] =?UTF-8?q?=E8=AF=B7=E8=B4=AD=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base-buildpackage/pom.xml | 4 +- .../RequisitionOrderPluginServiceImpl.java | 211 ++++++++++++------ .../ncc/spring/spring-buildpackage-plugin.xml | 2 +- 3 files changed, 146 insertions(+), 71 deletions(-) diff --git a/base-buildpackage/pom.xml b/base-buildpackage/pom.xml index 2467d45d..b91e52ac 100644 --- a/base-buildpackage/pom.xml +++ b/base-buildpackage/pom.xml @@ -45,9 +45,9 @@ - zqtlocal + jianhui - zqtlocal + jianhui diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/service/impl/RequisitionOrderPluginServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/service/impl/RequisitionOrderPluginServiceImpl.java index 49b42f3f..68710684 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/service/impl/RequisitionOrderPluginServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/oa/praybill/service/impl/RequisitionOrderPluginServiceImpl.java @@ -1,5 +1,7 @@ package com.hzya.frame.plugin.oa.praybill.service.impl; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.io.FileUtil; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; @@ -8,17 +10,24 @@ import com.alibaba.fastjson.JSONObject; import com.hzya.frame.plugin.oa.praybill.entity.RequisitionOrderEntity; import com.hzya.frame.plugin.oa.praybill.service.IRequisitionOrderPluginService; import com.hzya.frame.plugin.oa.praybill.service.IRequisitionOrderService; +import com.hzya.frame.seeyon.entity.CollAttachmentResDTO; import com.hzya.frame.seeyon.enums.ColEventTypeEnum; +import com.hzya.frame.seeyon.util.OARestUtil; import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.commons.collections.CollectionUtils; +import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import java.io.File; +import java.net.URLDecoder; +import java.util.Base64; import java.util.Date; import java.util.LinkedList; import java.util.List; @@ -34,7 +43,9 @@ public class RequisitionOrderPluginServiceImpl implements IRequisitionOrderPlugi @Autowired private IIntegrationTaskLivingDetailsService taskLivingDetailsService; @Autowired - private IRequisitionOrderService requisitionOrderService; + private IRequisitionOrderService requisitionOrderService; + @Autowired + private OARestUtil oaRestUtil; Logger logger = LoggerFactory.getLogger(IRequisitionOrderPluginService.class); /** * 请购单同步到ncc @@ -48,85 +59,22 @@ public class RequisitionOrderPluginServiceImpl implements IRequisitionOrderPlugi String datasourceCode = requestJson.getString("sourceCode"); String task_living_details_id = requestJson.getString("integration_task_living_details_id"); String headersStr = requestJson.getString("headers");//请求头 - //String formAppId = requestJson.getString("formApp"); String eventType = requestJson.getString("eventType"); + String summaryId = requestJson.getString("summaryId"); JSONObject headers = requestJson.getJSONObject("headers"); - // Assert.notEmpty(formAppId,"formAppId不能为空"); Assert.notEmpty(eventType,"eventType不能为空"); Assert.notEmpty(headersStr,"headers不能为空"); String formmainTableName = headers.getString("formmainTableName"); String forsonTableName = headers.getString("forsonTableName"); + String fileApiCode = headers.getString("fileApiCode"); JSONObject jsonStrObj = requestJson.getJSONObject("jsonStr"); JSONObject businessData = jsonStrObj.getJSONObject("businessDataStr"); JSONObject formmainData = businessData.getJSONObject(formmainTableName); JSONArray forsonData = businessData.getJSONArray(forsonTableName); //流程结束 if (ColEventTypeEnum.ONPROCESSFINISHED.getType().equals(eventType)){ - JSONObject paramObj = new JSONObject(); - JSONObject praybill = new JSONObject(); - paramObj.put("head", praybill); - praybill.put("pk_group",formmainData.getString("field0058"));//集团 - praybill.put("pk_org",formmainData.getString("field0027"));//库存组织 - praybill.put("pk_org_v",formmainData.getString("field0051"));//库存组织v - //praybill.put("vbillcode",formmainData.getString("field0001"));//请购单号 - praybill.put("dbilldate",formmainData.getString("field0004"));//请购日期 - boolean bsctype = false; - if ("1".equals(formmainData.getString("field0009"))){ - bsctype = true; - } - praybill.put("bsctype",bsctype);//委外 - praybill.put("pk_planpsn",formmainData.getString("field0030"));//计划员 - praybill.put("pk_plandept",formmainData.getString("field0052"));//计划部门 - praybill.put("pk_plandept_v",formmainData.getString("field0053"));//计划部门v - praybill.put("vmemo",formmainData.getString("field0013"));//备注 - praybill.put("fbillstatus",headers.getString("fbillstatus"));//单据状态 - praybill.put("bdirecttransit",false);//zhiyun - praybill.put("billmaker", headers.getString("billmaker"));//制单人 yonyou99 - praybill.put("dmakedate", formmainData.getString("field0004"));//制单日期 - praybill.put("ctrantypeid", formmainData.getString("field0039"));//请购类型 - praybill.put("bislatest", true);//最新版本 - praybill.put("vdef1",formmainData.getString("field0002")); - praybill.put("creator",headers.getString("creator"));// - praybill.put("fpraysource",headers.getString("fpraysource"));// - praybill.put("ccurrencyid",headers.getString("ccurrencyid"));// - praybill.put("nversion",headers.getString("nversion"));// - praybill.put("nversion",headers.getString("nversion"));// - List parybillList = new LinkedList<>(); - paramObj.put("body",parybillList); - String pk_org = formmainData.getString("field0027"); - String pk_org_v = formmainData.getString("field0051"); - for(int i=0; i collAttachmentList = oaRestUtil.getColAttachments(summaryId, "0", fileApiCode, token); + if (CollectionUtils.isNotEmpty(collAttachmentList)){ + //获取OA token + for (CollAttachmentResDTO collAttachment : collAttachmentList) { + try { + String fileName = URLDecoder.decode(collAttachment.getFilename(), "UTF-8"); + byte[] bytes = oaRestUtil.downloadFileBytes("hzya", fileApiCode, collAttachment.getFileUrl(), fileName, token); + String base64File = Base64.getEncoder().encodeToString(bytes); + JSONObject fileParams = new JSONObject(); + fileParams.put("creator", headers.getString("creator")); + fileParams.put("pk_bill", pk_bill); + fileParams.put("filename",fileName); + fileParams.put("file",base64File); + String result = HttpRequest.post(baseUrl) + .header("appId", "800065")//NCC应用 + .header("apiCode", "8000650001")//NCC附件上传接口 + .header("publicKey", "ZJYAbkr9+XjnDrlfQCRKXtpVvg/BjxqtxzcLgg5TIGagEKJCe7eDIk+3zDUT+v578prj")//OA公钥 + .header("secretKey", "2GR4+yrcx+Ev+pN0Q6V6wxCdvisPX7wzNKBgc5SsIYGxYI5GTISXT6GvTPfp1u2Rj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//OA密钥 + .body(fileParams.toString())//表单内容 + .timeout(30000)//超时,毫秒 + .execute().body(); + logger.info("======OA请购单附件上传到NCC响应参数:{}======",result); + }catch(Exception e){ + e.printStackTrace(); + logger.error("下载OA附件出错:{}",e); + } + } + } + } + + /** + * 组装请购单报文 + * @param headers 请求头 + * @param formmainData 主表数据 + * @param forsonData 子表数据 + * @return + */ + @NotNull + private static JSONArray praybillVaueOf(JSONObject headers, JSONObject formmainData, JSONArray forsonData) { + JSONObject paramObj = new JSONObject(); + JSONObject praybill = new JSONObject(); + paramObj.put("head", praybill); + praybill.put("pk_group", formmainData.getString("field0058"));//集团 + praybill.put("pk_org", formmainData.getString("field0027"));//库存组织 + praybill.put("pk_org_v", formmainData.getString("field0051"));//库存组织v + //praybill.put("vbillcode",formmainData.getString("field0001"));//请购单号 + praybill.put("dbilldate", formmainData.getString("field0004"));//请购日期 + boolean bsctype = false; + if ("1".equals(formmainData.getString("field0009"))){ + bsctype = true; + } + praybill.put("bsctype",bsctype);//委外 + praybill.put("pk_planpsn", formmainData.getString("field0030"));//计划员 + praybill.put("pk_plandept", formmainData.getString("field0052"));//计划部门 + praybill.put("pk_plandept_v", formmainData.getString("field0053"));//计划部门v + praybill.put("vmemo", formmainData.getString("field0013"));//备注 + praybill.put("fbillstatus", headers.getString("fbillstatus"));//单据状态 + praybill.put("bdirecttransit",false);//zhiyun + praybill.put("billmaker", headers.getString("billmaker"));//制单人 yonyou99 + praybill.put("dmakedate", formmainData.getString("field0004"));//制单日期 + praybill.put("ctrantypeid", formmainData.getString("field0039"));//请购类型 + praybill.put("bislatest", true);//最新版本 + praybill.put("vdef1", formmainData.getString("field0037")); + praybill.put("creator", headers.getString("creator"));// + praybill.put("fpraysource", headers.getString("fpraysource"));// + praybill.put("ccurrencyid", headers.getString("ccurrencyid"));// + praybill.put("nversion", headers.getString("nversion"));// + praybill.put("nversion", headers.getString("nversion"));// + List parybillList = new LinkedList<>(); + paramObj.put("body",parybillList); + String pk_org = formmainData.getString("field0027"); + String pk_org_v = formmainData.getString("field0051"); + for(int i = 0; i< forsonData.size(); i++){ + JSONObject forson = forsonData.getJSONObject(i); + JSONObject praybillB = new JSONObject(); + praybillB.put("crowno",forson.getString("field0014")); + praybillB.put("nnum",forson.getString("field0020")); + praybillB.put("pk_org",pk_org); + praybillB.put("pk_org_v",pk_org_v); + praybillB.put("vchangerate","1"); + praybillB.put("pk_srcmaterial",forson.getString("field0054"));//物料pk带版本的那个 + praybillB.put("pk_material",forson.getString("field0031"));//物料pk + praybillB.put("castunitid",forson.getString("field0055"));//计量单位pk + praybillB.put("cunitid",forson.getString("field0055"));//计量单位pk + praybillB.put("nastnum",forson.getString("field0020"));//数量 + praybillB.put("dreqdate",forson.getString("field0021"));//需求日期 + praybillB.put("dsuggestdate",forson.getString("field0022"));//建议订货日期 + praybillB.put("pk_purchaseorg",pk_org);//采购组织 + praybillB.put("pk_purchaseorg_v",pk_org_v);//采购组织 带版本的那个 + praybillB.put("pk_suggestsupplier",forson.getString("field0056"));//建议供应商 + praybillB.put("pk_suggestsupplier_v",forson.getString("field0056"));//建议供应商 + praybillB.put("pk_reqstoorg",pk_org); + praybillB.put("pk_reqstoorg_v",pk_org_v); + praybillB.put("pk_group", formmainData.getString("field0058")); + praybillB.put("browclose","N");//行关闭 + praybillB.put("vbdef1",forson.getString("field0032"));//现存量 + praybillB.put("vbdef2",forson.getString("field0033"));//在途量 + praybillB.put("vbdef3",forson.getString("field0035"));//月度消耗 + praybillB.put("vbdef4",forson.getString("field0034"));//安全库存 + parybillList.add(praybillB); + } + //调用NCC接口 + JSONArray reqParams = new JSONArray(); + reqParams.add(paramObj); + return reqParams; + } + public static void main(String[] args) { String result = "{\"msg\":\"转发失败\",\"type\":null,\"flag\":false,\"status\":\"500\",\"attribute\":{\"code\":\"success\",\"data\":{\"bodyVOList\":[{\"rowno\":\"1\",\"pk_material\":\"1001P1100000000IT34Q\",\"id\":\"1001A3100000001B2UOG\"}],\"headVO\":{\"code\":\"QG2025060800000182\",\"id\":\"1001A3100000001B2UOF\",\"vtrantypeid\":\"1001P1100000000IR21W\"}},\"message\":\"提示:========NCC-请购单保存提交《成功》!!!========。单据信息:《id》 = 1001A3100000001B2UOF ,《code》 = QG2025060800000182\"}}"; JSONObject resultJson = JSONObject.parseObject(result); @@ -195,6 +266,10 @@ public class RequisitionOrderPluginServiceImpl implements IRequisitionOrderPlugi } } } + JSONObject headers =new JSONObject(); + headers.put("creator","1001P1100000000NUULI"); + RequisitionOrderPluginServiceImpl service = new RequisitionOrderPluginServiceImpl(); + service.uploadFile("-333447786976688302",headers,"8000640003","1001A3100000001B4COB"); } //保存日志 public void saveLog(String integration_task_living_details_id, Boolean flag, IntegrationTaskLivingDetailsEntity taskLivingDetail){ diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-plugin.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-plugin.xml index a1c8db1a..c37cfb36 100644 --- a/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-plugin.xml +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/ncc/spring/spring-buildpackage-plugin.xml @@ -2,5 +2,5 @@ - + From 79a7f2a3ab07412fa623c451f96c989f874e7810 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 12 Jun 2025 10:27:27 +0800 Subject: [PATCH 65/67] =?UTF-8?q?=E5=A2=9E=E5=8A=A0app=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sysnew/application/api/entity/SysApplicationApiEntity.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml b/base-service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml index f2d0a1dc..cc0d29be 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml @@ -84,6 +84,7 @@ sys_application_api.id, + sys_application.id as app_id, sys_application.app_id as app_code, sys_application_api.api_code, sys_application_api.api_name, From eed8a9d5355d0264ca64f72dcfdfada94aee0025 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 12 Jun 2025 10:27:41 +0800 Subject: [PATCH 66/67] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=8D=8F=E5=90=8C?= =?UTF-8?q?=E9=99=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java index 56ef19e3..06143106 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java @@ -76,12 +76,12 @@ public class OARestUtil { * @param summaryId col_summary表id * @param attType 0代表附件,2代表关联文档,“0,2”代表附件和关联文档 * @param apiCode 接口编码 + * @param token * @return */ - public List getColAttachments(String summaryId,String attType,String apiCode,String loginName){ + public List getColAttachments(String summaryId,String attType,String apiCode,String token){ if (StrUtil.isNotEmpty(summaryId) && StrUtil.isNotEmpty(apiCode)){ SysApplicationApiEntity sysApp = getByCode(apiCode); - String token = getToken(loginName,sysApp); String appUrl = StrUtil.removeSuffix(sysApp.getAppUrl(),"/"); if (StrUtil.isEmpty(attType)){ attType = "0"; From f9a690a1362d9b94845ba7796802bc0d72ed116e Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 12 Jun 2025 10:28:15 +0800 Subject: [PATCH 67/67] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=B2=A1=E7=94=A8?= =?UTF-8?q?=E7=9A=84=EF=BC=8C=E4=B8=8D=E7=84=B6=E6=89=93=E5=8C=85=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/pom.xml b/pom.xml index 0254f0e5..65118c10 100644 --- a/pom.xml +++ b/pom.xml @@ -471,33 +471,7 @@ maven-war-plugin - - ${basedir}/../base-service/src/main/webapp/WEB-INF/lib - WEB-INF/lib/ - false - - - **/*.jar - - - - ${basedir}/../fw-bip/src/main/webapp/WEB-INF/lib - WEB-INF/lib/ - false - - - **/*.jar - - - - ${basedir}/../fw-ningbobank/src/main/webapp/WEB-INF/lib - WEB-INF/lib/ - false - - - **/*.jar - - +