diff --git a/service/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ICbsLogDao.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ICbsLogDao.java new file mode 100644 index 00000000..032d1a3e --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ICbsLogDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.seeyon.cbs8.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity; + +/** + * @Description cbs8支付日志 + * @Author xiangerlin + * @Date 2024/6/14 17:30 + **/ +public interface ICbsLogDao extends IBaseDao { +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/CbsLogDaoImpl.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/CbsLogDaoImpl.java new file mode 100644 index 00000000..a42437b0 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/CbsLogDaoImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.seeyon.cbs8.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.cbs8.dao.ICbsLogDao; +import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/14 17:31 + **/ +@Repository() +public class CbsLogDaoImpl extends MybatisGenericDao implements ICbsLogDao { +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.java new file mode 100644 index 00000000..21cc1a4f --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.java @@ -0,0 +1,151 @@ +package com.hzya.frame.seeyon.cbs8.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description cbs支付日志 + * @Author xiangerlin + * @Date 2024/6/14 17:16 + **/ +public class CbsLogEntity extends BaseEntity { + //流程标题 + private String title; + //请款主体 + private String pay_company; + //收款人 + private String payee; + //金额 + private String amount; + //cbs申请单号 + private String cbs_apply_code; + //日志表id + private String id; + //oa单据id + private String oa_id; + //oa单据号 + private String bill_code; + //英文表名 + private String tab_name_en; + //中文表名 + private String tab_name_ch; + //支付状态 + private String pay_state; + //支付信息 + private String message; + //支付申请状态 + private String apply_state; + //成功标记 + private String successed; + + public String getOa_id() { + return oa_id; + } + + public void setOa_id(String oa_id) { + this.oa_id = oa_id; + } + + public String getBill_code() { + return bill_code; + } + + public void setBill_code(String bill_code) { + this.bill_code = bill_code; + } + + public String getTab_name_en() { + return tab_name_en; + } + + public void setTab_name_en(String tab_name_en) { + this.tab_name_en = tab_name_en; + } + + public String getTab_name_ch() { + return tab_name_ch; + } + + public void setTab_name_ch(String tab_name_ch) { + this.tab_name_ch = tab_name_ch; + } + + public String getPay_state() { + return pay_state; + } + + public void setPay_state(String pay_state) { + this.pay_state = pay_state; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getApply_state() { + return apply_state; + } + + public void setApply_state(String apply_state) { + this.apply_state = apply_state; + } + + public String getSuccessed() { + return successed; + } + + public void setSuccessed(String successed) { + this.successed = successed; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getPay_company() { + return pay_company; + } + + public void setPay_company(String pay_company) { + this.pay_company = pay_company; + } + + public String getPayee() { + return payee; + } + + public void setPayee(String payee) { + this.payee = payee; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getCbs_apply_code() { + return cbs_apply_code; + } + + public void setCbs_apply_code(String cbs_apply_code) { + this.cbs_apply_code = cbs_apply_code; + } +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.xml b/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.xml new file mode 100644 index 00000000..9d596d92 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + id, + field0001 as oa_id, + field0002 as bill_code, + field0003 as tab_name_en, + field0004 as tab_name_ch, + field0005 as pay_state, + field0006 as message, + field0007 as apply_state, + field0008 as successed, + field0009 as title, + field0010 as pay_company, + field0011 as payee, + field0012 as amount, + field0013 as cbs_apply_code + + + + + + + + + + + + + update formmain_1283 set + + field0005 =#{pay_state}, + field0006 =#{message}, + field0007 =#{apply_state}, + field0008 =#{successed} + + where id = #{id} + + + + + diff --git a/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/ICbsLogService.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/ICbsLogService.java new file mode 100644 index 00000000..369a3aba --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/ICbsLogService.java @@ -0,0 +1,39 @@ +package com.hzya.frame.seeyon.cbs8.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity; + +import java.util.List; + +/** + * @Description cbs8支付日志 + * @Author xiangerlin + * @Date 2024/6/14 17:22 + **/ +public interface ICbsLogService extends IBaseService { + /** + * 查询支付中的数据 + * @param logEntity + * @return + */ + List queryInPayment(CbsLogEntity logEntity); + /** + * 保存日志,通过rest接口的形式 + * @param logEntity + */ + void saveLog(CbsLogEntity logEntity); + + /** + * 补推,从自己开发的页面或者APIpost + * 需要传oa表单id和表单编号 + * @param entity + */ + void retry(CbsLogEntity entity); + /** + * 补推,从OA页面 + * 只需要传日志表id就行 + * @param jsonObject + */ + void resend(JSONObject jsonObject); +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/IPaymentService.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/IPaymentService.java index caf8cd0b..4243084c 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/IPaymentService.java +++ b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/IPaymentService.java @@ -20,4 +20,44 @@ public interface IPaymentService extends IBaseService { * @throws Exception */ List queryUnpaid(PaymentEntity entity)throws Exception; + + /** + * 查询交易成功的数据 + * 内置了查询条件payResult = PayState.payStateGetValue("g"); 支付成功 + * @param entity + * @return + * @throws Exception + */ + List querySuccess(PaymentEntity entity)throws Exception; + + /** + * 查询交易成功,且电子回单为空的 + * @param entity + * @return + * @throws Exception + */ + List queryElecIsNull(PaymentEntity entity)throws Exception; + + /** + * 查询支付中的数据 + * 内置了查询条件 payResult = '支付中' or payResult not in ('审批撤销','审批拒绝','处理失败','退票','支付成功','取消支付','修改支付','支付失败') + * @param entity + * @return + * @throws Exception + */ + List queryInPayment(PaymentEntity entity)throws Exception; + + /** + * 更新支付状态 + * @param entity + * @throws Exception + */ + void updatePayState(PaymentEntity entity)throws Exception; + + /** + * 更新电子回单字段 + * @param entity + * @throws Exception + */ + void updateElec(PaymentEntity entity)throws Exception; } diff --git a/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 new file mode 100644 index 00000000..90a83f67 --- /dev/null +++ b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java @@ -0,0 +1,102 @@ +package com.hzya.frame.seeyon.cbs8.service.impl; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.cbs8.util.PayState; +import com.hzya.frame.seeyon.cbs8.dao.ICbsLogDao; +import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; +import com.hzya.frame.seeyon.cbs8.service.ICbsLogService; +import com.hzya.frame.web.exception.BaseSystemException; +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 cbs8支付日志 + * @Author xiangerlin + * @Date 2024/6/14 17:22 + **/ +@Service() +public class CbsLogServiceImpl extends BaseService implements ICbsLogService { + + Logger log = LoggerFactory.getLogger(getClass()); + + private ICbsLogDao cbsLogDao; + + @Autowired + public void setCbsLogDao(ICbsLogDao cbsLogDao) { + this.cbsLogDao = cbsLogDao; + this.dao = cbsLogDao; + } + + /** + * 查询支付中的数据 + * + * @param logEntity + * @return + */ + @Override + public List queryInPayment(CbsLogEntity logEntity) { + List logList = cbsLogDao.queryList(logEntity, "CbsLogEntity_list_base_in_payment"); + return logList; + } + + /** + * 保存日志,通过rest接口的形式 + * + * @param logEntity + */ + @Override + public void saveLog(CbsLogEntity logEntity) { + + } + + /** + * 补推,从自己开发的页面或者APIpost + * 需要传oa表单id和表单编号 + * + * @param entity + */ + @Override + public void retry(CbsLogEntity entity) { + PaymentEntity paymentEntity = new PaymentEntity(); + paymentEntity.setOaId(entity.getOa_id()); + paymentEntity.setReferenceNum(entity.getBill_code()); + CbsLogEntity logEntity = new CbsLogEntity(); + logEntity.setId(entity.getId()); + logEntity = cbsLogDao.queryOne(logEntity); + String pay_state = logEntity.getPay_state(); + if (PayState.h.getValue().equals(pay_state) + || PayState.three.getValue().equals(pay_state) + || PayState.k.getValue().equals(pay_state) + || "推送失败".equals(pay_state)){ + //todo 调用重试方法 + }else { + throw new BaseSystemException("只允许补推支付失败的记录"); + } + } + + /** + * 补推,从OA页面 + * 只需要传日志表id就行 + * + * @param jsonObject + */ + @Override + public void resend(JSONObject jsonObject) { + if (null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("id"))){ + String id = jsonObject.getString("id"); + CbsLogEntity cbsLogEntity = new CbsLogEntity(); + cbsLogEntity.setId(id); + cbsLogEntity =cbsLogDao.queryOne(cbsLogEntity); + if (null != cbsLogEntity && StrUtil.isNotEmpty(cbsLogEntity.getOa_id()) && StrUtil.isNotEmpty(cbsLogEntity.getBill_code())){ + retry(cbsLogEntity); + } + } + } +} diff --git a/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/PaymentServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/PaymentServiceImpl.java index 0148c19f..a1801a1d 100644 --- a/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/PaymentServiceImpl.java +++ b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/PaymentServiceImpl.java @@ -1,5 +1,6 @@ package com.hzya.frame.seeyon.cbs8.service.impl; +import com.baomidou.dynamic.datasource.annotation.DS; import com.hzya.frame.basedao.service.impl.BaseService; import com.hzya.frame.seeyon.cbs8.dao.IPaymentDao; import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; @@ -17,6 +18,8 @@ import java.util.List; @Service("OAPaymentServiceImpl") public class PaymentServiceImpl extends BaseService implements IPaymentService { + + public static final String oa_datasource_code = "123"; private IPaymentDao paymentDao; @Autowired @@ -33,8 +36,69 @@ public class PaymentServiceImpl extends BaseService implem * @return * @throws Exception */ + @Override public List queryUnpaid(PaymentEntity entity) throws Exception { return null; } + + /** + * 查询交易成功的数据 + * 内置了查询条件payResult = PayState.payStateGetValue("g"); 支付成功 + * + * @param entity + * @return + * @throws Exception + */ + @Override + public List querySuccess(PaymentEntity entity) throws Exception { + return null; + } + + /** + * 查询交易成功,且电子回单为空的 + * + * @param entity + * @return + * @throws Exception + */ + @Override + public List queryElecIsNull(PaymentEntity entity) throws Exception { + return null; + } + + /** + * 查询支付中的数据 + * 内置了查询条件 payResult = '支付中' or payResult not in ('审批撤销','审批拒绝','处理失败','退票','支付成功','取消支付','修改支付','支付失败') + * + * @param entity + * @return + * @throws Exception + */ + @Override + public List queryInPayment(PaymentEntity entity) throws Exception { + return null; + } + + /** + * 更新支付状态 + * + * @param entity + * @throws Exception + */ + @Override + public void updatePayState(PaymentEntity entity) throws Exception { + + } + + /** + * 更新电子回单字段 + * + * @param entity + * @throws Exception + */ + @Override + public void updateElec(PaymentEntity entity) throws Exception { + + } }