Merge remote-tracking branch 'origin/dongj' into dongj
This commit is contained in:
commit
cc4db3ae5c
|
@ -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<HashMap<String, Object>> 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<String, String> headerMap = MapBuilder.<String, String>create(true)
|
||||
.put("apiCode", "8000360002")
|
||||
.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")
|
||||
|
|
|
@ -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<HashMap<String, Object>> hashMaps = payBillDao.getOaBillData(stringBuffer.toString(),oaBillEntity);
|
||||
if(CollectionUtils.isNotEmpty(hashMaps)){
|
||||
for (HashMap<String, Object> 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();
|
||||
|
|
|
@ -118,65 +118,8 @@ public class NingboBankPayResultPluginInitializer extends PluginBaseEntity {
|
|||
try {
|
||||
List<HashMap<String, Object>> hashMaps = payBillDao.getOaBillData(stringBuffer.toString(),oaBillEntity);
|
||||
if(CollectionUtils.isNotEmpty(hashMaps)){
|
||||
for (HashMap<String, Object> 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();
|
||||
|
|
|
@ -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<HashMap<String, Object>> 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());
|
||||
}
|
||||
}
|
|
@ -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<HashMap<String, Object>> 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());
|
||||
}
|
||||
}
|
|
@ -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<HashMap<String, Object>> hashMaps,String pluginId,String apiCode,String interId);
|
||||
/**
|
||||
* 调用宁波银行esb接口
|
||||
* @param params
|
||||
|
@ -25,4 +35,11 @@ public interface INingboBankPluginService {
|
|||
* @param accTransactionResList
|
||||
*/
|
||||
void saveAccLog(List<AccTransactionRes> accTransactionResList);
|
||||
|
||||
/**
|
||||
* 查询交易结果
|
||||
* @param hashMaps
|
||||
* @param apiCode
|
||||
*/
|
||||
void queryResult(List<HashMap<String, Object>> hashMaps,String apiCode);
|
||||
}
|
||||
|
|
|
@ -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<HashMap<String, Object>> hashMaps, String pluginId, String apiCode,String interId) {
|
||||
if(CollectionUtils.isNotEmpty(hashMaps)){
|
||||
PayBillEntity oaBillEntity = new PayBillEntity();
|
||||
oaBillEntity.setDataSourceCode(oa_data_source_code);
|
||||
|
||||
for (HashMap<String, Object> 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<HashMap<String, Object>> hashMaps, String apiCode) {
|
||||
if(CollectionUtils.isNotEmpty(hashMaps)){
|
||||
PayBillEntity oaBillEntity = new PayBillEntity();
|
||||
oaBillEntity.setDataSourceCode(oa_data_source_code);
|
||||
for (HashMap<String, Object> 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接口
|
||||
*
|
||||
|
|
|
@ -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<String, String> header = null;
|
||||
/** query */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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 OA同步销售开票审核状态到U8C
|
||||
* @Date 10:21 上午 2024/8/2
|
||||
* @param requestJson
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
**/
|
||||
JsonResultEntity doSalesBilling(JSONObject requestJson);
|
||||
}
|
|
@ -0,0 +1,149 @@
|
|||
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 {
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(SalesBillingServiceImpl.class);
|
||||
|
||||
@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
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 同步销售开票审核状态
|
||||
* @Date 10:21 上午 2024/8/2
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity doSalesBilling(JSONObject requestJson) {
|
||||
//查询需要同步的数据
|
||||
|
||||
try {
|
||||
U8cSalesBillingEntity u8cSalesBillingEntity = new U8cSalesBillingEntity();
|
||||
u8cSalesBillingEntity.setDataSourceCode(oa_data_source_code);
|
||||
List<U8cSalesBillingEntity> 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;
|
||||
}
|
||||
|
||||
|
||||
public String executeEsb(String params, String appId, String apiCode, String publicKey, String secretKey) {
|
||||
logger.info("请求apiCode:{},参数:{}", apiCode, params);
|
||||
Map<String, String> header = MapBuilder.<String, String>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;
|
||||
}
|
||||
}
|
|
@ -49,4 +49,4 @@ cbs8:
|
|||
#电子回单下载临时存放位置
|
||||
elec_path: /Users/xiangerlin/Downloads/
|
||||
OA:
|
||||
data_source_code: yc_oa
|
||||
data_source_code: djoatest
|
|
@ -4,4 +4,6 @@
|
|||
<bean name="accLogPluginInitializer" class="com.hzya.frame.plugin.a8bill.plugin.AccLogPluginInitializer" />
|
||||
<bean name="ningboBankPayPluginInitializer" class="com.hzya.frame.plugin.a8bill.plugin.NingboBankPayPluginInitializer" />
|
||||
<bean name="ningboBankPayResultPluginInitializer" class="com.hzya.frame.plugin.a8bill.plugin.NingboBankPayResultPluginInitializer" />
|
||||
<bean name="ningboBankTTPayPluginInitializer" class="com.hzya.frame.plugin.a8bill.plugin.NingboBankTTPayPluginInitializer" />
|
||||
<bean name="ningboBankTTPayResultPluginInitializer" class="com.hzya.frame.plugin.a8bill.plugin.NingboBankTTPayResultPluginInitializer" />
|
||||
</beans>
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>SalesBillingPlugin</id>
|
||||
<name>u8c插件</name>
|
||||
<category>202408020001</category>
|
||||
</plugin>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="salesBillingPluginInitializer" class="com.hzya.frame.plugin.u8c.plugin.SalesBillingPluginInitializer" />
|
||||
</beans>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean name="salesBillingServiceImpl" class="com.hzya.frame.plugin.u8c.service.impl.SalesBillingServiceImpl" />
|
||||
</beans>
|
|
@ -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<ContractDetail> contractDtlList;
|
||||
private String postscript;
|
||||
private List<String> 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<String> getFileUploadCodes() {
|
||||
return fileUploadCodes;
|
||||
}
|
||||
|
||||
public void setFileUploadCodes(List<String> fileUploadCodes) {
|
||||
this.fileUploadCodes = fileUploadCodes;
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -60,6 +60,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");
|
||||
|
|
|
@ -206,11 +206,24 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
}
|
||||
}
|
||||
if(jsonObjectMain!=null && jsonObjectMain.size()>0) {
|
||||
Map<String, Object> map = new HashMap<>();//将主表数据存到map中
|
||||
Map<String, Object> map = new HashMap<>();//将主表数据存到map中
|
||||
List<List<Map<String, Object>>> mapDetails = new ArrayList<>();//将子表数据存到map中
|
||||
if (comparisonEntities != null && comparisonEntities.size() > 0) {
|
||||
map = spliceMainMap(comparisonEntities, jsonObjectMain, map, comparisonEntity, comparisonDetailsEntity);
|
||||
|
||||
//根据data_id判断数据是否已经保存在相关表中,避免重复保存
|
||||
List<String> fields = getFields(comparisonEntity);
|
||||
Map<String,Object> 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<Map<String, Object>> listDataId = comparisonDao.queryComparisonPage(comparisonDataId);
|
||||
if(CollectionUtils.isNotEmpty(listDataId)){
|
||||
return BaseResult.getFailureMessageEntity(comparisonEntity.getDbName()+"表中已经存在data_id为:"+jsonObjectMain.getString("data_id")+"的数据");
|
||||
}
|
||||
|
||||
//判断输入的主表字段是否是必填项
|
||||
for (ComparisonEntity entity : comparisonEntities) {
|
||||
//如果必填字段不为空
|
||||
|
|
|
@ -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<U8cSalesBillingEntity, String> {
|
||||
List<U8cSalesBillingEntity> queryDoSalesBilling(U8cSalesBillingEntity entity);
|
||||
|
||||
int updateDoSalesBilling(U8cSalesBillingEntity entity);
|
||||
}
|
||||
|
|
@ -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<U8cSalesBillingEntity, String> implements IU8cSalesBillingDao{
|
||||
@DS("#entity.dataSourceCode")
|
||||
@Override
|
||||
public List<U8cSalesBillingEntity> queryDoSalesBilling(U8cSalesBillingEntity entity) {
|
||||
List<U8cSalesBillingEntity> o = (List<U8cSalesBillingEntity>) 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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hzya.frame.u8c.salesBilling.dao.impl.U8cSalesBillingDaoImpl">
|
||||
|
||||
<resultMap id="get-U8cSalesBillingEntity-result" type="com.hzya.frame.u8c.salesBilling.entity.U8cSalesBillingEntity" >
|
||||
<result property="code" column="code" jdbcType="VARCHAR"/>
|
||||
<result property="corp" column="corp" jdbcType="VARCHAR"/>
|
||||
<result property="dateBegin" column="date_begin" jdbcType="VARCHAR"/>
|
||||
<result property="dateEnd" column="date_end" jdbcType="VARCHAR"/>
|
||||
<result property="approvid" column="approvid" jdbcType="VARCHAR"/>
|
||||
<result property="approvedate" column="approveDate" jdbcType="VARCHAR"/>
|
||||
<result property="status" column="status" jdbcType="VARCHAR"/>
|
||||
<result property="note" column="note" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="queryDoSalesBilling" resultType="com.hzya.frame.u8c.salesBilling.entity.U8cSalesBillingEntity" parameterType = "com.hzya.frame.u8c.salesBilling.entity.U8cSalesBillingEntity">
|
||||
SELECT
|
||||
formmain_0049.id as id,
|
||||
formmain_0049.field0001 as code, -- 单据号
|
||||
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, -- 审批人
|
||||
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
|
||||
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')
|
||||
</select>
|
||||
<update id="updateDoSalesBilling" parameterType="com.hzya.frame.u8c.salesBilling.entity.U8cSalesBillingEntity">
|
||||
update formmain_0049 set
|
||||
field0044 = #{pushStatus}
|
||||
where id = #{id}
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -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<U8cSalesBillingEntity, String> {
|
||||
List<U8cSalesBillingEntity> queryDoSalesBilling(U8cSalesBillingEntity u8cSalesBillingEntity);
|
||||
|
||||
int updateDoSalesBilling(U8cSalesBillingEntity entity);
|
||||
}
|
|
@ -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<U8cSalesBillingEntity, String> implements IU8cSalesBillingService {
|
||||
|
||||
private IU8cSalesBillingDao u8cSalesBillingDao;
|
||||
|
||||
@Autowired
|
||||
public void setU8cSalesBillingDao(IU8cSalesBillingDao dao) {
|
||||
this.u8cSalesBillingDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
@Override
|
||||
public List<U8cSalesBillingEntity> queryDoSalesBilling(U8cSalesBillingEntity entity) {
|
||||
List<U8cSalesBillingEntity> u8cSalesBillingEntityList = u8cSalesBillingDao.queryDoSalesBilling(entity);
|
||||
return u8cSalesBillingEntityList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateDoSalesBilling(U8cSalesBillingEntity entity) {
|
||||
return u8cSalesBillingDao.updateDoSalesBilling(entity);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue