From af5a85b748fdc793b8d0eab6af05821e4f2525be Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 25 Jul 2024 10:04:11 +0800 Subject: [PATCH 001/101] =?UTF-8?q?=E7=8E=AF=E5=A2=83=E4=BF=AE=E6=94=B9=20?= =?UTF-8?q?2024=E5=B9=B47=E6=9C=8825=E6=97=A5=2010:04:08?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildpackage/src/main/resources/application-xel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildpackage/src/main/resources/application-xel.yml b/buildpackage/src/main/resources/application-xel.yml index 13b3782c..f2a62090 100644 --- a/buildpackage/src/main/resources/application-xel.yml +++ b/buildpackage/src/main/resources/application-xel.yml @@ -6,13 +6,13 @@ logging: encodings: UTF-8 file: # 日志保存路径 - path: /Users/xiangerlin/work/app/logs/ydc + path: /Users/xiangerlin/work/app/logs/dongj spring: datasource: dynamic: datasource: master: - url: jdbc:mysql://hzya.ufyct.com: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 + 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 driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 From 93d9fc2224bfa4656dd5cbbaf554f88f81f00793 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 25 Jul 2024 15:48:51 +0800 Subject: [PATCH 002/101] =?UTF-8?q?=E5=AE=81=E6=B3=A2=E9=93=B6=E8=A1=8C?= =?UTF-8?q?=E4=BA=A4=E6=98=93=E6=98=8E=E7=BB=86=E6=9F=A5=E8=AF=A2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=202024=E5=B9=B47=E6=9C=8825=E6=97=A5=2015:48:44?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/req/AccTransactionReq.java | 190 +++++++ .../dto/res/AccTransactionRes.java | 464 ++++++++++++++++++ .../dto/res/AccTrxResponse.java | 94 ++++ .../dto/res/NingBoResponse.java | 23 + .../service/INingboBankTreasuryService.java | 23 + .../impl/NingboBankTreasuryServiceImpl.java | 105 ++++ 6 files changed, 899 insertions(+) create mode 100644 service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/req/AccTransactionReq.java create mode 100644 service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/res/AccTransactionRes.java create mode 100644 service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/res/AccTrxResponse.java create mode 100644 service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/res/NingBoResponse.java diff --git a/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/req/AccTransactionReq.java b/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/req/AccTransactionReq.java new file mode 100644 index 00000000..07c8e792 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/req/AccTransactionReq.java @@ -0,0 +1,190 @@ +package com.hzya.frame.ningboBankTreasury.dto.req; + +import java.util.List; + +/** + * @Description 交易明细查询请求参数 + * @Author xiangerlin + * @Date 2024/7/24 17:52 + **/ +public class AccTransactionReq { + + //客户号 必填 + private String custId; + //账号列表 每次对多1000个账号 必填 + private List bankAccList; + //增量查询标识,0增量查询 1全量查询 + private String queryFlag; + //增量查询起始时间 yyyy-MM-dd HH:mm:ss + private String recTime; + //开始日期 yyyy-MM-dd + private String beginDate; + //结束日期 yyyy-MM-dd + private String endDate; + //起始金额 + private String beginAmt; + //终止金额 + private String endAmt; + //收支方向 0收入 1支出 + private String cdSign; + //每页条数 + private String pageSize; + //当前页数 + private String currentPage; + //查询方式 0分页查询 1下载文件查询 + private String queryType; + //账户标识 0统计助手 1实体账户 + private String bankAccSign;// + //排序方式,asc正序 desc倒序 + private String sortType; + //单账号当日明细最大序号 + private String singleAccTodayMaxOrderNo; + //币种编码 + private String curCode; + //统计编号 + private List subBankAccList; + + public String getCustId() { + return custId; + } + + public void setCustId(String custId) { + this.custId = custId; + } + + public List getBankAccList() { + return bankAccList; + } + + public void setBankAccList(List bankAccList) { + this.bankAccList = bankAccList; + } + + public String getQueryFlag() { + return queryFlag; + } + + public void setQueryFlag(String queryFlag) { + this.queryFlag = queryFlag; + } + + public String getRecTime() { + return recTime; + } + + public void setRecTime(String recTime) { + this.recTime = recTime; + } + + public String getBeginDate() { + return beginDate; + } + + public void setBeginDate(String beginDate) { + this.beginDate = beginDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getBeginAmt() { + return beginAmt; + } + + public void setBeginAmt(String beginAmt) { + this.beginAmt = beginAmt; + } + + public String getEndAmt() { + return endAmt; + } + + public void setEndAmt(String endAmt) { + this.endAmt = endAmt; + } + + public String getCdSign() { + return cdSign; + } + + public void setCdSign(String cdSign) { + this.cdSign = cdSign; + } + + public String getPageSize() { + return pageSize; + } + + public void setPageSize(String pageSize) { + this.pageSize = pageSize; + } + + public String getCurrentPage() { + return currentPage; + } + + public void setCurrentPage(String currentPage) { + this.currentPage = currentPage; + } + + public String getQueryType() { + return queryType; + } + + public void setQueryType(String queryType) { + this.queryType = queryType; + } + + public String getBankAccSign() { + return bankAccSign; + } + + public void setBankAccSign(String bankAccSign) { + this.bankAccSign = bankAccSign; + } + + public String getSortType() { + return sortType; + } + + public void setSortType(String sortType) { + this.sortType = sortType; + } + + public String getSingleAccTodayMaxOrderNo() { + return singleAccTodayMaxOrderNo; + } + + public void setSingleAccTodayMaxOrderNo(String singleAccTodayMaxOrderNo) { + this.singleAccTodayMaxOrderNo = singleAccTodayMaxOrderNo; + } + + public String getCurCode() { + return curCode; + } + + public void setCurCode(String curCode) { + this.curCode = curCode; + } + + public List getSubBankAccList() { + return subBankAccList; + } + + public void setSubBankAccList(List subBankAccList) { + this.subBankAccList = subBankAccList; + } + public AccTransactionReq() { + + } + + public AccTransactionReq(String custId, List bankAccList) { + this.custId = custId; + this.bankAccList = bankAccList; + } +} diff --git a/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/res/AccTransactionRes.java b/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/res/AccTransactionRes.java new file mode 100644 index 00000000..2fc543c4 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/res/AccTransactionRes.java @@ -0,0 +1,464 @@ +package com.hzya.frame.ningboBankTreasury.dto.res; + +/** + * @Description 宁波银行 境内交易明细返回参数 + * @Author xiangerlin + * @Date 2024/7/24 16:53 + **/ +public class AccTransactionRes { + //账号 + private String bankAcc; + private String bankSubAcc; + //户名 + private String accName; + //开户行名 + private String bankName; + //对方户名 + private String oppAccName; + //对方账号 + private String oppAccNo; + //对方开户行名 + private String oppAccBank; + //收支方向 0支出 1支出 + private String cdSign; + //业务类型 收、支、其他 + private String cdSignName; + //交易金额 + private String amt; + //明细余额 + private String bal; + //时间 + private String transTime; + //子流水号 + private String subSerialNo; + //交易流水号 + private String serialNo; + //币种编号 + private String curCode; + //用途 + private String uses; + //摘要 + private String abs; + //回单匹配号 + private String voucherNo; + //银行类别代码 + private String bifCode; + //银行类别 + private String bankType; + //对方银行类别 + private String oppBankType; + //对公、对私标志 0对公 1对私 + private String isForIndividual; + //流水号 这个字段是唯一的 + private String serialId; + //银行交易流水号 + private String bankSerialId; + //集团内交易 + private String groupTrans; + //资金划拨 + private String capitalTrans; + //交易备注 + private String postScript; + private String accType; + private String accTypeName; + //现转标识 + private String cashTfrFlg; + //国 开 行 所属 分 行号 + private String chinaDevelopBankNo; + //国 开 行 所属 账号类型 + private String chinaDevelopAccType; + //支付匹配号 + private String payBillCode; + //业务基础订单号 + private String alipayBaseOrderNumber; + //业务描述 + private String alipayBusinessDescription; + //备注1 + private String labelValue1; + private String labelValue2; + private String labelValue3; + private String labelValue4; + private String downloadNo; + //排序规则 + private String sortRule; + //明细编码 + private String orderNo; + //商品名称 + private String alipayTradeName; + //回单匹配号 + private String matchCode; + //回单个性化描述 + private String receiptInfo; + //凭证号 + private String billNum; + //明细更新时间 + private String recTime; + + public String getBankAcc() { + return bankAcc; + } + + public void setBankAcc(String bankAcc) { + this.bankAcc = bankAcc; + } + + public String getBankSubAcc() { + return bankSubAcc; + } + + public void setBankSubAcc(String bankSubAcc) { + this.bankSubAcc = bankSubAcc; + } + + public String getAccName() { + return accName; + } + + public void setAccName(String accName) { + this.accName = accName; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getOppAccNo() { + return oppAccNo; + } + + public void setOppAccNo(String oppAccNo) { + this.oppAccNo = oppAccNo; + } + + public String getOppAccBank() { + return oppAccBank; + } + + public void setOppAccBank(String oppAccBank) { + this.oppAccBank = oppAccBank; + } + + public String getCdSign() { + return cdSign; + } + + public void setCdSign(String cdSign) { + this.cdSign = cdSign; + } + + public String getCdSignName() { + return cdSignName; + } + + public void setCdSignName(String cdSignName) { + this.cdSignName = cdSignName; + } + + public String getAmt() { + return amt; + } + + public void setAmt(String amt) { + this.amt = amt; + } + + public String getBal() { + return bal; + } + + public void setBal(String bal) { + this.bal = bal; + } + + public String getTransTime() { + return transTime; + } + + public void setTransTime(String transTime) { + this.transTime = transTime; + } + + public String getSubSerialNo() { + return subSerialNo; + } + + public void setSubSerialNo(String subSerialNo) { + this.subSerialNo = subSerialNo; + } + + public String getSerialNo() { + return serialNo; + } + + public void setSerialNo(String serialNo) { + this.serialNo = serialNo; + } + + public String getCurCode() { + return curCode; + } + + public void setCurCode(String curCode) { + this.curCode = curCode; + } + + public String getUses() { + return uses; + } + + public void setUses(String uses) { + this.uses = uses; + } + + public String getAbs() { + return abs; + } + + public void setAbs(String abs) { + this.abs = abs; + } + + public String getVoucherNo() { + return voucherNo; + } + + public void setVoucherNo(String voucherNo) { + this.voucherNo = voucherNo; + } + + public String getBifCode() { + return bifCode; + } + + public void setBifCode(String bifCode) { + this.bifCode = bifCode; + } + + public String getBankType() { + return bankType; + } + + public void setBankType(String bankType) { + this.bankType = bankType; + } + + public String getOppBankType() { + return oppBankType; + } + + public void setOppBankType(String oppBankType) { + this.oppBankType = oppBankType; + } + + public String getIsForIndividual() { + return isForIndividual; + } + + public void setIsForIndividual(String isForIndividual) { + this.isForIndividual = isForIndividual; + } + + public String getSerialId() { + return serialId; + } + + public void setSerialId(String serialId) { + this.serialId = serialId; + } + + public String getBankSerialId() { + return bankSerialId; + } + + public void setBankSerialId(String bankSerialId) { + this.bankSerialId = bankSerialId; + } + + public String getGroupTrans() { + return groupTrans; + } + + public void setGroupTrans(String groupTrans) { + this.groupTrans = groupTrans; + } + + public String getCapitalTrans() { + return capitalTrans; + } + + public void setCapitalTrans(String capitalTrans) { + this.capitalTrans = capitalTrans; + } + + public String getPostScript() { + return postScript; + } + + public void setPostScript(String postScript) { + this.postScript = postScript; + } + + public String getAccType() { + return accType; + } + + public void setAccType(String accType) { + this.accType = accType; + } + + public String getAccTypeName() { + return accTypeName; + } + + public void setAccTypeName(String accTypeName) { + this.accTypeName = accTypeName; + } + + public String getCashTfrFlg() { + return cashTfrFlg; + } + + public void setCashTfrFlg(String cashTfrFlg) { + this.cashTfrFlg = cashTfrFlg; + } + + public String getChinaDevelopBankNo() { + return chinaDevelopBankNo; + } + + public void setChinaDevelopBankNo(String chinaDevelopBankNo) { + this.chinaDevelopBankNo = chinaDevelopBankNo; + } + + public String getChinaDevelopAccType() { + return chinaDevelopAccType; + } + + public void setChinaDevelopAccType(String chinaDevelopAccType) { + this.chinaDevelopAccType = chinaDevelopAccType; + } + + public String getPayBillCode() { + return payBillCode; + } + + public void setPayBillCode(String payBillCode) { + this.payBillCode = payBillCode; + } + + public String getAlipayBaseOrderNumber() { + return alipayBaseOrderNumber; + } + + public void setAlipayBaseOrderNumber(String alipayBaseOrderNumber) { + this.alipayBaseOrderNumber = alipayBaseOrderNumber; + } + + public String getAlipayBusinessDescription() { + return alipayBusinessDescription; + } + + public void setAlipayBusinessDescription(String alipayBusinessDescription) { + this.alipayBusinessDescription = alipayBusinessDescription; + } + + public String getLabelValue1() { + return labelValue1; + } + + public void setLabelValue1(String labelValue1) { + this.labelValue1 = labelValue1; + } + + public String getLabelValue2() { + return labelValue2; + } + + public void setLabelValue2(String labelValue2) { + this.labelValue2 = labelValue2; + } + + public String getLabelValue3() { + return labelValue3; + } + + public void setLabelValue3(String labelValue3) { + this.labelValue3 = labelValue3; + } + + public String getLabelValue4() { + return labelValue4; + } + + public void setLabelValue4(String labelValue4) { + this.labelValue4 = labelValue4; + } + + public String getDownloadNo() { + return downloadNo; + } + + public void setDownloadNo(String downloadNo) { + this.downloadNo = downloadNo; + } + + public String getSortRule() { + return sortRule; + } + + public void setSortRule(String sortRule) { + this.sortRule = sortRule; + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public String getAlipayTradeName() { + return alipayTradeName; + } + + public void setAlipayTradeName(String alipayTradeName) { + this.alipayTradeName = alipayTradeName; + } + + public String getMatchCode() { + return matchCode; + } + + public void setMatchCode(String matchCode) { + this.matchCode = matchCode; + } + + public String getReceiptInfo() { + return receiptInfo; + } + + public void setReceiptInfo(String receiptInfo) { + this.receiptInfo = receiptInfo; + } + + public String getBillNum() { + return billNum; + } + + public void setBillNum(String billNum) { + this.billNum = billNum; + } + + public String getRecTime() { + return recTime; + } + + public void setRecTime(String recTime) { + this.recTime = recTime; + } +} diff --git a/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/res/AccTrxResponse.java b/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/res/AccTrxResponse.java new file mode 100644 index 00000000..a4bfd6f8 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/res/AccTrxResponse.java @@ -0,0 +1,94 @@ +package com.hzya.frame.ningboBankTreasury.dto.res; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSONObject; + +import java.util.List; + +/** + * @Description 宁波银行查询交易明细 + * @Author xiangerlin + * @Date 2024/7/24 16:45 + **/ +public class AccTrxResponse { + //返回交易码 0000成功,0001失败 + private String retCode; + //返回信息 + private String retMsg; + //每条页数 + private String pageSize; + //当前页数 + private String currentPage; + //总页数 + private String totalPage; + //总条数 + private String totalSize; + //收款明细列表 + private List list; + + public String getRetCode() { + return retCode; + } + + public void setRetCode(String retCode) { + this.retCode = retCode; + } + + public String getRetMsg() { + return retMsg; + } + + public void setRetMsg(String retMsg) { + this.retMsg = retMsg; + } + + public String getPageSize() { + return pageSize; + } + + public void setPageSize(String pageSize) { + this.pageSize = pageSize; + } + + public String getCurrentPage() { + return currentPage; + } + + public void setCurrentPage(String currentPage) { + this.currentPage = currentPage; + } + + public String getTotalPage() { + return totalPage; + } + + public void setTotalPage(String totalPage) { + this.totalPage = totalPage; + } + + public String getTotalSize() { + return totalSize; + } + + public void setTotalSize(String totalSize) { + this.totalSize = totalSize; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public static AccTrxResponse valueOf(String str){ + if (StrUtil.isNotEmpty(str) && JSONUtil.isTypeJSON(str)){ + NingBoResponse ningBoResponse = JSONObject.parseObject(str,NingBoResponse.class); + AccTrxResponse accTrxResponse = ningBoResponse.getData().toJavaObject(AccTrxResponse.class); + return accTrxResponse; + } + return null; + } +} diff --git a/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/res/NingBoResponse.java b/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/res/NingBoResponse.java new file mode 100644 index 00000000..c639c437 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/res/NingBoResponse.java @@ -0,0 +1,23 @@ +package com.hzya.frame.ningboBankTreasury.dto.res; + +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.annotation.JSONField; + +/** + * @Description 宁波银行返回对象 + * @Author xiangerlin + * @Date 2024/7/24 17:46 + **/ +public class NingBoResponse { + + @JSONField(name ="Data") + private JSONObject data; + + public JSONObject getData() { + return data; + } + + public void setData(JSONObject data) { + this.data = data; + } +} diff --git a/service/src/main/java/com/hzya/frame/ningboBankTreasury/service/INingboBankTreasuryService.java b/service/src/main/java/com/hzya/frame/ningboBankTreasury/service/INingboBankTreasuryService.java index d4f0b098..acc6f315 100644 --- a/service/src/main/java/com/hzya/frame/ningboBankTreasury/service/INingboBankTreasuryService.java +++ b/service/src/main/java/com/hzya/frame/ningboBankTreasury/service/INingboBankTreasuryService.java @@ -1,9 +1,14 @@ package com.hzya.frame.ningboBankTreasury.service; import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.ningboBankTreasury.dto.req.AccTransactionReq; +import com.hzya.frame.ningboBankTreasury.dto.res.AccTransactionRes; +import com.hzya.frame.ningboBankTreasury.dto.res.AccTrxResponse; import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; import com.hzya.frame.web.entity.JsonResultEntity; +import java.util.List; + public interface INingboBankTreasuryService { @@ -25,4 +30,22 @@ public interface INingboBankTreasuryService { * */ SysExtensionApiEntity doChangeData(SysExtensionApiEntity entity); + + /** + * 银行原生方法 + * 分页方式 全量查询境内账户交易明细 + * accTransactionReq.custId 客户号 必填 + * accTransactionReq.bankAccList 账号列表 必填 + * @param accTransactionReq + * @return + */ + List queryAccDetails(AccTransactionReq accTransactionReq); + + /** + * esb方法 + * 分页方式 全量查询境内账户交易明细 + * @param jsonObject + * @return + */ + JsonResultEntity queryAccountDetailsEsb(JSONObject jsonObject); } diff --git a/service/src/main/java/com/hzya/frame/ningboBankTreasury/service/impl/NingboBankTreasuryServiceImpl.java b/service/src/main/java/com/hzya/frame/ningboBankTreasury/service/impl/NingboBankTreasuryServiceImpl.java index 488eb869..ac09ca58 100644 --- a/service/src/main/java/com/hzya/frame/ningboBankTreasury/service/impl/NingboBankTreasuryServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/ningboBankTreasury/service/impl/NingboBankTreasuryServiceImpl.java @@ -1,8 +1,13 @@ package com.hzya.frame.ningboBankTreasury.service.impl; +import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.bip.v3.v2207.dps.service.impl.PayMentServiceImpl; +import com.hzya.frame.ningboBankTreasury.dto.req.AccTransactionReq; +import com.hzya.frame.ningboBankTreasury.dto.res.AccTransactionRes; +import com.hzya.frame.ningboBankTreasury.dto.res.AccTrxResponse; import com.hzya.frame.ningboBankTreasury.service.INingboBankTreasuryService; +import com.hzya.frame.ningboBankTreasury.util.BingboBankUtil; import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; import com.hzya.frame.sysnew.application.plugin.entity.SysApplicationPluginEntity; import com.hzya.frame.util.bipV3.SHA256Util; @@ -16,7 +21,9 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; @@ -81,6 +88,104 @@ public class NingboBankTreasuryServiceImpl implements INingboBankTreasuryService } } + /** + * 分页方式 全量查询境内账户交易明细 + * accTransactionReq.custId 客户号 必填 + * accTransactionReq.bankAccList 账号列表 必填 + * + * @param accTransactionReq + * @return + */ + @Override + public List queryAccDetails(AccTransactionReq accTransactionReq) { + accTransactionReq = defValue(accTransactionReq); + //当前页数 + int currentPage = Integer.valueOf(accTransactionReq.getCurrentPage()); + //总页数 + int totalPage = 0; + JSONObject data = new JSONObject(); + List resList = new ArrayList<>(); + try { + do { + ConfigParam configParam = new ConfigParam("MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgTt6OadouxxxSDg/0SZdOIBqtnFGKrpwmL+quEUf+hfSgCgYIKoEcz1UBgi2hRANCAAQGHNN2NO7btp+w1248yk98E0asGC8sG0bmIzdom4M0xp3vc4IfXjmZ8omUz4oVcjzAuyMSSpJM6uPLcU1SH4HZ","http://cz-test.nbcb.com.cn:7070/nbcb/api","54b3e05c-7983-4e6c-8920-f9ab8a0004a6","MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEXAt6fxeKlpREIyXoT3jDwGU7L6JkKrzdOKP1cMB14rtNwwlyaUGLrtuHVoArAHP3x7XN2rUw0GxSngYQwOAsjQ==",10000,20000); + OpenSDK.dynamicInit(configParam,true); + data.put("Data",JSONObject.toJSONString(accTransactionReq)); + logger.info("查询交易明细请求参数:{}",data.toString()); + String returnData = OpenSDK.send(BingboBankUtil.TMSREPORT,BingboBankUtil.QUERYACCDETAIL,data.toString()); + System.out.println(returnData); + logger.info("查询交易明细返回数据:{}",returnData); + AccTrxResponse accTrxResponse = AccTrxResponse.valueOf(returnData); + if (null != accTrxResponse && BingboBankUtil.isSuccess(accTrxResponse.getRetCode())){ + totalPage = Integer.valueOf(accTrxResponse.getTotalPage()); + resList.addAll(accTrxResponse.getList()); + } + currentPage++;//页码自增 + accTransactionReq.setCurrentPage(String.valueOf(currentPage));//页码 + }while (currentPage <= totalPage);//当前页 <= 总页数 继续循环 + } catch (Exception e) { + logger.error("查询账户交易明细出错:{}",e); + } + return resList; + } + + /** + * esb方法 + * 分页方式 全量查询境内账户交易明细 + * + * @param jsonObject + * @return + */ + @Override + public JsonResultEntity queryAccountDetailsEsb(JSONObject jsonObject) { + JSONObject entity = getstrObj("jsonStr", jsonObject); + String dataJson = entity.getJSONObject("Data").getString("Data"); + AccTransactionReq accTransactionReq = JSONObject.parseObject(dataJson,AccTransactionReq.class ); + accTransactionReq = defValue(accTransactionReq); + //当前页数 + int currentPage = Integer.valueOf(accTransactionReq.getCurrentPage()); + //总页数 + int totalPage = 0; + JSONObject data = new JSONObject(); + List resList = new ArrayList<>(); + try { + do { + data.put("Data",JSONObject.toJSONString(accTransactionReq)); + entity.put("Data",data); + JSONObject param = new JSONObject(); + param.put("jsonStr",entity); + JSONObject returnObj = (JSONObject) sendNbBank(param); + logger.info("查询交易明细返回数据:{}",returnObj.toString()); + AccTrxResponse accTrxResponse = AccTrxResponse.valueOf(returnObj.toString()); + if (null != accTrxResponse && BingboBankUtil.isSuccess(accTrxResponse.getRetCode())){ + totalPage = Integer.valueOf(accTrxResponse.getTotalPage()); + resList.addAll(accTrxResponse.getList()); + } + currentPage++;//页码自增 + accTransactionReq.setCurrentPage(String.valueOf(currentPage));//页码 + }while (currentPage <= totalPage);//当前页 <= 总页数 继续循环 + } catch (Exception e) { + logger.error("查询账户交易明细出错:{}",e); + return BaseResult.getFailureMessageEntity("查询账户交易明细出错"+e.getMessage()); + } + return BaseResult.getSuccessMessageEntity("查询账户交易明细成功",resList); + } + + //默认值检查 + private AccTransactionReq defValue(AccTransactionReq accTransactionReq){ + if (StrUtil.isEmpty(accTransactionReq.getPageSize())){ + accTransactionReq.setPageSize("1000"); + } + if (StrUtil.isEmpty(accTransactionReq.getCurrentPage())){ + accTransactionReq.setCurrentPage("1"); + } + if (StrUtil.isEmpty(accTransactionReq.getQueryType())){ + accTransactionReq.setQueryType("0"); + } + if (StrUtil.isEmpty(accTransactionReq.getCdSign())){ + accTransactionReq.setCdSign("0"); + } + return accTransactionReq; + } /** * @param entity * @content 此方法获取初始化参数,拼接请求参数 From e5c27bd860cac9fadf622a503a8d250993d6714b Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Fri, 26 Jul 2024 14:14:32 +0800 Subject: [PATCH 003/101] =?UTF-8?q?=E4=B8=9C=E8=BF=9B=E9=85=8D=E7=BD=AE=20?= =?UTF-8?q?=E5=8F=AApush=E4=BA=86dongj=E8=BF=99=E4=B8=AA=E5=88=86=E6=94=AF?= =?UTF-8?q?=202024=E5=B9=B47=E6=9C=8826=E6=97=A5=2014:14:06?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dongj.yml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 buildpackage/src/main/resources/application-dongj.yml diff --git a/buildpackage/src/main/resources/application-dongj.yml b/buildpackage/src/main/resources/application-dongj.yml new file mode 100644 index 00000000..e6734d2a --- /dev/null +++ b/buildpackage/src/main/resources/application-dongj.yml @@ -0,0 +1,35 @@ +#######################dev环境####################### +logging: + #日志级别 指定目录级别 + level: + root: warn + encodings: UTF-8 + file: + # 日志保存路径 + path: /home/webservice/zt/log +spring: + datasource: + dynamic: + datasource: + 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 + driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 +savefile: + # 文件保存路径 + path: /home/webservice/zt/file +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/ +OA: + data_source_code: djoatest \ No newline at end of file From 11d418a5b3fd1682681ab0854b870988c693b917 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Fri, 26 Jul 2024 15:16:39 +0800 Subject: [PATCH 004/101] =?UTF-8?q?=E6=94=B6=E6=AC=BE=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=202024=E5=B9=B47=E6=9C=8826=E6=97=A5=2015:16?= =?UTF-8?q?:33?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/AccLogPluginInitializer.java | 136 ++++++++++++++++++ .../service/INingboBankPluginService.java | 19 +++ .../impl/NingboBankPluginServiceImpl.java | 95 ++++++++++++ 3 files changed, 250 insertions(+) create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/AccLogPluginInitializer.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/AccLogPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/AccLogPluginInitializer.java new file mode 100644 index 00000000..602932c2 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/AccLogPluginInitializer.java @@ -0,0 +1,136 @@ +package com.hzya.frame.plugin.a8bill.plugin; + +import cn.hutool.core.convert.Convert; +import cn.hutool.core.map.MapBuilder; +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.ningboBankTreasury.dto.req.AccTransactionReq; +import com.hzya.frame.ningboBankTreasury.dto.res.AccTransactionRes; +import com.hzya.frame.ningboBankTreasury.util.NingboBankUtil; +import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService; +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; +import java.util.Map; + +/** + * @Description 查询宁波银行账户交易明细 保存到OA + * @Author xiangerlin + * @Date 2024/7/25 16:24 + **/ +public class AccLogPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private INingboBankPluginService ningboBankPluginService; + /*** + * 插件初始化方法 + * @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 "AccLogPlugin"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "查询交易明细插件"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "AccLogPlugin"; + } + + /*** + * 插件类型 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 { + //1、查询宁波银行的交易记录 + AccTransactionReq accTransactionReq = new AccTransactionReq(); + accTransactionReq.setCdSign(NingboBankUtil.SHOURU); + accTransactionReq.setBeginDate("2024-05-01"); + accTransactionReq.setEndDate("2024-05-30"); + accTransactionReq.setBankAccList(Convert.toList(String.class,"86041110000110293,86041110000109337,6223160030547665,6214180002001411023,6214180000002609736")); + Map headerMap = MapBuilder.create(true) + .put("apiCode", "8000360002") + .put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj") + .put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") + .put("appId","800036") + .build(); + String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(JSONObject.toJSONString(accTransactionReq)).timeout(60000).execute().body(); + System.out.println(body); + if (StrUtil.isNotEmpty(body)){ + JSONObject response = JSONObject.parseObject(body); + if (response.getBoolean("flag")){ + List accTransactionResList = JSONObject.parseArray(response.getJSONObject("attribute").getString("attribute"), AccTransactionRes.class); + //2、保存到OA底表 + if (CollectionUtils.isNotEmpty(accTransactionResList)){ + ningboBankPluginService.saveAccLog(accTransactionResList); + } + return BaseResult.getSuccessMessageEntity(getPluginName()+"执行成功:{}",accTransactionResList); + } + } + return BaseResult.getSuccessMessageEntity(getPluginName()+"执行成功"); + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java new file mode 100644 index 00000000..72ed2d87 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java @@ -0,0 +1,19 @@ +package com.hzya.frame.plugin.a8bill.service; + +import com.hzya.frame.ningboBankTreasury.dto.res.AccTransactionRes; + +import java.util.List; + +/** + * @Description 宁波银行插件用 + * @Author xiangerlin + * @Date 2024/7/25 16:33 + **/ +public interface INingboBankPluginService { + + /** + * 保存收款日志到oa底表 + * @param accTransactionResList + */ + void saveAccLog(List accTransactionResList); +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java new file mode 100644 index 00000000..2dcbf164 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java @@ -0,0 +1,95 @@ +package com.hzya.frame.plugin.a8bill.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 com.alibaba.fastjson.JSONObject; +import com.hzya.frame.ningboBankTreasury.dto.res.AccTransactionRes; +import com.hzya.frame.ningboBankTreasury.enums.CurrencyEnum; +import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService; +import com.hzya.frame.seeyon.dongj.entity.Formmain0044Entity; +import com.hzya.frame.seeyon.dongj.service.IFormmain0044Service; +import com.hzya.frame.stringutil.StringUtil; +import org.apache.commons.collections.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @Description 宁波银行插件用 + * @Author xiangerlin + * @Date 2024/7/25 16:34 + **/ +public class NingboBankPluginServiceImpl implements INingboBankPluginService { + +@Autowired +private IFormmain0044Service formmain0044Service; + + @Value("${OA.data_source_code}") + private String oa_data_source_code; + /** + * 保存收款日志到oa底表 + * @param accTransactionResList + */ + @Override + public void saveAccLog(List accTransactionResList) { + if (CollectionUtils.isNotEmpty(accTransactionResList)){ + //查询已经存在的数据 + Formmain0044Entity formmain0044 = new Formmain0044Entity(); + formmain0044.setStart_date(DateUtil.lastWeek().toDateStr()); + formmain0044.setDataSourceCode(oa_data_source_code); + List formmain0044List = formmain0044Service.querySeridId(formmain0044); + //过滤已保存的数据 + if (CollectionUtils.isNotEmpty(formmain0044List) && CollectionUtils.isNotEmpty(accTransactionResList)){ + accTransactionResList = accTransactionResList.stream() + .filter(acc -> formmain0044List.stream() + .noneMatch(f -> acc.getSerialId().equals(f.getField0018()))) + .collect(Collectors.toList()); + } + if (CollectionUtils.isNotEmpty(accTransactionResList)){ + for (AccTransactionRes accTransactionRes : accTransactionResList) { + String bankAcc = StringUtil.nullConvert(accTransactionRes.getBankAcc()); + String bankName = StringUtil.nullConvert(accTransactionRes.getBankName()); + String accName = StringUtil.nullConvert(accTransactionRes.getAccName()); + String oppAccNo = StringUtil.nullConvert(accTransactionRes.getOppAccNo()); + String oppAccName = StringUtil.nullConvert(accTransactionRes.getOppAccName()); + String oppAccBank = StringUtil.nullConvert(accTransactionRes.getOppAccBank()); + String transTime = StringUtil.nullConvert(accTransactionRes.getTransTime()); + //这个是唯一的 + String serialId = StringUtil.nullConvert(StringUtil.replaceBlank(accTransactionRes.getSerialId())); + String amt = StringUtil.nullConvert(accTransactionRes.getAmt()); + String abs = StringUtil.nullConvert(accTransactionRes.getAbs()); + String bankType = StringUtil.nullConvert(accTransactionRes.getBankType()); + String serialNo = StringUtil.nullConvert(accTransactionRes.getSerialNo()); + String currency = StringUtil.nullConvert(CurrencyEnum.getNameByCode(accTransactionRes.getCurCode())); + String uses = StringUtil.nullConvert(accTransactionRes.getUses()); + String curCode = StringUtil.nullConvert(accTransactionRes.getCurCode()); + String postScript = StringUtil.nullConvert(accTransactionRes.getPostScript()); + String data = StrUtil.format(getAccLogXmlTemplate(),bankAcc,bankName,accName,oppAccNo,oppAccName,oppAccBank,transTime,serialId,amt,abs,bankType,serialNo,currency,uses,postScript,curCode); + JSONObject paramsTemplate = new JSONObject(); + paramsTemplate.put("loginName", "oa1"); + paramsTemplate.put("dataXml", data); + Map header = MapBuilder.create(true) + .put("apiCode", "8000340006") + .put("publicKey","ZJYAA9Z/jWMe1rC+Sjh8NVMRtwVMb5Bn0DbmIEsgpVlR3C9Ce7eDIk+3zDUT+v578prj") + .put("secretKey","B8sgQwEaskwM7BQj1XLvu3kdKD3xm7Lyd4FWsPaFQk5v+UtQLCkzVzLlCZ9Bdyv2j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") + .put("appId","800034") + .build(); + String res = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(header).body(paramsTemplate.toString()).timeout(60000).execute().body(); + System.out.println("保存oa底表结果:"+res); + } + } + } + } + + + private static String getAccLogXmlTemplate(){ + // return ""; + return ""; + } +} From 4f798570f08dc15edf275f9b25ea6a79fb7afbfb Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Fri, 26 Jul 2024 15:18:47 +0800 Subject: [PATCH 005/101] =?UTF-8?q?=E6=94=B6=E6=AC=BE=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=202024=E5=B9=B47=E6=9C=8826=E6=97=A5=2015:18?= =?UTF-8?q?:41?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../seeyon/dongj/dao/IFormmain0044Dao.java | 12 ++ .../dongj/dao/impl/Formmain0044DaoImpl.java | 15 ++ .../dongj/entity/Formmain0044Entity.java | 146 ++++++++++++++++++ .../dongj/entity/Formmain0044Entity.xml | 57 +++++++ .../dongj/service/IFormmain0044Service.java | 16 ++ .../service/impl/Formmain0044ServiceImpl.java | 40 +++++ .../seeyon/service/ISeeyonExtService.java | 7 + .../service/impl/SeeyonExtServiceImpl.java | 20 +++ 8 files changed, 313 insertions(+) create mode 100644 service/src/main/java/com/hzya/frame/seeyon/dongj/dao/IFormmain0044Dao.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/dongj/dao/impl/Formmain0044DaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/dongj/entity/Formmain0044Entity.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/dongj/entity/Formmain0044Entity.xml create mode 100644 service/src/main/java/com/hzya/frame/seeyon/dongj/service/IFormmain0044Service.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/dongj/service/impl/Formmain0044ServiceImpl.java diff --git a/service/src/main/java/com/hzya/frame/seeyon/dongj/dao/IFormmain0044Dao.java b/service/src/main/java/com/hzya/frame/seeyon/dongj/dao/IFormmain0044Dao.java new file mode 100644 index 00000000..d663715e --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/dongj/dao/IFormmain0044Dao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.seeyon.dongj.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.seeyon.dongj.entity.Formmain0044Entity; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/7/26 11:01 + **/ +public interface IFormmain0044Dao extends IBaseDao { +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/dongj/dao/impl/Formmain0044DaoImpl.java b/service/src/main/java/com/hzya/frame/seeyon/dongj/dao/impl/Formmain0044DaoImpl.java new file mode 100644 index 00000000..6615da88 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/dongj/dao/impl/Formmain0044DaoImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.seeyon.dongj.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.dongj.dao.IFormmain0044Dao; +import com.hzya.frame.seeyon.dongj.entity.Formmain0044Entity; +import org.springframework.stereotype.Repository; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/7/26 11:02 + **/ +@Repository() +public class Formmain0044DaoImpl extends MybatisGenericDao implements IFormmain0044Dao { +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/dongj/entity/Formmain0044Entity.java b/service/src/main/java/com/hzya/frame/seeyon/dongj/entity/Formmain0044Entity.java new file mode 100644 index 00000000..6591f817 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/dongj/entity/Formmain0044Entity.java @@ -0,0 +1,146 @@ +package com.hzya.frame.seeyon.dongj.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description oa收款明细底表 + * @Author xiangerlin + * @Date 2024/7/26 10:56 + **/ +public class Formmain0044Entity extends BaseEntity { + private String field0001; // 我方账号 + private String field0017; // 我方开户行 + private String field0024; // 我方户名 + private String field0029; // 客户方账号 + private String field0022; // 客户方户名 + private String field0030; // 客户方开户行 + private String field0018; // 交易日期 + private String field0019; // 交易流水号 唯一值 + private String field0020; // 收款金额 + private String field0021; // 摘要 + private String field0025; // 银行类型 + private String field0026; // 银行流水号 + private String field0027; // 币种 + private String field0028; // 用途 + private String start_date; + + public String getField0001() { + return field0001; + } + + public void setField0001(String field0001) { + this.field0001 = field0001; + } + + public String getField0017() { + return field0017; + } + + public void setField0017(String field0017) { + this.field0017 = field0017; + } + + public String getField0024() { + return field0024; + } + + public void setField0024(String field0024) { + this.field0024 = field0024; + } + + public String getField0029() { + return field0029; + } + + public void setField0029(String field0029) { + this.field0029 = field0029; + } + + public String getField0022() { + return field0022; + } + + public void setField0022(String field0022) { + this.field0022 = field0022; + } + + public String getField0030() { + return field0030; + } + + public void setField0030(String field0030) { + this.field0030 = field0030; + } + + 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 getField0020() { + return field0020; + } + + public void setField0020(String field0020) { + this.field0020 = field0020; + } + + public String getField0021() { + return field0021; + } + + public void setField0021(String field0021) { + this.field0021 = field0021; + } + + public String getField0025() { + return field0025; + } + + public void setField0025(String field0025) { + this.field0025 = field0025; + } + + public String getField0026() { + return field0026; + } + + public void setField0026(String field0026) { + this.field0026 = field0026; + } + + public String getField0027() { + return field0027; + } + + public void setField0027(String field0027) { + this.field0027 = field0027; + } + + public String getField0028() { + return field0028; + } + + public void setField0028(String field0028) { + this.field0028 = field0028; + } + + public String getStart_date() { + return start_date; + } + + public void setStart_date(String start_date) { + this.start_date = start_date; + } +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/dongj/entity/Formmain0044Entity.xml b/service/src/main/java/com/hzya/frame/seeyon/dongj/entity/Formmain0044Entity.xml new file mode 100644 index 00000000..cad8daea --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/dongj/entity/Formmain0044Entity.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + id, + field0001, + field0017, + field0024, + field0029, + field0022, + field0030, + field0018, + field0019, + field0020, + field0021, + field0025, + field0026, + field0027, + field0028 + + + + + + + + + diff --git a/service/src/main/java/com/hzya/frame/seeyon/dongj/service/IFormmain0044Service.java b/service/src/main/java/com/hzya/frame/seeyon/dongj/service/IFormmain0044Service.java new file mode 100644 index 00000000..5c1a41d2 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/dongj/service/IFormmain0044Service.java @@ -0,0 +1,16 @@ +package com.hzya.frame.seeyon.dongj.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.dongj.entity.Formmain0044Entity; + +import java.util.List; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/7/26 11:03 + **/ +public interface IFormmain0044Service extends IBaseService { + + List querySeridId(Formmain0044Entity entity); +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/dongj/service/impl/Formmain0044ServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/dongj/service/impl/Formmain0044ServiceImpl.java new file mode 100644 index 00000000..fcf666f0 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/dongj/service/impl/Formmain0044ServiceImpl.java @@ -0,0 +1,40 @@ +package com.hzya.frame.seeyon.dongj.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity; +import com.hzya.frame.seeyon.cbs8.service.ICbsLogService; +import com.hzya.frame.seeyon.dongj.dao.IFormmain0044Dao; +import com.hzya.frame.seeyon.dongj.entity.Formmain0044Entity; +import com.hzya.frame.seeyon.dongj.service.IFormmain0044Service; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/7/26 11:05 + **/ +@Service +public class Formmain0044ServiceImpl extends BaseService implements IFormmain0044Service { + Logger log = LoggerFactory.getLogger(getClass()); + + private IFormmain0044Dao formmain0044Dao; + + @Autowired + public void setFormmain0044Dao(IFormmain0044Dao dao) { + this.formmain0044Dao = dao; + this.dao = dao; + } + + @DS(value = "#entity.dataSourceCode") + @Override + public List querySeridId(Formmain0044Entity entity) { + List list = formmain0044Dao.query(entity); + return list; + } +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/service/ISeeyonExtService.java b/service/src/main/java/com/hzya/frame/seeyon/service/ISeeyonExtService.java index 4f06472d..04a36c07 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/service/ISeeyonExtService.java +++ b/service/src/main/java/com/hzya/frame/seeyon/service/ISeeyonExtService.java @@ -26,4 +26,11 @@ public interface ISeeyonExtService { * @param logEntity */ void ydcSeeyon2u8CallBack(SysMessageManageLogEntity logEntity); + + /** + * 东进 宁波银行交易明细保存到OA底表参数组装 + * @param entity + * @return + */ + SysExtensionApiEntity dongjAccLog(SysExtensionApiEntity entity); } diff --git a/service/src/main/java/com/hzya/frame/seeyon/service/impl/SeeyonExtServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/service/impl/SeeyonExtServiceImpl.java index 677a14a2..9ba4a642 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/service/impl/SeeyonExtServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/seeyon/service/impl/SeeyonExtServiceImpl.java @@ -5,8 +5,10 @@ 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.ningboBankTreasury.dto.res.AccTransactionRes; import com.hzya.frame.seeyon.entity.OAWorkflowEventDataEntity; import com.hzya.frame.seeyon.service.ISeeyonExtService; +import com.hzya.frame.seeyon.util.RestUtil; import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; @@ -14,6 +16,7 @@ import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity; import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogStatusEnum; import com.hzya.frame.u8.util.U8Util; import com.hzya.frame.uuid.UUIDLong; +import org.apache.commons.collections.CollectionUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -21,6 +24,7 @@ import org.springframework.stereotype.Service; import java.util.Date; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -36,6 +40,8 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService { @Autowired private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + @Autowired + private RestUtil restUtil; /** * 英德赛 OA档案传U8 @@ -150,6 +156,20 @@ public class SeeyonExtServiceImpl implements ISeeyonExtService { } } + /** + * 东进 宁波银行交易明细保存到OA底表参数组装 + * + * @param entity + * @return + */ + @Override + public SysExtensionApiEntity dongjAccLog(SysExtensionApiEntity entity) { + String token = restUtil.getToken("", "8000340000"); + Map headers = entity.getHeaders(); + headers.put("token",token); + return entity; + } + //存货参数组装 private SysExtensionApiEntity getInventory(JSONObject businessData,SysExtensionApiEntity param){ if (null != businessData){ From 3a768e1dcc58ef034c4df08a66fae59c428c429d Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Fri, 26 Jul 2024 15:19:51 +0800 Subject: [PATCH 006/101] =?UTF-8?q?=E6=94=B6=E6=AC=BE=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=202024=E5=B9=B47=E6=9C=8826=E6=97=A5=2015:19?= =?UTF-8?q?:46?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/res/AccTransactionRes.java | 8 ++ .../impl/NingboBankTreasuryServiceImpl.java | 15 +-- .../src/test/java/com/hzya/frame/Tetst01.java | 105 +++++++++++++++++- 3 files changed, 118 insertions(+), 10 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/res/AccTransactionRes.java b/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/res/AccTransactionRes.java index 2fc543c4..c8ed11e6 100644 --- a/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/res/AccTransactionRes.java +++ b/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/res/AccTransactionRes.java @@ -461,4 +461,12 @@ public class AccTransactionRes { public void setRecTime(String recTime) { this.recTime = recTime; } + + public String getOppAccName() { + return oppAccName; + } + + public void setOppAccName(String oppAccName) { + this.oppAccName = oppAccName; + } } diff --git a/service/src/main/java/com/hzya/frame/ningboBankTreasury/service/impl/NingboBankTreasuryServiceImpl.java b/service/src/main/java/com/hzya/frame/ningboBankTreasury/service/impl/NingboBankTreasuryServiceImpl.java index ac09ca58..f2e32e87 100644 --- a/service/src/main/java/com/hzya/frame/ningboBankTreasury/service/impl/NingboBankTreasuryServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/ningboBankTreasury/service/impl/NingboBankTreasuryServiceImpl.java @@ -2,21 +2,17 @@ package com.hzya.frame.ningboBankTreasury.service.impl; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; -import com.hzya.frame.bip.v3.v2207.dps.service.impl.PayMentServiceImpl; import com.hzya.frame.ningboBankTreasury.dto.req.AccTransactionReq; import com.hzya.frame.ningboBankTreasury.dto.res.AccTransactionRes; import com.hzya.frame.ningboBankTreasury.dto.res.AccTrxResponse; import com.hzya.frame.ningboBankTreasury.service.INingboBankTreasuryService; -import com.hzya.frame.ningboBankTreasury.util.BingboBankUtil; +import com.hzya.frame.ningboBankTreasury.util.NingboBankUtil; import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; -import com.hzya.frame.sysnew.application.plugin.entity.SysApplicationPluginEntity; -import com.hzya.frame.util.bipV3.SHA256Util; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import com.nbcb.sdk.OpenSDK; import com.nbcb.sdk.aes.exception.SDKException; import com.nbcb.sdk.aes.param.ConfigParam; -import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; @@ -111,11 +107,11 @@ public class NingboBankTreasuryServiceImpl implements INingboBankTreasuryService OpenSDK.dynamicInit(configParam,true); data.put("Data",JSONObject.toJSONString(accTransactionReq)); logger.info("查询交易明细请求参数:{}",data.toString()); - String returnData = OpenSDK.send(BingboBankUtil.TMSREPORT,BingboBankUtil.QUERYACCDETAIL,data.toString()); + String returnData = OpenSDK.send(NingboBankUtil.TMSREPORT, NingboBankUtil.QUERYACCDETAIL,data.toString()); System.out.println(returnData); logger.info("查询交易明细返回数据:{}",returnData); AccTrxResponse accTrxResponse = AccTrxResponse.valueOf(returnData); - if (null != accTrxResponse && BingboBankUtil.isSuccess(accTrxResponse.getRetCode())){ + if (null != accTrxResponse && NingboBankUtil.isSuccess(accTrxResponse.getRetCode())){ totalPage = Integer.valueOf(accTrxResponse.getTotalPage()); resList.addAll(accTrxResponse.getList()); } @@ -153,10 +149,11 @@ public class NingboBankTreasuryServiceImpl implements INingboBankTreasuryService entity.put("Data",data); JSONObject param = new JSONObject(); param.put("jsonStr",entity); + logger.info("查询交易明细请求参数:{}",JSONObject.toJSONString(param)); JSONObject returnObj = (JSONObject) sendNbBank(param); logger.info("查询交易明细返回数据:{}",returnObj.toString()); AccTrxResponse accTrxResponse = AccTrxResponse.valueOf(returnObj.toString()); - if (null != accTrxResponse && BingboBankUtil.isSuccess(accTrxResponse.getRetCode())){ + if (null != accTrxResponse && NingboBankUtil.isSuccess(accTrxResponse.getRetCode())){ totalPage = Integer.valueOf(accTrxResponse.getTotalPage()); resList.addAll(accTrxResponse.getList()); } @@ -182,7 +179,7 @@ public class NingboBankTreasuryServiceImpl implements INingboBankTreasuryService accTransactionReq.setQueryType("0"); } if (StrUtil.isEmpty(accTransactionReq.getCdSign())){ - accTransactionReq.setCdSign("0"); + accTransactionReq.setCdSign(NingboBankUtil.SHOURU); } return accTransactionReq; } diff --git a/service/src/test/java/com/hzya/frame/Tetst01.java b/service/src/test/java/com/hzya/frame/Tetst01.java index 28ac6e3e..6b874fae 100644 --- a/service/src/test/java/com/hzya/frame/Tetst01.java +++ b/service/src/test/java/com/hzya/frame/Tetst01.java @@ -1,10 +1,15 @@ package com.hzya.frame; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.ningboBankTreasury.dto.res.AccTrxResponse; +import org.apache.commons.lang3.StringUtils; import org.junit.jupiter.api.Test; -import javax.annotation.Resource; +import java.util.List; /** @@ -16,4 +21,102 @@ import javax.annotation.Resource; public class Tetst01 { + //产品号 + private static String productID = "tmsReport"; + //服务号 + private static String serviceID = "queryAccDetail"; + + @Test + public void trxParseTest(){ + String str = "{\n" + + " \"Data\": {\n" + + " \"retCode\": \"0000\",\n" + + " \"retMsg\": \"查询成功\",\n" + + " \"pageSize\": \"50\",\n" + + " \"currentPage\": \"1\",\n" + + " \"totalPage\": \"1\",\n" + + " \"totalSize\": \"4\",\n" + + " \"list\": [{\n" + + " \"bankAcc\": \"53170122000051772\",\n" + + " \"bankSubAcc\": \"\",\n" + + " \"accName\": \"宁波富市智梵织焦投资有限公司\",\n" + + " \"bankName\": \"宁波银行股份有限公司江北支行\",\n" + + " \"oppAccNo\": \"\",\n" + + " \"oppAccBank\": \"\",\n" + + " \"cdSign\": \"0\",\n" + + " \"cdSignName\": \"收\",\n" + + " \"amt\": \"999999.00\",\n" + + " \"bal\": \"51643875.40\",\n" + + " \"transTime\": \"2024-05-04 09:13:18\",\n" + + " \"subSerialNo\": \"3200000021\",\n" + + " \"serialNo\": \"\",\n" + + " \"curCode\": \"01\",\n" + + " \"uses\": \"\",\n" + + " \"abs\": \"现金存入\",\n" + + " \"voucherNo\": \"12405044020000446120240504\",\n" + + " \"bifCode\": \"9038\",\n" + + " \"bankType\": \"宁波银行\",\n" + + " \"oppBankType\": \"\",\n" + + " \"isForIndividual\": \"0\",\n" + + " \"serialId\": \"445439D1462C3600F9235B9C2BEF48E6\",\n" + + " \"bankSerialId\": \"124050440200004461\",\n" + + " \"groupTrans\": \"否\",\n" + + " \"capitalTrans\": \"否\",\n" + + " \"postScript\": \"\",\n" + + " \"accType\": \"\",\n" + + " \"accTypeName\": \"\",\n" + + " \"cashTfrFlg\": \"现金\",\n" + + " \"chinaDevelopBankNo\": \"\",\n" + + " \"chinaDevelopAccType\": \"\",\n" + + " \"payBillCode\": \"\",\n" + + " \"alipayBaseOrderNumber\": \"\",\n" + + " \"alipayBusinessDescription\": \"\",\n" + + " \"labelValue1\": \"\",\n" + + " \"labelValue2\": \"\",\n" + + " \"labelValue3\": \"\",\n" + + " \"labelValue4\": \"\",\n" + + " \"downloadNo\": \"\",\n" + + " \"sortRule\": \"202405043200000021202405040000647193\",\n" + + " \"orderNo\": \"202405040000647193\",\n" + + " \"alipayTradeName\": \"\",\n" + + " \"matchCode\": \"5317012200005177220240504999999.0012405044020000446120240504\",\n" + + " \"receiptInfo\": \"\",\n" + + " \"billNum\": \"\",\n" + + " \"recTime\": \"2024-05-04 09:48:47\"\n" + + " }]\n" + + " }\n" + + "}"; + AccTrxResponse accTrxResponse = AccTrxResponse.valueOf(str); + System.out.println("1111"); + } + /** + * 宁波银行交易明细 + */ + @Test + public void queryAccDetail(){ + JSONObject jsonObject = new JSONObject(); + JSONObject data = new JSONObject(); + data.put("custId", "0000070401");//客户号 + List strs = (List) Convert.toList("123456"); + JSONArray jsonArray = new JSONArray(); + for(String str :strs){ + str = StringUtils.deleteWhitespace(str); + jsonArray.add(str); + } + data.put("bankAccList", jsonArray); + data.put("beginDate", DateUtil.today());//开始日期 + data.put("endDate", DateUtil.today());//结束日期 + data.put("pageSize", "1000");//每页条数 + data.put("currentPage", 1);//当前页数 + data.put("queryType", "0");//查询方式0-分页查询 + data.put("cdSign","0");//收支方向,0收入1支出 + jsonObject.put("Data", data); + String param = jsonObject.toString(); + System.out.println(param); + try { + //String res = OpenSDK.send(productID, serviceID, jsonObject.toJSONString()); + } catch (Exception e) { + throw new RuntimeException(e); + } + } } From 765f35b3e68f272966397990e4541cefe2371c2c Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Fri, 26 Jul 2024 16:43:00 +0800 Subject: [PATCH 007/101] =?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/temButtom.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/buildpackage/src/test/java/com/hzya/frame/temButtom.java b/buildpackage/src/test/java/com/hzya/frame/temButtom.java index e59468ee..f8628b33 100644 --- a/buildpackage/src/test/java/com/hzya/frame/temButtom.java +++ b/buildpackage/src/test/java/com/hzya/frame/temButtom.java @@ -12,6 +12,9 @@ import com.hzya.frame.cbs8.service.ICbs8ExtService; import com.hzya.frame.cbs8.service.ICbs8Service; import com.hzya.frame.cbs8.util.CBSUtil; import com.hzya.frame.cbs8.util.CbsAccessToken; +import com.hzya.frame.ningboBankTreasury.dto.req.AccTransactionReq; +import com.hzya.frame.ningboBankTreasury.dto.res.AccTransactionRes; +import com.hzya.frame.ningboBankTreasury.service.INingboBankTreasuryService; import com.hzya.frame.plugin.cbs8.plugin.PayApplyPluginInitializer; import com.hzya.frame.plugin.cbs8.plugin.PayResultPluginInitializer; import com.hzya.frame.plugin.cbs8.plugin.TransactionDetailPluginInitializer; @@ -56,6 +59,20 @@ public class temButtom { private TransactionDetailPluginInitializer transactionDetailPluginInitializer; @Autowired private PayResultPluginInitializer payResultPluginInitializer; + @Resource + private INingboBankTreasuryService ningboxService; + + @Test + public void accDetailTest(){ + AccTransactionReq accTransactionReq = new AccTransactionReq(); + accTransactionReq.setBeginDate("2024-06-01"); + accTransactionReq.setEndDate("2024-06-30"); + accTransactionReq.setPageSize("10"); + accTransactionReq.setCustId("0000112058"); + accTransactionReq.setBankAccList(Convert.toList(String.class,"86041110000110293,86041110000109337,6223160030547665,6214180002001411023,6214180000002609736")); + List list = ningboxService.queryAccDetails(accTransactionReq); + System.out.println("查询到的条数"+list.size()); + } @Test public void cbs8PluginTest(){ From 1221059d06999e87cf9b77e3a5f37764a094278b Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Fri, 26 Jul 2024 16:43:29 +0800 Subject: [PATCH 008/101] =?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 --- buildpackage/src/main/resources/application-xel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildpackage/src/main/resources/application-xel.yml b/buildpackage/src/main/resources/application-xel.yml index f2a62090..e4e22114 100644 --- a/buildpackage/src/main/resources/application-xel.yml +++ b/buildpackage/src/main/resources/application-xel.yml @@ -18,7 +18,7 @@ spring: driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 savefile: # 文件保存路径 - path: /Users/xiangerlin/work/app/logs/ydc + path: /Users/xiangerlin/work/app/logs/dongj cbs8: appId: 1P4AGrpz appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a @@ -32,4 +32,4 @@ cbs8: #电子回单下载临时存放位置 elec_path: /Users/xiangerlin/Downloads/ OA: - data_source_code: yc-test \ No newline at end of file + data_source_code: djoatest \ No newline at end of file From e6239e89bca966ac6f5e6626db67b8bc6154e527 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Fri, 26 Jul 2024 17:22:25 +0800 Subject: [PATCH 009/101] =?UTF-8?q?ningboBank=E5=B7=A5=E5=85=B7=E7=B1=BB?= =?UTF-8?q?=202024=E5=B9=B47=E6=9C=8826=E6=97=A5=2017:22:22?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../util/NingboBankUtil.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 service/src/main/java/com/hzya/frame/ningboBankTreasury/util/NingboBankUtil.java diff --git a/service/src/main/java/com/hzya/frame/ningboBankTreasury/util/NingboBankUtil.java b/service/src/main/java/com/hzya/frame/ningboBankTreasury/util/NingboBankUtil.java new file mode 100644 index 00000000..bb4c91e7 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/ningboBankTreasury/util/NingboBankUtil.java @@ -0,0 +1,27 @@ +package com.hzya.frame.ningboBankTreasury.util; + +/** + * @Description 宁波银行 + * @Author xiangerlin + * @Date 2024/7/24 18:15 + **/ +public class NingboBankUtil { + + //产品id + public static final String TMSREPORT = "tmsReport"; + //交易明细查询服务id + public static final String QUERYACCDETAIL = "queryAccDetail"; + public static final String QUERYACCOUNT = "queryAccount"; + //成功编码 + public static final String SUCCESSCODE = "0000"; + + //收入 + public static final String SHOURU = "0"; + //支出 + public static final String ZHICHU = "1"; + + //是否成功 + public static boolean isSuccess(String retCode){ + return SUCCESSCODE.equals(retCode) ? true : false; + } +} From 7f9a51330566d03eb2b5d19e00d71bea97e2f237 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Mon, 29 Jul 2024 15:15:03 +0800 Subject: [PATCH 010/101] =?UTF-8?q?=E5=B8=81=E7=A7=8D=E6=9E=9A=E4=B8=BE=20?= =?UTF-8?q?2024=E5=B9=B47=E6=9C=8829=E6=97=A5=2015:15:01?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enums/CurrencyEnum.java | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 service/src/main/java/com/hzya/frame/ningboBankTreasury/enums/CurrencyEnum.java diff --git a/service/src/main/java/com/hzya/frame/ningboBankTreasury/enums/CurrencyEnum.java b/service/src/main/java/com/hzya/frame/ningboBankTreasury/enums/CurrencyEnum.java new file mode 100644 index 00000000..e23923e6 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/ningboBankTreasury/enums/CurrencyEnum.java @@ -0,0 +1,51 @@ +package com.hzya.frame.ningboBankTreasury.enums; + +/** + * @Description 币种枚举 + * @Author xiangerlin + * @Date 2024/7/24 17:07 + **/ +public enum CurrencyEnum { + + 人民币("01","人民币"), + 美元("02","美元"), + 澳元("03","澳元"), + 欧元("04","欧元"), + 日元("05","日元"), + 英镑("06","英镑"), + 港币("07","港币"), + 新加坡元("08","新加坡元"), + 加拿大元("09","加拿大元"), + 瑞士("10","瑞士"), + 泰铢("23","泰铢"), + 新台币("92","新台币"), + ALL("ALL","多币"); + private final String name; + private final String code; + + CurrencyEnum(String name, String code) { + this.name = name; + this.code = code; + } + + public String getName() { + return name; + } + public String getCode() { + return code; + } + + /** + * 根据code获取币种名字 + * @param code + * @return + */ + public static String getNameByCode(String code){ + for (CurrencyEnum currency : values()) { + if (currency.code.equals(code)) { + return currency.name; + } + } + return null; // 或者抛出异常,表示找不到对应的币种 + } +} From 9090ca3dfa1f0a2f8dd094af2afaaee1e23175ff Mon Sep 17 00:00:00 2001 From: username Date: Mon, 29 Jul 2024 17:23:09 +0800 Subject: [PATCH 011/101] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-zqt.yml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 buildpackage/src/main/resources/application-zqt.yml diff --git a/buildpackage/src/main/resources/application-zqt.yml b/buildpackage/src/main/resources/application-zqt.yml new file mode 100644 index 00000000..28fa5bb3 --- /dev/null +++ b/buildpackage/src/main/resources/application-zqt.yml @@ -0,0 +1,35 @@ +#######################dev环境####################### +logging: + #日志级别 指定目录级别 + level: + root: info + encodings: UTF-8 + file: + # 日志保存路径 + path: /home/webservice/zt/log +spring: + datasource: + dynamic: + datasource: + 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 + driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 +savefile: + # 文件保存路径 + path: /home/webservice/zt/file +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/ +OA: + data_source_code: djoatest \ No newline at end of file From 29a0b03f145970bc4b489c96808df2e1629d124c Mon Sep 17 00:00:00 2001 From: username Date: Mon, 29 Jul 2024 17:48:06 +0800 Subject: [PATCH 012/101] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=94=B6=E6=AC=BE=E5=8D=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildpackage/pom.xml | 6 + .../plugin/oaReceipt/dao/IOaReceiptDao.java | 7 + .../oaReceipt/dao/impl/OaReceiptDaoImpl.java | 8 + .../oaReceipt/entity/OaReceiptEntity.java | 6 + .../oaReceipt/entity/OaReceiptEntity.xml | 16 ++ .../plugin/OaReceiptPluginInitializer.java | 58 +++++++ .../oaReceipt/service/IOaReceiptService.java | 7 + .../service/impl/OaReceiptServiceImpl.java | 8 + .../src/main/resources/application-zqt.yml | 4 +- .../cfgHome/plugin/oaReceipt/pluginCfg.xml | 6 + .../spring/spring-buildpackage-dao.xml | 5 + .../spring/spring-buildpackage-plugin.xml | 5 + .../spring/spring-buildpackage-service.xml | 5 + .../hzya/frame/bip/v3/v2207/util/BipUtil.java | 18 ++ .../seeyon/receiptFor/dao/IReceiptForDao.java | 11 ++ .../dao/impl/ReceiptForDaoImpl.java | 25 +++ .../receiptFor/entity/ReceiptForEntity.java | 79 +++++++++ .../receiptFor/entity/ReceiptForEntity.xml | 58 +++++++ .../service/IReceiptForService.java | 11 ++ .../service/impl/ReceiptForServiceImpl.java | 162 ++++++++++++++++++ 20 files changed, 503 insertions(+), 2 deletions(-) create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/dao/IOaReceiptDao.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/dao/impl/OaReceiptDaoImpl.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/entity/OaReceiptEntity.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/entity/OaReceiptEntity.xml create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/plugin/OaReceiptPluginInitializer.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/service/IOaReceiptService.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/service/impl/OaReceiptServiceImpl.java create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/oaReceipt/pluginCfg.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/oaReceipt/spring/spring-buildpackage-dao.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/oaReceipt/spring/spring-buildpackage-plugin.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/oaReceipt/spring/spring-buildpackage-service.xml create mode 100644 service/src/main/java/com/hzya/frame/seeyon/receiptFor/dao/IReceiptForDao.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/receiptFor/dao/impl/ReceiptForDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/IReceiptForService.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/impl/ReceiptForServiceImpl.java diff --git a/buildpackage/pom.xml b/buildpackage/pom.xml index 5c949541..c322ef46 100644 --- a/buildpackage/pom.xml +++ b/buildpackage/pom.xml @@ -93,6 +93,12 @@ yc + + zqt + + zqt + + kangarooDataCenterV3 diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/dao/IOaReceiptDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/dao/IOaReceiptDao.java new file mode 100644 index 00000000..1051b7fa --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/dao/IOaReceiptDao.java @@ -0,0 +1,7 @@ +package com.hzya.frame.plugin.oaReceipt.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.oaReceipt.entity.OaReceiptEntity; + +public interface IOaReceiptDao extends IBaseDao { +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/dao/impl/OaReceiptDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/dao/impl/OaReceiptDaoImpl.java new file mode 100644 index 00000000..e458e4d8 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/dao/impl/OaReceiptDaoImpl.java @@ -0,0 +1,8 @@ +package com.hzya.frame.plugin.oaReceipt.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.oaReceipt.dao.IOaReceiptDao; +import com.hzya.frame.plugin.oaReceipt.entity.OaReceiptEntity; + +public class OaReceiptDaoImpl extends MybatisGenericDao implements IOaReceiptDao { +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/entity/OaReceiptEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/entity/OaReceiptEntity.java new file mode 100644 index 00000000..1ef5e65e --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/entity/OaReceiptEntity.java @@ -0,0 +1,6 @@ +package com.hzya.frame.plugin.oaReceipt.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +public class OaReceiptEntity extends BaseEntity { +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/entity/OaReceiptEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/entity/OaReceiptEntity.xml new file mode 100644 index 00000000..896fd71d --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/entity/OaReceiptEntity.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + id + + + + + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/plugin/OaReceiptPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/plugin/OaReceiptPluginInitializer.java new file mode 100644 index 00000000..015354c0 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/plugin/OaReceiptPluginInitializer.java @@ -0,0 +1,58 @@ +package com.hzya.frame.plugin.oaReceipt.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.a8bill.plugin.PayBillPluginInitializer; +import com.hzya.frame.seeyon.receiptFor.service.IReceiptForService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +public class OaReceiptPluginInitializer extends PluginBaseEntity { + + Logger logger = LoggerFactory.getLogger(PayBillPluginInitializer.class); + @Autowired + private IReceiptForService receiptForService; + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "OaReceiptPlugin"; + } + + @Override + public String getPluginName() { + return "OaReceiptPlugin插件"; + } + + @Override + public String getPluginLabel() { + return "OaReceiptPlugin"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + logger.info("======开始执行付款单据信息同步========"); + return receiptForService.sendReceiptFor(requestJson); + }catch (Exception e){ + logger.info("======执行付款单据同步失败:{}========",e.getMessage()); + e.printStackTrace(); + } + return null; + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/service/IOaReceiptService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/service/IOaReceiptService.java new file mode 100644 index 00000000..10ce9851 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/service/IOaReceiptService.java @@ -0,0 +1,7 @@ +package com.hzya.frame.plugin.oaReceipt.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.oaReceipt.entity.OaReceiptEntity; + +public interface IOaReceiptService extends IBaseService { +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/service/impl/OaReceiptServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/service/impl/OaReceiptServiceImpl.java new file mode 100644 index 00000000..721488bd --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/oaReceipt/service/impl/OaReceiptServiceImpl.java @@ -0,0 +1,8 @@ +package com.hzya.frame.plugin.oaReceipt.service.impl; + +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.plugin.oaReceipt.entity.OaReceiptEntity; +import com.hzya.frame.plugin.oaReceipt.service.IOaReceiptService; + +public class OaReceiptServiceImpl extends BaseService implements IOaReceiptService { +} diff --git a/buildpackage/src/main/resources/application-zqt.yml b/buildpackage/src/main/resources/application-zqt.yml index 28fa5bb3..fef30d8a 100644 --- a/buildpackage/src/main/resources/application-zqt.yml +++ b/buildpackage/src/main/resources/application-zqt.yml @@ -6,7 +6,7 @@ logging: encodings: UTF-8 file: # 日志保存路径 - path: /home/webservice/zt/log + path: D:\log spring: datasource: dynamic: @@ -18,7 +18,7 @@ spring: driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 savefile: # 文件保存路径 - path: /home/webservice/zt/file + path: D:\log cbs8: appId: 1P4AGrpz appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a diff --git a/buildpackage/src/main/resources/cfgHome/plugin/oaReceipt/pluginCfg.xml b/buildpackage/src/main/resources/cfgHome/plugin/oaReceipt/pluginCfg.xml new file mode 100644 index 00000000..d2654f45 --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/oaReceipt/pluginCfg.xml @@ -0,0 +1,6 @@ + + +OaReceiptPlugin +OaReceiptPlugin插件 +90000026 + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/oaReceipt/spring/spring-buildpackage-dao.xml b/buildpackage/src/main/resources/cfgHome/plugin/oaReceipt/spring/spring-buildpackage-dao.xml new file mode 100644 index 00000000..f0695cce --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/oaReceipt/spring/spring-buildpackage-dao.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/oaReceipt/spring/spring-buildpackage-plugin.xml b/buildpackage/src/main/resources/cfgHome/plugin/oaReceipt/spring/spring-buildpackage-plugin.xml new file mode 100644 index 00000000..a6799dbf --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/oaReceipt/spring/spring-buildpackage-plugin.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/oaReceipt/spring/spring-buildpackage-service.xml b/buildpackage/src/main/resources/cfgHome/plugin/oaReceipt/spring/spring-buildpackage-service.xml new file mode 100644 index 00000000..ba5fdbe0 --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/oaReceipt/spring/spring-buildpackage-service.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/service/src/main/java/com/hzya/frame/bip/v3/v2207/util/BipUtil.java b/service/src/main/java/com/hzya/frame/bip/v3/v2207/util/BipUtil.java index a7bfe324..5148ef17 100644 --- a/service/src/main/java/com/hzya/frame/bip/v3/v2207/util/BipUtil.java +++ b/service/src/main/java/com/hzya/frame/bip/v3/v2207/util/BipUtil.java @@ -58,6 +58,24 @@ public class BipUtil { } return null; } + public static String sendOaToDj(String parm, String apiCode){ + String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface"; + System.out.println("推送参数"+parm); + String result = HttpRequest.post(baseUrl) + .header("appId", "800035")//头信息,多个头信息多次调用此方法即可 + .header("apiCode", apiCode)//头信息,多个头信息多次调用此方法即可 + .header("publicKey", "ZJYATW/MfYZX7zF0eAh4DJXbyTLwUtwSoSz5Y/o1ksAaN/dCe7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可 + .header("secretKey", "+5BUkLQh3iX3VHgEt5bE2IPh+ZeebGvDaEspsvVu739Ar6sFnwg+fpPod4t6XhoTj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可 + .body(parm)//表单内容 + .timeout(20000)//超时,毫秒 + .execute().body(); + System.out.println("返回参数"+result); + if(StrUtil.isNotEmpty(result)){ + return analytic(result); + } + return null; + } + public static String analytic(String parm){ JSONObject main = JSON.parseObject(parm); return main.getString("attribute"); diff --git a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/dao/IReceiptForDao.java b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/dao/IReceiptForDao.java new file mode 100644 index 00000000..7f6cb7a3 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/dao/IReceiptForDao.java @@ -0,0 +1,11 @@ +package com.hzya.frame.seeyon.receiptFor.dao; + +import com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity; + +import java.util.List; + +public interface IReceiptForDao{ + public List getOaReceipt(ReceiptForEntity recEntity); + + public int updateState(ReceiptForEntity recEntity); +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/dao/impl/ReceiptForDaoImpl.java b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/dao/impl/ReceiptForDaoImpl.java new file mode 100644 index 00000000..2bdecab3 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/dao/impl/ReceiptForDaoImpl.java @@ -0,0 +1,25 @@ +package com.hzya.frame.seeyon.receiptFor.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.receiptFor.dao.IReceiptForDao; +import com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository("receiptForDao") +public class ReceiptForDaoImpl extends MybatisGenericDao implements IReceiptForDao { + + @DS("#recEntity.dataSourceCode") + @Override + public List getOaReceipt(ReceiptForEntity recEntity){ + return super.selectList(getSqlIdPrifx()+"ReceiptForEntity_list_base",recEntity); + } + + @DS("#recEntity.dataSourceCode") + @Override + public int updateState(ReceiptForEntity recEntity){ + return super.update(getSqlIdPrifx()+"ReceiptForEntity_update_state",recEntity); + } +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.java b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.java new file mode 100644 index 00000000..b549b44a --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.java @@ -0,0 +1,79 @@ +package com.hzya.frame.seeyon.receiptFor.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +public class ReceiptForEntity extends BaseEntity { + private String dfybje; + private String djrq; + private String dwbm; + private String hbbm; + private String lrr; + private String shr; + private String shrq; + + private String state; + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getDfybje() { + return dfybje; + } + + public void setDfybje(String dfybje) { + this.dfybje = dfybje; + } + + public String getDjrq() { + return djrq; + } + + public void setDjrq(String djrq) { + this.djrq = djrq; + } + + public String getDwbm() { + return dwbm; + } + + public void setDwbm(String dwbm) { + this.dwbm = dwbm; + } + + public String getHbbm() { + return hbbm; + } + + public void setHbbm(String hbbm) { + this.hbbm = hbbm; + } + + public String getLrr() { + return lrr; + } + + public void setLrr(String lrr) { + this.lrr = lrr; + } + + public String getShr() { + return shr; + } + + public void setShr(String shr) { + this.shr = shr; + } + + public String getShrq() { + return shrq; + } + + public void setShrq(String shrq) { + this.shrq = shrq; + } +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml new file mode 100644 index 00000000..0b4d5ca3 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update formmain_0045 set state = #{state} where id = #{id} + + + + + + + diff --git a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/IReceiptForService.java b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/IReceiptForService.java new file mode 100644 index 00000000..13bfa3a7 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/IReceiptForService.java @@ -0,0 +1,11 @@ +package com.hzya.frame.seeyon.receiptFor.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +public interface IReceiptForService extends IBaseService { + + public JsonResultEntity sendReceiptFor(JSONObject requestJson); +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/impl/ReceiptForServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/impl/ReceiptForServiceImpl.java new file mode 100644 index 00000000..aa9905ff --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/impl/ReceiptForServiceImpl.java @@ -0,0 +1,162 @@ +package com.hzya.frame.seeyon.receiptFor.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.basedao.service.impl.BaseService; +import com.hzya.frame.bip.v3.v2207.util.BipUtil; +import com.hzya.frame.seeyon.receiptFor.dao.IReceiptForDao; +import com.hzya.frame.seeyon.receiptFor.entity.ReceiptForEntity; +import com.hzya.frame.seeyon.receiptFor.service.IReceiptForService; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +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.Date; +import java.util.List; + +@Service("ReceiptForServiceImpl") +public class ReceiptForServiceImpl extends BaseService implements IReceiptForService { + Logger logger = LoggerFactory.getLogger(ReceiptForServiceImpl.class); + @Autowired + private IReceiptForDao receiptForDao; + + @Autowired + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + + @Override + public JsonResultEntity sendReceiptFor(JSONObject requestJson){ + + //获取重推信息id,并记录日志 + JSONObject requestJsonObj = JSON.parseObject(requestJson.toString(),JSONObject.class); + String interId = requestJsonObj.getString("integration_task_living_details_id"); + logger.info("收款单重推解析后:"+requestJsonObj.toString()); + logger.info("收款单重新执行的任务主键:"+interId); + + //更换数据源 + JsonResultEntity resultEntity = new JsonResultEntity(); + ReceiptForEntity entity = new ReceiptForEntity(); + requestJson.put("db_code","djoatest"); + entity.setDataSourceCode(requestJson.getString("db_code")); + + //根据重推信息id,查询该条重推记录信息 + IntegrationTaskLivingDetailsEntity oldMsg = new IntegrationTaskLivingDetailsEntity(); + if(StrUtil.isNotEmpty(interId)){ + oldMsg = taskLivingDetailsService.get(interId); + } + String rootAppPk = oldMsg.getRootAppPk(); + entity.setId(rootAppPk); + if(StrUtil.isEmpty(rootAppPk)){ + //entity.setQueryState("查询"); + } + //如果是重推,是否通过entity传入的id,只能查到一条数据。 + //entity.setId("-8845102890648320822"); + List receiptList = receiptForDao.getOaReceipt(entity); + + if(CollectionUtils.isNotEmpty(receiptList)){ + for(ReceiptForEntity rec : receiptList){ + try{ + JSONObject main = bindingAdd(rec); + + logger.info("收款认领单推送数据:"+main.toString()); + String result = BipUtil.sendOaToDj(main.toString(),"8000350034"); + logger.info("收款认领单推送结果:"+result); + IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); + logDetails.setRootAppPk(rec.getId()); + //logDetails.setRootAppBill(); + //不知道源系统单据是什么,所以先注释掉了 + logDetails.setNewTransmitInfo(result); + logDetails.setNewPushDate(new Date()); + logDetails.setRootAppNewData(JSON.toJSONString(rec)); + logDetails.setPluginId("OaReceiptPlugin"); + + JSONObject resultObj = JSON.parseObject(result); + boolean flag = resultObj.get("status").equals("success"); + if(flag){ + // 推送成功,更新状态 + rec.setState("1"); + }else{ + // 推送失败 + rec.setState("0"); + } + rec.setDataSourceCode(requestJson.getString("db_code")); + try{ + if(StrUtil.isEmpty(interId)){ + if(flag){ + //首推成功 + //由于字段匹配问题,logDetails中没设置单据号,因此会保存失败。 + taskLivingDetailsService.saveLogToSuccess(logDetails); + }else{ + //首推失败 + taskLivingDetailsService.saveLogToFail(logDetails); + } + }else{ + logDetails.setId(interId); + if(flag){ + //重推成功 + taskLivingDetailsService.saveLogFailToSuccess(logDetails); + }else{ + //重推失败,把失败信息,更新到重推表中 + taskLivingDetailsService.updateLogFailToSuccess(logDetails); + } + } + }catch (Exception e){ + logger.info("保存日志失败"+e.getMessage()); + receiptForDao.updateState(rec); + e.printStackTrace(); + } + receiptForDao.updateState(rec); +// + } catch (Exception e) { + logger.info("收款单执行失败"+e.getMessage()); + e.printStackTrace(); + } + + } + } + return new JsonResultEntity("成功",true,resultEntity); + } + + @NotNull + private JSONObject bindingAdd(ReceiptForEntity rec) { + String djrq = rec.getDjrq().substring(0,10); + if(djrq.length()>19){ + djrq = rec.getDjrq().substring(0,10); + } + String shrq = rec.getShrq().substring(0,10); + if(shrq.length()>19){ + shrq = rec.getShrq().substring(0,10); + } + + JSONObject dfybjeJson = new JSONObject(); + dfybjeJson.put("dfybje",rec.getDfybje()); + JSONArray childrenArray = new JSONArray(); + childrenArray.add(dfybjeJson); + + JSONObject parentvo = new JSONObject(); + parentvo.put("djrq",djrq); + parentvo.put("dwbm",rec.getDwbm()); + parentvo.put("hbbm",rec.getHbbm()); + parentvo.put("lrr",rec.getLrr()); + parentvo.put("shr",rec.getShr()); + parentvo.put("shrq",shrq); + + JSONObject billvoJson = new JSONObject(); + billvoJson.put("children",childrenArray); + billvoJson.put("parentvo",parentvo); + + JSONArray billvoArray = new JSONArray(); + billvoArray.add(billvoJson); + JSONObject main = new JSONObject(); + main.put("billvo",billvoArray); + return main; + } + +} From 1eac206f2859330bd2adafef576dd373d0a2086b Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 30 Jul 2024 09:18:28 +0800 Subject: [PATCH 013/101] =?UTF-8?q?=E5=AE=81=E6=B3=A2=E9=93=B6=E8=A1=8C?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=202024=E5=B9=B47=E6=9C=8830=E6=97=A5=2009:17?= =?UTF-8?q?:43?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/IPayBillPluginInitializerDao.java | 36 +++ .../impl/PayBillPluginInitializerDaoImpl.java | 33 +++ .../plugin/a8bill/entity/PayBillEntity.java | 8 + .../plugin/a8bill/entity/PayBillEntity.xml | 15 +- .../NingboBankPayPluginInitializer.java | 212 ++++++++++++++++++ .../NingboBankPayResultPluginInitializer.java | 185 +++++++++++++++ .../service/INingboBankPluginService.java | 9 + .../impl/NingboBankPluginServiceImpl.java | 25 ++- .../dto/req/SingleTransferReq.java | 209 +++++++++++++++++ .../enums/PayStatusEnum.java | 72 ++++++ 10 files changed, 798 insertions(+), 6 deletions(-) create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/dao/IPayBillPluginInitializerDao.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/dao/impl/PayBillPluginInitializerDaoImpl.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayPluginInitializer.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayResultPluginInitializer.java create mode 100644 service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/req/SingleTransferReq.java create mode 100644 service/src/main/java/com/hzya/frame/ningboBankTreasury/enums/PayStatusEnum.java diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/dao/IPayBillPluginInitializerDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/dao/IPayBillPluginInitializerDao.java new file mode 100644 index 00000000..c94fd3fa --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/dao/IPayBillPluginInitializerDao.java @@ -0,0 +1,36 @@ +package com.hzya.frame.plugin.a8bill.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.plugin.a8bill.entity.PayBillEntity; + +import java.util.HashMap; +import java.util.List; + +/** + * 组织档案(mdm_org: table)表数据库访问层 + * + * @author makejava + * @since 2024-06-07 18:30:04 + */ +public interface IPayBillPluginInitializerDao extends IBaseDao { + /** + * + * @content 通用获取OA数据接口 + * @author laborer + * @date 2024/7/10 0010 16:06 + * + */ + + List> getOaBillData(String str , PayBillEntity entity)throws Exception; + /** + * + * @content 通过ID修改单据状态 + * @author laborer + * @date 2024/7/10 0010 17:32 + * + */ + + int updateStateForId(String str , PayBillEntity entity)throws Exception; +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/dao/impl/PayBillPluginInitializerDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/dao/impl/PayBillPluginInitializerDaoImpl.java new file mode 100644 index 00000000..8b948102 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/dao/impl/PayBillPluginInitializerDaoImpl.java @@ -0,0 +1,33 @@ +package com.hzya.frame.plugin.a8bill.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.execsql.service.IExecSqlService; +import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao; +import com.hzya.frame.plugin.a8bill.entity.PayBillEntity; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.HashMap; +import java.util.List; + +/** + * 组织档案(MdmOrg)表数据库访问层 + * + * @author makejava + * @since 2024-06-07 18:30:04 + */ +public class PayBillPluginInitializerDaoImpl extends MybatisGenericDao implements IPayBillPluginInitializerDao { + @Autowired + private IExecSqlService execSqlService; + @DS("#entity.dataSourceCode") + @Override + public List> getOaBillData(String str, PayBillEntity entity)throws Exception { + return execSqlService.execSelectSql(str, ""); + } + @DS("#entity.dataSourceCode") + @Override + public int updateStateForId(String str , PayBillEntity entity)throws Exception { + return super.update("com.hzya.frame.plugin.a8bill.dao.impl.PayBillPluginInitializerDaoImpl.PayBillEntity_update",entity); + } +} + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/entity/PayBillEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/entity/PayBillEntity.java index ecca14fb..dd8d1c0b 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/entity/PayBillEntity.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/entity/PayBillEntity.java @@ -9,6 +9,14 @@ import com.hzya.frame.web.entity.BaseEntity; * @since 2024-06-07 18:30:04 */ public class PayBillEntity extends BaseEntity { + private String sql; + public String getSql() { + return sql; + } + + public void setSql(String sql) { + this.sql = sql; + } } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/entity/PayBillEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/entity/PayBillEntity.xml index a251e1cd..bdde6c3f 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/entity/PayBillEntity.xml +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/entity/PayBillEntity.xml @@ -1,16 +1,21 @@ - + - + - + id - - + + + + + ${sql} + + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayPluginInitializer.java new file mode 100644 index 00000000..54edfb8a --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayPluginInitializer.java @@ -0,0 +1,212 @@ +package com.hzya.frame.plugin.a8bill.plugin; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao; +import com.hzya.frame.plugin.a8bill.entity.PayBillEntity; +import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +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 org.springframework.beans.factory.annotation.Value; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.HashMap; +import java.util.List; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/7/29 11:08 + **/ +public class NingboBankPayPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private INingboBankPluginService ningboBankPluginService; + @Resource + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + @Autowired + private IPayBillPluginInitializerDao payBillDao; + + @Value("${OA.data_source_code}") + private String oa_data_source_code; + /*** + * 插件初始化方法 + * @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 "NingboBankPayPlugin"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "宁波银行转账插件"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "宁波银行转账插件"; + } + + /*** + * 插件类型 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 { + JSONObject requestJsonObj = JSON.parseObject(requestJson.toString(),JSONObject.class); + String interId = requestJsonObj.getString("integration_task_living_details_id"); + IntegrationTaskLivingDetailsEntity oldMsg = new IntegrationTaskLivingDetailsEntity(); + if(StrUtil.isNotEmpty(interId)){ + oldMsg = taskLivingDetailsService.get(interId); + } + String rootAppPk = oldMsg.getRootAppPk(); + + try { + StringBuffer sb = new StringBuffer(); + if(StrUtil.isNotEmpty(rootAppPk)){ + String code = requestJson.getString("code"); + sb.append(" and id = '"+rootAppPk+"'"); + }else{ + sb.append(" and payState is null"); + } + + PayBillEntity oaBillEntity = new PayBillEntity(); + oaBillEntity.setDataSourceCode(oa_data_source_code); + StringBuffer stringBuffer = new StringBuffer(); + + //备用金申请单 + stringBuffer.append("select * from v_hzya_pay where 1=1 " ); + stringBuffer.append(sb.toString()); + List> hashMaps = payBillDao.getOaBillData(stringBuffer.toString(),oaBillEntity); + if(CollectionUtils.isNotEmpty(hashMaps)){ + for (HashMap hashMap : hashMaps) { + JSONObject main = new JSONObject(); + for(String key:hashMap.keySet()) { + main.put(key, hashMap.get(key)); + } + logger.info("获取到付款单的数据"+main.toString()); + String result = ningboBankPluginService.executeEsb(main.toString(),"8000360000"); + logger.info("推送宁波银行的返回结果"+result); + IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); + logDetails.setRootAppPk(main.getString("id")); + logDetails.setRootAppBill(main.getString("serialNo")); + logDetails.setNewTransmitInfo(result); + logDetails.setNewPushDate(new Date()); + logDetails.setRootAppNewData(JSON.toJSONString(main)); + logDetails.setPluginId("NingboBankPayPlugin"); + JSONObject resultObj = JSON.parseObject(result); + String attribute = resultObj.getString("attribute"); + boolean flag = resultObj.getBoolean("flag"); + String subState = ""; + String fieldName = main.getString("fieldName"); + String tableName = main.getString("tableName"); + String payMsg = main.getString("payMsg"); +// String subMsg = main.getString("subMsg"); + String str = ""; + String sync_flag = ""; + try { + if(StrUtil.isEmpty(interId)){// 银行状态 1支付中 2 支付失败 null 未提交支付 0支付成功 + if(flag){ + subState = "1"; + sync_flag = " ,"+payMsg+" = '支付中'"; + taskLivingDetailsService.saveLogToSuccess(logDetails); + }else{ + subState = "2"; + sync_flag = " ,"+payMsg+" = '"+attribute+"'"; + taskLivingDetailsService.saveLogToFail(logDetails); + } + }else{ + logDetails.setId(interId); + if(flag){ + subState = "1"; + sync_flag = " ,"+payMsg+" = '支付中'"; + taskLivingDetailsService.saveLogFailToSuccess(logDetails); + }else{ + subState = "2"; + sync_flag = " ,"+payMsg+" = '"+attribute+"'"; + taskLivingDetailsService.updateLogFailToSuccess(logDetails); + } + } + + str = "update "+tableName+" set " + fieldName + "= '" +subState+"'" +sync_flag+"where id = '"+main.getString("id")+"'"; + } catch (Exception e) { + subState = "N"; + str = "update "+tableName+" set " + fieldName + "= '" +subState+"'" +payMsg+" = '"+attribute+"' "+"where id = '"+main.getString("id")+"'"; + logger.info("保存日志失败"+e.getMessage()); + oaBillEntity.setSql(str); + payBillDao.updateStateForId(str,oaBillEntity); + e.printStackTrace(); + } + //修改推送状态,防止重复推送 + oaBillEntity.setSql(str); + payBillDao.updateStateForId(str,oaBillEntity); + } + } + } catch (Exception e) { + logger.info("获取OA数据失败"+e.getMessage()); + e.printStackTrace(); + } + return new JsonResultEntity("成功",true,new JsonResultEntity()); + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayResultPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayResultPluginInitializer.java new file mode 100644 index 00000000..3bed39bf --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayResultPluginInitializer.java @@ -0,0 +1,185 @@ +package com.hzya.frame.plugin.a8bill.plugin; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.ningboBankTreasury.enums.PayStatusEnum; +import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao; +import com.hzya.frame.plugin.a8bill.entity.PayBillEntity; +import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService; +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 org.springframework.beans.factory.annotation.Value; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Description 宁波银行 单笔付款交易结果查询 + * @Author xiangerlin + * @Date 2024/7/29 16:59 + **/ +public class NingboBankPayResultPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(getClass()); + @Value("${OA.data_source_code}") + private String oa_data_source_code; + @Autowired + private IPayBillPluginInitializerDao payBillDao; + @Autowired + private INingboBankPluginService ningboBankPluginService; + /*** + * 插件初始化方法 + * @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 "NingboBankPayResultPlugin"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "宁波银行转账结果查询插件"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "宁波银行转账结果查询插件"; + } + + /*** + * 插件类型 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 { + PayBillEntity oaBillEntity = new PayBillEntity(); + oaBillEntity.setDataSourceCode(oa_data_source_code); + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append("select * from v_hzya_pay where payState ='1'"); + try { + List> hashMaps = payBillDao.getOaBillData(stringBuffer.toString(),oaBillEntity); + if(CollectionUtils.isNotEmpty(hashMaps)){ + for (HashMap hashMap : hashMaps) { + JSONObject main = new JSONObject(); + for(String key:hashMap.keySet()) { + main.put(key, hashMap.get(key)); + } + String tableName = main.getString("tableName"); + String fieldName = main.getString("fieldName"); + String payDate = main.getString("payDate"); + String payMsg = main.getString("payMsg"); + try { + + logger.info("获取到付款单状态的数据"+main.toString()); + JSONObject reMain = new JSONObject(); + reMain.put("serialNo",main.getString("serialNo")); + String result = ningboBankPluginService.executeEsb(reMain.toString(),"8000360001"); + logger.info("获取付款状态结果"+result); + + JSONObject resultObj = JSON.parseObject(result); + JSONObject attribute = resultObj.getJSONObject("attribute"); + boolean flag = resultObj.getBoolean("flag"); + + StringBuffer sb = new StringBuffer(); + sb.append("update "+tableName); + if(flag){ + JSONObject data = attribute.getJSONObject("Data"); + JSONObject transferDtl = data.getJSONObject("transferDtl"); + String status = transferDtl.getString("status"); + String msg = PayStatusEnum.getByCode(status); + if(StrUtil.isEmpty(msg)){ + msg ="未知交易状态,请联系管理员查证"; + sb.append(" set "+payMsg+" = '"+msg+"'"); + sb.append(" , "+fieldName+" = '2'"); + } + sb.append(" set "+payMsg+" = '"+msg+"'"); + if(status.equals("0")||status.equals("-2")||status.equals("-3")||status.equals("2")||status.equals("4")||status.equals("5")||status.equals("6")||status.equals("96")||status.equals("112")){ + sb.append(" , "+fieldName+" = '0'"); + String payDateStr = DateUtil.now(); + sb.append(" , "+payDate+" = '"+payDateStr+"'"); + } + }else { + sb.append(" set "+payMsg+" = '查询失败,请联系管理员'"); + sb.append(" ,"+fieldName+" = '2'"); + + } + sb.append(" where id = '"+main.getString("id")+"'"); + //修改推送状态,防止重复推送 + oaBillEntity.setSql(sb.toString()); + payBillDao.updateStateForId(sb.toString(),oaBillEntity); + } catch (Exception e) { + StringBuffer sb = new StringBuffer(); + sb.append("update "+tableName ); + sb.append(" set "+payMsg+" = '获取交易状态失败'"); + sb.append(" , "+fieldName+" = '2'"); + sb.append(" where id = '"+main.getString("id")+"'"); + logger.info("获取交易状态失败,更新交易信息为失败状态,后续不在查询"); + e.printStackTrace(); + } + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return new JsonResultEntity("成功",true,new JsonResultEntity()); + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java index 72ed2d87..0551cd08 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java @@ -11,6 +11,15 @@ import java.util.List; **/ public interface INingboBankPluginService { + /** + * 调用宁波银行esb接口 + * @param params + * @param apiCode + * @return + */ + String executeEsb(String params,String apiCode); + + /** * 保存收款日志到oa底表 * @param accTransactionResList diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java index 2dcbf164..16aa36a9 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java @@ -12,6 +12,8 @@ import com.hzya.frame.seeyon.dongj.entity.Formmain0044Entity; import com.hzya.frame.seeyon.dongj.service.IFormmain0044Service; import com.hzya.frame.stringutil.StringUtil; 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; @@ -29,9 +31,30 @@ public class NingboBankPluginServiceImpl implements INingboBankPluginService { @Autowired private IFormmain0044Service formmain0044Service; - + Logger logger = LoggerFactory.getLogger(getClass()); @Value("${OA.data_source_code}") private String oa_data_source_code; + + /** + * 调用宁波银行esb接口 + * + * @param params + * @param apiCode + * @return + */ + @Override + public String executeEsb(String params, String apiCode) { + logger.info("请求apiCode:{},参数:{}",apiCode,params); + Map header = MapBuilder.create(true) + .put("apiCode", apiCode) + .put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj") + .put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") + .put("appId","800036") + .build(); + String res = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(header).body(params).timeout(60000).execute().body(); + return res; + } + /** * 保存收款日志到oa底表 * @param accTransactionResList diff --git a/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/req/SingleTransferReq.java b/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/req/SingleTransferReq.java new file mode 100644 index 00000000..7fbb7f5c --- /dev/null +++ b/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/req/SingleTransferReq.java @@ -0,0 +1,209 @@ +package com.hzya.frame.ningboBankTreasury.dto.req; + +/** + * @Description 单笔转账请求参数 + * @Author xiangerlin + * @Date 2024/7/26 16:27 + **/ +public class SingleTransferReq { + //客户号 必填 + private String custId; + //付款账号 必填 + private String payAcc; + //用途 必填,长度不能超过70 + private String purpose; + //收款账号 必填 + private String rcvAcc; + //收款方行名 和联行号二者必须填一个 + private String rcvBankName; + //收款方联行号 对公支付必填 + private String rcvBankNo; + //金额 必填 + private String amt; + //同城异地标识 0同城 1异地 + private String areaSign; + //单位代码 必填 + private String corpCode; + //是否同行转账 0他行 1同行 + private String difBank; + //交易流水号 + private String serialNo; + //对公对私标识 0对公 1对丝 + private String isForIndividual; + //是否预约支付 0非预约 1预约 + private String isSubscribe; + //是否短信通知收款人 0不通知 1通知,只支持宁波银行付款的情况 + private String isTellRcv; + //收款方手机号 + private String rcvMobile; + //收款户名 + private String rcvName; + //备注 + private String remark; + //预约转账时间 + private String wishPayTime; + //支付方式 0直接付款 1代理支付 2联动支付 3自动请款 ,为空时默认直接付款 + private String payType; + //代理/联动账号/拨款账号 + private String remarkAcc; + + public String getCustId() { + return custId; + } + + public void setCustId(String custId) { + this.custId = custId; + } + + public String getPayAcc() { + return payAcc; + } + + public void setPayAcc(String payAcc) { + this.payAcc = payAcc; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getRcvAcc() { + return rcvAcc; + } + + public void setRcvAcc(String rcvAcc) { + this.rcvAcc = rcvAcc; + } + + public String getRcvBankName() { + return rcvBankName; + } + + public void setRcvBankName(String rcvBankName) { + this.rcvBankName = rcvBankName; + } + + public String getRcvBankNo() { + return rcvBankNo; + } + + public void setRcvBankNo(String rcvBankNo) { + this.rcvBankNo = rcvBankNo; + } + + public String getAmt() { + return amt; + } + + public void setAmt(String amt) { + this.amt = amt; + } + + public String getAreaSign() { + return areaSign; + } + + public void setAreaSign(String areaSign) { + this.areaSign = areaSign; + } + + public String getCorpCode() { + return corpCode; + } + + public void setCorpCode(String corpCode) { + this.corpCode = corpCode; + } + + public String getDifBank() { + return difBank; + } + + public void setDifBank(String difBank) { + this.difBank = difBank; + } + + public String getSerialNo() { + return serialNo; + } + + public void setSerialNo(String serialNo) { + this.serialNo = serialNo; + } + + public String getIsForIndividual() { + return isForIndividual; + } + + public void setIsForIndividual(String isForIndividual) { + this.isForIndividual = isForIndividual; + } + + public String getIsSubscribe() { + return isSubscribe; + } + + public void setIsSubscribe(String isSubscribe) { + this.isSubscribe = isSubscribe; + } + + public String getIsTellRcv() { + return isTellRcv; + } + + public void setIsTellRcv(String isTellRcv) { + this.isTellRcv = isTellRcv; + } + + public String getRcvMobile() { + return rcvMobile; + } + + public void setRcvMobile(String rcvMobile) { + this.rcvMobile = rcvMobile; + } + + public String getRcvName() { + return rcvName; + } + + public void setRcvName(String rcvName) { + this.rcvName = rcvName; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getWishPayTime() { + return wishPayTime; + } + + public void setWishPayTime(String wishPayTime) { + this.wishPayTime = wishPayTime; + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType; + } + + public String getRemarkAcc() { + return remarkAcc; + } + + public void setRemarkAcc(String remarkAcc) { + this.remarkAcc = remarkAcc; + } +} diff --git a/service/src/main/java/com/hzya/frame/ningboBankTreasury/enums/PayStatusEnum.java b/service/src/main/java/com/hzya/frame/ningboBankTreasury/enums/PayStatusEnum.java new file mode 100644 index 00000000..01a697f7 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/ningboBankTreasury/enums/PayStatusEnum.java @@ -0,0 +1,72 @@ +package com.hzya.frame.ningboBankTreasury.enums; + +/** + * @Description 转账状态 + * @Author xiangerlin + * @Date 2024/7/29 17:11 + **/ +public enum PayStatusEnum { + SUCCESS("0","交易成功"), + // 失败状态 + FAILED_DELETED("-2", "已删除"), + APPROVAL_REJECTED_CLOSED("-3", "审批打回交易关闭"), + TRANSACTION_FAILED("2", "交易失败"), + FUND_ALLOCATION_FAILED("4", "交易失败,资金下拨失败"), + LINKAGE_PAYMENT_FAILED_REFUNDED("5", "联动支付失败,资金退回成功"), + LINKAGE_PAYMENT_FAILED_REFUND_PENDING("6", "联动支付失败,资金退回查证中"), + LINKAGE_PAYMENT_FAILED_REFUND_FAILED("96", "联动支付失败,资金退回失败"), + PAYMENT_REQUEST_FAILED("112", "请款失败"), + + // 其他状态 + REJECTED("-1", "驳回"), + PENDING_VERIFICATION("1", "交易待查证"), + PENDING_SEND("3", "待发送"), + PENDING_APPROVAL("11", "待审批"), + APPROVAL_THROUGH("95", "审批通过"), + TEMPORARY_STORAGE("7", "暂存"), + WITHDRAWN_BY_OPERATOR("-4", "经办撤回"), + PAYMENT_REQUEST_PENDING("111", "请款查证中"), + PAYMENT_REQUEST_SUCCEEDED_PENDING_SEND("113", "请款成功,交易待发送"), + LINKAGE_PAYMENT_SUCCEEDED_PENDING_SEND("114", "联动支付成功,智能支付交易待发送"); + + // 枚举属性 + private final String code; + private final String description; + + // 枚举构造函数 + PayStatusEnum(String code, String description) { + this.code = code; + this.description = description; + } + + // 获取状态码 + + + public String getCode() { + return code; + } + + // 获取状态描述 + public String getDescription() { + return description; + } + + // 根据状态码查找枚举 + public static PayStatusEnum fromCode(String code) { + for (PayStatusEnum status : PayStatusEnum.values()) { + if (status.getCode().equals(code)) { + return status; + } + } + throw new IllegalArgumentException("Unknown code: " + code); + } + + public static String getByCode(String code){ + for (PayStatusEnum status : PayStatusEnum.values()) { + if (status.getCode().equals(code)) { + return status.getDescription(); + } + } + throw new IllegalArgumentException("Unknown code: " + code); + } +} From 2301365d08c5444e80d64098f3fc179348b85e58 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 30 Jul 2024 17:33:59 +0800 Subject: [PATCH 014/101] =?UTF-8?q?=E5=AE=81=E6=B3=A2=E9=93=B6=E8=A1=8C?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=202024=E5=B9=B47=E6=9C=8830=E6=97=A5=2017:33?= =?UTF-8?q?:52?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/AccLogPluginInitializer.java | 23 +++++++- .../NingboBankPayPluginInitializer.java | 10 +++- .../NingboBankPayResultPluginInitializer.java | 3 +- .../impl/NingboBankPluginServiceImpl.java | 4 +- .../cfgHome/plugin/ningbobank/pluginCfg.xml | 6 ++ .../spring/spring-buildpackage-dao.xml | 5 ++ .../spring/spring-buildpackage-plugin.xml | 7 +++ .../spring/spring-buildpackage-service.xml | 5 ++ .../test/java/com/hzya/frame/temButtom.java | 5 +- .../enums/CurrencyEnum.java | 55 +++++++++++++------ .../enums/PayStatusEnum.java | 18 +++++- 11 files changed, 115 insertions(+), 26 deletions(-) create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/ningbobank/pluginCfg.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/ningbobank/spring/spring-buildpackage-dao.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/ningbobank/spring/spring-buildpackage-plugin.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/ningbobank/spring/spring-buildpackage-service.xml diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/AccLogPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/AccLogPluginInitializer.java index 602932c2..899e427b 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/AccLogPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/AccLogPluginInitializer.java @@ -9,6 +9,8 @@ import com.hzya.frame.base.PluginBaseEntity; import com.hzya.frame.ningboBankTreasury.dto.req.AccTransactionReq; import com.hzya.frame.ningboBankTreasury.dto.res.AccTransactionRes; import com.hzya.frame.ningboBankTreasury.util.NingboBankUtil; +import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao; +import com.hzya.frame.plugin.a8bill.entity.PayBillEntity; import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; @@ -16,7 +18,10 @@ 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 java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -29,6 +34,10 @@ public class AccLogPluginInitializer extends PluginBaseEntity { Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private INingboBankPluginService ningboBankPluginService; + @Value("${OA.data_source_code}") + private String oa_data_source_code; + @Autowired + private IPayBillPluginInitializerDao payBillDao; /*** * 插件初始化方法 * @Author 👻👻👻👻👻👻👻👻 gjh @@ -106,11 +115,21 @@ public class AccLogPluginInitializer extends PluginBaseEntity { **/ @Override public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + PayBillEntity oaBillEntity = new PayBillEntity(); + oaBillEntity.setDataSourceCode(oa_data_source_code); + List> hashMaps = payBillDao.getOaBillData("SELECT field0002 from formmain_0053",oaBillEntity); + List accList = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(hashMaps)){ + for (HashMap hashMap : hashMaps) { + String field0002 = String.valueOf(hashMap.get("field0002")); + accList.add(field0002); + } + } //1、查询宁波银行的交易记录 AccTransactionReq accTransactionReq = new AccTransactionReq(); accTransactionReq.setCdSign(NingboBankUtil.SHOURU); - accTransactionReq.setBeginDate("2024-05-01"); - accTransactionReq.setEndDate("2024-05-30"); + accTransactionReq.setBeginDate("2024-07-01"); + accTransactionReq.setEndDate("2024-07-30"); accTransactionReq.setBankAccList(Convert.toList(String.class,"86041110000110293,86041110000109337,6223160030547665,6214180002001411023,6214180000002609736")); Map headerMap = MapBuilder.create(true) .put("apiCode", "8000360002") diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayPluginInitializer.java index 54edfb8a..e9ce1098 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayPluginInitializer.java @@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import javax.annotation.Resource; +import java.nio.charset.StandardCharsets; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -167,24 +168,29 @@ public class NingboBankPayPluginInitializer extends PluginBaseEntity { String sync_flag = ""; try { if(StrUtil.isEmpty(interId)){// 银行状态 1支付中 2 支付失败 null 未提交支付 0支付成功 + logDetails.setCreate_time(new Date()); + logDetails.setModify_time(new Date()); if(flag){ subState = "1"; sync_flag = " ,"+payMsg+" = '支付中'"; taskLivingDetailsService.saveLogToSuccess(logDetails); }else{ subState = "2"; - sync_flag = " ,"+payMsg+" = '"+attribute+"'"; + String resMsg = JSONObject.parseObject(attribute).getString("retMsg"); + sync_flag = " ,"+payMsg+" = '"+resMsg+"'"; taskLivingDetailsService.saveLogToFail(logDetails); } }else{ logDetails.setId(interId); + logDetails.setModify_time(new Date()); if(flag){ subState = "1"; sync_flag = " ,"+payMsg+" = '支付中'"; taskLivingDetailsService.saveLogFailToSuccess(logDetails); }else{ subState = "2"; - sync_flag = " ,"+payMsg+" = '"+attribute+"'"; + String resMsg = JSONObject.parseObject(attribute).getString("retMsg"); + sync_flag = " ,"+payMsg+" = '"+resMsg+"'"; taskLivingDetailsService.updateLogFailToSuccess(logDetails); } } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayResultPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayResultPluginInitializer.java index 3bed39bf..5f0c1705 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayResultPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayResultPluginInitializer.java @@ -152,7 +152,8 @@ public class NingboBankPayResultPluginInitializer extends PluginBaseEntity { sb.append(" , "+fieldName+" = '2'"); } sb.append(" set "+payMsg+" = '"+msg+"'"); - if(status.equals("0")||status.equals("-2")||status.equals("-3")||status.equals("2")||status.equals("4")||status.equals("5")||status.equals("6")||status.equals("96")||status.equals("112")){ + //收否最终态 + if(PayStatusEnum.isFinally(status)){ sb.append(" , "+fieldName+" = '0'"); String payDateStr = DateUtil.now(); sb.append(" , "+payDate+" = '"+payDateStr+"'"); diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java index 16aa36a9..fee9e555 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java @@ -91,7 +91,9 @@ private IFormmain0044Service formmain0044Service; String serialNo = StringUtil.nullConvert(accTransactionRes.getSerialNo()); String currency = StringUtil.nullConvert(CurrencyEnum.getNameByCode(accTransactionRes.getCurCode())); String uses = StringUtil.nullConvert(accTransactionRes.getUses()); - String curCode = StringUtil.nullConvert(accTransactionRes.getCurCode()); + //String curCode = StringUtil.nullConvert(accTransactionRes.getCurCode()); + //这里转换成货币符号 + String curCode = StringUtil.nullConvert(CurrencyEnum.getSymbolByCode(accTransactionRes.getCurCode())); String postScript = StringUtil.nullConvert(accTransactionRes.getPostScript()); String data = StrUtil.format(getAccLogXmlTemplate(),bankAcc,bankName,accName,oppAccNo,oppAccName,oppAccBank,transTime,serialId,amt,abs,bankType,serialNo,currency,uses,postScript,curCode); JSONObject paramsTemplate = new JSONObject(); diff --git a/buildpackage/src/main/resources/cfgHome/plugin/ningbobank/pluginCfg.xml b/buildpackage/src/main/resources/cfgHome/plugin/ningbobank/pluginCfg.xml new file mode 100644 index 00000000..b278a16d --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/ningbobank/pluginCfg.xml @@ -0,0 +1,6 @@ + + +NingboBankPlugin +宁波银行财资大管家插件 +202407250001 + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/ningbobank/spring/spring-buildpackage-dao.xml b/buildpackage/src/main/resources/cfgHome/plugin/ningbobank/spring/spring-buildpackage-dao.xml new file mode 100644 index 00000000..a8d4b5ed --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/ningbobank/spring/spring-buildpackage-dao.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/ningbobank/spring/spring-buildpackage-plugin.xml b/buildpackage/src/main/resources/cfgHome/plugin/ningbobank/spring/spring-buildpackage-plugin.xml new file mode 100644 index 00000000..3c2d53a3 --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/ningbobank/spring/spring-buildpackage-plugin.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/ningbobank/spring/spring-buildpackage-service.xml b/buildpackage/src/main/resources/cfgHome/plugin/ningbobank/spring/spring-buildpackage-service.xml new file mode 100644 index 00000000..7d4d44a9 --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/ningbobank/spring/spring-buildpackage-service.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/buildpackage/src/test/java/com/hzya/frame/temButtom.java b/buildpackage/src/test/java/com/hzya/frame/temButtom.java index f8628b33..4ab3bcf7 100644 --- a/buildpackage/src/test/java/com/hzya/frame/temButtom.java +++ b/buildpackage/src/test/java/com/hzya/frame/temButtom.java @@ -65,10 +65,11 @@ public class temButtom { @Test public void accDetailTest(){ AccTransactionReq accTransactionReq = new AccTransactionReq(); - accTransactionReq.setBeginDate("2024-06-01"); - accTransactionReq.setEndDate("2024-06-30"); + accTransactionReq.setBeginDate("2024-07-01"); + accTransactionReq.setEndDate("2024-07-30"); accTransactionReq.setPageSize("10"); accTransactionReq.setCustId("0000112058"); + //accTransactionReq.setBankAccList(Convert.toList(String.class,"86041110000110293,86041110000109337,6223160030547665,6214180002001411023,6214180000002609736")); accTransactionReq.setBankAccList(Convert.toList(String.class,"86041110000110293,86041110000109337,6223160030547665,6214180002001411023,6214180000002609736")); List list = ningboxService.queryAccDetails(accTransactionReq); System.out.println("查询到的条数"+list.size()); diff --git a/service/src/main/java/com/hzya/frame/ningboBankTreasury/enums/CurrencyEnum.java b/service/src/main/java/com/hzya/frame/ningboBankTreasury/enums/CurrencyEnum.java index e23923e6..38e61b85 100644 --- a/service/src/main/java/com/hzya/frame/ningboBankTreasury/enums/CurrencyEnum.java +++ b/service/src/main/java/com/hzya/frame/ningboBankTreasury/enums/CurrencyEnum.java @@ -7,25 +7,28 @@ package com.hzya.frame.ningboBankTreasury.enums; **/ public enum CurrencyEnum { - 人民币("01","人民币"), - 美元("02","美元"), - 澳元("03","澳元"), - 欧元("04","欧元"), - 日元("05","日元"), - 英镑("06","英镑"), - 港币("07","港币"), - 新加坡元("08","新加坡元"), - 加拿大元("09","加拿大元"), - 瑞士("10","瑞士"), - 泰铢("23","泰铢"), - 新台币("92","新台币"), - ALL("ALL","多币"); - private final String name; - private final String code; + 人民币("01","人民币","CNY"), + 美元("02","美元","USD"), + 澳元("03","澳元","AUD"), + 欧元("04","欧元","EUR"), + 日元("05","日元","JPY"), + 英镑("06","英镑","GBP"), + 港币("07","港币","HKD"), + 新加坡元("08","新加坡元","SGD"), + 加拿大元("09","加拿大元","CAD"), + 瑞士("10","瑞士","CHF"), + 泰铢("23","泰铢","THB"), + 新台币("92","新台币","TWD"), + ALL("ALL","多币","ALL"); - CurrencyEnum(String name, String code) { - this.name = name; + private final String code; + private final String name; + //英文代码 CNY USD之类的 + private final String symbol; + CurrencyEnum(String code,String name,String symbol) { this.code = code; + this.name = name; + this.symbol = symbol; } public String getName() { @@ -35,6 +38,10 @@ public enum CurrencyEnum { return code; } + public String getSymbol() { + return symbol; + } + /** * 根据code获取币种名字 * @param code @@ -48,4 +55,18 @@ public enum CurrencyEnum { } return null; // 或者抛出异常,表示找不到对应的币种 } + + /** + * 根据code获取币种符号 + * @param code + * @return + */ + public static String getSymbolByCode(String code){ + for (CurrencyEnum currency : values()) { + if (currency.code.equals(code)) { + return currency.symbol; + } + } + return null; // 或者抛出异常,表示找不到对应的币种 + } } diff --git a/service/src/main/java/com/hzya/frame/ningboBankTreasury/enums/PayStatusEnum.java b/service/src/main/java/com/hzya/frame/ningboBankTreasury/enums/PayStatusEnum.java index 01a697f7..fa5bd341 100644 --- a/service/src/main/java/com/hzya/frame/ningboBankTreasury/enums/PayStatusEnum.java +++ b/service/src/main/java/com/hzya/frame/ningboBankTreasury/enums/PayStatusEnum.java @@ -32,7 +32,6 @@ public enum PayStatusEnum { // 枚举属性 private final String code; private final String description; - // 枚举构造函数 PayStatusEnum(String code, String description) { this.code = code; @@ -69,4 +68,21 @@ public enum PayStatusEnum { } throw new IllegalArgumentException("Unknown code: " + code); } + + /** + * 是否为最终态 + * @param code + * @return + */ + public static boolean isFinally(String code){ + return SUCCESS.code.equals(code) + || FAILED_DELETED.code.equals(code) + || APPROVAL_REJECTED_CLOSED.code.equals(code) + || TRANSACTION_FAILED.code.equals(code) + || FUND_ALLOCATION_FAILED.code.equals(code) + || LINKAGE_PAYMENT_FAILED_REFUNDED.code.equals(code) + || LINKAGE_PAYMENT_FAILED_REFUND_PENDING.code.equals(code) + || LINKAGE_PAYMENT_FAILED_REFUND_FAILED.code.equals(code) + || PAYMENT_REQUEST_FAILED.code.equals(code); + } } From cf0f756f2f3330870e06b561a9ae117d461efed3 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 31 Jul 2024 14:40:26 +0800 Subject: [PATCH 015/101] =?UTF-8?q?=E5=AE=81=E6=B3=A2=E9=93=B6=E8=A1=8C?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=202024=E5=B9=B47=E6=9C=8831=E6=97=A5=2014:40?= =?UTF-8?q?:22?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/NingboBankTreasuryServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/main/java/com/hzya/frame/ningboBankTreasury/service/impl/NingboBankTreasuryServiceImpl.java b/service/src/main/java/com/hzya/frame/ningboBankTreasury/service/impl/NingboBankTreasuryServiceImpl.java index f2e32e87..207f9fec 100644 --- a/service/src/main/java/com/hzya/frame/ningboBankTreasury/service/impl/NingboBankTreasuryServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/ningboBankTreasury/service/impl/NingboBankTreasuryServiceImpl.java @@ -32,7 +32,7 @@ public class NingboBankTreasuryServiceImpl implements INingboBankTreasuryService * @param jsonObject * @return com.hzya.frame.web.entity.JsonResultEntity * @Author lvleigang - * @Description 单笔查证接口 + * @Description 单笔转账查证接口 * @Date 4:45 下午 2024/7/9 **/ @Override From 0495fda2642ba493b65c23e50fd0b66e8812eb87 Mon Sep 17 00:00:00 2001 From: username Date: Wed, 31 Jul 2024 15:27:38 +0800 Subject: [PATCH 016/101] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=94=B6=E6=AC=BE=E5=8D=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzya/frame/bip/v3/v2207/util/BipUtil.java | 2 +- .../receiptFor/entity/ReceiptForEntity.java | 161 +++++++++++++++++- .../receiptFor/entity/ReceiptForEntity.xml | 69 ++++++-- .../service/impl/ReceiptForServiceImpl.java | 106 +++++++++--- 4 files changed, 302 insertions(+), 36 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/bip/v3/v2207/util/BipUtil.java b/service/src/main/java/com/hzya/frame/bip/v3/v2207/util/BipUtil.java index 5148ef17..551d932d 100644 --- a/service/src/main/java/com/hzya/frame/bip/v3/v2207/util/BipUtil.java +++ b/service/src/main/java/com/hzya/frame/bip/v3/v2207/util/BipUtil.java @@ -58,7 +58,7 @@ public class BipUtil { } return null; } - public static String sendOaToDj(String parm, String apiCode){ + public static String sendOaToU8c(String parm, String apiCode){ String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface"; System.out.println("推送参数"+parm); String result = HttpRequest.post(baseUrl) diff --git a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.java b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.java index b549b44a..63ce8300 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.java +++ b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.java @@ -3,15 +3,168 @@ package com.hzya.frame.seeyon.receiptFor.entity; import com.hzya.frame.web.entity.BaseEntity; public class ReceiptForEntity extends BaseEntity { - private String dfybje; - private String djrq; + + private String djrq;//field0003、单据日期、合同申请日期 private String dwbm; - private String hbbm; + private String hbbm;//field0090客商、客商编码、客商档案 private String lrr; private String shr; private String shrq; - private String state; + private String djbh;//field0001、单据号 + + private Long wldx;//field0004、往来对象 + private String deptid;//field0091部门、部门档案、部门编码 + private String ywybm;//field0092业务员、人员档案、业务员编码 + private String bfyhzh;//field0060收款银行账号、客户方账号 + private String skyhmc;//field0062收款银行名称、客户方开户行 + private String dfyhzh;//field0014付款银行账号,我方账号 + private String fkyhmc;//field0051付款银行名称,我方开户行 + + private String bzbm;//field0072币种、默认“CNY”,币种编码 + + private String dfbbje; + private String dfybje; + + private String ddh; + private String bbhl; + private String contractno; + + + + public String getDfbbje() { + return dfbbje; + } + + public void setDfbbje(String dfbbje) { + this.dfbbje = dfbbje; + } + + public String getDdh() { + return ddh; + } + + public void setDdh(String ddh) { + this.ddh = ddh; + } + + public String getBbhl() { + return bbhl; + } + + public void setBbhl(String bbhl) { + this.bbhl = bbhl; + } + + public String getContractno() { + return contractno; + } + + public void setContractno(String contractno) { + this.contractno = contractno; + } + + private String fph;//field0019发票号 + + private String zy;//field0059摘要 + + private String bzbm_code;//field0073币种编码 + + public String getFph() { + return fph; + } + + public void setFph(String fph) { + this.fph = fph; + } + + public String getZy() { + return zy; + } + + public void setZy(String zy) { + this.zy = zy; + } + + public String getBzbm_code() { + return bzbm_code; + } + + public void setBzbm_code(String bzbm_code) { + this.bzbm_code = bzbm_code; + } + + public String getDjbh() { + return djbh; + } + + public void setDjbh(String djbh) { + this.djbh = djbh; + } + + public Long getWldx() { + return wldx; + } + + public void setWldx(Long wldx) { + this.wldx = wldx; + } + + public String getDeptid() { + return deptid; + } + + public void setDeptid(String deptid) { + this.deptid = deptid; + } + + public String getYwybm() { + return ywybm; + } + + public void setYwybm(String ywybm) { + this.ywybm = ywybm; + } + + public String getBfyhzh() { + return bfyhzh; + } + + public void setBfyhzh(String bfyhzh) { + this.bfyhzh = bfyhzh; + } + + public String getSkyhmc() { + return skyhmc; + } + + public void setSkyhmc(String skyhmc) { + this.skyhmc = skyhmc; + } + + public String getDfyhzh() { + return dfyhzh; + } + + public void setDfyhzh(String dfyhzh) { + this.dfyhzh = dfyhzh; + } + + public String getFkyhmc() { + return fkyhmc; + } + + public void setFkyhmc(String fkyhmc) { + this.fkyhmc = fkyhmc; + } + + public String getBzbm() { + return bzbm; + } + + public void setBzbm(String bzbm) { + this.bzbm = bzbm; + } public String getState() { return state; diff --git a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml index 0b4d5ca3..c90d9e45 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml +++ b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml @@ -13,6 +13,20 @@ + + + + + + + + + + + + + + @@ -25,30 +39,61 @@ + + + + + + + + + + + + + + + + + + - update formmain_0045 set state = #{state} where id = #{id} + update formmain_0045 set field0089 = #{state} where id = #{id} diff --git a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/impl/ReceiptForServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/impl/ReceiptForServiceImpl.java index aa9905ff..1308f412 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/impl/ReceiptForServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/impl/ReceiptForServiceImpl.java @@ -66,12 +66,11 @@ public class ReceiptForServiceImpl extends BaseService JSONObject main = bindingAdd(rec); logger.info("收款认领单推送数据:"+main.toString()); - String result = BipUtil.sendOaToDj(main.toString(),"8000350034"); + String result = BipUtil.sendOaToU8c(main.toString(),"8000350034"); logger.info("收款认领单推送结果:"+result); IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); logDetails.setRootAppPk(rec.getId()); - //logDetails.setRootAppBill(); - //不知道源系统单据是什么,所以先注释掉了 + logDetails.setRootAppBill(rec.getDjbh()); logDetails.setNewTransmitInfo(result); logDetails.setNewPushDate(new Date()); logDetails.setRootAppNewData(JSON.toJSONString(rec)); @@ -81,17 +80,16 @@ public class ReceiptForServiceImpl extends BaseService boolean flag = resultObj.get("status").equals("success"); if(flag){ // 推送成功,更新状态 - rec.setState("1"); + rec.setState("Y"); }else{ // 推送失败 - rec.setState("0"); + rec.setState("N"); } rec.setDataSourceCode(requestJson.getString("db_code")); try{ if(StrUtil.isEmpty(interId)){ if(flag){ //首推成功 - //由于字段匹配问题,logDetails中没设置单据号,因此会保存失败。 taskLivingDetailsService.saveLogToSuccess(logDetails); }else{ //首推失败 @@ -124,29 +122,99 @@ public class ReceiptForServiceImpl extends BaseService return new JsonResultEntity("成功",true,resultEntity); } +// @NotNull +// private JSONObject bindingAdd(ReceiptForEntity rec) { +// String djrq = rec.getDjrq().substring(0,10); +// if(djrq.length()>10){ +// djrq = rec.getDjrq().substring(0,10); +// } +// String shrq = rec.getShrq().substring(0,10); +// if(shrq.length()>10){ +// shrq = rec.getShrq().substring(0,10); +// } +// +// JSONObject childrenJson = new JSONObject(); +// childrenJson.put("dfybje",rec.getDfybje()); +// +// childrenJson.put("dfbbje","24"); +// childrenJson.put("dfybje","12"); +// childrenJson.put("ddh","1231231"); +// childrenJson.put("fph","fph12312"); +// childrenJson.put("zy","zy"); +// childrenJson.put("bzbm_code","CNY"); +// childrenJson.put("bbhl","2"); +// childrenJson.put("contractno","hth123123"); +// +// +// JSONArray childrenArray = new JSONArray(); +// childrenArray.add(childrenJson); +// +// JSONObject parentvo = new JSONObject(); +// parentvo.put("djrq",djrq); +// parentvo.put("dwbm",rec.getDwbm()); +// parentvo.put("hbbm",rec.getHbbm()); +// parentvo.put("lrr",rec.getLrr()); +// parentvo.put("shr",rec.getShr()); +// parentvo.put("shrq",shrq); +// +// JSONObject billvoJson = new JSONObject(); +// billvoJson.put("children",childrenArray); +// billvoJson.put("parentvo",parentvo); +// +// JSONArray billvoArray = new JSONArray(); +// billvoArray.add(billvoJson); +// JSONObject main = new JSONObject(); +// main.put("billvo",billvoArray); +// return main; +// } + @NotNull private JSONObject bindingAdd(ReceiptForEntity rec) { - String djrq = rec.getDjrq().substring(0,10); - if(djrq.length()>19){ - djrq = rec.getDjrq().substring(0,10); - } - String shrq = rec.getShrq().substring(0,10); - if(shrq.length()>19){ - shrq = rec.getShrq().substring(0,10); - } +// if(rec.getDjrq()!=null){ +// String djrq = rec.getDjrq().substring(0,10); +// if(djrq.length()>10){ +// djrq = rec.getDjrq().substring(0,10); +// } +// } +// if(rec.getShrq()!=null){ +// String shrq = rec.getShrq().substring(0,10); +// if(shrq.length()>10){ +// shrq = rec.getShrq().substring(0,10); +// } +// } + + JSONObject childrenJson = new JSONObject(); + childrenJson.put("dfybje",rec.getDfybje()); + + //childrenJson.put("dfbbje",rec.getDfbbje()); + childrenJson.put("ddh",rec.getDdh()); + childrenJson.put("fph",rec.getFph()); + childrenJson.put("zy",rec.getZy()); + childrenJson.put("bzbm_code",rec.getBzbm_code()); + childrenJson.put("bbhl",rec.getBbhl()); + childrenJson.put("contractno",rec.getContractno()); + - JSONObject dfybjeJson = new JSONObject(); - dfybjeJson.put("dfybje",rec.getDfybje()); JSONArray childrenArray = new JSONArray(); - childrenArray.add(dfybjeJson); + childrenArray.add(childrenJson); JSONObject parentvo = new JSONObject(); - parentvo.put("djrq",djrq); + parentvo.put("djrq",rec.getDjrq().substring(0,10)); parentvo.put("dwbm",rec.getDwbm()); parentvo.put("hbbm",rec.getHbbm()); parentvo.put("lrr",rec.getLrr()); parentvo.put("shr",rec.getShr()); - parentvo.put("shrq",shrq); + parentvo.put("shrq",rec.getShrq().substring(0,10)); + + parentvo.put("djbh",rec.getDjbh()); + //parentvo.put("wldx",rec.getWldx()); + parentvo.put("deptid",rec.getDeptid()); + //parentvo.put("ywybm",rec.getYwybm()); + //parentvo.put("bfyhzh",rec.getBfyhzh()); + parentvo.put("skyhmc",rec.getSkyhmc()); + //parentvo.put("dfyhzh",rec.getDfyhzh()); + parentvo.put("fkyhmc",rec.getFkyhmc()); + parentvo.put("bzbm",rec.getBzbm()); JSONObject billvoJson = new JSONObject(); billvoJson.put("children",childrenArray); From 9b23c66998767595524c0d9917d2651a86c75d26 Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Wed, 31 Jul 2024 19:00:27 +0800 Subject: [PATCH 017/101] 1 --- .../com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml index 63dfa9c2..6ca1093d 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml @@ -1005,9 +1005,9 @@ where id = #{id} and sts = 'Y' + order by sorts asc limit #{size} - order by sorts asc From 33d5f8f3209aaca9a4c52b77fff9ec524dbca50a Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Fri, 2 Aug 2024 08:55:48 +0800 Subject: [PATCH 018/101] 1 --- .../impl/GroovyIntegrationServiceImpl.java | 88 +++++++++++++------ 1 file changed, 59 insertions(+), 29 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java index ee5ee3a1..a93ed74b 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java @@ -34,42 +34,49 @@ public class GroovyIntegrationServiceImpl implements IGroovyIntegrationService { } public static void main(String[] args) { - java.lang.String str = "{\"data\":{\"enablestate\":\"2\",\"user_password\":\"Hzya@1314\",\"gender\":\"12312\",\"user_name\":\"测试用户\",\"modify_time\":1719305835000,\"document_rule_num\":112,\"pk_org\":{\"org_mnecode\":\"1\",\"modify_time\":1718866279000,\"document_rule_num\":4,\"add_status\":\"0\",\"org_address\":\"1\",\"delete_status\":\"1\",\"org_innercode\":\"1\",\"id\":\"f7a8cee35fce4aa8ab266b3c7f125d7d\",\"data_status\":\"F\",\"modify_user_id\":\"1\",\"org_name\":\"开发部\",\"sorts\":4,\"document_rule\":\"ZZ-2024-06-20-00004\",\"create_user_id\":\"1\",\"create_time\":1718864103000,\"company_id\":\"Y\",\"org_memo\":\"1\",\"update_status\":\"0\",\"sts\":\"Y\",\"org_tel\":\"1\",\"org_id\":\"Y\",\"org_ncindustry\":\"1\",\"org_fatherorg\":\"c4913dde8da142bab4206fc084269382\",\"org_code\":\"003\",\"org_principal\":\"1\",\"org_countryzone\":\"1\"},\"add_status\":\"0\",\"pwdlevelcode\":\"\",\"user_type\":\"1\",\"user_code\":\"17633965916\",\"delete_status\":\"1\",\"id\":\"d99fe4e1c211450a960f7a1057da0d2c\",\"data_status\":\"F\",\"modify_user_id\":\"1\",\"sorts\":346,\"document_rule\":\"YH-2024-06-25-00112\",\"create_user_id\":\"1\",\"create_time\":1719305229000,\"company_id\":\"Y\",\"user_code_q\":\"KP003\",\"format\":\"ZH-CN\",\"mobile\":\"123123\",\"identityverifycode\":\"静态密码验证\",\"islocked\":\"N\",\"update_status\":\"0\",\"base_doc_type\":\"0\",\"sts\":\"Y\",\"login_name\":\"123123\",\"pwdparam\":\"2024-06-17\",\"org_id\":\"Y\",\"abledate\":\"2024-06-17 00:00:00\",\"isca\":\"Y\",\"contentlang\":\"ZH\"},\"query\":\"[]\",\"header\":\"[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"length\\\":\\\"100\\\",\\\"index\\\":0,\\\"description\\\":\\\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA87rrNR\\\",\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"7127798c-b731-453a-b3ac-cfe9033eeace\\\",\\\"parameterName\\\":\\\"pubKey\\\",\\\"required\\\":true,\\\"example\\\":\\\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA87rrNREgMNeOEOwlvM2iqqEfshDadRHziDSB2PbRnoMqSv1nGr3XBlZuseNj5HmxDEkLhOdfyw0yjzoz3wK7XhFpeN4Iyf7NT7hps5jAQMEpnul9Qwmj5qUr/eK5SaO9H8n7sh9BvCdrX9oRUh+U2/ceA3O+y/MUHk5DRvSadc8FhpqbOaNBbAzPnyYAwpVUPvaJ90jcGN1ZG99HR1GEzC+Cn9s6vgt7dYL6ysMs36bSP47xraDSxpfr0CLwa6JV/9KjLIeqL1ZaMtK0CJ1zJGCBA6O6kgxeE9Ul7q2lSS6mPAEJ78izaTYsrjhLpKT+eTtFBOLFbiCrbLp8tVE5kwIDAQAB\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"length\\\":\\\"50\\\",\\\"index\\\":1,\\\"description\\\":\\\"OA\\\",\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"7f965281-df0f-4d2f-b005-07e061fcde49\\\",\\\"parameterName\\\":\\\"client_id\\\",\\\"required\\\":true,\\\"example\\\":\\\"OA\\\"},{\\\"parameterType\\\":\\\"authport\\\",\\\"length\\\":\\\"50\\\",\\\"index\\\":2,\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"cbc0e105-17c0-4385-8863-8903303edc1f\\\",\\\"parameterName\\\":\\\"access_token\\\",\\\"example\\\":[\\\"attribute\\\",\\\"data\\\",\\\"access_token\\\"]}]\",\"body\":\"[{\\\"index\\\":0,\\\"id\\\":\\\"beeedbc6-24c2-4093-9a5e-20fced9fb1b4\\\",\\\"parameterName\\\":\\\"body\\\",\\\"first\\\":true}]\"}"; - A88772 s = new A88772(); - s.execute(str); +// java.lang.String str = "{\"data\":{\"document_rule\":\"WLFL-2024-07-31-00025\",\"create_user_id\":\"1\",\"create_time\":1722405930000,\"company_id\":\"Y\",\"modify_time\":1722405930000,\"materiel_classify_name\":\"测试下发一级\",\"document_rule_num\":25,\"materiel_classify_code\":\"09\",\"add_status\":\"0\",\"update_status\":\"0\",\"sts\":\"Y\",\"delete_status\":\"1\",\"org_id\":\"Y\",\"id\":\"3dac9727cc0648baa8c1355464ad44b8\",\"data_status\":\"F\",\"modify_user_id\":\"1\",\"sorts\":34},\"query\":\"[]\",\"header\":\"[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":0,\\\"parameterName\\\":\\\"usercode\\\",\\\"id\\\":\\\"e2c4013a-a5ad-4d21-9e91-aac0dd738838\\\",\\\"example\\\":\\\"17633965916\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":1,\\\"parameterName\\\":\\\"password\\\",\\\"id\\\":\\\"22373440-45f5-450c-9497-40ede659e831\\\",\\\"example\\\":\\\"92d40fd65a74377608c0039eaafdba99\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":2,\\\"parameterName\\\":\\\"trantype\\\",\\\"id\\\":\\\"12fd925a-29c1-42ca-a3e6-edf3c925c495\\\",\\\"example\\\":\\\"code\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":3,\\\"parameterName\\\":\\\"system\\\",\\\"id\\\":\\\"11dd627c-bb82-4304-bff0-2ba54e2b8907\\\",\\\"example\\\":\\\"01\\\"}]\",\"tripartiteId\":\"0001A110000000000R6D\",\"body\":\"[{\\\"parameterType\\\":\\\"complex\\\",\\\"children\\\":[{\\\"parameterType\\\":\\\"complexlist\\\",\\\"children\\\":[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":2,\\\"description\\\":\\\"分类编码\\\",\\\"parameterName\\\":\\\"invclasscode\\\",\\\"id\\\":\\\"3b2af319-87c8-400a-b38a-d54f9b207f26\\\",\\\"example\\\":\\\"04\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":3,\\\"description\\\":\\\"分类名称\\\",\\\"parameterName\\\":\\\"invclassname\\\",\\\"id\\\":\\\"7c5bd695-ed84-4a92-a1c7-31c862e98d21\\\",\\\"example\\\":\\\"成品测试1\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":4,\\\"description\\\":\\\"公司编码默认0001\\\",\\\"parameterName\\\":\\\"pk_corp\\\",\\\"id\\\":\\\"482d659b-b374-4fb5-b31b-32bca4a6d8be\\\",\\\"example\\\":\\\"0001\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":5,\\\"description\\\":\\\"分类主键\\\",\\\"parameterName\\\":\\\"pk_invcl\\\",\\\"id\\\":\\\"3fa6caac-e0cd-4ec7-8df4-7c990504ee25\\\",\\\"example\\\":\\\"0001F11000000000I6NN\\\"}],\\\"concreteType\\\":\\\"ObjectCom\\\",\\\"index\\\":1,\\\"parameterName\\\":\\\"invcl\\\",\\\"id\\\":\\\"0638670a-e65d-46e1-aabd-adc7a956c4cb\\\"}],\\\"concreteType\\\":\\\"Object\\\",\\\"index\\\":0,\\\"id\\\":\\\"81cdd912-9bf3-4cb4-b74f-2a8ee27de93a\\\",\\\"parameterName\\\":\\\"body\\\",\\\"first\\\":true}]\"}"; +// A88772 s = new A88772(); +// System.out.println(s.execute(str)); + + String str = "{\"data\":\"{\\\"msg\\\":\\\"转发成功\\\",\\\"type\\\":null,\\\"flag\\\":true,\\\"status\\\":\\\"200\\\",\\\"attribute\\\":{\\\"data\\\":\\\"[{\\\\\\\"pk_invcl\\\\\\\":\\\\\\\"0001A110000000000QPW\\\\\\\",\\\\\\\"invclasscode\\\\\\\":\\\\\\\"09\\\\\\\",\\\\\\\"invclassname\\\\\\\":\\\\\\\"测试下发一级\\\\\\\",\\\\\\\"invclasslev\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"pk_corp\\\\\\\":\\\\\\\"0001\\\\\\\"}]\\\",\\\"taskNumber\\\":\\\"202407310125\\\",\\\"status\\\":\\\"success\\\"}}\"}"; + g_482610back t = new g_482610back(); + System.out.println(t.execute(str)); + } + static class test0001{ + String execute(String jsonStr) { + com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject(); + com.alibaba.fastjson.JSONObject reqData = com.alibaba.fastjson.JSON.parseObject(jsonStr); + if(null !=reqData){ + com.alibaba.fastjson.JSONObject header = new com.alibaba.fastjson.JSONObject(); + if(null !=reqData.getString("status")&& !"".equals(reqData.getString("status"))){ + com.alibaba.fastjson.JSONArray dataArr = com.alibaba.fastjson.JSON.parseArray(reqData.getString("data")); + com.alibaba.fastjson.JSONObject data = (JSONObject) dataArr.get(0); + returnObject.put("success","true"); + returnObject.put("tripartiteId",data.getString("pk_invcl")); + }else{ + returnObject.put("success","false"); + } + }else{ + returnObject.put("success","false"); + } + return returnObject.toJSONString(); + } } static class A88772 { String execute(String jsonStr) { com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject(); com.alibaba.fastjson.JSONObject bodys = new com.alibaba.fastjson.JSONObject(); - + com.alibaba.fastjson.JSONArray invcl = new com.alibaba.fastjson.JSONArray(); + com.alibaba.fastjson.JSONObject main = new com.alibaba.fastjson.JSONObject(); com.alibaba.fastjson.JSONObject reqData = com.alibaba.fastjson.JSON.parseObject(jsonStr); com.alibaba.fastjson.JSONObject data = reqData.getJSONObject("data"); - com.alibaba.fastjson.JSONObject ufinterfaceObject = new com.alibaba.fastjson.JSONObject(); - ufinterfaceObject.put("billtype", "customer"); - ufinterfaceObject.put("isexchange", "Y"); - ufinterfaceObject.put("replace", "Y"); - ufinterfaceObject.put("sender", "openUser"); - ufinterfaceObject.put("account", "ycjf"); - ufinterfaceObject.put("groupcode", "ycjf"); - com.alibaba.fastjson.JSONObject billObject = new com.alibaba.fastjson.JSONObject(); - com.alibaba.fastjson.JSONObject billheadObject = new com.alibaba.fastjson.JSONObject(); - billheadObject.put("code", data.get("code")); - billheadObject.put("custprop", data.get("custprop")); - billheadObject.put("custstate", data.get("custstate")); - billheadObject.put("pk_custclass", data.get("pk_custclass")); - billheadObject.put("pk_country", data.get("pk_country")); - billheadObject.put("pk_timezone", "P0800"); - billheadObject.put("pk_format", "ZH-CN"); - billheadObject.put("enablestate", data.get("enablestate")); - billheadObject.put("name", data.get("name")); - billheadObject.put("pk_group", data.get("pk_group")); - billheadObject.put("pk_org", data.get("pk_org")); - billheadObject.put("taxpayerid", data.get("taxpayerid")); - billObject.put("billhead", billheadObject); - ufinterfaceObject.put("bill", billObject); - bodys.put("ufinterface", ufinterfaceObject); + main.put("invclasscode", data.getString("materiel_classify_code")); + main.put("invclassname", data.getString("materiel_classify_name")); + main.put("pk_invcl", reqData.getString("tripartiteId")); + main.put("pk_corp", "0001"); + invcl.add(main); + bodys.put("invcl",invcl); returnObject.put("bodys",bodys.toJSONString()); return returnObject.toJSONString(); @@ -79,6 +86,29 @@ public class GroovyIntegrationServiceImpl implements IGroovyIntegrationService { } } - + static class g_482610back { + String execute(String jsonStr){ + com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject(); + com.alibaba.fastjson.JSONObject resData = com.alibaba.fastjson.JSON.parseObject(jsonStr); + if("200".equals(resData.getJSONObject("data").get("status"))){ + com.alibaba.fastjson.JSONObject reqData = resData.getJSONObject("data").getJSONObject("attribute"); + if(null !=reqData){ + com.alibaba.fastjson.JSONObject header = new com.alibaba.fastjson.JSONObject(); + if(null !=reqData.getString("status")&& !"".equals(reqData.getString("status"))){ + com.alibaba.fastjson.JSONArray dataArr = com.alibaba.fastjson.JSON.parseArray(reqData.getString("data")); +// com.alibaba.fastjson.JSONObject data = (com.alibaba.fastjson.JSONObject) dataArr.get(0); + com.alibaba.fastjson.JSONObject data = dataArr.getJSONObject(0); + returnObject.put("success","true"); + returnObject.put("tripartiteId",data.getString("pk_invcl")); + }else{ + returnObject.put("success","false"); + } + }else{ + returnObject.put("success","false"); + } + }else { + returnObject.put("success","false"); + } + return returnObject.toJSONString(); } } } From 08567f88f78aae2d0abf7a4540ead888e4d8e836 Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Fri, 2 Aug 2024 08:56:27 +0800 Subject: [PATCH 019/101] 1 --- buildpackage/pom.xml | 6 ++++++ .../mdmDistribute/plugin/MdmModulePluginInitializer.java | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/buildpackage/pom.xml b/buildpackage/pom.xml index c322ef46..e90d5030 100644 --- a/buildpackage/pom.xml +++ b/buildpackage/pom.xml @@ -99,6 +99,12 @@ zqt + + dongj + + dongj + + kangarooDataCenterV3 diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java index 3657beac..15e50c1f 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java +++ b/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); @@ -473,7 +474,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { //查询主数据 MdmModuleEntity queryMdmModuleEntity = new MdmModuleEntity(); queryMdmModuleEntity.setSts("Y"); - queryMdmModuleEntity.setMdmCode(10004L); + queryMdmModuleEntity.setMdmCode(10021L); List mdmModuleEntities = mdmModuleDao.queryBase(queryMdmModuleEntity); if(mdmModuleEntities == null || mdmModuleEntities.size() == 0){ return BaseResult.getSuccessMessageEntity("主数据未设置,不需要下发"); From ca14226903569c614172d572df169eb9470ec435 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Fri, 2 Aug 2024 10:34:00 +0800 Subject: [PATCH 020/101] =?UTF-8?q?oa=E9=94=80=E5=94=AE=E5=BC=80=E7=A5=A8?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E7=8A=B6=E6=80=81=E5=90=8C=E6=AD=A5u8c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/SalesBillingPluginInitializer.java | 98 +++++++++++++++++++ .../u8c/service/ISalesBillingService.java | 17 ++++ .../service/impl/SalesBillingServiceImpl.java | 31 ++++++ .../cfgHome/plugin/u8c/pluginCfg.xml | 6 ++ .../u8c/spring/spring-buildpackage-plugin.xml | 5 + .../spring/spring-buildpackage-service.xml | 5 + 6 files changed, 162 insertions(+) create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/u8c/plugin/SalesBillingPluginInitializer.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/ISalesBillingService.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/u8c/pluginCfg.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/u8c/spring/spring-buildpackage-plugin.xml create mode 100644 buildpackage/src/main/resources/cfgHome/plugin/u8c/spring/spring-buildpackage-service.xml diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/plugin/SalesBillingPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/plugin/SalesBillingPluginInitializer.java new file mode 100644 index 00000000..5aba75cb --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/plugin/SalesBillingPluginInitializer.java @@ -0,0 +1,98 @@ +package com.hzya.frame.plugin.u8c.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.u8c.service.ISalesBillingService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + + +public class SalesBillingPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(SalesBillingPluginInitializer.class); + + @Autowired + private ISalesBillingService salesBillingService; + + /*** + * 插件初始化方法 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 10:48 + * @Param [] + * @return void + **/ + @Override + public void 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 "SalesBillingPlugin"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "u8c销售开票审核状态同步插件"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "u8c销售开票审核状态同步插件"; + } + + /*** + * 插件类型 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 { + JsonResultEntity jsonResultEntity = salesBillingService.doSalesBilling(requestJson); + return jsonResultEntity; + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/ISalesBillingService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/ISalesBillingService.java new file mode 100644 index 00000000..ee491c26 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/ISalesBillingService.java @@ -0,0 +1,17 @@ +package com.hzya.frame.plugin.u8c.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.web.entity.JsonResultEntity; + +public interface ISalesBillingService { + + + /** + * @Author lvleigang + * @Description 同步销售开票审核状态 + * @Date 10:21 上午 2024/8/2 + * @param requestJson + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity doSalesBilling(JSONObject requestJson); +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java new file mode 100644 index 00000000..d33ea735 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java @@ -0,0 +1,31 @@ +package com.hzya.frame.plugin.u8c.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.u8c.service.ISalesBillingService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; + + +public class SalesBillingServiceImpl implements ISalesBillingService { + + Logger logger = LoggerFactory.getLogger(SalesBillingServiceImpl.class); + + @Value("${OA.data_source_code}") + private String oa_data_source_code; + + /** + * @param requestJson + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 同步销售开票审核状态 + * @Date 10:21 上午 2024/8/2 + **/ + @Override + public JsonResultEntity doSalesBilling(JSONObject requestJson) { + + + return null; + } +} diff --git a/buildpackage/src/main/resources/cfgHome/plugin/u8c/pluginCfg.xml b/buildpackage/src/main/resources/cfgHome/plugin/u8c/pluginCfg.xml new file mode 100644 index 00000000..c6c0d8e4 --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/u8c/pluginCfg.xml @@ -0,0 +1,6 @@ + + +SalesBilling +u8c插件 +202408020001 + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/u8c/spring/spring-buildpackage-plugin.xml b/buildpackage/src/main/resources/cfgHome/plugin/u8c/spring/spring-buildpackage-plugin.xml new file mode 100644 index 00000000..593229f6 --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/u8c/spring/spring-buildpackage-plugin.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/buildpackage/src/main/resources/cfgHome/plugin/u8c/spring/spring-buildpackage-service.xml b/buildpackage/src/main/resources/cfgHome/plugin/u8c/spring/spring-buildpackage-service.xml new file mode 100644 index 00000000..c011db17 --- /dev/null +++ b/buildpackage/src/main/resources/cfgHome/plugin/u8c/spring/spring-buildpackage-service.xml @@ -0,0 +1,5 @@ + + + + + From 57ad64fb6d51a2ba876854a1cfd42ac6e4f1a782 Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Fri, 2 Aug 2024 15:20:21 +0800 Subject: [PATCH 021/101] 1 --- .../plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java index 15e50c1f..37cdeb34 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java @@ -474,7 +474,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { //查询主数据 MdmModuleEntity queryMdmModuleEntity = new MdmModuleEntity(); queryMdmModuleEntity.setSts("Y"); - queryMdmModuleEntity.setMdmCode(10021L); +// queryMdmModuleEntity.setMdmCode(10021L); List mdmModuleEntities = mdmModuleDao.queryBase(queryMdmModuleEntity); if(mdmModuleEntities == null || mdmModuleEntities.size() == 0){ return BaseResult.getSuccessMessageEntity("主数据未设置,不需要下发"); From e6f9c5824e13cdad3ca3bfc323fb7664976dd2bb Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Fri, 2 Aug 2024 15:57:52 +0800 Subject: [PATCH 022/101] =?UTF-8?q?=E4=B8=BB=E6=95=B0=E6=8D=AE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/MdmModulePluginInitializer.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java index 3106085e..fc3be07e 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java @@ -1009,6 +1009,18 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { parameterJson.put("body",apiEntity.getBodyIn()); parameterJson.put("query",apiEntity.getQueryIn()); parameterJson.put("data",doObjects.get(i)); + //1、根据主数据id、数据id、应用ID默认查询主数据应用下发三方id表,只查询最新的一条数据 + MdmModuleDistributeTripartiteEntity mdmModuleDistributeTripartiteEntity1 = new MdmModuleDistributeTripartiteEntity(); + mdmModuleDistributeTripartiteEntity1.setSts("Y"); + mdmModuleDistributeTripartiteEntity1.setMdmId(mdmId); + mdmModuleDistributeTripartiteEntity1.setDataId(objects.get(i).getString("id")); + mdmModuleDistributeTripartiteEntity1.setAppId(sysApplicationEntity.getId()); + mdmModuleDistributeTripartiteEntity1 = mdmModuleDistributeTripartiteDao.queryOneTripartite(mdmModuleDistributeTripartiteEntity1); + String tripartiteId = ""; + if(mdmModuleDistributeTripartiteEntity1 != null && mdmModuleDistributeTripartiteEntity1.getTripartiteId() != null ){ + tripartiteId = mdmModuleDistributeTripartiteEntity1.getTripartiteId(); + } + parameterJson.put("tripartiteId", tripartiteId); /** head */ Map header = null; /** query */ From 6d3ce7042f8553702b212be86d00ac3a669dd4a6 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Mon, 5 Aug 2024 09:18:33 +0800 Subject: [PATCH 023/101] =?UTF-8?q?T/T=E6=B1=87=E6=AC=BE=202024=E5=B9=B48?= =?UTF-8?q?=E6=9C=885=E6=97=A5=2009:18:23?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/AccLogPluginInitializer.java | 4 +- .../NingboBankPayPluginInitializer.java | 77 +--- .../NingboBankPayResultPluginInitializer.java | 61 +-- .../NingboBankTTPayPluginInitializer.java | 147 +++++++ ...ingboBankTTPayResultPluginInitializer.java | 129 ++++++ .../service/INingboBankPluginService.java | 17 + .../impl/NingboBankPluginServiceImpl.java | 209 +++++++++- .../dto/req/TTRemitReq.java | 390 ++++++++++++++++++ .../enums/TTPayStatusEnum.java | 78 ++++ .../impl/NingboBankTreasuryServiceImpl.java | 1 + 10 files changed, 973 insertions(+), 140 deletions(-) create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankTTPayPluginInitializer.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankTTPayResultPluginInitializer.java create mode 100644 service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/req/TTRemitReq.java create mode 100644 service/src/main/java/com/hzya/frame/ningboBankTreasury/enums/TTPayStatusEnum.java diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/AccLogPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/AccLogPluginInitializer.java index 899e427b..4757f41a 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/AccLogPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/AccLogPluginInitializer.java @@ -115,6 +115,7 @@ public class AccLogPluginInitializer extends PluginBaseEntity { **/ @Override public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + //查询银行账户列表 PayBillEntity oaBillEntity = new PayBillEntity(); oaBillEntity.setDataSourceCode(oa_data_source_code); List> hashMaps = payBillDao.getOaBillData("SELECT field0002 from formmain_0053",oaBillEntity); @@ -125,12 +126,13 @@ public class AccLogPluginInitializer extends PluginBaseEntity { accList.add(field0002); } } + accList = Convert.toList(String.class,"86041110000110293,86041110000109337,6223160030547665,6214180002001411023,6214180000002609736"); //1、查询宁波银行的交易记录 AccTransactionReq accTransactionReq = new AccTransactionReq(); accTransactionReq.setCdSign(NingboBankUtil.SHOURU); accTransactionReq.setBeginDate("2024-07-01"); accTransactionReq.setEndDate("2024-07-30"); - accTransactionReq.setBankAccList(Convert.toList(String.class,"86041110000110293,86041110000109337,6223160030547665,6214180002001411023,6214180000002609736")); + accTransactionReq.setBankAccList(accList); Map headerMap = MapBuilder.create(true) .put("apiCode", "8000360002") .put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj") diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayPluginInitializer.java index e9ce1098..1c251e9f 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayPluginInitializer.java @@ -10,15 +10,11 @@ import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService; import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; 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 org.springframework.beans.factory.annotation.Value; - import javax.annotation.Resource; -import java.nio.charset.StandardCharsets; -import java.util.Date; import java.util.HashMap; import java.util.List; @@ -135,80 +131,11 @@ public class NingboBankPayPluginInitializer extends PluginBaseEntity { PayBillEntity oaBillEntity = new PayBillEntity(); oaBillEntity.setDataSourceCode(oa_data_source_code); StringBuffer stringBuffer = new StringBuffer(); - - //备用金申请单 + //付款单 stringBuffer.append("select * from v_hzya_pay where 1=1 " ); stringBuffer.append(sb.toString()); List> hashMaps = payBillDao.getOaBillData(stringBuffer.toString(),oaBillEntity); - if(CollectionUtils.isNotEmpty(hashMaps)){ - for (HashMap hashMap : hashMaps) { - JSONObject main = new JSONObject(); - for(String key:hashMap.keySet()) { - main.put(key, hashMap.get(key)); - } - logger.info("获取到付款单的数据"+main.toString()); - String result = ningboBankPluginService.executeEsb(main.toString(),"8000360000"); - logger.info("推送宁波银行的返回结果"+result); - IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); - logDetails.setRootAppPk(main.getString("id")); - logDetails.setRootAppBill(main.getString("serialNo")); - logDetails.setNewTransmitInfo(result); - logDetails.setNewPushDate(new Date()); - logDetails.setRootAppNewData(JSON.toJSONString(main)); - logDetails.setPluginId("NingboBankPayPlugin"); - JSONObject resultObj = JSON.parseObject(result); - String attribute = resultObj.getString("attribute"); - boolean flag = resultObj.getBoolean("flag"); - String subState = ""; - String fieldName = main.getString("fieldName"); - String tableName = main.getString("tableName"); - String payMsg = main.getString("payMsg"); -// String subMsg = main.getString("subMsg"); - String str = ""; - String sync_flag = ""; - try { - if(StrUtil.isEmpty(interId)){// 银行状态 1支付中 2 支付失败 null 未提交支付 0支付成功 - logDetails.setCreate_time(new Date()); - logDetails.setModify_time(new Date()); - if(flag){ - subState = "1"; - sync_flag = " ,"+payMsg+" = '支付中'"; - taskLivingDetailsService.saveLogToSuccess(logDetails); - }else{ - subState = "2"; - String resMsg = JSONObject.parseObject(attribute).getString("retMsg"); - sync_flag = " ,"+payMsg+" = '"+resMsg+"'"; - taskLivingDetailsService.saveLogToFail(logDetails); - } - }else{ - logDetails.setId(interId); - logDetails.setModify_time(new Date()); - if(flag){ - subState = "1"; - sync_flag = " ,"+payMsg+" = '支付中'"; - taskLivingDetailsService.saveLogFailToSuccess(logDetails); - }else{ - subState = "2"; - String resMsg = JSONObject.parseObject(attribute).getString("retMsg"); - sync_flag = " ,"+payMsg+" = '"+resMsg+"'"; - taskLivingDetailsService.updateLogFailToSuccess(logDetails); - } - } - - str = "update "+tableName+" set " + fieldName + "= '" +subState+"'" +sync_flag+"where id = '"+main.getString("id")+"'"; - } catch (Exception e) { - subState = "N"; - str = "update "+tableName+" set " + fieldName + "= '" +subState+"'" +payMsg+" = '"+attribute+"' "+"where id = '"+main.getString("id")+"'"; - logger.info("保存日志失败"+e.getMessage()); - oaBillEntity.setSql(str); - payBillDao.updateStateForId(str,oaBillEntity); - e.printStackTrace(); - } - //修改推送状态,防止重复推送 - oaBillEntity.setSql(str); - payBillDao.updateStateForId(str,oaBillEntity); - } - } + ningboBankPluginService.payRequest(hashMaps,getPluginId(),"8000360000",interId); } catch (Exception e) { logger.info("获取OA数据失败"+e.getMessage()); e.printStackTrace(); diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayResultPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayResultPluginInitializer.java index 5f0c1705..7b366558 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayResultPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayResultPluginInitializer.java @@ -118,65 +118,8 @@ public class NingboBankPayResultPluginInitializer extends PluginBaseEntity { try { List> hashMaps = payBillDao.getOaBillData(stringBuffer.toString(),oaBillEntity); if(CollectionUtils.isNotEmpty(hashMaps)){ - for (HashMap hashMap : hashMaps) { - JSONObject main = new JSONObject(); - for(String key:hashMap.keySet()) { - main.put(key, hashMap.get(key)); - } - String tableName = main.getString("tableName"); - String fieldName = main.getString("fieldName"); - String payDate = main.getString("payDate"); - String payMsg = main.getString("payMsg"); - try { - - logger.info("获取到付款单状态的数据"+main.toString()); - JSONObject reMain = new JSONObject(); - reMain.put("serialNo",main.getString("serialNo")); - String result = ningboBankPluginService.executeEsb(reMain.toString(),"8000360001"); - logger.info("获取付款状态结果"+result); - - JSONObject resultObj = JSON.parseObject(result); - JSONObject attribute = resultObj.getJSONObject("attribute"); - boolean flag = resultObj.getBoolean("flag"); - - StringBuffer sb = new StringBuffer(); - sb.append("update "+tableName); - if(flag){ - JSONObject data = attribute.getJSONObject("Data"); - JSONObject transferDtl = data.getJSONObject("transferDtl"); - String status = transferDtl.getString("status"); - String msg = PayStatusEnum.getByCode(status); - if(StrUtil.isEmpty(msg)){ - msg ="未知交易状态,请联系管理员查证"; - sb.append(" set "+payMsg+" = '"+msg+"'"); - sb.append(" , "+fieldName+" = '2'"); - } - sb.append(" set "+payMsg+" = '"+msg+"'"); - //收否最终态 - if(PayStatusEnum.isFinally(status)){ - sb.append(" , "+fieldName+" = '0'"); - String payDateStr = DateUtil.now(); - sb.append(" , "+payDate+" = '"+payDateStr+"'"); - } - }else { - sb.append(" set "+payMsg+" = '查询失败,请联系管理员'"); - sb.append(" ,"+fieldName+" = '2'"); - - } - sb.append(" where id = '"+main.getString("id")+"'"); - //修改推送状态,防止重复推送 - oaBillEntity.setSql(sb.toString()); - payBillDao.updateStateForId(sb.toString(),oaBillEntity); - } catch (Exception e) { - StringBuffer sb = new StringBuffer(); - sb.append("update "+tableName ); - sb.append(" set "+payMsg+" = '获取交易状态失败'"); - sb.append(" , "+fieldName+" = '2'"); - sb.append(" where id = '"+main.getString("id")+"'"); - logger.info("获取交易状态失败,更新交易信息为失败状态,后续不在查询"); - e.printStackTrace(); - } - } + //查询交易结果 + ningboBankPluginService.queryResult(hashMaps,"8000360001"); } } catch (Exception e) { e.printStackTrace(); diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankTTPayPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankTTPayPluginInitializer.java new file mode 100644 index 00000000..5303546e --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankTTPayPluginInitializer.java @@ -0,0 +1,147 @@ +package com.hzya.frame.plugin.a8bill.plugin; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao; +import com.hzya.frame.plugin.a8bill.entity.PayBillEntity; +import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +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 org.springframework.beans.factory.annotation.Value; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.HashMap; +import java.util.List; + +/** + * @Description 外汇 TT 汇款 + * @Author xiangerlin + * @Date 2024/8/1 14:33 + **/ +public class NingboBankTTPayPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private INingboBankPluginService ningboBankPluginService; + @Resource + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + @Autowired + private IPayBillPluginInitializerDao payBillDao; + @Value("${OA.data_source_code}") + private String oa_data_source_code; + + + /*** + * 插件初始化方法 + * @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 "NingboBankTTPayPlugin"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "宁波银行T/T汇款插件"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "宁波银行T/T汇款插件"; + } + + /*** + * 插件类型 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 { + JSONObject requestJsonObj = JSON.parseObject(requestJson.toString(),JSONObject.class); + String interId = requestJsonObj.getString("integration_task_living_details_id"); + IntegrationTaskLivingDetailsEntity oldMsg = new IntegrationTaskLivingDetailsEntity(); + if(StrUtil.isNotEmpty(interId)){ + oldMsg = taskLivingDetailsService.get(interId); + } + String rootAppPk = oldMsg.getRootAppPk(); + try { + StringBuffer sb = new StringBuffer(); + if(StrUtil.isNotEmpty(rootAppPk)){ + String code = requestJson.getString("code"); + sb.append(" and id = '"+rootAppPk+"'"); + }else{ + sb.append(" and payState is null"); + } + PayBillEntity oaBillEntity = new PayBillEntity(); + oaBillEntity.setDataSourceCode(oa_data_source_code); + StringBuffer stringBuffer = new StringBuffer(); + //付款单 + stringBuffer.append("select * from v_hzya_pay_tt where 1=1 " ); + stringBuffer.append(sb.toString()); + List> hashMaps = payBillDao.getOaBillData(stringBuffer.toString(),oaBillEntity); + ningboBankPluginService.payRequest(hashMaps,getPluginId(),"8000360003",interId); + } catch (Exception e) { + logger.info("获取OA数据失败"+e.getMessage()); + e.printStackTrace(); + } + return new JsonResultEntity("成功",true,new JsonResultEntity()); + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankTTPayResultPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankTTPayResultPluginInitializer.java new file mode 100644 index 00000000..f5ed1791 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankTTPayResultPluginInitializer.java @@ -0,0 +1,129 @@ +package com.hzya.frame.plugin.a8bill.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao; +import com.hzya.frame.plugin.a8bill.entity.PayBillEntity; +import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +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 org.springframework.beans.factory.annotation.Value; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; + +/** + * @Description TT汇款汇出交易结果查询 + * @Author xiangerlin + * @Date 2024/8/2 10:47 + **/ +public class NingboBankTTPayResultPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private INingboBankPluginService ningboBankPluginService; + @Resource + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + @Autowired + private IPayBillPluginInitializerDao payBillDao; + @Value("${OA.data_source_code}") + private String oa_data_source_code; + + + /*** + * 插件初始化方法 + * @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 "NingboBankTTPayResultPlugin"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "宁波银行T/T汇款交易状态查询插件"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "宁波银行T/T汇款交易状态查询插件"; + } + + /*** + * 插件类型 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 { + PayBillEntity oaBillEntity = new PayBillEntity(); + oaBillEntity.setDataSourceCode(oa_data_source_code); + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append("select * from v_hzya_pay_tt where payState ='1'"); + try { + List> hashMaps = payBillDao.getOaBillData(stringBuffer.toString(),oaBillEntity); + if(CollectionUtils.isNotEmpty(hashMaps)){ + //查询交易结果 + ningboBankPluginService.queryResult(hashMaps,"8000360007"); + } + } catch (Exception e) { + e.printStackTrace(); + } + return new JsonResultEntity("成功",true,new JsonResultEntity()); + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java index 0551cd08..5a39a6ae 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java @@ -1,7 +1,9 @@ package com.hzya.frame.plugin.a8bill.service; +import com.alibaba.fastjson.JSONObject; import com.hzya.frame.ningboBankTreasury.dto.res.AccTransactionRes; +import java.util.HashMap; import java.util.List; /** @@ -11,6 +13,14 @@ import java.util.List; **/ public interface INingboBankPluginService { + /** + * 支付申请 + * @param hashMaps oa 查到的数据 + * @param pluginId 插件 id + * @param apiCode api 编码 + * @param interId 重试 id + */ + void payRequest(List> hashMaps,String pluginId,String apiCode,String interId); /** * 调用宁波银行esb接口 * @param params @@ -25,4 +35,11 @@ public interface INingboBankPluginService { * @param accTransactionResList */ void saveAccLog(List accTransactionResList); + + /** + * 查询交易结果 + * @param hashMaps + * @param apiCode + */ + void queryResult(List> hashMaps,String apiCode); } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java index fee9e555..22a44037 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java @@ -1,25 +1,34 @@ package com.hzya.frame.plugin.a8bill.service.impl; +import cn.hutool.core.convert.Convert; import cn.hutool.core.date.DateUtil; 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.hzya.frame.ningboBankTreasury.dto.req.SingleTransferReq; +import com.hzya.frame.ningboBankTreasury.dto.req.TTRemitReq; import com.hzya.frame.ningboBankTreasury.dto.res.AccTransactionRes; import com.hzya.frame.ningboBankTreasury.enums.CurrencyEnum; +import com.hzya.frame.ningboBankTreasury.enums.PayStatusEnum; +import com.hzya.frame.ningboBankTreasury.enums.TTPayStatusEnum; +import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao; +import com.hzya.frame.plugin.a8bill.entity.PayBillEntity; import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService; import com.hzya.frame.seeyon.dongj.entity.Formmain0044Entity; import com.hzya.frame.seeyon.dongj.service.IFormmain0044Service; import com.hzya.frame.stringutil.StringUtil; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; 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 java.util.ArrayList; -import java.util.List; -import java.util.Map; +import javax.annotation.Resource; +import java.util.*; import java.util.stream.Collectors; /** @@ -28,13 +37,203 @@ import java.util.stream.Collectors; * @Date 2024/7/25 16:34 **/ public class NingboBankPluginServiceImpl implements INingboBankPluginService { - + Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private IFormmain0044Service formmain0044Service; - Logger logger = LoggerFactory.getLogger(getClass()); + @Resource + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + @Autowired + private IPayBillPluginInitializerDao payBillDao; + @Value("${OA.data_source_code}") private String oa_data_source_code; + + /** + * 支付申请 + * @param hashMaps oa 查到的数据 + * @param pluginId 插件 id + * @param apiCode api 编码 + * @param interId 重试 id + */ + @Override + public void payRequest(List> hashMaps, String pluginId, String apiCode,String interId) { + if(CollectionUtils.isNotEmpty(hashMaps)){ + PayBillEntity oaBillEntity = new PayBillEntity(); + oaBillEntity.setDataSourceCode(oa_data_source_code); + + for (HashMap hashMap : hashMaps) { + try { + JSONObject main = new JSONObject(); + for(String key:hashMap.keySet()) { + main.put(key, hashMap.get(key)); + } + String param = ""; + if ("8000360000".equals(apiCode)){ + SingleTransferReq singleTransferReq = JSONObject.parseObject(main.toString(), SingleTransferReq.class); + param = JSONObject.toJSONString(singleTransferReq); + }else if("8000360003".equals(apiCode)){ + TTRemitReq ttRemitReq = JSONObject.parseObject(main.toString(), TTRemitReq.class); + if ("01".equals(ttRemitReq.getPayMode()) || "1".equals(ttRemitReq.getPayMode())){ + ttRemitReq.setFileUploadCodes(Convert.toList(String.class,"0a736c17-e79f-48be-b3cd-710585165d55")); + } + param = JSONObject.toJSONString(ttRemitReq); + } + if (StrUtil.isEmpty(param)){ + param = main.toString(); + } + logger.info("获取到付款单的数据:{}",main.toString()); + String result = this.executeEsb(param,apiCode); + logger.info("推送宁波银行的返回结果:{}",result); + IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); + logDetails.setRootAppPk(main.getString("id")); + logDetails.setRootAppBill(main.getString("serialNo")); + logDetails.setNewTransmitInfo(result); + logDetails.setNewPushDate(new Date()); + logDetails.setRootAppNewData(JSON.toJSONString(main)); + logDetails.setPluginId(pluginId); + JSONObject resultObj = JSON.parseObject(result); + String attribute = resultObj.getString("attribute"); + boolean flag = resultObj.getBoolean("flag"); + String subState = ""; + String fieldName = main.getString("fieldName"); + String tableName = main.getString("tableName"); + String payMsg = main.getString("payMsg"); +// String subMsg = main.getString("subMsg"); + String str = ""; + String sync_flag = ""; + try { + if(StrUtil.isEmpty(interId)){// 银行状态 1支付中 2 支付失败 null 未提交支付 0支付成功 + logDetails.setCreate_time(new Date()); + logDetails.setModify_time(new Date()); + if(flag){ + subState = "1"; + sync_flag = " ,"+payMsg+" = '支付中'"; + taskLivingDetailsService.saveLogToSuccess(logDetails); + }else{ + subState = "2"; + String resMsg = JSONObject.parseObject(attribute).getString("retMsg"); + sync_flag = " ,"+payMsg+" = '"+resMsg+"'"; + taskLivingDetailsService.saveLogToFail(logDetails); + } + }else{ + logDetails.setId(interId); + logDetails.setModify_time(new Date()); + if(flag){ + subState = "1"; + sync_flag = " ,"+payMsg+" = '支付中'"; + taskLivingDetailsService.saveLogFailToSuccess(logDetails); + }else{ + subState = "2"; + String resMsg = JSONObject.parseObject(attribute).getString("retMsg"); + sync_flag = " ,"+payMsg+" = '"+resMsg+"'"; + taskLivingDetailsService.updateLogFailToSuccess(logDetails); + } + } + + str = "update "+tableName+" set " + fieldName + "= '" +subState+"'" +sync_flag+"where id = '"+main.getString("id")+"'"; + } catch (Exception e) { + subState = "N"; + str = "update "+tableName+" set " + fieldName + "= '" +subState+"'" +payMsg+" = '"+attribute+"' "+"where id = '"+main.getString("id")+"'"; + logger.info("保存日志失败"+e.getMessage()); + oaBillEntity.setSql(str); + payBillDao.updateStateForId(str,oaBillEntity); + e.printStackTrace(); + } + //修改推送状态,防止重复推送 + oaBillEntity.setSql(str); + payBillDao.updateStateForId(str,oaBillEntity); + }catch (Exception e){ + logger.info("宁波银行付款接口调用出错:{}",e); + } + } + } + } + + /** + * 查询交易结果 + * + * @param hashMaps + * @param apiCode + */ + @Override + public void queryResult(List> hashMaps, String apiCode) { + if(CollectionUtils.isNotEmpty(hashMaps)){ + PayBillEntity oaBillEntity = new PayBillEntity(); + oaBillEntity.setDataSourceCode(oa_data_source_code); + for (HashMap hashMap : hashMaps) { + JSONObject main = new JSONObject(); + for(String key:hashMap.keySet()) { + main.put(key, hashMap.get(key)); + } + String tableName = main.getString("tableName"); + String fieldName = main.getString("fieldName"); + String payDate = main.getString("payDate"); + String payMsg = main.getString("payMsg"); + try { + + logger.info("获取到付款单状态的数据"+main.toString()); + JSONObject reMain = new JSONObject(); + reMain.put("serialNo",main.getString("serialNo")); + String result = this.executeEsb(reMain.toString(),apiCode); + logger.info("获取付款状态结果"+result); + + JSONObject resultObj = JSON.parseObject(result); + JSONObject attribute = resultObj.getJSONObject("attribute"); + boolean flag = resultObj.getBoolean("flag"); + + StringBuffer sb = new StringBuffer(); + sb.append("update "+tableName); + if(flag){ + JSONObject data = attribute.getJSONObject("Data"); + JSONObject transferDtl = new JSONObject(); + String status = ""; + String msg = ""; + boolean isFinally = true; + if ("8000360001".equals(apiCode)){ + transferDtl = data.getJSONObject("transferDtl"); + status = transferDtl.getString("status"); + msg = PayStatusEnum.getByCode(status); + isFinally = PayStatusEnum.isFinally(status); + }else if ("8000360007".equals(apiCode)){ + status = data.getString("transState"); + msg = TTPayStatusEnum.getByCode(status); + isFinally = TTPayStatusEnum.isFinally(status); + } + if(StrUtil.isEmpty(msg)){ + msg ="未知交易状态,请联系管理员查证"; + sb.append(" set "+payMsg+" = '"+msg+"'"); + sb.append(" , "+fieldName+" = '2'"); + } + sb.append(" set "+payMsg+" = '"+msg+"'"); + //是否最终态 + if(isFinally){ + sb.append(" , "+fieldName+" = '0'"); + String payDateStr = DateUtil.now(); + sb.append(" , "+payDate+" = '"+payDateStr+"'"); + } + }else { + sb.append(" set "+payMsg+" = '"+attribute.getString("retMsg")+"'"); + sb.append(" ,"+fieldName+" = '2'"); + + } + sb.append(" where id = '"+main.getString("id")+"'"); + //修改推送状态,防止重复推送 + oaBillEntity.setSql(sb.toString()); + payBillDao.updateStateForId(sb.toString(),oaBillEntity); + } catch (Exception e) { + StringBuffer sb = new StringBuffer(); + sb.append("update "+tableName ); + sb.append(" set "+payMsg+" = '获取交易状态失败'"); + sb.append(" , "+fieldName+" = '2'"); + sb.append(" where id = '"+main.getString("id")+"'"); + logger.info("获取交易状态失败,更新交易信息为失败状态,后续不在查询"); + e.printStackTrace(); + } + } + } + } + /** * 调用宁波银行esb接口 * diff --git a/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/req/TTRemitReq.java b/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/req/TTRemitReq.java new file mode 100644 index 00000000..bf46a6e6 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/ningboBankTreasury/dto/req/TTRemitReq.java @@ -0,0 +1,390 @@ +package com.hzya.frame.ningboBankTreasury.dto.req; + +import java.util.List; + +/** + * @Description T/T汇款提交 + * @Author xiangerlin + * @Date 2024/8/1 17:14 + **/ +public class TTRemitReq { + private String custId; + private String serialNo; + private String remitType; + private String transferType; + private String corpCode; + private String remitAddress; + private String bankType; + private String payMode; + private String estimateDate; + private String remitCurCode; + private String smallCurCode; + private String totalAmt; + private String transAmt; + private String subTransCode; + private String goods; + private String transAmt2; + private String subTransCode2; + private String goods2; + private String remitAcc; + private String curRemitAmt; + private String remitAcc2; + private String curRemitAmt2; + private String curRemitAmt3; + private String remitAcc3; + private String isAgent; + private String agentAcc; + private String agentBankSwiftCode; + private String rcvSettleType; + private String rcvBankCode; + private String rcvCountryCode; + private String rcvName; + private String rcvAddress; + private String rcvAcc; + private String costPayer; + private String costAcc; + private String isFullPay; + private String paymentProp; + private String contacts; + private String contactPhone; + private String payUnderFreeTax; + //private List contractDtlList; + private String postscript; + private List fileUploadCodes; + + public String getCustId() { + return custId; + } + + public void setCustId(String custId) { + this.custId = custId; + } + + public String getSerialNo() { + return serialNo; + } + + public void setSerialNo(String serialNo) { + this.serialNo = serialNo; + } + + public String getRemitType() { + return remitType; + } + + public void setRemitType(String remitType) { + this.remitType = remitType; + } + + public String getTransferType() { + return transferType; + } + + public void setTransferType(String transferType) { + this.transferType = transferType; + } + + public String getCorpCode() { + return corpCode; + } + + public void setCorpCode(String corpCode) { + this.corpCode = corpCode; + } + + public String getRemitAddress() { + return remitAddress; + } + + public void setRemitAddress(String remitAddress) { + this.remitAddress = remitAddress; + } + + public String getBankType() { + return bankType; + } + + public void setBankType(String bankType) { + this.bankType = bankType; + } + + public String getPayMode() { + return payMode; + } + + public void setPayMode(String payMode) { + this.payMode = payMode; + } + + public String getEstimateDate() { + return estimateDate; + } + + public void setEstimateDate(String estimateDate) { + this.estimateDate = estimateDate; + } + + public String getRemitCurCode() { + return remitCurCode; + } + + public void setRemitCurCode(String remitCurCode) { + this.remitCurCode = remitCurCode; + } + + public String getSmallCurCode() { + return smallCurCode; + } + + public void setSmallCurCode(String smallCurCode) { + this.smallCurCode = smallCurCode; + } + + public String getTotalAmt() { + return totalAmt; + } + + public void setTotalAmt(String totalAmt) { + this.totalAmt = totalAmt; + } + + public String getTransAmt() { + return transAmt; + } + + public void setTransAmt(String transAmt) { + this.transAmt = transAmt; + } + + public String getSubTransCode() { + return subTransCode; + } + + public void setSubTransCode(String subTransCode) { + this.subTransCode = subTransCode; + } + + public String getGoods() { + return goods; + } + + public void setGoods(String goods) { + this.goods = goods; + } + + public String getTransAmt2() { + return transAmt2; + } + + public void setTransAmt2(String transAmt2) { + this.transAmt2 = transAmt2; + } + + public String getSubTransCode2() { + return subTransCode2; + } + + public void setSubTransCode2(String subTransCode2) { + this.subTransCode2 = subTransCode2; + } + + public String getGoods2() { + return goods2; + } + + public void setGoods2(String goods2) { + this.goods2 = goods2; + } + + public String getRemitAcc() { + return remitAcc; + } + + public void setRemitAcc(String remitAcc) { + this.remitAcc = remitAcc; + } + + public String getCurRemitAmt() { + return curRemitAmt; + } + + public void setCurRemitAmt(String curRemitAmt) { + this.curRemitAmt = curRemitAmt; + } + + public String getRemitAcc2() { + return remitAcc2; + } + + public void setRemitAcc2(String remitAcc2) { + this.remitAcc2 = remitAcc2; + } + + public String getCurRemitAmt2() { + return curRemitAmt2; + } + + public void setCurRemitAmt2(String curRemitAmt2) { + this.curRemitAmt2 = curRemitAmt2; + } + + public String getCurRemitAmt3() { + return curRemitAmt3; + } + + public void setCurRemitAmt3(String curRemitAmt3) { + this.curRemitAmt3 = curRemitAmt3; + } + + public String getRemitAcc3() { + return remitAcc3; + } + + public void setRemitAcc3(String remitAcc3) { + this.remitAcc3 = remitAcc3; + } + + public String getIsAgent() { + return isAgent; + } + + public void setIsAgent(String isAgent) { + this.isAgent = isAgent; + } + + public String getAgentAcc() { + return agentAcc; + } + + public void setAgentAcc(String agentAcc) { + this.agentAcc = agentAcc; + } + + public String getAgentBankSwiftCode() { + return agentBankSwiftCode; + } + + public void setAgentBankSwiftCode(String agentBankSwiftCode) { + this.agentBankSwiftCode = agentBankSwiftCode; + } + + public String getRcvSettleType() { + return rcvSettleType; + } + + public void setRcvSettleType(String rcvSettleType) { + this.rcvSettleType = rcvSettleType; + } + + public String getRcvBankCode() { + return rcvBankCode; + } + + public void setRcvBankCode(String rcvBankCode) { + this.rcvBankCode = rcvBankCode; + } + + public String getRcvCountryCode() { + return rcvCountryCode; + } + + public void setRcvCountryCode(String rcvCountryCode) { + this.rcvCountryCode = rcvCountryCode; + } + + public String getRcvName() { + return rcvName; + } + + public void setRcvName(String rcvName) { + this.rcvName = rcvName; + } + + public String getRcvAddress() { + return rcvAddress; + } + + public void setRcvAddress(String rcvAddress) { + this.rcvAddress = rcvAddress; + } + + public String getRcvAcc() { + return rcvAcc; + } + + public void setRcvAcc(String rcvAcc) { + this.rcvAcc = rcvAcc; + } + + public String getCostPayer() { + return costPayer; + } + + public void setCostPayer(String costPayer) { + this.costPayer = costPayer; + } + + public String getCostAcc() { + return costAcc; + } + + public void setCostAcc(String costAcc) { + this.costAcc = costAcc; + } + + public String getIsFullPay() { + return isFullPay; + } + + public void setIsFullPay(String isFullPay) { + this.isFullPay = isFullPay; + } + + public String getPaymentProp() { + return paymentProp; + } + + public void setPaymentProp(String paymentProp) { + this.paymentProp = paymentProp; + } + + public String getContacts() { + return contacts; + } + + public void setContacts(String contacts) { + this.contacts = contacts; + } + + public String getContactPhone() { + return contactPhone; + } + + public void setContactPhone(String contactPhone) { + this.contactPhone = contactPhone; + } + + public String getPayUnderFreeTax() { + return payUnderFreeTax; + } + + public void setPayUnderFreeTax(String payUnderFreeTax) { + this.payUnderFreeTax = payUnderFreeTax; + } + + public String getPostscript() { + return postscript; + } + + public void setPostscript(String postscript) { + this.postscript = postscript; + } + + public List getFileUploadCodes() { + return fileUploadCodes; + } + + public void setFileUploadCodes(List fileUploadCodes) { + this.fileUploadCodes = fileUploadCodes; + } +} diff --git a/service/src/main/java/com/hzya/frame/ningboBankTreasury/enums/TTPayStatusEnum.java b/service/src/main/java/com/hzya/frame/ningboBankTreasury/enums/TTPayStatusEnum.java new file mode 100644 index 00000000..c90150c2 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/ningboBankTreasury/enums/TTPayStatusEnum.java @@ -0,0 +1,78 @@ +package com.hzya.frame.ningboBankTreasury.enums; + +/** + * @Description T/T汇款 支付状态枚举 + * @Author xiangerlin + * @Date 2024/8/2 15:42 + **/ +public enum TTPayStatusEnum{ + + // 成功和失败状态 + SUCCESS("0", "交易成功"), + TRANSACTION_FAILED("2", "交易失败"), + TRANSACTION_SENDING("8", "交易发送中"), + + // 审批状态 + + APPROVAL_IN_PROGRESS("11-94", "审批中"), + APPROVAL_PASSED("95", "审批通过"), + APPROVAL_REJECTED_CLOSED("-3", "审批打回,交易关闭"), + + // 其他状态 + TEMPORARY_STORAGE("7", "暂存"), + DELETED("-2", "删除"), + BANK_PROCESSING("1", "银行处理中"), + APPROVAL_REJECTED("-1", "审批打回"); + + // 枚举属性 + private final String code; + private final String description; + + // 枚举构造函数 + TTPayStatusEnum(String code, String description) { + this.code = code; + this.description = description; + } + + // 获取状态码 + public String getCode() { + return code; + } + + // 获取状态描述 + public String getDescription() { + return description; + } + + + // 根据状态码查找枚举 + public static TTPayStatusEnum fromCode(String code) { + for (TTPayStatusEnum status : TTPayStatusEnum.values()) { + if (status.getCode().equals(code)) { + return status; + } + } + throw new IllegalArgumentException("Unknown code: " + code); + } + + public static String getByCode(String code){ + for (TTPayStatusEnum status : TTPayStatusEnum.values()) { + if (status.getCode().equals(code)) { + return status.getDescription(); + } + } + throw new IllegalArgumentException("Unknown code: " + code); + } + + /** + * 是否为最终态 + * @param code + * @return + */ + public static boolean isFinally(String code){ + return SUCCESS.code.equals(code) + || APPROVAL_REJECTED_CLOSED.code.equals(code) + || DELETED.code.equals(code) + || TRANSACTION_FAILED.code.equals(code); + } +} diff --git a/service/src/main/java/com/hzya/frame/ningboBankTreasury/service/impl/NingboBankTreasuryServiceImpl.java b/service/src/main/java/com/hzya/frame/ningboBankTreasury/service/impl/NingboBankTreasuryServiceImpl.java index 207f9fec..f2cc7c40 100644 --- a/service/src/main/java/com/hzya/frame/ningboBankTreasury/service/impl/NingboBankTreasuryServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/ningboBankTreasury/service/impl/NingboBankTreasuryServiceImpl.java @@ -58,6 +58,7 @@ public class NingboBankTreasuryServiceImpl implements INingboBankTreasuryService } //发送数据 try { + logger.info("调用宁波银行接口最终参数:{}",dataJson); String returnData = OpenSDK.send(productID,serviceID,dataJson.replace(" ","")); if(returnData == null || "".equals(returnData)){ returnJson.put("retCode","9999"); From ae561ea8b80087bb78e17d25c2008214a7afe8d9 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Mon, 5 Aug 2024 09:25:54 +0800 Subject: [PATCH 024/101] =?UTF-8?q?T/T=E6=B1=87=E6=AC=BE=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=202024=E5=B9=B48=E6=9C=885=E6=97=A5=2009:25:?= =?UTF-8?q?50?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/ningbobank/spring/spring-buildpackage-plugin.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildpackage/src/main/resources/cfgHome/plugin/ningbobank/spring/spring-buildpackage-plugin.xml b/buildpackage/src/main/resources/cfgHome/plugin/ningbobank/spring/spring-buildpackage-plugin.xml index 3c2d53a3..207becf2 100644 --- a/buildpackage/src/main/resources/cfgHome/plugin/ningbobank/spring/spring-buildpackage-plugin.xml +++ b/buildpackage/src/main/resources/cfgHome/plugin/ningbobank/spring/spring-buildpackage-plugin.xml @@ -4,4 +4,6 @@ + + From 99ad32eb0aef0f6199d159500645c76a64678c07 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Mon, 5 Aug 2024 11:56:08 +0800 Subject: [PATCH 025/101] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=B8=AD=E6=A0=B9=E6=8D=AEdata=5Fid=E5=88=A4=E6=96=AD=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=98=AF=E5=90=A6=E5=B7=B2=E7=BB=8F=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ComparisonServiceImpl.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java index 9defee72..fa22661d 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java @@ -206,11 +206,24 @@ public class ComparisonServiceImpl extends BaseService } } if(jsonObjectMain!=null && jsonObjectMain.size()>0) { - Map map = new HashMap<>();//将主表数据存到map中 + Map map = new HashMap<>();//将主表数据存到map中 List>> mapDetails = new ArrayList<>();//将子表数据存到map中 if (comparisonEntities != null && comparisonEntities.size() > 0) { map = spliceMainMap(comparisonEntities, jsonObjectMain, map, comparisonEntity, comparisonDetailsEntity); + //根据data_id判断数据是否已经保存在相关表中,避免重复保存 + List fields = getFields(comparisonEntity); + Map mapDataId=new HashMap<>(); + mapDataId.put("data_id",jsonObjectMain.getString("data_id")); + ComparisonEntity comparisonDataId=new ComparisonEntity(); + comparisonDataId.setMap(mapDataId); + comparisonDataId.setDbName(comparisonEntity.getDbName()); + comparisonDataId.setFields(fields); + List> listDataId = comparisonDao.queryComparisonPage(comparisonDataId); + if(CollectionUtils.isNotEmpty(listDataId)){ + return BaseResult.getFailureMessageEntity(comparisonEntity.getDbName()+"表中已经存在data_id为:"+jsonObjectMain.getString("data_id")+"的数据"); + } + //判断输入的主表字段是否是必填项 for (ComparisonEntity entity : comparisonEntities) { //如果必填字段不为空 From c5664ad86b164d140f1fa1db98cc3e6642ab70a8 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Mon, 5 Aug 2024 15:45:09 +0800 Subject: [PATCH 026/101] =?UTF-8?q?=E4=B8=9C=E8=BF=9BOA=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E5=9B=9E=E4=BC=A0U8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../u8c/service/ISalesBillingService.java | 2 +- .../service/impl/SalesBillingServiceImpl.java | 120 +++++++++++++++++- .../src/main/resources/application-llg.yml | 2 +- .../cfgHome/plugin/u8c/pluginCfg.xml | 2 +- .../salesBilling/dao/IU8cSalesBillingDao.java | 20 +++ .../dao/impl/U8cSalesBillingDaoImpl.java | 29 +++++ .../entity/U8cSalesBillingEntity.java | 111 ++++++++++++++++ .../entity/U8cSalesBillingEntity.xml | 40 ++++++ .../service/IU8cSalesBillingService.java | 13 ++ .../impl/U8cSalesBillingServiceImpl.java | 35 +++++ 10 files changed, 370 insertions(+), 4 deletions(-) create mode 100644 service/src/main/java/com/hzya/frame/u8c/salesBilling/dao/IU8cSalesBillingDao.java create mode 100644 service/src/main/java/com/hzya/frame/u8c/salesBilling/dao/impl/U8cSalesBillingDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8c/salesBilling/entity/U8cSalesBillingEntity.java create mode 100644 service/src/main/java/com/hzya/frame/u8c/salesBilling/entity/U8cSalesBillingEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/u8c/salesBilling/service/IU8cSalesBillingService.java create mode 100644 service/src/main/java/com/hzya/frame/u8c/salesBilling/service/impl/U8cSalesBillingServiceImpl.java diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/ISalesBillingService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/ISalesBillingService.java index ee491c26..5b0b6184 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/ISalesBillingService.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/ISalesBillingService.java @@ -8,7 +8,7 @@ public interface ISalesBillingService { /** * @Author lvleigang - * @Description 同步销售开票审核状态 + * @Description OA同步销售开票审核状态到U8C * @Date 10:21 上午 2024/8/2 * @param requestJson * @return com.hzya.frame.web.entity.JsonResultEntity diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java index d33ea735..6318757b 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java @@ -1,12 +1,23 @@ package com.hzya.frame.plugin.u8c.service.impl; +import cn.hutool.core.map.MapBuilder; +import cn.hutool.http.HttpRequest; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.plugin.u8c.service.ISalesBillingService; +import com.hzya.frame.u8c.salesBilling.entity.U8cSalesBillingEntity; +import com.hzya.frame.u8c.salesBilling.service.IU8cSalesBillingService; +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.List; +import java.util.Map; + public class SalesBillingServiceImpl implements ISalesBillingService { @@ -14,6 +25,13 @@ public class SalesBillingServiceImpl implements ISalesBillingService { @Value("${OA.data_source_code}") private String oa_data_source_code; + @Autowired + private IU8cSalesBillingService iu8cSalesBillingService; + + private final String appId = "800035"; + private final String apiCode = "8000350047"; + private final String publicKey = "ZJYATW/MfYZX7zF0eAh4DJXbyTLwUtwSoSz5Y/o1ksAaN/dCe7eDIk+3zDUT+v578prj"; + private final String secretKey = "+5BUkLQh3iX3VHgEt5bE2IPh+ZeebGvDaEspsvVu739Ar6sFnwg+fpPod4t6XhoTj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="; /** * @param requestJson @@ -24,8 +42,108 @@ public class SalesBillingServiceImpl implements ISalesBillingService { **/ @Override public JsonResultEntity doSalesBilling(JSONObject requestJson) { + //查询需要同步的数据 + + try { + U8cSalesBillingEntity u8cSalesBillingEntity = new U8cSalesBillingEntity(); + u8cSalesBillingEntity.setDataSourceCode(oa_data_source_code); + List u8cSalesBillingEntities = iu8cSalesBillingService.queryDoSalesBilling(u8cSalesBillingEntity); + + if (u8cSalesBillingEntities != null && u8cSalesBillingEntities.size() > 0) { + for (int i = 0; i < u8cSalesBillingEntities.size(); i++) { + U8cSalesBillingEntity entity = u8cSalesBillingEntities.get(i); + String params = getSendData(entity); + //发送数据 + String returnData = executeEsb(params,appId,apiCode,publicKey,secretKey); + //解析结果 + boolean flag = analyzeReturnData(returnData); + if(flag){ + entity.setPushStatus("Y"); + }else { + entity.setPushStatus("N"); + } + entity.setDataSourceCode(oa_data_source_code); + iu8cSalesBillingService.updateDoSalesBilling(entity); + } + return BaseResult.getSuccessMessageEntity("同步销售开票审核状态成功"); + } else { + return BaseResult.getSuccessMessageEntity("同步销售开票审核状态成功"); + } + } catch (Exception e) { + return BaseResult.getFailureMessageEntity("同步销售开票审核状态失败" + e.getMessage()); + } + } + + /** + * @Author lvleigang + * @Description 解析返回状态 + * @Date 2:50 下午 2024/8/2 + * @param returnData + * @return boolean + **/ + private boolean analyzeReturnData(String returnData) { + boolean falg = false ; + if (JSONUtil.isTypeJSON(returnData)) { + JSONObject jsonObject = JSONObject.parseObject(returnData); + if(jsonObject != null && jsonObject.get("flag") != null && jsonObject.getBoolean("flag")) { + JSONObject attribute = jsonObject.getJSONObject("attribute"); + if(attribute != null && attribute.get("status") != null && "success".equals(attribute.getString("status"))) { + falg = true; + } + } + } + return falg; + } + + private String getSendData(U8cSalesBillingEntity entity) { + String params = ""; + //{ + // "queryinfo": { + // "code": [ + // "SITH1904180026", + // "SOTH1805240023" + // ], + // "corp": "1000", + // "date_begin": "2019-03-24", + // "date_end": "2019-05-24" + // }, + // "approveinfo": { + // "approvid": "18612329914", + // "approveDate": "2018-04-19", + // "status": "Y", + // "note": "哈哈" + // } + //} + JSONObject data = new JSONObject(); + JSONObject queryinfo = new JSONObject(); + JSONObject approveinfo = new JSONObject(); + JSONArray code = new JSONArray(); + code.add(entity.getCode());//单据号 + queryinfo.put("code", code); + queryinfo.put("corp", entity.getCorp());//公司编码 + queryinfo.put("date_begin", entity.getDateBegin());//单据开始日期 + queryinfo.put("date_end", entity.getDateEnd());//单据结束日期 + approveinfo.put("approvid", entity.getApprovid());//审批人 + approveinfo.put("approveDate", entity.getApprovedate());//审核时间 + approveinfo.put("status", entity.getStatus());//审批状态(Y:通过,N:不通过,R:驳回) + approveinfo.put("note", entity.getNote());//批语 + + data.put("queryinfo", queryinfo); + data.put("approveinfo", approveinfo); + params = data.toJSONString(); + return params; + } - return null; + public String executeEsb(String params, String appId, String apiCode, String publicKey, String secretKey) { + logger.info("请求apiCode:{},参数:{}", apiCode, params); + Map header = MapBuilder.create(true) + .put("apiCode", apiCode) + .put("publicKey", publicKey) + .put("secretKey", secretKey) + .put("appId", appId) + .build(); + String res = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(header).body(params).timeout(60000).execute().body(); + return res; } } diff --git a/buildpackage/src/main/resources/application-llg.yml b/buildpackage/src/main/resources/application-llg.yml index 2920f2eb..f24d567c 100644 --- a/buildpackage/src/main/resources/application-llg.yml +++ b/buildpackage/src/main/resources/application-llg.yml @@ -49,4 +49,4 @@ cbs8: #电子回单下载临时存放位置 elec_path: /Users/xiangerlin/Downloads/ OA: - data_source_code: yc_oa \ No newline at end of file + data_source_code: djoatest \ No newline at end of file diff --git a/buildpackage/src/main/resources/cfgHome/plugin/u8c/pluginCfg.xml b/buildpackage/src/main/resources/cfgHome/plugin/u8c/pluginCfg.xml index c6c0d8e4..70c76f15 100644 --- a/buildpackage/src/main/resources/cfgHome/plugin/u8c/pluginCfg.xml +++ b/buildpackage/src/main/resources/cfgHome/plugin/u8c/pluginCfg.xml @@ -1,6 +1,6 @@ -SalesBilling +SalesBillingPlugin u8c插件 202408020001 diff --git a/service/src/main/java/com/hzya/frame/u8c/salesBilling/dao/IU8cSalesBillingDao.java b/service/src/main/java/com/hzya/frame/u8c/salesBilling/dao/IU8cSalesBillingDao.java new file mode 100644 index 00000000..ce8ccd13 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/salesBilling/dao/IU8cSalesBillingDao.java @@ -0,0 +1,20 @@ +package com.hzya.frame.u8c.salesBilling.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; +import com.hzya.frame.u8c.salesBilling.entity.U8cSalesBillingEntity; + +import java.util.List; + +/** + * 脚本表(u8c_sales_billing: table)表数据库访问层 + * + * @author makejava + * @since 2024-08-02 11:07:43 + */ +public interface IU8cSalesBillingDao extends IBaseDao { + List queryDoSalesBilling(U8cSalesBillingEntity entity); + + int updateDoSalesBilling(U8cSalesBillingEntity entity); +} + diff --git a/service/src/main/java/com/hzya/frame/u8c/salesBilling/dao/impl/U8cSalesBillingDaoImpl.java b/service/src/main/java/com/hzya/frame/u8c/salesBilling/dao/impl/U8cSalesBillingDaoImpl.java new file mode 100644 index 00000000..411317d0 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/salesBilling/dao/impl/U8cSalesBillingDaoImpl.java @@ -0,0 +1,29 @@ +package com.hzya.frame.u8c.salesBilling.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; +import com.hzya.frame.u8c.salesBilling.dao.IU8cSalesBillingDao; +import com.hzya.frame.u8c.salesBilling.entity.U8cSalesBillingEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository(value = "U8cSalesBillingDaoImpl") +public class U8cSalesBillingDaoImpl extends MybatisGenericDao implements IU8cSalesBillingDao{ + @DS("#entity.dataSourceCode") + @Override + public List queryDoSalesBilling(U8cSalesBillingEntity entity) { + List o = (List) super.selectList(getSqlIdPrifx() + "queryDoSalesBilling", entity); + return o; + } + + + @DS("#entity.dataSourceCode") + @Override + public int updateDoSalesBilling(U8cSalesBillingEntity entity) { + Integer o = super.update(getSqlIdPrifx() + "updateDoSalesBilling", entity); + return o; + } +} + diff --git a/service/src/main/java/com/hzya/frame/u8c/salesBilling/entity/U8cSalesBillingEntity.java b/service/src/main/java/com/hzya/frame/u8c/salesBilling/entity/U8cSalesBillingEntity.java new file mode 100644 index 00000000..ff4c1951 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/salesBilling/entity/U8cSalesBillingEntity.java @@ -0,0 +1,111 @@ +package com.hzya.frame.u8c.salesBilling.entity; + + +import com.hzya.frame.web.entity.BaseEntity; + +public class U8cSalesBillingEntity extends BaseEntity { + + /** 单据号 */ + private String code; + /** 公司编码 */ + private String corp; + /** 单据开始日期 */ + private String dateBegin; + /** 单据结束日期 */ + private String dateEnd; + /** 审批人 */ + private String approvid; + /** 审核时间 */ + private String approvedate; + /** 审批状态(Y:通过,N:不通过,R:驳回) */ + private String status; + /** 批语 */ + private String note; + //数据源 + private String dataSourceCode; + //推送状态 Y成功N失败 + private String pushStatus; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCorp() { + return corp; + } + + public void setCorp(String corp) { + this.corp = corp; + } + + public String getDateBegin() { + return dateBegin; + } + + public void setDateBegin(String dateBegin) { + this.dateBegin = dateBegin; + } + + public String getDateEnd() { + return dateEnd; + } + + public void setDateEnd(String dateEnd) { + this.dateEnd = dateEnd; + } + + public String getApprovid() { + return approvid; + } + + public void setApprovid(String approvid) { + this.approvid = approvid; + } + + public String getApprovedate() { + return approvedate; + } + + public void setApprovedate(String approvedate) { + this.approvedate = approvedate; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getNote() { + return note; + } + + public void setNote(String note) { + this.note = note; + } + + @Override + public String getDataSourceCode() { + return dataSourceCode; + } + + @Override + public void setDataSourceCode(String dataSourceCode) { + this.dataSourceCode = dataSourceCode; + } + + public String getPushStatus() { + return pushStatus; + } + + public void setPushStatus(String pushStatus) { + this.pushStatus = pushStatus; + } +} + diff --git a/service/src/main/java/com/hzya/frame/u8c/salesBilling/entity/U8cSalesBillingEntity.xml b/service/src/main/java/com/hzya/frame/u8c/salesBilling/entity/U8cSalesBillingEntity.xml new file mode 100644 index 00000000..e3f49a5d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/salesBilling/entity/U8cSalesBillingEntity.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + update formmain_0049 set + field0044 = #{pushStatus} + where id = #{id} + + + diff --git a/service/src/main/java/com/hzya/frame/u8c/salesBilling/service/IU8cSalesBillingService.java b/service/src/main/java/com/hzya/frame/u8c/salesBilling/service/IU8cSalesBillingService.java new file mode 100644 index 00000000..80b7b9e5 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/salesBilling/service/IU8cSalesBillingService.java @@ -0,0 +1,13 @@ +package com.hzya.frame.u8c.salesBilling.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; +import com.hzya.frame.u8c.salesBilling.entity.U8cSalesBillingEntity; + +import java.util.List; + +public interface IU8cSalesBillingService extends IBaseService { + List queryDoSalesBilling(U8cSalesBillingEntity u8cSalesBillingEntity); + + int updateDoSalesBilling(U8cSalesBillingEntity entity); +} diff --git a/service/src/main/java/com/hzya/frame/u8c/salesBilling/service/impl/U8cSalesBillingServiceImpl.java b/service/src/main/java/com/hzya/frame/u8c/salesBilling/service/impl/U8cSalesBillingServiceImpl.java new file mode 100644 index 00000000..56ea26f8 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/salesBilling/service/impl/U8cSalesBillingServiceImpl.java @@ -0,0 +1,35 @@ +package com.hzya.frame.u8c.salesBilling.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao; +import com.hzya.frame.u8c.salesBilling.dao.IU8cSalesBillingDao; +import com.hzya.frame.u8c.salesBilling.entity.U8cSalesBillingEntity; +import com.hzya.frame.u8c.salesBilling.service.IU8cSalesBillingService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +@Service(value = "u8cSalesBillingService") +public class U8cSalesBillingServiceImpl extends BaseService implements IU8cSalesBillingService { + + private IU8cSalesBillingDao u8cSalesBillingDao; + + @Autowired + public void setU8cSalesBillingDao(IU8cSalesBillingDao dao) { + this.u8cSalesBillingDao = dao; + this.dao = dao; + } + @Override + public List queryDoSalesBilling(U8cSalesBillingEntity entity) { + List u8cSalesBillingEntityList = u8cSalesBillingDao.queryDoSalesBilling(entity); + return u8cSalesBillingEntityList; + } + + @Override + public int updateDoSalesBilling(U8cSalesBillingEntity entity) { + return u8cSalesBillingDao.updateDoSalesBilling(entity); + } +} From 42b10acc82e4e3867cc973b7c709940371500243 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Mon, 5 Aug 2024 16:42:53 +0800 Subject: [PATCH 027/101] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E6=8E=A5=E5=8F=A3=202024=E5=B9=B48=E6=9C=885?= =?UTF-8?q?=E6=97=A5=2016:42:46?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hzya/frame/seeyon/util/RestUtil.java | 79 +++++++++++++------ 1 file changed, 54 insertions(+), 25 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/seeyon/util/RestUtil.java b/service/src/main/java/com/hzya/frame/seeyon/util/RestUtil.java index dc6195f2..8959db3b 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/util/RestUtil.java +++ b/service/src/main/java/com/hzya/frame/seeyon/util/RestUtil.java @@ -69,6 +69,26 @@ public class RestUtil { 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 = 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 @@ -78,36 +98,45 @@ public class RestUtil { public String getToken(String login_name,String api_code){ if (StrUtil.isNotEmpty(api_code)){ SysApplicationApiEntity sysApp = getByCode(api_code); - if (null != sysApp){ - HashMap hashMap = new HashMap<>(); - String app_url = 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); - } - } - if (StrUtil.isNotEmpty(login_name)){ - hashMap.put("loginName",login_name); - } - 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 getToken(login_name,sysApp); }else { throw new BaseSystemException("api_code不能为空"); } - return null; } + /** + * 获取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 = 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); + } + } + if (StrUtil.isNotEmpty(login_name)){ + hashMap.put("loginName",login_name); + } + 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(); From 5ce5818c9479f684557654f8719801bc480db72c Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Mon, 5 Aug 2024 17:07:46 +0800 Subject: [PATCH 028/101] =?UTF-8?q?2106=E8=A1=8C=20=E5=AE=81=E6=B3=A2?= =?UTF-8?q?=E9=93=B6=E8=A1=8C=E8=BF=94=E5=9B=9E=E5=8F=82=E6=95=B0=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=20data=E6=94=B9=E6=88=90=20Data=202024=E5=B9=B48?= =?UTF-8?q?=E6=9C=885=E6=97=A5=2017:07:23?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/service/impl/SysApplicationServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java index 30d56d10..17ae554f 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java @@ -2103,7 +2103,7 @@ public class SysApplicationServiceImpl extends BaseService Date: Tue, 6 Aug 2024 15:43:39 +0800 Subject: [PATCH 029/101] 1 --- common/src/main/java/com/hzya/frame/util/GroovyUtil.java | 1 + 1 file changed, 1 insertion(+) diff --git a/common/src/main/java/com/hzya/frame/util/GroovyUtil.java b/common/src/main/java/com/hzya/frame/util/GroovyUtil.java index eec3019b..2b88f25f 100644 --- a/common/src/main/java/com/hzya/frame/util/GroovyUtil.java +++ b/common/src/main/java/com/hzya/frame/util/GroovyUtil.java @@ -51,6 +51,7 @@ public class GroovyUtil { logger.info("创建newInstance失败:"+ e); throw new BaseSystemException(e); } + logger.info("开始执行脚本:"+parameterJson); Object returnObj = groovyObject.invokeMethod("execute",parameterJson); logger.info("执行脚本结束:"+returnObj); return returnObj; From 9f6009bd9639c9199cae6a8d432ccf67ff080337 Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Tue, 6 Aug 2024 15:44:18 +0800 Subject: [PATCH 030/101] 1 --- .../impl/GroovyIntegrationServiceImpl.java | 73 ++++++++++--------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java index a93ed74b..e8c9e6e0 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java @@ -34,49 +34,32 @@ public class GroovyIntegrationServiceImpl implements IGroovyIntegrationService { } public static void main(String[] args) { -// java.lang.String str = "{\"data\":{\"document_rule\":\"WLFL-2024-07-31-00025\",\"create_user_id\":\"1\",\"create_time\":1722405930000,\"company_id\":\"Y\",\"modify_time\":1722405930000,\"materiel_classify_name\":\"测试下发一级\",\"document_rule_num\":25,\"materiel_classify_code\":\"09\",\"add_status\":\"0\",\"update_status\":\"0\",\"sts\":\"Y\",\"delete_status\":\"1\",\"org_id\":\"Y\",\"id\":\"3dac9727cc0648baa8c1355464ad44b8\",\"data_status\":\"F\",\"modify_user_id\":\"1\",\"sorts\":34},\"query\":\"[]\",\"header\":\"[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":0,\\\"parameterName\\\":\\\"usercode\\\",\\\"id\\\":\\\"e2c4013a-a5ad-4d21-9e91-aac0dd738838\\\",\\\"example\\\":\\\"17633965916\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":1,\\\"parameterName\\\":\\\"password\\\",\\\"id\\\":\\\"22373440-45f5-450c-9497-40ede659e831\\\",\\\"example\\\":\\\"92d40fd65a74377608c0039eaafdba99\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":2,\\\"parameterName\\\":\\\"trantype\\\",\\\"id\\\":\\\"12fd925a-29c1-42ca-a3e6-edf3c925c495\\\",\\\"example\\\":\\\"code\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":3,\\\"parameterName\\\":\\\"system\\\",\\\"id\\\":\\\"11dd627c-bb82-4304-bff0-2ba54e2b8907\\\",\\\"example\\\":\\\"01\\\"}]\",\"tripartiteId\":\"0001A110000000000R6D\",\"body\":\"[{\\\"parameterType\\\":\\\"complex\\\",\\\"children\\\":[{\\\"parameterType\\\":\\\"complexlist\\\",\\\"children\\\":[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":2,\\\"description\\\":\\\"分类编码\\\",\\\"parameterName\\\":\\\"invclasscode\\\",\\\"id\\\":\\\"3b2af319-87c8-400a-b38a-d54f9b207f26\\\",\\\"example\\\":\\\"04\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":3,\\\"description\\\":\\\"分类名称\\\",\\\"parameterName\\\":\\\"invclassname\\\",\\\"id\\\":\\\"7c5bd695-ed84-4a92-a1c7-31c862e98d21\\\",\\\"example\\\":\\\"成品测试1\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":4,\\\"description\\\":\\\"公司编码默认0001\\\",\\\"parameterName\\\":\\\"pk_corp\\\",\\\"id\\\":\\\"482d659b-b374-4fb5-b31b-32bca4a6d8be\\\",\\\"example\\\":\\\"0001\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":5,\\\"description\\\":\\\"分类主键\\\",\\\"parameterName\\\":\\\"pk_invcl\\\",\\\"id\\\":\\\"3fa6caac-e0cd-4ec7-8df4-7c990504ee25\\\",\\\"example\\\":\\\"0001F11000000000I6NN\\\"}],\\\"concreteType\\\":\\\"ObjectCom\\\",\\\"index\\\":1,\\\"parameterName\\\":\\\"invcl\\\",\\\"id\\\":\\\"0638670a-e65d-46e1-aabd-adc7a956c4cb\\\"}],\\\"concreteType\\\":\\\"Object\\\",\\\"index\\\":0,\\\"id\\\":\\\"81cdd912-9bf3-4cb4-b74f-2a8ee27de93a\\\",\\\"parameterName\\\":\\\"body\\\",\\\"first\\\":true}]\"}"; -// A88772 s = new A88772(); -// System.out.println(s.execute(str)); + java.lang.String str = "{\"data\":{\"pk_areacl\":\"01\",\"document_rule\":\"KH-2024-08-02-00001\",\"create_user_id\":\"1\",\"code\":\"K202408010001\",\"create_time\":1722580487000,\"company_id\":\"Y\",\"modify_time\":1722580487000,\"document_rule_num\":1,\"mdm_customer_bank\":[],\"add_status\":\"0\",\"update_status\":\"1\",\"sts\":\"Y\",\"delete_status\":\"1\",\"org_id\":\"Y\",\"name\":\"测试手动下发\",\"id\":\"f0daa2ce563949968aeb2b4cfd7f4fad\",\"data_status\":\"Y\",\"modify_user_id\":\"1\",\"sorts\":136,\"custshortname\":\"测试手动下发\"},\"query\":\"[]\",\"header\":\"[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":0,\\\"parameterName\\\":\\\"usercode\\\",\\\"id\\\":\\\"7e7c7f83-9cb1-491d-bd1a-d23744bacba8\\\",\\\"example\\\":\\\"17633965916\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":1,\\\"parameterName\\\":\\\"password\\\",\\\"id\\\":\\\"e6c1a7c7-0bcc-4246-b62c-e2313b092438\\\",\\\"example\\\":\\\"92d40fd65a74377608c0039eaafdba99\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":2,\\\"parameterName\\\":\\\"trantype\\\",\\\"id\\\":\\\"b4ff0ceb-d797-462a-8c93-124f5a053628\\\",\\\"example\\\":\\\"code\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":3,\\\"parameterName\\\":\\\"system\\\",\\\"id\\\":\\\"a8962ee0-108f-427a-8862-8f8e5c8e61ab\\\",\\\"example\\\":\\\"01\\\"}]\",\"body\":\"[{\\\"parameterType\\\":\\\"complexlist\\\",\\\"children\\\":[{\\\"parameterType\\\":\\\"complexlist\\\",\\\"children\\\":[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":2,\\\"parameterName\\\":\\\"accname\\\",\\\"id\\\":\\\"69014133-b81e-4a9d-82fc-7c29821e77f9\\\",\\\"example\\\":\\\"666601\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":3,\\\"parameterName\\\":\\\"account\\\",\\\"id\\\":\\\"51980e53-c1dd-448a-bf36-d24fd817b1a5\\\",\\\"example\\\":\\\"test001\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":4,\\\"parameterName\\\":\\\"accountname\\\",\\\"id\\\":\\\"97111e2d-8df9-4465-a241-e1969b032287\\\",\\\"example\\\":\\\"zy测试银行账户\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":5,\\\"parameterName\\\":\\\"banktypename\\\",\\\"id\\\":\\\"176cd4c8-5228-4dd6-bee7-2101f09a16d3\\\",\\\"example\\\":\\\"6666\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":6,\\\"parameterName\\\":\\\"defflag\\\",\\\"id\\\":\\\"8d833cbf-a396-41af-ba52-cb58b3aa5a74\\\",\\\"example\\\":\\\"Y\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":7,\\\"parameterName\\\":\\\"pk_currtype\\\",\\\"id\\\":\\\"d80241ec-c9fb-480c-9e0a-bd1589595a20\\\",\\\"example\\\":\\\"CNY\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":8,\\\"parameterName\\\":\\\"status\\\",\\\"id\\\":\\\"2c7d4b42-b26e-4aa9-a294-3b330e08cf70\\\",\\\"example\\\":\\\"2\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":9,\\\"parameterName\\\":\\\"unitname\\\",\\\"id\\\":\\\"9e6a593f-e35f-456e-879a-41d3d63bb94b\\\",\\\"example\\\":\\\"测试001\\\"}],\\\"concreteType\\\":\\\"ObjectCom\\\",\\\"index\\\":1,\\\"parameterName\\\":\\\"banks\\\",\\\"id\\\":\\\"3815c339-d96b-40d6-a96c-81b8cf68be28\\\"},{\\\"parameterType\\\":\\\"complex\\\",\\\"children\\\":[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":11,\\\"parameterName\\\":\\\"conaddr\\\",\\\"id\\\":\\\"b5990933-94e0-4015-9f53-2ce6fa9bc3da\\\",\\\"example\\\":\\\"测试33145411113\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":12,\\\"parameterName\\\":\\\"creator\\\",\\\"id\\\":\\\"f0cce0b5-b5fa-4ea7-8f15-f1ac075eb7f1\\\",\\\"example\\\":\\\"0001F8100000000000PL\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":13,\\\"parameterName\\\":\\\"custcode\\\",\\\"id\\\":\\\"853453c3-dad1-4155-998b-9d1c4b8e2acd\\\",\\\"example\\\":\\\"ceshi007\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":14,\\\"parameterName\\\":\\\"custname\\\",\\\"id\\\":\\\"2b06423d-827a-465d-b829-42471733fa51\\\",\\\"example\\\":\\\"测试007\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":15,\\\"parameterName\\\":\\\"custprop\\\",\\\"id\\\":\\\"c4277bcb-7d80-4c12-8508-935086e2c7df\\\",\\\"example\\\":\\\"0\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":16,\\\"parameterName\\\":\\\"custshortname\\\",\\\"id\\\":\\\"6c02f4ec-618c-4973-babe-a0c81c179743\\\",\\\"example\\\":\\\"测试007\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":17,\\\"parameterName\\\":\\\"freecustflag\\\",\\\"id\\\":\\\"48c1d795-4396-4189-8f22-9228b2424fce\\\",\\\"example\\\":\\\"N\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":18,\\\"parameterName\\\":\\\"isconnflag\\\",\\\"id\\\":\\\"92be035c-eb7c-46be-a2c3-5e48ce18cf4f\\\",\\\"example\\\":\\\"N\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":19,\\\"parameterName\\\":\\\"pk_areacl\\\",\\\"id\\\":\\\"8bc3d731-ab42-46d5-afc3-3227de0df96b\\\",\\\"example\\\":\\\"01\\\"}],\\\"concreteType\\\":\\\"Object\\\",\\\"index\\\":10,\\\"parameterName\\\":\\\"parentvo\\\",\\\"id\\\":\\\"627af933-4b7f-433b-beb5-f2a49b50cfaa\\\"}],\\\"concreteType\\\":\\\"ObjectCom\\\",\\\"index\\\":0,\\\"parameterName\\\":\\\"cbdocvo\\\",\\\"id\\\":\\\"33aac70c-d95a-475d-8f98-28925223f305\\\"}]\"}"; + A88772 s = new A88772(); + System.out.println(s.execute(str)); - String str = "{\"data\":\"{\\\"msg\\\":\\\"转发成功\\\",\\\"type\\\":null,\\\"flag\\\":true,\\\"status\\\":\\\"200\\\",\\\"attribute\\\":{\\\"data\\\":\\\"[{\\\\\\\"pk_invcl\\\\\\\":\\\\\\\"0001A110000000000QPW\\\\\\\",\\\\\\\"invclasscode\\\\\\\":\\\\\\\"09\\\\\\\",\\\\\\\"invclassname\\\\\\\":\\\\\\\"测试下发一级\\\\\\\",\\\\\\\"invclasslev\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"pk_corp\\\\\\\":\\\\\\\"0001\\\\\\\"}]\\\",\\\"taskNumber\\\":\\\"202407310125\\\",\\\"status\\\":\\\"success\\\"}}\"}"; - g_482610back t = new g_482610back(); - System.out.println(t.execute(str)); - } - static class test0001{ - String execute(String jsonStr) { - com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject(); - com.alibaba.fastjson.JSONObject reqData = com.alibaba.fastjson.JSON.parseObject(jsonStr); - if(null !=reqData){ - com.alibaba.fastjson.JSONObject header = new com.alibaba.fastjson.JSONObject(); - if(null !=reqData.getString("status")&& !"".equals(reqData.getString("status"))){ - com.alibaba.fastjson.JSONArray dataArr = com.alibaba.fastjson.JSON.parseArray(reqData.getString("data")); - com.alibaba.fastjson.JSONObject data = (JSONObject) dataArr.get(0); - returnObject.put("success","true"); - returnObject.put("tripartiteId",data.getString("pk_invcl")); - }else{ - returnObject.put("success","false"); - } - }else{ - returnObject.put("success","false"); - } - return returnObject.toJSONString(); - } +// String str = "{\"data\":\"{\\\"msg\\\":\\\"转发成功\\\",\\\"type\\\":null,\\\"flag\\\":true,\\\"status\\\":\\\"200\\\",\\\"attribute\\\":{\\\"data\\\":\\\"[{\\\\\\\"parentvo\\\\\\\":{\\\\\\\"pk_corp\\\\\\\":\\\\\\\"0001\\\\\\\",\\\\\\\"invcode\\\\\\\":\\\\\\\"CS202408020001\\\\\\\",\\\\\\\"invname\\\\\\\":\\\\\\\"测试存货档案\\\\\\\",\\\\\\\"pk_invcl\\\\\\\":\\\\\\\"0001A110000000000RB3\\\\\\\",\\\\\\\"invclcode\\\\\\\":\\\\\\\"0901\\\\\\\",\\\\\\\"invclname\\\\\\\":\\\\\\\"测试二级-1-1-1\\\\\\\",\\\\\\\"pk_measdoc\\\\\\\":\\\\\\\"0001A110000000000J7T\\\\\\\",\\\\\\\"meascode\\\\\\\":\\\\\\\"BAO\\\\\\\",\\\\\\\"measname\\\\\\\":\\\\\\\"包\\\\\\\",\\\\\\\"pk_taxitems\\\\\\\":\\\\\\\"40040000000000000037\\\\\\\",\\\\\\\"taxitemscode\\\\\\\":\\\\\\\"1001\\\\\\\",\\\\\\\"taxitemsname\\\\\\\":\\\\\\\"水泥\\\\\\\",\\\\\\\"unitvolume\\\\\\\":\\\\\\\"0.00000000\\\\\\\",\\\\\\\"unitweight\\\\\\\":\\\\\\\"0.00000000\\\\\\\",\\\\\\\"laborflag\\\\\\\":false,\\\\\\\"discountflag\\\\\\\":false,\\\\\\\"setpartsflag\\\\\\\":false,\\\\\\\"asset\\\\\\\":false,\\\\\\\"iselectrans\\\\\\\":false,\\\\\\\"isretail\\\\\\\":false,\\\\\\\"assistunit\\\\\\\":true,\\\\\\\"autobalancemeas\\\\\\\":false,\\\\\\\"ismngstockbygrswt\\\\\\\":false,\\\\\\\"isstorebyconvert\\\\\\\":false,\\\\\\\"creator\\\\\\\":\\\\\\\"openapi\\\\\\\",\\\\\\\"createtime\\\\\\\":\\\\\\\"2024-08-02 10:38:10\\\\\\\",\\\\\\\"pk_invbasdoc\\\\\\\":\\\\\\\"0001A110000000000SZM\\\\\\\",\\\\\\\"dr\\\\\\\":\\\\\\\"0\\\\\\\"},\\\\\\\"childrenvo\\\\\\\":[]}]\\\",\\\"taskNumber\\\":\\\"202408020006\\\",\\\"status\\\":\\\"success\\\"}}\"}"; +// g_482610back t = new g_482610back(); +// System.out.println(t.execute(str)); } + static class A88772 { String execute(String jsonStr) { com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject(); com.alibaba.fastjson.JSONObject bodys = new com.alibaba.fastjson.JSONObject(); - com.alibaba.fastjson.JSONArray invcl = new com.alibaba.fastjson.JSONArray(); + com.alibaba.fastjson.JSONArray cbdocvo = new com.alibaba.fastjson.JSONArray(); com.alibaba.fastjson.JSONObject main = new com.alibaba.fastjson.JSONObject(); + com.alibaba.fastjson.JSONObject parentvo = new com.alibaba.fastjson.JSONObject(); com.alibaba.fastjson.JSONObject reqData = com.alibaba.fastjson.JSON.parseObject(jsonStr); com.alibaba.fastjson.JSONObject data = reqData.getJSONObject("data"); - main.put("invclasscode", data.getString("materiel_classify_code")); - main.put("invclassname", data.getString("materiel_classify_name")); - main.put("pk_invcl", reqData.getString("tripartiteId")); - main.put("pk_corp", "0001"); - invcl.add(main); - bodys.put("invcl",invcl); + parentvo.put("pk_areacl", data.getString("pk_areacl")); + parentvo.put("custcode", data.getString("code")); + parentvo.put("custshortname", data.getString("custshortname")); + parentvo.put("custname", data.getString("name")); + main.put("parentvo",parentvo); + cbdocvo.add(main); + bodys.put("cbdocvo",cbdocvo); returnObject.put("bodys",bodys.toJSONString()); return returnObject.toJSONString(); @@ -96,10 +79,10 @@ public class GroovyIntegrationServiceImpl implements IGroovyIntegrationService { com.alibaba.fastjson.JSONObject header = new com.alibaba.fastjson.JSONObject(); if(null !=reqData.getString("status")&& !"".equals(reqData.getString("status"))){ com.alibaba.fastjson.JSONArray dataArr = com.alibaba.fastjson.JSON.parseArray(reqData.getString("data")); -// com.alibaba.fastjson.JSONObject data = (com.alibaba.fastjson.JSONObject) dataArr.get(0); com.alibaba.fastjson.JSONObject data = dataArr.getJSONObject(0); + com.alibaba.fastjson.JSONObject parentvo = data.getJSONObject("parentvo"); returnObject.put("success","true"); - returnObject.put("tripartiteId",data.getString("pk_invcl")); + returnObject.put("tripartiteId",parentvo.getString("pk_invbasdoc")); }else{ returnObject.put("success","false"); } @@ -110,5 +93,25 @@ public class GroovyIntegrationServiceImpl implements IGroovyIntegrationService { returnObject.put("success","false"); } return returnObject.toJSONString(); } } + static class g_494689 { + public static void main(String[] args) { + String str = "{\"data\":{\"pk_areacl\":\"01\",\"document_rule\":\"KH-2024-08-02-00007\",\"create_user_id\":\"1\",\"code\":\"K202408010006\",\"create_time\":1722584236000,\"company_id\":\"Y\",\"modify_time\":1722584236000,\"document_rule_num\":7,\"mdm_customer_bank\":[],\"add_status\":\"0\",\"update_status\":\"1\",\"sts\":\"Y\",\"delete_status\":\"1\",\"org_id\":\"Y\",\"custstate\":\"测试自动分配03\",\"id\":\"d9ccd167d0ae4e3884f2b76c31a88a34\",\"data_status\":\"Y\",\"modify_user_id\":\"1\",\"sorts\":142,\"custshortname\":\"测试自动分配03\"},\"query\":\"[]\",\"header\":\"[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"index\\\":0,\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"8e704f6e-20a8-49f9-b10a-fd1a6090565a\\\",\\\"parameterName\\\":\\\"usercode\\\",\\\"required\\\":false,\\\"example\\\":\\\"17633965916\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"index\\\":1,\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"5ca85472-dc42-45d8-9be6-dedf20cb09d9\\\",\\\"parameterName\\\":\\\"password\\\",\\\"example\\\":\\\"92d40fd65a74377608c0039eaafdba99\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"index\\\":2,\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"d32b0dfd-2f06-4ee1-a56d-03882f9003d4\\\",\\\"parameterName\\\":\\\"trantype\\\",\\\"example\\\":\\\"code\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"index\\\":3,\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"1f48a05d-8f89-4bb2-b29a-e1a6eac7f5b7\\\",\\\"parameterName\\\":\\\"system\\\",\\\"example\\\":\\\"01\\\"}]\",\"body\":\"[{\\\"parameterType\\\":\\\"complexlist\\\",\\\"children\\\":[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":1,\\\"parameterName\\\":\\\"pk_corp\\\",\\\"id\\\":\\\"33bc86ee-652c-4822-b6a8-dbd329a20779\\\",\\\"example\\\":\\\"1004\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":2,\\\"parameterName\\\":\\\"custprop\\\",\\\"id\\\":\\\"b5d55712-b378-4dbd-b2ae-04bcb3d0fb2b\\\",\\\"example\\\":\\\"0\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":3,\\\"parameterName\\\":\\\"pk_cubasdoc\\\",\\\"id\\\":\\\"0c4a5614-effb-4d88-83e2-e9cd0f33ea3a\\\",\\\"example\\\":\\\"0001F810000000000FE0\\\"}],\\\"concreteType\\\":\\\"ObjectCom\\\",\\\"index\\\":0,\\\"parameterName\\\":\\\"custbasvo\\\",\\\"id\\\":\\\"df932132-3a93-463c-aaa7-7393b0abfa80\\\"}]\"}"; + g_494689 s = new g_494689(); + System.out.println(s.execute(str)); + } + String execute (String jsonStr){ + com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject(); + com.alibaba.fastjson.JSONObject bodys = new com.alibaba.fastjson.JSONObject(); + com.alibaba.fastjson.JSONArray custbasvo = new com.alibaba.fastjson.JSONArray(); + com.alibaba.fastjson.JSONObject main = new com.alibaba.fastjson.JSONObject(); + com.alibaba.fastjson.JSONObject reqData = com.alibaba.fastjson.JSON.parseObject(jsonStr); + com.alibaba.fastjson.JSONObject data = reqData.getJSONObject("data"); + main.put("pk_corp", "002"); + main.put("pk_cubasdoc", reqData.getString("tripartiteId")); + main.put("custprop", "2"); + custbasvo.add(main); + bodys.put("custbasvo",custbasvo); + returnObject.put("bodys",bodys.toJSONString()); + return returnObject.toJSONString(); } } } From 0cf730bb43caa9250e8098935f42991a406d0ac2 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 7 Aug 2024 09:46:05 +0800 Subject: [PATCH 031/101] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=8E=A5=E5=8F=A3=202024=E5=B9=B48=E6=9C=887?= =?UTF-8?q?=E6=97=A5=2009:45:52?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/INingboBankPluginService.java | 14 +++ .../impl/NingboBankPluginServiceImpl.java | 102 +++++++++++++++++- 2 files changed, 112 insertions(+), 4 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java index 5a39a6ae..b4ab0ff1 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java @@ -42,4 +42,18 @@ public interface INingboBankPluginService { * @param apiCode */ void queryResult(List> hashMaps,String apiCode); + + /** + * 查询OA附件,并上传到宁波银行 + * @param oaId oa主键id + * @return 宁波银行附件上传编码 + */ + String fileUpload(String oaId); + + /** + * 更新u8c单据状态 + * @param billCode oa单据编号 + * @param dwbm 公司编码 + */ + void updateU8CStatus(String billCode,String dwbm); } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java index 22a44037..13d31d90 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java @@ -6,6 +6,7 @@ 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.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.ningboBankTreasury.dto.req.SingleTransferReq; import com.hzya.frame.ningboBankTreasury.dto.req.TTRemitReq; @@ -13,14 +14,17 @@ import com.hzya.frame.ningboBankTreasury.dto.res.AccTransactionRes; import com.hzya.frame.ningboBankTreasury.enums.CurrencyEnum; import com.hzya.frame.ningboBankTreasury.enums.PayStatusEnum; import com.hzya.frame.ningboBankTreasury.enums.TTPayStatusEnum; +import com.hzya.frame.ningboBankTreasury.service.INingboBankTreasuryService; import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao; import com.hzya.frame.plugin.a8bill.entity.PayBillEntity; import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService; import com.hzya.frame.seeyon.dongj.entity.Formmain0044Entity; import com.hzya.frame.seeyon.dongj.service.IFormmain0044Service; +import com.hzya.frame.seeyon.util.RestUtil; import com.hzya.frame.stringutil.StringUtil; import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.web.entity.JsonResultEntity; import org.apache.commons.collections.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -28,7 +32,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import javax.annotation.Resource; -import java.util.*; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -44,7 +51,10 @@ private IFormmain0044Service formmain0044Service; private IIntegrationTaskLivingDetailsService taskLivingDetailsService; @Autowired private IPayBillPluginInitializerDao payBillDao; - + @Autowired + private RestUtil restUtil; + @Autowired + private INingboBankTreasuryService ningboBankTreasuryService; @Value("${OA.data_source_code}") private String oa_data_source_code; @@ -69,13 +79,17 @@ private IFormmain0044Service formmain0044Service; main.put(key, hashMap.get(key)); } String param = ""; + //单笔转账 if ("8000360000".equals(apiCode)){ SingleTransferReq singleTransferReq = JSONObject.parseObject(main.toString(), SingleTransferReq.class); param = JSONObject.toJSONString(singleTransferReq); }else if("8000360003".equals(apiCode)){ + //TT汇款 TTRemitReq ttRemitReq = JSONObject.parseObject(main.toString(), TTRemitReq.class); - if ("01".equals(ttRemitReq.getPayMode()) || "1".equals(ttRemitReq.getPayMode())){ - ttRemitReq.setFileUploadCodes(Convert.toList(String.class,"0a736c17-e79f-48be-b3cd-710585165d55")); + //货到付款时,要上传附件 + if ("01".equals(ttRemitReq.getPayMode())){ + String fileCode = fileUpload(main.getString("id")); + ttRemitReq.setFileUploadCodes(Convert.toList(String.class,fileCode)); } param = JSONObject.toJSONString(ttRemitReq); } @@ -143,6 +157,8 @@ private IFormmain0044Service formmain0044Service; //修改推送状态,防止重复推送 oaBillEntity.setSql(str); payBillDao.updateStateForId(str,oaBillEntity); + //更新u8c付款单状态 + updateU8CStatus(main.getString("serialNo"),main.getString("dwbm")); }catch (Exception e){ logger.info("宁波银行付款接口调用出错:{}",e); } @@ -311,6 +327,84 @@ private IFormmain0044Service formmain0044Service; } } + /** + * 查询OA附件,并上传到宁波银行 + * + * @param oaId oa主键id + * @return 宁波银行附件上传编码 + */ + @Override + public String fileUpload(String oaId) { + if (StrUtil.isNotEmpty(oaId)){ + try { + //查询oa单据关联附件 + PayBillEntity oaBillEntity = new PayBillEntity(); + oaBillEntity.setDataSourceCode(oa_data_source_code); + String sql = " SELECT\n" + + " formmain_0058.id,\n" + + " formmain_0058.field0024 ,\n" + + " CTP_ATTACHMENT.FILE_URL,\n" + + " CTP_ATTACHMENT.FILENAME\n" + + "FROM\n" + + " formmain_0058 \n" + + " LEFT JOIN CTP_ATTACHMENT ON CTP_ATTACHMENT.SUB_REFERENCE = formmain_0058.field0024 \n" + + "WHERE\n" + + " formmain_0058.field0061 = '境外'\n" + + " and formmain_0058.id = '" + oaId+"'"; + oaBillEntity.setSql(sql); + List> dataList = payBillDao.getOaBillData(sql, oaBillEntity); + if (CollectionUtils.isNotEmpty(dataList)){ + HashMap oaDataMap = dataList.get(0); + String fileUrl = String.valueOf(oaDataMap.get("FILE_URL")); + String fileName = String.valueOf(oaDataMap.get("FILENAME")); + if (StrUtil.isNotEmpty(fileUrl)){ + //下载OA附件 + byte[] bytes = restUtil.downloadFileBytes("oa1", "8000340000", fileUrl, fileName); + //上传到宁波银行 + logger.info("上传附件到宁波银行:{},{}",fileUrl,fileName); + JSONObject param = new JSONObject(); + param.put("fileName",fileName); + param.put("bytes",bytes); + param.put("channelNo","open-filegateway"); + String res = executeEsb(param.toString(), "8000360008"); + JsonResultEntity jsonResultEntity = JSONObject.parseObject(res, JsonResultEntity.class); + if (null != jsonResultEntity && jsonResultEntity.isFlag()){ + JSONObject attribute = JSONObject.parseObject(String.valueOf(jsonResultEntity.getAttribute())); + JSONObject data = attribute.getJSONObject("Data"); + String fileCode = data.getString("data"); + return fileCode; + } + } + } + }catch(Exception e){ + logger.error("上传附件到宁波银行出错:{}",e); + } + } + return null; + } + + /** + * 更新u8c单据状态 + * @param billCode oa单据编号 + * @param dwbm 公司编码 + */ + @Override + public void updateU8CStatus(String billCode,String dwbm) { + if (StrUtil.isNotEmpty(billCode)){ + JSONObject billObj = new JSONObject(); + billObj.put("djbh",billCode); + billObj.put("dwbm",dwbm); + billObj.put("operatedate",DateUtil.today()); + billObj.put("operatorid","yonyou02"); + billObj.put("result","0"); + JSONArray bills = new JSONArray(); + bills.add(bills); + JSONObject param = new JSONObject(); + param.put("bills",bills); + String s = executeEsb(param.toString(), "8000350044"); + logger.info("调用U8C付款单审批返回参数:{}",s); + } + } private static String getAccLogXmlTemplate(){ // return ""; From 59840afc972891190877da40d83a1ab11135a0cd Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Thu, 8 Aug 2024 09:55:40 +0800 Subject: [PATCH 032/101] 1 --- buildpackage/src/main/resources/application-dongj.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildpackage/src/main/resources/application-dongj.yml b/buildpackage/src/main/resources/application-dongj.yml index e6734d2a..28fa5bb3 100644 --- a/buildpackage/src/main/resources/application-dongj.yml +++ b/buildpackage/src/main/resources/application-dongj.yml @@ -2,7 +2,7 @@ logging: #日志级别 指定目录级别 level: - root: warn + root: info encodings: UTF-8 file: # 日志保存路径 From eeeae913da083ae5677364fd80330d0fc70c47ea Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 14 Aug 2024 13:31:50 +0800 Subject: [PATCH 033/101] =?UTF-8?q?=E9=99=84=E4=BB=B6=E5=A4=84=E7=90=86=20?= =?UTF-8?q?2024=E5=B9=B48=E6=9C=8814=E6=97=A5=2013:31:45?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../a8bill/service/INingboBankPluginService.java | 7 ++++--- .../impl/NingboBankPluginServiceImpl.java | 16 +++++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java index b4ab0ff1..80c6010f 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java @@ -23,11 +23,12 @@ public interface INingboBankPluginService { void payRequest(List> hashMaps,String pluginId,String apiCode,String interId); /** * 调用宁波银行esb接口 - * @param params - * @param apiCode + * @param params 参数 + * @param apiCode 接口编码 + * @param appId 应用id * @return */ - String executeEsb(String params,String apiCode); + String executeEsb(String params,String apiCode,String appId); /** diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java index 13d31d90..2b3983fd 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java @@ -97,7 +97,7 @@ private IFormmain0044Service formmain0044Service; param = main.toString(); } logger.info("获取到付款单的数据:{}",main.toString()); - String result = this.executeEsb(param,apiCode); + String result = this.executeEsb(param,apiCode,"800036"); logger.info("推送宁波银行的返回结果:{}",result); IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); logDetails.setRootAppPk(main.getString("id")); @@ -191,7 +191,7 @@ private IFormmain0044Service formmain0044Service; logger.info("获取到付款单状态的数据"+main.toString()); JSONObject reMain = new JSONObject(); reMain.put("serialNo",main.getString("serialNo")); - String result = this.executeEsb(reMain.toString(),apiCode); + String result = this.executeEsb(reMain.toString(),apiCode,"800036"); logger.info("获取付款状态结果"+result); JSONObject resultObj = JSON.parseObject(result); @@ -258,13 +258,14 @@ private IFormmain0044Service formmain0044Service; * @return */ @Override - public String executeEsb(String params, String apiCode) { + public String executeEsb(String params, String apiCode,String appId) { logger.info("请求apiCode:{},参数:{}",apiCode,params); Map header = MapBuilder.create(true) .put("apiCode", apiCode) .put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj") .put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") - .put("appId","800036") + //.put("appId","800036") + .put("appId",appId) .build(); String res = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(header).body(params).timeout(60000).execute().body(); return res; @@ -366,7 +367,7 @@ private IFormmain0044Service formmain0044Service; param.put("fileName",fileName); param.put("bytes",bytes); param.put("channelNo","open-filegateway"); - String res = executeEsb(param.toString(), "8000360008"); + String res = executeEsb(param.toString(), "8000360008","800036"); JsonResultEntity jsonResultEntity = JSONObject.parseObject(res, JsonResultEntity.class); if (null != jsonResultEntity && jsonResultEntity.isFlag()){ JSONObject attribute = JSONObject.parseObject(String.valueOf(jsonResultEntity.getAttribute())); @@ -398,10 +399,11 @@ private IFormmain0044Service formmain0044Service; billObj.put("operatorid","yonyou02"); billObj.put("result","0"); JSONArray bills = new JSONArray(); - bills.add(bills); + bills.add(billObj); JSONObject param = new JSONObject(); param.put("bills",bills); - String s = executeEsb(param.toString(), "8000350044"); + String s = executeEsb(param.toString(), "8000350044","800035"); + System.out.println("调用U8C付款单审批返回参数"+s); logger.info("调用U8C付款单审批返回参数:{}",s); } } From 902d6933c3b374d276bba8f536df12a8006faa2f Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 14 Aug 2024 13:32:49 +0800 Subject: [PATCH 034/101] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=B1=BB=202024?= =?UTF-8?q?=E5=B9=B48=E6=9C=8814=E6=97=A5=2013:32:44?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/java/com/hzya/frame/temButtom.java | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/buildpackage/src/test/java/com/hzya/frame/temButtom.java b/buildpackage/src/test/java/com/hzya/frame/temButtom.java index 4ab3bcf7..91b2abcc 100644 --- a/buildpackage/src/test/java/com/hzya/frame/temButtom.java +++ b/buildpackage/src/test/java/com/hzya/frame/temButtom.java @@ -1,6 +1,8 @@ package com.hzya.frame; import cn.hutool.core.convert.Convert; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.io.IoUtil; import cn.hutool.http.HttpRequest; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; @@ -15,6 +17,8 @@ import com.hzya.frame.cbs8.util.CbsAccessToken; import com.hzya.frame.ningboBankTreasury.dto.req.AccTransactionReq; import com.hzya.frame.ningboBankTreasury.dto.res.AccTransactionRes; import com.hzya.frame.ningboBankTreasury.service.INingboBankTreasuryService; +import com.hzya.frame.ningboBankTreasury.util.NingboBankUtil; +import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService; import com.hzya.frame.plugin.cbs8.plugin.PayApplyPluginInitializer; import com.hzya.frame.plugin.cbs8.plugin.PayResultPluginInitializer; import com.hzya.frame.plugin.cbs8.plugin.TransactionDetailPluginInitializer; @@ -24,6 +28,8 @@ import com.hzya.frame.seeyon.cbs8.service.IPaymentService; import com.hzya.frame.stringutil.StringUtil; import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; import com.hzya.frame.util.AESUtil; +import com.nbcb.sdk.OpenSDK; +import com.nbcb.sdk.aes.param.ConfigParam; import org.apache.http.protocol.HTTP; import org.junit.Test; import org.junit.runner.RunWith; @@ -32,6 +38,7 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import javax.annotation.Resource; +import java.io.File; import java.util.*; /** @@ -62,6 +69,39 @@ public class temButtom { @Resource private INingboBankTreasuryService ningboxService; + @Autowired + private INingboBankPluginService ningboBankPluginService; + + @Test + public void updateU8CTest(){ + ningboBankPluginService.updateU8CStatus("FK2408060001","001"); + } + @Test + public void fileUploadTest(){ + ningboBankPluginService.fileUpload("-3984312850527925899"); + } + @Test + public void fileUpload() { + try { + JSONObject data = new JSONObject(); + String filePath = "/Users/xiangerlin/Downloads/测试附件.xlsx"; + File file = new File(filePath); + byte[] bytes = IoUtil.readBytes(FileUtil.getInputStream(file)); + JSONObject params = new JSONObject(); + params.put("channelNo","open-filegateway"); + params.put("fileName","测试附件.xlsx"); + params.put("bytes",bytes); + ConfigParam configParam = new ConfigParam("MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgTt6OadouxxxSDg/0SZdOIBqtnFGKrpwmL+quEUf+hfSgCgYIKoEcz1UBgi2hRANCAAQGHNN2NO7btp+w1248yk98E0asGC8sG0bmIzdom4M0xp3vc4IfXjmZ8omUz4oVcjzAuyMSSpJM6uPLcU1SH4HZ","http://cz-test.nbcb.com.cn:7070/nbcb/api","54b3e05c-7983-4e6c-8920-f9ab8a0004a6","MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEXAt6fxeKlpREIyXoT3jDwGU7L6JkKrzdOKP1cMB14rtNwwlyaUGLrtuHVoArAHP3x7XN2rUw0GxSngYQwOAsjQ==",10000,20000); + OpenSDK.dynamicInit(configParam,true); + data.put("Data",JSONObject.toJSONString(params)); + System.out.println("附件上传请求参数:"+data.toString()); + String returnData = OpenSDK.send("tms", "fileUpload",data.toString()); + System.out.println(returnData); + }catch (Exception e){ + e.printStackTrace(); + } + + } @Test public void accDetailTest(){ AccTransactionReq accTransactionReq = new AccTransactionReq(); From eb74a51dbeeab6b413115d66d7bee8d7cb1badf3 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 27 Aug 2024 09:00:48 +0800 Subject: [PATCH 035/101] =?UTF-8?q?@Value("${OA.data=5Fsource=5Fcode:}")?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=202024=E5=B9=B48=E6=9C=8827=E6=97=A509:00:42?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/src/main/java/com/hzya/frame/cbs8/util/CBSUtil.java | 6 +++--- .../main/java/com/hzya/frame/cbs8/util/CbsAccessToken.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/cbs8/util/CBSUtil.java b/service/src/main/java/com/hzya/frame/cbs8/util/CBSUtil.java index 417f41a4..602a9124 100644 --- a/service/src/main/java/com/hzya/frame/cbs8/util/CBSUtil.java +++ b/service/src/main/java/com/hzya/frame/cbs8/util/CBSUtil.java @@ -87,21 +87,21 @@ public class CBSUtil { /** * 财资管理云公钥(平台公钥) */ - @Value("${cbs8.cbs_public_key}") + @Value("${cbs8.cbs_public_key:}") public void setBodyEncryptionKey(String bodyEncryptionKey) { CBSUtil.bodyEncryptionKey = bodyEncryptionKey; } /** * 企业私钥(解密) */ - @Value("${cbs8.ya_private_key}") + @Value("${cbs8.ya_private_key:}") public void setSignEncryptionPrivateKey(String signEncryptionPrivateKey) { CBSUtil.signEncryptionPrivateKey = signEncryptionPrivateKey; } /** * 企业私钥(解密) */ - @Value("${cbs8.ya_private_key}") + @Value("${cbs8.ya_private_key:}") public void setBodyDecryptionKey(String bodyDecryptionKey) { CBSUtil.bodyDecryptionKey = bodyDecryptionKey; } diff --git a/service/src/main/java/com/hzya/frame/cbs8/util/CbsAccessToken.java b/service/src/main/java/com/hzya/frame/cbs8/util/CbsAccessToken.java index 080e58fc..341af450 100644 --- a/service/src/main/java/com/hzya/frame/cbs8/util/CbsAccessToken.java +++ b/service/src/main/java/com/hzya/frame/cbs8/util/CbsAccessToken.java @@ -24,11 +24,11 @@ import java.util.Map; public class CbsAccessToken { private static final Logger logger = LoggerFactory.getLogger(CbsAccessToken.class); - @Value("${cbs8.appId}") + @Value("${cbs8.appId:}") private String app_id; - @Value("${cbs8.appSecret}") + @Value("${cbs8.appSecret:}") private String app_secret; - @Value("${cbs8.url}") + @Value("${cbs8.url:}") private String app_url; private static String appId; From ea44b43c0ef542215a68b7fd1ae2594ef4e4c4de Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 27 Aug 2024 13:57:01 +0800 Subject: [PATCH 036/101] =?UTF-8?q?u8c=E5=AE=A1=E6=89=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=202024=E5=B9=B48=E6=9C=8827=E6=97=A513:56:53?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/NingboBankPluginServiceImpl.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java index 2b3983fd..2b48d5c3 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java @@ -267,7 +267,7 @@ private IFormmain0044Service formmain0044Service; //.put("appId","800036") .put("appId",appId) .build(); - String res = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(header).body(params).timeout(60000).execute().body(); + String res = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(header).body(params).timeout(20000).execute().body(); return res; } @@ -392,17 +392,14 @@ private IFormmain0044Service formmain0044Service; @Override public void updateU8CStatus(String billCode,String dwbm) { if (StrUtil.isNotEmpty(billCode)){ - JSONObject billObj = new JSONObject(); - billObj.put("djbh",billCode); - billObj.put("dwbm",dwbm); - billObj.put("operatedate",DateUtil.today()); - billObj.put("operatorid","yonyou02"); - billObj.put("result","0"); - JSONArray bills = new JSONArray(); - bills.add(billObj); JSONObject param = new JSONObject(); - param.put("bills",bills); - String s = executeEsb(param.toString(), "8000350044","800035"); + param.put("billno",billCode); + param.put("corpcode",dwbm); + param.put("billType","paybill"); + param.put("userCode","yonyou02"); + param.put("ckeckResult","Y"); + param.put("ckeckNote","测试审批"); + String s = executeEsb(param.toString(), "8000350060","800035"); System.out.println("调用U8C付款单审批返回参数"+s); logger.info("调用U8C付款单审批返回参数:{}",s); } From 1b300d0bfa067252436fd232912e10bbc47a6b24 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 27 Aug 2024 13:57:55 +0800 Subject: [PATCH 037/101] =?UTF-8?q?u8c=E5=AE=A1=E6=89=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=202024=E5=B9=B48=E6=9C=8827=E6=97=A513:56:53?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/a8bill/plugin/NingboBankPayPluginInitializer.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayPluginInitializer.java index 1c251e9f..c54e09e8 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/NingboBankPayPluginInitializer.java @@ -32,7 +32,7 @@ public class NingboBankPayPluginInitializer extends PluginBaseEntity { @Autowired private IPayBillPluginInitializerDao payBillDao; - @Value("${OA.data_source_code}") + @Value("${OA.data_source_code:}") private String oa_data_source_code; /*** * 插件初始化方法 @@ -127,7 +127,6 @@ public class NingboBankPayPluginInitializer extends PluginBaseEntity { }else{ sb.append(" and payState is null"); } - PayBillEntity oaBillEntity = new PayBillEntity(); oaBillEntity.setDataSourceCode(oa_data_source_code); StringBuffer stringBuffer = new StringBuffer(); From 1a99b6b4f449e76ce78c2ada61716d0bda5608f2 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 28 Aug 2024 10:58:07 +0800 Subject: [PATCH 038/101] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=B1=BB=202024?= =?UTF-8?q?=E5=B9=B48=E6=9C=8828=E6=97=A510:58:01?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildpackage/src/test/java/com/hzya/frame/temButtom.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/buildpackage/src/test/java/com/hzya/frame/temButtom.java b/buildpackage/src/test/java/com/hzya/frame/temButtom.java index 91b2abcc..1ac76208 100644 --- a/buildpackage/src/test/java/com/hzya/frame/temButtom.java +++ b/buildpackage/src/test/java/com/hzya/frame/temButtom.java @@ -74,7 +74,12 @@ public class temButtom { @Test public void updateU8CTest(){ - ningboBankPluginService.updateU8CStatus("FK2408060001","001"); + try { + ningboBankPluginService.updateU8CStatus("FK2408260001","002"); + }catch (Exception ex){ + ex.printStackTrace(); + } + System.out.println("执行完成"); } @Test public void fileUploadTest(){ From 0d7be1c3ac3ba563dff94c2b9a42681fda4cc832 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 28 Aug 2024 11:57:46 +0800 Subject: [PATCH 039/101] =?UTF-8?q?=E5=AE=A1=E6=89=B9=E6=84=8F=E8=A7=81?= =?UTF-8?q?=E6=94=B9=E6=88=90=E5=AE=A1=E6=89=B9=E9=80=9A=E8=BF=87=202024?= =?UTF-8?q?=E5=B9=B48=E6=9C=8828=E6=97=A511:57:40?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java index 2b48d5c3..13b293ae 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java @@ -398,7 +398,7 @@ private IFormmain0044Service formmain0044Service; param.put("billType","paybill"); param.put("userCode","yonyou02"); param.put("ckeckResult","Y"); - param.put("ckeckNote","测试审批"); + param.put("ckeckNote","审批通过"); String s = executeEsb(param.toString(), "8000350060","800035"); System.out.println("调用U8C付款单审批返回参数"+s); logger.info("调用U8C付款单审批返回参数:{}",s); From 9e54b38c9a2a852fad6d1a8624cf8374eafa77c4 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Wed, 28 Aug 2024 18:26:53 +0800 Subject: [PATCH 040/101] =?UTF-8?q?=E8=BF=94=E5=9B=9Ereturn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comparison/service/impl/ComparisonServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java index 9b4c57ae..72718c51 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java @@ -222,7 +222,7 @@ public class ComparisonServiceImpl extends BaseService List> listDataId = comparisonDao.queryComparisonPage(comparisonDataId); if (CollectionUtils.isNotEmpty(listDataId)) { //return BaseResult.getFailureMessageEntity(comparisonEntity.getDbName()+"表中已经存在data_id为:"+jsonObjectMain.getString("data_id")+"的数据"); - updateEntity(json); + return updateEntity(json); } else { //判断输入的主表字段是否是必填项 for (ComparisonEntity entity : comparisonEntities) { @@ -361,7 +361,7 @@ public class ComparisonServiceImpl extends BaseService } } } - return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); + return BaseResult.getFailureMessageEntity("保存失败","请检查传递参数"); } //更新通用数据数据 @@ -500,7 +500,7 @@ public class ComparisonServiceImpl extends BaseService return BaseResult.getFailureMessageEntity("更新失败"); } } - return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); + return BaseResult.getFailureMessageEntity("更新失败","请检查传递参数"); } private List getFields(ComparisonEntity comparisonEntity) { @@ -612,7 +612,7 @@ public class ComparisonServiceImpl extends BaseService return BaseResult.getFailureMessageEntity("删除失败"); } } - return BaseResult.getFailureMessageEntity("查询失败","请检查传递参数"); + return BaseResult.getFailureMessageEntity("删除失败","请检查传递参数"); } //根据应用key和应用密钥获取应用编码和应用名称 From a1b601a41d4b2131385e8f6b5781457b34c4a777 Mon Sep 17 00:00:00 2001 From: username Date: Thu, 29 Aug 2024 15:08:08 +0800 Subject: [PATCH 041/101] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E9=A2=84=E8=AD=A6=EF=BC=8C=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E9=87=8D=E6=96=B0=E6=8E=A8=E9=80=81=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ISysApplicationService.java | 3 + .../impl/SysApplicationServiceImpl.java | 523 ++++++++++++++++++ .../controler/EntranceController.java | 9 + 3 files changed, 535 insertions(+) diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java b/service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java index c468ffe1..25ec9090 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/service/ISysApplicationService.java +++ b/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.messageManageLog.entity.SysMessageManageLogEntity; import com.hzya.frame.web.entity.JsonResultEntity; import javax.servlet.ServletRequest; @@ -308,6 +309,8 @@ public interface ISysApplicationService extends IBaseService oldheaderMap = new HashMap<>(); + Iterator it = headerObject.entrySet().iterator(); + while (it.hasNext()) { + Map.Entry entry = (Map.Entry) it.next(); + oldheaderMap.put(entry.getKey(), entry.getValue()); + } + + String oldId = resendLogEntity.getId(); + String oldbodys = bodyObject.toString(); + String oldquerys = ""; + //应用key + String publicKey = headerObject.getString("publickey"); + //应用密钥 + String secretKey = headerObject.getString("secretkey"); + //appId + String appId = headerObject.getString("appid"); + //apiCode + String apiCode = headerObject.getString("apicode"); + String ip = headerObject.getString("x-real-ip"); + 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) { + //saveLog(new SysApplicationEntity(), new SysApplicationEntity(), new SysApplicationApiEntity(), oldbodys, null, oldheaderMap, null, null, oldquerys, null, null, false,"公钥、密钥错误"); + return BaseResult.getFailureMessageEntity("公钥、密钥错误,请联系管理员"); + } + //判断应用是否启用 + if (sendApp.getAppStatus() == null || !"1".equals(sendApp.getAppStatus())) { + return BaseResult.getFailureMessageEntity(sendApp.getName() + "应用未启用,请联系管理员"); + } + + SysApplicationEntity receiveApp = getAppByAppId(appId); + if (receiveApp == null) { + return BaseResult.getFailureMessageEntity("根据appId:" + appId + "未匹配到应用,请联系管理员"); + } + //判断应用是否启用 + if (receiveApp.getAppStatus() == null || !"1".equals(receiveApp.getAppStatus())) { + return BaseResult.getFailureMessageEntity(receiveApp.getName() + "应用未启用,请联系管理员"); + } + //判断应用接口是否启用 + if (receiveApp.getInterfaceStatus() == null || !"1".equals(receiveApp.getInterfaceStatus())) { + return BaseResult.getFailureMessageEntity(receiveApp.getName() + "应用接口环境未启用,请联系管理员"); + } + + SysApplicationApiEntity receiveApi = getApiByAppIdApiCode(receiveApp.getId(), apiCode); + if (receiveApi == null) { + return BaseResult.getFailureMessageEntity(receiveApp.getName() + ":" + apiCode + "未启用或者未创建"); + } + + SysApplicationApiAuthEntity sysApplicationApiAuthEntity = getApiAuthByNameAppId(sendApp.getId(), receiveApp.getId()); + if (sysApplicationApiAuthEntity == null) { + return BaseResult.getFailureMessageEntity(receiveApp.getName() + "应用权限配置错误"); + } + if (sysApplicationApiAuthEntity.getSystemAddress() != null && !"".equals(sysApplicationApiAuthEntity.getSystemAddress()) + && !sysApplicationApiAuthEntity.getSystemAddress().contains(ip)) { + return BaseResult.getFailureMessageEntity(receiveApp.getName() + "发送应用" + receiveApp.getName() + "的ip白名单配置错误"); + } + + SysApplicationApiAuthDetailEntity sysApplicationApiAuthDetailEntity = getApiAuthDetailByAppIdApiIdTripartiteSystemId(receiveApp.getId(), receiveApi.getId(), sysApplicationApiAuthEntity.getId()); + if (sysApplicationApiAuthDetailEntity == null) { + 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"; + } + //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 (headerMap != null && headerMap.size() > 0) { + // for (Map.Entry entry : headerMap.entrySet()) { + // if (!a.contains(entry.getKey())) { + // headers.put(entry.getKey(), entry.getValue()); + // } + // } + //} + + + if ("POST".equals(method)) { + HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); + // HttpClient + CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build(); + HttpPost post = new HttpPost(url.toString()); + CloseableHttpResponse response = null; + + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(outTime).build(); + post.setConfig(requestConfig);//设置请求参数【超时时间】 + + if (headers != null && headers.size() > 0) { + for (String key : headers.keySet()) { + post.setHeader(key, headers.get(key)); + } + } + StringBuilder body = new StringBuilder(); + boolean flag = true; + try { + if (bodys != null && !"".equals(bodys)) { + ByteArrayEntity entity = new ByteArrayEntity(bodys.getBytes("UTF-8")); + entity.setContentType("application/json"); + post.setEntity(entity); + } + response = closeableHttpClient.execute(post); + + 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("保存日志开始"); + //重写saveLog方法,利用他原有逻辑判断重推结果,根据重推结果,设置该条日志的状态 + SysMessageManageLogEntity sysMessageManageLogEntity = updateLog(sendApp, receiveApp, receiveApi, oldbodys,bodys, oldheaderMap,headers, headers, oldquerys,querys, body.toString(),true,null,oldId); + 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 { + return BaseResult.getSuccessMessageEntity("重推失败", jsonObject); + } + } else { + if(sysMessageManageLogEntity.getStatus() != null && "3".equals(sysMessageManageLogEntity.getStatus())){ + return BaseResult.getSuccessMessageEntity("重推成功", body); + }else { + return BaseResult.getSuccessMessageEntity("重推失败", body); + } + } + } else { + return BaseResult.getSuccessMessageEntity("重推失败", 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 = updateLog(sendApp, receiveApp, receiveApi, oldbodys,bodys, oldheaderMap,headers, headers, oldquerys,querys, body.toString(), true,null,oldId); + 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 { + return BaseResult.getSuccessMessageEntity("重推失败", jsonObject); + } + } else { + if(sysMessageManageLogEntity.getStatus() != null && "3".equals(sysMessageManageLogEntity.getStatus())){ + return BaseResult.getSuccessMessageEntity("重推成功", body); + }else { + return BaseResult.getSuccessMessageEntity("重推失败", body); + } + } + } else { + return BaseResult.getSuccessMessageEntity("重推失败", body); + } + } + } + private SysApplicationApiAuthDetailEntity getApiAuthDetailByAppIdApiIdTripartiteSystemId(String appId, String apiId, String tripartiteSystemId) { String str = "appId" + appId + "apiId" + apiId + "tripartiteSystemId" + tripartiteSystemId; Object o = applicationCache.get("4", str); @@ -2276,6 +2641,161 @@ public class SysApplicationServiceImpl extends BaseService oldheaderMap,Map headerMap, + Map headers, + String oldquerys, String querys, + String body, boolean flag,String msg,String oldId) { + SysMessageManageLogEntity sysMessageManageLogEntity = new SysMessageManageLogEntity(); + //messageManageId 消息主表主键 + //theme 消息主题 + //messageCode 消息编码 + //sendApp + sysMessageManageLogEntity.setSendApp(sendApp.getId());//发送者应用 + //sendApi 发送者 + sysMessageManageLogEntity.setReceiveCode(receiveApi.getApiCode() != null ? receiveApi.getApiCode().toString() : null);//接收者编码 + sysMessageManageLogEntity.setReceiveApp(receiveApp.getId());//接收者应用 + sysMessageManageLogEntity.setReceiveApi(receiveApi.getId());//接收者 + JSONObject jsonObject = new JSONObject(); + jsonObject.put("body", oldbodys); + jsonObject.put("header", oldheaderMap); + jsonObject.put("querys", oldquerys); + sysMessageManageLogEntity.setSourceData(jsonObject.toString());//源数据 + JSONObject send = new JSONObject(); + send.put("body", bodys); + send.put("header", headers); + send.put("querys", querys); + sysMessageManageLogEntity.setTargetData(send.toString());//目标data + if(receiveApp.getAppType() != null && "4".equals(receiveApp.getAppType())){//宁波银行 + JSONObject jsonObject1 = JSONObject.parseObject(body); + String retCode = jsonObject1.getString("retCode"); + if(retCode != null && "0000".equals(retCode)){ + JSONObject jsonObject2 = JSONObject.parseObject(jsonObject1.getString("data")); + String fileBytes = jsonObject2.getString("fileBytes"); + if(fileBytes != null && !"".equals(fileBytes)){ + jsonObject2.put("fileBytes",""); + jsonObject1.put("data",jsonObject2); + sysMessageManageLogEntity.setReturnData(jsonObject1.toJSONString());//返回信息 + }else { + sysMessageManageLogEntity.setReturnData(body);//返回信息 + } + }else { + sysMessageManageLogEntity.setReturnData(body);//返回信息 + } + }else { + sysMessageManageLogEntity.setReturnData(body);//返回信息 + } + + + //校验返回 + if (!flag) { + sysMessageManageLogEntity.setStatus("4");//返回信息 + sysMessageManageLogEntity.setRemark(msg);//返回信息 + } else { + if (receiveApi.getReturnSuccessField() != null && !"".equals(receiveApi.getReturnSuccessField()) + && receiveApi.getReturnSuccessValue() != null && !"".equals(receiveApi.getReturnSuccessValue())) { + if (JSONUtil.isTypeJSON(body)) { + JSONObject cheackdatas = JSONObject.parseObject(body); + JSONObject datas = JSONObject.parseObject(body); + String checkdata = cheackdatas.getString(receiveApi.getReturnSuccessField()); + if (checkdata != null && receiveApi.getReturnSuccessValue().equals(checkdata)) { + sysMessageManageLogEntity.setStatus("3");//返回信息 + if (receiveApi.getReturnMsg() != null && !"".equals(receiveApi.getReturnMsg())) { + String returnMsg = cheackdatas.getString(receiveApi.getReturnMsg()); + sysMessageManageLogEntity.setRemark("接口调用成功,返回信息如下:" + returnMsg);//返回信息 + } else { + sysMessageManageLogEntity.setRemark("接口调用成功");//返回信息 + } + }else if(receiveApi.getReturnSuccessValue().equals("not null") && checkdata != null){ + sysMessageManageLogEntity.setStatus("3");//返回信息 + if (receiveApi.getReturnMsg() != null && !"".equals(receiveApi.getReturnMsg())) { + String returnMsg = cheackdatas.getString(receiveApi.getReturnMsg()); + sysMessageManageLogEntity.setRemark("接口调用成功,返回信息如下:" + returnMsg);//返回信息 + } else { + sysMessageManageLogEntity.setRemark("接口调用成功");//返回信息 + } + }else { + String fieldname = receiveApi.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 && receiveApi.getReturnSuccessValue().equals(a)) { + flags = true; + break; + }else if(receiveApi.getReturnSuccessValue().equals("not null") && a != null){ + flags = true; + break; + }else { + break; + } + } + } + } + if(flags){ + sysMessageManageLogEntity.setStatus("3");//返回信息 + if (receiveApi.getReturnMsg() != null && !"".equals(receiveApi.getReturnMsg())) { + String returnMsg = cheackdatas.getString(receiveApi.getReturnMsg()); + sysMessageManageLogEntity.setRemark("接口调用成功,返回信息如下:" + returnMsg);//返回信息 + } else { + sysMessageManageLogEntity.setRemark("接口调用成功");//返回信息 + } + }else { + sysMessageManageLogEntity.setStatus("4");//返回信息 + if (receiveApi.getReturnMsg() != null && !"".equals(receiveApi.getReturnMsg())) { + String returnMsg = cheackdatas.getString(receiveApi.getReturnMsg()); + sysMessageManageLogEntity.setRemark("接口调用失败,返回值错误,返回信息如下:" + returnMsg);//返回信息 + } else { + sysMessageManageLogEntity.setRemark("接口调用失败,返回值错误");//返回信息 + } + } + + }else { + sysMessageManageLogEntity.setStatus("4");//返回信息 + if (receiveApi.getReturnMsg() != null && !"".equals(receiveApi.getReturnMsg())) { + String returnMsg = cheackdatas.getString(receiveApi.getReturnMsg()); + sysMessageManageLogEntity.setRemark("接口调用失败,返回值错误,返回信息如下:" + returnMsg);//返回信息 + } else { + sysMessageManageLogEntity.setRemark("接口调用失败,返回值错误");//返回信息 + } + } + } + } else { + sysMessageManageLogEntity.setStatus("4");//返回信息 + sysMessageManageLogEntity.setRemark("接口调用失败,返回格式错误,不是JSON");//返回信息 + } + } else { + sysMessageManageLogEntity.setStatus("4");//返回信息 + if (receiveApi.getReturnMsg() != null && !"".equals(receiveApi.getReturnMsg())) { + if (JSONUtil.isTypeJSON(body)) { + JSONObject cheackdatas = JSONObject.parseObject(body); + String checkdata = cheackdatas.getString(receiveApi.getReturnMsg()); + sysMessageManageLogEntity.setRemark("接口调用失败,api返回信息字段未配置,返回信息如下:" + checkdata);//返回信息 + } else { + sysMessageManageLogEntity.setRemark("接口调用失败,返回格式错误,不是JSON");//返回信息 + } + } else { + sysMessageManageLogEntity.setRemark("接口调用失败");//返回信息 + } + } + } + //remark 备注 + sysMessageManageLogEntity.setErrorStatus("2");//返回信息 + sysMessageManageLogEntity.setId(oldId); + sysMessageManageLogEntity.setCreate_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); + sysMessageManageLogEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); + //sysMessageManageLogEntity.setCreate_time(new Date()); + sysMessageManageLogEntity.setModify_time(new Date()); + sysMessageManageLogEntity.setSts("Y"); + taskExecutor.execute(() -> doEsbTaskNew(sysMessageManageLogEntity)); + return sysMessageManageLogEntity; + } + /** * @param manageLogEntities * @return void @@ -2286,6 +2806,9 @@ public class SysApplicationServiceImpl extends BaseService Date: Thu, 22 Aug 2024 09:37:08 +0800 Subject: [PATCH 042/101] =?UTF-8?q?XEL=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?=202024=E5=B9=B48=E6=9C=8822=E6=97=A509:37:00?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildpackage/src/main/resources/application-xel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildpackage/src/main/resources/application-xel.yml b/buildpackage/src/main/resources/application-xel.yml index 4802ae21..e53ca4c4 100644 --- a/buildpackage/src/main/resources/application-xel.yml +++ b/buildpackage/src/main/resources/application-xel.yml @@ -6,7 +6,7 @@ logging: encodings: UTF-8 file: # 日志保存路径 - path: /Users/xiangerlin/work/app/logs/ydc + path: /Users/xiangerlin/work/app/logs/dev spring: datasource: dynamic: @@ -18,7 +18,7 @@ spring: driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 savefile: # 文件保存路径 - path: /Users/xiangerlin/work/app/logs/ydc + path: /Users/xiangerlin/work/app/file/dev cbs8: appId: 1P4AGrpz appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a From f5b69825dc164c8c7d66b8f0b9148849138450b0 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Mon, 26 Aug 2024 10:10:36 +0800 Subject: [PATCH 043/101] =?UTF-8?q?@Value=E6=B3=A8=E8=A7=A3=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=BF=AE=E6=94=B9=202024=E5=B9=B48=E6=9C=8826?= =?UTF-8?q?=E6=97=A510:10:06?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/cbs8/service/impl/CbsPluginServiceImpl.java | 4 ++-- service/src/main/java/com/hzya/frame/cbs8/util/CBSUtil.java | 6 +++--- .../main/java/com/hzya/frame/cbs8/util/CbsAccessToken.java | 6 +++--- .../nxproof/oerdjml/service/impl/OerDjmlExtServiceImpl.java | 2 +- .../frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/service/impl/CbsPluginServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/service/impl/CbsPluginServiceImpl.java index f560a661..854a9191 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/service/impl/CbsPluginServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/service/impl/CbsPluginServiceImpl.java @@ -66,9 +66,9 @@ public class CbsPluginServiceImpl implements ICbsPluginService { @Autowired private RestUtil restUtil; - @Value("${cbs8.elec_path}") + @Value("${cbs8.elec_path:}") private String elec_path; - @Value("${OA.data_source_code}") + @Value("${OA.data_source_code:}") private String oa_data_source_code; /** * 支付申请 diff --git a/service/src/main/java/com/hzya/frame/cbs8/util/CBSUtil.java b/service/src/main/java/com/hzya/frame/cbs8/util/CBSUtil.java index 417f41a4..602a9124 100644 --- a/service/src/main/java/com/hzya/frame/cbs8/util/CBSUtil.java +++ b/service/src/main/java/com/hzya/frame/cbs8/util/CBSUtil.java @@ -87,21 +87,21 @@ public class CBSUtil { /** * 财资管理云公钥(平台公钥) */ - @Value("${cbs8.cbs_public_key}") + @Value("${cbs8.cbs_public_key:}") public void setBodyEncryptionKey(String bodyEncryptionKey) { CBSUtil.bodyEncryptionKey = bodyEncryptionKey; } /** * 企业私钥(解密) */ - @Value("${cbs8.ya_private_key}") + @Value("${cbs8.ya_private_key:}") public void setSignEncryptionPrivateKey(String signEncryptionPrivateKey) { CBSUtil.signEncryptionPrivateKey = signEncryptionPrivateKey; } /** * 企业私钥(解密) */ - @Value("${cbs8.ya_private_key}") + @Value("${cbs8.ya_private_key:}") public void setBodyDecryptionKey(String bodyDecryptionKey) { CBSUtil.bodyDecryptionKey = bodyDecryptionKey; } diff --git a/service/src/main/java/com/hzya/frame/cbs8/util/CbsAccessToken.java b/service/src/main/java/com/hzya/frame/cbs8/util/CbsAccessToken.java index 080e58fc..341af450 100644 --- a/service/src/main/java/com/hzya/frame/cbs8/util/CbsAccessToken.java +++ b/service/src/main/java/com/hzya/frame/cbs8/util/CbsAccessToken.java @@ -24,11 +24,11 @@ import java.util.Map; public class CbsAccessToken { private static final Logger logger = LoggerFactory.getLogger(CbsAccessToken.class); - @Value("${cbs8.appId}") + @Value("${cbs8.appId:}") private String app_id; - @Value("${cbs8.appSecret}") + @Value("${cbs8.appSecret:}") private String app_secret; - @Value("${cbs8.url}") + @Value("${cbs8.url:}") private String app_url; private static String appId; diff --git a/service/src/main/java/com/hzya/frame/grpU8/nxproof/oerdjml/service/impl/OerDjmlExtServiceImpl.java b/service/src/main/java/com/hzya/frame/grpU8/nxproof/oerdjml/service/impl/OerDjmlExtServiceImpl.java index d8d4b2c7..78d409be 100644 --- a/service/src/main/java/com/hzya/frame/grpU8/nxproof/oerdjml/service/impl/OerDjmlExtServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/grpU8/nxproof/oerdjml/service/impl/OerDjmlExtServiceImpl.java @@ -49,7 +49,7 @@ public class OerDjmlExtServiceImpl implements IOerDjmlExtService { Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private RestUtil restUtil; - @Value("${savefile.path}") + @Value("${savefile.path:}") public String DSK; @Autowired private ISysApplicationDatabaseService sysApplicationDatabaseService; diff --git a/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java index bb2df76f..a99744cf 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java @@ -39,7 +39,7 @@ public class CbsLogServiceImpl extends BaseService implemen Logger log = LoggerFactory.getLogger(getClass()); private ICbsLogDao cbsLogDao; - @Value("${OA.data_source_code}") + @Value("${OA.data_source_code:}") private String oa_data_source_code; @Autowired public void setCbsLogDao(ICbsLogDao cbsLogDao) { From 96cb15eeffc08ed40dfa59c8177d215d2e6861d8 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Tue, 3 Sep 2024 09:10:43 +0800 Subject: [PATCH 044/101] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E4=B8=BA=E7=BB=84=E7=BB=87=E6=A0=91=E6=97=B6=E5=80=99=EF=BC=8C?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E5=92=8C=E6=96=B0=E5=A2=9E=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=A0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comparison/entity/ComparisonEntity.java | 21 ++++ .../service/impl/ComparisonServiceImpl.java | 114 +++++++++++++++++- 2 files changed, 129 insertions(+), 6 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java index 117880b0..147d6867 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java @@ -52,6 +52,27 @@ public class ComparisonEntity extends BaseEntity { private List fields; private List returnField; + /** 显示类型 1、树2、列表*/ + private String viewName; + //下级结构树 + private List comparisonEntities; + + public List getComparisonEntities() { + return comparisonEntities; + } + + public void setComparisonEntities(List comparisonEntities) { + this.comparisonEntities = comparisonEntities; + } + + public String getViewName() { + return viewName; + } + + public void setViewName(String viewName) { + this.viewName = viewName; + } + public List getReturnField() { return returnField; } diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java index 72718c51..a4948dd0 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java @@ -3,13 +3,14 @@ package com.hzya.frame.sysnew.comparison.service.impl; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.baomidou.dynamic.datasource.annotation.DS; import com.github.pagehelper.PageInfo; import com.hzya.frame.basedao.service.impl.BaseService; import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao; import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; +import com.hzya.frame.mdm.mdmModuleView.dao.IMdmModuleViewDao; +import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity; import com.hzya.frame.mdm.service.impl.MdmServiceCache; import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; @@ -20,15 +21,10 @@ import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity; import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; import com.hzya.frame.sysnew.comparison.service.IComparisonService; import com.hzya.frame.uuid.UUIDLong; -import com.hzya.frame.uuid.UUIDUtils; -import com.hzya.frame.web.entity.BaseEntity; import com.hzya.frame.web.entity.BaseResult; -import com.hzya.frame.web.entity.JsonResultEntity; import org.apache.commons.collections.CollectionUtils; -import org.apache.ivy.Main; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import sun.java2d.pipe.AAShapePipe; import java.util.*; import java.util.stream.Collectors; @@ -49,6 +45,9 @@ public class ComparisonServiceImpl extends BaseService @Autowired private MdmServiceCache mdmServiceCache; + @Autowired + private IMdmModuleViewDao mdmModuleViewDao; + @Autowired public void setGeneralDataDao(IComparisonDao dao) { this.comparisonDao = dao; @@ -105,6 +104,12 @@ public class ComparisonServiceImpl extends BaseService comparisonEntity.setFields(fields); //查询主表数据 List> comparisonEntitiePages = comparisonDao.queryComparisonPage(comparisonEntity); + + //递归查询组织树 + if(comparisonEntities.get(0).getViewName().equals("1")){ + return recursiveQueryComparison(comparisonEntitiePages,comparisonEntity); + } + if(CollectionUtils.isNotEmpty(comparisonEntitiePages)){ for (Map comparisonEntitiePage : comparisonEntitiePages) { JSONObject jsonObjects=new JSONObject(); @@ -224,6 +229,23 @@ public class ComparisonServiceImpl extends BaseService //return BaseResult.getFailureMessageEntity(comparisonEntity.getDbName()+"表中已经存在data_id为:"+jsonObjectMain.getString("data_id")+"的数据"); return updateEntity(json); } else { + + //如果是树形结构,查询不存在,新增时候需要得到parent_id,根据parent_id查询data_id是否有,之后将查询得父id设置到mdm_up_id中 + if(comparisonEntities.get(0).getViewName().equals("1")){ + List fieldParent = getFields(comparisonEntity); + Map mapParentId = new HashMap<>(); + mapDataId.put("data_id", jsonObjectMain.getString("parent_id")); + ComparisonEntity comparisonParentId = new ComparisonEntity(); + comparisonParentId.setMap(mapParentId); + comparisonParentId.setDbName(comparisonEntity.getDbName()); + comparisonParentId.setFields(fieldParent); + List> listParentId = comparisonDao.queryComparisonPage(comparisonDataId); + //如果根据parentid查询数据不为空,将dataid为parenti得id值设置到mdm_up_id中 + if(CollectionUtils.isNotEmpty(listParentId)){ + map.put("mdm_up_id",listParentId.get(0).get("id")); + } + } + //判断输入的主表字段是否是必填项 for (ComparisonEntity entity : comparisonEntities) { //如果必填字段不为空 @@ -440,6 +462,22 @@ public class ComparisonServiceImpl extends BaseService if(CollectionUtils.isEmpty(comparisonEntitiePages)){ return BaseResult.getFailureMessageEntity("根据data_id查询id数据为空,请检查data_id"); } + + //判断是否是树形结构 + if(comparisonEntities.get(0).getViewName().equals("1")){ + //根据data_id查询出parent_id,再根据parent_id得值查询data_id字段中为这个得值,如果有,将data_id为parent_id得id值保存到mdm_up_id中 + Map mapParent=new HashMap<>(); + mapParent.put("data_id",comparisonEntitiePages.get(0).get("parent_id")); + ComparisonEntity comparisonParent=new ComparisonEntity(); + comparisonParent.setDbName(comparisonEntity.getDbName()); + comparisonParent.setMap(mapId); + comparisonParent.setFields(fields); + List> comparisonEntitieParent = comparisonDao.queryComparisonPage(comparisonParent); + if(!CollectionUtils.isEmpty(comparisonEntitieParent)){ + map.put("mdm_up_id",comparisonEntitieParent.get(0).get("id")); + } + } + String id = String.valueOf(comparisonEntitiePages.get(0).get("id")); map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); @@ -583,6 +621,12 @@ public class ComparisonServiceImpl extends BaseService if(CollectionUtils.isEmpty(comparisonEntitiePages)){ return BaseResult.getFailureMessageEntity("根据data_id查询id数据为空,请检查data_id"); } + + //递归删除树结构 1.树 2.列表 + if(comparisonEntities.get(0).getViewName().equals("1")){ + return recursiveDeleteComparison(comparisonEntitiePages,comparisonEntity); + } + String id = String.valueOf(comparisonEntitiePages.get(0).get("id")); map.remove("id"); @@ -615,6 +659,58 @@ public class ComparisonServiceImpl extends BaseService return BaseResult.getFailureMessageEntity("删除失败","请检查传递参数"); } + //递归删除组织树 + private Object recursiveDeleteComparison(List> list,ComparisonEntity comparisonEntity){ + for(int i=0;i fields = getFields(comparisonEntity); + Map mapId=new HashMap<>(); + mapId.put("mdm_up_id",list.get(0).get("id")); + ComparisonEntity comparison=new ComparisonEntity(); + comparison.setDbName(comparisonEntity.getDbName()); + comparison.setMap(mapId); + comparison.setFields(fields); + List> comparisonEntitiePages = comparisonDao.queryComparisonPage(comparison); + if(CollectionUtils.isNotEmpty(comparisonEntitiePages)){ + recursiveDeleteComparison(comparisonEntitiePages,comparisonEntity); + } + comparisonEntity.setId(String.valueOf(list.get(0).get("id"))); + Integer integer = comparisonDao.deleteComparison(comparisonEntity); + JSONObject json1 = new JSONObject(); + json1.put("status","200"); + json1.put("integer",integer); + return json1; + } + return null; + } + + //递归查询组织树 + private Object recursiveQueryComparison(List> list,ComparisonEntity comparisonEntity){ + if(CollectionUtils.isNotEmpty(list)) { + for (int i = 0; i < list.size(); i++) { + List fields = getFields(comparisonEntity); + Map mapId=new HashMap<>(); + mapId.put("mdm_up_id",list.get(0).get("id")); + ComparisonEntity comparison=new ComparisonEntity(); + comparison.setDbName(comparisonEntity.getDbName()); + comparison.setMap(mapId); + comparison.setFields(fields); + List> comparisonEntitiePages = comparisonDao.queryComparisonPage(comparison); + if(CollectionUtils.isNotEmpty(comparisonEntitiePages)){ + recursiveQueryComparison(comparisonEntitiePages,comparisonEntity); + for (Map map : list) { + map.put("comparisonEntities",comparisonEntitiePages); + } + } + PageInfo pageInfo = new PageInfo(list); + JSONObject json1=new JSONObject(); + json1.put("status","200"); + json1.put("pageInfo",pageInfo); + return json1; + } + } + return null; + } + //根据应用key和应用密钥获取应用编码和应用名称 @Override public SysExtensionApiEntity getAppNameAndCode(SysExtensionApiEntity sysExtensionApiEntity) { @@ -704,6 +800,11 @@ public class ComparisonServiceImpl extends BaseService comparisonEntity.setmId(mdmModuleEntity.getId()); List comparisonEntitiesFieldRule = comparisonDao.queryComparisonBymdmIdDbIdFiledId(comparisonEntity); + //根据mdm_module得id判断是树结构还是列表结构 + MdmModuleViewEntity mdmModuleViewEntity=new MdmModuleViewEntity(); + mdmModuleViewEntity.setMdmId(mdmModuleEntity.getId()); + List mdmModuleViewEntities = mdmModuleViewDao.query(mdmModuleViewEntity); + //根据mdm_id查询mdm_module_db的信息 MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); @@ -736,6 +837,7 @@ public class ComparisonServiceImpl extends BaseService comparisonEntityFile.setmId(mdmModuleEntity.getId()); comparisonEntityFile.setMdmName(mdmModuleEntity.getMdmName()); comparisonEntityFile.setMdmCode(String.valueOf(mdmModuleEntity.getMdmCode())); + comparisonEntityFile.setViewName(CollectionUtils.isNotEmpty(mdmModuleViewEntities)?mdmModuleViewEntities.get(0).getViewName():null); if(CollectionUtils.isNotEmpty(comparisonEntitiesFieldRule)){ for (ComparisonEntity entity : comparisonEntitiesFieldRule) { if(entity.getEnName().equals(moduleDbFiledsEntity.getEnName()) && entity.getDbType().equals(moduleDbEntity.getDbType())){ From a068e1a434868375b57efd2dbc323c9ae44b5cfe Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Wed, 4 Sep 2024 09:37:11 +0800 Subject: [PATCH 045/101] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BD=AC=E5=8F=91?= =?UTF-8?q?=E7=9A=84=E6=97=A5=E5=BF=97=E8=AF=B7=E6=B1=82=E7=BA=A7=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/entrance/service/impl/EntranceServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java b/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java index 46af2a3c..e99454da 100644 --- a/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java +++ b/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java @@ -183,10 +183,10 @@ public class EntranceServiceImpl implements IEntranceService { Method[] methods = object.getClass().getMethods(); logger.info("methodsLength:" + methods.length); if (methods == null || methods.length == 0) { - logger.info("当前methods:" + methods + "methodsLength = " + methods.length); + logger.error("当前methods:" + methods + "methodsLength = " + methods.length); throw new BaseSystemException(service + "未找到" + serviceMethod + "方法"); } else { - logger.info("当前methods222222:" + methods + "methodsLength = " + methods.length); + logger.info("当前methods:" + methods + "methodsLength = " + methods.length); } for (Method m : methods) { //logger.info("当前mnAME:" + m.getName() + " :serviceMethod = " + serviceMethod.trim()); @@ -271,10 +271,10 @@ public class EntranceServiceImpl implements IEntranceService { Method[] methods = object.getClass().getMethods(); logger.info("methodsLength:" + methods.length); if (methods == null || methods.length == 0) { - logger.info("当前methods:" + methods + "methodsLength = " + methods.length); + logger.error("当前methods:" + methods + "methodsLength = " + methods.length); return BaseResult.getFailureMessageEntity(service + "未找到" + serviceMethod + "方法"); } else { - logger.error("当前methods2:" + methods + "methodsLength = " + methods.length); + logger.info("当前methods:" + methods + "methodsLength = " + methods.length); } for (Method m : methods) { //logger.info("当前mnAME:" + m.getName() + " :serviceMethod = " + serviceMethod.trim()); From 798dfbd3f1b7ce06ed0a981226b9ff82bc232d94 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 4 Sep 2024 14:19:36 +0800 Subject: [PATCH 046/101] =?UTF-8?q?=E5=A2=9E=E5=8A=A0mdm=5Fup=5Fid=20?= =?UTF-8?q?=E9=80=9A=E7=94=A8=E6=8E=A5=E5=8F=A3=E4=BF=9D=E5=AD=98=E6=A0=91?= =?UTF-8?q?=E5=BD=A2=E7=BB=93=E6=9E=84=E6=95=B0=E6=8D=AE=E6=97=B6=E8=A6=81?= =?UTF-8?q?=E7=94=A8=E8=BF=99=E4=B8=AA=E5=AD=97=E6=AE=B5=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E4=B8=8A=E4=B8=8B=E7=BA=A7=E5=85=B3=E7=B3=BB=202024=E5=B9=B49?= =?UTF-8?q?=E6=9C=884=E6=97=A514:19:30?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml index 4c3d4b73..ae5903a8 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml @@ -346,6 +346,7 @@ where id = #{id} `org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID', `company_id` varchar(50) DEFAULT NULL COMMENT '公司id', `data_id` varchar(100) DEFAULT NULL COMMENT 'data_id', + `mdm_up_id` varchar(100) DEFAULT NULL COMMENT 'mdm_up_id', `id` varchar(50) NOT NULL COMMENT '唯一标识码', From ad23819b59eefa35aeef5b8f95d28b12182b4b02 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 4 Sep 2024 14:21:33 +0800 Subject: [PATCH 047/101] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=B1=BB=202024?= =?UTF-8?q?=E5=B9=B49=E6=9C=884=E6=97=A514:21:28?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildpackage/src/test/java/com/hzya/frame/temButtom.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildpackage/src/test/java/com/hzya/frame/temButtom.java b/buildpackage/src/test/java/com/hzya/frame/temButtom.java index 0285be5d..a711e11c 100644 --- a/buildpackage/src/test/java/com/hzya/frame/temButtom.java +++ b/buildpackage/src/test/java/com/hzya/frame/temButtom.java @@ -66,6 +66,8 @@ public class temButtom { @Autowired private PayResultPluginInitializer payResultPluginInitializer; + + @Test public void cbs8PluginTest(){ try { From a3da542b5683c924679cf60d6e9818554e143063 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Wed, 4 Sep 2024 16:16:35 +0800 Subject: [PATCH 048/101] =?UTF-8?q?u8c=E5=B0=81=E8=A3=85=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Encapsulation/dao/IEncapsulationDao.java | 19 + .../dao/impl/EncapsulationDaoImpl.java | 32 + .../entity/EncapsulationEntity.java | 33 + .../entity/EncapsulationEntity.xml | 16 + .../service/IEncapsulationService.java | 95 +++ .../service/impl/EncapsulationImpl.java | 587 ++++++++++++++++++ 6 files changed, 782 insertions(+) create mode 100644 service/src/main/java/com/hzya/frame/u8c/Encapsulation/dao/IEncapsulationDao.java create mode 100644 service/src/main/java/com/hzya/frame/u8c/Encapsulation/dao/impl/EncapsulationDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.java create mode 100644 service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/IEncapsulationService.java create mode 100644 service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java diff --git a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/dao/IEncapsulationDao.java b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/dao/IEncapsulationDao.java new file mode 100644 index 00000000..77f0a933 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/dao/IEncapsulationDao.java @@ -0,0 +1,19 @@ +package com.hzya.frame.u8c.Encapsulation.dao; + + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.u8c.Encapsulation.entity.EncapsulationEntity; + +import java.util.List; + +/** + * (bd_corp: table)表数据库访问层 + * + * @author makejava + * @since 2023-09-06 14:47:17 + */ +public interface IEncapsulationDao extends IBaseDao { + + List queryCgrkddh(EncapsulationEntity encapsulationEntity); +} + diff --git a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/dao/impl/EncapsulationDaoImpl.java b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/dao/impl/EncapsulationDaoImpl.java new file mode 100644 index 00000000..eff12797 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/dao/impl/EncapsulationDaoImpl.java @@ -0,0 +1,32 @@ +package com.hzya.frame.u8c.Encapsulation.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.grpU8.dictAcctSubj.entity.DictAcctSubjEntity; +import com.hzya.frame.grpU8.dictAcctSubj.entity.DictAcctSubjEntityVo; +import com.hzya.frame.u8c.Encapsulation.dao.IEncapsulationDao; +import com.hzya.frame.u8c.Encapsulation.entity.EncapsulationEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + + +/** + * (BdCorp)表数据库访问层 + * + * @author makejava + * @since 2023-09-06 14:47:17 + */ +@Repository("encapsulationDaoImpl") +public class EncapsulationDaoImpl extends MybatisGenericDao implements IEncapsulationDao { + + @DS("#entity.dataSourceCode") + @Override + public List queryCgrkddh(EncapsulationEntity entity) { + List o = (List) super.selectList(getSqlIdPrifx() + "queryCgrkddh", entity); + return o; + } + + +} + diff --git a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.java b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.java new file mode 100644 index 00000000..98b01fb5 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.java @@ -0,0 +1,33 @@ +package com.hzya.frame.u8c.Encapsulation.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * (BdCorp)实体类 + * + * @author makejava + * @since 2023-09-06 14:47:18 + */ +public class EncapsulationEntity extends BaseEntity { + //单据号 + private String code; + //单据类型 + private String type; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } +} + diff --git a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml new file mode 100644 index 00000000..f911f81e --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml @@ -0,0 +1,16 @@ + + + + + + + diff --git a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/IEncapsulationService.java b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/IEncapsulationService.java new file mode 100644 index 00000000..ab1e0f09 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/IEncapsulationService.java @@ -0,0 +1,95 @@ +package com.hzya.frame.u8c.Encapsulation.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.u8c.Encapsulation.entity.EncapsulationEntity; + +/** + * (BdCorp)表服务接口 + * + * @author makejava + * @since 2023-09-06 14:47:18 + */ +public interface IEncapsulationService extends IBaseService { + /** + * @Author lvleigang + * @Description 采购订单删除接口 + * 0、根据采购订单号查询入库单号,1、库存采购入库单取消签字,2、库存采购入库单删除,3、采购订单弃审,4、采购订单删除 + * @Date 9:44 上午 2024/9/4 + * @param jsonObject + * @return java.lang.Object + **/ + Object purchaseOrderDelete(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 采购入库单删除接口 + * 1、库存采购入库单取消签字,2、库存采购入库单删除 + * @Date 9:44 上午 2024/9/4 + * @param jsonObject + * @return java.lang.Object + **/ + Object purchaseWarehousingDelete(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 销售订单删除接口 + * 0、根据销售钉订单号查询出销售出库单号,1、库存销售出库单取消签字,2、库存销售出库单删除,3、销售订单取消审批,4、销售订单删除 + * @Date 9:44 上午 2024/9/4 + * @param jsonObject + * @return java.lang.Object + **/ + Object salesOrderDelete(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 调拨订单删除接口 + * 0、根据调拨订单号查询调拨入库,调拨出库单据,1、库存调拨出库取消签字 2、库存调拨出库删除 3、调拨入库取消签字 4、调拨入库删除 5、调拨订单弃审 6、调拨订单删除 + * @Date 9:44 上午 2024/9/4 + * @param jsonObject + * @return java.lang.Object + **/ + Object transferOrderDelete(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 产成品入库删除接口 + * 1、库存产成品入库单取消签字 2、库存产成品入库单删除 + * @Date 9:44 上午 2024/9/4 + * @param jsonObject + * @return java.lang.Object + **/ + Object finishedProductsAreStoredDelete(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 材料出库删除接口 + * 1、库存材料出库取消签字 2、库存材料出库单删除 + * @Date 9:44 上午 2024/9/4 + * @param jsonObject + * @return java.lang.Object + **/ + Object materialDeliveryDelete(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 其他出库单删除接口 + * 1、库存其他出库取消签字 2、库存其他出库删除 + * @Date 9:44 上午 2024/9/4 + * @param jsonObject + * @return java.lang.Object + **/ + Object otherWarehouseOrdersDelete(JSONObject jsonObject); + + /** + * @Author lvleigang + * @Description 其他入库单删除接口 + * 1、库存其他入库单取消签字. 2、库存其他入库删除 + * @Date 9:44 上午 2024/9/4 + * @param jsonObject + * @return java.lang.Object + **/ + Object otherWarehouseReceiptDelete(JSONObject jsonObject); + + +} diff --git a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java new file mode 100644 index 00000000..07339ebb --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java @@ -0,0 +1,587 @@ +package com.hzya.frame.u8c.Encapsulation.service.impl; + +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.sysnew.application.service.impl.ApplicationCache; +import com.hzya.frame.u8c.Encapsulation.dao.IEncapsulationDao; +import com.hzya.frame.u8c.Encapsulation.entity.EncapsulationEntity; +import com.hzya.frame.u8c.Encapsulation.service.IEncapsulationService; +import com.hzya.frame.web.entity.BaseResult; +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.HttpPost; +import org.apache.http.entity.ByteArrayEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.util.EntityUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; + +import javax.annotation.Resource; +import java.io.IOException; +import java.util.List; + +/** + * (BdCorp)表服务实现类 + * + * @author makejava + * @since 2023-09-06 14:47:18 + */ +@Service("encapsulationImpl") +public class EncapsulationImpl extends BaseService implements IEncapsulationService { + + private IEncapsulationDao encapsulationDao; + + @Autowired + public void setEncapsulationDao(IEncapsulationDao dao) { + this.encapsulationDao = dao; + this.dao = dao; + } + + @Value("${zt.url}") + private String ztUrl; + private final Object lock = new Object(); + + /** + * @param object + * @return java.lang.Object + * @Author lvleigang + * @Description 采购订单删除接口 + * 0、根据采购订单号查询入库单号,1、库存采购入库单取消签字,2、库存采购入库单删除,3、采购订单弃审,4、采购订单删除 + * @Date 9:44 上午 2024/9/4 + **/ + @Override + public Object purchaseOrderDelete(JSONObject object) { + JSONObject returnObject = new JSONObject(); + + //获取单号和时间 + JSONObject jsonObject = getData("jsonStr", object, JSONObject.class); + //判断是否存在参数 + if (!checkStr(jsonObject.getString("code"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("corp"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "公司为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("date_begin"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据开始日期为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("date_end"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据结束日期为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("coperator"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "操作员为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("CgrkUnapproveApi"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存采购入库单取消签字接口编号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("CgrkDeleteApi"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存采购入库单删除接口编号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("CgddUnapproveApi"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "采购订单弃审接口编号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("CgddDeleteApi"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "采购订单删除接口编号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("dataSourceCode"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "数据源编码为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("publicKey"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "publicKey为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("secretKey"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "secretKey为空"); + return returnObject; + } + //根据采购订单号查询入库单号 + EncapsulationEntity encapsulationEntity = new EncapsulationEntity(); + encapsulationEntity.setCode(jsonObject.getString("code")); + encapsulationEntity.setDataSourceCode(jsonObject.getString("dataSourceCode")); + encapsulationEntity.setType("21"); + List encapsulationEntities = encapsulationDao.queryCgrkddh(encapsulationEntity); + if (encapsulationEntities != null && encapsulationEntities.size() == 1) { + String cgrkdqxqz = getsendBody("1", jsonObject, encapsulationEntities.get(0).getCode()); + //执行库存采购入库单取消签字接口 + boolean cgrkdqxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("CgrkUnapproveApi"), jsonObject.getString("CgrkUnapproveApi").substring(6), cgrkdqxqz); + if (cgrkdqxqzflag) { + String cgrkdsc = getsendBody("2", jsonObject, encapsulationEntities.get(0).getCode()); + //执行库存采购入库单删除 + boolean cgrkdscfiag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("CgrkDeleteApi"), jsonObject.getString("CgrkDeleteApi").substring(6), cgrkdsc); + if (cgrkdscfiag) { + String cgddqs = getsendBody("3", jsonObject, null); + //执行采购订单弃审, + boolean cgddqsflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("CgddUnapproveApi"), jsonObject.getString("CgddUnapproveApi").substring(6), cgddqs); + if (cgddqsflag) { + String cgddsc = getsendBody("4", jsonObject, null); + //执行采购订单删除 + boolean cgddscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("CgddUnapproveApi"), jsonObject.getString("CgddUnapproveApi").substring(6), cgddsc); + if (cgddscflag) { + returnObject.put("status", "success"); + returnObject.put("errormsg", "采购订单删除成功"); + return returnObject; + } else { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "采购订单删除失败"); + return returnObject; + } + } else { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "采购订单弃审失败"); + return returnObject; + } + } else { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "采购入库单删除失败"); + return returnObject; + } + } else { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "采购入库单取消签字失败"); + return returnObject; + } + } else { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "查到多条采购入库单"); + return returnObject; + } + } + + /** + * @param object + * @return java.lang.Object + * @Author lvleigang + * @Description 采购入库单删除接口 + * 1、库存采购入库单取消签字,2、库存采购入库单删除 + * @Date 9:44 上午 2024/9/4 + **/ + @Override + public Object purchaseWarehousingDelete(JSONObject object) { + JSONObject returnObject = new JSONObject(); + + //获取单号和时间 + JSONObject jsonObject = getData("jsonStr", object, JSONObject.class); + //判断是否存在参数 + if (!checkStr(jsonObject.getString("code"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("corp"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "公司为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("date_begin"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据开始日期为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("date_end"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据结束日期为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("coperator"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "操作员为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("CgrkUnapproveApi"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存采购入库单取消签字接口编号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("CgrkDeleteApi"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存采购入库单删除接口编号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("dataSourceCode"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "数据源编码为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("publicKey"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "publicKey为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("secretKey"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "secretKey为空"); + return returnObject; + } + String cgrkdqxqz = getsendBody("1", jsonObject, jsonObject.getString("code")); + //执行库存采购入库单取消签字接口 + boolean cgrkdqxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("CgrkUnapproveApi"), jsonObject.getString("CgrkUnapproveApi").substring(6), cgrkdqxqz); + if (cgrkdqxqzflag) { + String cgrkdsc = getsendBody("2", jsonObject, jsonObject.getString("code")); + //执行库存采购入库单删除接口 + boolean cgrkdscfiag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("CgrkDeleteApi"), jsonObject.getString("CgrkDeleteApi").substring(6), cgrkdsc); + if (cgrkdscfiag) { + returnObject.put("status", "success"); + returnObject.put("errormsg", "采购入库单删除成功"); + return returnObject; + } else { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "采购入库单删除失败"); + return returnObject; + } + } else { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "采购入库单取消签字失败"); + return returnObject; + } + } + + /** + * @param object + * @return java.lang.Object + * @Author lvleigang + * @Description 销售订单删除接口 + * 0、根据销售钉订单号查询出销售出库单号,1、库存销售出库单取消签字,2、库存销售出库单删除,3、销售订单取消审批,4、销售订单删除 + * @Date 9:44 上午 2024/9/4 + **/ + @Override + public Object salesOrderDelete(JSONObject object) { + JSONObject returnObject = new JSONObject(); + + //获取单号和时间 + JSONObject jsonObject = getData("jsonStr", object, JSONObject.class); + //判断是否存在参数 + if (!checkStr(jsonObject.getString("code"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("corp"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "公司为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("date_begin"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据开始日期为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("date_end"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据结束日期为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("coperator"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "操作员为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("kcxsckdUnapproveApi"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存销售出库单取消签字接口编号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("kcxsckDeleteApi"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存销售出库单删除接口编号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("xsddUnapproveApi"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "销售订单取消审批接口编号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("xsddDeleteApi"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "销售订单删除接口编号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("dataSourceCode"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "数据源编码为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("publicKey"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "publicKey为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("secretKey"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "secretKey为空"); + return returnObject; + } + //根据销售钉订单号查询出销售出库单号 + EncapsulationEntity encapsulationEntity = new EncapsulationEntity(); + encapsulationEntity.setCode(jsonObject.getString("code")); + encapsulationEntity.setDataSourceCode(jsonObject.getString("dataSourceCode")); + encapsulationEntity.setType("30"); + List encapsulationEntities = encapsulationDao.queryCgrkddh(encapsulationEntity); + if (encapsulationEntities != null && encapsulationEntities.size() == 1) { + String cgrkdqxqz = getsendBody("5", jsonObject, encapsulationEntities.get(0).getCode()); + //库存销售出库单取消签字, + boolean cgrkdqxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcxsckdUnapproveApi"), jsonObject.getString("kcxsckdUnapproveApi").substring(6), cgrkdqxqz); + if (cgrkdqxqzflag) { + String cgrkdsc = getsendBody("2", jsonObject, encapsulationEntities.get(0).getCode()); + //库存销售出库单删除 + boolean cgrkdscfiag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcxsckDeleteApi"), jsonObject.getString("kcxsckDeleteApi").substring(6), cgrkdsc); + if (cgrkdscfiag) { + String cgddqs = getsendBody("3", jsonObject, null); + //销售订单取消审批,, + boolean cgddqsflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("xsddUnapproveApi"), jsonObject.getString("xsddUnapproveApi").substring(6), cgddqs); + if (cgddqsflag) { + String cgddsc = getsendBody("4", jsonObject, null); + //销售订单删除 + boolean cgddscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("xsddDeleteApi"), jsonObject.getString("xsddDeleteApi").substring(6), cgddsc); + if (cgddscflag) { + returnObject.put("status", "success"); + returnObject.put("errormsg", "销售订单删除成功"); + return returnObject; + } else { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "销售订单删除失败"); + return returnObject; + } + } else { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "销售订单取消审批失败"); + return returnObject; + } + } else { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存销售出库单删除失败"); + return returnObject; + } + } else { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存销售出库单取消签字失败"); + return returnObject; + } + } else { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "查到多条销售出库单"); + return returnObject; + } + } + + /** + * @param jsonObject + * @return java.lang.Object + * @Author lvleigang + * @Description 调拨订单删除接口 + * 0、根据调拨订单号查询调拨入库,调拨出库单据,1、库存调拨出库取消签字 2、库存调拨出库删除 3、调拨入库取消签字 4、调拨入库删除 5、调拨订单弃审 6、调拨订单删除 + * @Date 9:44 上午 2024/9/4 + **/ + @Override + public Object transferOrderDelete(JSONObject jsonObject) { + return null; + } + + /** + * @param jsonObject + * @return java.lang.Object + * @Author lvleigang + * @Description 产成品入库删除接口 + * 1、库存产成品入库单取消签字 2、库存产成品入库单删除 + * @Date 9:44 上午 2024/9/4 + **/ + @Override + public Object finishedProductsAreStoredDelete(JSONObject jsonObject) { + return null; + } + + /** + * @param jsonObject + * @return java.lang.Object + * @Author lvleigang + * @Description 材料出库删除接口 + * 1、库存材料出库取消签字 2、库存材料出库单删除 + * @Date 9:44 上午 2024/9/4 + **/ + @Override + public Object materialDeliveryDelete(JSONObject jsonObject) { + return null; + } + + /** + * @param jsonObject + * @return java.lang.Object + * @Author lvleigang + * @Description 其他出库单删除接口 + * 1、库存其他出库取消签字 2、库存其他出库删除 + * @Date 9:44 上午 2024/9/4 + **/ + @Override + public Object otherWarehouseOrdersDelete(JSONObject jsonObject) { + return null; + } + + /** + * @param jsonObject + * @return java.lang.Object + * @Author lvleigang + * @Description 其他入库单删除接口 + * 1、库存其他入库单取消签字. 2、库存其他入库删除 + * @Date 9:44 上午 2024/9/4 + **/ + @Override + public Object otherWarehouseReceiptDelete(JSONObject jsonObject) { + return null; + } + + + //拼装数据 + private String getsendBody(String type, JSONObject object, String code) { + JSONObject jsonObject1 = new JSONObject(); + + switch (type) { + case "1": //库存采购入库单取消签字 + JSONObject unsignInfo = new JSONObject(); + unsignInfo.put("coperator", object.getString("coperator")); + JSONObject queryInfo = new JSONObject(); + queryInfo.put("date_end", object.getString("date_end")); + queryInfo.put("date_begin", object.getString("date_begin")); + queryInfo.put("corp", object.getString("corp")); + queryInfo.put("billcode", code); + jsonObject1.put("unsignInfo", unsignInfo); + jsonObject1.put("queryInfo", queryInfo); + break; + case "2": //库存采购入库单删除 + JSONObject unsignInfo2 = new JSONObject(); + unsignInfo2.put("coperator", object.getString("coperator")); + JSONObject queryInfo2 = new JSONObject(); + queryInfo2.put("date_end", object.getString("date_end")); + queryInfo2.put("date_begin", object.getString("date_begin")); + queryInfo2.put("corp", object.getString("corp")); + queryInfo2.put("billcode", code); + jsonObject1.put("deleteInfo", unsignInfo2); + jsonObject1.put("queryInfo", queryInfo2); + break; + case "3": //采购订单弃审 + JSONObject unsignInfo3 = new JSONObject(); + unsignInfo3.put("approvid", object.getString("coperator")); + JSONObject queryInfo3 = new JSONObject(); + queryInfo3.put("date_end", object.getString("date_end")); + queryInfo3.put("date_begin", object.getString("date_begin")); + queryInfo3.put("corp", object.getString("corp")); + queryInfo3.put("code", object.getString("code")); + jsonObject1.put("approveinfo", unsignInfo3); + jsonObject1.put("queryinfo", queryInfo3); + break; + case "4": //采购订单删除 + JSONObject unsignInfo4 = new JSONObject(); + unsignInfo4.put("coperator", object.getString("coperator")); + JSONObject queryInfo4 = new JSONObject(); + queryInfo4.put("date_end", object.getString("date_end")); + queryInfo4.put("date_begin", object.getString("date_begin")); + queryInfo4.put("corp", object.getString("corp")); + queryInfo4.put("code", object.getString("code")); + jsonObject1.put("deleteinfo", unsignInfo4); + jsonObject1.put("queryinfo", queryInfo4); + break; + default: + } + return jsonObject1.toJSONString(); + } + + /** + * @param publicKey + * @param secretKey + * @param apiCode + * @param appId + * @param bodys + * @return java.lang.String + * @Author lvleigang + * @Description 发送接口 + * @Date 3:05 下午 2024/9/4 + **/ + private boolean sendPost(String publicKey, String secretKey, String apiCode, String appId, String bodys) { + StringBuilder returnBody = new StringBuilder(); + Integer outTime = 6000; + HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); + // HttpClient + CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build(); + HttpPost post = new HttpPost(ztUrl); + CloseableHttpResponse response = null; + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(outTime).build(); + post.setConfig(requestConfig);//设置请求参数【超时时间】 + post.setHeader("publicKey", publicKey); + post.setHeader("secretKey", secretKey); + post.setHeader("apiCode", apiCode); + post.setHeader("appId", appId); + + try { + if (bodys != null && !"".equals(bodys)) { + ByteArrayEntity entity = new ByteArrayEntity(bodys.getBytes("UTF-8")); + entity.setContentType("application/json"); + post.setEntity(entity); + } + response = closeableHttpClient.execute(post); + + HttpEntity entity = response.getEntity(); + synchronized (lock) { + returnBody.append(EntityUtils.toString(entity, "UTF-8")); + } + logger.info("返回结果:" + returnBody); + } catch (Exception e) { + logger.error("请求错误:" + e.getMessage()); + returnBody.append(e.getMessage()); + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + + } + + if (returnBody != null && !"".equals(returnBody)) { + if (JSONUtil.isTypeJSON(returnBody.toString())) { + JSONObject jsonObject1 = JSONObject.parseObject(returnBody.toString()); + if (jsonObject1.getString("status") != null && "200".equals(jsonObject1.getString("status"))) { + return true; + } else { + return false; + } + } else { + return false; + } + } else { + return false; + } + } + + +} From 1f2d0584e27b1f9b75a4c50012876d14974f439c Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 5 Sep 2024 16:00:23 +0800 Subject: [PATCH 049/101] =?UTF-8?q?=E9=92=89=E9=92=89=E6=8E=A5=E5=8F=A3=20?= =?UTF-8?q?2024=E5=B9=B49=E6=9C=885=E6=97=A516:00:12=20xel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 18 +- .../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 +++++++++++ 7 files changed, 530 insertions(+), 1 deletion(-) create mode 100644 service/src/main/java/com/hzya/frame/dingtalk/enums/OrgEventEnum.java create mode 100644 service/src/main/java/com/hzya/frame/dingtalk/service/IDingTalkExtService.java create mode 100644 service/src/main/java/com/hzya/frame/dingtalk/service/IDingTalkService.java create mode 100644 service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkExtServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/dingtalk/util/DingTalkAccessToken.java diff --git a/pom.xml b/pom.xml index 73a24eaf..d7c2e49a 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,8 @@ 8.0.3 42.2.6 1.7.4 - + 1.3.7 + 2.1.46 @@ -383,6 +384,21 @@ org.springframework.boot spring-boot-starter-data-mongodb + + com.dingtalk.open + app-stream-client + ${dingtalk-stream-sdk.version} + + + com.aliyun + dingtalk + ${dingtalk-sdk.version} + + + com.aliyun + alibaba-dingtalk-service-sdk + 2.0.0 + diff --git a/service/src/main/java/com/hzya/frame/dingtalk/enums/OrgEventEnum.java b/service/src/main/java/com/hzya/frame/dingtalk/enums/OrgEventEnum.java new file mode 100644 index 00000000..f01431f0 --- /dev/null +++ b/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/service/src/main/java/com/hzya/frame/dingtalk/service/IDingTalkExtService.java b/service/src/main/java/com/hzya/frame/dingtalk/service/IDingTalkExtService.java new file mode 100644 index 00000000..ffbba432 --- /dev/null +++ b/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/service/src/main/java/com/hzya/frame/dingtalk/service/IDingTalkService.java b/service/src/main/java/com/hzya/frame/dingtalk/service/IDingTalkService.java new file mode 100644 index 00000000..8429bc1c --- /dev/null +++ b/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/service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkExtServiceImpl.java b/service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkExtServiceImpl.java new file mode 100644 index 00000000..61dc97fa --- /dev/null +++ b/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 +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/service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkServiceImpl.java b/service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkServiceImpl.java new file mode 100644 index 00000000..89b4bd3e --- /dev/null +++ b/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 +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/service/src/main/java/com/hzya/frame/dingtalk/util/DingTalkAccessToken.java b/service/src/main/java/com/hzya/frame/dingtalk/util/DingTalkAccessToken.java new file mode 100644 index 00000000..eb951180 --- /dev/null +++ b/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); + } +} From 4391df3e02b3504738fb42f3b87a6f7f352f39ea Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Fri, 6 Sep 2024 11:15:55 +0800 Subject: [PATCH 050/101] =?UTF-8?q?u8c=E5=B0=81=E8=A3=85=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-llg.yml | 2 + .../mdm/mdmModule/entity/MdmModuleEntity.xml | 16 +- .../entity/EncapsulationEntity.xml | 2 + .../service/IEncapsulationService.java | 9 + .../service/impl/EncapsulationImpl.java | 1048 ++++++++++++++--- 5 files changed, 914 insertions(+), 163 deletions(-) diff --git a/buildpackage/src/main/resources/application-llg.yml b/buildpackage/src/main/resources/application-llg.yml index 0a16527c..5953ca0d 100644 --- a/buildpackage/src/main/resources/application-llg.yml +++ b/buildpackage/src/main/resources/application-llg.yml @@ -42,6 +42,8 @@ spring: savefile: # 文件保存路径 path: /Users/apple/Desktop/log/local + tomcatpath: /Users/apple/Desktop/log/local + pluginpath: /Users/apple/Desktop/log/local zt: url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface cbs8: diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml index ae5903a8..bd141eed 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml @@ -962,19 +962,25 @@ where id = #{id} ${item.leftBracket} ${item.filedId} - = + = #{item.filedVaule} - != + != #{item.filedVaule} - > + > #{item.filedVaule} - < + < #{item.filedVaule} + + + like concat('%',#{item.filedVaule},'%') + + + not like concat('%',#{item.filedVaule},'%') - #{item.filedVaule} + diff --git a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml index f911f81e..c50f9002 100644 --- a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml +++ b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml @@ -12,5 +12,7 @@ SELECT cgeneralhid FROM ic_general_b WHERE vfirstbillcode = #{code} and csourcetype = #{type} ) + + diff --git a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/IEncapsulationService.java b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/IEncapsulationService.java index ab1e0f09..c6605b4a 100644 --- a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/IEncapsulationService.java +++ b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/IEncapsulationService.java @@ -2,6 +2,7 @@ package com.hzya.frame.u8c.Encapsulation.service; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; import com.hzya.frame.u8c.Encapsulation.entity.EncapsulationEntity; /** @@ -20,6 +21,7 @@ public interface IEncapsulationService extends IBaseService this.encapsulationDao = dao; this.dao = dao; } - + @Resource + private ISysApplicationDatabaseDao sysApplicationDatabaseDao; @Value("${zt.url}") private String ztUrl; private final Object lock = new Object(); @@ -49,15 +53,15 @@ public class EncapsulationImpl extends BaseService * @param object * @return java.lang.Object * @Author lvleigang - * @Description 采购订单删除接口 - * 0、根据采购订单号查询入库单号,1、库存采购入库单取消签字,2、库存采购入库单删除,3、采购订单弃审,4、采购订单删除 + * @Description 采购订单删除接口 8000350080 + * 0、根据采购订单号查询入库单号,1、库存采购入库单取消签字 8000350061,2、库存采购入库单删除 8000350058,3、采购订单弃审 8000350059,4、采购订单删除 8000350056 + * * @Date 9:44 上午 2024/9/4 **/ @Override public Object purchaseOrderDelete(JSONObject object) { JSONObject returnObject = new JSONObject(); - //获取单号和时间 JSONObject jsonObject = getData("jsonStr", object, JSONObject.class); //判断是否存在参数 if (!checkStr(jsonObject.getString("code"))) { @@ -85,26 +89,28 @@ public class EncapsulationImpl extends BaseService returnObject.put("errormsg", "操作员为空"); return returnObject; } - if (!checkStr(jsonObject.getString("CgrkUnapproveApi"))) { + + if (!checkStr(jsonObject.getString("cgrkqxqz"))) { returnObject.put("status", "falied"); returnObject.put("errormsg", "库存采购入库单取消签字接口编号为空"); return returnObject; } - if (!checkStr(jsonObject.getString("CgrkDeleteApi"))) { + if (!checkStr(jsonObject.getString("cgrksc"))) { returnObject.put("status", "falied"); returnObject.put("errormsg", "库存采购入库单删除接口编号为空"); return returnObject; } - if (!checkStr(jsonObject.getString("CgddUnapproveApi"))) { + if (!checkStr(jsonObject.getString("cgddqs"))) { returnObject.put("status", "falied"); returnObject.put("errormsg", "采购订单弃审接口编号为空"); return returnObject; } - if (!checkStr(jsonObject.getString("CgddDeleteApi"))) { + if (!checkStr(jsonObject.getString("cgddsc"))) { returnObject.put("status", "falied"); returnObject.put("errormsg", "采购订单删除接口编号为空"); return returnObject; } + if (!checkStr(jsonObject.getString("dataSourceCode"))) { returnObject.put("status", "falied"); returnObject.put("errormsg", "数据源编码为空"); @@ -126,66 +132,96 @@ public class EncapsulationImpl extends BaseService encapsulationEntity.setDataSourceCode(jsonObject.getString("dataSourceCode")); encapsulationEntity.setType("21"); List encapsulationEntities = encapsulationDao.queryCgrkddh(encapsulationEntity); - if (encapsulationEntities != null && encapsulationEntities.size() == 1) { - String cgrkdqxqz = getsendBody("1", jsonObject, encapsulationEntities.get(0).getCode()); - //执行库存采购入库单取消签字接口 - boolean cgrkdqxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("CgrkUnapproveApi"), jsonObject.getString("CgrkUnapproveApi").substring(6), cgrkdqxqz); - if (cgrkdqxqzflag) { - String cgrkdsc = getsendBody("2", jsonObject, encapsulationEntities.get(0).getCode()); - //执行库存采购入库单删除 - boolean cgrkdscfiag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("CgrkDeleteApi"), jsonObject.getString("CgrkDeleteApi").substring(6), cgrkdsc); - if (cgrkdscfiag) { - String cgddqs = getsendBody("3", jsonObject, null); - //执行采购订单弃审, - boolean cgddqsflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("CgddUnapproveApi"), jsonObject.getString("CgddUnapproveApi").substring(6), cgddqs); - if (cgddqsflag) { - String cgddsc = getsendBody("4", jsonObject, null); - //执行采购订单删除 - boolean cgddscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("CgddUnapproveApi"), jsonObject.getString("CgddUnapproveApi").substring(6), cgddsc); - if (cgddscflag) { - returnObject.put("status", "success"); - returnObject.put("errormsg", "采购订单删除成功"); - return returnObject; - } else { - returnObject.put("status", "falied"); - returnObject.put("errormsg", "采购订单删除失败"); - return returnObject; - } - } else { - returnObject.put("status", "falied"); - returnObject.put("errormsg", "采购订单弃审失败"); - return returnObject; - } - } else { - returnObject.put("status", "falied"); - returnObject.put("errormsg", "采购入库单删除失败"); - return returnObject; - } - } else { - returnObject.put("status", "falied"); - returnObject.put("errormsg", "采购入库单取消签字失败"); - return returnObject; - } - } else { + if(encapsulationEntities == null || encapsulationEntities.size() != 1){ returnObject.put("status", "falied"); returnObject.put("errormsg", "查到多条采购入库单"); return returnObject; } + //执行库存采购入库单取消签字接口 + String cgrkdqxqz = getsendBody("1", jsonObject, encapsulationEntities.get(0).getCode()); + boolean cgrkdqxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("cgrkqxqz"), jsonObject.getString("cgrkqxqz").substring(6), cgrkdqxqz); + if (!cgrkdqxqzflag) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "采购入库单取消签字失败"); + return returnObject; + } + //执行库存采购入库单删除 + String cgrkdsc = getsendBody("2", jsonObject, encapsulationEntities.get(0).getCode()); + boolean cgrkdscfiag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("cgrksc"), jsonObject.getString("cgrksc").substring(6), cgrkdsc); + if (!cgrkdscfiag) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "采购入库单删除失败"); + return returnObject; + } + //执行采购订单弃审 + String cgddqs = getsendBody("3", jsonObject, null); + boolean cgddqsflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("cgddqs"), jsonObject.getString("cgddqs").substring(6), cgddqs); + if (!cgddqsflag) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "采购订单弃审失败"); + return returnObject; + } + //执行采购订单删除 + String cgddsc = getsendBody("4", jsonObject, null); + boolean cgddscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("cgddsc"), jsonObject.getString("cgddsc").substring(6), cgddsc); + if (cgddscflag) { + returnObject.put("status", "success"); + returnObject.put("errormsg", "采购订单删除成功"); + return returnObject; + } else { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "采购订单删除失败"); + return returnObject; + } } + /** + * @param entity + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 数据表 + * @Date 11:52 上午 2024/3/27 + **/ + @Override + public SysExtensionApiEntity addPurchaseOrderDelete(SysExtensionApiEntity entity) { + try { + Map headers = entity.getHeaders(); + SysApplicationEntity applicationEntity = entity.getReceiveApp(); + 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()); + jsonObject.put("publicKey",headers.get("publicKey")); + jsonObject.put("secretKey",headers.get("secretKey")); + jsonObject.put("cgrkqxqz",headers.get("cgrkqxqz")); + jsonObject.put("cgrksc",headers.get("cgrksc")); + jsonObject.put("cgddqs",headers.get("cgddqs")); + jsonObject.put("cgddsc",headers.get("cgddsc")); + entity.setBodys(jsonObject.toJSONString()); + } + } catch (Exception e) { + e.printStackTrace(); + } + return entity; + } /** * @param object * @return java.lang.Object * @Author lvleigang - * @Description 采购入库单删除接口 - * 1、库存采购入库单取消签字,2、库存采购入库单删除 + * @Description 采购入库单删除接口 8000350081 + * 1、库存采购入库单取消签字 8000350061,2、库存采购入库单删除 8000350058 * @Date 9:44 上午 2024/9/4 **/ @Override public Object purchaseWarehousingDelete(JSONObject object) { JSONObject returnObject = new JSONObject(); - //获取单号和时间 JSONObject jsonObject = getData("jsonStr", object, JSONObject.class); //判断是否存在参数 if (!checkStr(jsonObject.getString("code"))) { @@ -213,12 +249,12 @@ public class EncapsulationImpl extends BaseService returnObject.put("errormsg", "操作员为空"); return returnObject; } - if (!checkStr(jsonObject.getString("CgrkUnapproveApi"))) { + if (!checkStr(jsonObject.getString("cgrkqxqz"))) { returnObject.put("status", "falied"); returnObject.put("errormsg", "库存采购入库单取消签字接口编号为空"); return returnObject; } - if (!checkStr(jsonObject.getString("CgrkDeleteApi"))) { + if (!checkStr(jsonObject.getString("cgrksc"))) { returnObject.put("status", "falied"); returnObject.put("errormsg", "库存采购入库单删除接口编号为空"); return returnObject; @@ -238,42 +274,74 @@ public class EncapsulationImpl extends BaseService returnObject.put("errormsg", "secretKey为空"); return returnObject; } - String cgrkdqxqz = getsendBody("1", jsonObject, jsonObject.getString("code")); //执行库存采购入库单取消签字接口 - boolean cgrkdqxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("CgrkUnapproveApi"), jsonObject.getString("CgrkUnapproveApi").substring(6), cgrkdqxqz); - if (cgrkdqxqzflag) { - String cgrkdsc = getsendBody("2", jsonObject, jsonObject.getString("code")); - //执行库存采购入库单删除接口 - boolean cgrkdscfiag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("CgrkDeleteApi"), jsonObject.getString("CgrkDeleteApi").substring(6), cgrkdsc); - if (cgrkdscfiag) { - returnObject.put("status", "success"); - returnObject.put("errormsg", "采购入库单删除成功"); - return returnObject; - } else { - returnObject.put("status", "falied"); - returnObject.put("errormsg", "采购入库单删除失败"); - return returnObject; - } - } else { + String cgrkdqxqz = getsendBody("1", jsonObject, jsonObject.getString("code")); + boolean cgrkdqxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("cgrkqxqz"), jsonObject.getString("cgrkqxqz").substring(6), cgrkdqxqz); + if (!cgrkdqxqzflag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "采购入库单取消签字失败"); return returnObject; } - } + //执行库存采购入库单删除接口 + String cgrkdsc = getsendBody("2", jsonObject, jsonObject.getString("code")); + boolean cgrkdscfiag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("cgrksc"), jsonObject.getString("cgrksc").substring(6), cgrkdsc); + if (cgrkdscfiag) { + returnObject.put("status", "success"); + returnObject.put("errormsg", "采购入库单删除成功"); + return returnObject; + } else { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "采购入库单删除失败"); + return returnObject; + } + } + /** + * @param entity + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 数据表 + * @Date 11:52 上午 2024/3/27 + **/ + @Override + public SysExtensionApiEntity addPurchaseWarehousingDelete(SysExtensionApiEntity entity) { + try { + Map headers = entity.getHeaders(); + SysApplicationEntity applicationEntity = entity.getReceiveApp(); + 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()); + jsonObject.put("publicKey",headers.get("publicKey")); + jsonObject.put("secretKey",headers.get("secretKey")); + + jsonObject.put("cgrkqxqz",headers.get("cgrkqxqz")); + jsonObject.put("cgrksc",headers.get("cgrksc")); + entity.setBodys(jsonObject.toJSONString()); + } + } catch (Exception e) { + e.printStackTrace(); + } + return entity; + } /** * @param object * @return java.lang.Object * @Author lvleigang - * @Description 销售订单删除接口 - * 0、根据销售钉订单号查询出销售出库单号,1、库存销售出库单取消签字,2、库存销售出库单删除,3、销售订单取消审批,4、销售订单删除 + * @Description 销售订单删除接口 8000350082 + * 0、根据销售钉订单号查询出销售出库单号,1、库存销售出库单取消签字 8000350062 ,2、库存销售出库单删除 8000350063 ,3、销售订单取消审批 8000350064 ,4、销售订单删除 8000350065 * @Date 9:44 上午 2024/9/4 **/ @Override public Object salesOrderDelete(JSONObject object) { JSONObject returnObject = new JSONObject(); - //获取单号和时间 JSONObject jsonObject = getData("jsonStr", object, JSONObject.class); //判断是否存在参数 if (!checkStr(jsonObject.getString("code"))) { @@ -301,26 +369,28 @@ public class EncapsulationImpl extends BaseService returnObject.put("errormsg", "操作员为空"); return returnObject; } - if (!checkStr(jsonObject.getString("kcxsckdUnapproveApi"))) { + + if (!checkStr(jsonObject.getString("kcxsckqxqz"))) { returnObject.put("status", "falied"); returnObject.put("errormsg", "库存销售出库单取消签字接口编号为空"); return returnObject; } - if (!checkStr(jsonObject.getString("kcxsckDeleteApi"))) { + if (!checkStr(jsonObject.getString("kcxscksc"))) { returnObject.put("status", "falied"); returnObject.put("errormsg", "库存销售出库单删除接口编号为空"); return returnObject; } - if (!checkStr(jsonObject.getString("xsddUnapproveApi"))) { + if (!checkStr(jsonObject.getString("xsddqxsp"))) { returnObject.put("status", "falied"); returnObject.put("errormsg", "销售订单取消审批接口编号为空"); return returnObject; } - if (!checkStr(jsonObject.getString("xsddDeleteApi"))) { + if (!checkStr(jsonObject.getString("xsddsc"))) { returnObject.put("status", "falied"); returnObject.put("errormsg", "销售订单删除接口编号为空"); return returnObject; } + if (!checkStr(jsonObject.getString("dataSourceCode"))) { returnObject.put("status", "falied"); returnObject.put("errormsg", "数据源编码为空"); @@ -342,165 +412,827 @@ public class EncapsulationImpl extends BaseService encapsulationEntity.setDataSourceCode(jsonObject.getString("dataSourceCode")); encapsulationEntity.setType("30"); List encapsulationEntities = encapsulationDao.queryCgrkddh(encapsulationEntity); - if (encapsulationEntities != null && encapsulationEntities.size() == 1) { - String cgrkdqxqz = getsendBody("5", jsonObject, encapsulationEntities.get(0).getCode()); - //库存销售出库单取消签字, - boolean cgrkdqxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcxsckdUnapproveApi"), jsonObject.getString("kcxsckdUnapproveApi").substring(6), cgrkdqxqz); - if (cgrkdqxqzflag) { - String cgrkdsc = getsendBody("2", jsonObject, encapsulationEntities.get(0).getCode()); - //库存销售出库单删除 - boolean cgrkdscfiag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcxsckDeleteApi"), jsonObject.getString("kcxsckDeleteApi").substring(6), cgrkdsc); - if (cgrkdscfiag) { - String cgddqs = getsendBody("3", jsonObject, null); - //销售订单取消审批,, - boolean cgddqsflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("xsddUnapproveApi"), jsonObject.getString("xsddUnapproveApi").substring(6), cgddqs); - if (cgddqsflag) { - String cgddsc = getsendBody("4", jsonObject, null); - //销售订单删除 - boolean cgddscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("xsddDeleteApi"), jsonObject.getString("xsddDeleteApi").substring(6), cgddsc); - if (cgddscflag) { - returnObject.put("status", "success"); - returnObject.put("errormsg", "销售订单删除成功"); - return returnObject; - } else { - returnObject.put("status", "falied"); - returnObject.put("errormsg", "销售订单删除失败"); - return returnObject; - } - } else { - returnObject.put("status", "falied"); - returnObject.put("errormsg", "销售订单取消审批失败"); - return returnObject; - } - } else { - returnObject.put("status", "falied"); - returnObject.put("errormsg", "库存销售出库单删除失败"); - return returnObject; - } - } else { - returnObject.put("status", "falied"); - returnObject.put("errormsg", "库存销售出库单取消签字失败"); - return returnObject; - } - } else { + if(encapsulationEntities == null || encapsulationEntities.size() != 1){ returnObject.put("status", "falied"); returnObject.put("errormsg", "查到多条销售出库单"); return returnObject; } + //库存销售出库单取消签字, + String cgrkdqxqz = getsendBody("1", jsonObject, encapsulationEntities.get(0).getCode()); + boolean cgrkdqxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcxsckqxqz"), jsonObject.getString("kcxsckqxqz").substring(6), cgrkdqxqz); + if (!cgrkdqxqzflag) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存销售出库单取消签字失败"); + return returnObject; + } + //库存销售出库单删除 + String cgrkdsc = getsendBody("2", jsonObject, encapsulationEntities.get(0).getCode()); + boolean cgrkdscfiag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcxscksc"), jsonObject.getString("kcxscksc").substring(6), cgrkdsc); + if (!cgrkdscfiag) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存销售出库单删除失败"); + return returnObject; + } + //销售订单取消审批,, + String cgddqs = getsendBody("3", jsonObject, jsonObject.getString("code")); + boolean cgddqsflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("xsddqxsp"), jsonObject.getString("xsddqxsp").substring(6), cgddqs); + if (!cgddqsflag) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "销售订单取消审批失败"); + return returnObject; + } + //销售订单删除 + String cgddsc = getsendBody("4", jsonObject, jsonObject.getString("code")); + boolean cgddscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("xsddsc"), jsonObject.getString("xsddsc").substring(6), cgddsc); + if (cgddscflag) { + returnObject.put("status", "success"); + returnObject.put("errormsg", "销售订单删除成功"); + return returnObject; + } else { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "销售订单删除失败"); + return returnObject; + } } - /** - * @param jsonObject + * @param entity + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 数据表 + * @Date 11:52 上午 2024/3/27 + **/ + @Override + public SysExtensionApiEntity addSalesOrderDelete(SysExtensionApiEntity entity) { + try { + Map headers = entity.getHeaders(); + SysApplicationEntity applicationEntity = entity.getReceiveApp(); + 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()); + jsonObject.put("publicKey",headers.get("publicKey")); + jsonObject.put("secretKey",headers.get("secretKey")); + + jsonObject.put("kcxsckqxqz",headers.get("kcxsckqxqz")); + jsonObject.put("kcxscksc",headers.get("kcxscksc")); + jsonObject.put("xsddqxsp",headers.get("xsddqxsp")); + jsonObject.put("xsddsc",headers.get("xsddsc")); + entity.setBodys(jsonObject.toJSONString()); + } + } catch (Exception e) { + e.printStackTrace(); + } + return entity; + } + /** + * @param object * @return java.lang.Object * @Author lvleigang - * @Description 调拨订单删除接口 - * 0、根据调拨订单号查询调拨入库,调拨出库单据,1、库存调拨出库取消签字 2、库存调拨出库删除 3、调拨入库取消签字 4、调拨入库删除 5、调拨订单弃审 6、调拨订单删除 + * @Description 调拨订单删除接口 8000350083 + * + * 0、根据调拨订单号查询调拨入库,调拨出库单据,1、库存调拨出库取消签字 8000350066 2、库存调拨出库删除 8000350067 + * 3、调拨入库取消签字 8000350068 4、调拨入库删除 8000350069 5、调拨订单弃审 8000350070 6、调拨订单删除 8000350071 * @Date 9:44 上午 2024/9/4 **/ @Override - public Object transferOrderDelete(JSONObject jsonObject) { - return null; - } + public Object transferOrderDelete(JSONObject object) { + JSONObject returnObject = new JSONObject(); + JSONObject jsonObject = getData("jsonStr", object, JSONObject.class); + //判断是否存在参数 + if (!checkStr(jsonObject.getString("code"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("corp"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "公司为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("date_begin"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据开始日期为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("date_end"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据结束日期为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("coperator"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "操作员为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("kcdbckqxqz"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存调拨出库取消签字接口编号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("kcdbcksc"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存调拨出库删除删除接口编号为空"); + return returnObject; + } + + if (!checkStr(jsonObject.getString("dbrkqxqz"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "调拨入库取消签字接口编号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("dbrksc"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "调拨入库删除接口编号为空"); + return returnObject; + } + + if (!checkStr(jsonObject.getString("dbddqs"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "调拨订单弃审接口编号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("dbddsc"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "调拨订单删除接口编号为空"); + return returnObject; + } + + if (!checkStr(jsonObject.getString("dataSourceCode"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "数据源编码为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("publicKey"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "publicKey为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("secretKey"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "secretKey为空"); + return returnObject; + } + //根据调拨订单号查询调拨入库 + EncapsulationEntity rk = new EncapsulationEntity(); + rk.setCode(jsonObject.getString("code")); + rk.setDataSourceCode(jsonObject.getString("dataSourceCode")); + rk.setType("4E"); + List rklist = encapsulationDao.queryCgrkddh(rk); + if(rklist == null || rklist.size() != 1){ + returnObject.put("status", "falied"); + returnObject.put("errormsg", "查到多条调拨入库单"); + return returnObject; + } + //根据调拨订单号查询调拨出库 + EncapsulationEntity ck = new EncapsulationEntity(); + ck.setCode(jsonObject.getString("code")); + ck.setDataSourceCode(jsonObject.getString("dataSourceCode")); + ck.setType("4Y"); + List cklist = encapsulationDao.queryCgrkddh(ck); + if(cklist == null || cklist.size() != 1){ + returnObject.put("status", "falied"); + returnObject.put("errormsg", "查到多条调拨出库单"); + return returnObject; + } + //调拨入库取消签字 + String dbrk = getsendBody("1", jsonObject, jsonObject.getString("code")); + boolean dbrkflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("dbrkqxqz"), jsonObject.getString("dbrkqxqz").substring(6), dbrk); + if (!dbrkflag) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "调拨入库取消签字失败"); + return returnObject; + } + //调拨入库删除 + String dbrksc = getsendBody("2", jsonObject, jsonObject.getString("code")); + boolean dbrkscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("dbrksc"), jsonObject.getString("dbrksc").substring(6), dbrksc); + if (!dbrkscflag) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "调拨入库删除失败"); + return returnObject; + } + //库存调拨出库取消签字 + String dbck = getsendBody("1", jsonObject, jsonObject.getString("code")); + boolean dbckflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcdbckqxqz"), jsonObject.getString("kcdbckqxqz").substring(6), dbck); + if (!dbckflag) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存调拨出库取消签字失败"); + return returnObject; + } + //库存调拨出库删除 + String dbcksc = getsendBody("2", jsonObject, jsonObject.getString("code")); + boolean dbckscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcdbcksc"), jsonObject.getString("kcdbcksc").substring(6), dbcksc); + if (!dbckscflag) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存调拨出库删除失败"); + return returnObject; + } + //调拨订单弃审 + String dbdd = getsendBody("3", jsonObject, jsonObject.getString("code")); + boolean dbddflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("dbddqs"), jsonObject.getString("dbddqs").substring(6), dbdd); + if (!dbddflag) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "调拨订单弃审失败"); + return returnObject; + } + //调拨订单删除 + String dbddsc = getsendBody("4", jsonObject, jsonObject.getString("code")); + boolean dbddscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("dbddsc"), jsonObject.getString("dbddsc").substring(6), dbddsc); + if (!dbddscflag) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "调拨订单删除失败"); + return returnObject; + } + + returnObject.put("status", "success"); + returnObject.put("errormsg", "调拨订单删除成功"); + return returnObject; + + + } /** - * @param jsonObject + * @param entity + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 数据表 + * @Date 11:52 上午 2024/3/27 + **/ + @Override + public SysExtensionApiEntity addTransferOrderDelete(SysExtensionApiEntity entity) { + try { + Map headers = entity.getHeaders(); + SysApplicationEntity applicationEntity = entity.getReceiveApp(); + 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()); + jsonObject.put("publicKey",headers.get("publicKey")); + jsonObject.put("secretKey",headers.get("secretKey")); + + jsonObject.put("kcdbckqxqz",headers.get("kcdbckqxqz")); + jsonObject.put("kcdbcksc",headers.get("kcdbcksc")); + jsonObject.put("dbrkqxqz",headers.get("dbrkqxqz")); + jsonObject.put("dbrksc",headers.get("dbrksc")); + jsonObject.put("dbddqs",headers.get("dbddqs")); + jsonObject.put("dbddsc",headers.get("dbddsc")); + entity.setBodys(jsonObject.toJSONString()); + } + } catch (Exception e) { + e.printStackTrace(); + } + return entity; + } + /** + * @param object * @return java.lang.Object * @Author lvleigang - * @Description 产成品入库删除接口 - * 1、库存产成品入库单取消签字 2、库存产成品入库单删除 + * @Description 产成品入库删除接口 8000350084 + * 1、库存产成品入库单取消签字 8000350072 2、库存产成品入库单删除 8000350073 * @Date 9:44 上午 2024/9/4 **/ @Override - public Object finishedProductsAreStoredDelete(JSONObject jsonObject) { - return null; - } + public Object finishedProductsAreStoredDelete(JSONObject object) { + JSONObject returnObject = new JSONObject(); + JSONObject jsonObject = getData("jsonStr", object, JSONObject.class); + //判断是否存在参数 + if (!checkStr(jsonObject.getString("code"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("corp"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "公司为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("date_begin"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据开始日期为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("date_end"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据结束日期为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("coperator"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "操作员为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("kcccprkqxqz"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存产成品入库单取消签字接口编号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("kcccprksc"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存产成品入库单删除接口编号为空"); + return returnObject; + } + + if (!checkStr(jsonObject.getString("dataSourceCode"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "数据源编码为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("publicKey"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "publicKey为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("secretKey"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "secretKey为空"); + return returnObject; + } + + //库存产成品入库单取消签字 + String qxqz = getsendBody("1", jsonObject, jsonObject.getString("code")); + boolean qxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcccprkqxqz"), jsonObject.getString("kcccprkqxqz").substring(6), qxqz); + if (!qxqzflag) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存产成品入库单取消签字失败"); + return returnObject; + } + //库存产成品入库单删除 + String sc = getsendBody("2", jsonObject, jsonObject.getString("code")); + boolean scflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcccprksc"), jsonObject.getString("kcccprksc").substring(6), sc); + if (!scflag) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存产成品入库单删除失败"); + return returnObject; + } + + returnObject.put("status", "success"); + returnObject.put("errormsg", "库存产成品入库删除成功"); + return returnObject; + + } /** - * @param jsonObject + * @param entity + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 数据表 + * @Date 11:52 上午 2024/3/27 + **/ + @Override + public SysExtensionApiEntity addFinishedProductsAreStoredDelete(SysExtensionApiEntity entity) { + try { + Map headers = entity.getHeaders(); + SysApplicationEntity applicationEntity = entity.getReceiveApp(); + 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()); + jsonObject.put("publicKey",headers.get("publicKey")); + jsonObject.put("secretKey",headers.get("secretKey")); + + jsonObject.put("kcccprkqxqz",headers.get("kcccprkqxqz")); + jsonObject.put("kcccprksc",headers.get("kcccprksc")); + entity.setBodys(jsonObject.toJSONString()); + } + } catch (Exception e) { + e.printStackTrace(); + } + return entity; + } + /** + * @param object * @return java.lang.Object * @Author lvleigang - * @Description 材料出库删除接口 - * 1、库存材料出库取消签字 2、库存材料出库单删除 + * @Description 材料出库删除接口 8000350085 + * 1、库存材料出库取消签字 8000350074 2、库存材料出库单删除 8000350075 * @Date 9:44 上午 2024/9/4 **/ @Override - public Object materialDeliveryDelete(JSONObject jsonObject) { - return null; - } + public Object materialDeliveryDelete(JSONObject object) { + JSONObject returnObject = new JSONObject(); + JSONObject jsonObject = getData("jsonStr", object, JSONObject.class); + //判断是否存在参数 + if (!checkStr(jsonObject.getString("code"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("corp"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "公司为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("date_begin"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据开始日期为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("date_end"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据结束日期为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("coperator"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "操作员为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("qxqzApi"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存材料出库取消签字接口编号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("scApi"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存材料出库单删除接口编号为空"); + return returnObject; + } + + if (!checkStr(jsonObject.getString("dataSourceCode"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "数据源编码为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("publicKey"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "publicKey为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("secretKey"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "secretKey为空"); + return returnObject; + } + + //库存材料出库取消签字 + String qxqz = getsendBody("1", jsonObject, jsonObject.getString("code")); + boolean qxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("qxqzApi"), jsonObject.getString("qxqzApi").substring(6), qxqz); + if (!qxqzflag) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存材料出库取消签字失败"); + return returnObject; + } + //库存材料出库单删除 + String sc = getsendBody("2", jsonObject, jsonObject.getString("code")); + boolean scflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("scApi"), jsonObject.getString("scApi").substring(6), sc); + if (!scflag) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存材料出库单删除失败"); + return returnObject; + } + + returnObject.put("status", "success"); + returnObject.put("errormsg", "库存材料出库删除成功"); + return returnObject; + + } /** - * @param jsonObject + * @param entity + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 数据表 + * @Date 11:52 上午 2024/3/27 + **/ + @Override + public SysExtensionApiEntity addMaterialDeliveryDelete(SysExtensionApiEntity entity) { + try { + Map headers = entity.getHeaders(); + SysApplicationEntity applicationEntity = entity.getReceiveApp(); + 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()); + jsonObject.put("publicKey",headers.get("publicKey")); + jsonObject.put("secretKey",headers.get("secretKey")); + + jsonObject.put("qxqzApi",headers.get("qxqzApi")); + jsonObject.put("scApi",headers.get("scApi")); + entity.setBodys(jsonObject.toJSONString()); + } + } catch (Exception e) { + e.printStackTrace(); + } + return entity; + } + /** + * @param object * @return java.lang.Object * @Author lvleigang - * @Description 其他出库单删除接口 - * 1、库存其他出库取消签字 2、库存其他出库删除 + * @Description 其他出库单删除接口 8000350086 + * 1、库存其他出库取消签字 8000350076 2、库存其他出库删除 8000350077 * @Date 9:44 上午 2024/9/4 **/ @Override - public Object otherWarehouseOrdersDelete(JSONObject jsonObject) { - return null; - } + public Object otherWarehouseOrdersDelete(JSONObject object) { + JSONObject returnObject = new JSONObject(); + JSONObject jsonObject = getData("jsonStr", object, JSONObject.class); + //判断是否存在参数 + if (!checkStr(jsonObject.getString("code"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("corp"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "公司为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("date_begin"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据开始日期为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("date_end"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据结束日期为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("coperator"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "操作员为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("qxqzApi"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存其他出库取消签字接口编号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("scApi"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存其他出库删除接口编号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("dataSourceCode"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "数据源编码为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("publicKey"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "publicKey为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("secretKey"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "secretKey为空"); + return returnObject; + } + //库存其他出库取消签字 + String qxqz = getsendBody("1", jsonObject, jsonObject.getString("code")); + boolean qxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("qxqzApi"), jsonObject.getString("qxqzApi").substring(6), qxqz); + if (!qxqzflag) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存其他出库取消签字失败"); + return returnObject; + } + //库存其他出库删除 + String sc = getsendBody("2", jsonObject, jsonObject.getString("code")); + boolean scflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("scApi"), jsonObject.getString("scApi").substring(6), sc); + if (!scflag) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存其他出库删除失败"); + return returnObject; + } + + returnObject.put("status", "success"); + returnObject.put("errormsg", "库存其他出库删除成功"); + return returnObject; + + } /** - * @param jsonObject + * @param entity + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 数据表 + * @Date 11:52 上午 2024/3/27 + **/ + @Override + public SysExtensionApiEntity addOtherWarehouseOrdersDelete(SysExtensionApiEntity entity) { + try { + Map headers = entity.getHeaders(); + SysApplicationEntity applicationEntity = entity.getReceiveApp(); + 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()); + jsonObject.put("publicKey",headers.get("publicKey")); + jsonObject.put("secretKey",headers.get("secretKey")); + + jsonObject.put("qxqzApi",headers.get("qxqzApi")); + jsonObject.put("scApi",headers.get("scApi")); + entity.setBodys(jsonObject.toJSONString()); + } + } catch (Exception e) { + e.printStackTrace(); + } + return entity; + } + /** + * @param object * @return java.lang.Object * @Author lvleigang - * @Description 其他入库单删除接口 - * 1、库存其他入库单取消签字. 2、库存其他入库删除 + * @Description 其他入库单删除接口 8000350087 + * 1、库存其他入库单取消签字.8000350078 2、库存其他入库删除 8000350079 * @Date 9:44 上午 2024/9/4 **/ @Override - public Object otherWarehouseReceiptDelete(JSONObject jsonObject) { - return null; - } + public Object otherWarehouseReceiptDelete(JSONObject object) { + JSONObject returnObject = new JSONObject(); + JSONObject jsonObject = getData("jsonStr", object, JSONObject.class); + //判断是否存在参数 + if (!checkStr(jsonObject.getString("code"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("corp"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "公司为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("date_begin"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据开始日期为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("date_end"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "单据结束日期为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("coperator"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "操作员为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("qxqzApi"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存其他入库单取消签字接口编号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("scApi"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存其他入库删除接口编号为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("dataSourceCode"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "数据源编码为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("publicKey"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "publicKey为空"); + return returnObject; + } + if (!checkStr(jsonObject.getString("secretKey"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "secretKey为空"); + return returnObject; + } + //库存其他入库单取消签字 + String qxqz = getsendBody("1", jsonObject, jsonObject.getString("code")); + boolean qxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("qxqzApi"), jsonObject.getString("qxqzApi").substring(6), qxqz); + if (!qxqzflag) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存其他入库单取消签字失败"); + return returnObject; + } + //库存其他入库删除 + String sc = getsendBody("2", jsonObject, jsonObject.getString("code")); + boolean scflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("scApi"), jsonObject.getString("scApi").substring(6), sc); + if (!scflag) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "库存其他入库删除失败"); + return returnObject; + } + returnObject.put("status", "success"); + returnObject.put("errormsg", "库存其他入库删除成功"); + return returnObject; + } + /** + * @param entity + * @return com.hzya.frame.web.entity.JsonResultEntity + * @Author lvleigang + * @Description 数据表 + * @Date 11:52 上午 2024/3/27 + **/ + @Override + public SysExtensionApiEntity addOtherWarehouseReceiptDelete(SysExtensionApiEntity entity) { + try { + Map headers = entity.getHeaders(); + SysApplicationEntity applicationEntity = entity.getReceiveApp(); + 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()); + jsonObject.put("publicKey",headers.get("publicKey")); + jsonObject.put("secretKey",headers.get("secretKey")); + + jsonObject.put("qxqzApi",headers.get("qxqzApi")); + jsonObject.put("scApi",headers.get("scApi")); + entity.setBodys(jsonObject.toJSONString()); + } + } catch (Exception e) { + e.printStackTrace(); + } + return entity; + } //拼装数据 private String getsendBody(String type, JSONObject object, String code) { JSONObject jsonObject1 = new JSONObject(); switch (type) { - case "1": //库存采购入库单取消签字 + case "1": //取消签字参数类型1、库存采购入库单取消签字 2\库存销售出库单取消签字 3\库存调拨出库取消签字4\调拨入库取消签字 5\库存产成品入库单取消签字 + //6\库存材料出库取消签字 7\库存其他出库取消签字 8\库存其他入库单取消签字 JSONObject unsignInfo = new JSONObject(); unsignInfo.put("coperator", object.getString("coperator")); + JSONObject queryInfo = new JSONObject(); queryInfo.put("date_end", object.getString("date_end")); queryInfo.put("date_begin", object.getString("date_begin")); queryInfo.put("corp", object.getString("corp")); queryInfo.put("billcode", code); + jsonObject1.put("unsignInfo", unsignInfo); jsonObject1.put("queryInfo", queryInfo); break; - case "2": //库存采购入库单删除 + case "2": //删除接口1、库存采购入库单删除 2\库存销售出库单删除 3\库存调拨出库删除 4\调拨入库删除 5\库存产成品入库单删除 + //6\库存材料出库单删除 7\库存其他出库删除 8\库存其他入库删除 JSONObject unsignInfo2 = new JSONObject(); unsignInfo2.put("coperator", object.getString("coperator")); + JSONObject queryInfo2 = new JSONObject(); queryInfo2.put("date_end", object.getString("date_end")); queryInfo2.put("date_begin", object.getString("date_begin")); queryInfo2.put("corp", object.getString("corp")); queryInfo2.put("billcode", code); + jsonObject1.put("deleteInfo", unsignInfo2); jsonObject1.put("queryInfo", queryInfo2); break; - case "3": //采购订单弃审 + case "3": //弃审 1、采购订单弃审 2\销售订单取消审批 3\调拨订单弃审 JSONObject unsignInfo3 = new JSONObject(); unsignInfo3.put("approvid", object.getString("coperator")); + JSONObject queryInfo3 = new JSONObject(); queryInfo3.put("date_end", object.getString("date_end")); queryInfo3.put("date_begin", object.getString("date_begin")); queryInfo3.put("corp", object.getString("corp")); - queryInfo3.put("code", object.getString("code")); + queryInfo3.put("code", code); + jsonObject1.put("approveinfo", unsignInfo3); jsonObject1.put("queryinfo", queryInfo3); break; - case "4": //采购订单删除 + case "4": //删除 1\采购订单删除 2\销售订单删除 3\调拨订单删除 JSONObject unsignInfo4 = new JSONObject(); unsignInfo4.put("coperator", object.getString("coperator")); + JSONObject queryInfo4 = new JSONObject(); queryInfo4.put("date_end", object.getString("date_end")); queryInfo4.put("date_begin", object.getString("date_begin")); queryInfo4.put("corp", object.getString("corp")); - queryInfo4.put("code", object.getString("code")); + queryInfo4.put("code", code); + jsonObject1.put("deleteinfo", unsignInfo4); jsonObject1.put("queryinfo", queryInfo4); break; From 07d896204608c81177cbf8e5867f3dfc49157937 Mon Sep 17 00:00:00 2001 From: username Date: Sat, 7 Sep 2024 14:12:25 +0800 Subject: [PATCH 051/101] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=EF=BC=8C=E5=AE=9A=E6=97=B6=E6=8F=92=E4=BB=B6=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E6=B6=88=E6=81=AF=EF=BC=8C=E6=B6=88=E6=81=AF=E6=A8=A1=E7=89=88?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=EF=BC=8C=E6=8E=A8=E9=80=81=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pushMessage/dao/IPushMessageDao.java | 7 + .../dao/impl/PushMessageDaoImpl.java | 8 + .../pushMessage/entity/PushMessageEntity.java | 106 ++++ .../pushMessage/entity/PushMessageEntity.xml | 43 ++ .../plugin/PushMessagePluginInitializer.java | 77 +++ .../service/IPushMessageService.java | 10 + .../service/impl/PushMessageServiceImpl.java | 25 + .../main/resources/application-zqtlocal.yml | 2 +- .../sysnew/message/dao/ISysMessageDao.java | 15 + .../message/dao/impl/SysMessageDaoImpl.java | 17 + .../message/entity/SysMessageEntity.java | 136 +++++ .../message/entity/SysMessageEntity.xml | 327 ++++++++++++ .../message/service/ISysMessageService.java | 26 + .../service/impl/SysMessageServiceImpl.java | 112 ++++ .../dao/ISysMessageTemplateDao.java | 15 + .../dao/impl/SysMessageTemplateDaoImpl.java | 17 + .../entity/SysMessageTemplateEntity.java | 136 +++++ .../entity/SysMessageTemplateEntity.xml | 328 ++++++++++++ .../service/ISysMessageTemplateService.java | 36 ++ .../impl/SysMessageTemplateServiceImpl.java | 205 ++++++++ .../pushMessage/dao/ISysPushMessageDao.java | 7 + .../dao/impl/SysPushMessageDaoImpl.java | 10 + .../entity/SysPushMessageEntity.java | 116 ++++ .../entity/SysPushMessageEntity.xml | 42 ++ .../service/ISysPushMessageService.java | 10 + .../impl/SysPushMessageServiceImpl.java | 33 ++ .../dao/ISysSendMessageLogDao.java | 15 + .../dao/impl/SysSendMessageLogDaoImpl.java | 17 + .../entity/SysSendMessageLogEntity.java | 126 +++++ .../entity/SysSendMessageLogEntity.xml | 353 +++++++++++++ .../service/ISysSendMessageLogService.java | 34 ++ .../impl/SysSendMessageLogServiceImpl.java | 496 ++++++++++++++++++ .../sysnew/user/entity/SysUserEntity.java | 20 + .../sysnew/user/entity/SysUserEntity.xml | 9 +- .../dao/ISysWarningConfigDao.java | 15 + .../dao/impl/SysWarningConfigDaoImpl.java | 17 + .../entity/SysWarningConfigEntity.java | 96 ++++ .../entity/SysWarningConfigEntity.xml | 283 ++++++++++ .../service/ISysWarningConfigService.java | 29 + .../impl/SysWarningConfigServiceImpl.java | 167 ++++++ .../dao/ISysWarningInterfaceDao.java | 15 + .../dao/impl/SysWarningInterfaceDaoImpl.java | 17 + .../entity/SysWarningInterfaceEntity.java | 76 +++ .../entity/SysWarningInterfaceEntity.xml | 254 +++++++++ .../service/ISysWarningInterfaceService.java | 29 + .../impl/SysWarningInterfaceServiceImpl.java | 167 ++++++ 46 files changed, 4099 insertions(+), 2 deletions(-) create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/dao/IPushMessageDao.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/dao/impl/PushMessageDaoImpl.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/entity/PushMessageEntity.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/entity/PushMessageEntity.xml create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/plugin/PushMessagePluginInitializer.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/service/IPushMessageService.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/service/impl/PushMessageServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/message/dao/ISysMessageDao.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/message/dao/impl/SysMessageDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/message/entity/SysMessageEntity.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/message/entity/SysMessageEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/sysnew/message/service/ISysMessageService.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/message/service/impl/SysMessageServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/messageTemplate/dao/ISysMessageTemplateDao.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/messageTemplate/dao/impl/SysMessageTemplateDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/messageTemplate/entity/SysMessageTemplateEntity.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/messageTemplate/entity/SysMessageTemplateEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/sysnew/messageTemplate/service/ISysMessageTemplateService.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/messageTemplate/service/impl/SysMessageTemplateServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/pushMessage/dao/ISysPushMessageDao.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/pushMessage/dao/impl/SysPushMessageDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/sysnew/pushMessage/service/ISysPushMessageService.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/pushMessage/service/impl/SysPushMessageServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/dao/ISysSendMessageLogDao.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/dao/impl/SysSendMessageLogDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/ISysSendMessageLogService.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/warningConfig/dao/ISysWarningConfigDao.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/warningConfig/dao/impl/SysWarningConfigDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/warningConfig/entity/SysWarningConfigEntity.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/warningConfig/entity/SysWarningConfigEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/sysnew/warningConfig/service/ISysWarningConfigService.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/warningConfig/service/impl/SysWarningConfigServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/warningInterface/dao/ISysWarningInterfaceDao.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/warningInterface/dao/impl/SysWarningInterfaceDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/sysnew/warningInterface/service/ISysWarningInterfaceService.java create mode 100644 service/src/main/java/com/hzya/frame/sysnew/warningInterface/service/impl/SysWarningInterfaceServiceImpl.java diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/dao/IPushMessageDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/dao/IPushMessageDao.java new file mode 100644 index 00000000..fa96f193 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/dao/IPushMessageDao.java @@ -0,0 +1,7 @@ +package com.hzya.frame.plugin.pushMessage.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity; + +public interface IPushMessageDao extends IBaseDao { +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/dao/impl/PushMessageDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/dao/impl/PushMessageDaoImpl.java new file mode 100644 index 00000000..adff81f2 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/dao/impl/PushMessageDaoImpl.java @@ -0,0 +1,8 @@ +package com.hzya.frame.plugin.pushMessage.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.pushMessage.dao.IPushMessageDao; +import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity; + +public class PushMessageDaoImpl extends MybatisGenericDao implements IPushMessageDao { +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/entity/PushMessageEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/entity/PushMessageEntity.java new file mode 100644 index 00000000..a91f1e6a --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/entity/PushMessageEntity.java @@ -0,0 +1,106 @@ +package com.hzya.frame.plugin.pushMessage.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +public class PushMessageEntity extends BaseEntity { + + private String pushMethod; + private String warningAppCode; + private String warningApiCode; + private String recipientIdList; + private String warningAppType; + private String sendAppName; + private String receiveAppName; + private String receiveApiName; + private String returnData; + private String receiveApiCode; + private String status; + + public String getPushMethod() { + return pushMethod; + } + + public void setPushMethod(String pushMethod) { + this.pushMethod = pushMethod; + } + + public String getWarningAppCode() { + return warningAppCode; + } + + public void setWarningAppCode(String warningAppCode) { + this.warningAppCode = warningAppCode; + } + + public String getWarningApiCode() { + return warningApiCode; + } + + public void setWarningApiCode(String warningApiCode) { + this.warningApiCode = warningApiCode; + } + + public String getRecipientIdList() { + return recipientIdList; + } + + public void setRecipientIdList(String recipientIdList) { + this.recipientIdList = recipientIdList; + } + + public String getWarningAppType() { + return warningAppType; + } + + public void setWarningAppType(String warningAppType) { + this.warningAppType = warningAppType; + } + + public String getSendAppName() { + return sendAppName; + } + + public void setSendAppName(String sendAppName) { + this.sendAppName = sendAppName; + } + + public String getReceiveAppName() { + return receiveAppName; + } + + public void setReceiveAppName(String receiveAppName) { + this.receiveAppName = receiveAppName; + } + + public String getReceiveApiName() { + return receiveApiName; + } + + public void setReceiveApiName(String receiveApiName) { + this.receiveApiName = receiveApiName; + } + + public String getReturnData() { + return returnData; + } + + public void setReturnData(String returnData) { + this.returnData = returnData; + } + + public String getReceiveApiCode() { + return receiveApiCode; + } + + public void setReceiveApiCode(String receiveApiCode) { + this.receiveApiCode = receiveApiCode; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/entity/PushMessageEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/entity/PushMessageEntity.xml new file mode 100644 index 00000000..af2614b6 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/entity/PushMessageEntity.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/plugin/PushMessagePluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/plugin/PushMessagePluginInitializer.java new file mode 100644 index 00000000..3e0a996f --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/plugin/PushMessagePluginInitializer.java @@ -0,0 +1,77 @@ +package com.hzya.frame.plugin.pushMessage.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.pushMessage.dao.IPushMessageDao; +import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity; +import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataService; +import com.hzya.frame.sysnew.pushMessage.dao.ISysPushMessageDao; +import com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity; +import com.hzya.frame.sysnew.pushMessage.service.ISysPushMessageService; +import com.hzya.frame.sysnew.sendMessageLog.service.ISysSendMessageLogService; +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.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +@Service("PushMessagePluginInitializer") +public class PushMessagePluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(PushMessagePluginInitializer.class); + + @Autowired + private ISysPushMessageDao sysPushMessageDao; + + @Resource + public ISysSendMessageLogService sysSendMessageLogService; + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "PushMessagePlugin"; + } + + @Override + public String getPluginName() { + return "PushMessagePlugin插件"; + } + + @Override + public String getPluginLabel() { + return "PushMessagePlugin"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + logger.info("======开始执行定时消息推送========"); + List list = sysPushMessageDao.getAll(); + + for(SysPushMessageEntity entity : list){ + sysSendMessageLogService.sendMessage(entity); + } + return BaseResult.getSuccessMessageEntity("定时推送消息成功"); + }catch (Exception e){ + logger.info("======执行定时消息推送失败:{}========",e.getMessage()); + e.printStackTrace(); + } + return null; + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/service/IPushMessageService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/service/IPushMessageService.java new file mode 100644 index 00000000..1109a5bd --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/service/IPushMessageService.java @@ -0,0 +1,10 @@ +package com.hzya.frame.plugin.pushMessage.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +public interface IPushMessageService extends IBaseService { + +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/service/impl/PushMessageServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/service/impl/PushMessageServiceImpl.java new file mode 100644 index 00000000..8101cda9 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/pushMessage/service/impl/PushMessageServiceImpl.java @@ -0,0 +1,25 @@ +package com.hzya.frame.plugin.pushMessage.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.plugin.pushMessage.dao.IPushMessageDao; +import com.hzya.frame.plugin.pushMessage.entity.PushMessageEntity; +import com.hzya.frame.plugin.pushMessage.service.IPushMessageService; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +public class PushMessageServiceImpl extends BaseService implements IPushMessageService { + + private IPushMessageDao pushMessageDao; + + @Autowired + public void setPushMessageDao(IPushMessageDao dao) { + this.pushMessageDao = dao; + this.dao = dao; + } + +} diff --git a/buildpackage/src/main/resources/application-zqtlocal.yml b/buildpackage/src/main/resources/application-zqtlocal.yml index a656bd59..ffff00a3 100644 --- a/buildpackage/src/main/resources/application-zqtlocal.yml +++ b/buildpackage/src/main/resources/application-zqtlocal.yml @@ -2,7 +2,7 @@ logging: #日志级别 指定目录级别 level: - root: warn + root: info encodings: UTF-8 file: # 日志保存路径 diff --git a/service/src/main/java/com/hzya/frame/sysnew/message/dao/ISysMessageDao.java b/service/src/main/java/com/hzya/frame/sysnew/message/dao/ISysMessageDao.java new file mode 100644 index 00000000..94aed6d7 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/message/dao/ISysMessageDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.sysnew.message.dao; + +import com.hzya.frame.sysnew.message.entity.SysMessageEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * (sys_message: table)表数据库访问层 + * + * @author makejava + * @since 2024-08-30 14:17:11 + */ +public interface ISysMessageDao extends IBaseDao { + +} + diff --git a/service/src/main/java/com/hzya/frame/sysnew/message/dao/impl/SysMessageDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/message/dao/impl/SysMessageDaoImpl.java new file mode 100644 index 00000000..7734cd43 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/message/dao/impl/SysMessageDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.sysnew.message.dao.impl; + +import com.hzya.frame.sysnew.message.entity.SysMessageEntity; +import com.hzya.frame.sysnew.message.dao.ISysMessageDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * (SysMessage)表数据库访问层 + * + * @author makejava + * @since 2024-08-30 14:17:11 + */ +@Repository(value = "SysMessageDaoImpl") +public class SysMessageDaoImpl extends MybatisGenericDao implements ISysMessageDao{ + +} + diff --git a/service/src/main/java/com/hzya/frame/sysnew/message/entity/SysMessageEntity.java b/service/src/main/java/com/hzya/frame/sysnew/message/entity/SysMessageEntity.java new file mode 100644 index 00000000..a5488938 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/message/entity/SysMessageEntity.java @@ -0,0 +1,136 @@ +package com.hzya.frame.sysnew.message.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * (SysMessage)实体类 + * + * @author makejava + * @since 2024-08-30 14:17:11 + */ +public class SysMessageEntity extends BaseEntity { + + /** 公司id */ + private String companyId; + /** 调用单据类型 */ + private Integer billKindId; + /** 来源业务单据id */ + private String billId; + /** 模版id */ + private String templateId; + /** 1文本消息 2 卡片消息 */ + private String messageType; + /** 消息标题 */ + private String title; + /** 消息内容 */ + private String content; + /** 消息操作区域 */ + private String btns; + /** 发送时间 */ + private Date pushTime; + /** 发送者 */ + private String sendPersonId; + /** 接受者 */ + private String sendToPersonId; + /** 状态 */ + private Integer state; + + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + public Integer getBillKindId() { + return billKindId; + } + + public void setBillKindId(Integer billKindId) { + this.billKindId = billKindId; + } + + public String getBillId() { + return billId; + } + + public void setBillId(String billId) { + this.billId = billId; + } + + public String getTemplateId() { + return templateId; + } + + public void setTemplateId(String templateId) { + this.templateId = templateId; + } + + public String getMessageType() { + return messageType; + } + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getBtns() { + return btns; + } + + public void setBtns(String btns) { + this.btns = btns; + } + + public Date getPushTime() { + return pushTime; + } + + public void setPushTime(Date pushTime) { + this.pushTime = pushTime; + } + + public String getSendPersonId() { + return sendPersonId; + } + + public void setSendPersonId(String sendPersonId) { + this.sendPersonId = sendPersonId; + } + + public String getSendToPersonId() { + return sendToPersonId; + } + + public void setSendToPersonId(String sendToPersonId) { + this.sendToPersonId = sendToPersonId; + } + + public Integer getState() { + return state; + } + + public void setState(Integer state) { + this.state = state; + } + +} + diff --git a/service/src/main/java/com/hzya/frame/sysnew/message/entity/SysMessageEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/message/entity/SysMessageEntity.xml new file mode 100644 index 00000000..080729bf --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/message/entity/SysMessageEntity.xml @@ -0,0 +1,327 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + ,sorts + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,org_id + ,company_id + ,bill_kind_id + ,bill_id + ,template_id + ,message_type + ,title + ,content + ,btns + ,push_time + ,send_person_id + ,send_to_person_id + ,state + + + + + + + + + + + + + + + + + + + insert into sys_message( + + id , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + bill_kind_id , + bill_id , + template_id , + message_type , + title , + content , + btns , + push_time , + send_person_id , + send_to_person_id , + state , + sts, + + )values( + + #{id} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + #{billKindId} , + #{billId} , + #{templateId} , + #{messageType} , + #{title} , + #{content} , + #{btns} , + #{pushTime} , + #{sendPersonId} , + #{sendToPersonId} , + #{state} , + 'Y', + + ) + + + + insert into sys_message(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, bill_kind_id, bill_id, template_id, message_type, title, content, btns, push_time, send_person_id, send_to_person_id, state, sts) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.billKindId},#{entity.billId},#{entity.templateId},#{entity.messageType},#{entity.title},#{entity.content},#{entity.btns},#{entity.pushTime},#{entity.sendPersonId},#{entity.sendToPersonId},#{entity.state}, 'Y') + + + + + insert into sys_message(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, bill_kind_id, bill_id, template_id, message_type, title, content, btns, push_time, send_person_id, send_to_person_id, state) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.billKindId},#{entity.billId},#{entity.templateId},#{entity.messageType},#{entity.title},#{entity.content},#{entity.btns},#{entity.pushTime},#{entity.sendPersonId},#{entity.sendToPersonId},#{entity.state}) + + 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), + org_id = values(org_id), + company_id = values(company_id), + bill_kind_id = values(bill_kind_id), + bill_id = values(bill_id), + template_id = values(template_id), + message_type = values(message_type), + title = values(title), + content = values(content), + btns = values(btns), + push_time = values(push_time), + send_person_id = values(send_person_id), + send_to_person_id = values(send_to_person_id), + state = values(state) + + +update sys_message set + + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + bill_kind_id = #{billKindId}, + bill_id = #{billId}, + template_id = #{templateId}, + message_type = #{messageType}, + title = #{title}, + content = #{content}, + btns = #{btns}, + push_time = #{pushTime}, + send_person_id = #{sendPersonId}, + send_to_person_id = #{sendToPersonId}, + state = #{state}, + +where id = #{id} + + + +update sys_message set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update sys_message set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and bill_kind_id = #{billKindId} + and bill_id = #{billId} + and template_id = #{templateId} + and message_type = #{messageType} + and title = #{title} + and content = #{content} + and btns = #{btns} + and push_time = #{pushTime} + and send_person_id = #{sendPersonId} + and send_to_person_id = #{sendToPersonId} + and state = #{state} + and sts='Y' + + + + + delete from sys_message where id = #{id} + + + + diff --git a/service/src/main/java/com/hzya/frame/sysnew/message/service/ISysMessageService.java b/service/src/main/java/com/hzya/frame/sysnew/message/service/ISysMessageService.java new file mode 100644 index 00000000..e3e2e2a2 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/message/service/ISysMessageService.java @@ -0,0 +1,26 @@ +package com.hzya.frame.sysnew.message.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.message.entity.SysMessageEntity; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * (SysMessage)表服务接口 + * + * @author makejava + * @since 2024-08-30 14:17:11 + */ +public interface ISysMessageService extends IBaseService{ + JsonResultEntity queryEntityPage(JSONObject jsonObject); + + JsonResultEntity queryEntity(JSONObject jsonObject); + + JsonResultEntity saveEntity(JSONObject jsonObject); + + JsonResultEntity getEntity(JSONObject jsonObject); + + JsonResultEntity updateEntity(JSONObject jsonObject); + + JsonResultEntity deleteEntity(JSONObject jsonObject); +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/message/service/impl/SysMessageServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/message/service/impl/SysMessageServiceImpl.java new file mode 100644 index 00000000..0421079b --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/message/service/impl/SysMessageServiceImpl.java @@ -0,0 +1,112 @@ +package com.hzya.frame.sysnew.message.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hzya.frame.sysnew.message.entity.SysMessageEntity; +import com.hzya.frame.sysnew.message.dao.ISysMessageDao; +import com.hzya.frame.sysnew.message.service.ISysMessageService; +import com.hzya.frame.sysnew.organ.entity.SysOrganEntity; +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; + +/** + * (SysMessage)表服务实现类 + * + * @author makejava + * @since 2024-08-30 14:17:11 + */ +@Service(value = "sysMessageService") +public class SysMessageServiceImpl extends BaseService implements ISysMessageService { + + private ISysMessageDao sysMessageDao; + + @Autowired + public void setSysMessageDao(ISysMessageDao dao) { + this.sysMessageDao = dao; + this.dao = dao; + } + + @Override + public JsonResultEntity queryEntityPage(JSONObject jsonObject){ + SysMessageEntity entity = getData("jsonStr", jsonObject, SysMessageEntity.class); + if(entity == null || entity.getPageNum() == null || entity.getPageSize() == null){ + return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + } + PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + List list = sysMessageDao.queryByLike(entity); + PageInfo pageInfo = new PageInfo<>(list); + return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo); + } + + @Override + public JsonResultEntity queryEntity(JSONObject jsonObject){ + SysMessageEntity entity = getData("jsonStr", jsonObject, SysMessageEntity.class); + if(entity == null){ + entity = new SysMessageEntity(); + } + List list = sysMessageDao.queryByLike(entity); + return BaseResult.getSuccessMessageEntity("查询数据成功", list); + } + + @Override + public JsonResultEntity getEntity(JSONObject jsonObject){ + SysMessageEntity entity = getData("jsonStr", jsonObject, SysMessageEntity.class); + if(entity == null){ + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if(entity.getId() == null || "".equals(entity.getId())){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity = sysMessageDao.get(entity.getId()); + if(entity == null){ + return BaseResult.getFailureMessageEntity("获取站内消息失败"); + } + return BaseResult.getSuccessMessageEntity("获取站内消息成功", entity); + } + + @Override + public JsonResultEntity saveEntity(JSONObject jsonObject) { + SysMessageEntity entity = getData("jsonStr", jsonObject, SysMessageEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + entity.setCreate(); + //保存 + sysMessageDao.save(entity); + return BaseResult.getSuccessMessageEntity("保存消息成功", entity); + } + + @Override + public JsonResultEntity updateEntity(JSONObject jsonObject) { + SysMessageEntity entity = getData("jsonStr", jsonObject, SysMessageEntity.class); + if(entity == null){ + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if(entity.getId() == null || "".equals(entity.getId())){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setUpdate(); + sysMessageDao.update(entity); + return BaseResult.getSuccessMessageEntity("修改站内消息成功", entity); + } + + @Override + public JsonResultEntity deleteEntity(JSONObject jsonObject) { + SysMessageEntity entity = getData("jsonStr", jsonObject, SysMessageEntity.class); + if(entity == null){ + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if(entity.getId() == null || "".equals(entity.getId())){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + sysMessageDao.logicRemove(entity); + return BaseResult.getSuccessMessageEntity("删除站内消息成功"); + } +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/messageTemplate/dao/ISysMessageTemplateDao.java b/service/src/main/java/com/hzya/frame/sysnew/messageTemplate/dao/ISysMessageTemplateDao.java new file mode 100644 index 00000000..a7a29b66 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/messageTemplate/dao/ISysMessageTemplateDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.sysnew.messageTemplate.dao; + +import com.hzya.frame.sysnew.messageTemplate.entity.SysMessageTemplateEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * (sys_message_template: table)表数据库访问层 + * + * @author makejava + * @since 2024-08-30 14:21:15 + */ +public interface ISysMessageTemplateDao extends IBaseDao { + +} + diff --git a/service/src/main/java/com/hzya/frame/sysnew/messageTemplate/dao/impl/SysMessageTemplateDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/messageTemplate/dao/impl/SysMessageTemplateDaoImpl.java new file mode 100644 index 00000000..10890a7a --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/messageTemplate/dao/impl/SysMessageTemplateDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.sysnew.messageTemplate.dao.impl; + +import com.hzya.frame.sysnew.messageTemplate.entity.SysMessageTemplateEntity; +import com.hzya.frame.sysnew.messageTemplate.dao.ISysMessageTemplateDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * (SysMessageTemplate)表数据库访问层 + * + * @author makejava + * @since 2024-08-30 14:21:15 + */ +@Repository(value = "SysMessageTemplateDaoImpl") +public class SysMessageTemplateDaoImpl extends MybatisGenericDao implements ISysMessageTemplateDao{ + +} + diff --git a/service/src/main/java/com/hzya/frame/sysnew/messageTemplate/entity/SysMessageTemplateEntity.java b/service/src/main/java/com/hzya/frame/sysnew/messageTemplate/entity/SysMessageTemplateEntity.java new file mode 100644 index 00000000..5cda5ede --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/messageTemplate/entity/SysMessageTemplateEntity.java @@ -0,0 +1,136 @@ +package com.hzya.frame.sysnew.messageTemplate.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * (SysMessageTemplate)实体类 + * + * @author makejava + * @since 2024-08-30 14:21:15 + */ +public class SysMessageTemplateEntity extends BaseEntity { + + /** 公司id */ + private String companyId; + /** 调用单据类型 */ + private String billKindId; + /** 模版类型 */ + private String templateType; + /** 模版名称 */ + private String templateName; + /** 消息标题 */ + private String messageTitle; + /** 消息内容 */ + private String messageContents; + /** 消息操作区域 */ + private String btns; + /** 数据源 */ + private String dataSource; + /** 创建时间 */ + private Date createDate; + /** 创建人 */ + private String createPersonId; + /** 状态 */ + private String state; + /** 删除标志 */ + private Integer isdelete; + + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + public String getBillKindId() { + return billKindId; + } + + public void setBillKindId(String billKindId) { + this.billKindId = billKindId; + } + + public String getTemplateType() { + return templateType; + } + + public void setTemplateType(String templateType) { + this.templateType = templateType; + } + + public String getTemplateName() { + return templateName; + } + + public void setTemplateName(String templateName) { + this.templateName = templateName; + } + + public String getMessageTitle() { + return messageTitle; + } + + public void setMessageTitle(String messageTitle) { + this.messageTitle = messageTitle; + } + + public String getMessageContents() { + return messageContents; + } + + public void setMessageContents(String messageContents) { + this.messageContents = messageContents; + } + + public String getBtns() { + return btns; + } + + public void setBtns(String btns) { + this.btns = btns; + } + + public String getDataSource() { + return dataSource; + } + + 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; + } + + public void setState(String state) { + this.state = state; + } + + public Integer getIsdelete() { + return isdelete; + } + + public void setIsdelete(Integer isdelete) { + this.isdelete = isdelete; + } + +} + diff --git a/service/src/main/java/com/hzya/frame/sysnew/messageTemplate/entity/SysMessageTemplateEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/messageTemplate/entity/SysMessageTemplateEntity.xml new file mode 100644 index 00000000..80002b16 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/messageTemplate/entity/SysMessageTemplateEntity.xml @@ -0,0 +1,328 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + ,sorts + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,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 + + + + + + + + + + + + + + + + + + + + insert into sys_message_template( + + id , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + 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( + + #{id} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + #{billKindId} , + #{templateType} , + #{templateName} , + #{messageTitle} , + #{messageContents} , + #{btns} , + #{dataSource} , + #{createDate} , + #{createPersonId} , + #{state} , + #{isdelete} , + 'Y', + + ) + + + + insert into sys_message_template(create_user_id, create_time, modify_user_id, modify_time, 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 + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.billKindId},#{entity.templateType},#{entity.templateName},#{entity.messageTitle},#{entity.messageContents},#{entity.btns},#{entity.dataSource},#{entity.createDate},#{entity.createPersonId},#{entity.state},#{entity.isdelete}, 'Y') + + + + + insert into sys_message_template(create_user_id, create_time, modify_user_id, modify_time, 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) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.billKindId},#{entity.templateType},#{entity.templateName},#{entity.messageTitle},#{entity.messageContents},#{entity.btns},#{entity.dataSource},#{entity.createDate},#{entity.createPersonId},#{entity.state},#{entity.isdelete}) + + 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), + org_id = values(org_id), + company_id = values(company_id), + bill_kind_id = values(bill_kind_id), + template_type = values(template_type), + template_name = values(template_name), + message_title = values(message_title), + message_contents = values(message_contents), + btns = values(btns), + data_source = values(data_source), + create_date = values(create_date), + create_person_id = values(create_person_id), + state = values(state), + isdelete = values(isdelete) + + +update sys_message_template set + + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + 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} + + + +update sys_message_template set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update sys_message_template set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and sorts = #{sorts} + and sts = #{sts} + 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' + + + + + delete from sys_message_template where id = #{id} + + + + diff --git a/service/src/main/java/com/hzya/frame/sysnew/messageTemplate/service/ISysMessageTemplateService.java b/service/src/main/java/com/hzya/frame/sysnew/messageTemplate/service/ISysMessageTemplateService.java new file mode 100644 index 00000000..bb553613 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/messageTemplate/service/ISysMessageTemplateService.java @@ -0,0 +1,36 @@ +package com.hzya.frame.sysnew.messageTemplate.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.messageTemplate.entity.SysMessageTemplateEntity; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.ibatis.annotations.Select; + +import java.sql.SQLException; + +/** + * (SysMessageTemplate)表服务接口 + * + * @author makejava + * @since 2024-08-30 14:21:15 + */ +public interface ISysMessageTemplateService extends IBaseService{ + JsonResultEntity queryEntityPage(JSONObject jsonObject); + + JsonResultEntity queryEntity(JSONObject jsonObject); + + JsonResultEntity saveEntity(JSONObject jsonObject); + + JsonResultEntity getEntity(JSONObject jsonObject); + + JsonResultEntity updateEntity(JSONObject jsonObject); + + JsonResultEntity deleteEntity(JSONObject jsonObject); + + JsonResultEntity enableDisableEntity(JSONObject jsonObject); + + JsonResultEntity checkSql(JSONObject jsonObject)throws Exception; + + JsonResultEntity spliceMessage(JSONObject jsonObject); + +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/messageTemplate/service/impl/SysMessageTemplateServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/messageTemplate/service/impl/SysMessageTemplateServiceImpl.java new file mode 100644 index 00000000..7f4db12a --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/messageTemplate/service/impl/SysMessageTemplateServiceImpl.java @@ -0,0 +1,205 @@ +package com.hzya.frame.sysnew.messageTemplate.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hzya.frame.execsql.service.IExecSqlService; +import com.hzya.frame.sysnew.messageTemplate.entity.SysMessageTemplateEntity; +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.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.*; +import java.util.HashMap; +import java.util.List; + +/** + * (SysMessageTemplate)表服务实现类 + * + * @author makejava + * @since 2024-08-30 14:21:15 + */ +@Service(value = "sysMessageTemplateService") +public class SysMessageTemplateServiceImpl extends BaseService implements ISysMessageTemplateService { + + private ISysMessageTemplateDao sysMessageTemplateDao; + + @Resource + public IExecSqlService execSqlService; + + @Autowired + 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 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 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 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 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 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 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("消息拼接成功"); + } +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/pushMessage/dao/ISysPushMessageDao.java b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/dao/ISysPushMessageDao.java new file mode 100644 index 00000000..7c9c4303 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/dao/ISysPushMessageDao.java @@ -0,0 +1,7 @@ +package com.hzya.frame.sysnew.pushMessage.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity; + +public interface ISysPushMessageDao extends IBaseDao{ +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/pushMessage/dao/impl/SysPushMessageDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/dao/impl/SysPushMessageDaoImpl.java new file mode 100644 index 00000000..3ede38a6 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/dao/impl/SysPushMessageDaoImpl.java @@ -0,0 +1,10 @@ +package com.hzya.frame.sysnew.pushMessage.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.sysnew.pushMessage.dao.ISysPushMessageDao; +import com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity; +import org.springframework.stereotype.Repository; + +@Repository("sysPushMessageDaoImpl") +public class SysPushMessageDaoImpl extends MybatisGenericDao implements ISysPushMessageDao { +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.java b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.java new file mode 100644 index 00000000..ba467aee --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.java @@ -0,0 +1,116 @@ +package com.hzya.frame.sysnew.pushMessage.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +public class SysPushMessageEntity extends BaseEntity { + /** 推送方式 “一次”、“定时” */ + private String pushMethod; + /** 预警应用编码 */ + private String warningAppCode; + /** 预警接口编码 */ + private String warningApiCode; + /** 接收者ID列表*/ + private String recipientIdList; + /** 预警应用类型 */ + private String warningAppType; + /** 发送应用名称 */ + private String sendAppName; + /** 接收应用名称 */ + private String receiveAppName; + /** 接收接口名称 */ + private String receiveApiName; + /** 返回信息 */ + private String returnData; + /** 接收接口编码 */ + private String receiveApiCode; + /** 状态(1、待发送2、发送中3、发送成功4、发送失败) */ + private String status; + + public String getPushMethod() { + return pushMethod; + } + + public void setPushMethod(String pushMethod) { + this.pushMethod = pushMethod; + } + + public String getWarningAppCode() { + return warningAppCode; + } + + public void setWarningAppCode(String warningAppCode) { + this.warningAppCode = warningAppCode; + } + + public String getWarningApiCode() { + return warningApiCode; + } + + public void setWarningApiCode(String warningApiCode) { + this.warningApiCode = warningApiCode; + } + + public String getRecipientIdList() { + return recipientIdList; + } + + public void setRecipientIdList(String recipientIdList) { + this.recipientIdList = recipientIdList; + } + + public String getWarningAppType() { + return warningAppType; + } + + public void setWarningAppType(String warningAppType) { + this.warningAppType = warningAppType; + } + + public String getSendAppName() { + return sendAppName; + } + + public void setSendAppName(String sendAppName) { + this.sendAppName = sendAppName; + } + + public String getReceiveAppName() { + return receiveAppName; + } + + public void setReceiveAppName(String receiveAppName) { + this.receiveAppName = receiveAppName; + } + + public String getReceiveApiName() { + return receiveApiName; + } + + public void setReceiveApiName(String receiveApiName) { + this.receiveApiName = receiveApiName; + } + + public String getReturnData() { + return returnData; + } + + public void setReturnData(String returnData) { + this.returnData = returnData; + } + + public String getReceiveApiCode() { + return receiveApiCode; + } + + public void setReceiveApiCode(String receiveApiCode) { + this.receiveApiCode = receiveApiCode; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.xml new file mode 100644 index 00000000..be1fd3e3 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/service/src/main/java/com/hzya/frame/sysnew/pushMessage/service/ISysPushMessageService.java b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/service/ISysPushMessageService.java new file mode 100644 index 00000000..67f4583b --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/service/ISysPushMessageService.java @@ -0,0 +1,10 @@ +package com.hzya.frame.sysnew.pushMessage.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +public interface ISysPushMessageService extends IBaseService{ + JsonResultEntity queryEntity(JSONObject jsonObject); +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/pushMessage/service/impl/SysPushMessageServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/service/impl/SysPushMessageServiceImpl.java new file mode 100644 index 00000000..28a7028d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/service/impl/SysPushMessageServiceImpl.java @@ -0,0 +1,33 @@ +package com.hzya.frame.sysnew.pushMessage.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.sysnew.pushMessage.dao.ISysPushMessageDao; +import com.hzya.frame.sysnew.pushMessage.dao.impl.SysPushMessageDaoImpl; +import com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity; +import com.hzya.frame.sysnew.pushMessage.service.ISysPushMessageService; +import com.hzya.frame.sysnew.sendMessageLog.dao.ISysSendMessageLogDao; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service("sysPushMessageService") +public class SysPushMessageServiceImpl extends BaseService implements ISysPushMessageService { + + private ISysPushMessageDao sysPushMessageDao; + + @Autowired + public void setSysPushMessageDao(ISysPushMessageDao dao) { + this.sysPushMessageDao = dao; + this.dao = dao; + } + + @Override + public JsonResultEntity queryEntity(JSONObject jsonObject){ + List list = sysPushMessageDao.getAll(); + return BaseResult.getSuccessMessageEntity("success"); + } +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/dao/ISysSendMessageLogDao.java b/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/dao/ISysSendMessageLogDao.java new file mode 100644 index 00000000..5359eede --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/dao/ISysSendMessageLogDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.sysnew.sendMessageLog.dao; + +import com.hzya.frame.sysnew.sendMessageLog.entity.SysSendMessageLogEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * (sys_send_message_log: table)表数据库访问层 + * + * @author makejava + * @since 2024-08-30 14:19:30 + */ +public interface ISysSendMessageLogDao extends IBaseDao { + +} + diff --git a/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/dao/impl/SysSendMessageLogDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/dao/impl/SysSendMessageLogDaoImpl.java new file mode 100644 index 00000000..7593f996 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/dao/impl/SysSendMessageLogDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.sysnew.sendMessageLog.dao.impl; + +import com.hzya.frame.sysnew.sendMessageLog.entity.SysSendMessageLogEntity; +import com.hzya.frame.sysnew.sendMessageLog.dao.ISysSendMessageLogDao; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +/** + * (SysSendMessageLog)表数据库访问层 + * + * @author makejava + * @since 2024-08-30 14:19:30 + */ +@Repository(value = "SysSendMessageLogDaoImpl") +public class SysSendMessageLogDaoImpl extends MybatisGenericDao implements ISysSendMessageLogDao{ + +} + diff --git a/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.java b/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.java new file mode 100644 index 00000000..6e88baf2 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.java @@ -0,0 +1,126 @@ +package com.hzya.frame.sysnew.sendMessageLog.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * (SysSendMessageLog)实体类 + * + * @author makejava + * @since 2024-08-30 14:19:30 + */ +public class SysSendMessageLogEntity extends BaseEntity { + + /** 公司id */ + private String companyId; + /** 来源业务单据 */ + private String billId; + /** 消息类型(1、系统消息、2、单据消息、3、钉钉、4微信、5短信、6、邮件) */ + private String type; + /** 发送给谁(三方系统userID 钉钉微信、邮箱、手机号) */ + private String sendToUserId; + /** 发送给系统内部人员ID */ + private String sendToPersonId; + /** 消息内容 */ + private String sendCount; + /** 发送时间 */ + private Date sendDatetime; + /** 发送人Id */ + private String sendPersonId; + /** 消息发送来源模块 */ + private String sourceModelName; + /** 消息状态(0未读1已读) */ + private Integer state; + /** 三方系统消息结果 */ + private String resultMessage; + + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + public String getBillId() { + return billId; + } + + public void setBillId(String billId) { + this.billId = billId; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getSendToUserId() { + return sendToUserId; + } + + public void setSendToUserId(String sendToUserId) { + this.sendToUserId = sendToUserId; + } + + public String getSendToPersonId() { + return sendToPersonId; + } + + public void setSendToPersonId(String sendToPersonId) { + this.sendToPersonId = sendToPersonId; + } + + public String getSendCount() { + return sendCount; + } + + public void setSendCount(String sendCount) { + this.sendCount = sendCount; + } + + public Date getSendDatetime() { + return sendDatetime; + } + + public void setSendDatetime(Date sendDatetime) { + this.sendDatetime = sendDatetime; + } + + public String getSendPersonId() { + return sendPersonId; + } + + public void setSendPersonId(String sendPersonId) { + this.sendPersonId = sendPersonId; + } + + public String getSourceModelName() { + return sourceModelName; + } + + public void setSourceModelName(String sourceModelName) { + this.sourceModelName = sourceModelName; + } + + public Integer getState() { + return state; + } + + public void setState(Integer state) { + this.state = state; + } + + public String getResultMessage() { + return resultMessage; + } + + public void setResultMessage(String resultMessage) { + this.resultMessage = resultMessage; + } + +} + diff --git a/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.xml new file mode 100644 index 00000000..144a67e7 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/entity/SysSendMessageLogEntity.xml @@ -0,0 +1,353 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + ,sorts + ,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( + + id , + sorts , + 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, + + )values( + + #{id} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + #{billId} , + #{type} , + #{sendToUserId} , + #{sendToPersonId} , + #{sendCount} , + #{sendDatetime} , + #{sendPersonId} , + #{sourceModelName} , + #{state} , + #{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, 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') + + + + + 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) + 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}) + + 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), + org_id = values(org_id), + 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), + send_count = values(send_count), + send_datetime = values(send_datetime), + send_person_id = values(send_person_id), + source_model_name = values(source_model_name), + state = values(state), + result_message = values(result_message) + + +update sys_send_message_log set + + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + bill_id = #{billId}, + type = #{type}, + send_to_user_id = #{sendToUserId}, + send_to_person_id = #{sendToPersonId}, + send_count = #{sendCount}, + send_datetime = #{sendDatetime}, + send_person_id = #{sendPersonId}, + source_model_name = #{sourceModelName}, + state = #{state}, + result_message = #{resultMessage}, + +where id = #{id} + + + +update sys_send_message_log set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update sys_send_message_log set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + 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 send_count = #{sendCount} + and send_datetime = #{sendDatetime} + and send_person_id = #{sendPersonId} + and source_model_name = #{sourceModelName} + and state = #{state} + and result_message = #{resultMessage} + and sts='Y' + + + + + delete from sys_send_message_log where id = #{id} + + + + + + + + diff --git a/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/ISysSendMessageLogService.java b/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/ISysSendMessageLogService.java new file mode 100644 index 00000000..929a22b3 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/ISysSendMessageLogService.java @@ -0,0 +1,34 @@ +package com.hzya.frame.sysnew.sendMessageLog.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity; +import com.hzya.frame.sysnew.sendMessageLog.entity.SysSendMessageLogEntity; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * (SysSendMessageLog)表服务接口 + * + * @author makejava + * @since 2024-08-30 14:19:30 + */ +public interface ISysSendMessageLogService extends IBaseService{ + + + JsonResultEntity queryEntityPage(JSONObject jsonObject); + + JsonResultEntity queryEntity(JSONObject jsonObject); + + JsonResultEntity getEntity(JSONObject jsonObject); + + JsonResultEntity saveEntity(JSONObject jsonObject); + + JsonResultEntity updateEntity(JSONObject jsonObject); + + JsonResultEntity deleteEntity(JSONObject jsonObject); + + boolean sendMessage(SysPushMessageEntity entity); + + + +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java new file mode 100644 index 00000000..846c1f9f --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java @@ -0,0 +1,496 @@ +package com.hzya.frame.sysnew.sendMessageLog.service.impl; + +import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hzya.frame.sysnew.application.apiPara.dao.ISysApplicationApiParaDao; +import com.hzya.frame.sysnew.application.apiPara.entity.SysApplicationApiParaEntity; +import com.hzya.frame.sysnew.messageTemplate.dao.ISysMessageTemplateDao; +import com.hzya.frame.sysnew.messageTemplate.entity.SysMessageTemplateEntity; +import com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity; +import com.hzya.frame.sysnew.sendMessageLog.entity.SysSendMessageLogEntity; +import com.hzya.frame.sysnew.sendMessageLog.dao.ISysSendMessageLogDao; +import com.hzya.frame.sysnew.sendMessageLog.service.ISysSendMessageLogService; +import com.hzya.frame.sysnew.user.dao.ISysUserDao; +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.sysnew.warningInterface.dao.ISysWarningInterfaceDao; +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.stereotype.Service; +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.Date; +import java.util.List; + +/** + * (SysSendMessageLog)表服务实现类 + * + * @author makejava + * @since 2024-08-30 14:19:30 + */ +@Service(value = "sysSendMessageLogService") +public class SysSendMessageLogServiceImpl extends BaseService implements ISysSendMessageLogService { + + @Resource + private ISysWarningInterfaceDao sysWarningInterfaceDao; + @Resource + private ISysWarningConfigDao sysWarningConfigDao; + @Resource + private ISysMessageTemplateDao sysMessageTemplateDao; + @Resource + private ISysUserDao sysUserDao; + @Resource + private ISysApplicationApiParaDao sysApplicationApiParaDao; + + private ISysSendMessageLogDao sysSendMessageLogDao; + + @Autowired + public void setSysSendMessageLogDao(ISysSendMessageLogDao dao) { + this.sysSendMessageLogDao = dao; + this.dao = dao; + } + + @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 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 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 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 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 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); + } + +// public JsonResultEntity sendMsg(JSONObject jsonObject){ +// //拼接一条测试消息数据 +// jsonObject.put("log_id","e2f213567c2242eab7401edcb3949c45"); +// jsonObject.put("send_app_name","数智中台"); +// jsonObject.put("recieve_app_name","东进U8C"); +// jsonObject.put("recieve_api_name","存货基本档案修改"); +// jsonObject.put("receive_api_code","8000350046"); +// jsonObject.put("return_data","{\n" + +// " \"status\": \"falied\",\n" + +// " \"errorcode\": \"-32000\",\n" + +// " \"errormsg\": \"U8C返回信息:以下档案在U8cloud系统中根据公司或者账簿信息找不到,请检查!详细信息:1、档案类型:计量档案,公司编码:0001,档案编码:个;\",\n" + +// " \"taskNumber\": \"202408220001\"\n" + +// "}"); +// jsonObject.put("status","4"); +// jsonObject.put("url","https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2"); +// jsonObject.put("appType","5DD"); +// +// //1、根据测试消息状态(成功、失败),以及目标API是否启用推送,决定是否要推送消息(只推送失败的,且启用推送的) +// //2、根据目标API,找到其消息模版,并根据模版生成消息内容 +// //3、根据目标API,找到其预警应用api,并推送消息 +// String status = jsonObject.get("status").toString(); +// String receiveApiCode = jsonObject.get("receive_api_code").toString(); +// String sendAppName = jsonObject.get("send_app_name").toString(); +// String receiveApiName = jsonObject.get("recieve_api_name").toString(); +// String recieveAppName = jsonObject.get("recieve_app_name").toString(); +// String returnData = jsonObject.get("return_data").toString(); +// String url = jsonObject.get("url").toString(); +// String appType = jsonObject.get("appType").toString(); +// String sendMsgContent = ""; +// +// SysWarningInterfaceEntity interfaceEntity = new SysWarningInterfaceEntity(); +// SysWarningConfigEntity configEntity = new SysWarningConfigEntity(); +// SysMessageTemplateEntity templateEntity = new SysMessageTemplateEntity(); +// +// interfaceEntity.setApiCode(receiveApiCode); +// +// if(status == null){ +// logger.error("日志状态为空"); +// return BaseResult.getFailureMessageEntity("日志状态为空"); +// } +// if ("4".equals(status)) { +// interfaceEntity = sysWarningInterfaceDao.queryOne(interfaceEntity); +// if(interfaceEntity == null){ +// logger.error("未找到API接口预警信息"); +// return BaseResult.getFailureMessageEntity("未找到API接口预警信息"); +// } +// if(interfaceEntity.getStatus() == null || interfaceEntity.getStatus().equals("1") == false){ +// logger.error("API接口未启用推送"); +// return BaseResult.getFailureMessageEntity("API接口未启用推送"); +// } +// //根据主表id,找到主表记录中的消息模版id +// String warningConfigId = interfaceEntity.getWarningConfigId(); +// if(warningConfigId == null || "".equals(warningConfigId)){ +// logger.error("未找到该接口预警配置信息的主表id"); +// return BaseResult.getFailureMessageEntity("未找到该接口预警配置信息的主表id"); +// } +// configEntity = sysWarningConfigDao.get(warningConfigId); +// if(configEntity == null){ +// logger.error("未找到该接口预警配置信息"); +// return BaseResult.getFailureMessageEntity("未找到该接口预警配置信息"); +// } +// +// String messageTemplateId = configEntity.getMessageTemplateId(); +// if(messageTemplateId == null || "".equals(messageTemplateId)){ +// logger.error("未找到该接口预警配置信息的消息模版id"); +// return BaseResult.getFailureMessageEntity("未找到该接口预警配置信息的消息模版id"); +// } +// templateEntity = sysMessageTemplateDao.get(messageTemplateId); +// if(templateEntity == null){ +// logger.error("未找到该接口预警配置信息的消息模版信息"); +// return BaseResult.getFailureMessageEntity("未找到该接口预警配置信息的消息模版信息"); +// } +// +// String messageContent = templateEntity.getMessageContents(); +// if(messageContent == null || "".equals(messageContent)){ +// logger.error("未找到该接口预警配置信息的消息模版内容"); +// return BaseResult.getFailureMessageEntity("未找到该接口预警配置信息的消息模版内容"); +// } +// +// sendMsgContent = messageContent.replace("${reciecveAppName}",recieveAppName); +// sendMsgContent = sendMsgContent.replace("${sendAppName}",sendAppName); +// sendMsgContent = sendMsgContent.replace("${receiveApiName}",receiveApiName); +// sendMsgContent = sendMsgContent.replace("${returnData}",returnData); +// +// String templateName = templateEntity.getTemplateName(); +// +// switch (appType){ +// case "6WX": +// //调用微信推送消息 +// break; +// case "5DD": +// //消息类型:3表示钉钉 +// String appkey = "dingbltm9wszcl7hoxyg"; +// String appsecret = "ex3a9qwdTXWf_VKJEddAg8YE7x98kIl3Nsy_7g0NdwvK3w3nXdUhJ3XQP4lUYs2d"; +// +// String type = "3"; +// //发送消息时使用的微应用的AgentID +// String agent_id = "3209295620"; +// //接收者的userid列表,最大用户列表长度100 +// String userid_list = configEntity.getRecipientId(); +// +// String bodyParams = splicingDDBody(sendMsgContent,agent_id,userid_list).toString(); +// +//// String access_token = getAccessToken(appkey,appsecret); +//// String Baseurl = url + "?access_token="+ access_token; +// +// String result = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface"). +// header("appId","800043"). +// header("apiCode","8000430001"). +// 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 errcode = resultJson.getString("errcode"); +// +// if(errcode != null && errcode.equals("0")){ +// logger.info("推送消息成功,开始保存日志"); +// SysSendMessageLogEntity logentity = saveLog(sendMsgContent,type,resultJson.toString(),templateName); +// logger.info("保存日志成功"); +// }else{ +// logger.error("推送消息失败,开始保存日志"); +// SysSendMessageLogEntity logentity = saveLog(sendMsgContent,type,resultJson.toString(),templateName); +// logger.error("保存日志成功"); +// } +// break; +// default: +// logger.error("未找到该应用类型"); +// break; +// } +// +// }else{ +// logger.error("日志状态为成功,不需要推送消息"); +// return BaseResult.getFailureMessageEntity("日志状态为成功,不需要推送消息"); +// } +// return BaseResult.getSuccessMessageEntity("true"); +// } + + /** + * sendMessage方法:根据请求错误消息,组装成消息模版,推送到三方业务系统 + * 1、先获取接口调用的日志数据 + * 2、如果日志状态为失败,且该接口预警状态为启用,则进行消息推送 + * 3、根据预警配置,找到消息模版,并生成消息内容 + * 4、根据预警配置,找到预警应用,并推送消息 + * 5、保存消息推送日志 + * */ + @Override + public boolean sendMessage(SysPushMessageEntity entity){ + String status = entity.getStatus(); + String receiveApiCode = entity.getReceiveApiCode(); + String sendAppName = entity.getSendAppName(); + String receiveApiName = entity.getReceiveApiName(); + String recieveAppName = entity.getReceiveAppName(); + String returnData = entity.getReturnData(); + String warningAppType = entity.getWarningAppType(); + String warningAppCode = entity.getWarningAppCode(); + String warningApiCode = entity.getWarningApiCode(); + String sendMsgContent = ""; + + SysWarningInterfaceEntity interfaceEntity = new SysWarningInterfaceEntity(); + SysWarningConfigEntity configEntity = new SysWarningConfigEntity(); + SysMessageTemplateEntity templateEntity = new SysMessageTemplateEntity(); + SysApplicationApiParaEntity sysApplicationApiParaEntity = new SysApplicationApiParaEntity(); + + interfaceEntity.setApiCode(receiveApiCode); + + 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("${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(); + + //查询预警人员id列表 + String recipientIdList = configEntity.getRecipientId(); + //根据预警人员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("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface"). + header("appId",warningAppCode). + header("apiCode",warningApiCode). + 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 errcode = resultJson.getJSONObject("attribute").getString("errcode"); + if(errcode != null && errcode.equals("0")){ + logger.info("推送消息成功,开始保存日志"); + saveLog(sendMsgContent,type,resultJson.toString(),templateName,recipientIdList,warningAppReceiverIdList); + + logger.info("保存日志成功"); + }else{ + logger.error("推送消息失败,开始保存日志"); + saveLog(sendMsgContent,type,resultJson.toString(),templateName,recipientIdList,warningAppReceiverIdList); + logger.error("保存日志成功"); + } + + }else{ + logger.error("日志状态为成功,不需要推送消息"); + return false; + } + return true; + } + + + /**保存推送消息日志时,需要循环预警应用人员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()); + + 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); + + String[] personIdList = warningAppReceiverIdList.split(","); + String[] userIdList = recipientIdList.split(","); + + 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; + } + return warningAppReceiverIdList; + } +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.java b/service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.java index c552e1d2..8358eb94 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.java @@ -82,6 +82,26 @@ public class SysUserEntity extends BaseEntity { */ private String mobilePhone; + private String ddUserId; + + private String wxUserId; + + public String getDdUserId() { + return ddUserId; + } + + public void setDdUserId(String ddUserId) { + this.ddUserId = ddUserId; + } + + public String getWxUserId() { + return wxUserId; + } + + public void setWxUserId(String wxUserId) { + this.wxUserId = wxUserId; + } + public String getPersonId() { return personId; } diff --git a/service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.xml index 90a643c0..82c6d1ed 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/user/entity/SysUserEntity.xml @@ -24,6 +24,8 @@ + + @@ -44,7 +46,9 @@ ,modify_time ,sts ,org_id - ,company_id + ,company_id + ,dd_user_id + ,wx_user_id + select + + from sys_warning_config where id = #{ id } and sts='Y' + + + + + + + + + + + + + + + + insert into sys_warning_config( + + id , + sorts , + 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, + + )values( + + #{id} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + #{messageTemplateId} , + #{appId} , + #{warningAppId} , + #{acceptMessageApiCode} , + #{remark} , + #{status} , + #{recipientId} , + '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) + 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') + + + + + 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) + 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}) + + 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), + org_id = values(org_id), + company_id = values(company_id), + message_template_id = values(message_template_id), + app_id = values(app_id), + 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) + + +update sys_warning_config set + + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + message_template_id = #{messageTemplateId}, + app_id = #{appId}, + warning_app_id = #{warningAppId}, + accept_message_api_code = #{acceptMessageApiCode}, + remark = #{remark}, + status = #{status}, + recipient_id = #{recipientId}, + +where id = #{id} + + + +update sys_warning_config set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update sys_warning_config set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and message_template_id = #{messageTemplateId} + and app_id = #{appId} + and warning_app_id = #{warningAppId} + and accept_message_api_code = #{acceptMessageApiCode} + and remark = #{remark} + and status = #{status} + and recipient_id = #{recipientId} + and sts='Y' + + + + + delete from sys_warning_config where id = #{id} + + + + diff --git a/service/src/main/java/com/hzya/frame/sysnew/warningConfig/service/ISysWarningConfigService.java b/service/src/main/java/com/hzya/frame/sysnew/warningConfig/service/ISysWarningConfigService.java new file mode 100644 index 00000000..618a0524 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/warningConfig/service/ISysWarningConfigService.java @@ -0,0 +1,29 @@ +package com.hzya.frame.sysnew.warningConfig.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.warningConfig.entity.SysWarningConfigEntity; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * 预警配置表(SysWarningConfig)表服务接口 + * + * @author makejava + * @since 2024-09-03 09:28:23 + */ +public interface ISysWarningConfigService extends IBaseService{ + + JsonResultEntity queryEntityPage(JSONObject jsonObject); + + JsonResultEntity queryEntity(JSONObject jsonObject); + + JsonResultEntity saveEntity(JSONObject jsonObject); + + JsonResultEntity getEntity(JSONObject jsonObject); + + JsonResultEntity updateEntity(JSONObject jsonObject); + + JsonResultEntity deleteEntity(JSONObject jsonObject); + + JsonResultEntity enableDisableEntity(JSONObject jsonObject); +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/warningConfig/service/impl/SysWarningConfigServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/warningConfig/service/impl/SysWarningConfigServiceImpl.java new file mode 100644 index 00000000..7634e93f --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/warningConfig/service/impl/SysWarningConfigServiceImpl.java @@ -0,0 +1,167 @@ +package com.hzya.frame.sysnew.warningConfig.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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.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; + +/** + * 预警配置表(SysWarningConfig)表服务实现类 + * + * @author makejava + * @since 2024-09-03 09:28:23 + */ +@Service(value = "sysWarningConfigService") +public class SysWarningConfigServiceImpl extends BaseService implements ISysWarningConfigService { + + private ISysWarningConfigDao sysWarningConfigDao; + + @Autowired + public void setSysWarningConfigDao(ISysWarningConfigDao dao) { + this.sysWarningConfigDao = dao; + this.dao = dao; + } + + @Override + public JsonResultEntity queryEntityPage(JSONObject jsonObject){ + SysWarningConfigEntity entity = getData("jsonStr", jsonObject, SysWarningConfigEntity.class); + if(entity == null || entity.getPageSize() == null || entity.getPageNum() == null){ + return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + } + PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + List list = sysWarningConfigDao.queryByLike(entity); + PageInfo pageInfo = new PageInfo(list); + return BaseResult.getSuccessMessageEntity("查询数据成功",pageInfo); + } + + @Override + public JsonResultEntity queryEntity(JSONObject jsonObject){ + SysWarningConfigEntity entity = getData("jsonStr", jsonObject, SysWarningConfigEntity.class); + if(entity == null){ + entity = new SysWarningConfigEntity(); + } + List list = sysWarningConfigDao.queryByLike(entity); + return BaseResult.getSuccessMessageEntity("查询数据成功",list); + } + + @Override + public JsonResultEntity getEntity(JSONObject jsonObject){ + SysWarningConfigEntity entity = getData("jsonStr", jsonObject, SysWarningConfigEntity.class); + if(entity == null){ + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if(entity.getId() == null || "".equals(entity.getId())){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity = sysWarningConfigDao.get(entity.getId()); + if(entity == null){ + return BaseResult.getFailureMessageEntity("获取预警配置失败"); + } + return BaseResult.getSuccessMessageEntity("获取预警配置成功",entity); + } + + @Override + public JsonResultEntity saveEntity(JSONObject jsonObject){ + SysWarningConfigEntity entity = getData("jsonStr", jsonObject, SysWarningConfigEntity.class); + if(entity == null){ + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if(entity.getMessageTemplateId() == null || "".equals(entity.getMessageTemplateId())){ + return BaseResult.getFailureMessageEntity("消息模版不允许为空"); + } + if(entity.getAppId() == null || "".equals(entity.getAppId())){ + return BaseResult.getFailureMessageEntity("应用ID不允许为空"); + } + if(entity.getWarningAppId() == null || "".equals(entity.getWarningAppId())){ + return BaseResult.getFailureMessageEntity("预警应用类型不允许为空"); + } + if(entity.getStatus() == null || "".equals(entity.getStatus())){ + return BaseResult.getFailureMessageEntity("状态不允许为空"); + } + if(entity.getRecipientId() == null || "".equals(entity.getRecipientId())){ + return BaseResult.getFailureMessageEntity("接收者ID不允许为空"); + } + entity.setCreate(); + sysWarningConfigDao.save(entity); + return BaseResult.getSuccessMessageEntity("保存预警配置成功",entity); + } + + @Override + public JsonResultEntity updateEntity(JSONObject jsonObject){ + SysWarningConfigEntity entity = getData("jsonStr", jsonObject, SysWarningConfigEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if(entity.getMessageTemplateId() == null || "".equals(entity.getMessageTemplateId())){ + return BaseResult.getFailureMessageEntity("消息模版不允许为空"); + } + if(entity.getAppId() == null || "".equals(entity.getAppId())){ + return BaseResult.getFailureMessageEntity("应用ID不允许为空"); + } + if(entity.getWarningAppId() == null || "".equals(entity.getWarningAppId())){ + return BaseResult.getFailureMessageEntity("预警应用类型不允许为空"); + } + if(entity.getStatus() == null || "".equals(entity.getStatus())){ + return BaseResult.getFailureMessageEntity("状态不允许为空"); + } + if(entity.getRecipientId() == null || "".equals(entity.getRecipientId())){ + return BaseResult.getFailureMessageEntity("接收者ID不允许为空"); + } + entity.setUpdate(); + sysWarningConfigDao.update(entity); + return BaseResult.getSuccessMessageEntity("修改预警配置成功",entity); + } + + @Override + public JsonResultEntity deleteEntity(JSONObject jsonObject) { + SysWarningConfigEntity entity = getData("jsonStr", jsonObject, SysWarningConfigEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setUpdate(); + sysWarningConfigDao.logicRemove(entity); + return BaseResult.getSuccessMessageEntity("删除预警配置成功"); + } + + @Override + public JsonResultEntity enableDisableEntity(JSONObject jsonObject){ + SysWarningConfigEntity entity = getData("jsonStr", jsonObject, SysWarningConfigEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getStatus() == null || "".equals(entity.getStatus())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //0启用,1禁用 + if("0".equals(entity.getStatus())){ + entity.setUpdate(); + sysWarningConfigDao.update(entity); + return BaseResult.getSuccessMessageEntity("启用模版成功"); + }else{ + //停用消息模版 + entity.setUpdate(); + sysWarningConfigDao.update(entity); + return BaseResult.getSuccessMessageEntity("停用模版成功"); + } + } + +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/warningInterface/dao/ISysWarningInterfaceDao.java b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/dao/ISysWarningInterfaceDao.java new file mode 100644 index 00000000..544241f6 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/dao/ISysWarningInterfaceDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.sysnew.warningInterface.dao; + +import com.hzya.frame.sysnew.warningInterface.entity.SysWarningInterfaceEntity; +import com.hzya.frame.basedao.dao.IBaseDao; + +/** + * 预警接口表(sys_warning_interface: table)表数据库访问层 + * + * @author makejava + * @since 2024-09-03 10:06:18 + */ +public interface ISysWarningInterfaceDao extends IBaseDao { + +} + diff --git a/service/src/main/java/com/hzya/frame/sysnew/warningInterface/dao/impl/SysWarningInterfaceDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/dao/impl/SysWarningInterfaceDaoImpl.java new file mode 100644 index 00000000..655eb183 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/dao/impl/SysWarningInterfaceDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.sysnew.warningInterface.dao.impl; + +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; +/** + * 预警接口表(SysWarningInterface)表数据库访问层 + * + * @author makejava + * @since 2024-09-03 10:06:19 + */ +@Repository(value = "SysWarningInterfaceDaoImpl") +public class SysWarningInterfaceDaoImpl extends MybatisGenericDao implements ISysWarningInterfaceDao{ + +} + diff --git a/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.java b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.java new file mode 100644 index 00000000..166f8c61 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.java @@ -0,0 +1,76 @@ +package com.hzya.frame.sysnew.warningInterface.entity; + +import java.util.Date; +import com.hzya.frame.web.entity.BaseEntity; +/** + * 预警接口表(SysWarningInterface)实体类 + * + * @author makejava + * @since 2024-09-03 10:06:19 + */ +public class SysWarningInterfaceEntity extends BaseEntity { + + /** 公司id */ + private String companyId; + /** api名称 */ + private String apiName; + /** api编码 */ + private String apiCode; + /** 推送方式(1:推送一次、2:定时) */ + private String pushMethod; + /** 状态(0:停用、1:启用) */ + private String status; + /** 主表id(预警配置表id) */ + private String warningConfigId; + + + public String getCompanyId() { + return companyId; + } + + public void setCompanyId(String companyId) { + this.companyId = companyId; + } + + public String getApiName() { + return apiName; + } + + public void setApiName(String apiName) { + this.apiName = apiName; + } + + public String getApiCode() { + return apiCode; + } + + public void setApiCode(String apiCode) { + this.apiCode = apiCode; + } + + public String getPushMethod() { + return pushMethod; + } + + public void setPushMethod(String pushMethod) { + this.pushMethod = pushMethod; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getWarningConfigId() { + return warningConfigId; + } + + public void setWarningConfigId(String warningConfigId) { + this.warningConfigId = warningConfigId; + } + +} + diff --git a/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.xml new file mode 100644 index 00000000..e9bc2d65 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.xml @@ -0,0 +1,254 @@ + + + + + + + + + + + + + + + + + + + + + + + id + ,sorts + ,create_user_id + ,create_time + ,modify_user_id + ,modify_time + ,sts + ,org_id + ,company_id + ,api_name + ,api_code + ,push_method + ,status + ,warning_config_id + + + + + + + + + + + + + + + + insert into sys_warning_interface( + + id , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + api_name , + api_code , + push_method , + status , + warning_config_id , + sts, + + )values( + + #{id} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{companyId} , + #{apiName} , + #{apiCode} , + #{pushMethod} , + #{status} , + #{warningConfigId} , + 'Y', + + ) + + + + insert into sys_warning_interface(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, api_name, api_code, push_method, status, warning_config_id, sts) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.apiName},#{entity.apiCode},#{entity.pushMethod},#{entity.status},#{entity.warningConfigId}, 'Y') + + + + + insert into sys_warning_interface(create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, api_name, api_code, push_method, status, warning_config_id) + values + + (#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.apiName},#{entity.apiCode},#{entity.pushMethod},#{entity.status},#{entity.warningConfigId}) + + 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), + org_id = values(org_id), + company_id = values(company_id), + api_name = values(api_name), + api_code = values(api_code), + push_method = values(push_method), + status = values(status), + warning_config_id = values(warning_config_id) + + +update sys_warning_interface set + + create_user_id = #{create_user_id}, + create_time = #{create_time}, + modify_user_id = #{modify_user_id}, + modify_time = #{modify_time}, + sts = #{sts}, + org_id = #{org_id}, + company_id = #{companyId}, + api_name = #{apiName}, + api_code = #{apiCode}, + push_method = #{pushMethod}, + status = #{status}, + warning_config_id = #{warningConfigId}, + +where id = #{id} + + + +update sys_warning_interface set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} +where id = #{id} + + + +update sys_warning_interface set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id} + + and id = #{id} + and sorts = #{sorts} + and sts = #{sts} + and company_id = #{companyId} + and api_name = #{apiName} + and api_code = #{apiCode} + and push_method = #{pushMethod} + and status = #{status} + and warning_config_id = #{warningConfigId} + and sts='Y' + + + + + delete from sys_warning_interface where id = #{id} + + + + diff --git a/service/src/main/java/com/hzya/frame/sysnew/warningInterface/service/ISysWarningInterfaceService.java b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/service/ISysWarningInterfaceService.java new file mode 100644 index 00000000..09f2ff30 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/service/ISysWarningInterfaceService.java @@ -0,0 +1,29 @@ +package com.hzya.frame.sysnew.warningInterface.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.warningInterface.entity.SysWarningInterfaceEntity; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.ibatis.annotations.Select; + +/** + * 预警接口表(SysWarningInterface)表服务接口 + * + * @author makejava + * @since 2024-09-03 10:06:19 + */ +public interface ISysWarningInterfaceService extends IBaseService{ + JsonResultEntity queryEntityPage(JSONObject jsonObject); + + JsonResultEntity queryEntity(JSONObject jsonObject); + + JsonResultEntity saveEntity(JSONObject jsonObject); + + JsonResultEntity getEntity(JSONObject jsonObject); + + JsonResultEntity updateEntity(JSONObject jsonObject); + + JsonResultEntity deleteEntity(JSONObject jsonObject); + + JsonResultEntity enableDisableEntity(JSONObject jsonObject); +} diff --git a/service/src/main/java/com/hzya/frame/sysnew/warningInterface/service/impl/SysWarningInterfaceServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/service/impl/SysWarningInterfaceServiceImpl.java new file mode 100644 index 00000000..70c2e1eb --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/service/impl/SysWarningInterfaceServiceImpl.java @@ -0,0 +1,167 @@ +package com.hzya.frame.sysnew.warningInterface.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hzya.frame.sysnew.warningConfig.entity.SysWarningConfigEntity; +import com.hzya.frame.sysnew.warningInterface.entity.SysWarningInterfaceEntity; +import com.hzya.frame.sysnew.warningInterface.dao.ISysWarningInterfaceDao; +import com.hzya.frame.sysnew.warningInterface.service.ISysWarningInterfaceService; +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; + +/** + * 预警接口表(SysWarningInterface)表服务实现类 + * + * @author makejava + * @since 2024-09-03 10:06:19 + */ +@Service(value = "sysWarningInterfaceService") +public class SysWarningInterfaceServiceImpl extends BaseService implements ISysWarningInterfaceService { + + private ISysWarningInterfaceDao sysWarningInterfaceDao; + + @Autowired + public void setSysWarningInterfaceDao(ISysWarningInterfaceDao dao) { + this.sysWarningInterfaceDao = dao; + this.dao = dao; + } + + @Override + public JsonResultEntity queryEntityPage(JSONObject jsonObject){ + SysWarningInterfaceEntity entity = getData("jsonStr", jsonObject, SysWarningInterfaceEntity.class); + if(entity == null || entity.getPageNum() == null || entity.getPageSize() == null){ + return BaseResult.getFailureMessageEntity("分页查询参数不存在"); + } + PageHelper.startPage(entity.getPageNum(), entity.getPageSize()); + List list = sysWarningInterfaceDao.queryByLike(entity); + PageInfo pageInfo = new PageInfo<>(list); + return BaseResult.getSuccessMessageEntity("查询数据成功",pageInfo); + } + + @Override + public JsonResultEntity queryEntity(JSONObject jsonObject){ + SysWarningInterfaceEntity entity = getData("jsonStr", jsonObject, SysWarningInterfaceEntity.class); + if(entity == null){ + entity = new SysWarningInterfaceEntity(); + } + List list = sysWarningInterfaceDao.queryByLike(entity); + return BaseResult.getSuccessMessageEntity("查询数据成功",list); + } + + @Override + public JsonResultEntity getEntity(JSONObject jsonObject){ + SysWarningInterfaceEntity entity = getData("jsonStr", jsonObject, SysWarningInterfaceEntity.class); + if(entity == null){ + return BaseResult.getFailureMessageEntity("查询参数不存在"); + } + if(entity.getId() == null || "".equals(entity.getId())){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity = sysWarningInterfaceDao.get(entity.getId()); + if(entity == null){ + return BaseResult.getFailureMessageEntity("获取预警接口失败"); + } + return BaseResult.getSuccessMessageEntity("获取预警接口成功",entity); + } + + @Override + public JsonResultEntity saveEntity(JSONObject jsonObject){ + SysWarningInterfaceEntity entity = getData("jsonStr", jsonObject, SysWarningInterfaceEntity.class); + if(entity == null){ + return BaseResult.getFailureMessageEntity("查询参数不存在"); + } + if(entity.getId() == null || "".equals(entity.getId())){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + if(entity.getApiCode() == null || "".equals(entity.getApiCode())){ + return BaseResult.getFailureMessageEntity("接口编码不能为空"); + } + if(entity.getPushMethod() == null || "".equals(entity.getPushMethod())){ + return BaseResult.getFailureMessageEntity("推送方式不能为空"); + } + if(entity.getStatus() == null || "".equals(entity.getStatus())){ + return BaseResult.getFailureMessageEntity("状态不能为空"); + } + if(entity.getWarningConfigId() == null || "".equals(entity.getWarningConfigId())){ + return BaseResult.getFailureMessageEntity("预警配置id不能为空"); + } + entity.setCreate(); + sysWarningInterfaceDao.save(entity); + return BaseResult.getSuccessMessageEntity("保存预警接口成功",entity); + } + + @Override + public JsonResultEntity updateEntity(JSONObject jsonObject){ + SysWarningInterfaceEntity entity = getData("jsonStr", jsonObject, SysWarningInterfaceEntity.class); + if(entity == null){ + return BaseResult.getFailureMessageEntity("查询参数不存在"); + } + if(entity.getId() == null || "".equals(entity.getId())){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + if(entity.getApiCode() == null || "".equals(entity.getApiCode())){ + return BaseResult.getFailureMessageEntity("接口编码不能为空"); + } + if(entity.getPushMethod() == null || "".equals(entity.getPushMethod())){ + return BaseResult.getFailureMessageEntity("推送方式不能为空"); + } + if(entity.getStatus() == null || "".equals(entity.getStatus())){ + return BaseResult.getFailureMessageEntity("状态不能为空"); + } + if(entity.getWarningConfigId() == null || "".equals(entity.getWarningConfigId())){ + return BaseResult.getFailureMessageEntity("预警配置id不能为空"); + } + entity.setUpdate(); + sysWarningInterfaceDao.update(entity); + return BaseResult.getSuccessMessageEntity("修改预警接口成功",entity); + } + + @Override + public JsonResultEntity deleteEntity(JSONObject jsonObject){ + SysWarningInterfaceEntity entity = getData("jsonStr", jsonObject, SysWarningInterfaceEntity.class); + if(entity == null){ + return BaseResult.getFailureMessageEntity("查询参数不存在"); + } + if(entity.getId() == null || "".equals(entity.getId())){ + return BaseResult.getFailureMessageEntity("系统错误"); + } + entity.setUpdate(); + sysWarningInterfaceDao.logicRemove(entity); + + return BaseResult.getSuccessMessageEntity("删除预警接口成功"); + } + + @Override + public JsonResultEntity enableDisableEntity(JSONObject jsonObject) { + SysWarningInterfaceEntity entity = getData("jsonStr", jsonObject, SysWarningInterfaceEntity.class); + if (entity == null) { + return BaseResult.getFailureMessageEntity("参数不允许为空"); + } + if (entity.getId() == null || "".equals(entity.getId())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + if (entity.getStatus() == null || "".equals(entity.getStatus())) { + return BaseResult.getFailureMessageEntity("系统错误"); + } + //0启用,1禁用 + if("0".equals(entity.getStatus())){ + entity.setUpdate(); + sysWarningInterfaceDao.update(entity); + return BaseResult.getSuccessMessageEntity("启用模版成功"); + }else{ + //停用消息模版 + entity.setUpdate(); + sysWarningInterfaceDao.update(entity); + return BaseResult.getSuccessMessageEntity("停用模版成功"); + } + + } + +} From 37b66cee8b14bcaeaeb50e30e0d07c30cfd3ed9c Mon Sep 17 00:00:00 2001 From: username Date: Sat, 7 Sep 2024 16:02:27 +0800 Subject: [PATCH 052/101] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=EF=BC=8C=E9=A2=84=E8=AD=A6=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E6=8F=92=E4=BB=B6=E6=8E=A8=E9=80=81=E6=B6=88=E6=81=AF?= =?UTF-8?q?=EF=BC=8C=E6=B6=88=E6=81=AF=E6=A8=A1=E7=89=88=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=EF=BC=8C=E6=8E=A8=E9=80=81=E6=B6=88=E6=81=AF=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DingTalkExtServiceImpl.java | 2 +- .../entity/SysPushMessageEntity.java | 31 +-- .../entity/SysPushMessageEntity.xml | 6 +- .../impl/SysSendMessageLogServiceImpl.java | 226 ++++++------------ .../entity/SysWarningConfigEntity.java | 6 +- .../entity/SysWarningConfigEntity.xml | 2 +- .../entity/SysWarningInterfaceEntity.java | 6 +- .../entity/SysWarningInterfaceEntity.xml | 2 +- 8 files changed, 104 insertions(+), 177 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkExtServiceImpl.java b/service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkExtServiceImpl.java index 61dc97fa..dd0267f8 100644 --- a/service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkExtServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkExtServiceImpl.java @@ -28,7 +28,7 @@ import java.util.stream.Stream; * @Author xiangerlin * @Date 2024/8/28 14:25 **/ -@Service +@Service(value = "dingTalkExtService") public class DingTalkExtServiceImpl implements IDingTalkExtService { diff --git a/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.java b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.java index ba467aee..94eeb61f 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.java @@ -6,9 +6,9 @@ public class SysPushMessageEntity extends BaseEntity { /** 推送方式 “一次”、“定时” */ private String pushMethod; /** 预警应用编码 */ - private String warningAppCode; + private Long warningAppCode; /** 预警接口编码 */ - private String warningApiCode; + private Long warningApiCode; /** 接收者ID列表*/ private String recipientIdList; /** 预警应用类型 */ @@ -22,7 +22,7 @@ public class SysPushMessageEntity extends BaseEntity { /** 返回信息 */ private String returnData; /** 接收接口编码 */ - private String receiveApiCode; + private Long receiveApiCode; /** 状态(1、待发送2、发送中3、发送成功4、发送失败) */ private String status; @@ -34,22 +34,31 @@ public class SysPushMessageEntity extends BaseEntity { this.pushMethod = pushMethod; } - public String getWarningAppCode() { + + public Long getWarningAppCode() { return warningAppCode; } - public void setWarningAppCode(String warningAppCode) { + public void setWarningAppCode(Long warningAppCode) { this.warningAppCode = warningAppCode; } - public String getWarningApiCode() { + public Long getWarningApiCode() { return warningApiCode; } - public void setWarningApiCode(String warningApiCode) { + public void setWarningApiCode(Long warningApiCode) { this.warningApiCode = warningApiCode; } + public Long getReceiveApiCode() { + return receiveApiCode; + } + + public void setReceiveApiCode(Long receiveApiCode) { + this.receiveApiCode = receiveApiCode; + } + public String getRecipientIdList() { return recipientIdList; } @@ -98,14 +107,6 @@ public class SysPushMessageEntity extends BaseEntity { this.returnData = returnData; } - public String getReceiveApiCode() { - return receiveApiCode; - } - - public void setReceiveApiCode(String receiveApiCode) { - this.receiveApiCode = receiveApiCode; - } - public String getStatus() { return status; } diff --git a/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.xml index be1fd3e3..0916a33a 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.xml @@ -4,14 +4,14 @@ - - + + - + diff --git a/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java index 846c1f9f..ea688246 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java @@ -2,9 +2,12 @@ package com.hzya.frame.sysnew.sendMessageLog.service.impl; import cn.dev33.satoken.stp.StpUtil; import cn.hutool.http.HttpRequest; +import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import com.hzya.frame.sysnew.application.api.dao.ISysApplicationApiDao; +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.messageTemplate.dao.ISysMessageTemplateDao; @@ -49,6 +52,8 @@ public class SysSendMessageLogServiceImpl extends BaseService - + diff --git a/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.java b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.java index 166f8c61..fa2181c9 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.java @@ -15,7 +15,7 @@ public class SysWarningInterfaceEntity extends BaseEntity { /** api名称 */ private String apiName; /** api编码 */ - private String apiCode; + private Long apiCode; /** 推送方式(1:推送一次、2:定时) */ private String pushMethod; /** 状态(0:停用、1:启用) */ @@ -40,11 +40,11 @@ public class SysWarningInterfaceEntity extends BaseEntity { this.apiName = apiName; } - public String getApiCode() { + public Long getApiCode() { return apiCode; } - public void setApiCode(String apiCode) { + public void setApiCode(Long apiCode) { this.apiCode = apiCode; } diff --git a/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.xml index e9bc2d65..663e7cd1 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.xml @@ -13,7 +13,7 @@ - + From 24ab9a9dc1ab87daddb0f7e41dcdeffe1d6aaec0 Mon Sep 17 00:00:00 2001 From: username Date: Sat, 7 Sep 2024 16:07:53 +0800 Subject: [PATCH 053/101] =?UTF-8?q?Revert=20"=E9=A2=84=E8=AD=A6=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E9=A2=84=E8=AD=A6=E6=8E=A5=E5=8F=A3=EF=BC=8C?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E6=8F=92=E4=BB=B6=E6=8E=A8=E9=80=81=E6=B6=88?= =?UTF-8?q?=E6=81=AF=EF=BC=8C=E6=B6=88=E6=81=AF=E6=A8=A1=E7=89=88=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E6=8E=A8=E9=80=81=E6=B6=88=E6=81=AF=E6=97=A5?= =?UTF-8?q?=E5=BF=97"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 37b66cee8b14bcaeaeb50e30e0d07c30cfd3ed9c. --- .../service/impl/DingTalkExtServiceImpl.java | 2 +- .../entity/SysPushMessageEntity.java | 31 ++- .../entity/SysPushMessageEntity.xml | 6 +- .../impl/SysSendMessageLogServiceImpl.java | 226 ++++++++++++------ .../entity/SysWarningConfigEntity.java | 6 +- .../entity/SysWarningConfigEntity.xml | 2 +- .../entity/SysWarningInterfaceEntity.java | 6 +- .../entity/SysWarningInterfaceEntity.xml | 2 +- 8 files changed, 177 insertions(+), 104 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkExtServiceImpl.java b/service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkExtServiceImpl.java index dd0267f8..61dc97fa 100644 --- a/service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkExtServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkExtServiceImpl.java @@ -28,7 +28,7 @@ import java.util.stream.Stream; * @Author xiangerlin * @Date 2024/8/28 14:25 **/ -@Service(value = "dingTalkExtService") +@Service public class DingTalkExtServiceImpl implements IDingTalkExtService { diff --git a/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.java b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.java index 94eeb61f..ba467aee 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.java @@ -6,9 +6,9 @@ public class SysPushMessageEntity extends BaseEntity { /** 推送方式 “一次”、“定时” */ private String pushMethod; /** 预警应用编码 */ - private Long warningAppCode; + private String warningAppCode; /** 预警接口编码 */ - private Long warningApiCode; + private String warningApiCode; /** 接收者ID列表*/ private String recipientIdList; /** 预警应用类型 */ @@ -22,7 +22,7 @@ public class SysPushMessageEntity extends BaseEntity { /** 返回信息 */ private String returnData; /** 接收接口编码 */ - private Long receiveApiCode; + private String receiveApiCode; /** 状态(1、待发送2、发送中3、发送成功4、发送失败) */ private String status; @@ -34,31 +34,22 @@ public class SysPushMessageEntity extends BaseEntity { this.pushMethod = pushMethod; } - - public Long getWarningAppCode() { + public String getWarningAppCode() { return warningAppCode; } - public void setWarningAppCode(Long warningAppCode) { + public void setWarningAppCode(String warningAppCode) { this.warningAppCode = warningAppCode; } - public Long getWarningApiCode() { + public String getWarningApiCode() { return warningApiCode; } - public void setWarningApiCode(Long warningApiCode) { + public void setWarningApiCode(String warningApiCode) { this.warningApiCode = warningApiCode; } - public Long getReceiveApiCode() { - return receiveApiCode; - } - - public void setReceiveApiCode(Long receiveApiCode) { - this.receiveApiCode = receiveApiCode; - } - public String getRecipientIdList() { return recipientIdList; } @@ -107,6 +98,14 @@ public class SysPushMessageEntity extends BaseEntity { this.returnData = returnData; } + public String getReceiveApiCode() { + return receiveApiCode; + } + + public void setReceiveApiCode(String receiveApiCode) { + this.receiveApiCode = receiveApiCode; + } + public String getStatus() { return status; } diff --git a/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.xml index 0916a33a..be1fd3e3 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.xml @@ -4,14 +4,14 @@ - - + + - + diff --git a/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java index ea688246..846c1f9f 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java @@ -2,12 +2,9 @@ package com.hzya.frame.sysnew.sendMessageLog.service.impl; import cn.dev33.satoken.stp.StpUtil; import cn.hutool.http.HttpRequest; -import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; -import com.hzya.frame.sysnew.application.api.dao.ISysApplicationApiDao; -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.messageTemplate.dao.ISysMessageTemplateDao; @@ -52,8 +49,6 @@ public class SysSendMessageLogServiceImpl extends BaseService - + diff --git a/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.java b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.java index fa2181c9..166f8c61 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.java @@ -15,7 +15,7 @@ public class SysWarningInterfaceEntity extends BaseEntity { /** api名称 */ private String apiName; /** api编码 */ - private Long apiCode; + private String apiCode; /** 推送方式(1:推送一次、2:定时) */ private String pushMethod; /** 状态(0:停用、1:启用) */ @@ -40,11 +40,11 @@ public class SysWarningInterfaceEntity extends BaseEntity { this.apiName = apiName; } - public Long getApiCode() { + public String getApiCode() { return apiCode; } - public void setApiCode(Long apiCode) { + public void setApiCode(String apiCode) { this.apiCode = apiCode; } diff --git a/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.xml index 663e7cd1..e9bc2d65 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.xml @@ -13,7 +13,7 @@ - + From c2ad1e3ea33913dc89af01d841be216d0bb04e4f Mon Sep 17 00:00:00 2001 From: username Date: Sat, 7 Sep 2024 16:02:27 +0800 Subject: [PATCH 054/101] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=EF=BC=8C=E9=A2=84=E8=AD=A6=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E6=8F=92=E4=BB=B6=E6=8E=A8=E9=80=81=E6=B6=88=E6=81=AF?= =?UTF-8?q?=EF=BC=8C=E6=B6=88=E6=81=AF=E6=A8=A1=E7=89=88=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=EF=BC=8C=E6=8E=A8=E9=80=81=E6=B6=88=E6=81=AF=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DingTalkExtServiceImpl.java | 2 +- .../entity/SysPushMessageEntity.java | 31 +-- .../entity/SysPushMessageEntity.xml | 6 +- .../impl/SysSendMessageLogServiceImpl.java | 226 ++++++------------ .../entity/SysWarningConfigEntity.java | 6 +- .../entity/SysWarningConfigEntity.xml | 2 +- .../entity/SysWarningInterfaceEntity.java | 6 +- .../entity/SysWarningInterfaceEntity.xml | 2 +- 8 files changed, 104 insertions(+), 177 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkExtServiceImpl.java b/service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkExtServiceImpl.java index 61dc97fa..dd0267f8 100644 --- a/service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkExtServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/dingtalk/service/impl/DingTalkExtServiceImpl.java @@ -28,7 +28,7 @@ import java.util.stream.Stream; * @Author xiangerlin * @Date 2024/8/28 14:25 **/ -@Service +@Service(value = "dingTalkExtService") public class DingTalkExtServiceImpl implements IDingTalkExtService { diff --git a/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.java b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.java index ba467aee..94eeb61f 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.java @@ -6,9 +6,9 @@ public class SysPushMessageEntity extends BaseEntity { /** 推送方式 “一次”、“定时” */ private String pushMethod; /** 预警应用编码 */ - private String warningAppCode; + private Long warningAppCode; /** 预警接口编码 */ - private String warningApiCode; + private Long warningApiCode; /** 接收者ID列表*/ private String recipientIdList; /** 预警应用类型 */ @@ -22,7 +22,7 @@ public class SysPushMessageEntity extends BaseEntity { /** 返回信息 */ private String returnData; /** 接收接口编码 */ - private String receiveApiCode; + private Long receiveApiCode; /** 状态(1、待发送2、发送中3、发送成功4、发送失败) */ private String status; @@ -34,22 +34,31 @@ public class SysPushMessageEntity extends BaseEntity { this.pushMethod = pushMethod; } - public String getWarningAppCode() { + + public Long getWarningAppCode() { return warningAppCode; } - public void setWarningAppCode(String warningAppCode) { + public void setWarningAppCode(Long warningAppCode) { this.warningAppCode = warningAppCode; } - public String getWarningApiCode() { + public Long getWarningApiCode() { return warningApiCode; } - public void setWarningApiCode(String warningApiCode) { + public void setWarningApiCode(Long warningApiCode) { this.warningApiCode = warningApiCode; } + public Long getReceiveApiCode() { + return receiveApiCode; + } + + public void setReceiveApiCode(Long receiveApiCode) { + this.receiveApiCode = receiveApiCode; + } + public String getRecipientIdList() { return recipientIdList; } @@ -98,14 +107,6 @@ public class SysPushMessageEntity extends BaseEntity { this.returnData = returnData; } - public String getReceiveApiCode() { - return receiveApiCode; - } - - public void setReceiveApiCode(String receiveApiCode) { - this.receiveApiCode = receiveApiCode; - } - public String getStatus() { return status; } diff --git a/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.xml index be1fd3e3..0916a33a 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/pushMessage/entity/SysPushMessageEntity.xml @@ -4,14 +4,14 @@ - - + + - + diff --git a/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java index 846c1f9f..ea688246 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java @@ -2,9 +2,12 @@ package com.hzya.frame.sysnew.sendMessageLog.service.impl; import cn.dev33.satoken.stp.StpUtil; import cn.hutool.http.HttpRequest; +import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import com.hzya.frame.sysnew.application.api.dao.ISysApplicationApiDao; +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.messageTemplate.dao.ISysMessageTemplateDao; @@ -49,6 +52,8 @@ public class SysSendMessageLogServiceImpl extends BaseService - + diff --git a/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.java b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.java index 166f8c61..fa2181c9 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.java +++ b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.java @@ -15,7 +15,7 @@ public class SysWarningInterfaceEntity extends BaseEntity { /** api名称 */ private String apiName; /** api编码 */ - private String apiCode; + private Long apiCode; /** 推送方式(1:推送一次、2:定时) */ private String pushMethod; /** 状态(0:停用、1:启用) */ @@ -40,11 +40,11 @@ public class SysWarningInterfaceEntity extends BaseEntity { this.apiName = apiName; } - public String getApiCode() { + public Long getApiCode() { return apiCode; } - public void setApiCode(String apiCode) { + public void setApiCode(Long apiCode) { this.apiCode = apiCode; } diff --git a/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.xml index e9bc2d65..663e7cd1 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.xml +++ b/service/src/main/java/com/hzya/frame/sysnew/warningInterface/entity/SysWarningInterfaceEntity.xml @@ -13,7 +13,7 @@ - + From 927f8c5a7bcb10a62712974b373a61b87ede37d1 Mon Sep 17 00:00:00 2001 From: username Date: Sat, 7 Sep 2024 16:30:36 +0800 Subject: [PATCH 055/101] =?UTF-8?q?=E6=8E=A8=E9=80=81=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SysSendMessageLogServiceImpl.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java index ea688246..2ff4f682 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/sendMessageLog/service/impl/SysSendMessageLogServiceImpl.java @@ -279,12 +279,8 @@ public class SysSendMessageLogServiceImpl extends BaseService Date: Mon, 9 Sep 2024 14:20:48 +0800 Subject: [PATCH 056/101] =?UTF-8?q?esb=E6=B7=BB=E5=8A=A0=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SysApplicationServiceImpl.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java index 77a1dd3f..e2674a56 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java @@ -46,6 +46,8 @@ import com.hzya.frame.sysnew.messageManageDetail.entity.SysMessageManageDetailEn import com.hzya.frame.sysnew.messageManageLog.dao.ISysMessageManageLogDao; import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity; import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogPageVo; +import com.hzya.frame.sysnew.pushMessage.entity.SysPushMessageEntity; +import com.hzya.frame.sysnew.sendMessageLog.service.ISysSendMessageLogService; import com.hzya.frame.util.AESUtil; import com.hzya.frame.util.IPHelper; import com.hzya.frame.uuid.UUIDUtils; @@ -90,6 +92,8 @@ public class SysApplicationServiceImpl extends BaseService doEsbTask(sysMessageManageLogEntity)); + SysPushMessageEntity sysPushMessageEntity = new SysPushMessageEntity(); + sysPushMessageEntity.setSendAppName(sendApp.getName()); + sysPushMessageEntity.setReceiveAppName(receiveApp.getName()); + sysPushMessageEntity.setReceiveApiName(receiveApi.getApiName()); + sysPushMessageEntity.setReceiveApiCode(receiveApi.getApiCode()); + sysPushMessageEntity.setReturnData(sysMessageManageLogEntity.getReturnData()); + sysPushMessageEntity.setStatus(sysMessageManageLogEntity.getStatus()); + taskExecutor.execute(() -> sendMssage(sysPushMessageEntity)); return sysMessageManageLogEntity; } + private void sendMssage(SysPushMessageEntity sysPushMessageEntity) { + sysSendMessageLogService.sendMessage(sysPushMessageEntity); + } + private SysMessageManageLogEntity updateLog(SysApplicationEntity sendApp, SysApplicationEntity receiveApp, SysApplicationApiEntity receiveApi, String oldbodys,String bodys, Map oldheaderMap,Map headerMap, @@ -2793,6 +2809,9 @@ public class SysApplicationServiceImpl extends BaseService doEsbTaskNew(sysMessageManageLogEntity)); + + + return sysMessageManageLogEntity; } @@ -2805,6 +2824,7 @@ public class SysApplicationServiceImpl extends BaseService Date: Mon, 9 Sep 2024 17:32:47 +0800 Subject: [PATCH 057/101] =?UTF-8?q?u8c=E5=B0=81=E8=A3=85=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?,=E6=B5=8B=E8=AF=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SysApplicationServiceImpl.java | 2 +- .../entity/EncapsulationEntity.java | 22 ++- .../entity/EncapsulationEntity.xml | 13 +- .../service/impl/EncapsulationImpl.java | 143 +++++++++--------- 4 files changed, 103 insertions(+), 77 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java index e2674a56..2a11d6ef 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java @@ -123,7 +123,7 @@ public class SysApplicationServiceImpl extends BaseService SELECT - vbillcode as code + h.vbillcode as code, + a.unitcode FROM - ic_general_h + ic_general_h h + LEFT JOIN bd_corp a on a.pk_corp = h.pk_corp WHERE - cgeneralhid in ( - SELECT cgeneralhid FROM ic_general_b WHERE vfirstbillcode = #{code} and csourcetype = #{type} + h.cgeneralhid in ( + SELECT cgeneralhid FROM ic_general_b WHERE vfirstbillcode = #{code} + and csourcetype = #{type} ) + and h.cbilltypecode = #{cbilltypecode} + diff --git a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java index 1f74f2c7..47f23d0b 100644 --- a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java +++ b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java @@ -138,32 +138,32 @@ public class EncapsulationImpl extends BaseService return returnObject; } //执行库存采购入库单取消签字接口 - String cgrkdqxqz = getsendBody("1", jsonObject, encapsulationEntities.get(0).getCode()); - boolean cgrkdqxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("cgrkqxqz"), jsonObject.getString("cgrkqxqz").substring(6), cgrkdqxqz); + String cgrkdqxqz = getsendBody("1", jsonObject, encapsulationEntities.get(0).getCode(),encapsulationEntities.get(0).getUnitcode()); + boolean cgrkdqxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("cgrkqxqz"), jsonObject.getString("cgrkqxqz").substring(0,6), cgrkdqxqz); if (!cgrkdqxqzflag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "采购入库单取消签字失败"); return returnObject; } //执行库存采购入库单删除 - String cgrkdsc = getsendBody("2", jsonObject, encapsulationEntities.get(0).getCode()); - boolean cgrkdscfiag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("cgrksc"), jsonObject.getString("cgrksc").substring(6), cgrkdsc); + String cgrkdsc = getsendBody("2", jsonObject, encapsulationEntities.get(0).getCode(),encapsulationEntities.get(0).getUnitcode()); + boolean cgrkdscfiag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("cgrksc"), jsonObject.getString("cgrksc").substring(0,6), cgrkdsc); if (!cgrkdscfiag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "采购入库单删除失败"); return returnObject; } //执行采购订单弃审 - String cgddqs = getsendBody("3", jsonObject, null); - boolean cgddqsflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("cgddqs"), jsonObject.getString("cgddqs").substring(6), cgddqs); + String cgddqs = getsendBody("3", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp")); + boolean cgddqsflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("cgddqs"), jsonObject.getString("cgddqs").substring(0,6), cgddqs); if (!cgddqsflag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "采购订单弃审失败"); return returnObject; } //执行采购订单删除 - String cgddsc = getsendBody("4", jsonObject, null); - boolean cgddscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("cgddsc"), jsonObject.getString("cgddsc").substring(6), cgddsc); + String cgddsc = getsendBody("4", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp")); + boolean cgddscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("cgddsc"), jsonObject.getString("cgddsc").substring(0,6), cgddsc); if (cgddscflag) { returnObject.put("status", "success"); returnObject.put("errormsg", "采购订单删除成功"); @@ -196,8 +196,8 @@ public class EncapsulationImpl extends BaseService String parm = entity.getBodys(); JSONObject jsonObject = JSONObject.parseObject(parm); jsonObject.put("dataSourceCode",sysDataSourceEntities.get(0).getSourceCode()); - jsonObject.put("publicKey",headers.get("publicKey")); - jsonObject.put("secretKey",headers.get("secretKey")); + jsonObject.put("publicKey",entity.getSendApp().getPublicKey()); + jsonObject.put("secretKey",entity.getSendApp().getSecretKey()); jsonObject.put("cgrkqxqz",headers.get("cgrkqxqz")); jsonObject.put("cgrksc",headers.get("cgrksc")); @@ -275,8 +275,8 @@ public class EncapsulationImpl extends BaseService return returnObject; } //执行库存采购入库单取消签字接口 - String cgrkdqxqz = getsendBody("1", jsonObject, jsonObject.getString("code")); - boolean cgrkdqxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("cgrkqxqz"), jsonObject.getString("cgrkqxqz").substring(6), cgrkdqxqz); + String cgrkdqxqz = getsendBody("1", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp")); + boolean cgrkdqxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("cgrkqxqz"), jsonObject.getString("cgrkqxqz").substring(0,6), cgrkdqxqz); if (!cgrkdqxqzflag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "采购入库单取消签字失败"); @@ -284,8 +284,8 @@ public class EncapsulationImpl extends BaseService } //执行库存采购入库单删除接口 - String cgrkdsc = getsendBody("2", jsonObject, jsonObject.getString("code")); - boolean cgrkdscfiag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("cgrksc"), jsonObject.getString("cgrksc").substring(6), cgrkdsc); + String cgrkdsc = getsendBody("2", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp")); + boolean cgrkdscfiag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("cgrksc"), jsonObject.getString("cgrksc").substring(0,6), cgrkdsc); if (cgrkdscfiag) { returnObject.put("status", "success"); returnObject.put("errormsg", "采购入库单删除成功"); @@ -318,8 +318,8 @@ public class EncapsulationImpl extends BaseService String parm = entity.getBodys(); JSONObject jsonObject = JSONObject.parseObject(parm); jsonObject.put("dataSourceCode",sysDataSourceEntities.get(0).getSourceCode()); - jsonObject.put("publicKey",headers.get("publicKey")); - jsonObject.put("secretKey",headers.get("secretKey")); + jsonObject.put("publicKey",entity.getSendApp().getPublicKey()); + jsonObject.put("secretKey",entity.getSendApp().getSecretKey()); jsonObject.put("cgrkqxqz",headers.get("cgrkqxqz")); jsonObject.put("cgrksc",headers.get("cgrksc")); @@ -418,32 +418,32 @@ public class EncapsulationImpl extends BaseService return returnObject; } //库存销售出库单取消签字, - String cgrkdqxqz = getsendBody("1", jsonObject, encapsulationEntities.get(0).getCode()); - boolean cgrkdqxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcxsckqxqz"), jsonObject.getString("kcxsckqxqz").substring(6), cgrkdqxqz); + String cgrkdqxqz = getsendBody("1", jsonObject, encapsulationEntities.get(0).getCode(), encapsulationEntities.get(0).getUnitcode()); + boolean cgrkdqxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcxsckqxqz"), jsonObject.getString("kcxsckqxqz").substring(0,6), cgrkdqxqz); if (!cgrkdqxqzflag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "库存销售出库单取消签字失败"); return returnObject; } //库存销售出库单删除 - String cgrkdsc = getsendBody("2", jsonObject, encapsulationEntities.get(0).getCode()); - boolean cgrkdscfiag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcxscksc"), jsonObject.getString("kcxscksc").substring(6), cgrkdsc); + String cgrkdsc = getsendBody("2", jsonObject, encapsulationEntities.get(0).getCode(), encapsulationEntities.get(0).getUnitcode()); + boolean cgrkdscfiag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcxscksc"), jsonObject.getString("kcxscksc").substring(0,6), cgrkdsc); if (!cgrkdscfiag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "库存销售出库单删除失败"); return returnObject; } //销售订单取消审批,, - String cgddqs = getsendBody("3", jsonObject, jsonObject.getString("code")); - boolean cgddqsflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("xsddqxsp"), jsonObject.getString("xsddqxsp").substring(6), cgddqs); + String cgddqs = getsendBody("3", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp")); + boolean cgddqsflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("xsddqxsp"), jsonObject.getString("xsddqxsp").substring(0,6), cgddqs); if (!cgddqsflag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "销售订单取消审批失败"); return returnObject; } //销售订单删除 - String cgddsc = getsendBody("4", jsonObject, jsonObject.getString("code")); - boolean cgddscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("xsddsc"), jsonObject.getString("xsddsc").substring(6), cgddsc); + String cgddsc = getsendBody("4", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp")); + boolean cgddscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("xsddsc"), jsonObject.getString("xsddsc").substring(0,6), cgddsc); if (cgddscflag) { returnObject.put("status", "success"); returnObject.put("errormsg", "销售订单删除成功"); @@ -476,8 +476,8 @@ public class EncapsulationImpl extends BaseService String parm = entity.getBodys(); JSONObject jsonObject = JSONObject.parseObject(parm); jsonObject.put("dataSourceCode",sysDataSourceEntities.get(0).getSourceCode()); - jsonObject.put("publicKey",headers.get("publicKey")); - jsonObject.put("secretKey",headers.get("secretKey")); + jsonObject.put("publicKey",entity.getSendApp().getPublicKey()); + jsonObject.put("secretKey",entity.getSendApp().getSecretKey()); jsonObject.put("kcxsckqxqz",headers.get("kcxsckqxqz")); jsonObject.put("kcxscksc",headers.get("kcxscksc")); @@ -583,7 +583,7 @@ public class EncapsulationImpl extends BaseService EncapsulationEntity rk = new EncapsulationEntity(); rk.setCode(jsonObject.getString("code")); rk.setDataSourceCode(jsonObject.getString("dataSourceCode")); - rk.setType("4E"); + rk.setCbilltypecode("4E"); List rklist = encapsulationDao.queryCgrkddh(rk); if(rklist == null || rklist.size() != 1){ returnObject.put("status", "falied"); @@ -594,7 +594,7 @@ public class EncapsulationImpl extends BaseService EncapsulationEntity ck = new EncapsulationEntity(); ck.setCode(jsonObject.getString("code")); ck.setDataSourceCode(jsonObject.getString("dataSourceCode")); - ck.setType("4Y"); + ck.setCbilltypecode("4Y"); List cklist = encapsulationDao.queryCgrkddh(ck); if(cklist == null || cklist.size() != 1){ returnObject.put("status", "falied"); @@ -602,48 +602,48 @@ public class EncapsulationImpl extends BaseService return returnObject; } //调拨入库取消签字 - String dbrk = getsendBody("1", jsonObject, jsonObject.getString("code")); - boolean dbrkflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("dbrkqxqz"), jsonObject.getString("dbrkqxqz").substring(6), dbrk); + String dbrk = getsendBody("1", jsonObject, rklist.get(0).getCode(),rklist.get(0).getUnitcode()); + boolean dbrkflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("dbrkqxqz"), jsonObject.getString("dbrkqxqz").substring(0,6), dbrk); if (!dbrkflag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "调拨入库取消签字失败"); return returnObject; } //调拨入库删除 - String dbrksc = getsendBody("2", jsonObject, jsonObject.getString("code")); - boolean dbrkscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("dbrksc"), jsonObject.getString("dbrksc").substring(6), dbrksc); + String dbrksc = getsendBody("2", jsonObject, rklist.get(0).getCode(), rklist.get(0).getUnitcode()); + boolean dbrkscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("dbrksc"), jsonObject.getString("dbrksc").substring(0,6), dbrksc); if (!dbrkscflag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "调拨入库删除失败"); return returnObject; } //库存调拨出库取消签字 - String dbck = getsendBody("1", jsonObject, jsonObject.getString("code")); - boolean dbckflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcdbckqxqz"), jsonObject.getString("kcdbckqxqz").substring(6), dbck); + String dbck = getsendBody("1", jsonObject, cklist.get(0).getCode(), cklist.get(0).getUnitcode()); + boolean dbckflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcdbckqxqz"), jsonObject.getString("kcdbckqxqz").substring(0,6), dbck); if (!dbckflag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "库存调拨出库取消签字失败"); return returnObject; } //库存调拨出库删除 - String dbcksc = getsendBody("2", jsonObject, jsonObject.getString("code")); - boolean dbckscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcdbcksc"), jsonObject.getString("kcdbcksc").substring(6), dbcksc); + String dbcksc = getsendBody("2", jsonObject, cklist.get(0).getCode(), cklist.get(0).getUnitcode()); + boolean dbckscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcdbcksc"), jsonObject.getString("kcdbcksc").substring(0,6), dbcksc); if (!dbckscflag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "库存调拨出库删除失败"); return returnObject; } //调拨订单弃审 - String dbdd = getsendBody("3", jsonObject, jsonObject.getString("code")); - boolean dbddflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("dbddqs"), jsonObject.getString("dbddqs").substring(6), dbdd); + String dbdd = getsendBody("3", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp")); + boolean dbddflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("dbddqs"), jsonObject.getString("dbddqs").substring(0,6), dbdd); if (!dbddflag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "调拨订单弃审失败"); return returnObject; } //调拨订单删除 - String dbddsc = getsendBody("4", jsonObject, jsonObject.getString("code")); - boolean dbddscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("dbddsc"), jsonObject.getString("dbddsc").substring(6), dbddsc); + String dbddsc = getsendBody("4", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp")); + boolean dbddscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("dbddsc"), jsonObject.getString("dbddsc").substring(0,6), dbddsc); if (!dbddscflag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "调拨订单删除失败"); @@ -678,8 +678,8 @@ public class EncapsulationImpl extends BaseService String parm = entity.getBodys(); JSONObject jsonObject = JSONObject.parseObject(parm); jsonObject.put("dataSourceCode",sysDataSourceEntities.get(0).getSourceCode()); - jsonObject.put("publicKey",headers.get("publicKey")); - jsonObject.put("secretKey",headers.get("secretKey")); + jsonObject.put("publicKey",entity.getSendApp().getPublicKey()); + jsonObject.put("secretKey",entity.getSendApp().getSecretKey()); jsonObject.put("kcdbckqxqz",headers.get("kcdbckqxqz")); jsonObject.put("kcdbcksc",headers.get("kcdbcksc")); @@ -761,16 +761,16 @@ public class EncapsulationImpl extends BaseService } //库存产成品入库单取消签字 - String qxqz = getsendBody("1", jsonObject, jsonObject.getString("code")); - boolean qxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcccprkqxqz"), jsonObject.getString("kcccprkqxqz").substring(6), qxqz); + String qxqz = getsendBody("1", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp")); + boolean qxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcccprkqxqz"), jsonObject.getString("kcccprkqxqz").substring(0,6), qxqz); if (!qxqzflag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "库存产成品入库单取消签字失败"); return returnObject; } //库存产成品入库单删除 - String sc = getsendBody("2", jsonObject, jsonObject.getString("code")); - boolean scflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcccprksc"), jsonObject.getString("kcccprksc").substring(6), sc); + String sc = getsendBody("2", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp")); + boolean scflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("kcccprksc"), jsonObject.getString("kcccprksc").substring(0,6), sc); if (!scflag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "库存产成品入库单删除失败"); @@ -804,8 +804,8 @@ public class EncapsulationImpl extends BaseService String parm = entity.getBodys(); JSONObject jsonObject = JSONObject.parseObject(parm); jsonObject.put("dataSourceCode",sysDataSourceEntities.get(0).getSourceCode()); - jsonObject.put("publicKey",headers.get("publicKey")); - jsonObject.put("secretKey",headers.get("secretKey")); + jsonObject.put("publicKey",entity.getSendApp().getPublicKey()); + jsonObject.put("secretKey",entity.getSendApp().getSecretKey()); jsonObject.put("kcccprkqxqz",headers.get("kcccprkqxqz")); jsonObject.put("kcccprksc",headers.get("kcccprksc")); @@ -883,16 +883,16 @@ public class EncapsulationImpl extends BaseService } //库存材料出库取消签字 - String qxqz = getsendBody("1", jsonObject, jsonObject.getString("code")); - boolean qxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("qxqzApi"), jsonObject.getString("qxqzApi").substring(6), qxqz); + String qxqz = getsendBody("1", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp")); + boolean qxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("qxqzApi"), jsonObject.getString("qxqzApi").substring(0,6), qxqz); if (!qxqzflag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "库存材料出库取消签字失败"); return returnObject; } //库存材料出库单删除 - String sc = getsendBody("2", jsonObject, jsonObject.getString("code")); - boolean scflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("scApi"), jsonObject.getString("scApi").substring(6), sc); + String sc = getsendBody("2", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp")); + boolean scflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("scApi"), jsonObject.getString("scApi").substring(0,6), sc); if (!scflag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "库存材料出库单删除失败"); @@ -926,8 +926,8 @@ public class EncapsulationImpl extends BaseService String parm = entity.getBodys(); JSONObject jsonObject = JSONObject.parseObject(parm); jsonObject.put("dataSourceCode",sysDataSourceEntities.get(0).getSourceCode()); - jsonObject.put("publicKey",headers.get("publicKey")); - jsonObject.put("secretKey",headers.get("secretKey")); + jsonObject.put("publicKey",entity.getSendApp().getPublicKey()); + jsonObject.put("secretKey",entity.getSendApp().getSecretKey()); jsonObject.put("qxqzApi",headers.get("qxqzApi")); jsonObject.put("scApi",headers.get("scApi")); @@ -1003,16 +1003,16 @@ public class EncapsulationImpl extends BaseService } //库存其他出库取消签字 - String qxqz = getsendBody("1", jsonObject, jsonObject.getString("code")); - boolean qxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("qxqzApi"), jsonObject.getString("qxqzApi").substring(6), qxqz); + String qxqz = getsendBody("1", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp")); + boolean qxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("qxqzApi"), jsonObject.getString("qxqzApi").substring(0,6), qxqz); if (!qxqzflag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "库存其他出库取消签字失败"); return returnObject; } //库存其他出库删除 - String sc = getsendBody("2", jsonObject, jsonObject.getString("code")); - boolean scflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("scApi"), jsonObject.getString("scApi").substring(6), sc); + String sc = getsendBody("2", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp")); + boolean scflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("scApi"), jsonObject.getString("scApi").substring(0,6), sc); if (!scflag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "库存其他出库删除失败"); @@ -1046,8 +1046,8 @@ public class EncapsulationImpl extends BaseService String parm = entity.getBodys(); JSONObject jsonObject = JSONObject.parseObject(parm); jsonObject.put("dataSourceCode",sysDataSourceEntities.get(0).getSourceCode()); - jsonObject.put("publicKey",headers.get("publicKey")); - jsonObject.put("secretKey",headers.get("secretKey")); + jsonObject.put("publicKey",entity.getSendApp().getPublicKey()); + jsonObject.put("secretKey",entity.getSendApp().getSecretKey()); jsonObject.put("qxqzApi",headers.get("qxqzApi")); jsonObject.put("scApi",headers.get("scApi")); @@ -1123,16 +1123,16 @@ public class EncapsulationImpl extends BaseService } //库存其他入库单取消签字 - String qxqz = getsendBody("1", jsonObject, jsonObject.getString("code")); - boolean qxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("qxqzApi"), jsonObject.getString("qxqzApi").substring(6), qxqz); + String qxqz = getsendBody("1", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp")); + boolean qxqzflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("qxqzApi"), jsonObject.getString("qxqzApi").substring(0,6), qxqz); if (!qxqzflag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "库存其他入库单取消签字失败"); return returnObject; } //库存其他入库删除 - String sc = getsendBody("2", jsonObject, jsonObject.getString("code")); - boolean scflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("scApi"), jsonObject.getString("scApi").substring(6), sc); + String sc = getsendBody("2", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp")); + boolean scflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("scApi"), jsonObject.getString("scApi").substring(0,6), sc); if (!scflag) { returnObject.put("status", "falied"); returnObject.put("errormsg", "库存其他入库删除失败"); @@ -1164,8 +1164,8 @@ public class EncapsulationImpl extends BaseService String parm = entity.getBodys(); JSONObject jsonObject = JSONObject.parseObject(parm); jsonObject.put("dataSourceCode",sysDataSourceEntities.get(0).getSourceCode()); - jsonObject.put("publicKey",headers.get("publicKey")); - jsonObject.put("secretKey",headers.get("secretKey")); + jsonObject.put("publicKey",entity.getSendApp().getPublicKey()); + jsonObject.put("secretKey",entity.getSendApp().getSecretKey()); jsonObject.put("qxqzApi",headers.get("qxqzApi")); jsonObject.put("scApi",headers.get("scApi")); @@ -1178,7 +1178,7 @@ public class EncapsulationImpl extends BaseService } //拼装数据 - private String getsendBody(String type, JSONObject object, String code) { + private String getsendBody(String type, JSONObject object, String code,String unitcode) { JSONObject jsonObject1 = new JSONObject(); switch (type) { @@ -1190,7 +1190,7 @@ public class EncapsulationImpl extends BaseService JSONObject queryInfo = new JSONObject(); queryInfo.put("date_end", object.getString("date_end")); queryInfo.put("date_begin", object.getString("date_begin")); - queryInfo.put("corp", object.getString("corp")); + queryInfo.put("corp", unitcode); queryInfo.put("billcode", code); jsonObject1.put("unsignInfo", unsignInfo); @@ -1204,7 +1204,7 @@ public class EncapsulationImpl extends BaseService JSONObject queryInfo2 = new JSONObject(); queryInfo2.put("date_end", object.getString("date_end")); queryInfo2.put("date_begin", object.getString("date_begin")); - queryInfo2.put("corp", object.getString("corp")); + queryInfo2.put("corp", unitcode); queryInfo2.put("billcode", code); jsonObject1.put("deleteInfo", unsignInfo2); @@ -1217,7 +1217,7 @@ public class EncapsulationImpl extends BaseService JSONObject queryInfo3 = new JSONObject(); queryInfo3.put("date_end", object.getString("date_end")); queryInfo3.put("date_begin", object.getString("date_begin")); - queryInfo3.put("corp", object.getString("corp")); + queryInfo3.put("corp", unitcode); queryInfo3.put("code", code); jsonObject1.put("approveinfo", unsignInfo3); @@ -1230,7 +1230,7 @@ public class EncapsulationImpl extends BaseService JSONObject queryInfo4 = new JSONObject(); queryInfo4.put("date_end", object.getString("date_end")); queryInfo4.put("date_begin", object.getString("date_begin")); - queryInfo4.put("corp", object.getString("corp")); + queryInfo4.put("corp", unitcode); queryInfo4.put("code", code); jsonObject1.put("deleteinfo", unsignInfo4); @@ -1253,6 +1253,7 @@ public class EncapsulationImpl extends BaseService * @Date 3:05 下午 2024/9/4 **/ private boolean sendPost(String publicKey, String secretKey, String apiCode, String appId, String bodys) { + StringBuilder returnBody = new StringBuilder(); Integer outTime = 6000; HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); From c5eaaf92070c3280c9bf3810a423406b200597c7 Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Tue, 10 Sep 2024 08:34:43 +0800 Subject: [PATCH 058/101] =?UTF-8?q?OA=E6=97=A0=E6=B5=81=E7=A8=8B=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E5=85=AC=E7=94=A8=E5=88=A0=E9=99=A4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../seeyon/dao/ICapFormDefinitionDao.java | 51 ++++++++ .../dao/impl/CapFormDefinitionDaoImpl.java | 39 ++++++ .../entity/CapFormDefinitionEntity.java | 71 +++++++++++ .../seeyon/entity/CapFormDefinitionEntity.xml | 41 ++++++ .../seeyon/service/INoProcessService.java | 26 ++++ .../service/impl/NoProcessServiceImpl.java | 119 ++++++++++++++++++ 6 files changed, 347 insertions(+) create mode 100644 service/src/main/java/com/hzya/frame/seeyon/dao/ICapFormDefinitionDao.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/dao/impl/CapFormDefinitionDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/seeyon/service/INoProcessService.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/service/impl/NoProcessServiceImpl.java diff --git a/service/src/main/java/com/hzya/frame/seeyon/dao/ICapFormDefinitionDao.java b/service/src/main/java/com/hzya/frame/seeyon/dao/ICapFormDefinitionDao.java new file mode 100644 index 00000000..f892fa11 --- /dev/null +++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/dao/impl/CapFormDefinitionDaoImpl.java b/service/src/main/java/com/hzya/frame/seeyon/dao/impl/CapFormDefinitionDaoImpl.java new file mode 100644 index 00000000..07304f45 --- /dev/null +++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.java b/service/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.java new file mode 100644 index 00000000..2ab841bd --- /dev/null +++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.xml b/service/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.xml new file mode 100644 index 00000000..5c0a498d --- /dev/null +++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/service/INoProcessService.java b/service/src/main/java/com/hzya/frame/seeyon/service/INoProcessService.java new file mode 100644 index 00000000..57e72e80 --- /dev/null +++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/service/impl/NoProcessServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/service/impl/NoProcessServiceImpl.java new file mode 100644 index 00000000..87ba10be --- /dev/null +++ b/service/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); + } +} From 6a45c88a18ce88e3446ee52310c06bbc973374a5 Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Tue, 10 Sep 2024 08:42:02 +0800 Subject: [PATCH 059/101] 1 --- .../application/service/impl/SysApplicationServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java index fb7cf0a7..39e6be2e 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java @@ -125,7 +125,7 @@ public class SysApplicationServiceImpl extends BaseService Date: Tue, 10 Sep 2024 08:43:33 +0800 Subject: [PATCH 060/101] 1 --- buildpackage/src/main/resources/application-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildpackage/src/main/resources/application-dev.yml b/buildpackage/src/main/resources/application-dev.yml index 5e9c4b36..aefc15a7 100644 --- a/buildpackage/src/main/resources/application-dev.yml +++ b/buildpackage/src/main/resources/application-dev.yml @@ -2,7 +2,7 @@ logging: #日志级别 指定目录级别 level: - root: warn + root: INFO encodings: UTF-8 file: # 日志保存路径 From 916a133c0c0622590602b8ed480fe1be94b5cded Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Tue, 10 Sep 2024 08:34:43 +0800 Subject: [PATCH 061/101] =?UTF-8?q?OA=E6=97=A0=E6=B5=81=E7=A8=8B=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E5=85=AC=E7=94=A8=E5=88=A0=E9=99=A4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../seeyon/dao/ICapFormDefinitionDao.java | 51 ++++++++ .../dao/impl/CapFormDefinitionDaoImpl.java | 39 ++++++ .../entity/CapFormDefinitionEntity.java | 71 +++++++++++ .../seeyon/entity/CapFormDefinitionEntity.xml | 41 ++++++ .../seeyon/service/INoProcessService.java | 26 ++++ .../service/impl/NoProcessServiceImpl.java | 119 ++++++++++++++++++ 6 files changed, 347 insertions(+) create mode 100644 service/src/main/java/com/hzya/frame/seeyon/dao/ICapFormDefinitionDao.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/dao/impl/CapFormDefinitionDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/seeyon/service/INoProcessService.java create mode 100644 service/src/main/java/com/hzya/frame/seeyon/service/impl/NoProcessServiceImpl.java diff --git a/service/src/main/java/com/hzya/frame/seeyon/dao/ICapFormDefinitionDao.java b/service/src/main/java/com/hzya/frame/seeyon/dao/ICapFormDefinitionDao.java new file mode 100644 index 00000000..f892fa11 --- /dev/null +++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/dao/impl/CapFormDefinitionDaoImpl.java b/service/src/main/java/com/hzya/frame/seeyon/dao/impl/CapFormDefinitionDaoImpl.java new file mode 100644 index 00000000..07304f45 --- /dev/null +++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.java b/service/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.java new file mode 100644 index 00000000..2ab841bd --- /dev/null +++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.xml b/service/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.xml new file mode 100644 index 00000000..5c0a498d --- /dev/null +++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/service/INoProcessService.java b/service/src/main/java/com/hzya/frame/seeyon/service/INoProcessService.java new file mode 100644 index 00000000..57e72e80 --- /dev/null +++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/service/impl/NoProcessServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/service/impl/NoProcessServiceImpl.java new file mode 100644 index 00000000..87ba10be --- /dev/null +++ b/service/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); + } +} From f68aaa92981903b0ea24fd7ecdf4ede46a517e07 Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Tue, 10 Sep 2024 15:30:04 +0800 Subject: [PATCH 062/101] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildpackage/pom.xml | 138 +++++++++--------- .../src/main/resources/application-ax.yml | 23 --- .../src/main/resources/application-dev.yml | 42 ------ .../main/resources/application-hclocal.yml | 27 ---- .../src/main/resources/application-llg.yml | 62 -------- .../src/main/resources/application-local.yml | 23 --- .../src/main/resources/application-xel.yml | 35 ----- .../src/main/resources/application-yc.yml | 90 ------------ .../src/main/resources/application-ydc.yml | 21 --- .../main/resources/application-yuecheng.yml | 31 ---- .../src/main/resources/application-yuqh.yml | 23 --- .../src/main/resources/application-zqt.yml | 35 ----- .../main/resources/application-zqtlocal.yml | 39 ----- 13 files changed, 69 insertions(+), 520 deletions(-) delete mode 100644 buildpackage/src/main/resources/application-ax.yml delete mode 100644 buildpackage/src/main/resources/application-dev.yml delete mode 100644 buildpackage/src/main/resources/application-hclocal.yml delete mode 100644 buildpackage/src/main/resources/application-llg.yml delete mode 100644 buildpackage/src/main/resources/application-local.yml delete mode 100644 buildpackage/src/main/resources/application-xel.yml delete mode 100644 buildpackage/src/main/resources/application-yc.yml delete mode 100644 buildpackage/src/main/resources/application-ydc.yml delete mode 100644 buildpackage/src/main/resources/application-yuecheng.yml delete mode 100644 buildpackage/src/main/resources/application-yuqh.yml delete mode 100644 buildpackage/src/main/resources/application-zqt.yml delete mode 100644 buildpackage/src/main/resources/application-zqtlocal.yml diff --git a/buildpackage/pom.xml b/buildpackage/pom.xml index 5a452f20..ba8c1c4d 100644 --- a/buildpackage/pom.xml +++ b/buildpackage/pom.xml @@ -36,75 +36,75 @@ - - local - - local - - - true - - - - dev - - dev - - - - ax - - ax - - - - hclocal - - hclocal - - - - llg - - llg - - - - zqtlocal - - zqtlocal - - - - yuqh - - yuqh - - - - xel - - xel - - - - ydc - - ydc - - - - yc - - yc - - - - zqt - - zqt - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + dongj diff --git a/buildpackage/src/main/resources/application-ax.yml b/buildpackage/src/main/resources/application-ax.yml deleted file mode 100644 index fda31564..00000000 --- a/buildpackage/src/main/resources/application-ax.yml +++ /dev/null @@ -1,23 +0,0 @@ -#######################澳星环境####################### -logging: - #日志级别 指定目录级别 - level: - root: info - encodings: GBK - file: -# 日志保存路径 - path: E:\yongansystem\log -spring: - datasource: - dynamic: - datasource: - master: - url: jdbc:mysql://127.0.0.1:3306/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 - driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 -savefile: - # 文件保存路径 - path: E:\yongansystem\file -zt: - url: http://127.0.0.1:9081/kangarooDataCenterV3/entranceController/externalCallInterface \ No newline at end of file diff --git a/buildpackage/src/main/resources/application-dev.yml b/buildpackage/src/main/resources/application-dev.yml deleted file mode 100644 index aefc15a7..00000000 --- a/buildpackage/src/main/resources/application-dev.yml +++ /dev/null @@ -1,42 +0,0 @@ -#######################dev环境####################### -logging: - #日志级别 指定目录级别 - level: - root: INFO - encodings: UTF-8 - file: - # 日志保存路径 - path: /home/webservice/zt/log -spring: - datasource: - dynamic: - datasource: - 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 - driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 -savefile: - # 文件保存路径 - path: /home/webservice/zt/file -# path: D:\webservice\file -# pluginpath: D:\webservice\plugin - pluginpath: /home/webservice/zt/plugin -# tomcatpath: D:\apache-tomcat-9.0.69\webapps\kangarooDataCenter\WEB-INF\classes\ - tomcatpath: /home/webservice/zt/tomcatV3/webapps/kangarooDataCenterV3/WEB-INF/classes/ -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/ -OA: - data_source_code: yc_oa -zt: - url: http://127.0.0.1:9082/kangarooDataCenterV3/entranceController/externalCallInterface \ No newline at end of file diff --git a/buildpackage/src/main/resources/application-hclocal.yml b/buildpackage/src/main/resources/application-hclocal.yml deleted file mode 100644 index 1ec327da..00000000 --- a/buildpackage/src/main/resources/application-hclocal.yml +++ /dev/null @@ -1,27 +0,0 @@ -#######################本地环境####################### -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://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 - driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 -savefile: - # 文件保存路径 - path: D:\yongansystem\kangarooDataCenter\v3\logs -zt: - url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface diff --git a/buildpackage/src/main/resources/application-llg.yml b/buildpackage/src/main/resources/application-llg.yml deleted file mode 100644 index a25cb2ca..00000000 --- a/buildpackage/src/main/resources/application-llg.yml +++ /dev/null @@ -1,62 +0,0 @@ -#######################本地环境####################### -logging: - #日志级别 指定目录级别 - level: - root: info - encodings: UTF-8 - file: - # 日志保存路径 - path: /Users/apple/Desktop/log/local -spring: - data: - mongodb: -# host: 192.168.2.237 -# port: 27017 -# database: businesscenter -# auto-index-creation: true -# password: hzya1314 -# username: hzya - flyway: - # 启动flyway migration, 默认为true - enabled: false - datasource: - dynamic: - druid: - filters: stat,log4j2 - datasource: - master: -# url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle -# username: hzyazt -# password: 62e4295b615a30dbf3b8ee96f41c820b -# driver-class-name: dm.jdbc.driver.DmDriver -# type: com.alibaba.druid.pool.DruidDataSource - 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 - driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 -# url: jdbc:dm://hzya.ufyct.com:9040/businesscenter?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8 -# url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle -# username: hzyazt -# password: 62e4295b615a30dbf3b8ee96f41c820b -# driver-class-name: dm.jdbc.driver.DmDriver -savefile: - # 文件保存路径 - path: /Users/apple/Desktop/log/local - tomcatpath: /Users/apple/Desktop/log/local - pluginpath: /Users/apple/Desktop/log/local -zt: - url: http://127.0.0.1:9999/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/ -OA: - data_source_code: djoatest \ No newline at end of file diff --git a/buildpackage/src/main/resources/application-local.yml b/buildpackage/src/main/resources/application-local.yml deleted file mode 100644 index 66d151f2..00000000 --- a/buildpackage/src/main/resources/application-local.yml +++ /dev/null @@ -1,23 +0,0 @@ -#######################本地环境####################### -logging: - #日志级别 指定目录级别 - level: - root: info - encodings: UTF-8 - file: -# 日志保存路径 - path: /Users/apple/Desktop/log/local -spring: - datasource: - dynamic: - datasource: - 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 - driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 -savefile: - # 文件保存路径 - path: /Users/apple/Desktop/log/local -zt: - url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface diff --git a/buildpackage/src/main/resources/application-xel.yml b/buildpackage/src/main/resources/application-xel.yml deleted file mode 100644 index e53ca4c4..00000000 --- a/buildpackage/src/main/resources/application-xel.yml +++ /dev/null @@ -1,35 +0,0 @@ -#######################本地环境####################### -logging: - #日志级别 指定目录级别 - level: - root: info - encodings: UTF-8 - file: -# 日志保存路径 - path: /Users/xiangerlin/work/app/logs/dev -spring: - datasource: - dynamic: - datasource: - 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 - driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 -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 diff --git a/buildpackage/src/main/resources/application-yc.yml b/buildpackage/src/main/resources/application-yc.yml deleted file mode 100644 index b2e3e2cf..00000000 --- a/buildpackage/src/main/resources/application-yc.yml +++ /dev/null @@ -1,90 +0,0 @@ -#logging: -# #日志级别 指定目录级别 -# level: -# root: info -# encodings: UTF-8 -# file: -# # 日志保存路径 -# path: /zt/log -#spring: -# flyway: -# # 启动flyway migration, 默认为true -# enabled: false -# datasource: -# dynamic: -# druid: -# filters: stat,log4j2 -# datasource: -# master: -# url: jdbc:dm://10.75.51.82:5238?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle -# username: businesscenter -# password: 6842568689469adad597d144ee104063 -# driver-class-name: dm.jdbc.driver.DmDriver -#savefile: -# # 文件保存路径 -# path: /zt/file -#公司mysql -#ax: -# url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface -#logging: -# #日志级别 指定目录级别warn -# level: -# root: info -# encodings: UTF-8 -# file: -# # 日志保存路径 -# path: /home/webservice/zt/log -#spring: -# datasource: -# dynamic: -# datasource: -# 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 -# driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 -#savefile: -# # 文件保存路径 -# path: /home/webservice/zt/file - - -#公司服务器达梦 -logging: - #日志级别 指定目录级别 - level: - root: info - encodings: UTF-8 - file: - # 日志保存路径 - path: /zt/log -spring: - flyway: - # 启动flyway migration, 默认为true - enabled: false - datasource: - dynamic: - druid: - filters: stat,log4j2 - datasource: - master: - url: jdbc:dm://ufidahz.com.cn:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle - username: hzyazt - password: 62e4295b615a30dbf3b8ee96f41c820b - driver-class-name: dm.jdbc.driver.DmDriver -savefile: - # 文件保存路径 - path: /zt/file -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: /zt/elecfile -OA: - data_source_code: yc_oa diff --git a/buildpackage/src/main/resources/application-ydc.yml b/buildpackage/src/main/resources/application-ydc.yml deleted file mode 100644 index 3038dda0..00000000 --- a/buildpackage/src/main/resources/application-ydc.yml +++ /dev/null @@ -1,21 +0,0 @@ -#######################本地环境####################### -logging: - #日志级别 指定目录级别 - level: - root: info - encodings: UTF-8 - file: -# 日志保存路径 - path: /Users/xiangerlin/work/app/logs/ydc -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可省略此配置 -savefile: - # 文件保存路径 - path: /Users/xiangerlin/work/app/logs/ydc diff --git a/buildpackage/src/main/resources/application-yuecheng.yml b/buildpackage/src/main/resources/application-yuecheng.yml deleted file mode 100644 index 7e081ecb..00000000 --- a/buildpackage/src/main/resources/application-yuecheng.yml +++ /dev/null @@ -1,31 +0,0 @@ -#######################本地环境####################### -logging: - #日志级别 指定目录级别 - level: - root: info - encodings: UTF-8 - file: -# 日志保存路径 - path: /Users/xiangerlin/work/app/logs/yuecheng -spring: - datasource: - dynamic: - datasource: - 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 - driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 -savefile: - # 文件保存路径 - path: /Users/xiangerlin/work/app/logs/yuecheng -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 diff --git a/buildpackage/src/main/resources/application-yuqh.yml b/buildpackage/src/main/resources/application-yuqh.yml deleted file mode 100644 index d114d224..00000000 --- a/buildpackage/src/main/resources/application-yuqh.yml +++ /dev/null @@ -1,23 +0,0 @@ -#######################本地环境####################### -logging: - #日志级别 指定目录级别 - level: - root: info - encodings: UTF-8 - file: -# 日志保存路径 - path: E:\yongansystem\log -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可省略此配置 -savefile: - # 文件保存路径 - path: E:\yongansystem\log -zt: - url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface diff --git a/buildpackage/src/main/resources/application-zqt.yml b/buildpackage/src/main/resources/application-zqt.yml deleted file mode 100644 index fef30d8a..00000000 --- a/buildpackage/src/main/resources/application-zqt.yml +++ /dev/null @@ -1,35 +0,0 @@ -#######################dev环境####################### -logging: - #日志级别 指定目录级别 - level: - root: info - encodings: UTF-8 - file: - # 日志保存路径 - path: D:\log -spring: - datasource: - dynamic: - datasource: - 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 - driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 -savefile: - # 文件保存路径 - path: D:\log -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/ -OA: - data_source_code: djoatest \ No newline at end of file diff --git a/buildpackage/src/main/resources/application-zqtlocal.yml b/buildpackage/src/main/resources/application-zqtlocal.yml deleted file mode 100644 index ffff00a3..00000000 --- a/buildpackage/src/main/resources/application-zqtlocal.yml +++ /dev/null @@ -1,39 +0,0 @@ -#######################zqtlocal环境####################### -logging: - #日志级别 指定目录级别 - level: - root: info - encodings: UTF-8 - file: - # 日志保存路径 - path: D:/local/logs/ -spring: - datasource: - dynamic: - datasource: - 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 - driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 -savefile: - # 文件保存路径 - path: D:/local/upload/ - pluginpath : D:/local/plugin/ - tomcatpath: E:\apache-tomcat-9.0.27\webapps\kangarooDataCenterV3\WEB-INF\classes\ -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/ -OA: - data_source_code: yc_oa -zt: - url: http://127.0.0.1:9082/kangarooDataCenterV3/entranceController/externalCallInterface \ No newline at end of file From d7d1ef5078048411fbf6522aab87181784a219bb Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Tue, 10 Sep 2024 16:32:28 +0800 Subject: [PATCH 063/101] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=AF=BB=E5=8F=96=E4=B8=8D=E5=88=B0=20?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E4=B8=8D=E6=88=90=E5=8A=9F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../file/download/service/impl/FileDownloadServiceImpl.java | 6 +++--- .../sys/file/upload/service/impl/FileUploadServiceImpl.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/sys/file/download/service/impl/FileDownloadServiceImpl.java b/service/src/main/java/com/hzya/frame/sys/file/download/service/impl/FileDownloadServiceImpl.java index 036d31a7..83e2eb05 100644 --- a/service/src/main/java/com/hzya/frame/sys/file/download/service/impl/FileDownloadServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sys/file/download/service/impl/FileDownloadServiceImpl.java @@ -30,13 +30,13 @@ import java.util.zip.ZipInputStream; public class FileDownloadServiceImpl extends BaseService< FileDownloadEntity,Long> implements IFileDownloadService{ protected IFileDownloadDao filedownloadDao; - @Value("${savefile.path}") + @Value("${savefile.path:}") public String DSK; - @Value("${savefile.pluginpath}") + @Value("${savefile.pluginpath:}") public String PLUGINPATH; - @Value("${savefile.tomcatpath}") + @Value("${savefile.tomcatpath:}") public String TOMCATPATH; @Autowired public void setFileDownloadDao(IFileDownloadDao dao) { diff --git a/service/src/main/java/com/hzya/frame/sys/file/upload/service/impl/FileUploadServiceImpl.java b/service/src/main/java/com/hzya/frame/sys/file/upload/service/impl/FileUploadServiceImpl.java index b2ccda26..071fa4e2 100644 --- a/service/src/main/java/com/hzya/frame/sys/file/upload/service/impl/FileUploadServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sys/file/upload/service/impl/FileUploadServiceImpl.java @@ -40,10 +40,10 @@ import java.util.zip.ZipFile; */ @Service(value = "sys_fileUploadService") public class FileUploadServiceImpl extends BaseService implements IFileUploadService { - @Value("${savefile.path}") + @Value("${savefile.path:}") public String DSK; - @Value("${savefile.pluginpath}") + @Value("${savefile.pluginpath:}") public String PLUGINPATH; protected IFileUploadDao fileUploadDao; From 17518aa2d44742c4d84953c9f0f0fd63fcb57e83 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Wed, 11 Sep 2024 14:04:44 +0800 Subject: [PATCH 064/101] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BB=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=BF=9D=E5=AD=98=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mdmDistribute/plugin/MdmModulePluginInitializer.java | 6 +++--- .../com/hzya/frame/mdm/service/impl/MdmServiceImpl.java | 4 ++-- .../application/service/impl/SysApplicationServiceImpl.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java index de6fb968..ebff9dc2 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java @@ -704,7 +704,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { continue; }else { //保存日志 - saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"3"); + 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(),"3"); continue; } } @@ -885,7 +885,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { continue; }else { //保存日志 - saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"2"); + 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(),"2"); continue; } } @@ -1124,7 +1124,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { continue; }else { //保存日志 - saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + 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"); continue; } } diff --git a/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java index 26c03807..fcb46154 100644 --- a/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java @@ -1935,7 +1935,7 @@ public class MdmServiceImpl implements IMdmService { } } catch (Exception e) { logger.error("新增返回脚本解析保存三方id错误" + jsonResultEntity.getAttribute()); - saveMdmModuleSendLogEntity(mdmModuleEntity.getMdmCode(), mdmModuleDistributeEntity.getId(), "2", "转发失败", dbname, object.getString("id"), sysApplicationEntity.getName(), sysApplicationEntity.getId(), apiEntity.getApiName(), apiEntity.getId(), object.toJSONString(), type); + 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("发送错误:新增返回脚本解析保存三方id错误"); } } @@ -1943,7 +1943,7 @@ public class MdmServiceImpl implements IMdmService { saveMdmModuleSendLogEntity(mdmModuleEntity.getMdmCode(), mdmModuleDistributeEntity.getId(), "1", "发送成功", dbname, object.getString("id"), sysApplicationEntity.getName(), sysApplicationEntity.getId(), apiEntity.getApiName(), apiEntity.getId(), object.toJSONString(), type); return BaseResult.getSuccessMessageEntity("发送成功"); } else { - saveMdmModuleSendLogEntity(mdmModuleEntity.getMdmCode(), mdmModuleDistributeEntity.getId(), "2", "转发失败", dbname, object.getString("id"), sysApplicationEntity.getName(), sysApplicationEntity.getId(), apiEntity.getApiName(), apiEntity.getId(), object.toJSONString(), type); + 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()); } } diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java index 2a11d6ef..b6ad01cd 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java +++ b/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; } From 504c9e54c0333527a8030f0e1d72144e55e1aada Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Wed, 11 Sep 2024 14:07:03 +0800 Subject: [PATCH 065/101] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BB=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=BF=9D=E5=AD=98=E4=BF=A1=E6=81=AF?= 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/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml index bd141eed..d9571819 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml @@ -379,7 +379,7 @@ where id = #{id} `org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID', `company_id` varchar(50) DEFAULT NULL COMMENT '公司id', `data_type` varchar(255) DEFAULT NULL COMMENT '状态 1、成功2、失败', - `remark` varchar(255) DEFAULT NULL COMMENT '备注', + `remark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '备注', `id` varchar(50) NOT NULL COMMENT '唯一标识码', @@ -397,7 +397,7 @@ where id = #{id} `org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID', `company_id` varchar(50) DEFAULT NULL COMMENT '公司id', `data_type` varchar(50) DEFAULT NULL COMMENT '状态 1、成功2、失败', - `remark` varchar(255) DEFAULT NULL COMMENT '备注', + `remark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '备注', `distribute_id` varchar(50) DEFAULT NULL COMMENT 'distribute_id', `api_id` varchar(50) DEFAULT NULL COMMENT 'apiid', `app_id` varchar(50) DEFAULT NULL COMMENT 'app_id', From 6055a0954c00ff89c4ed7b9bbed697e07dc4e91c Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Fri, 13 Sep 2024 10:48:05 +0800 Subject: [PATCH 066/101] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=BB=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=B8=8B=E5=8F=91=E6=9D=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mdmDistribute/plugin/MdmModulePluginInitializer.java | 6 +++--- buildpackage/src/main/resources/application.yml | 2 +- .../hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml | 8 ++++---- .../com/hzya/frame/sys/template/entity/TemplateMapper.xml | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java index aef186c0..411215ea 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java @@ -544,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); @@ -739,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); @@ -927,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); diff --git a/buildpackage/src/main/resources/application.yml b/buildpackage/src/main/resources/application.yml index 7b481a9d..aef79e6c 100644 --- a/buildpackage/src/main/resources/application.yml +++ b/buildpackage/src/main/resources/application.yml @@ -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:8901/kangarooDataCenterV3/entranceController/externalCallInterface #JimuReport[minidao配置] minidao : base-package: org.jeecg.modules.jmreport.desreport.dao* diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml index d9571819..629067a8 100644 --- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml +++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml @@ -985,20 +985,20 @@ where id = #{id} - ${item.rightParenthesis} and + ${item.rightParenthesis} - ${item.rightParenthesis} + ${item.rightParenthesis} and - ${item.rightParenthesis} or + ${item.rightParenthesis} - ${item.rightParenthesis} + ${item.rightParenthesis} or diff --git a/service/src/main/java/com/hzya/frame/sys/template/entity/TemplateMapper.xml b/service/src/main/java/com/hzya/frame/sys/template/entity/TemplateMapper.xml index ea3115a2..2b07793f 100644 --- a/service/src/main/java/com/hzya/frame/sys/template/entity/TemplateMapper.xml +++ b/service/src/main/java/com/hzya/frame/sys/template/entity/TemplateMapper.xml @@ -79,7 +79,7 @@ FROM information_schema.TABLES WHERE - TABLE_SCHEMA = 'businesscenter' + TABLE_SCHEMA = 'businesscenter_kjs' and TABLE_NAME = #{tableName} From 00eebd3fb54d301027241e9b60b9c042f31bb3cc Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Wed, 18 Sep 2024 08:50:13 +0800 Subject: [PATCH 067/101] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E8=B0=83=E7=94=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hzya/frame/bip/v3/v2207/util/BipUtil.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/bip/v3/v2207/util/BipUtil.java b/service/src/main/java/com/hzya/frame/bip/v3/v2207/util/BipUtil.java index 551d932d..992da9d5 100644 --- a/service/src/main/java/com/hzya/frame/bip/v3/v2207/util/BipUtil.java +++ b/service/src/main/java/com/hzya/frame/bip/v3/v2207/util/BipUtil.java @@ -22,7 +22,7 @@ public class BipUtil { */ public static String sendU9cTOBipEsb(String parm, String apiCode,String token){ - String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface"; + String baseUrl = "http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface"; System.out.println("推送参数"+parm); String result = HttpRequest.post(baseUrl) .header("appId", "800023")//头信息,多个头信息多次调用此方法即可 @@ -40,7 +40,7 @@ public class BipUtil { return null; } public static String getBipToken(String userCode, String apiCode){ - String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface"; + String baseUrl = "http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface"; String result = HttpRequest.post(baseUrl) .header("appId", "800023")//头信息,多个头信息多次调用此方法即可 .header("apiCode", apiCode)//头信息,多个头信息多次调用此方法即可 @@ -59,7 +59,7 @@ public class BipUtil { return null; } public static String sendOaToU8c(String parm, String apiCode){ - String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface"; + String baseUrl = "http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface"; System.out.println("推送参数"+parm); String result = HttpRequest.post(baseUrl) .header("appId", "800035")//头信息,多个头信息多次调用此方法即可 From f1604d68eb8d840ed9cbbb67751aea26c0a97031 Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Wed, 18 Sep 2024 08:51:30 +0800 Subject: [PATCH 068/101] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E8=B0=83=E7=94=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml index c90d9e45..2aab8a1a 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml +++ b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml @@ -82,7 +82,7 @@ field0073 as r_bzbm, field0092 as r_ywybm from formmain_0045 - where field0089 = 'N' + where field0089 is null and id like concat('%',#{id},'%') From 97f57a493f2dcb3b37150d20fcdfa7ade0ed332e Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 19 Sep 2024 09:32:07 +0800 Subject: [PATCH 069/101] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AD=E5=8F=B0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=9C=B0=E5=9D=80=209999=E6=94=B9=E6=88=9089?= =?UTF-8?q?01=202024=E5=B9=B49=E6=9C=8819=E6=97=A509:31:50?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/a8bill/plugin/AccLogPluginInitializer.java | 7 ++++--- .../a8bill/service/impl/NingboBankPluginServiceImpl.java | 6 +++--- buildpackage/src/test/java/com/hzya/frame/temButtom.java | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/AccLogPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/AccLogPluginInitializer.java index 4757f41a..ee1ecf96 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/AccLogPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/AccLogPluginInitializer.java @@ -1,6 +1,7 @@ package com.hzya.frame.plugin.a8bill.plugin; import cn.hutool.core.convert.Convert; +import cn.hutool.core.date.DateUtil; import cn.hutool.core.map.MapBuilder; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; @@ -130,8 +131,8 @@ public class AccLogPluginInitializer extends PluginBaseEntity { //1、查询宁波银行的交易记录 AccTransactionReq accTransactionReq = new AccTransactionReq(); accTransactionReq.setCdSign(NingboBankUtil.SHOURU); - accTransactionReq.setBeginDate("2024-07-01"); - accTransactionReq.setEndDate("2024-07-30"); + accTransactionReq.setBeginDate(DateUtil.format(DateUtil.yesterday(),"yyyy-MM-dd")); + accTransactionReq.setEndDate(DateUtil.today()); accTransactionReq.setBankAccList(accList); Map headerMap = MapBuilder.create(true) .put("apiCode", "8000360002") @@ -139,7 +140,7 @@ public class AccLogPluginInitializer extends PluginBaseEntity { .put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") .put("appId","800036") .build(); - String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(JSONObject.toJSONString(accTransactionReq)).timeout(60000).execute().body(); + String body = HttpRequest.post("http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(JSONObject.toJSONString(accTransactionReq)).timeout(60000).execute().body(); System.out.println(body); if (StrUtil.isNotEmpty(body)){ JSONObject response = JSONObject.parseObject(body); diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java index 13b293ae..4b2e911b 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java @@ -267,7 +267,7 @@ private IFormmain0044Service formmain0044Service; //.put("appId","800036") .put("appId",appId) .build(); - String res = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(header).body(params).timeout(20000).execute().body(); + String res = HttpRequest.post("http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(header).body(params).timeout(50000).execute().body(); return res; } @@ -321,7 +321,7 @@ private IFormmain0044Service formmain0044Service; .put("secretKey","B8sgQwEaskwM7BQj1XLvu3kdKD3xm7Lyd4FWsPaFQk5v+UtQLCkzVzLlCZ9Bdyv2j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") .put("appId","800034") .build(); - String res = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(header).body(paramsTemplate.toString()).timeout(60000).execute().body(); + String res = HttpRequest.post("http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(header).body(paramsTemplate.toString()).timeout(60000).execute().body(); System.out.println("保存oa底表结果:"+res); } } @@ -396,7 +396,7 @@ private IFormmain0044Service formmain0044Service; param.put("billno",billCode); param.put("corpcode",dwbm); param.put("billType","paybill"); - param.put("userCode","yonyou02"); + param.put("userCode","hzya"); param.put("ckeckResult","Y"); param.put("ckeckNote","审批通过"); String s = executeEsb(param.toString(), "8000350060","800035"); diff --git a/buildpackage/src/test/java/com/hzya/frame/temButtom.java b/buildpackage/src/test/java/com/hzya/frame/temButtom.java index 1ac76208..26c3a2ce 100644 --- a/buildpackage/src/test/java/com/hzya/frame/temButtom.java +++ b/buildpackage/src/test/java/com/hzya/frame/temButtom.java @@ -75,7 +75,7 @@ public class temButtom { @Test public void updateU8CTest(){ try { - ningboBankPluginService.updateU8CStatus("FK2408260001","002"); + ningboBankPluginService.updateU8CStatus("FK2409190002","001"); }catch (Exception ex){ ex.printStackTrace(); } From 8a3dcc44ab6ff93bd1d603879dc0658e72bd741a Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Thu, 19 Sep 2024 11:20:33 +0800 Subject: [PATCH 070/101] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=94=B6=E6=AC=BE?= =?UTF-8?q?=E5=8D=95=E6=8E=A8=E9=80=81U8C=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../receiptFor/entity/ReceiptForEntity.java | 16 ++++++++++++++++ .../receiptFor/entity/ReceiptForEntity.xml | 6 ++++++ .../service/impl/ReceiptForServiceImpl.java | 6 ++++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.java b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.java index 63ce8300..edf3f0b2 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.java +++ b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.java @@ -29,8 +29,24 @@ public class ReceiptForEntity extends BaseEntity { private String ddh; private String bbhl; private String contractno; + private String djlxbm;//交易类型编码 + private String pj_jsfs;//结算方式编码 + public String getPj_jsfs() { + return pj_jsfs; + } + public void setPj_jsfs(String pj_jsfs) { + this.pj_jsfs = pj_jsfs; + } + + public String getDjlxbm() { + return djlxbm; + } + + public void setDjlxbm(String djlxbm) { + this.djlxbm = djlxbm; + } public String getDfbbje() { return dfbbje; diff --git a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml index 2aab8a1a..9659424c 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml +++ b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml @@ -12,6 +12,8 @@ + + @@ -70,6 +72,9 @@ field0013 as r_dfbbje, field0011 as r_dfybje, field0019 as r_fph, + 'D2' as djlxbm, + field0095 as pj_jsfs, + field0014 as bfyhzh, field0059 as r_zy, field0073 as r_bzbm_code, field0001 as r_djbh, @@ -83,6 +88,7 @@ field0092 as r_ywybm from formmain_0045 where field0089 is null + and finishedflag = '1' and id like concat('%',#{id},'%') diff --git a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/impl/ReceiptForServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/impl/ReceiptForServiceImpl.java index 1308f412..36564a0f 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/impl/ReceiptForServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/impl/ReceiptForServiceImpl.java @@ -203,6 +203,7 @@ public class ReceiptForServiceImpl extends BaseService parentvo.put("dwbm",rec.getDwbm()); parentvo.put("hbbm",rec.getHbbm()); parentvo.put("lrr",rec.getLrr()); + parentvo.put("djlxbm",rec.getDjlxbm());//交易类型编码 parentvo.put("shr",rec.getShr()); parentvo.put("shrq",rec.getShrq().substring(0,10)); @@ -210,8 +211,9 @@ public class ReceiptForServiceImpl extends BaseService //parentvo.put("wldx",rec.getWldx()); parentvo.put("deptid",rec.getDeptid()); //parentvo.put("ywybm",rec.getYwybm()); - //parentvo.put("bfyhzh",rec.getBfyhzh()); - parentvo.put("skyhmc",rec.getSkyhmc()); + parentvo.put("bfyhzh",rec.getBfyhzh()); + parentvo.put("skyhmc",rec.getSkyhmc());//收款银行账号 + parentvo.put("pj_jsfs",rec.getPj_jsfs());//结算方式 //parentvo.put("dfyhzh",rec.getDfyhzh()); parentvo.put("fkyhmc",rec.getFkyhmc()); parentvo.put("bzbm",rec.getBzbm()); From 86aac2c3f5cab04e45e3b09e50ed2dd4bce5e87e Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Fri, 20 Sep 2024 10:09:01 +0800 Subject: [PATCH 071/101] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=BA=95=E8=A1=A8=E7=9A=84=E8=AF=AD=E5=8F=A5=202024=E5=B9=B49?= =?UTF-8?q?=E6=9C=8820=E6=97=A510:08:56?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java index 4b2e911b..e681f5d7 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java @@ -148,7 +148,7 @@ private IFormmain0044Service formmain0044Service; str = "update "+tableName+" set " + fieldName + "= '" +subState+"'" +sync_flag+"where id = '"+main.getString("id")+"'"; } catch (Exception e) { subState = "N"; - str = "update "+tableName+" set " + fieldName + "= '" +subState+"'" +payMsg+" = '"+attribute+"' "+"where id = '"+main.getString("id")+"'"; + str = "update "+tableName+" set " + fieldName + "= '" +subState+"'," +payMsg+" = '"+attribute+"' "+"where id = '"+main.getString("id")+"'"; logger.info("保存日志失败"+e.getMessage()); oaBillEntity.setSql(str); payBillDao.updateStateForId(str,oaBillEntity); From c814e0c475d684bf46d23a5d1a7fb08c1a83f978 Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Tue, 24 Sep 2024 09:38:37 +0800 Subject: [PATCH 072/101] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=94=B6=E6=AC=BE?= =?UTF-8?q?=E5=8D=95=E6=8E=A8=E9=80=81U8C=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dongj.yml | 2 +- .../src/main/resources/application.yml | 2 +- .../receiptFor/entity/ReceiptForEntity.java | 45 +++++++++++++++++++ .../receiptFor/entity/ReceiptForEntity.xml | 18 ++++++-- .../service/impl/ReceiptForServiceImpl.java | 9 +++- .../service/impl/ComparisonServiceImpl.java | 8 ++-- 6 files changed, 72 insertions(+), 12 deletions(-) diff --git a/buildpackage/src/main/resources/application-dongj.yml b/buildpackage/src/main/resources/application-dongj.yml index 28fa5bb3..a4e93212 100644 --- a/buildpackage/src/main/resources/application-dongj.yml +++ b/buildpackage/src/main/resources/application-dongj.yml @@ -12,7 +12,7 @@ spring: dynamic: datasource: 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 + url: jdbc:mysql://115.239.174.22:3306/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 driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 diff --git a/buildpackage/src/main/resources/application.yml b/buildpackage/src/main/resources/application.yml index aef79e6c..146859a0 100644 --- a/buildpackage/src/main/resources/application.yml +++ b/buildpackage/src/main/resources/application.yml @@ -1,5 +1,5 @@ server: - port: 9999 + port: 8901 servlet: context-path: /kangarooDataCenterV3 localIP: 127.0.0.1 diff --git a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.java b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.java index edf3f0b2..3205944c 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.java +++ b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.java @@ -31,6 +31,51 @@ public class ReceiptForEntity extends BaseEntity { private String contractno; private String djlxbm;//交易类型编码 private String pj_jsfs;//结算方式编码 + private String scomment;//备注 + private String zyx22;//合同号 + private String zyx24;//合同名称 + private String zyx28;//用途 + private String szxmid;//收支项目 + + public String getSzxmid() { + return szxmid; + } + + public void setSzxmid(String szxmid) { + this.szxmid = szxmid; + } + + public String getZyx28() { + return zyx28; + } + + public void setZyx28(String zyx28) { + this.zyx28 = zyx28; + } + + public String getZyx22() { + return zyx22; + } + + public void setZyx22(String zyx22) { + this.zyx22 = zyx22; + } + + public String getZyx24() { + return zyx24; + } + + public void setZyx24(String zyx24) { + this.zyx24 = zyx24; + } + + public String getScomment() { + return scomment; + } + + public void setScomment(String scomment) { + this.scomment = scomment; + } public String getPj_jsfs() { return pj_jsfs; diff --git a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml index 9659424c..a13bf8f0 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml +++ b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/entity/ReceiptForEntity.xml @@ -19,16 +19,21 @@ - + - + + + + + + @@ -80,12 +85,17 @@ field0001 as r_djbh, field0004 as r_wldx, field0091 as r_deptid, - field0060 as r_bfyhzh, + field0060 as dfyhzh, field0062 as r_skyhmc, field0014 as r_dfyhzh, field0051 as r_fkyhmc, field0073 as r_bzbm, - field0092 as r_ywybm + field0068 as scomment, + field0042 as zyx22, + field0009 as zyx24, + field0092 as r_ywybm, + field0096 as szxmid, + field0058 as zyx28 from formmain_0045 where field0089 is null and finishedflag = '1' diff --git a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/impl/ReceiptForServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/impl/ReceiptForServiceImpl.java index 36564a0f..f6f9ed3d 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/impl/ReceiptForServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/impl/ReceiptForServiceImpl.java @@ -211,10 +211,15 @@ public class ReceiptForServiceImpl extends BaseService //parentvo.put("wldx",rec.getWldx()); parentvo.put("deptid",rec.getDeptid()); //parentvo.put("ywybm",rec.getYwybm()); - parentvo.put("bfyhzh",rec.getBfyhzh()); + parentvo.put("bfyhzh",rec.getBfyhzh());//本方银行账号 parentvo.put("skyhmc",rec.getSkyhmc());//收款银行账号 parentvo.put("pj_jsfs",rec.getPj_jsfs());//结算方式 - //parentvo.put("dfyhzh",rec.getDfyhzh()); + parentvo.put("dfyhzh",rec.getDfyhzh());//对方银行账号 + parentvo.put("scomment",rec.getScomment());//备注 + parentvo.put("zyx22",rec.getZyx22());//合同号 + parentvo.put("zyx24",rec.getZyx24());//合同名称 + parentvo.put("zyx28",rec.getZyx28());//用途 + parentvo.put("szxmid",rec.getSzxmid());//收支项目 parentvo.put("fkyhmc",rec.getFkyhmc()); parentvo.put("bzbm",rec.getBzbm()); diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java index a4948dd0..12f50559 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java @@ -105,10 +105,10 @@ public class ComparisonServiceImpl extends BaseService //查询主表数据 List> comparisonEntitiePages = comparisonDao.queryComparisonPage(comparisonEntity); - //递归查询组织树 - if(comparisonEntities.get(0).getViewName().equals("1")){ - return recursiveQueryComparison(comparisonEntitiePages,comparisonEntity); - } +// //递归查询组织树 +// if(comparisonEntities.get(0).getViewName().equals("1")){ +// return recursiveQueryComparison(comparisonEntitiePages,comparisonEntity); +// } if(CollectionUtils.isNotEmpty(comparisonEntitiePages)){ for (Map comparisonEntitiePage : comparisonEntitiePages) { From 59ce4792f951c2d2fd19e1fd6d4dc6a74d7c4b1e Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Thu, 26 Sep 2024 10:24:34 +0800 Subject: [PATCH 073/101] 1 --- .../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/service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java index 3b0bf5be..aac97324 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/login/impl/LoginServiceImpl.java @@ -122,7 +122,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/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java b/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java index e99454da..01be7c99 100644 --- a/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java +++ b/webapp/src/main/java/com/hzya/frame/webapp/entrance/service/impl/EntranceServiceImpl.java @@ -128,8 +128,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/webapp/src/main/java/com/hzya/frame/webapp/web/exception/ExceptionController.java b/webapp/src/main/java/com/hzya/frame/webapp/web/exception/ExceptionController.java index 3e966cf1..6488d4fd 100644 --- a/webapp/src/main/java/com/hzya/frame/webapp/web/exception/ExceptionController.java +++ b/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/webapp/src/main/java/com/hzya/frame/webapp/web/filter/SaTokenConfigure.java b/webapp/src/main/java/com/hzya/frame/webapp/web/filter/SaTokenConfigure.java index b325e29f..3411d439 100644 --- a/webapp/src/main/java/com/hzya/frame/webapp/web/filter/SaTokenConfigure.java +++ b/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 2cfeec1f9966c1f43b810adf7f0787424a8e3cfb Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Sun, 29 Sep 2024 16:25:26 +0800 Subject: [PATCH 074/101] =?UTF-8?q?feat:=20u8c=E5=AE=A1=E6=89=B9=E5=B8=90?= =?UTF-8?q?=E5=8F=B7=E4=BF=AE=E6=94=B9=20=EF=BC=8C=E4=BB=8Ehzya=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=88=9015715849962=20=E5=86=85=E9=83=A8=E7=BE=A4?= =?UTF-8?q?=E9=87=8C=E8=B4=BA=E7=81=BF=E8=AE=A9=E6=94=B9=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java index e681f5d7..1a5f22ea 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java @@ -396,7 +396,7 @@ private IFormmain0044Service formmain0044Service; param.put("billno",billCode); param.put("corpcode",dwbm); param.put("billType","paybill"); - param.put("userCode","hzya"); + param.put("userCode","15715849962"); param.put("ckeckResult","Y"); param.put("ckeckNote","审批通过"); String s = executeEsb(param.toString(), "8000350060","800035"); From f893941710a0bb67a5a0df0cb0c9ea32fefe41a5 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Mon, 30 Sep 2024 10:25:16 +0800 Subject: [PATCH 075/101] =?UTF-8?q?feat:=20=E4=B8=AD=E5=8F=B0=E7=AB=AF?= =?UTF-8?q?=E5=8F=A3=E4=BF=AE=E6=94=B9=EF=BC=8C=209999=E6=94=B9=E6=88=9089?= =?UTF-8?q?01?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java index 6318757b..e57f0e41 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java @@ -143,7 +143,7 @@ public class SalesBillingServiceImpl implements ISalesBillingService { .put("secretKey", secretKey) .put("appId", appId) .build(); - String res = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(header).body(params).timeout(60000).execute().body(); + String res = HttpRequest.post("http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(header).body(params).timeout(60000).execute().body(); return res; } } From 9f748783bc07b1bb7c7ddb35d0d57f6f7749842c Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Mon, 30 Sep 2024 11:39:20 +0800 Subject: [PATCH 076/101] =?UTF-8?q?fix:=20=E9=94=80=E5=94=AE=E5=BC=80?= =?UTF-8?q?=E7=A5=A8=E5=AE=A1=E6=89=B9=E4=BA=BA=E4=BF=AE=E6=94=B9=20?= =?UTF-8?q?=E6=94=B9=E6=88=9015715849962?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/u8c/salesBilling/entity/U8cSalesBillingEntity.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/main/java/com/hzya/frame/u8c/salesBilling/entity/U8cSalesBillingEntity.xml b/service/src/main/java/com/hzya/frame/u8c/salesBilling/entity/U8cSalesBillingEntity.xml index e3f49a5d..b9c194ba 100644 --- a/service/src/main/java/com/hzya/frame/u8c/salesBilling/entity/U8cSalesBillingEntity.xml +++ b/service/src/main/java/com/hzya/frame/u8c/salesBilling/entity/U8cSalesBillingEntity.xml @@ -22,7 +22,7 @@ formmain_0049.field0045 as corp, -- 公司编码 CONVERT(varchar,formmain_0049.start_date, 23) as dateBegin,-- 单据开始日期 CONVERT(varchar,formmain_0049.modify_date, 23) as dateEnd, -- 单据结束日期 - '15639671252' as approvid, -- 审批人 + '15715849962' as approvid, -- 审批人 CONVERT(varchar,formmain_0049.modify_date, 23) as approvedate, -- 审核时间 case when COL_SUMMARY.STATE = '1' then 'R' when COL_SUMMARY.STATE = '3' then 'Y' ELSE 'Y' END as status, -- 审批状态(Y:通过,N:不通过,R:驳回) '已阅' as note -- 批语 From e9bdcfe9bddf11935cc59c52f8d16f2cbb202ff0 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 8 Oct 2024 10:16:56 +0800 Subject: [PATCH 077/101] =?UTF-8?q?fix:=20=E9=94=80=E5=94=AE=E5=BC=80?= =?UTF-8?q?=E7=A5=A8=E5=AE=A1=E6=89=B9=E7=BB=93=E6=9E=9C=E4=BC=A0=E5=88=B0?= =?UTF-8?q?u8c=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9=EF=BC=8C=E7=94=A8?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E5=AE=A1=E6=89=B9=E6=8E=A5=E5=8F=A3=202024?= =?UTF-8?q?=E5=B9=B410=E6=9C=888=E6=97=A510:16:44?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../u8c/service/impl/SalesBillingServiceImpl.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java index e57f0e41..15047033 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java @@ -29,7 +29,9 @@ public class SalesBillingServiceImpl implements ISalesBillingService { private IU8cSalesBillingService iu8cSalesBillingService; private final String appId = "800035"; - private final String apiCode = "8000350047"; + //这个接口调错了。要用开发的那个审批接口 + //private final String apiCode = "8000350047"; + private final String apiCode = "8000350060"; private final String publicKey = "ZJYATW/MfYZX7zF0eAh4DJXbyTLwUtwSoSz5Y/o1ksAaN/dCe7eDIk+3zDUT+v578prj"; private final String secretKey = "+5BUkLQh3iX3VHgEt5bE2IPh+ZeebGvDaEspsvVu739Ar6sFnwg+fpPod4t6XhoTj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="; @@ -131,6 +133,16 @@ public class SalesBillingServiceImpl implements ISalesBillingService { data.put("queryinfo", queryinfo); data.put("approveinfo", approveinfo); params = data.toJSONString(); + + //用新的审批接口 + JSONObject jsonObject = new JSONObject(); + jsonObject.put("billno",entity.getCode()); + jsonObject.put("corpcode",entity.getCode()); + jsonObject.put("billType","saleinvoice"); + jsonObject.put("userCode","15715849962"); + jsonObject.put("ckeckResult","Y"); + jsonObject.put("ckeckNote","审批通过"); + params = jsonObject.toString(); return params; } From 697a89884469061235c33f90a3be2e739fa6ae19 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 9 Oct 2024 11:17:01 +0800 Subject: [PATCH 078/101] =?UTF-8?q?=E5=85=AC=E5=8F=B8=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java index 15047033..4b943082 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/service/impl/SalesBillingServiceImpl.java @@ -137,7 +137,7 @@ public class SalesBillingServiceImpl implements ISalesBillingService { //用新的审批接口 JSONObject jsonObject = new JSONObject(); jsonObject.put("billno",entity.getCode()); - jsonObject.put("corpcode",entity.getCode()); + jsonObject.put("corpcode",entity.getCorp()); jsonObject.put("billType","saleinvoice"); jsonObject.put("userCode","15715849962"); jsonObject.put("ckeckResult","Y"); From 7069df374efa75aa022453c60a5af1785aed687e Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 9 Oct 2024 15:44:49 +0800 Subject: [PATCH 079/101] =?UTF-8?q?feat:=20OA=E4=BB=98=E6=AC=BE=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E5=8D=95=E6=B5=81=E7=A8=8B=E7=BB=93=E6=9D=9F=E4=BC=A0?= =?UTF-8?q?u8c=E6=8B=86=E5=88=86=E6=88=90=E7=8B=AC=E7=AB=8B=E7=9A=84?= =?UTF-8?q?=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PayReqSyncU8CPluginInitializer.java | 152 ++++++++++++++++++ .../service/INingboBankPluginService.java | 6 +- .../impl/NingboBankPluginServiceImpl.java | 99 ++++++++++-- 3 files changed, 238 insertions(+), 19 deletions(-) create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayReqSyncU8CPluginInitializer.java diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayReqSyncU8CPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayReqSyncU8CPluginInitializer.java new file mode 100644 index 00000000..bf7d7ae8 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayReqSyncU8CPluginInitializer.java @@ -0,0 +1,152 @@ +package com.hzya.frame.plugin.a8bill.plugin; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.a8bill.dao.IPayBillPluginInitializerDao; +import com.hzya.frame.plugin.a8bill.entity.PayBillEntity; +import com.hzya.frame.plugin.a8bill.service.INingboBankPluginService; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +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 javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; + +/** + * @Description OA付款申请审批完成后传u8c + * @Author xiangerlin + * @Date 2024/10/9 14:19 + **/ +public class PayReqSyncU8CPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private INingboBankPluginService ningboBankPluginService; + @Resource + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + @Autowired + private IPayBillPluginInitializerDao payBillDao; + @Value("${OA.data_source_code}") + private String oa_data_source_code; + + /*** + * 插件初始化方法 + * @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 "PayReqSyncU8CPlugin"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "付款申请审批结果传U8C"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "付款申请审批结果传U8C"; + } + + /*** + * 插件类型 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 { + logger.info("======开始执行付款申请审批结果传U8C========"); + JSONObject requestJsonObj = JSON.parseObject(requestJson.toString(), JSONObject.class); + String integration_task_living_details_id = requestJsonObj.getString("integration_task_living_details_id"); + IntegrationTaskLivingDetailsEntity oldMsg = new IntegrationTaskLivingDetailsEntity(); + if (StrUtil.isNotEmpty(integration_task_living_details_id)) { + oldMsg = taskLivingDetailsService.get(integration_task_living_details_id); + } + String rootAppPk = oldMsg.getRootAppPk(); + try { + StringBuffer sb = new StringBuffer(); + if (StrUtil.isNotEmpty(rootAppPk)) { + sb.append(" and id = '" + rootAppPk + "'"); + }else { + sb.append("and finishedflag = '1' and pushState is null"); + } + PayBillEntity oaBillEntity = new PayBillEntity(); + oaBillEntity.setDataSourceCode(oa_data_source_code); + StringBuffer stringBuffer = new StringBuffer(); + //付款单 + stringBuffer.append("SELECT * from v_hzya_payres_u8c WHERE 1= 1 "); + stringBuffer.append(sb.toString()); + List> hashMaps = payBillDao.getOaBillData(stringBuffer.toString(), oaBillEntity); + for (HashMap hashMap : hashMaps) { + JSONObject main = new JSONObject(); + for (String key : hashMap.keySet()) { + main.put(key, hashMap.get(key)); + } + ningboBankPluginService.updateU8CStatus(main,integration_task_living_details_id); + } + } catch (Exception e) { + logger.info("获取OA数据失败" + e.getMessage()); + e.printStackTrace(); + } + return BaseResult.getSuccessMessageEntity(getPluginName()+"执行成功"); + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java index 80c6010f..a60a7302 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/INingboBankPluginService.java @@ -53,8 +53,8 @@ public interface INingboBankPluginService { /** * 更新u8c单据状态 - * @param billCode oa单据编号 - * @param dwbm 公司编码 + * @param jsonObject + * @param integration_task_living_details_id 重试id */ - void updateU8CStatus(String billCode,String dwbm); + void updateU8CStatus(JSONObject jsonObject,String integration_task_living_details_id); } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java index 1a5f22ea..889ba344 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/NingboBankPluginServiceImpl.java @@ -157,8 +157,6 @@ private IFormmain0044Service formmain0044Service; //修改推送状态,防止重复推送 oaBillEntity.setSql(str); payBillDao.updateStateForId(str,oaBillEntity); - //更新u8c付款单状态 - updateU8CStatus(main.getString("serialNo"),main.getString("dwbm")); }catch (Exception e){ logger.info("宁波银行付款接口调用出错:{}",e); } @@ -386,25 +384,94 @@ private IFormmain0044Service formmain0044Service; /** * 更新u8c单据状态 - * @param billCode oa单据编号 - * @param dwbm 公司编码 + * @param main */ @Override - public void updateU8CStatus(String billCode,String dwbm) { + public void updateU8CStatus(JSONObject main,String integration_task_living_details_id) { + String billCode = main.getString("serialNo"); + String dwbm = main.getString("dwbm"); + String state = main.getString("state"); + String userCode = main.getString("userCode"); + String id = main.getString("id"); if (StrUtil.isNotEmpty(billCode)){ - JSONObject param = new JSONObject(); - param.put("billno",billCode); - param.put("corpcode",dwbm); - param.put("billType","paybill"); - param.put("userCode","15715849962"); - param.put("ckeckResult","Y"); - param.put("ckeckNote","审批通过"); - String s = executeEsb(param.toString(), "8000350060","800035"); - System.out.println("调用U8C付款单审批返回参数"+s); - logger.info("调用U8C付款单审批返回参数:{}",s); + PayBillEntity oaBillEntity = new PayBillEntity(); + oaBillEntity.setDataSourceCode(oa_data_source_code); + String str = "update formmain_0058 set field0072 = 'N' where id = "+id; + try { + JSONObject param = new JSONObject(); + param.put("billno",billCode); + param.put("corpcode",dwbm); + param.put("billType","paybill"); + param.put("userCode",userCode); + param.put("ckeckResult","3".equals(state) ? "Y" :"N"); + param.put("ckeckNote",getStateName(state)); + String result = executeEsb(param.toString(), "8000350060","800035"); + logger.info("调用U8C付款单审批返回参数:{}",result); + //保存日志 + IntegrationTaskLivingDetailsEntity taskLivingDetail = new IntegrationTaskLivingDetailsEntity(); + taskLivingDetail.setCreate_time(new Date()); + taskLivingDetail.setModify_time(new Date()); + taskLivingDetail.setRootAppPk(id); + taskLivingDetail.setRootAppBill(main.getString("serialNo")); + taskLivingDetail.setPluginId("PayReqSyncU8CPlugin"); + taskLivingDetail.setRootAppNewData(param.toString()); + taskLivingDetail.setNewTransmitInfo(result); + taskLivingDetail.setNewPushDate(new Date()); + JSONObject resultObj = JSON.parseObject(result); + boolean flag = resultObj.getBoolean("flag"); + //保存日志 + saveLog(integration_task_living_details_id,flag,taskLivingDetail); + //更新oa表单推送状态 + if (flag){ + str = "update formmain_0058 set field0072 = 'Y' where id = "+id; + } + }catch (Exception e){ + logger.error("执行U8C付款单审批接口出错:{}",e); + } + //修改推送状态,防止重复推送 + oaBillEntity.setSql(str); + try { + payBillDao.updateStateForId(str,oaBillEntity); + } catch (Exception e) { + logger.error("执行U8C付款单审批接口后更新OA单据状态出错:{}",e); + } + } + } + //审批状态对应的中文 + private String getStateName(String state){ + if ("3".equals(state)){ + return "审批通过"; + }else if ("1".equals(state)){ + return "流程终止"; + }else if ("2".equals(state)){ + return "流程撤销"; + } + return "审批通过"; + } + public void saveLog(String integration_task_living_details_id, Boolean flag, IntegrationTaskLivingDetailsEntity taskLivingDetail){ + try { + //判断,成功调用这个方法 + if (StrUtil.isEmpty(integration_task_living_details_id)){ + if (flag){ + taskLivingDetailsService.saveLogToSuccess(taskLivingDetail); + }else { + //失败 调用这个方法 + taskLivingDetailsService.saveLogToFail(taskLivingDetail); + } + }else { + taskLivingDetail.setId(integration_task_living_details_id); + if (flag){ + //如果是重试 成功调这个方法 + taskLivingDetailsService.saveLogFailToSuccess(taskLivingDetail); + }else { + //如果是重试 失败调这个方法 + taskLivingDetailsService.updateLogFailToSuccess(taskLivingDetail); + } + } + }catch (Exception e){ + logger.error("保存日志出错:{}",e); } } - private static String getAccLogXmlTemplate(){ // return ""; return ""; From 473435ab21459d5cc35cd1fe0a60085519a072a6 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 9 Oct 2024 15:45:27 +0800 Subject: [PATCH 080/101] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0OA=E4=BB=98?= =?UTF-8?q?=E6=AC=BE=E5=AE=A1=E6=89=B9=E5=8D=95=E6=B5=81=E7=A8=8B=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=E4=BC=A0u8c=E6=8F=92=E4=BB=B6=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/ningbobank/spring/spring-buildpackage-plugin.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/buildpackage/src/main/resources/cfgHome/plugin/ningbobank/spring/spring-buildpackage-plugin.xml b/buildpackage/src/main/resources/cfgHome/plugin/ningbobank/spring/spring-buildpackage-plugin.xml index 207becf2..448a645d 100644 --- a/buildpackage/src/main/resources/cfgHome/plugin/ningbobank/spring/spring-buildpackage-plugin.xml +++ b/buildpackage/src/main/resources/cfgHome/plugin/ningbobank/spring/spring-buildpackage-plugin.xml @@ -6,4 +6,5 @@ + From b0f95f3478c664b9bf9c46450a628c2f66197595 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 9 Oct 2024 15:46:02 +0800 Subject: [PATCH 081/101] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=8E=89=E6=B2=A1?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildpackage/src/test/java/com/hzya/frame/temButtom.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildpackage/src/test/java/com/hzya/frame/temButtom.java b/buildpackage/src/test/java/com/hzya/frame/temButtom.java index 26c3a2ce..28dd916a 100644 --- a/buildpackage/src/test/java/com/hzya/frame/temButtom.java +++ b/buildpackage/src/test/java/com/hzya/frame/temButtom.java @@ -75,7 +75,7 @@ public class temButtom { @Test public void updateU8CTest(){ try { - ningboBankPluginService.updateU8CStatus("FK2409190002","001"); + //ningboBankPluginService.updateU8CStatus("FK2409190002","001","3"); }catch (Exception ex){ ex.printStackTrace(); } From c8d95fe33503a47bd61844b6a7ded1077d1d9f20 Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Mon, 14 Oct 2024 15:20:47 +0800 Subject: [PATCH 082/101] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E9=93=B6=E8=A1=8C=E6=B5=81=E6=B0=B4=E6=8A=A5=E9=94=99=E4=BA=86?= =?UTF-8?q?=E4=B8=8D=E7=BB=A7=E7=BB=AD=E6=89=A7=E8=A1=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../receiptFor/service/impl/ReceiptForServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/impl/ReceiptForServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/impl/ReceiptForServiceImpl.java index f6f9ed3d..0fad67ad 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/impl/ReceiptForServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/seeyon/receiptFor/service/impl/ReceiptForServiceImpl.java @@ -59,12 +59,12 @@ public class ReceiptForServiceImpl extends BaseService //如果是重推,是否通过entity传入的id,只能查到一条数据。 //entity.setId("-8845102890648320822"); List receiptList = receiptForDao.getOaReceipt(entity); - + logger.info("收款单查询数据{}",JSONObject.toJSONString(receiptList)); if(CollectionUtils.isNotEmpty(receiptList)){ for(ReceiptForEntity rec : receiptList){ try{ + logger.info("组装数据"); JSONObject main = bindingAdd(rec); - logger.info("收款认领单推送数据:"+main.toString()); String result = BipUtil.sendOaToU8c(main.toString(),"8000350034"); logger.info("收款认领单推送结果:"+result); @@ -113,6 +113,7 @@ public class ReceiptForServiceImpl extends BaseService receiptForDao.updateState(rec); // } catch (Exception e) { + logger.info("收款单执行失败1"+e); logger.info("收款单执行失败"+e.getMessage()); e.printStackTrace(); } From 937395744e984ac3a602fde389d5fd2d4b10f224 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Thu, 17 Oct 2024 10:29:31 +0800 Subject: [PATCH 083/101] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/entity/U8CReturnEntity.java | 58 +++++ .../impl/SysApplicationServiceImpl.java | 208 +++++++++++++----- .../entity/SysMessageManageLogEntity.java | 22 ++ 3 files changed, 227 insertions(+), 61 deletions(-) create mode 100644 service/src/main/java/com/hzya/frame/sysnew/application/entity/U8CReturnEntity.java diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/entity/U8CReturnEntity.java b/service/src/main/java/com/hzya/frame/sysnew/application/entity/U8CReturnEntity.java new file mode 100644 index 00000000..cbe17902 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/sysnew/application/entity/U8CReturnEntity.java @@ -0,0 +1,58 @@ +package com.hzya.frame.sysnew.application.entity; + + +/** + * 应用表(SysApplication)实体类 + * + * @author makejava + * @since 2023-09-22 16:22:18 + */ +public class U8CReturnEntity { + + private String status; + private String data; + private String taskNumber; + private String errorcode; + private String errormsg; + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getData() { + return data; + } + + public void setData(String data) { + this.data = data; + } + + public String getTaskNumber() { + return taskNumber; + } + + public void setTaskNumber(String taskNumber) { + this.taskNumber = taskNumber; + } + + 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; + } +} + diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java index d7d27103..c90a4621 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java @@ -73,6 +73,7 @@ import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import java.io.IOException; +import java.io.InputStream; import java.lang.reflect.Method; import java.nio.file.Files; import java.nio.file.Path; @@ -1688,10 +1689,18 @@ public class SysApplicationServiceImpl extends BaseService oldheaderMap = ServletUtil.getHeaderMap(request); + logger.info("发送数据3"+(System.currentTimeMillis()-startTime1)); + String oldquerys = request.getQueryString(); //应用key String publicKey = request.getHeader("publicKey"); @@ -1701,8 +1710,11 @@ public class SysApplicationServiceImpl extends BaseService 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"}); @@ -1791,6 +1810,7 @@ public class SysApplicationServiceImpl extends BaseService 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())) { @@ -1881,6 +1905,8 @@ public class SysApplicationServiceImpl extends BaseService 0) { for (Method m : methods) { if (null != m) { @@ -1947,16 +1983,30 @@ public class SysApplicationServiceImpl extends BaseService ids; + + private JSONObject returnObject; + private U8CReturnEntity u8CReturnEntity; + public String getReturnType() { return returnType; } @@ -196,5 +202,21 @@ public class SysMessageManageLogEntity extends BaseEntity { public void setCreateTimeEnd(Date createTimeEnd) { this.createTimeEnd = createTimeEnd; } + + public JSONObject getReturnObject() { + return returnObject; + } + + public void setReturnObject(JSONObject returnObject) { + this.returnObject = returnObject; + } + + public U8CReturnEntity getU8CReturnEntity() { + return u8CReturnEntity; + } + + public void setU8CReturnEntity(U8CReturnEntity u8CReturnEntity) { + this.u8CReturnEntity = u8CReturnEntity; + } } From bb5aa51255be7dcd5e6e3cce72627ef1e73bffc1 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Thu, 17 Oct 2024 11:28:03 +0800 Subject: [PATCH 084/101] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/service/impl/SysApplicationServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java index c90a4621..a098d0fe 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java @@ -2343,7 +2343,7 @@ public class SysApplicationServiceImpl extends BaseService Date: Thu, 17 Oct 2024 16:33:26 +0800 Subject: [PATCH 085/101] =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=90=8C=E6=AD=A5OA=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzya/frame/u8c/sosale/dao/ISoSaleDao.java | 36 ++ .../frame/u8c/sosale/dao/ISoSaleLineDao.java | 28 ++ .../u8c/sosale/dao/impl/SoSaleDaoImpl.java | 32 ++ .../sosale/dao/impl/SoSaleLineDaoImpl.java | 21 ++ .../frame/u8c/sosale/entity/SoSaleEntity.java | 245 +++++++++++++ .../frame/u8c/sosale/entity/SoSaleEntity.xml | 82 +++++ .../u8c/sosale/entity/SoSaleLineEntity.java | 143 ++++++++ .../u8c/sosale/entity/SoSaleLineEntity.xml | 53 +++ .../u8c/sosale/service/ISoSaleService.java | 22 ++ .../service/impl/SoSaleServiceImpl.java | 328 ++++++++++++++++++ 10 files changed, 990 insertions(+) create mode 100644 service/src/main/java/com/hzya/frame/u8c/sosale/dao/ISoSaleDao.java create mode 100644 service/src/main/java/com/hzya/frame/u8c/sosale/dao/ISoSaleLineDao.java create mode 100644 service/src/main/java/com/hzya/frame/u8c/sosale/dao/impl/SoSaleDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8c/sosale/dao/impl/SoSaleLineDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8c/sosale/entity/SoSaleEntity.java create mode 100644 service/src/main/java/com/hzya/frame/u8c/sosale/entity/SoSaleEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/u8c/sosale/entity/SoSaleLineEntity.java create mode 100644 service/src/main/java/com/hzya/frame/u8c/sosale/entity/SoSaleLineEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/u8c/sosale/service/ISoSaleService.java create mode 100644 service/src/main/java/com/hzya/frame/u8c/sosale/service/impl/SoSaleServiceImpl.java diff --git a/service/src/main/java/com/hzya/frame/u8c/sosale/dao/ISoSaleDao.java b/service/src/main/java/com/hzya/frame/u8c/sosale/dao/ISoSaleDao.java new file mode 100644 index 00000000..7f7dbdff --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/sosale/dao/ISoSaleDao.java @@ -0,0 +1,36 @@ +package com.hzya.frame.u8c.sosale.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.u8c.sosale.entity.SoSaleEntity; + +import java.util.List; + +/** + * 脚本表(u8c_sales_billing: table)表数据库访问层 + * + * @author makejava + * @since 2024-08-02 11:07:43 + */ +public interface ISoSaleDao extends IBaseDao { +/** + * + * @content 获取U8C主表数据 + * @className: Administrator + * @author laborer + * @date 2024-10-16 15:30 + * + */ + + List getU8cSale(SoSaleEntity entity); +/** + * + * @content 修改推送状态 + * @className: Administrator + * @author laborer + * @date 2024-10-16 16:00 + * + */ + + int updateState(SoSaleEntity sale); +} + diff --git a/service/src/main/java/com/hzya/frame/u8c/sosale/dao/ISoSaleLineDao.java b/service/src/main/java/com/hzya/frame/u8c/sosale/dao/ISoSaleLineDao.java new file mode 100644 index 00000000..15647b24 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/sosale/dao/ISoSaleLineDao.java @@ -0,0 +1,28 @@ +package com.hzya.frame.u8c.sosale.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.u8c.sosale.entity.SoSaleEntity; +import com.hzya.frame.u8c.sosale.entity.SoSaleLineEntity; + +import java.util.List; + +/** + * 脚本表(u8c_sales_billing: table)表数据库访问层 + * + * @author makejava + * @since 2024-08-02 11:07:43 + */ +public interface ISoSaleLineDao extends IBaseDao { +/** + * + * @content 获取U8C明细数据 + * @className: Administrator + * @author laborer + * @date 2024-10-16 15:52 + * + */ + + List getU8cSaleLine(SoSaleLineEntity line); + +} + diff --git a/service/src/main/java/com/hzya/frame/u8c/sosale/dao/impl/SoSaleDaoImpl.java b/service/src/main/java/com/hzya/frame/u8c/sosale/dao/impl/SoSaleDaoImpl.java new file mode 100644 index 00000000..e520ccc9 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/sosale/dao/impl/SoSaleDaoImpl.java @@ -0,0 +1,32 @@ +package com.hzya.frame.u8c.sosale.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.u8c.sosale.dao.ISoSaleDao; +import com.hzya.frame.u8c.sosale.entity.SoSaleEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository(value = "SoSaleDaoImpl") +public class SoSaleDaoImpl extends MybatisGenericDao implements ISoSaleDao { +/** + * + * @content 获取UC8C销售订单表头数据 + * @className: Administrator + * @author laborer + * @date 2024-10-16 15:30 + * + */ +@DS("#entity.dataSourceCode") + @Override + public List getU8cSale(SoSaleEntity entity) { + return (List) super.selectList("com.hzya.frame.u8c.sosale.dao.impl.SoSaleDaoImpl.querySaleMain",entity); + } + @DS("#entity.dataSourceCode") + @Override + public int updateState(SoSaleEntity entity) { + return super.update("com.hzya.frame.u8c.sosale.dao.impl.SoSaleDaoImpl.updateState",entity); + } +} + diff --git a/service/src/main/java/com/hzya/frame/u8c/sosale/dao/impl/SoSaleLineDaoImpl.java b/service/src/main/java/com/hzya/frame/u8c/sosale/dao/impl/SoSaleLineDaoImpl.java new file mode 100644 index 00000000..9ae963fc --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/sosale/dao/impl/SoSaleLineDaoImpl.java @@ -0,0 +1,21 @@ +package com.hzya.frame.u8c.sosale.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.u8c.sosale.dao.ISoSaleDao; +import com.hzya.frame.u8c.sosale.dao.ISoSaleLineDao; +import com.hzya.frame.u8c.sosale.entity.SoSaleEntity; +import com.hzya.frame.u8c.sosale.entity.SoSaleLineEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository(value = "SoSaleLineDaoImpl") +public class SoSaleLineDaoImpl extends MybatisGenericDao implements ISoSaleLineDao { + @DS("#entity.dataSourceCode") + @Override + public List getU8cSaleLine(SoSaleLineEntity entity) { + return (List) super.selectList("com.hzya.frame.u8c.sosale.dao.impl.SoSaleLineDaoImpl.querySaleLine", entity); + } +} + diff --git a/service/src/main/java/com/hzya/frame/u8c/sosale/entity/SoSaleEntity.java b/service/src/main/java/com/hzya/frame/u8c/sosale/entity/SoSaleEntity.java new file mode 100644 index 00000000..ea5ea748 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/sosale/entity/SoSaleEntity.java @@ -0,0 +1,245 @@ +package com.hzya.frame.u8c.sosale.entity; + + +import com.hzya.frame.web.entity.BaseEntity; + +import java.util.List; + +public class SoSaleEntity extends BaseEntity { + private String csaleId;//销售订单主表ID + private String billCode;//单据编号 + private String state; + private String vreceiptcode;// 单据编号 + private String user_code; // 审核人编码 + private String user_name; // 审核人名称 + private String dapprovedate; // 审核日期 + private String custcode;// 客户编码 + private String custname;// 客户名称 + private String vsalestrucode;// 销售组织编码 + private String vsalestruname;// 销售组织名称 + private String bodycode; // 库存组织编码 + private String bodyname; // 库存组织名称 + private String creceiptcustomerid ;// 收货单位 + private String shcode;// 收货单位编码 + private String shname;// 收货单位名称 + private String creceiptcorpid ;// 开票单位 + private String kpcode;// 开票单位编码 + private String kpname;// 开票单位名称 + private String ctransmodeid;// 运输方式 + private String busicode;//业务类型编码 + private String businame;//业务类型名称 + private String vnote;// 备注 + private String unitname;// + private String unitcode;// + + public String getUnitname() { + return unitname; + } + + public void setUnitname(String unitname) { + this.unitname = unitname; + } + + public String getUnitcode() { + return unitcode; + } + + public void setUnitcode(String unitcode) { + this.unitcode = unitcode; + } + + public String getVreceiptcode() { + return vreceiptcode; + } + + public void setVreceiptcode(String vreceiptcode) { + this.vreceiptcode = vreceiptcode; + } + + public String getUser_code() { + return user_code; + } + + public void setUser_code(String user_code) { + this.user_code = user_code; + } + + public String getUser_name() { + return user_name; + } + + public void setUser_name(String user_name) { + this.user_name = user_name; + } + + public String getDapprovedate() { + return dapprovedate; + } + + public void setDapprovedate(String dapprovedate) { + this.dapprovedate = dapprovedate; + } + + public String getCustcode() { + return custcode; + } + + public void setCustcode(String custcode) { + this.custcode = custcode; + } + + public String getCustname() { + return custname; + } + + public void setCustname(String custname) { + this.custname = custname; + } + + public String getVsalestrucode() { + return vsalestrucode; + } + + public void setVsalestrucode(String vsalestrucode) { + this.vsalestrucode = vsalestrucode; + } + + public String getVsalestruname() { + return vsalestruname; + } + + public void setVsalestruname(String vsalestruname) { + this.vsalestruname = vsalestruname; + } + + public String getBodycode() { + return bodycode; + } + + public void setBodycode(String bodycode) { + this.bodycode = bodycode; + } + + public String getBodyname() { + return bodyname; + } + + public void setBodyname(String bodyname) { + this.bodyname = bodyname; + } + + public String getCreceiptcustomerid() { + return creceiptcustomerid; + } + + public void setCreceiptcustomerid(String creceiptcustomerid) { + this.creceiptcustomerid = creceiptcustomerid; + } + + public String getShcode() { + return shcode; + } + + public void setShcode(String shcode) { + this.shcode = shcode; + } + + public String getShname() { + return shname; + } + + public void setShname(String shname) { + this.shname = shname; + } + + public String getCreceiptcorpid() { + return creceiptcorpid; + } + + public void setCreceiptcorpid(String creceiptcorpid) { + this.creceiptcorpid = creceiptcorpid; + } + + public String getKpcode() { + return kpcode; + } + + public void setKpcode(String kpcode) { + this.kpcode = kpcode; + } + + public String getKpname() { + return kpname; + } + + public void setKpname(String kpname) { + this.kpname = kpname; + } + + public String getCtransmodeid() { + return ctransmodeid; + } + + public void setCtransmodeid(String ctransmodeid) { + this.ctransmodeid = ctransmodeid; + } + + public String getBusicode() { + return busicode; + } + + public void setBusicode(String busicode) { + this.busicode = busicode; + } + + public String getBusiname() { + return businame; + } + + public void setBusiname(String businame) { + this.businame = businame; + } + + public String getVnote() { + return vnote; + } + + public void setVnote(String vnote) { + this.vnote = vnote; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + private ListsaleLineList; + + public List getSaleLineList() { + return saleLineList; + } + + public void setSaleLineList(List saleLineList) { + this.saleLineList = saleLineList; + } + + public String getCsaleId() { + return csaleId; + } + + public void setCsaleId(String csaleId) { + this.csaleId = csaleId; + } + + public String getBillCode() { + return billCode; + } + + public void setBillCode(String billCode) { + this.billCode = billCode; + } +} + diff --git a/service/src/main/java/com/hzya/frame/u8c/sosale/entity/SoSaleEntity.xml b/service/src/main/java/com/hzya/frame/u8c/sosale/entity/SoSaleEntity.xml new file mode 100644 index 00000000..c709d6dd --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/sosale/entity/SoSaleEntity.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update so_sale set + vdef1 = #{state} + where csaleid = #{csaleId} + + + diff --git a/service/src/main/java/com/hzya/frame/u8c/sosale/entity/SoSaleLineEntity.java b/service/src/main/java/com/hzya/frame/u8c/sosale/entity/SoSaleLineEntity.java new file mode 100644 index 00000000..10cc9da9 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/sosale/entity/SoSaleLineEntity.java @@ -0,0 +1,143 @@ +package com.hzya.frame.u8c.sosale.entity; + + +import com.hzya.frame.web.entity.BaseEntity; + +public class SoSaleLineEntity extends BaseEntity { + private String csaleId;//销售订单主表ID + private String cinvbasdocid; + private String invcode; + private String invname; + private String invspec; + private String invtype; + private String measname ; + private String nnumber;// 数量 + private String noriginalcurprice;// 无税单价 + private String ntaxrate; // 税率 + private String noriginalcurtaxprice; // 含税单价 + private String noriginalcurmny; // 无税金额 + private String noriginalcursummny; // 价税合计 + private String blargessflag; // 是否赠品 + private String frownote; + + public String getCinvbasdocid() { + return cinvbasdocid; + } + + public void setCinvbasdocid(String cinvbasdocid) { + this.cinvbasdocid = cinvbasdocid; + } + + public String getInvcode() { + return invcode; + } + + public void setInvcode(String invcode) { + this.invcode = invcode; + } + + public String getInvname() { + return invname; + } + + public void setInvname(String invname) { + this.invname = invname; + } + + public String getInvspec() { + return invspec; + } + + public void setInvspec(String invspec) { + this.invspec = invspec; + } + + public String getInvtype() { + return invtype; + } + + public void setInvtype(String invtype) { + this.invtype = invtype; + } + + public String getMeasname() { + return measname; + } + + public void setMeasname(String measname) { + this.measname = measname; + } + + public String getNnumber() { + return nnumber; + } + + public void setNnumber(String nnumber) { + this.nnumber = nnumber; + } + + public String getNoriginalcurprice() { + return noriginalcurprice; + } + + public void setNoriginalcurprice(String noriginalcurprice) { + this.noriginalcurprice = noriginalcurprice; + } + + public String getNtaxrate() { + return ntaxrate; + } + + public void setNtaxrate(String ntaxrate) { + this.ntaxrate = ntaxrate; + } + + public String getNoriginalcurtaxprice() { + return noriginalcurtaxprice; + } + + public void setNoriginalcurtaxprice(String noriginalcurtaxprice) { + this.noriginalcurtaxprice = noriginalcurtaxprice; + } + + public String getNoriginalcurmny() { + return noriginalcurmny; + } + + public void setNoriginalcurmny(String noriginalcurmny) { + this.noriginalcurmny = noriginalcurmny; + } + + public String getNoriginalcursummny() { + return noriginalcursummny; + } + + public void setNoriginalcursummny(String noriginalcursummny) { + this.noriginalcursummny = noriginalcursummny; + } + + public String getBlargessflag() { + return blargessflag; + } + + public void setBlargessflag(String blargessflag) { + this.blargessflag = blargessflag; + } + + public String getFrownote() { + return frownote; + } + + public void setFrownote(String frownote) { + this.frownote = frownote; + } + + public String getCsaleId() { + return csaleId; + } + + public void setCsaleId(String csaleId) { + this.csaleId = csaleId; + } +} + diff --git a/service/src/main/java/com/hzya/frame/u8c/sosale/entity/SoSaleLineEntity.xml b/service/src/main/java/com/hzya/frame/u8c/sosale/entity/SoSaleLineEntity.xml new file mode 100644 index 00000000..cd8f39aa --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/sosale/entity/SoSaleLineEntity.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/service/src/main/java/com/hzya/frame/u8c/sosale/service/ISoSaleService.java b/service/src/main/java/com/hzya/frame/u8c/sosale/service/ISoSaleService.java new file mode 100644 index 00000000..63002409 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/sosale/service/ISoSaleService.java @@ -0,0 +1,22 @@ +package com.hzya.frame.u8c.sosale.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.u8c.sosale.entity.SoSaleEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +import java.util.List; + +public interface ISoSaleService extends IBaseService { + +/** + * + * @content 获取U8C销售订单同步OA销售合同 + * @className: Administrator + * @author laborer + * @date 2024-10-16 15:22 + * + */ + + JsonResultEntity getU8cSaleToOa(JSONObject requestJson); +} diff --git a/service/src/main/java/com/hzya/frame/u8c/sosale/service/impl/SoSaleServiceImpl.java b/service/src/main/java/com/hzya/frame/u8c/sosale/service/impl/SoSaleServiceImpl.java new file mode 100644 index 00000000..3ad71716 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8c/sosale/service/impl/SoSaleServiceImpl.java @@ -0,0 +1,328 @@ +package com.hzya.frame.u8c.sosale.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.basedao.service.impl.BaseService; +import com.hzya.frame.bip.v3.v2207.util.BipUtil; +import com.hzya.frame.seeyon.util.RestUtil; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.u8c.sosale.dao.ISoSaleDao; +import com.hzya.frame.u8c.sosale.dao.ISoSaleLineDao; +import com.hzya.frame.u8c.sosale.entity.SoSaleEntity; +import com.hzya.frame.u8c.sosale.entity.SoSaleLineEntity; +import com.hzya.frame.u8c.sosale.service.ISoSaleService; +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 org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +@Service(value = "SoSaleServiceImpl") +public class SoSaleServiceImpl extends BaseService implements ISoSaleService { + Logger logger = LoggerFactory.getLogger(SoSaleServiceImpl.class); + @Autowired + private ISoSaleDao u8cSaleDao; + @Autowired + private ISoSaleLineDao saleLineDao; + @Autowired + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + + /** + * + * @content 获取U8C销售订单同步OA销售合同 + * @className: Administrator + * @author laborer + * @date 2024-10-16 15:22 + * + */ + @Override + public JsonResultEntity getU8cSaleToOa(JSONObject requestJson) { + + //获取重推信息id,并记录日志 + JSONObject requestJsonObj = JSON.parseObject(requestJson.toString(),JSONObject.class); + String interId = requestJsonObj.getString("integration_task_living_details_id"); + logger.info("U8C销售订单推送OA重推解析后:"+requestJsonObj.toString()); + logger.info("U8C销售订单推送OA重新执行的任务主键:"+interId); + + //更换数据源 + JsonResultEntity resultEntity = new JsonResultEntity(); + SoSaleEntity entity = new SoSaleEntity(); + requestJson.put("db_code","dongjinU8C"); + entity.setDataSourceCode(requestJson.getString("db_code")); + + //根据重推信息id,查询该条重推记录信息 + IntegrationTaskLivingDetailsEntity oldMsg = new IntegrationTaskLivingDetailsEntity(); + if(StrUtil.isNotEmpty(interId)){ + oldMsg = taskLivingDetailsService.get(interId); + } + String rootAppPk = oldMsg.getRootAppPk(); + entity.setId(rootAppPk); + StrUtil.isEmpty(rootAppPk);//entity.setQueryState("查询"); +//如果是重推,是否通过entity传入的id,只能查到一条数据。 + //entity.setId("-8845102890648320822"); + List soleList = u8cSaleDao.getU8cSale(entity); + logger.info("销售订单查询数据{}",JSONObject.toJSONString(soleList)); + if(CollectionUtils.isNotEmpty(soleList)){ + soleList.forEach(sale -> { + try{ + //获取明细数据进行拼接 + String csaleId = sale.getCsaleId(); + if(!StrUtil.isEmpty(csaleId)){ + SoSaleLineEntity line = new SoSaleLineEntity(); + line.setCsaleId(csaleId); + line.setDataSourceCode(requestJson.getString("db_code")); + List lineList = saleLineDao.getU8cSaleLine(line); + logger.info("销售订单明细查询数据{}",JSONObject.toJSONString(lineList)); + sale.setSaleLineList(lineList); + logger.info("组装数据"); + JSONObject main = bindingAdd(sale); + logger.info("销售订单推送数据:"+main.toString()); + String result = RestUtil.sendU8CToOA(main.toString(),"8000340003",sale.getUser_code()); + logger.info("销售订单推送结果:"+result); + IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); + logDetails.setRootAppPk(sale.getCsaleId()); + logDetails.setRootAppBill(sale.getBillCode()); + logDetails.setNewTransmitInfo(result); + logDetails.setNewPushDate(new Date()); + logDetails.setRootAppNewData(JSON.toJSONString(sale)); + logDetails.setPluginId("SaleConPlugin"); + + JSONObject resultObj = JSON.parseObject(result); + boolean flag = resultObj.getString("code").equals("0"); + if(flag){ + // 推送成功,更新状态 + sale.setState("Y"); + }else{ + // 推送失败 + sale.setState("N"); + } + sale.setDataSourceCode(requestJson.getString("db_code")); + try{ + if(StrUtil.isEmpty(interId)){ + if(flag){ + //首推成功 + taskLivingDetailsService.saveLogToSuccess(logDetails); + }else{ + //首推失败 + taskLivingDetailsService.saveLogToFail(logDetails); + } + }else{ + logDetails.setId(interId); + if(flag){ + //重推成功 + taskLivingDetailsService.saveLogFailToSuccess(logDetails); + }else{ + //重推失败,把失败信息,更新到重推表中 + taskLivingDetailsService.updateLogFailToSuccess(logDetails); + } + } + }catch (Exception e){ + logger.info("保存日志失败"+e.getMessage()); + u8cSaleDao.updateState(sale); + e.printStackTrace(); + } + u8cSaleDao.updateState(sale); + } + } catch (Exception e) { + logger.info("销售订单执行失败"+e.getMessage()); + e.printStackTrace(); + } + }); + + } + return new JsonResultEntity("成功",true,resultEntity); + } +/** + * + * @content 组装销售订单数据 + * @className: Administrator + * @author laborer + * @date 2024-10-16 15:34 + * + */ + + private JSONObject bindingAdd(SoSaleEntity rec) { + JSONObject main = new JSONObject(); + main.put("formCode","formmain_0047"); +// main.put("loginName",rec.getUser_code()); + main.put("loginName","yuqh"); + main.put("rightId","-8974880151631871438.3094438342688065626"); + JSONArray dataList = new JSONArray(); + JSONObject dataListObj = new JSONObject(); + + JSONObject masterTable = new JSONObject(); + JSONArray subTables = new JSONArray(); + dataListObj.put("masterTable", masterTable); + masterTable.put("name","formmain_0047"); + JSONObject record = new JSONObject(); + record.put("id","-4921737319255610298"); + JSONArray fields = new JSONArray(); + JSONObject field0001 = new JSONObject();//单据号 + field0001.put("showValue",rec.getBillCode()); + field0001.put("name","field0001"); + field0001.put("value",rec.getBillCode()); + fields.add(field0001); + + JSONObject field0004 = new JSONObject();//单据日期 + field0004.put("showValue",rec.getDapprovedate()); + field0004.put("name","field0004"); + field0004.put("value",rec.getDapprovedate()); + fields.add(field0004); + + JSONObject field0033 = new JSONObject();//合同编号 + field0033.put("showValue",rec.getBillCode()); + field0033.put("name","field0033"); + field0033.put("value",rec.getBillCode()); + fields.add(field0033); + + JSONObject field0014 = new JSONObject();//客户名称 + field0014.put("showValue",rec.getCustname()); + field0014.put("name","field0014"); + field0014.put("value",rec.getBillCode()); + fields.add(field0014); + + JSONObject field0045 = new JSONObject();//客户编码 + field0045.put("showValue",rec.getCustcode()); + field0045.put("name","field0045"); + field0045.put("value",rec.getCustcode()); + fields.add(field0045); + + JSONObject field0005 = new JSONObject();//销售组织 + field0005.put("showValue",rec.getVsalestruname()); + field0005.put("name","field0005"); + field0005.put("value",rec.getBillCode()); + fields.add(field0005); + + JSONObject field0006 = new JSONObject();//库存组织 + field0006.put("showValue",rec.getBodyname()); + field0006.put("name","field0006"); + field0006.put("value",rec.getBodyname()); + fields.add(field0006); + + JSONObject field0007 = new JSONObject();//收货单位 + field0007.put("showValue",rec.getShname()); + field0007.put("name","field0007"); + field0007.put("value",rec.getShname()); + fields.add(field0007); + + JSONObject field0009 = new JSONObject();//开票单位 + field0009.put("showValue",rec.getKpname()); + field0009.put("name","field0009"); + field0009.put("value",rec.getKpname()); + fields.add(field0009); + + JSONObject field0013 = new JSONObject();//业务流程 + field0013.put("showValue",rec.getBusiname()); + field0013.put("name","field0013"); + field0013.put("value",rec.getBusiname()); + fields.add(field0013); + + JSONObject field0018 = new JSONObject();//备注 + field0018.put("showValue",rec.getVnote()); + field0018.put("name","field0018"); + field0018.put("value",rec.getVnote()); + fields.add(field0018); + + record.put("fields",fields); + masterTable.put("record",record); + if(CollectionUtils.isNotEmpty(rec.getSaleLineList())){ + rec.getSaleLineList().forEach(line->{ + JSONObject subTablesObj = new JSONObject(); + JSONArray records = new JSONArray(); + + JSONObject field0020 = new JSONObject();//存货编号 + field0020.put("showValue",line.getInvcode()); + field0020.put("name","field0020"); + field0020.put("value",line.getInvcode()); + records.add(field0020); + + JSONObject field0021 = new JSONObject();//存货名称 + field0021.put("showValue",line.getInvname()); + field0021.put("name","field0021"); + field0021.put("value",line.getInvname()); + records.add(field0021); + + + JSONObject field0022 = new JSONObject();//规格 + field0022.put("showValue",line.getInvspec()); + field0022.put("name","field0022"); + field0022.put("value",line.getInvspec()); + records.add(field0022); + + JSONObject field0023 = new JSONObject();//型号 + field0023.put("showValue",line.getInvtype()); + field0023.put("name","field0023"); + field0023.put("value",line.getInvtype()); + records.add(field0023); + + JSONObject field0024 = new JSONObject();//单位 + field0024.put("showValue",line.getMeasname()); + field0024.put("name","field0024"); + field0024.put("value",line.getMeasname()); + records.add(field0024); + + JSONObject field0025 = new JSONObject();//数量 + field0025.put("showValue",line.getNnumber()); + field0025.put("name","field0025"); + field0025.put("value",line.getNnumber()); + records.add(field0025); + + JSONObject field0026 = new JSONObject();//无税单价 + field0026.put("showValue",line.getNoriginalcurprice()); + field0026.put("name","field0026"); + field0026.put("value",line.getNoriginalcurprice()); + records.add(field0026); + + JSONObject field0027 = new JSONObject();//税率 + field0027.put("showValue",line.getNtaxrate()); + field0027.put("name","field0027"); + field0027.put("value",line.getNtaxrate()); + records.add(field0027); + + JSONObject field0028 = new JSONObject();//含税单价 + field0028.put("showValue",line.getNoriginalcurtaxprice()); + field0028.put("name","field0028"); + field0028.put("value",line.getNoriginalcurtaxprice()); + records.add(field0028); + + JSONObject field0029 = new JSONObject();//无税金额 + field0029.put("showValue",line.getNoriginalcurmny()); + field0029.put("name","field0029"); + field0029.put("value",line.getNoriginalcurmny()); + records.add(field0029); + + JSONObject field0030 = new JSONObject();//价税合计 + field0030.put("showValue",line.getNoriginalcursummny()); + field0030.put("name","field0030"); + field0030.put("value",line.getNoriginalcursummny()); + records.add(field0030); + + JSONObject field0031 = new JSONObject();//是否赠品 + field0031.put("showValue",line.getBlargessflag()); + field0031.put("name","field0031"); + field0031.put("value",line.getBlargessflag()); + records.add(field0031); + + JSONObject field0032 = new JSONObject();//合同编号 + field0032.put("showValue",line.getFrownote()); + field0032.put("name","field0032"); + field0032.put("value",line.getFrownote()); + records.add(field0032); + subTablesObj.put("name","formson_0048"); + subTablesObj.put("records",records); + subTables.add(subTablesObj); + }); + } + dataListObj.put("subTables", subTables); + dataList.add(dataListObj); + main.put("dataList",dataList); + return main; + } +} From f15c2f1d9b99ad2141cfdabcede0bcb07496908c Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Thu, 17 Oct 2024 16:33:46 +0800 Subject: [PATCH 086/101] =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=90=8C=E6=AD=A5OA=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hzya/frame/seeyon/util/RestUtil.java | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/service/src/main/java/com/hzya/frame/seeyon/util/RestUtil.java b/service/src/main/java/com/hzya/frame/seeyon/util/RestUtil.java index 2259638a..e468fae4 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/util/RestUtil.java +++ b/service/src/main/java/com/hzya/frame/seeyon/util/RestUtil.java @@ -206,4 +206,58 @@ public class RestUtil { } return null; } + public static String sendU8CToOA(String parm, String apiCode,String userCode){ + String baseUrl = "http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface"; + System.out.println("推送参数"+parm); + //获取OAtoken + + JSONObject tokenObj = new JSONObject(); + tokenObj.put("password","2cdd6cfc-5b87-47d1-aaea-756a55f6b5a6"); + tokenObj.put("userName","restUser"); + tokenObj.put("loginName",userCode); + tokenObj.put("loginName","yuqh"); + String token = getOaTokenForEsb(tokenObj.toString(),""); + if(StrUtil.isNotEmpty(token)){ + tokenObj = JSON.parseObject(token); + token = tokenObj.getString("id"); + } + + String result = HttpRequest.post(baseUrl) + .header("appId", "800034")//头信息,多个头信息多次调用此方法即可 + .header("apiCode", apiCode)//头信息,多个头信息多次调用此方法即可 + .header("token", token)//头信息,多个头信息多次调用此方法即可 + .header("publicKey", "ZJYA0iD/DtdYCBYE1AqHlz4All0gLb96p8G1xNjdGz4tDZlCe7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可 + .header("secretKey", "nL860JIPqIuB0jUsJE5RZLcyZfi8ArRSz6rk0h69TDbkf3Qq0Jstwk9FIgbGa6ejj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可 + .body(parm)//表单内容 + .timeout(20000)//超时,毫秒 + .execute().body(); + System.out.println("返回参数"+result); + if(StrUtil.isNotEmpty(result)){ + return analytic(result); + } + return null; + } + + public static String getOaTokenForEsb(String parm, String apiCode){ + String baseUrl = "http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface"; + System.out.println("推送参数"+parm); + String result = HttpRequest.post(baseUrl) + .header("appId", "800034")//头信息,多个头信息多次调用此方法即可 + .header("apiCode", "8000340000")//头信息,多个头信息多次调用此方法即可 + .header("publicKey", "ZJYA0iD/DtdYCBYE1AqHlz4All0gLb96p8G1xNjdGz4tDZlCe7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可 + .header("secretKey", "nL860JIPqIuB0jUsJE5RZLcyZfi8ArRSz6rk0h69TDbkf3Qq0Jstwk9FIgbGa6ejj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可 + .body(parm)//表单内容 + .timeout(20000)//超时,毫秒 + .execute().body(); + System.out.println("返回参数"+result); + if(StrUtil.isNotEmpty(result)){ + return analytic(result); + } + return null; + } + + public static String analytic(String parm){ + JSONObject main = JSON.parseObject(parm); + return main.getString("attribute"); + } } From 7066e2bec6380107b4fc5c0a6fcba133d9aa04d7 Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Thu, 17 Oct 2024 16:34:04 +0800 Subject: [PATCH 087/101] =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=90=8C=E6=AD=A5OA=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../u8c/plugin/SaleConPluginInitializer.java | 98 +++++++++++++++++++ .../u8c/spring/spring-buildpackage-plugin.xml | 1 + 2 files changed, 99 insertions(+) create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/u8c/plugin/SaleConPluginInitializer.java diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/plugin/SaleConPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/plugin/SaleConPluginInitializer.java new file mode 100644 index 00000000..6c0d6b56 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/plugin/SaleConPluginInitializer.java @@ -0,0 +1,98 @@ +package com.hzya.frame.plugin.u8c.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.u8c.service.ISalesBillingService; +import com.hzya.frame.u8c.sosale.service.ISoSaleService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + + +public class SaleConPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(SaleConPluginInitializer.class); + +@Autowired +private ISoSaleService soSaleService; + + /*** + * 插件初始化方法 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 10:48 + * @Param [] + * @return void + **/ + @Override + public void 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 "SaleConPlugin"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "U8C销售合同同步OA销售合同"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "U8C销售合同同步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 { + return soSaleService.getU8cSaleToOa(requestJson); + } +} diff --git a/buildpackage/src/main/resources/cfgHome/plugin/u8c/spring/spring-buildpackage-plugin.xml b/buildpackage/src/main/resources/cfgHome/plugin/u8c/spring/spring-buildpackage-plugin.xml index 593229f6..2f7f2dcc 100644 --- a/buildpackage/src/main/resources/cfgHome/plugin/u8c/spring/spring-buildpackage-plugin.xml +++ b/buildpackage/src/main/resources/cfgHome/plugin/u8c/spring/spring-buildpackage-plugin.xml @@ -2,4 +2,5 @@ + From a20359be42b50da13da06b8a3876569dd9f1d23f Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Fri, 18 Oct 2024 08:52:02 +0800 Subject: [PATCH 088/101] =?UTF-8?q?=E6=BE=B3=E6=98=9F=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=BD=AC=E5=8F=91=E8=8E=B7=E5=8F=96header=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E7=9A=84=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1b1d7c41..b9730e0b 100644 --- a/.gitignore +++ b/.gitignore @@ -19,7 +19,7 @@ Icon .Trashes .VolumeIcon.icns .com.apple.timemachine.donotpresent - +*.iml # Directories potentially created on remote AFP share .AppleDB .AppleDesktop @@ -60,3 +60,8 @@ $RECYCLE.BIN/ /common/target/ /buildpackage/target/ /webapp/target/ +/E:/yongansystem/log/2024-10-15/ +/base-buildpackage/target/ +/base-common/target/ +/base-core/target/ +/fw-weixin/target/ From d1687abd91a4746408b06c84f28662334e483b18 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Fri, 18 Oct 2024 09:16:15 +0800 Subject: [PATCH 089/101] =?UTF-8?q?=E4=B8=9C=E8=BF=9B=E9=94=80=E5=94=AE?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=88=A0=E9=99=A4=E6=8E=A5=E5=8F=A3=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=A0=E9=99=A4oa=E9=94=80=E5=94=AE?= =?UTF-8?q?=E5=90=88=E5=90=8C=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/EncapsulationImpl.java | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java index 47f23d0b..7efbce26 100644 --- a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java +++ b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java @@ -335,7 +335,7 @@ public class EncapsulationImpl extends BaseService * @return java.lang.Object * @Author lvleigang * @Description 销售订单删除接口 8000350082 - * 0、根据销售钉订单号查询出销售出库单号,1、库存销售出库单取消签字 8000350062 ,2、库存销售出库单删除 8000350063 ,3、销售订单取消审批 8000350064 ,4、销售订单删除 8000350065 + * 0、根据销售钉订单号查询出销售出库单号,1、库存销售出库单取消签字 8000350062 ,2、库存销售出库单删除 8000350063 ,3、销售订单取消审批 8000350064 ,4、销售订单删除 8000350065,4、oa删除合同 8000340012 * @Date 9:44 上午 2024/9/4 **/ @Override @@ -390,6 +390,11 @@ public class EncapsulationImpl extends BaseService returnObject.put("errormsg", "销售订单删除接口编号为空"); return returnObject; } + if (!checkStr(jsonObject.getString("xsht"))) { + returnObject.put("status", "falied"); + returnObject.put("errormsg", "oa合同删除接口编号为空"); + return returnObject; + } if (!checkStr(jsonObject.getString("dataSourceCode"))) { returnObject.put("status", "falied"); @@ -445,9 +450,18 @@ public class EncapsulationImpl extends BaseService String cgddsc = getsendBody("4", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp")); boolean cgddscflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("xsddsc"), jsonObject.getString("xsddsc").substring(0,6), cgddsc); if (cgddscflag) { - returnObject.put("status", "success"); - returnObject.put("errormsg", "销售订单删除成功"); - return returnObject; + //oa删除合同 + String scht = getsendBody("4", jsonObject, jsonObject.getString("code"), jsonObject.getString("corp")); + boolean schtflag = sendPost(jsonObject.getString("publicKey"), jsonObject.getString("secretKey"), jsonObject.getString("xsht"), jsonObject.getString("xsht").substring(0,6), scht); + if (schtflag) { + returnObject.put("status", "success"); + returnObject.put("errormsg", "销售订单删除成功"); + return returnObject; + } else { + returnObject.put("status", "success"); + returnObject.put("errormsg", "销售订单删除成功,oa合同删除失败"); + return returnObject; + } } else { returnObject.put("status", "falied"); returnObject.put("errormsg", "销售订单删除失败"); @@ -1236,6 +1250,11 @@ public class EncapsulationImpl extends BaseService jsonObject1.put("deleteinfo", unsignInfo4); jsonObject1.put("queryinfo", queryInfo4); break; + case "5": //删除 oa销售合同 + jsonObject1.put("formCode", "formmain_0047"); + jsonObject1.put("fieldName", "field0001"); + jsonObject1.put("fieldValue", code); + break; default: } return jsonObject1.toJSONString(); From f17ade414544c76deb5420ee870189920e5a2ea4 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Fri, 18 Oct 2024 09:23:50 +0800 Subject: [PATCH 090/101] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E8=BD=AC=E5=8F=91?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/entity/U8CReturnEntity.java | 58 ------ .../impl/SysApplicationServiceImpl.java | 189 ++++++------------ .../entity/SysMessageManageLogEntity.java | 19 -- 3 files changed, 62 insertions(+), 204 deletions(-) delete mode 100644 service/src/main/java/com/hzya/frame/sysnew/application/entity/U8CReturnEntity.java diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/entity/U8CReturnEntity.java b/service/src/main/java/com/hzya/frame/sysnew/application/entity/U8CReturnEntity.java deleted file mode 100644 index cbe17902..00000000 --- a/service/src/main/java/com/hzya/frame/sysnew/application/entity/U8CReturnEntity.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.hzya.frame.sysnew.application.entity; - - -/** - * 应用表(SysApplication)实体类 - * - * @author makejava - * @since 2023-09-22 16:22:18 - */ -public class U8CReturnEntity { - - private String status; - private String data; - private String taskNumber; - private String errorcode; - private String errormsg; - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getData() { - return data; - } - - public void setData(String data) { - this.data = data; - } - - public String getTaskNumber() { - return taskNumber; - } - - public void setTaskNumber(String taskNumber) { - this.taskNumber = taskNumber; - } - - 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; - } -} - diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java index a098d0fe..53ba8e36 100644 --- a/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java @@ -1689,18 +1689,10 @@ public class SysApplicationServiceImpl extends BaseService oldheaderMap = ServletUtil.getHeaderMap(request); - logger.info("发送数据3"+(System.currentTimeMillis()-startTime1)); - String oldquerys = request.getQueryString(); //应用key String publicKey = request.getHeader("publicKey"); @@ -1710,11 +1702,8 @@ public class SysApplicationServiceImpl extends BaseService 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"}); @@ -1810,7 +1792,6 @@ public class SysApplicationServiceImpl extends BaseService 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())) { @@ -1905,8 +1882,6 @@ public class SysApplicationServiceImpl extends BaseService 0) { for (Method m : methods) { if (null != m) { @@ -1983,30 +1948,16 @@ public class SysApplicationServiceImpl extends BaseService ids; - private JSONObject returnObject; - private U8CReturnEntity u8CReturnEntity; - public String getReturnType() { return returnType; } @@ -203,20 +199,5 @@ public class SysMessageManageLogEntity extends BaseEntity { this.createTimeEnd = createTimeEnd; } - public JSONObject getReturnObject() { - return returnObject; - } - - public void setReturnObject(JSONObject returnObject) { - this.returnObject = returnObject; - } - - public U8CReturnEntity getU8CReturnEntity() { - return u8CReturnEntity; - } - - public void setU8CReturnEntity(U8CReturnEntity u8CReturnEntity) { - this.u8CReturnEntity = u8CReturnEntity; - } } From c596b42646f611b83a88f465f36da9b61fc131c1 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Thu, 31 Oct 2024 08:49:39 +0800 Subject: [PATCH 091/101] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../u8c/Encapsulation/service/impl/EncapsulationImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java index 7efbce26..05681456 100644 --- a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java +++ b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java @@ -597,7 +597,7 @@ public class EncapsulationImpl extends BaseService EncapsulationEntity rk = new EncapsulationEntity(); rk.setCode(jsonObject.getString("code")); rk.setDataSourceCode(jsonObject.getString("dataSourceCode")); - rk.setCbilltypecode("4E"); + rk.setType("5D"); List rklist = encapsulationDao.queryCgrkddh(rk); if(rklist == null || rklist.size() != 1){ returnObject.put("status", "falied"); @@ -608,7 +608,7 @@ public class EncapsulationImpl extends BaseService EncapsulationEntity ck = new EncapsulationEntity(); ck.setCode(jsonObject.getString("code")); ck.setDataSourceCode(jsonObject.getString("dataSourceCode")); - ck.setCbilltypecode("4Y"); + ck.setType("4Y"); List cklist = encapsulationDao.queryCgrkddh(ck); if(cklist == null || cklist.size() != 1){ returnObject.put("status", "falied"); From 1733ec7c54852cdc5975c5c4c1a527a65ed0658f Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Thu, 31 Oct 2024 10:15:42 +0800 Subject: [PATCH 092/101] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../u8c/Encapsulation/service/impl/EncapsulationImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java index 05681456..7efbce26 100644 --- a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java +++ b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java @@ -597,7 +597,7 @@ public class EncapsulationImpl extends BaseService EncapsulationEntity rk = new EncapsulationEntity(); rk.setCode(jsonObject.getString("code")); rk.setDataSourceCode(jsonObject.getString("dataSourceCode")); - rk.setType("5D"); + rk.setCbilltypecode("4E"); List rklist = encapsulationDao.queryCgrkddh(rk); if(rklist == null || rklist.size() != 1){ returnObject.put("status", "falied"); @@ -608,7 +608,7 @@ public class EncapsulationImpl extends BaseService EncapsulationEntity ck = new EncapsulationEntity(); ck.setCode(jsonObject.getString("code")); ck.setDataSourceCode(jsonObject.getString("dataSourceCode")); - ck.setType("4Y"); + ck.setCbilltypecode("4Y"); List cklist = encapsulationDao.queryCgrkddh(ck); if(cklist == null || cklist.size() != 1){ returnObject.put("status", "falied"); From 0fc94df9963d4660082a1d10f9bbb8d1522de859 Mon Sep 17 00:00:00 2001 From: "476474485@qq.com" Date: Fri, 1 Nov 2024 08:28:48 +0800 Subject: [PATCH 093/101] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=80=E5=94=AE?= =?UTF-8?q?=E5=8F=91=E7=A5=A8=E6=9C=AA=E5=AE=A1=E6=A0=B8=E5=90=8C=E6=AD=A5?= =?UTF-8?q?U8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzya/frame/u8c/salesBilling/entity/U8cSalesBillingEntity.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/service/src/main/java/com/hzya/frame/u8c/salesBilling/entity/U8cSalesBillingEntity.xml b/service/src/main/java/com/hzya/frame/u8c/salesBilling/entity/U8cSalesBillingEntity.xml index b9c194ba..65943310 100644 --- a/service/src/main/java/com/hzya/frame/u8c/salesBilling/entity/U8cSalesBillingEntity.xml +++ b/service/src/main/java/com/hzya/frame/u8c/salesBilling/entity/U8cSalesBillingEntity.xml @@ -30,6 +30,7 @@ formmain_0049 LEFT JOIN COL_SUMMARY ON COL_SUMMARY.FORM_RECORDID = formmain_0049.id WHERE formmain_0049.field0044 is NULL and COL_SUMMARY.STATE in ( '1','3','0') + and formmain_0049.finishedflag = 1 update formmain_0049 set From 7570880778344efdb4e0dd3caa4215e15ba87b2c Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Fri, 1 Nov 2024 09:14:55 +0800 Subject: [PATCH 094/101] =?UTF-8?q?=E5=88=86=E7=BB=84=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=8D=95=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml index 1933d3d3..edf4ae46 100644 --- a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml +++ b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml @@ -15,7 +15,7 @@ and csourcetype = #{type} ) and h.cbilltypecode = #{cbilltypecode} - + group by h.vbillcode,a.unitcode From dccbb4cebfca4aee2fa2a6a4afb541ad101adb99 Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Fri, 1 Nov 2024 15:13:18 +0800 Subject: [PATCH 095/101] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AF=B9=E6=8E=A5CRM?= =?UTF-8?q?=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cfgHome/plugin/u8c/spring/spring-buildpackage-plugin.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildpackage/src/main/resources/cfgHome/plugin/u8c/spring/spring-buildpackage-plugin.xml b/buildpackage/src/main/resources/cfgHome/plugin/u8c/spring/spring-buildpackage-plugin.xml index 2f7f2dcc..c487c28c 100644 --- a/buildpackage/src/main/resources/cfgHome/plugin/u8c/spring/spring-buildpackage-plugin.xml +++ b/buildpackage/src/main/resources/cfgHome/plugin/u8c/spring/spring-buildpackage-plugin.xml @@ -1,6 +1,6 @@ - - + + From 87d554ba6498038aa7dbb7ceccd3c0e24a22eb09 Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Fri, 1 Nov 2024 15:13:46 +0800 Subject: [PATCH 096/101] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AF=B9=E6=8E=A5CRM?= =?UTF-8?q?=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SoSaleServiceImpl.java | 47 ++++++++++--------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/u8c/sosale/service/impl/SoSaleServiceImpl.java b/service/src/main/java/com/hzya/frame/u8c/sosale/service/impl/SoSaleServiceImpl.java index 3ad71716..513b38a4 100644 --- a/service/src/main/java/com/hzya/frame/u8c/sosale/service/impl/SoSaleServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/u8c/sosale/service/impl/SoSaleServiceImpl.java @@ -1,5 +1,6 @@ package com.hzya.frame.u8c.sosale.service.impl; +import cn.hutool.core.lang.UUID; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; @@ -162,7 +163,7 @@ public class SoSaleServiceImpl extends BaseService impleme dataListObj.put("masterTable", masterTable); masterTable.put("name","formmain_0047"); JSONObject record = new JSONObject(); - record.put("id","-4921737319255610298"); + record.put("id", UUID.randomUUID().getMostSignificantBits()); JSONArray fields = new JSONArray(); JSONObject field0001 = new JSONObject();//单据号 field0001.put("showValue",rec.getBillCode()); @@ -232,93 +233,95 @@ public class SoSaleServiceImpl extends BaseService impleme record.put("fields",fields); masterTable.put("record",record); + JSONArray records = new JSONArray(); + JSONObject subTablesObj = new JSONObject(); + if(CollectionUtils.isNotEmpty(rec.getSaleLineList())){ rec.getSaleLineList().forEach(line->{ - JSONObject subTablesObj = new JSONObject(); - JSONArray records = new JSONArray(); - + JSONObject body = new JSONObject(); + body.put("id",UUID.randomUUID().getMostSignificantBits()); + JSONArray bodyDetails = new JSONArray(); JSONObject field0020 = new JSONObject();//存货编号 field0020.put("showValue",line.getInvcode()); field0020.put("name","field0020"); field0020.put("value",line.getInvcode()); - records.add(field0020); - + bodyDetails.add(field0020); JSONObject field0021 = new JSONObject();//存货名称 field0021.put("showValue",line.getInvname()); field0021.put("name","field0021"); field0021.put("value",line.getInvname()); - records.add(field0021); - + bodyDetails.add(field0021); JSONObject field0022 = new JSONObject();//规格 field0022.put("showValue",line.getInvspec()); field0022.put("name","field0022"); field0022.put("value",line.getInvspec()); - records.add(field0022); + bodyDetails.add(field0022); JSONObject field0023 = new JSONObject();//型号 field0023.put("showValue",line.getInvtype()); field0023.put("name","field0023"); field0023.put("value",line.getInvtype()); - records.add(field0023); + bodyDetails.add(field0023); JSONObject field0024 = new JSONObject();//单位 field0024.put("showValue",line.getMeasname()); field0024.put("name","field0024"); field0024.put("value",line.getMeasname()); - records.add(field0024); + bodyDetails.add(field0024); JSONObject field0025 = new JSONObject();//数量 field0025.put("showValue",line.getNnumber()); field0025.put("name","field0025"); field0025.put("value",line.getNnumber()); - records.add(field0025); + bodyDetails.add(field0025); JSONObject field0026 = new JSONObject();//无税单价 field0026.put("showValue",line.getNoriginalcurprice()); field0026.put("name","field0026"); field0026.put("value",line.getNoriginalcurprice()); - records.add(field0026); + bodyDetails.add(field0026); JSONObject field0027 = new JSONObject();//税率 field0027.put("showValue",line.getNtaxrate()); field0027.put("name","field0027"); field0027.put("value",line.getNtaxrate()); - records.add(field0027); + bodyDetails.add(field0027); JSONObject field0028 = new JSONObject();//含税单价 field0028.put("showValue",line.getNoriginalcurtaxprice()); field0028.put("name","field0028"); field0028.put("value",line.getNoriginalcurtaxprice()); - records.add(field0028); + bodyDetails.add(field0028); JSONObject field0029 = new JSONObject();//无税金额 field0029.put("showValue",line.getNoriginalcurmny()); field0029.put("name","field0029"); field0029.put("value",line.getNoriginalcurmny()); - records.add(field0029); + bodyDetails.add(field0029); JSONObject field0030 = new JSONObject();//价税合计 field0030.put("showValue",line.getNoriginalcursummny()); field0030.put("name","field0030"); field0030.put("value",line.getNoriginalcursummny()); - records.add(field0030); + bodyDetails.add(field0030); JSONObject field0031 = new JSONObject();//是否赠品 field0031.put("showValue",line.getBlargessflag()); field0031.put("name","field0031"); field0031.put("value",line.getBlargessflag()); - records.add(field0031); + bodyDetails.add(field0031); JSONObject field0032 = new JSONObject();//合同编号 field0032.put("showValue",line.getFrownote()); field0032.put("name","field0032"); field0032.put("value",line.getFrownote()); - records.add(field0032); - subTablesObj.put("name","formson_0048"); - subTablesObj.put("records",records); - subTables.add(subTablesObj); + bodyDetails.add(field0032); + body.put("fields",bodyDetails); }); + subTablesObj.put("records",records); + subTablesObj.put("name","formson_0048"); + subTables.add(subTablesObj); } dataListObj.put("subTables", subTables); dataList.add(dataListObj); From 2c6d81919b0af747e82be40f0a75205477d3039b Mon Sep 17 00:00:00 2001 From: "476474485@qq.com" Date: Sat, 2 Nov 2024 11:41:31 +0800 Subject: [PATCH 097/101] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=85=B3=E8=81=94?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=85=A5=E5=BA=93=E5=8D=95=EF=BC=8C=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E8=BF=87=E6=BB=A4=E5=88=A0=E9=99=A4=E7=8A=B6=E6=80=81?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E4=B8=BAdr=3D0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml index edf4ae46..3221d1d9 100644 --- a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml +++ b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml @@ -14,6 +14,7 @@ SELECT cgeneralhid FROM ic_general_b WHERE vfirstbillcode = #{code} and csourcetype = #{type} ) + and dr = '0' and h.cbilltypecode = #{cbilltypecode} group by h.vbillcode,a.unitcode From f845f4ed26c0b7b02dcb8ebab6948bcc1a62eb45 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Mon, 4 Nov 2024 08:38:23 +0800 Subject: [PATCH 098/101] =?UTF-8?q?=E5=88=86=E7=BB=84=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=8D=95=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/u8c/Encapsulation/entity/EncapsulationEntity.xml | 3 +-- .../u8c/Encapsulation/service/impl/EncapsulationImpl.java | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml index edf4ae46..51c91685 100644 --- a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml +++ b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml @@ -12,12 +12,11 @@ WHERE h.cgeneralhid in ( SELECT cgeneralhid FROM ic_general_b WHERE vfirstbillcode = #{code} - and csourcetype = #{type} + and csourcetype = #{type} and dr = '0' ) and h.cbilltypecode = #{cbilltypecode} group by h.vbillcode,a.unitcode - diff --git a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java index 7efbce26..9ba924c7 100644 --- a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java +++ b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/service/impl/EncapsulationImpl.java @@ -9,7 +9,6 @@ import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; import com.hzya.frame.u8c.Encapsulation.dao.IEncapsulationDao; import com.hzya.frame.u8c.Encapsulation.entity.EncapsulationEntity; -import com.hzya.frame.u8c.Encapsulation.service.IEncapsulationService; import org.apache.http.HttpEntity; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; From 4d73583183a9da6a0246bf6346f25e615b1034ef Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Mon, 4 Nov 2024 08:39:02 +0800 Subject: [PATCH 099/101] =?UTF-8?q?=E5=88=86=E7=BB=84=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=8D=95=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml index 48e8d1e6..51c91685 100644 --- a/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml +++ b/service/src/main/java/com/hzya/frame/u8c/Encapsulation/entity/EncapsulationEntity.xml @@ -14,7 +14,6 @@ SELECT cgeneralhid FROM ic_general_b WHERE vfirstbillcode = #{code} and csourcetype = #{type} and dr = '0' ) - and dr = '0' and h.cbilltypecode = #{cbilltypecode} group by h.vbillcode,a.unitcode From 2400d08a9363a4bb52b80ee9f5d1b372c840c251 Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Tue, 5 Nov 2024 14:29:29 +0800 Subject: [PATCH 100/101] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AF=B9=E6=8E=A5CRM?= =?UTF-8?q?=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/u8/otherin/dao/IOtherInDao.java | 37 ++++ .../u8/otherin/dao/IOtherInDetailDao.java | 27 +++ .../u8/otherin/dao/impl/OtherInDaoImpl.java | 31 +++ .../dao/impl/OtherInDetailDaoImpl.java | 26 +++ .../otherin/entity/OtherInDetailEntity.java | 68 ++++++ .../u8/otherin/entity/OtherInDetailEntity.xml | 84 ++++++++ .../u8/otherin/entity/OtherInEntity.java | 120 +++++++++++ .../frame/u8/otherin/entity/OtherInEntity.xml | 106 +++++++++ .../otherin/service/IOtherInDetaiService.java | 15 ++ .../u8/otherin/service/IOtherInService.java | 26 +++ .../service/impl/OtherInDetaiServiceImpl.java | 23 ++ .../service/impl/OtherInServiceImpl.java | 201 +++++++++++++++++ .../frame/u8/otherout/dao/IOtherOutDao.java | 37 ++++ .../u8/otherout/dao/IOtherOutDetailDao.java | 28 +++ .../u8/otherout/dao/impl/OtherOutDaoImpl.java | 31 +++ .../dao/impl/OtherOutDetailDaoImpl.java | 26 +++ .../otherout/entity/OtherOutDetailEntity.java | 49 +++++ .../otherout/entity/OtherOutDetailEntity.xml | 62 ++++++ .../u8/otherout/entity/OtherOutEntity.java | 119 ++++++++++ .../u8/otherout/entity/OtherOutEntity.xml | 102 +++++++++ .../service/IOtherOutDetaiService.java | 15 ++ .../u8/otherout/service/IOtherOutService.java | 26 +++ .../impl/OtherOutDetaiServiceImpl.java | 23 ++ .../service/impl/OtherOutServiceImpl.java | 190 ++++++++++++++++ .../frame/u8/receipt/dao/IReceiptDao.java | 37 ++++ .../u8/receipt/dao/IReceiptDetailDao.java | 15 ++ .../u8/receipt/dao/impl/ReceiptDaoImpl.java | 31 +++ .../dao/impl/ReceiptDetailDaoImpl.java | 18 ++ .../receipt/entity/ReceiptDetailEntity.java | 32 +++ .../u8/receipt/entity/ReceiptDetailEntity.xml | 11 + .../u8/receipt/entity/ReceiptEntity.java | 126 +++++++++++ .../frame/u8/receipt/entity/ReceiptEntity.xml | 121 +++++++++++ .../receipt/service/IReceiptDetaiService.java | 15 ++ .../u8/receipt/service/IReceiptService.java | 27 +++ .../service/impl/ReceiptDetaiServiceImpl.java | 23 ++ .../service/impl/ReceiptServiceImpl.java | 168 +++++++++++++++ .../frame/u8/saleinv/dao/ISaleInvDao.java | 37 ++++ .../u8/saleinv/dao/ISaleInvDetailDao.java | 27 +++ .../u8/saleinv/dao/impl/SaleInvDaoImpl.java | 32 +++ .../dao/impl/SaleInvDetailDaoImpl.java | 26 +++ .../saleinv/entity/SaleInvDetailEntity.java | 67 ++++++ .../u8/saleinv/entity/SaleInvDetailEntity.xml | 72 +++++++ .../u8/saleinv/entity/SaleInvEntity.java | 107 +++++++++ .../frame/u8/saleinv/entity/SaleInvEntity.xml | 109 ++++++++++ .../saleinv/service/ISaleInvDetaiService.java | 15 ++ .../u8/saleinv/service/ISaleInvService.java | 27 +++ .../service/impl/SaleInvDetaiServiceImpl.java | 23 ++ .../service/impl/SaleInvServiceImpl.java | 191 ++++++++++++++++ .../frame/u8/saleout/dao/ISaleOutDao.java | 32 +++ .../u8/saleout/dao/ISaleOutDetailDao.java | 25 +++ .../u8/saleout/dao/impl/SaleOutDaoImpl.java | 28 +++ .../dao/impl/SaleOutDetailDaoImpl.java | 23 ++ .../saleout/entity/SaleOutDetailEntity.java | 76 +++++++ .../u8/saleout/entity/SaleOutDetailEntity.xml | 81 +++++++ .../u8/saleout/entity/SaleOutEntity.java | 102 +++++++++ .../frame/u8/saleout/entity/SaleOutEntity.xml | 101 +++++++++ .../saleout/service/ISaleOutDetaiService.java | 15 ++ .../u8/saleout/service/ISaleOutService.java | 26 +++ .../service/impl/SaleOutDetaiServiceImpl.java | 25 +++ .../service/impl/SaleOutServiceImpl.java | 204 ++++++++++++++++++ 60 files changed, 3567 insertions(+) create mode 100644 service/src/main/java/com/hzya/frame/u8/otherin/dao/IOtherInDao.java create mode 100644 service/src/main/java/com/hzya/frame/u8/otherin/dao/IOtherInDetailDao.java create mode 100644 service/src/main/java/com/hzya/frame/u8/otherin/dao/impl/OtherInDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8/otherin/dao/impl/OtherInDetailDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInDetailEntity.java create mode 100644 service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInDetailEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInEntity.java create mode 100644 service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/u8/otherin/service/IOtherInDetaiService.java create mode 100644 service/src/main/java/com/hzya/frame/u8/otherin/service/IOtherInService.java create mode 100644 service/src/main/java/com/hzya/frame/u8/otherin/service/impl/OtherInDetaiServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8/otherin/service/impl/OtherInServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8/otherout/dao/IOtherOutDao.java create mode 100644 service/src/main/java/com/hzya/frame/u8/otherout/dao/IOtherOutDetailDao.java create mode 100644 service/src/main/java/com/hzya/frame/u8/otherout/dao/impl/OtherOutDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8/otherout/dao/impl/OtherOutDetailDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutDetailEntity.java create mode 100644 service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutDetailEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutEntity.java create mode 100644 service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/u8/otherout/service/IOtherOutDetaiService.java create mode 100644 service/src/main/java/com/hzya/frame/u8/otherout/service/IOtherOutService.java create mode 100644 service/src/main/java/com/hzya/frame/u8/otherout/service/impl/OtherOutDetaiServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8/otherout/service/impl/OtherOutServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8/receipt/dao/IReceiptDao.java create mode 100644 service/src/main/java/com/hzya/frame/u8/receipt/dao/IReceiptDetailDao.java create mode 100644 service/src/main/java/com/hzya/frame/u8/receipt/dao/impl/ReceiptDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8/receipt/dao/impl/ReceiptDetailDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptDetailEntity.java create mode 100644 service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptDetailEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptEntity.java create mode 100644 service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/u8/receipt/service/IReceiptDetaiService.java create mode 100644 service/src/main/java/com/hzya/frame/u8/receipt/service/IReceiptService.java create mode 100644 service/src/main/java/com/hzya/frame/u8/receipt/service/impl/ReceiptDetaiServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8/receipt/service/impl/ReceiptServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8/saleinv/dao/ISaleInvDao.java create mode 100644 service/src/main/java/com/hzya/frame/u8/saleinv/dao/ISaleInvDetailDao.java create mode 100644 service/src/main/java/com/hzya/frame/u8/saleinv/dao/impl/SaleInvDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8/saleinv/dao/impl/SaleInvDetailDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvDetailEntity.java create mode 100644 service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvDetailEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvEntity.java create mode 100644 service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/u8/saleinv/service/ISaleInvDetaiService.java create mode 100644 service/src/main/java/com/hzya/frame/u8/saleinv/service/ISaleInvService.java create mode 100644 service/src/main/java/com/hzya/frame/u8/saleinv/service/impl/SaleInvDetaiServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8/saleinv/service/impl/SaleInvServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8/saleout/dao/ISaleOutDao.java create mode 100644 service/src/main/java/com/hzya/frame/u8/saleout/dao/ISaleOutDetailDao.java create mode 100644 service/src/main/java/com/hzya/frame/u8/saleout/dao/impl/SaleOutDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8/saleout/dao/impl/SaleOutDetailDaoImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutDetailEntity.java create mode 100644 service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutDetailEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutEntity.java create mode 100644 service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutEntity.xml create mode 100644 service/src/main/java/com/hzya/frame/u8/saleout/service/ISaleOutDetaiService.java create mode 100644 service/src/main/java/com/hzya/frame/u8/saleout/service/ISaleOutService.java create mode 100644 service/src/main/java/com/hzya/frame/u8/saleout/service/impl/SaleOutDetaiServiceImpl.java create mode 100644 service/src/main/java/com/hzya/frame/u8/saleout/service/impl/SaleOutServiceImpl.java diff --git a/service/src/main/java/com/hzya/frame/u8/otherin/dao/IOtherInDao.java b/service/src/main/java/com/hzya/frame/u8/otherin/dao/IOtherInDao.java new file mode 100644 index 00000000..b901f09e --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherin/dao/IOtherInDao.java @@ -0,0 +1,37 @@ +package com.hzya.frame.u8.otherin.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.u8.otherin.entity.OtherInEntity; + +import java.util.List; + +/** + * + * @content 其他入库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface IOtherInDao extends IBaseDao { + /** + * + * @content 获取U8C其他入库单数据 + * @className: Administrator + * @author laborer + * @date 2024-10-18 14:52 + * + */ + + List getU8otherIn(OtherInEntity entity); +/** + * + * @content 修改状态 + * @className: Administrator + * @author laborer + * @date 2024-10-18 15:10 + * + */ + + int updateState(OtherInEntity sale); +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherin/dao/IOtherInDetailDao.java b/service/src/main/java/com/hzya/frame/u8/otherin/dao/IOtherInDetailDao.java new file mode 100644 index 00000000..e1b33276 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherin/dao/IOtherInDetailDao.java @@ -0,0 +1,27 @@ +package com.hzya.frame.u8.otherin.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.u8.otherin.entity.OtherInDetailEntity; + +import java.util.List; + +/** + * + * @content 其他入库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface IOtherInDetailDao extends IBaseDao { + /** + * + * @content 获取其他入库单的明细数据 + * @className: Administrator + * @author laborer + * @date 2024-10-18 15:02 + * + */ + + List getU8OtherInLine(OtherInDetailEntity line); +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherin/dao/impl/OtherInDaoImpl.java b/service/src/main/java/com/hzya/frame/u8/otherin/dao/impl/OtherInDaoImpl.java new file mode 100644 index 00000000..b792d76c --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherin/dao/impl/OtherInDaoImpl.java @@ -0,0 +1,31 @@ +package com.hzya.frame.u8.otherin.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.u8.otherin.dao.IOtherInDao; +import com.hzya.frame.u8.otherin.entity.OtherInEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * + * @content 其他入库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Repository(value = "OtherInDaoImpl") +public class OtherInDaoImpl extends MybatisGenericDao implements IOtherInDao { + @DS("#entity.dataSourceCode") + @Override + public List getU8otherIn(OtherInEntity entity) { + return (List) super.selectList("com.hzya.frame.u8.otherin.dao.impl.OtherInDaoImpl.entity_list_base",entity); + } + + @Override + public int updateState(OtherInEntity entity) { + return super.update("com.hzya.frame.u8.otherin.dao.impl.OtherInDaoImpl.entity_update",entity); + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherin/dao/impl/OtherInDetailDaoImpl.java b/service/src/main/java/com/hzya/frame/u8/otherin/dao/impl/OtherInDetailDaoImpl.java new file mode 100644 index 00000000..653aa367 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherin/dao/impl/OtherInDetailDaoImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.u8.otherin.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.u8.otherin.dao.IOtherInDetailDao; +import com.hzya.frame.u8.otherin.entity.OtherInDetailEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * + * @content 其他入库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Repository(value = "OtherInDetailDaoImpl") +public class OtherInDetailDaoImpl extends MybatisGenericDao implements IOtherInDetailDao { + @DS("#entity.dataSourceCode") + @Override + public List getU8OtherInLine(OtherInDetailEntity entity) { + return (List) super.selectList("com.hzya.frame.u8.otherin.dao.impl.OtherInDetailDaoImpl.entity_list_base",entity); + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInDetailEntity.java b/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInDetailEntity.java new file mode 100644 index 00000000..0a1acff8 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInDetailEntity.java @@ -0,0 +1,68 @@ +package com.hzya.frame.u8.otherin.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * + * @content 其他入库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public class OtherInDetailEntity extends BaseEntity { +private String cinvcode;//存货编码 +private String iquantity;//数量 +private String itvrowno;//调拨单行号 +private String irowno;//单据体行号 +private String AccCode;//账套编码 +private String AccId;//账套号 + + public String getAccCode() { + return AccCode; + } + + public void setAccCode(String accCode) { + AccCode = accCode; + } + + public String getAccId() { + return AccId; + } + + public void setAccId(String accId) { + AccId = accId; + } + + public String getCinvcode() { + return cinvcode; + } + + public void setCinvcode(String cinvcode) { + this.cinvcode = cinvcode; + } + + public String getIquantity() { + return iquantity; + } + + public void setIquantity(String iquantity) { + this.iquantity = iquantity; + } + + public String getItvrowno() { + return itvrowno; + } + + public void setItvrowno(String itvrowno) { + this.itvrowno = itvrowno; + } + + public String getIrowno() { + return irowno; + } + + public void setIrowno(String irowno) { + this.irowno = irowno; + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInDetailEntity.xml b/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInDetailEntity.xml new file mode 100644 index 00000000..ec758c32 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInDetailEntity.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + diff --git a/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInEntity.java b/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInEntity.java new file mode 100644 index 00000000..8f79a027 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInEntity.java @@ -0,0 +1,120 @@ +package com.hzya.frame.u8.otherin.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +import java.util.List; + +/** + * + * @content 其他入库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ + +public class OtherInEntity extends BaseEntity { + +private String ccode;//入库单号 +private String cbuscode;//调拨单号 +private String crdcode;//入库类别编码 +private String cwhcode;//仓库编码 +private String cmaker;//制单人 +private String AccId;//账套 +private String id;// +private String state;// +private String AccCode;// + private String ids;// + + public String getIds() { + return ids; + } + + public void setIds(String ids) { + this.ids = ids; + } + + public String getAccCode() { + return AccCode; + } + + public void setAccCode(String accCode) { + AccCode = accCode; + } + + private ListotherInDetailEntityList; + + public List getOtherInDetailEntityList() { + return otherInDetailEntityList; + } + + public void setOtherInDetailEntityList(List otherInDetailEntityList) { + this.otherInDetailEntityList = otherInDetailEntityList; + } + + public String getCcode() { + return ccode; + } + + public void setCcode(String ccode) { + this.ccode = ccode; + } + + public String getCbuscode() { + return cbuscode; + } + + public void setCbuscode(String cbuscode) { + this.cbuscode = cbuscode; + } + + public String getCrdcode() { + return crdcode; + } + + public void setCrdcode(String crdcode) { + this.crdcode = crdcode; + } + + public String getCwhcode() { + return cwhcode; + } + + public void setCwhcode(String cwhcode) { + this.cwhcode = cwhcode; + } + + public String getCmaker() { + return cmaker; + } + + public void setCmaker(String cmaker) { + this.cmaker = cmaker; + } + + public String getAccId() { + return AccId; + } + + public void setAccId(String accId) { + AccId = accId; + } + + @Override + public String getId() { + return id; + } + + @Override + public void setId(String id) { + this.id = id; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInEntity.xml b/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInEntity.xml new file mode 100644 index 00000000..836b6b40 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherin/entity/OtherInEntity.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + update #{AccCode}.dbo.RdRecord08 set sync_flag = #{state} + where id = #{id} + + diff --git a/service/src/main/java/com/hzya/frame/u8/otherin/service/IOtherInDetaiService.java b/service/src/main/java/com/hzya/frame/u8/otherin/service/IOtherInDetaiService.java new file mode 100644 index 00000000..33ef87fb --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherin/service/IOtherInDetaiService.java @@ -0,0 +1,15 @@ +package com.hzya.frame.u8.otherin.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.u8.otherin.entity.OtherInDetailEntity; + +/** + * + * @content 其他入库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface IOtherInDetaiService extends IBaseService { +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherin/service/IOtherInService.java b/service/src/main/java/com/hzya/frame/u8/otherin/service/IOtherInService.java new file mode 100644 index 00000000..68bcda9b --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherin/service/IOtherInService.java @@ -0,0 +1,26 @@ +package com.hzya.frame.u8.otherin.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.u8.otherin.entity.OtherInEntity; + +/** + * + * @content 其他入库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface IOtherInService extends IBaseService { +/** + * + * @content 获取U8其他入库单数据推送CRM + * @className: Administrator + * @author laborer + * @date 2024-10-18 13:45 + * + */ + + void getU8OtherInToCrm(JSONObject requestJson); +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherin/service/impl/OtherInDetaiServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/otherin/service/impl/OtherInDetaiServiceImpl.java new file mode 100644 index 00000000..f20a1c84 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherin/service/impl/OtherInDetaiServiceImpl.java @@ -0,0 +1,23 @@ +package com.hzya.frame.u8.otherin.service.impl; + +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.u8.otherin.entity.OtherInDetailEntity; +import com.hzya.frame.u8.otherin.service.IOtherInDetaiService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.stereotype.Service; + +/** + * + * @content 其他入库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Service(value = "OtherInDetaiServiceImpl") +public class OtherInDetaiServiceImpl extends BaseService implements IOtherInDetaiService { + Logger logger = LogManager.getLogger(getClass()); + + +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherin/service/impl/OtherInServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/otherin/service/impl/OtherInServiceImpl.java new file mode 100644 index 00000000..14baac05 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherin/service/impl/OtherInServiceImpl.java @@ -0,0 +1,201 @@ +package com.hzya.frame.u8.otherin.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.basedao.service.impl.BaseService; +import com.hzya.frame.crm.util.CrmUtil; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.u8.otherin.dao.IOtherInDao; +import com.hzya.frame.u8.otherin.dao.IOtherInDetailDao; +import com.hzya.frame.u8.otherin.entity.OtherInDetailEntity; +import com.hzya.frame.u8.otherin.entity.OtherInEntity; +import com.hzya.frame.u8.otherin.service.IOtherInService; +import com.hzya.frame.u8.saleout.entity.SaleOutDetailEntity; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.commons.collections.CollectionUtils; +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 javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * + * @content 其他入库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Service(value = "OtherInServiceImpl") +public class OtherInServiceImpl extends BaseService implements IOtherInService { + Logger logger = LogManager.getLogger(getClass()); + @Autowired + private IOtherInDao otherInDao; + @Autowired + private IOtherInDetailDao otherInDetailDao; + @Resource + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; +/** + * + * @content 获取U8其他入库单数据推送CRM + * @className: Administrator + * @author laborer + * @date 2024-10-18 13:46 + * + */ + + @Override + public void getU8OtherInToCrm(JSONObject requestJson) { + //获取重推信息id,并记录日志 + JSONObject requestJsonObj = JSON.parseObject(requestJson.toString(),JSONObject.class); + String interId = requestJsonObj.getString("integration_task_living_details_id"); + logger.info("U8其他入库单重推解析后:"+requestJsonObj.toString()); + logger.info("U8其他入库单推送CRM重新执行的任务主键:"+interId); + + //更换数据源 + JsonResultEntity resultEntity = new JsonResultEntity(); + OtherInEntity entity = new OtherInEntity(); + requestJson.put("db_code","YONYOUU8"); + entity.setDataSourceCode(requestJson.getString("db_code")); + + //根据重推信息id,查询该条重推记录信息 + IntegrationTaskLivingDetailsEntity oldMsg = new IntegrationTaskLivingDetailsEntity(); + if(StrUtil.isNotEmpty(interId)){ + oldMsg = taskLivingDetailsService.get(interId); + } + String rootAppPk = oldMsg.getRootAppPk(); + entity.setIds(rootAppPk); + StrUtil.isEmpty(rootAppPk);//entity.setQueryState("查询"); + //如果是重推,是否通过entity传入的id,只能查到一条数据。 + //entity.setId("-8845102890648320822"); + List soleList = otherInDao.getU8otherIn(entity); + logger.info("销售出库查询数据{}",JSONObject.toJSONString(soleList)); + if(CollectionUtils.isNotEmpty(soleList)){ + soleList.forEach(sale -> { + try{ + //获取明细数据进行拼接 + String id = sale.getId(); + if(!StrUtil.isEmpty(id)){ + OtherInDetailEntity line = new OtherInDetailEntity(); + line.setId(id); + line.setAccId(sale.getAccId()); + line.setDataSourceCode(requestJson.getString("db_code")); + List lineList = otherInDetailDao.getU8OtherInLine(line); + logger.info("其他入库单明细查询数据{}",JSONObject.toJSONString(lineList)); + sale.setOtherInDetailEntityList(lineList); + logger.info("组装数据"); + JSONObject main = bindingAdd(sale); + logger.info("销售出库推送数据:"+main.toString()); + String result = CrmUtil.sendU8TOCrmEsb(main.toString(), "8000340003"); + logger.info("销售出库推送结果:"+result); + IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); + logDetails.setRootAppPk(sale.getIds()); + logDetails.setRootAppBill(sale.getCcode()); + logDetails.setNewTransmitInfo(result); + logDetails.setNewPushDate(new Date()); + logDetails.setRootAppNewData(JSON.toJSONString(sale)); + logDetails.setPluginId("SaleConPlugin"); + + JSONObject resultObj = JSON.parseObject(result); + boolean flag = resultObj.getString("code").equals("0"); + if(flag){ + // 推送成功,更新状态 + sale.setState("Y"); + logDetails.setNewTransmitInfo("推送成功"); + }else{ + // 推送失败 + sale.setState("N"); + } + sale.setDataSourceCode(requestJson.getString("db_code")); + try{ + saveLog(interId, logDetails, flag); + }catch (Exception e){ + logger.error("保存日志失败"+e.getMessage()); + otherInDao.updateState(sale); + e.printStackTrace(); + } + otherInDao.updateState(sale); + } + } catch (Exception e) { + logger.error("销售出库执行失败"+e.getMessage()); + e.printStackTrace(); + } + }); + + } + } + /** + * + * @content 保存日志信息 + * @className: Administrator + * @author laborer + * @date 2024-10-18 11:27 + * + */ + + private void saveLog(String interId, IntegrationTaskLivingDetailsEntity logDetails, boolean flag) throws Exception { + if(StrUtil.isEmpty(interId)){ + if(flag){ + //首推成功 + taskLivingDetailsService.saveLogToSuccess(logDetails); + }else{ + //首推失败 + taskLivingDetailsService.saveLogToFail(logDetails); + } + }else{ + logDetails.setId(interId); + if(flag){ + //重推成功 + taskLivingDetailsService.saveLogFailToSuccess(logDetails); + }else{ + //重推失败,把失败信息,更新到重推表中 + taskLivingDetailsService.updateLogFailToSuccess(logDetails); + } + } + } + + /** + * + * @content 组装推送参数 + * @className: Administrator + * @author laborer + * @date 2024-10-18 11:13 + * + */ + + private JSONObject bindingAdd(OtherInEntity sale) { + JSONObject main = new JSONObject(); + main.put("AccId",sale.getAccId()); + main.put("billid",sale.getId()); + main.put("LoginDate", DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); + JSONObject head = new JSONObject(); + head.put("ccode",sale.getCcode()); + head.put("cbuscode",sale.getCbuscode()); + head.put("crdcode",sale.getCrdcode()); + head.put("cwhcode",sale.getCwhcode()); + head.put("cmaker",sale.getCmaker()); + JSONArray body = new JSONArray(); + List lineList = sale.getOtherInDetailEntityList(); + if(CollectionUtils.isNotEmpty(lineList)){ + lineList.forEach(line -> { + JSONObject lineObj = new JSONObject(); + lineObj.put("cinvcode",line.getCinvcode()); + lineObj.put("iquantity",line.getIquantity()); + lineObj.put("itvrowno",line.getItvrowno()); + lineObj.put("irowno",line.getIrowno()); + body.add(lineObj); + }); + } + main.put("head",head); + main.put("body",body); + return main; + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherout/dao/IOtherOutDao.java b/service/src/main/java/com/hzya/frame/u8/otherout/dao/IOtherOutDao.java new file mode 100644 index 00000000..558a3f4f --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherout/dao/IOtherOutDao.java @@ -0,0 +1,37 @@ +package com.hzya.frame.u8.otherout.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.u8.otherout.entity.OtherOutEntity; + +import java.util.List; + +/** + * + * @content 其他出库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface IOtherOutDao extends IBaseDao { + /** + * + * @content 获取销售出库单数据 + * @className: Administrator + * @author laborer + * @date 2024-10-18 15:18 + * + */ + + List getU8SaleOut(OtherOutEntity entity); +/** + * + * @content 修改推送状态 + * @className: Administrator + * @author laborer + * @date 2024-10-18 15:22 + * + */ + + int updateState(OtherOutEntity sale); +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherout/dao/IOtherOutDetailDao.java b/service/src/main/java/com/hzya/frame/u8/otherout/dao/IOtherOutDetailDao.java new file mode 100644 index 00000000..b9a2ac71 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherout/dao/IOtherOutDetailDao.java @@ -0,0 +1,28 @@ +package com.hzya.frame.u8.otherout.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.u8.otherout.entity.OtherOutDetailEntity; + +import java.util.List; + +/** + * + * @content 其他出库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface IOtherOutDetailDao extends IBaseDao { + /** + * + * @content 获取U8其他出库单行数据 + * @param line + * @className: Administrator + * @author laborer + * @date 2024-10-18 15:20 + * + */ + + List getU8otherOutLine(OtherOutDetailEntity line); +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherout/dao/impl/OtherOutDaoImpl.java b/service/src/main/java/com/hzya/frame/u8/otherout/dao/impl/OtherOutDaoImpl.java new file mode 100644 index 00000000..7a938b59 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherout/dao/impl/OtherOutDaoImpl.java @@ -0,0 +1,31 @@ +package com.hzya.frame.u8.otherout.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.u8.otherout.dao.IOtherOutDao; +import com.hzya.frame.u8.otherout.entity.OtherOutEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * + * @content 其他出库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Repository(value = "OtherOutDaoImpl") +public class OtherOutDaoImpl extends MybatisGenericDao implements IOtherOutDao { + @DS("#entity.dataSourceCode") + @Override + public List getU8SaleOut(OtherOutEntity entity) { + return (List) super.selectList("com.hzya.frame.u8.otherout.dao.impl.OtherOutDaoImpl.entity_list_base",entity); + } + @DS("#entity.dataSourceCode") + @Override + public int updateState(OtherOutEntity entity) { + return super.update("com.hzya.frame.u8.otherout.dao.impl.OtherOutDaoImpl.entity_update",entity); + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherout/dao/impl/OtherOutDetailDaoImpl.java b/service/src/main/java/com/hzya/frame/u8/otherout/dao/impl/OtherOutDetailDaoImpl.java new file mode 100644 index 00000000..19881cad --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherout/dao/impl/OtherOutDetailDaoImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.u8.otherout.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.u8.otherout.dao.IOtherOutDetailDao; +import com.hzya.frame.u8.otherout.entity.OtherOutDetailEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * + * @content 其他出库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Repository(value = "OtherOutDetailDaoImpl") +public class OtherOutDetailDaoImpl extends MybatisGenericDao implements IOtherOutDetailDao { + @DS("#entity.dataSourceCode") + @Override + public List getU8otherOutLine(OtherOutDetailEntity entity) { + return (List) selectList("com.hzya.frame.u8.otherout.dao.impl.OtherOutDetailDaoImpl.entity_list_base",entity); + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutDetailEntity.java b/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutDetailEntity.java new file mode 100644 index 00000000..6b61fbf5 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutDetailEntity.java @@ -0,0 +1,49 @@ +package com.hzya.frame.u8.otherout.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * + * @content 其他出库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public class OtherOutDetailEntity extends BaseEntity { + private String cinvcode;//存货编码 + private String iquantity;//数量 + private String AccCode;//账套编码 + private String AccId;//账套号 + + public String getAccCode() { + return AccCode; + } + + public void setAccCode(String accCode) { + AccCode = accCode; + } + + public String getAccId() { + return AccId; + } + + public void setAccId(String accId) { + AccId = accId; + } + public String getCinvcode() { + return cinvcode; + } + + public void setCinvcode(String cinvcode) { + this.cinvcode = cinvcode; + } + + public String getIquantity() { + return iquantity; + } + + public void setIquantity(String iquantity) { + this.iquantity = iquantity; + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutDetailEntity.xml b/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutDetailEntity.xml new file mode 100644 index 00000000..d63d9416 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherout/entity/OtherOutDetailEntity.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + select * from ( + select + '001' as AccId, + 'UFDATA_001_2023' as AccCode, + id, + '1001'+CAST( id AS VARCHAR(100)) as ids, + ccode, + cbuscode, + crdcode, + cwhcode, + cmaker, + cCusCode, + cHandler + from UFDATA_001_2023.dbo.RdRecord09 + + union all + select + '002' as AccId, + 'UFDATA_002_2024' as AccCode, + id, + '1002'+CAST( id AS VARCHAR(100)) as ids, + ccode, + cbuscode, + crdcode, + cwhcode, + cmaker, + cCusCode, + cHandler + from UFDATA_002_2024.dbo.RdRecord09 + + union all + select + '004' as AccId, + 'UFDATA_004_2024' as AccCode, + id, + '1004'+CAST( id AS VARCHAR(100)) as ids, + ccode, + cbuscode, + crdcode, + cwhcode, + cmaker, + cCusCode, + cHandler + from UFDATA_004_2024.dbo.RdRecord09 + + union all + select + '005' as AccId, + 'UFDATA_005_2024' as AccCode, + id, + '1005'+CAST( id AS VARCHAR(100)) as ids, + ccode, + cbuscode, + crdcode, + cwhcode, + cmaker, + cCusCode, + cHandler + from UFDATA_005_2024.dbo.RdRecord09 + + union all + select + '201' as AccId, + 'UFDATA_201_2023' as AccCode, + id, + '1201'+CAST( id AS VARCHAR(100)) as ids, + ccode, + cbuscode, + crdcode, + cwhcode, + cmaker, + cCusCode, + cHandler + from UFDATA_201_2023.dbo.RdRecord09 + )m1 where cHandler is not null + and ids = #{ids} + + + + update RdRecord09 set sync_flag = #{state} + where id = #{id} + + diff --git a/service/src/main/java/com/hzya/frame/u8/otherout/service/IOtherOutDetaiService.java b/service/src/main/java/com/hzya/frame/u8/otherout/service/IOtherOutDetaiService.java new file mode 100644 index 00000000..7ff3b718 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherout/service/IOtherOutDetaiService.java @@ -0,0 +1,15 @@ +package com.hzya.frame.u8.otherout.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.u8.otherout.entity.OtherOutDetailEntity; + +/** + * + * @content 其他出库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface IOtherOutDetaiService extends IBaseService { +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherout/service/IOtherOutService.java b/service/src/main/java/com/hzya/frame/u8/otherout/service/IOtherOutService.java new file mode 100644 index 00000000..b82ab5cb --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherout/service/IOtherOutService.java @@ -0,0 +1,26 @@ +package com.hzya.frame.u8.otherout.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.u8.otherout.entity.OtherOutEntity; + +/** + * + * @content 其他出库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface IOtherOutService extends IBaseService { +/** + * + * @content 获取其他出库单信息推送到CRM + * @className: Administrator + * @author laborer + * @date 2024-10-18 13:46 + * + */ + + void getU8OtherOutToCrm(JSONObject requestJson); +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherout/service/impl/OtherOutDetaiServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/otherout/service/impl/OtherOutDetaiServiceImpl.java new file mode 100644 index 00000000..e08cb3e2 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherout/service/impl/OtherOutDetaiServiceImpl.java @@ -0,0 +1,23 @@ +package com.hzya.frame.u8.otherout.service.impl; + +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.u8.otherout.entity.OtherOutDetailEntity; +import com.hzya.frame.u8.otherout.service.IOtherOutDetaiService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.stereotype.Service; + +/** + * + * @content 其他出库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Service(value = "OtherOutDetaiServiceImpl") +public class OtherOutDetaiServiceImpl extends BaseService implements IOtherOutDetaiService { + Logger logger = LogManager.getLogger(getClass()); + + +} diff --git a/service/src/main/java/com/hzya/frame/u8/otherout/service/impl/OtherOutServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/otherout/service/impl/OtherOutServiceImpl.java new file mode 100644 index 00000000..52ed5576 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/otherout/service/impl/OtherOutServiceImpl.java @@ -0,0 +1,190 @@ +package com.hzya.frame.u8.otherout.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.basedao.service.impl.BaseService; +import com.hzya.frame.crm.util.CrmUtil; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.u8.otherout.dao.IOtherOutDao; +import com.hzya.frame.u8.otherout.dao.IOtherOutDetailDao; +import com.hzya.frame.u8.otherout.entity.OtherOutDetailEntity; +import com.hzya.frame.u8.otherout.entity.OtherOutEntity; +import com.hzya.frame.u8.otherout.service.IOtherOutService; + +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.commons.collections.CollectionUtils; +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 javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * + * @content 其他出库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Service(value = "OtherOutServiceImpl") +public class OtherOutServiceImpl extends BaseService implements IOtherOutService { + Logger logger = LogManager.getLogger(getClass()); + @Autowired + private IOtherOutDao otherOutDao; + @Autowired + private IOtherOutDetailDao otherOutDetailDao; + @Resource + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + @Override + public void getU8OtherOutToCrm(JSONObject requestJson) { + //获取重推信息id,并记录日志 + JSONObject requestJsonObj = JSON.parseObject(requestJson.toString(),JSONObject.class); + String interId = requestJsonObj.getString("integration_task_living_details_id"); + logger.info("U8销售出库单重推解析后:"+requestJsonObj.toString()); + logger.info("U8销售出库单推送CRM重新执行的任务主键:"+interId); + + //更换数据源 + JsonResultEntity resultEntity = new JsonResultEntity(); + OtherOutEntity entity = new OtherOutEntity(); + requestJson.put("db_code","YONYOUU8"); + entity.setDataSourceCode(requestJson.getString("db_code")); + + //根据重推信息id,查询该条重推记录信息 + IntegrationTaskLivingDetailsEntity oldMsg = new IntegrationTaskLivingDetailsEntity(); + if(StrUtil.isNotEmpty(interId)){ + oldMsg = taskLivingDetailsService.get(interId); + } + String rootAppPk = oldMsg.getRootAppPk(); + entity.setIds(rootAppPk); + StrUtil.isEmpty(rootAppPk); + //如果是重推,是否通过entity传入的id,只能查到一条数据。 + List soleList = otherOutDao.getU8SaleOut(entity); + logger.info("销售出库查询数据{}",JSONObject.toJSONString(soleList)); + if(CollectionUtils.isNotEmpty(soleList)){ + soleList.forEach(sale -> { + try{ + //获取明细数据进行拼接 + String id = sale.getId(); + if(!StrUtil.isEmpty(id)){ + OtherOutDetailEntity line = new OtherOutDetailEntity(); + line.setId(id); + line.setAccId(id); + line.setDataSourceCode(requestJson.getString("db_code")); + List lineList = otherOutDetailDao.getU8otherOutLine(line); + logger.info("销售出库单明细查询数据{}",JSONObject.toJSONString(lineList)); + sale.setOtherOutDetailEntityList(lineList); + logger.info("组装数据"); + JSONObject main = bindingAdd(sale); + logger.info("销售出库推送数据:"+main.toString()); + String result = CrmUtil.sendU8TOCrmEsb(main.toString(), "8000340003"); + logger.info("销售出库推送结果:"+result); + IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); + logDetails.setRootAppPk(sale.getIds()); + logDetails.setRootAppBill(sale.getCcode()); + logDetails.setNewTransmitInfo(result); + logDetails.setNewPushDate(new Date()); + logDetails.setRootAppNewData(JSON.toJSONString(sale)); + logDetails.setPluginId("SaleConPlugin"); + + JSONObject resultObj = JSON.parseObject(result); + boolean flag = resultObj.getString("code").equals("0"); + if(flag){ + logDetails.setNewTransmitInfo("推送成功"); + // 推送成功,更新状态 + sale.setState("Y"); + }else{ + // 推送失败 + sale.setState("N"); + } + sale.setDataSourceCode(requestJson.getString("db_code")); + try{ + saveLog(interId, logDetails, flag); + }catch (Exception e){ + logger.error("保存日志失败"+e.getMessage()); + otherOutDao.updateState(sale); + e.printStackTrace(); + } + otherOutDao.updateState(sale); + } + } catch (Exception e) { + logger.error("销售出库执行失败"+e.getMessage()); + e.printStackTrace(); + } + }); + + } + } + /** + * + * @content 保存日志信息 + * @className: Administrator + * @author laborer + * @date 2024-10-18 11:27 + * + */ + + private void saveLog(String interId, IntegrationTaskLivingDetailsEntity logDetails, boolean flag) throws Exception { + if(StrUtil.isEmpty(interId)){ + if(flag){ + //首推成功 + taskLivingDetailsService.saveLogToSuccess(logDetails); + }else{ + //首推失败 + taskLivingDetailsService.saveLogToFail(logDetails); + } + }else{ + logDetails.setId(interId); + if(flag){ + //重推成功 + taskLivingDetailsService.saveLogFailToSuccess(logDetails); + }else{ + //重推失败,把失败信息,更新到重推表中 + taskLivingDetailsService.updateLogFailToSuccess(logDetails); + } + } + } + + /** + * + * @content 组装推送参数 + * @className: Administrator + * @author laborer + * @date 2024-10-18 11:13 + * + */ + + private JSONObject bindingAdd(OtherOutEntity sale) { + JSONObject main = new JSONObject(); + main.put("AccId",sale.getAccId()); + main.put("billid",sale.getId()); + main.put("LoginDate", DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); + JSONObject head = new JSONObject(); + head.put("ccode",sale.getCcode()); + head.put("cbuscode",sale.getCbuscode()); + head.put("crdcode",sale.getCrdcode()); + head.put("cwhcode",sale.getCwhcode()); + head.put("cmaker",sale.getCmaker()); + JSONArray body = new JSONArray(); + List lineList = sale.getOtherOutDetailEntityList(); + if(CollectionUtils.isNotEmpty(lineList)){ + lineList.forEach(line -> { + JSONObject lineObj = new JSONObject(); + lineObj.put("cinvcode",line.getCinvcode()); + lineObj.put("iquantity",line.getIquantity()); + + body.add(lineObj); + }); + } + main.put("head",head); + main.put("body",body); + return main; + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/receipt/dao/IReceiptDao.java b/service/src/main/java/com/hzya/frame/u8/receipt/dao/IReceiptDao.java new file mode 100644 index 00000000..d0175d05 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/receipt/dao/IReceiptDao.java @@ -0,0 +1,37 @@ +package com.hzya.frame.u8.receipt.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.u8.receipt.entity.ReceiptEntity; + +import java.util.List; + +/** + * + * @content 销售收款单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface IReceiptDao extends IBaseDao { + /** + * + * @content 获取U8销售收款单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 13:53 + * + */ + + List getU8Receipt(ReceiptEntity entity); +/** + * + * @content 修改推送状态 + * @className: Administrator + * @author laborer + * @date 2024-10-18 14:07 + * + */ + + int updateState(ReceiptEntity sale); +} diff --git a/service/src/main/java/com/hzya/frame/u8/receipt/dao/IReceiptDetailDao.java b/service/src/main/java/com/hzya/frame/u8/receipt/dao/IReceiptDetailDao.java new file mode 100644 index 00000000..47805b0d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/receipt/dao/IReceiptDetailDao.java @@ -0,0 +1,15 @@ +package com.hzya.frame.u8.receipt.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.u8.receipt.entity.ReceiptDetailEntity; + +/** + * + * @content 销售收款单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface IReceiptDetailDao extends IBaseDao { +} diff --git a/service/src/main/java/com/hzya/frame/u8/receipt/dao/impl/ReceiptDaoImpl.java b/service/src/main/java/com/hzya/frame/u8/receipt/dao/impl/ReceiptDaoImpl.java new file mode 100644 index 00000000..268a12e7 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/receipt/dao/impl/ReceiptDaoImpl.java @@ -0,0 +1,31 @@ +package com.hzya.frame.u8.receipt.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.u8.receipt.dao.IReceiptDao; +import com.hzya.frame.u8.receipt.entity.ReceiptEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * + * @content 销售收款单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Repository(value = "ReceiptDaoImpl") +public class ReceiptDaoImpl extends MybatisGenericDao implements IReceiptDao { + @DS("#entity.dataSourceCode") + @Override + public List getU8Receipt(ReceiptEntity entity) { + return (List) super.selectList("com.hzya.frame.u8.receipt.dao.impl.ReceiptDaoImpl.entity_list_base",entity); + } + @DS("#entity.dataSourceCode") + @Override + public int updateState(ReceiptEntity entity) { + return super.update("com.hzya.frame.u8.receipt.dao.impl.ReceiptDaoImpl.entity_update",entity); + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/receipt/dao/impl/ReceiptDetailDaoImpl.java b/service/src/main/java/com/hzya/frame/u8/receipt/dao/impl/ReceiptDetailDaoImpl.java new file mode 100644 index 00000000..d537c29a --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/receipt/dao/impl/ReceiptDetailDaoImpl.java @@ -0,0 +1,18 @@ +package com.hzya.frame.u8.receipt.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.u8.receipt.dao.IReceiptDetailDao; +import com.hzya.frame.u8.receipt.entity.ReceiptDetailEntity; +import org.springframework.stereotype.Repository; + +/** + * + * @content 销售收款单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Repository(value = "ReceiptDetailDaoImpl") +public class ReceiptDetailDaoImpl extends MybatisGenericDao implements IReceiptDetailDao { +} diff --git a/service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptDetailEntity.java b/service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptDetailEntity.java new file mode 100644 index 00000000..0966cf2b --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptDetailEntity.java @@ -0,0 +1,32 @@ +package com.hzya.frame.u8.receipt.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * + * @content 销售收款单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public class ReceiptDetailEntity extends BaseEntity { + private String AccCode;//账套编码 + private String AccId;//账套号 + + public String getAccCode() { + return AccCode; + } + + public void setAccCode(String accCode) { + AccCode = accCode; + } + + public String getAccId() { + return AccId; + } + + public void setAccId(String accId) { + AccId = accId; + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptDetailEntity.xml b/service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptDetailEntity.xml new file mode 100644 index 00000000..a63ae040 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptDetailEntity.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptEntity.java b/service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptEntity.java new file mode 100644 index 00000000..826cd5bf --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptEntity.java @@ -0,0 +1,126 @@ +package com.hzya.frame.u8.receipt.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * + * @content 销售收款单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ + +public class ReceiptEntity extends BaseEntity { + + private String iID;//主键 + private String cvouchid;//收款单号 + private String dvouchdate;//单据日期 + private String ccuscode;//客户编码 + private String ccusname;//客户名称 + private String iamount_f;//金额 + private String csscode;//收款方式 + private String syncFlag;//标识 + private String AccId;//账套 + private String state;//状态 + private String AccCode;//账套编码 + private String ids;// + + public String getIds() { + return ids; + } + + public void setIds(String ids) { + this.ids = ids; + } + + + public String getAccCode() { + return AccCode; + } + + public void setAccCode(String accCode) { + AccCode = accCode; + } + + + public String getiID() { + return iID; + } + + public void setiID(String iID) { + this.iID = iID; + } + + public String getCvouchid() { + return cvouchid; + } + + public void setCvouchid(String cvouchid) { + this.cvouchid = cvouchid; + } + + public String getDvouchdate() { + return dvouchdate; + } + + public void setDvouchdate(String dvouchdate) { + this.dvouchdate = dvouchdate; + } + + public String getCcuscode() { + return ccuscode; + } + + public void setCcuscode(String ccuscode) { + this.ccuscode = ccuscode; + } + + public String getCcusname() { + return ccusname; + } + + public void setCcusname(String ccusname) { + this.ccusname = ccusname; + } + + public String getIamount_f() { + return iamount_f; + } + + public void setIamount_f(String iamount_f) { + this.iamount_f = iamount_f; + } + + public String getCsscode() { + return csscode; + } + + public void setCsscode(String csscode) { + this.csscode = csscode; + } + + public String getSyncFlag() { + return syncFlag; + } + + public void setSyncFlag(String syncFlag) { + this.syncFlag = syncFlag; + } + + public String getAccId() { + return AccId; + } + + public void setAccId(String accId) { + AccId = accId; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptEntity.xml b/service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptEntity.xml new file mode 100644 index 00000000..2fa5e46c --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/receipt/entity/ReceiptEntity.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + update #{AccCode}.dbo.Ap_CloseBill set sync_flag = #{state} + where iID = #{iID} + + diff --git a/service/src/main/java/com/hzya/frame/u8/receipt/service/IReceiptDetaiService.java b/service/src/main/java/com/hzya/frame/u8/receipt/service/IReceiptDetaiService.java new file mode 100644 index 00000000..0f2802b1 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/receipt/service/IReceiptDetaiService.java @@ -0,0 +1,15 @@ +package com.hzya.frame.u8.receipt.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.u8.receipt.entity.ReceiptDetailEntity; + +/** + * + * @content 销售收款单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface IReceiptDetaiService extends IBaseService { +} diff --git a/service/src/main/java/com/hzya/frame/u8/receipt/service/IReceiptService.java b/service/src/main/java/com/hzya/frame/u8/receipt/service/IReceiptService.java new file mode 100644 index 00000000..da0daad5 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/receipt/service/IReceiptService.java @@ -0,0 +1,27 @@ +package com.hzya.frame.u8.receipt.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.u8.receipt.entity.ReceiptEntity; + +/** + * + * @content 销售收款单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface IReceiptService extends IBaseService { +/** + * + * @content 获取U8收款单推送CRM + * @param requestJson + * @className: Administrator + * @author laborer + * @date 2024-10-18 13:47 + * + */ + + void getU8ReceiptCrm(JSONObject requestJson); +} diff --git a/service/src/main/java/com/hzya/frame/u8/receipt/service/impl/ReceiptDetaiServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/receipt/service/impl/ReceiptDetaiServiceImpl.java new file mode 100644 index 00000000..1e5c87c3 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/receipt/service/impl/ReceiptDetaiServiceImpl.java @@ -0,0 +1,23 @@ +package com.hzya.frame.u8.receipt.service.impl; + +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.u8.receipt.entity.ReceiptDetailEntity; +import com.hzya.frame.u8.receipt.service.IReceiptDetaiService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.stereotype.Service; + +/** + * + * @content 销售收款单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Service(value = "ReceiptDetaiServiceImpl") +public class ReceiptDetaiServiceImpl extends BaseService implements IReceiptDetaiService { + Logger logger = LogManager.getLogger(getClass()); + + +} diff --git a/service/src/main/java/com/hzya/frame/u8/receipt/service/impl/ReceiptServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/receipt/service/impl/ReceiptServiceImpl.java new file mode 100644 index 00000000..b36f983e --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/receipt/service/impl/ReceiptServiceImpl.java @@ -0,0 +1,168 @@ +package com.hzya.frame.u8.receipt.service.impl; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.crm.util.CrmUtil; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.u8.receipt.dao.IReceiptDao; +import com.hzya.frame.u8.receipt.entity.ReceiptEntity; +import com.hzya.frame.u8.receipt.service.IReceiptService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.commons.collections.CollectionUtils; +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 javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * + * @content 销售收款单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Service(value = "ReceiptServiceImpl") +public class ReceiptServiceImpl extends BaseService implements IReceiptService { + Logger logger = LogManager.getLogger(getClass()); + @Autowired + private IReceiptDao saleOutDao; + + @Resource + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + @Override + public void getU8ReceiptCrm(JSONObject requestJson) { + //获取重推信息id,并记录日志 + JSONObject requestJsonObj = JSON.parseObject(requestJson.toString(),JSONObject.class); + String interId = requestJsonObj.getString("integration_task_living_details_id"); + logger.info("U8销售收款单重推解析后:"+requestJsonObj.toString()); + logger.info("U8销售收款单推送CRM重新执行的任务主键:"+interId); + + //更换数据源 + JsonResultEntity resultEntity = new JsonResultEntity(); + ReceiptEntity entity = new ReceiptEntity(); + requestJson.put("db_code","YONYOUU8"); + entity.setDataSourceCode(requestJson.getString("db_code")); + + //根据重推信息id,查询该条重推记录信息 + IntegrationTaskLivingDetailsEntity oldMsg = new IntegrationTaskLivingDetailsEntity(); + if(StrUtil.isNotEmpty(interId)){ + oldMsg = taskLivingDetailsService.get(interId); + } + String rootAppPk = oldMsg.getRootAppPk(); + entity.setIds(rootAppPk); + StrUtil.isEmpty(rootAppPk);//entity.setQueryState("查询"); + //如果是重推,是否通过entity传入的id,只能查到一条数据。 + //entity.setId("-8845102890648320822"); + List soleList = saleOutDao.getU8Receipt(entity); + logger.info("销售出库查询数据{}",JSONObject.toJSONString(soleList)); + if(CollectionUtils.isNotEmpty(soleList)){ + soleList.forEach(sale -> { + try{ + //获取明细数据进行拼接 + String id = sale.getiID(); + if(!StrUtil.isEmpty(id)){ + logger.info("组装数据"); + JSONObject main = bindingAdd(sale); + logger.info("销售出库推送数据:"+main.toString()); + String result = CrmUtil.sendU8TOCrmEsb(main.toString(), "8000340003"); + logger.info("销售出库推送结果:"+result); + IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); + logDetails.setRootAppPk(sale.getIds()); + logDetails.setRootAppBill(sale.getCvouchid()); + logDetails.setNewTransmitInfo(result); + logDetails.setNewPushDate(new Date()); + logDetails.setRootAppNewData(JSON.toJSONString(sale)); + logDetails.setPluginId("SaleConPlugin"); + + JSONObject resultObj = JSON.parseObject(result); + boolean flag = resultObj.getString("code").equals("0"); + if(flag){ + logDetails.setNewTransmitInfo("推送成功"); + // 推送成功,更新状态 + sale.setState("Y"); + }else{ + // 推送失败 + sale.setState("N"); + } + sale.setDataSourceCode(requestJson.getString("db_code")); + try{ + saveLog(interId, logDetails, flag); + }catch (Exception e){ + logger.error("保存日志失败"+e.getMessage()); + saleOutDao.updateState(sale); + e.printStackTrace(); + } + saleOutDao.updateState(sale); + } + } catch (Exception e) { + logger.error("销售出库执行失败"+e.getMessage()); + e.printStackTrace(); + } + }); + + } + } + /** + * + * @content 保存日志信息 + * @className: Administrator + * @author laborer + * @date 2024-10-18 11:27 + * + */ + + private void saveLog(String interId, IntegrationTaskLivingDetailsEntity logDetails, boolean flag) throws Exception { + if(StrUtil.isEmpty(interId)){ + if(flag){ + //首推成功 + taskLivingDetailsService.saveLogToSuccess(logDetails); + }else{ + //首推失败 + taskLivingDetailsService.saveLogToFail(logDetails); + } + }else{ + logDetails.setId(interId); + if(flag){ + //重推成功 + taskLivingDetailsService.saveLogFailToSuccess(logDetails); + }else{ + //重推失败,把失败信息,更新到重推表中 + taskLivingDetailsService.updateLogFailToSuccess(logDetails); + } + } + } + + /** + * + * @content 组装推送参数 + * @className: Administrator + * @author laborer + * @date 2024-10-18 11:13 + * + */ + + private JSONObject bindingAdd(ReceiptEntity sale) { + JSONObject main = new JSONObject(); + main.put("AccId",sale.getAccId()); + main.put("billid",sale.getiID()); + main.put("LoginDate", DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); + JSONObject head = new JSONObject(); + head.put("cvouchid",sale.getCvouchid()); + head.put("dvouchdate",sale.getDvouchdate()); + head.put("ccuscode",sale.getCcuscode()); + head.put("iamount",sale.getCcusname()); + head.put("csscode",sale.getCsscode()); + head.put("syncFlag",sale.getSyncFlag()); + main.put("head",head); + return main; + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/saleinv/dao/ISaleInvDao.java b/service/src/main/java/com/hzya/frame/u8/saleinv/dao/ISaleInvDao.java new file mode 100644 index 00000000..ec87015a --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleinv/dao/ISaleInvDao.java @@ -0,0 +1,37 @@ +package com.hzya.frame.u8.saleinv.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.u8.saleinv.entity.SaleInvEntity; + +import java.util.List; + +/** + * + * @content 销售发票 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface ISaleInvDao extends IBaseDao { + /** + * + * @content 获取U8销售发票信息 + * @className: Administrator + * @author laborer + * @date 2024-10-18 14:22 + * + */ + + List getU8SaleInv(SaleInvEntity entity); +/** + * + * @content 修改推送状态 + * @className: Administrator + * @author laborer + * @date 2024-10-18 14:43 + * + */ + + int updateState(SaleInvEntity entity); +} diff --git a/service/src/main/java/com/hzya/frame/u8/saleinv/dao/ISaleInvDetailDao.java b/service/src/main/java/com/hzya/frame/u8/saleinv/dao/ISaleInvDetailDao.java new file mode 100644 index 00000000..c409cac7 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleinv/dao/ISaleInvDetailDao.java @@ -0,0 +1,27 @@ +package com.hzya.frame.u8.saleinv.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.u8.saleinv.entity.SaleInvDetailEntity; + +import java.util.List; + +/** + * + * @content 销售发票 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface ISaleInvDetailDao extends IBaseDao { + /** + * + * @content 获取U8销售发票明细数据 + * @className: Administrator + * @author laborer + * @date 2024-10-18 14:37 + * + */ + + List getU8InvDetail(SaleInvDetailEntity line); +} diff --git a/service/src/main/java/com/hzya/frame/u8/saleinv/dao/impl/SaleInvDaoImpl.java b/service/src/main/java/com/hzya/frame/u8/saleinv/dao/impl/SaleInvDaoImpl.java new file mode 100644 index 00000000..df12cd47 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleinv/dao/impl/SaleInvDaoImpl.java @@ -0,0 +1,32 @@ +package com.hzya.frame.u8.saleinv.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.u8.saleinv.dao.ISaleInvDao; +import com.hzya.frame.u8.saleinv.entity.SaleInvEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * + * @content 销售发票 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Repository(value = "SaleInvDaoImpl") +public class SaleInvDaoImpl extends MybatisGenericDao implements ISaleInvDao { + @DS("#entity.dataSourceCode") + + @Override + public List getU8SaleInv(SaleInvEntity entity) { + return (List) super.selectList("com.hzya.frame.u8.saleinv.dao.impl.SaleInvDaoImpl.entity_list_base",entity); + } + + @Override + public int updateState(SaleInvEntity entity) { + return super.update("com.hzya.frame.u8.saleinv.dao.impl.SaleInvDaoImpl.entity_update", entity); + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/saleinv/dao/impl/SaleInvDetailDaoImpl.java b/service/src/main/java/com/hzya/frame/u8/saleinv/dao/impl/SaleInvDetailDaoImpl.java new file mode 100644 index 00000000..bdb14a41 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleinv/dao/impl/SaleInvDetailDaoImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.u8.saleinv.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.u8.saleinv.dao.ISaleInvDetailDao; +import com.hzya.frame.u8.saleinv.entity.SaleInvDetailEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * + * @content 销售发票 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Repository(value = "SaleInvDetailDaoImpl") +public class SaleInvDetailDaoImpl extends MybatisGenericDao implements ISaleInvDetailDao { + @DS("#entity.dataSourceCode") + @Override + public List getU8InvDetail(SaleInvDetailEntity entity) { + return (List) super.selectList("com.hzya.frame.u8.saleinv.dao.impl.SaleInvDetailDaoImpl.entity_list_base",entity); + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvDetailEntity.java b/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvDetailEntity.java new file mode 100644 index 00000000..9f4925de --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvDetailEntity.java @@ -0,0 +1,67 @@ +package com.hzya.frame.u8.saleinv.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * + * @content 销售发票 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public class SaleInvDetailEntity extends BaseEntity { + private String cdlcode;//发货单号 + private String idlsum;//发货单金额 + private String idlrowno;//发货单行号 + private String SBVID;//主表主键 + private String AccCode;//账套编码 + private String AccId;//账套号 + + public String getAccCode() { + return AccCode; + } + + public void setAccCode(String accCode) { + AccCode = accCode; + } + + public String getAccId() { + return AccId; + } + + public void setAccId(String accId) { + AccId = accId; + } + public String getCdlcode() { + return cdlcode; + } + + public void setCdlcode(String cdlcode) { + this.cdlcode = cdlcode; + } + + public String getIdlsum() { + return idlsum; + } + + public void setIdlsum(String idlsum) { + this.idlsum = idlsum; + } + + public String getIdlrowno() { + return idlrowno; + } + + public void setIdlrowno(String idlrowno) { + this.idlrowno = idlrowno; + } + + public String getSBVID() { + return SBVID; + } + + public void setSBVID(String SBVID) { + this.SBVID = SBVID; + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvDetailEntity.xml b/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvDetailEntity.xml new file mode 100644 index 00000000..81564d34 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvDetailEntity.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + diff --git a/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvEntity.java b/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvEntity.java new file mode 100644 index 00000000..9181c0aa --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvEntity.java @@ -0,0 +1,107 @@ +package com.hzya.frame.u8.saleinv.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +import java.util.List; + +/** + * + * @content 销售发票 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ + +public class SaleInvEntity extends BaseEntity { + private String csbvcode;//销售发票号 + private String ddate;//销售发票日期 + private String isum;//发票金额 + private String SBVID;//发票主键 + private String AccId;//账套 + private String state;// + private String syncFlag;// + private String ids;// + + public String getIds() { + return ids; + } + + public void setIds(String ids) { + this.ids = ids; + } + private List saleInvDetailEntityList; + private String AccCode;//账套编码 + public String getAccCode() { + return AccCode; + } + + public void setAccCode(String accCode) { + AccCode = accCode; + } + + + public List getSaleInvDetailEntityList() { + return saleInvDetailEntityList; + } + + public void setSaleInvDetailEntityList(List saleInvDetailEntityList) { + this.saleInvDetailEntityList = saleInvDetailEntityList; + } + + public String getCsbvcode() { + return csbvcode; + } + + public void setCsbvcode(String csbvcode) { + this.csbvcode = csbvcode; + } + + public String getDdate() { + return ddate; + } + + public void setDdate(String ddate) { + this.ddate = ddate; + } + + public String getIsum() { + return isum; + } + + public void setIsum(String isum) { + this.isum = isum; + } + + public String getSBVID() { + return SBVID; + } + + public void setSBVID(String SBVID) { + this.SBVID = SBVID; + } + + public String getAccId() { + return AccId; + } + + public void setAccId(String accId) { + AccId = accId; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getSyncFlag() { + return syncFlag; + } + + public void setSyncFlag(String syncFlag) { + this.syncFlag = syncFlag; + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvEntity.xml b/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvEntity.xml new file mode 100644 index 00000000..887ad0da --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleinv/entity/SaleInvEntity.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + update #{AccCode}.dbo.SaleBillVouch set sync_flag = #{state} + where SBVID = #{SBVID} + + + diff --git a/service/src/main/java/com/hzya/frame/u8/saleinv/service/ISaleInvDetaiService.java b/service/src/main/java/com/hzya/frame/u8/saleinv/service/ISaleInvDetaiService.java new file mode 100644 index 00000000..dba6b3e3 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleinv/service/ISaleInvDetaiService.java @@ -0,0 +1,15 @@ +package com.hzya.frame.u8.saleinv.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.u8.saleinv.entity.SaleInvDetailEntity; + +/** + * + * @content 销售发票 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface ISaleInvDetaiService extends IBaseService { +} diff --git a/service/src/main/java/com/hzya/frame/u8/saleinv/service/ISaleInvService.java b/service/src/main/java/com/hzya/frame/u8/saleinv/service/ISaleInvService.java new file mode 100644 index 00000000..d5587da1 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleinv/service/ISaleInvService.java @@ -0,0 +1,27 @@ +package com.hzya.frame.u8.saleinv.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.u8.saleinv.entity.SaleInvEntity; + +/** + * + * @content 销售发票 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface ISaleInvService extends IBaseService { +/** + * + * @content 获取U8销售发票数据,并推送到CRM + * @param requestJson + * @className: Administrator + * @author laborer + * @date 2024-10-18 13:48 + * + */ + + void getU8SaleInvToCrm(JSONObject requestJson); +} diff --git a/service/src/main/java/com/hzya/frame/u8/saleinv/service/impl/SaleInvDetaiServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/saleinv/service/impl/SaleInvDetaiServiceImpl.java new file mode 100644 index 00000000..9a95b6a5 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleinv/service/impl/SaleInvDetaiServiceImpl.java @@ -0,0 +1,23 @@ +package com.hzya.frame.u8.saleinv.service.impl; + +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.u8.saleinv.entity.SaleInvDetailEntity; +import com.hzya.frame.u8.saleinv.service.ISaleInvDetaiService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.stereotype.Service; + +/** + * + * @content 销售发票 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Service(value = "SaleInvDetaiServiceImpl") +public class SaleInvDetaiServiceImpl extends BaseService implements ISaleInvDetaiService { + Logger logger = LogManager.getLogger(getClass()); + + +} diff --git a/service/src/main/java/com/hzya/frame/u8/saleinv/service/impl/SaleInvServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/saleinv/service/impl/SaleInvServiceImpl.java new file mode 100644 index 00000000..76cffc9a --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleinv/service/impl/SaleInvServiceImpl.java @@ -0,0 +1,191 @@ +package com.hzya.frame.u8.saleinv.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.basedao.service.impl.BaseService; +import com.hzya.frame.crm.util.CrmUtil; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.u8.saleinv.dao.ISaleInvDao; +import com.hzya.frame.u8.saleinv.dao.ISaleInvDetailDao; +import com.hzya.frame.u8.saleinv.entity.SaleInvDetailEntity; +import com.hzya.frame.u8.saleinv.entity.SaleInvEntity; +import com.hzya.frame.u8.saleinv.service.ISaleInvService; + +import com.hzya.frame.u8.saleout.entity.SaleOutDetailEntity; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.commons.collections.CollectionUtils; +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 javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * + * @content 销售发票 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Service(value = "SaleInvServiceImpl") +public class SaleInvServiceImpl extends BaseService implements ISaleInvService { + Logger logger = LogManager.getLogger(getClass()); + @Autowired + private ISaleInvDao saleInvDao; + @Autowired + private ISaleInvDetailDao saleInvDetailDao; + @Resource + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + @Override + public void getU8SaleInvToCrm(JSONObject requestJson) { + //获取重推信息id,并记录日志 + JSONObject requestJsonObj = JSON.parseObject(requestJson.toString(),JSONObject.class); + String interId = requestJsonObj.getString("integration_task_living_details_id"); + logger.info("U8销售发票单重推解析后:"+requestJsonObj.toString()); + logger.info("U8销售发票单推送CRM重新执行的任务主键:"+interId); + + //更换数据源 + JsonResultEntity resultEntity = new JsonResultEntity(); + SaleInvEntity entity = new SaleInvEntity(); + requestJson.put("db_code","YONYOUU8"); + entity.setDataSourceCode(requestJson.getString("db_code")); + + //根据重推信息id,查询该条重推记录信息 + IntegrationTaskLivingDetailsEntity oldMsg = new IntegrationTaskLivingDetailsEntity(); + if(StrUtil.isNotEmpty(interId)){ + oldMsg = taskLivingDetailsService.get(interId); + } + String rootAppPk = oldMsg.getRootAppPk(); + entity.setIds(rootAppPk); + StrUtil.isEmpty(rootAppPk);//entity.setQueryState("查询"); + //如果是重推,是否通过entity传入的id,只能查到一条数据。 + //entity.setId("-8845102890648320822"); + List soleList = saleInvDao.getU8SaleInv(entity); + logger.info("销售发票查询数据{}",JSONObject.toJSONString(soleList)); + if(CollectionUtils.isNotEmpty(soleList)){ + soleList.forEach(sale -> { + try{ + //获取明细数据进行拼接 + String id = sale.getSBVID(); + if(!StrUtil.isEmpty(id)){ + SaleInvDetailEntity line = new SaleInvDetailEntity(); + line.setSBVID(id); + line.setAccId(id); + line.setDataSourceCode(requestJson.getString("db_code")); + List lineList = saleInvDetailDao.getU8InvDetail(line); + logger.info("销售发票单明细查询数据{}",JSONObject.toJSONString(lineList)); + sale.setSaleInvDetailEntityList(lineList); + logger.info("组装数据"); + JSONObject main = bindingAdd(sale); + logger.info("销售发票推送数据:"+main.toString()); + String result = CrmUtil.sendU8TOCrmEsb(main.toString(), "8000340003"); + logger.info("销售发票推送结果:"+result); + IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); + logDetails.setRootAppPk(sale.getIds()); + logDetails.setRootAppBill(sale.getCsbvcode()); + logDetails.setNewTransmitInfo(result); + logDetails.setNewPushDate(new Date()); + logDetails.setRootAppNewData(JSON.toJSONString(sale)); + logDetails.setPluginId("SaleConPlugin"); + + JSONObject resultObj = JSON.parseObject(result); + boolean flag = resultObj.getString("code").equals("0"); + if(flag){ + logDetails.setNewTransmitInfo("推送成功"); + // 推送成功,更新状态 + sale.setState("Y"); + }else{ + // 推送失败 + sale.setState("N"); + } + sale.setDataSourceCode(requestJson.getString("db_code")); + try{ + saveLog(interId, logDetails, flag); + }catch (Exception e){ + logger.error("保存日志失败"+e.getMessage()); + saleInvDao.updateState(sale); + e.printStackTrace(); + } + saleInvDao.updateState(sale); + } + } catch (Exception e) { + logger.error("销售发票执行失败"+e.getMessage()); + e.printStackTrace(); + } + }); + + } + } + /** + * + * @content 保存日志信息 + * @className: Administrator + * @author laborer + * @date 2024-10-18 11:27 + * + */ + + private void saveLog(String interId, IntegrationTaskLivingDetailsEntity logDetails, boolean flag) throws Exception { + if(StrUtil.isEmpty(interId)){ + if(flag){ + //首推成功 + taskLivingDetailsService.saveLogToSuccess(logDetails); + }else{ + //首推失败 + taskLivingDetailsService.saveLogToFail(logDetails); + } + }else{ + logDetails.setId(interId); + if(flag){ + //重推成功 + taskLivingDetailsService.saveLogFailToSuccess(logDetails); + }else{ + //重推失败,把失败信息,更新到重推表中 + taskLivingDetailsService.updateLogFailToSuccess(logDetails); + } + } + } + + /** + * + * @content 组装推送参数 + * @className: Administrator + * @author laborer + * @date 2024-10-18 11:13 + * + */ + + private JSONObject bindingAdd(SaleInvEntity sale) { + JSONObject main = new JSONObject(); + main.put("AccId",sale.getAccId()); + main.put("billid",sale.getId()); + main.put("LoginDate", DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); + JSONObject head = new JSONObject(); + head.put("csbvcode",sale.getCsbvcode()); + head.put("ddate",sale.getDdate()); + head.put("syncFlag",sale.getSyncFlag()); + head.put("isum",sale.getIsum()); + JSONArray body = new JSONArray(); + main.put("head",head); + List lineList = sale.getSaleInvDetailEntityList(); + if(CollectionUtils.isNotEmpty(lineList)){ + lineList.forEach(line -> { + JSONObject lineObj = new JSONObject(); + lineObj.put("cdlcode",line.getCdlcode()); + lineObj.put("idlsum",line.getIdlsum()); + lineObj.put("idlrowno",line.getIdlrowno()); + body.add(lineObj); + }); + } + main.put("body",body); + return main; + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/saleout/dao/ISaleOutDao.java b/service/src/main/java/com/hzya/frame/u8/saleout/dao/ISaleOutDao.java new file mode 100644 index 00000000..d11d03ed --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleout/dao/ISaleOutDao.java @@ -0,0 +1,32 @@ +package com.hzya.frame.u8.saleout.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.u8.saleout.entity.SaleOutEntity; + +import java.util.List; + +/** + * @Description U8发货单 + * @Author xiangerlin + * @Date 2024/8/22 15:07 + **/ +public interface ISaleOutDao extends IBaseDao { + /** + * @content 获取U8销售出库单数据 + * @className: Administrator + * @author laborer + * @date 2024-10-18 10:49 + */ + + List getU8SaleOut(SaleOutEntity entity); +/** + * + * @content 推送修改状态 + * @className: Administrator + * @author laborer + * @date 2024-10-18 11:23 + * + */ + + int updateState(SaleOutEntity sale); +} diff --git a/service/src/main/java/com/hzya/frame/u8/saleout/dao/ISaleOutDetailDao.java b/service/src/main/java/com/hzya/frame/u8/saleout/dao/ISaleOutDetailDao.java new file mode 100644 index 00000000..d4f51fac --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleout/dao/ISaleOutDetailDao.java @@ -0,0 +1,25 @@ +package com.hzya.frame.u8.saleout.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.u8.saleout.entity.SaleOutDetailEntity; + +import java.util.List; + +/** + * @Description u8发货单明细行 + * @Author xiangerlin + * @Date 2024/8/22 16:22 + **/ +public interface ISaleOutDetailDao extends IBaseDao { + /** + * + * @content 获取u8发货单明细行 + * @return + * @className: Administrator + * @author laborer + * @date 2024-10-18 11:04 + * + */ + + List getU8SaleOutLine(SaleOutDetailEntity entity); +} diff --git a/service/src/main/java/com/hzya/frame/u8/saleout/dao/impl/SaleOutDaoImpl.java b/service/src/main/java/com/hzya/frame/u8/saleout/dao/impl/SaleOutDaoImpl.java new file mode 100644 index 00000000..cac9899e --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleout/dao/impl/SaleOutDaoImpl.java @@ -0,0 +1,28 @@ +package com.hzya.frame.u8.saleout.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.u8.saleout.dao.ISaleOutDao; +import com.hzya.frame.u8.saleout.entity.SaleOutEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * @Description u8发货单 + * @Author xiangerlin + * @Date 2024/8/22 15:09 + **/ +@Repository(value = "SaleOutDaoImpl") +public class SaleOutDaoImpl extends MybatisGenericDao implements ISaleOutDao { + @DS("#entity.dataSourceCode") + @Override + public List getU8SaleOut(SaleOutEntity entity) { + return (List) super.selectList("com.hzya.frame.u8.saleout.dao.impl.SaleOutDaoImpl.entity_list_base",entity); + } + @DS("#entity.dataSourceCode") + @Override + public int updateState(SaleOutEntity entity) { + return super.update("com.hzya.frame.u8.saleout.dao.impl.SaleOutDaoImpl.entity_list_base",entity); + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/saleout/dao/impl/SaleOutDetailDaoImpl.java b/service/src/main/java/com/hzya/frame/u8/saleout/dao/impl/SaleOutDetailDaoImpl.java new file mode 100644 index 00000000..894ed33c --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleout/dao/impl/SaleOutDetailDaoImpl.java @@ -0,0 +1,23 @@ +package com.hzya.frame.u8.saleout.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.u8.saleout.dao.ISaleOutDetailDao; +import com.hzya.frame.u8.saleout.entity.SaleOutDetailEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/8/22 16:24 + **/ +@Repository(value = "SaleOutDetailDaoImpl") +public class SaleOutDetailDaoImpl extends MybatisGenericDao implements ISaleOutDetailDao { + @DS("#entity.dataSourceCode") + @Override + public List getU8SaleOutLine(SaleOutDetailEntity entity) { + return (List) super.selectList("com.hzya.frame.u8.saleout.dao.impl.SaleOutDetailDaoImpl.entity_list_base",entity); + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutDetailEntity.java b/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutDetailEntity.java new file mode 100644 index 00000000..89d9cafb --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutDetailEntity.java @@ -0,0 +1,76 @@ +package com.hzya.frame.u8.saleout.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * + * @content 销售出库单明细 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public class SaleOutDetailEntity extends BaseEntity { + private String cinvcode;//存货编码 + private String cinvname;//存货名称 + private String iquantity;//数量 + private String inum;//辅计量单位数量 + private String idlrowno;//发货单行号 + private String AccCode;//账套编码 + private String AccId;//账套号 + + public String getAccCode() { + return AccCode; + } + + public void setAccCode(String accCode) { + AccCode = accCode; + } + + public String getAccId() { + return AccId; + } + + public void setAccId(String accId) { + AccId = accId; + } + public String getCinvcode() { + return cinvcode; + } + + public void setCinvcode(String cinvcode) { + this.cinvcode = cinvcode; + } + + public String getCinvname() { + return cinvname; + } + + public void setCinvname(String cinvname) { + this.cinvname = cinvname; + } + + public String getIquantity() { + return iquantity; + } + + public void setIquantity(String iquantity) { + this.iquantity = iquantity; + } + + public String getInum() { + return inum; + } + + public void setInum(String inum) { + this.inum = inum; + } + + public String getIdlrowno() { + return idlrowno; + } + + public void setIdlrowno(String idlrowno) { + this.idlrowno = idlrowno; + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutDetailEntity.xml b/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutDetailEntity.xml new file mode 100644 index 00000000..7ec7acfb --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutDetailEntity.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + diff --git a/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutEntity.java b/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutEntity.java new file mode 100644 index 00000000..ace3d86d --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutEntity.java @@ -0,0 +1,102 @@ +package com.hzya.frame.u8.saleout.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.hzya.frame.web.entity.BaseEntity; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.List; + +/** + * + * @content 销售出库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ + +public class SaleOutEntity extends BaseEntity { + private String cdlcode;//发货单号 + private String outtype;//出库方式 + private String ccode;//出库单号 + private String ddate;//出库日期 + private String AccId;//账套 + private String state;//状态 + private String AccCode;//账套编码 + private String ids;// + + public String getIds() { + return ids; + } + + public void setIds(String ids) { + this.ids = ids; + } + + public String getAccCode() { + return AccCode; + } + + public void setAccCode(String accCode) { + AccCode = accCode; + } + + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getAccId() { + return AccId; + } + + public void setAccId(String accId) { + AccId = accId; + } + + private ListsaleOutDetailEntityList; + + public List getSaleOutDetailEntityList() { + return saleOutDetailEntityList; + } + + public void setSaleOutDetailEntityList(List saleOutDetailEntityList) { + this.saleOutDetailEntityList = saleOutDetailEntityList; + } + + public String getCdlcode() { + return cdlcode; + } + + public void setCdlcode(String cdlcode) { + this.cdlcode = cdlcode; + } + + public String getOuttype() { + return outtype; + } + + public void setOuttype(String outtype) { + this.outtype = outtype; + } + + public String getCcode() { + return ccode; + } + + public void setCcode(String ccode) { + this.ccode = ccode; + } + + public String getDdate() { + return ddate; + } + + public void setDdate(String ddate) { + this.ddate = ddate; + } +} diff --git a/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutEntity.xml b/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutEntity.xml new file mode 100644 index 00000000..6c7e4035 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleout/entity/SaleOutEntity.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + update #{AccCode}.dbo.rdrecords32 set sync_flag = #{state} + where id = #{id} + + diff --git a/service/src/main/java/com/hzya/frame/u8/saleout/service/ISaleOutDetaiService.java b/service/src/main/java/com/hzya/frame/u8/saleout/service/ISaleOutDetaiService.java new file mode 100644 index 00000000..64fda28b --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleout/service/ISaleOutDetaiService.java @@ -0,0 +1,15 @@ +package com.hzya.frame.u8.saleout.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.u8.saleout.entity.SaleOutDetailEntity; + +/** + * + * @content 销售出库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface ISaleOutDetaiService extends IBaseService { +} diff --git a/service/src/main/java/com/hzya/frame/u8/saleout/service/ISaleOutService.java b/service/src/main/java/com/hzya/frame/u8/saleout/service/ISaleOutService.java new file mode 100644 index 00000000..3ab5a256 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleout/service/ISaleOutService.java @@ -0,0 +1,26 @@ +package com.hzya.frame.u8.saleout.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.u8.saleout.entity.SaleOutEntity; + +/** + * + * @content 销售出库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +public interface ISaleOutService extends IBaseService { +/** + * + * @content 获取U8销售出库单到CRM + * @className: Administrator + * @author laborer + * @date 2024-10-18 10:15 + * + */ + + void getU8SaleOutToCrm(JSONObject requestJson); +} diff --git a/service/src/main/java/com/hzya/frame/u8/saleout/service/impl/SaleOutDetaiServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/saleout/service/impl/SaleOutDetaiServiceImpl.java new file mode 100644 index 00000000..073d0d46 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleout/service/impl/SaleOutDetaiServiceImpl.java @@ -0,0 +1,25 @@ +package com.hzya.frame.u8.saleout.service.impl; + +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.u8.saleout.dao.ISaleOutDetailDao; +import com.hzya.frame.u8.saleout.entity.SaleOutDetailEntity; +import com.hzya.frame.u8.saleout.service.ISaleOutDetaiService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * + * @content 销售出库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Service(value = "SaleOutDetaiServiceImpl") +public class SaleOutDetaiServiceImpl extends BaseService implements ISaleOutDetaiService { + Logger logger = LogManager.getLogger(getClass()); + + +} diff --git a/service/src/main/java/com/hzya/frame/u8/saleout/service/impl/SaleOutServiceImpl.java b/service/src/main/java/com/hzya/frame/u8/saleout/service/impl/SaleOutServiceImpl.java new file mode 100644 index 00000000..c60a6654 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/u8/saleout/service/impl/SaleOutServiceImpl.java @@ -0,0 +1,204 @@ +package com.hzya.frame.u8.saleout.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.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.crm.util.CrmUtil; +import com.hzya.frame.seeyon.util.RestUtil; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.u8.saleout.dao.ISaleOutDao; +import com.hzya.frame.u8.saleout.dao.ISaleOutDetailDao; +import com.hzya.frame.u8.saleout.dao.impl.SaleOutDetailDaoImpl; +import com.hzya.frame.u8.saleout.entity.SaleOutDetailEntity; +import com.hzya.frame.u8.saleout.entity.SaleOutEntity; +import com.hzya.frame.u8.saleout.service.ISaleOutService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.commons.collections.CollectionUtils; +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 javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * + * @content 销售出库单 + * @className: Administrator + * @author laborer + * @date 2024-10-18 9:27 + * + */ +@Service(value = "SaleOutServiceImpl") +public class SaleOutServiceImpl extends BaseService implements ISaleOutService { + Logger logger = LogManager.getLogger(getClass()); + @Autowired + private ISaleOutDao saleOutDao; + @Autowired + private ISaleOutDetailDao saleOutDetailDao; + @Resource + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + + /** + * + * @content 获取U8销售出库单到CRM + * @className: Administrator + * @author laborer + * @date 2024-10-18 10:15 + * + */ + + @Override + public void getU8SaleOutToCrm(JSONObject requestJson) { + //获取重推信息id,并记录日志 + JSONObject requestJsonObj = JSON.parseObject(requestJson.toString(),JSONObject.class); + String interId = requestJsonObj.getString("integration_task_living_details_id"); + logger.info("U8销售出库单重推解析后:"+requestJsonObj.toString()); + logger.info("U8销售出库单推送CRM重新执行的任务主键:"+interId); + + //更换数据源 + JsonResultEntity resultEntity = new JsonResultEntity(); + SaleOutEntity entity = new SaleOutEntity(); + requestJson.put("db_code","YONYOUU8"); + entity.setDataSourceCode(requestJson.getString("db_code")); + + //根据重推信息id,查询该条重推记录信息 + IntegrationTaskLivingDetailsEntity oldMsg = new IntegrationTaskLivingDetailsEntity(); + if(StrUtil.isNotEmpty(interId)){ + oldMsg = taskLivingDetailsService.get(interId); + } + String rootAppPk = oldMsg.getRootAppPk(); + entity.setIds(rootAppPk); + StrUtil.isEmpty(rootAppPk);//entity.setQueryState("查询"); + //如果是重推,是否通过entity传入的id,只能查到一条数据。 + //entity.setId("-8845102890648320822"); + List soleList = saleOutDao.getU8SaleOut(entity); + logger.info("销售出库查询数据{}",JSONObject.toJSONString(soleList)); + if(CollectionUtils.isNotEmpty(soleList)){ + soleList.forEach(sale -> { + try{ + //获取明细数据进行拼接 + String id = sale.getId(); + if(!StrUtil.isEmpty(id)){ + SaleOutDetailEntity line = new SaleOutDetailEntity(); + line.setId(id); + line.setAccId(id); + line.setDataSourceCode(requestJson.getString("db_code")); + List lineList = saleOutDetailDao.getU8SaleOutLine(line); + logger.info("销售出库单明细查询数据{}",JSONObject.toJSONString(lineList)); + sale.setSaleOutDetailEntityList(lineList); + logger.info("组装数据"); + JSONObject main = bindingAdd(sale); + logger.info("销售出库推送数据:"+main.toString()); + String result = CrmUtil.sendU8TOCrmEsb(main.toString(), "8000340003"); + logger.info("销售出库推送结果:"+result); + IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); + logDetails.setRootAppPk(sale.getIds()); + logDetails.setRootAppBill(sale.getCcode()); + logDetails.setNewTransmitInfo(result); + logDetails.setNewPushDate(new Date()); + logDetails.setRootAppNewData(JSON.toJSONString(sale)); + logDetails.setPluginId("SaleConPlugin"); + + JSONObject resultObj = JSON.parseObject(result); + boolean flag = resultObj.getString("code").equals("0"); + if(flag){ + logDetails.setNewTransmitInfo("推送成功"); + // 推送成功,更新状态 + sale.setState("Y"); + }else{ + // 推送失败 + sale.setState("N"); + } + sale.setDataSourceCode(requestJson.getString("db_code")); + try{ + saveLog(interId, logDetails, flag); + }catch (Exception e){ + logger.error("保存日志失败"+e.getMessage()); + saleOutDao.updateState(sale); + e.printStackTrace(); + } + saleOutDao.updateState(sale); + } + } catch (Exception e) { + logger.error("销售出库执行失败"+e.getMessage()); + e.printStackTrace(); + } + }); + + } + } +/** + * + * @content 保存日志信息 + * @className: Administrator + * @author laborer + * @date 2024-10-18 11:27 + * + */ + + private void saveLog(String interId, IntegrationTaskLivingDetailsEntity logDetails, boolean flag) throws Exception { + if(StrUtil.isEmpty(interId)){ + if(flag){ + //首推成功 + taskLivingDetailsService.saveLogToSuccess(logDetails); + }else{ + //首推失败 + taskLivingDetailsService.saveLogToFail(logDetails); + } + }else{ + logDetails.setId(interId); + if(flag){ + //重推成功 + taskLivingDetailsService.saveLogFailToSuccess(logDetails); + }else{ + //重推失败,把失败信息,更新到重推表中 + taskLivingDetailsService.updateLogFailToSuccess(logDetails); + } + } + } + + /** + * + * @content 组装推送参数 + * @className: Administrator + * @author laborer + * @date 2024-10-18 11:13 + * + */ + + private JSONObject bindingAdd(SaleOutEntity sale) { + JSONObject main = new JSONObject(); + main.put("AccId",sale.getAccId()); + main.put("billid",sale.getId()); + main.put("LoginDate", DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); + JSONObject head = new JSONObject(); + head.put("cdlcode",sale.getCdlcode()); + head.put("couttype",sale.getOuttype()); + head.put("ccode",sale.getCcode()); + head.put("ddate",sale.getDdate()); + JSONArray body = new JSONArray(); + List lineList = sale.getSaleOutDetailEntityList(); + if(CollectionUtils.isNotEmpty(lineList)){ + lineList.forEach(line -> { + JSONObject lineObj = new JSONObject(); + lineObj.put("cinvcode",line.getCinvcode()); + lineObj.put("cinvname",line.getCinvname()); + lineObj.put("iquantity",line.getIquantity()); + lineObj.put("inum",line.getInum()); + lineObj.put("idlrowno",line.getIdlrowno()); + body.add(lineObj); + }); + } + main.put("head",head); + main.put("body",body); + return main; + } +} From 00fec98bed38a7a21aa7ae1cd095d9b1221d0d16 Mon Sep 17 00:00:00 2001 From: yuqh <123456> Date: Tue, 5 Nov 2024 15:01:55 +0800 Subject: [PATCH 101/101] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AF=B9=E6=8E=A5CRM?= =?UTF-8?q?=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/a8bill/plugin/PayReqSyncU8CPluginInitializer.java | 2 ++ .../frame/plugin/u8c/plugin/SaleConPluginInitializer.java | 4 +++- .../src/main/java/com/hzya/frame/seeyon/util/RestUtil.java | 5 ++--- .../frame/u8c/sosale/service/impl/SoSaleServiceImpl.java | 2 ++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayReqSyncU8CPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayReqSyncU8CPluginInitializer.java index bf7d7ae8..74297311 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayReqSyncU8CPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayReqSyncU8CPluginInitializer.java @@ -141,6 +141,8 @@ public class PayReqSyncU8CPluginInitializer extends PluginBaseEntity { for (String key : hashMap.keySet()) { main.put(key, hashMap.get(key)); } + logger.info("组装数据前"+JSON.toJSONString(hashMaps)); + logger.info("组装数据前1"+main.toString()); ningboBankPluginService.updateU8CStatus(main,integration_task_living_details_id); } } catch (Exception e) { diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/plugin/SaleConPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/plugin/SaleConPluginInitializer.java index 6c0d6b56..f406009d 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/plugin/SaleConPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/u8c/plugin/SaleConPluginInitializer.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; import com.hzya.frame.base.PluginBaseEntity; import com.hzya.frame.plugin.u8c.service.ISalesBillingService; import com.hzya.frame.u8c.sosale.service.ISoSaleService; +import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -93,6 +94,7 @@ private ISoSaleService soSaleService; **/ @Override public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { - return soSaleService.getU8cSaleToOa(requestJson); + soSaleService.getU8cSaleToOa(requestJson); + return BaseResult.getSuccessMessageEntity("销售订单同步OA成功"); } } diff --git a/service/src/main/java/com/hzya/frame/seeyon/util/RestUtil.java b/service/src/main/java/com/hzya/frame/seeyon/util/RestUtil.java index e468fae4..a74908a1 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/util/RestUtil.java +++ b/service/src/main/java/com/hzya/frame/seeyon/util/RestUtil.java @@ -208,9 +208,8 @@ public class RestUtil { } public static String sendU8CToOA(String parm, String apiCode,String userCode){ String baseUrl = "http://127.0.0.1:8901/kangarooDataCenterV3/entranceController/externalCallInterface"; - System.out.println("推送参数"+parm); //获取OAtoken - + logger.info("推送参数"+parm); JSONObject tokenObj = new JSONObject(); tokenObj.put("password","2cdd6cfc-5b87-47d1-aaea-756a55f6b5a6"); tokenObj.put("userName","restUser"); @@ -231,7 +230,7 @@ public class RestUtil { .body(parm)//表单内容 .timeout(20000)//超时,毫秒 .execute().body(); - System.out.println("返回参数"+result); + logger.info("返回参数"+parm); if(StrUtil.isNotEmpty(result)){ return analytic(result); } diff --git a/service/src/main/java/com/hzya/frame/u8c/sosale/service/impl/SoSaleServiceImpl.java b/service/src/main/java/com/hzya/frame/u8c/sosale/service/impl/SoSaleServiceImpl.java index 513b38a4..b2ea2c04 100644 --- a/service/src/main/java/com/hzya/frame/u8c/sosale/service/impl/SoSaleServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/u8c/sosale/service/impl/SoSaleServiceImpl.java @@ -318,6 +318,8 @@ public class SoSaleServiceImpl extends BaseService impleme field0032.put("value",line.getFrownote()); bodyDetails.add(field0032); body.put("fields",bodyDetails); + records.add(body); + }); subTablesObj.put("records",records); subTablesObj.put("name","formson_0048");