到账推送BIP和到账通知推送-init
This commit is contained in:
parent
c7eb7aa8b6
commit
2f6a9901be
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding='gb2312'?>
|
||||
<module displayname="cmp" name="cmp">
|
||||
<dependencies>
|
||||
</dependencies>
|
||||
</module>
|
|
@ -0,0 +1,443 @@
|
|||
package nccloud.web.cmp.informer.informer.action;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import nc.bs.logging.Logger;
|
||||
import nc.itf.uap.IUAPQueryBS;
|
||||
import nc.jdbc.framework.JdbcSession;
|
||||
import nc.jdbc.framework.PersistenceManager;
|
||||
import nc.jdbc.framework.exception.DbException;
|
||||
import nc.jdbc.framework.processor.MapListProcessor;
|
||||
import nc.jdbc.framework.processor.MapProcessor;
|
||||
import nccloud.framework.service.ServiceLocator;
|
||||
import nccloud.framework.web.action.itf.ICommonAction;
|
||||
import nccloud.framework.web.container.IRequest;
|
||||
import nccloud.web.cmp.informer.action.InformerAction;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 2005适配2312
|
||||
*
|
||||
* @author mzr
|
||||
* @date 2025/04/02
|
||||
*/
|
||||
public class myBtnClickAction extends InformerAction implements ICommonAction {
|
||||
|
||||
@Override
|
||||
public Object doAction(IRequest request) {
|
||||
|
||||
|
||||
// 初始化结果映射,用于存储处理结果
|
||||
HashMap<String, String> resultMap = new HashMap<String, String>();
|
||||
// 读取请求中的JSON数据
|
||||
|
||||
String json = request.read();
|
||||
Map<String, Object> maps = JSON.parseObject(json, Map.class);
|
||||
if (maps.get("pks") == null) {
|
||||
resultMap.put("result", "请选择行");
|
||||
return resultMap;
|
||||
}
|
||||
JSONArray jsonArray = (JSONArray) maps.get("pks");
|
||||
ArrayList<Object> pks = new ArrayList<>(Arrays.asList(jsonArray.toArray()));
|
||||
|
||||
// 使用 String.join 进行字符串拼接
|
||||
String result = "";
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (pks.size() > 1) {
|
||||
for (int i = 0; i < pks.size(); i++) {
|
||||
sb.append("'").append(pks.get(i)).append("'");
|
||||
if (i < pks.size() - 1) {
|
||||
sb.append(",");
|
||||
}
|
||||
}
|
||||
|
||||
result = sb.toString();
|
||||
} else {
|
||||
result = "'" + (String) pks.get(0) + "'";
|
||||
|
||||
}
|
||||
System.out.println(result);
|
||||
// 解析JSON数据为JSONObject对象
|
||||
// 从JSON对象中提取账单编号
|
||||
System.out.println(json);
|
||||
String urlpath;
|
||||
String appKey;
|
||||
String appSecret;
|
||||
String tenant;
|
||||
|
||||
// 如果账单编号为空,则返回失败结果
|
||||
|
||||
try {
|
||||
String urlsql = "select code,name from bd_defdoc where code='baseUrl'";
|
||||
String appksql = "select code,name from bd_defdoc where code='appKey'";
|
||||
String uappssql = "select code,name from bd_defdoc where code='appSecret'";
|
||||
String tenantsql = "select code,name from bd_defdoc where code='tenant'";
|
||||
|
||||
Map<String, Object> urls = (Map<String, Object>) getQueryService().executeQuery(urlsql, new MapProcessor());
|
||||
Map<String, Object> appks = (Map<String, Object>) getQueryService().executeQuery(appksql, new MapProcessor());
|
||||
Map<String, Object> appses = (Map<String, Object>) getQueryService().executeQuery(uappssql, new MapProcessor());
|
||||
Map<String, Object> tenants = (Map<String, Object>) getQueryService().executeQuery(tenantsql, new MapProcessor());
|
||||
|
||||
if (urls.get("code") != null) {
|
||||
urlpath = (String) urls.get("name");
|
||||
} else {
|
||||
resultMap.put("result", "未配置url");
|
||||
return resultMap;
|
||||
}
|
||||
if (appks.get("code") != null) {
|
||||
appKey = (String) appks.get("name");
|
||||
} else {
|
||||
resultMap.put("result", "未配置appKey");
|
||||
return resultMap;
|
||||
}
|
||||
if (appses.get("code") != null) {
|
||||
appSecret = (String) appses.get("name");
|
||||
} else {
|
||||
resultMap.put("result", "未配置appSecret");
|
||||
return resultMap;
|
||||
}
|
||||
if (tenants.get("code") != null) {
|
||||
tenant = (String) tenants.get("name");
|
||||
} else {
|
||||
resultMap.put("result", "未配置tenant");
|
||||
return resultMap;
|
||||
}
|
||||
long timestampMillis = System.currentTimeMillis();
|
||||
System.out.println("当前时间戳(毫秒):" + timestampMillis);
|
||||
String dai = "appKey" + appKey + "timestamp" + timestampMillis;
|
||||
String signature = calculateHmacSHA256(dai, appSecret);
|
||||
SSLUtilities sas = new SSLUtilities();
|
||||
sas.disableCertificateValidation();
|
||||
|
||||
String urlstr = "appKey=" + appKey + "×tamp=" + timestampMillis + "&signature=" + signature;
|
||||
URL url = new URL(urlpath + "/iuap-api-auth/open-auth/selfAppAuth/getAccessToken?" + urlstr);
|
||||
// 打开连接
|
||||
HttpURLConnection con = (HttpURLConnection) url.openConnection();
|
||||
|
||||
// 设置请求方法为 GET
|
||||
con.setRequestMethod("GET");
|
||||
|
||||
|
||||
// 获取响应代码
|
||||
BufferedReader ins = new BufferedReader(new InputStreamReader(con.getInputStream()));
|
||||
String inputLine;
|
||||
StringBuilder response = new StringBuilder();
|
||||
|
||||
while ((inputLine = ins.readLine()) != null) {
|
||||
response.append(inputLine);
|
||||
}
|
||||
|
||||
System.out.println(response);
|
||||
System.out.println(response);
|
||||
|
||||
String jsonString = response.toString();
|
||||
Map<String, Object> map = JSON.parseObject(jsonString, Map.class);
|
||||
System.out.println(map);
|
||||
|
||||
System.out.println(url);
|
||||
|
||||
// 获取当前年份
|
||||
String sql = " select jstype.code as pk_balatype,ban.code bancode,ban.name as banname,bankname,bank.accnum as accnum,infodate,CASE direction " +
|
||||
"WHEN 'paymoney' THEN '付款' " +
|
||||
"WHEN 'receivemoney' THEN '收款' " +
|
||||
"ELSE '不存在' " +
|
||||
"END as direction, 'CNY' as currencyCode,moneyy , bant.code as dfcode,bant.name as dfname,oppbankaccount,bankt.accnum dfaccnum " +
|
||||
",pk_oppunit,org.code as orgcode,org.name as orgname,cmp.pk_informer " +
|
||||
",cmp.memo,cmp.transerial,df.name as ksmc,df.code as ksbm,cmp.note_no,def01,cmp.oppunitname " +
|
||||
"from cmp_informer cmp " +
|
||||
"left join bd_bankaccbas bank on cmp.pk_bankacc=bank.pk_bankaccbas " +
|
||||
"left join bd_bankdoc ban on cmp.pk_bank=ban.pk_bankdoc " +
|
||||
"left join bd_bankdoc bant on cmp.pk_oppbank=bant.pk_bankdoc " +
|
||||
"left join bd_bankaccbas bankt on cmp.pk_oppacc=bankt.pk_bankaccbas " +
|
||||
"left join bd_cust_supplier df on cmp.pk_oppunit=df.pk_cust_sup " +
|
||||
"left join org_financeorg org on cmp.pk_org = org.pk_financeorg " +
|
||||
"left join bd_balatype jstype on jstype.pk_balatype =cmp.pk_balatype " +
|
||||
" where cmp.pk_informer in(" + result + ") ";
|
||||
List<Map<String, String>> results = (List<Map<String, String>>) getQueryService().executeQuery(sql, new MapListProcessor());
|
||||
|
||||
ArrayList lists = new ArrayList();
|
||||
for (int i = 0; i < results.size(); i++) {
|
||||
Map vmao = new HashMap();
|
||||
Map<String, String> row = results.get(i);
|
||||
String def01 = (String) row.get("def01");
|
||||
if ("已推送".equals(def01)) {
|
||||
resultMap.put("flag", "false");
|
||||
resultMap.put("message", "已推送无法再次推送");
|
||||
return resultMap;
|
||||
}
|
||||
if ("撤回".equals(def01)) {
|
||||
vmao.put("publishStatus", "再次发布");
|
||||
|
||||
} else {
|
||||
vmao.put("publishStatus", "");
|
||||
|
||||
}
|
||||
|
||||
|
||||
String pjlsh;
|
||||
if (row.get("transerial") != null) {
|
||||
pjlsh = row.get("transerial").toString();
|
||||
} else if (row.get("note_no") != null) {
|
||||
pjlsh = row.get("note_no").toString();
|
||||
} else {
|
||||
resultMap.put("flag", "false");
|
||||
resultMap.put("message", "票据与流水号不可同时为空");
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
vmao.put("accountName", row.get("bancode"));
|
||||
vmao.put("bankNum", row.get("accnum"));
|
||||
vmao.put("transactionDate", row.get("infodate"));
|
||||
vmao.put("paymentReceiptStatus", row.get("direction"));
|
||||
vmao.put("currencyCode", "CNY");
|
||||
vmao.put("transactionAmount", row.get("moneyy"));
|
||||
vmao.put("pendingClaimAmount", 0);
|
||||
vmao.put("oppAccount", row.get("oppbankaccount"));
|
||||
vmao.put("oppAccountName", row.get("oppunitname"));
|
||||
vmao.put("oppBank", row.get("dfcode"));
|
||||
vmao.put("oppBankName", row.get("dfname"));
|
||||
vmao.put("description", row.get("memo"));
|
||||
vmao.put("bankTransactionNumber", pjlsh);
|
||||
vmao.put("accountType", "默认类型");
|
||||
vmao.put("orgCode", row.get("orgcode"));
|
||||
vmao.put("billNumber", row.get("note_no"));
|
||||
|
||||
if (row.get("pk_balatype") != null && row.get("pk_balatype") != "" && row.get("pk_balatype") != "~") {
|
||||
vmao.put("paymentMethod", row.get("pk_balatype"));
|
||||
} else {
|
||||
vmao.put("paymentMethod", "10");
|
||||
}
|
||||
vmao.put("sourceId", row.get("pk_informer"));
|
||||
lists.add(vmao);
|
||||
}
|
||||
|
||||
// lists转json
|
||||
String jsonString1 = JSON.toJSONString(lists);
|
||||
Map access_token = (Map) map.get("data");
|
||||
String urls2 = urlpath + "/iuap-api-gateway/" + tenant + "/current_yonbip_default_sys/KKAPI/paymentNotice/addBatch?access_token=" + access_token.get("access_token");
|
||||
Map mapjson = httpFW(urls2, jsonString1);
|
||||
Map datas = (Map) mapjson.get("data");
|
||||
JSONArray faijsonist = (JSONArray) datas.get("failData");
|
||||
|
||||
String message1 = (String) mapjson.get("message");
|
||||
JSONArray jsonist = (JSONArray) datas.get("successData");
|
||||
// 将JSONArray转换为List<String>
|
||||
ArrayList<String> successData = null;
|
||||
ArrayList<String> failData = null;
|
||||
|
||||
if (jsonist != null) {
|
||||
successData = (ArrayList<String>) jsonist.toJavaList(String.class);
|
||||
|
||||
}
|
||||
if (faijsonist != null) {
|
||||
failData = (ArrayList<String>) faijsonist.toJavaList(String.class);
|
||||
}
|
||||
ArrayList sqlStr = new ArrayList<>();
|
||||
for (int i = 0; i < pks.size(); i++) {
|
||||
String pk_s = (String) pks.get(i);
|
||||
String sql1;
|
||||
if (successData != null && successData.contains(pk_s)) {
|
||||
sql1 = "update cmp_informer set def01='已推送' where pk_informer='" + pk_s + "'";
|
||||
sqlStr.add(sql1);
|
||||
} else {
|
||||
sql1 = "update cmp_informer set def01='推送失败' where pk_informer='" + pk_s + "'";
|
||||
}
|
||||
sqlStr.add(sql1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
int succState = executeUpdate(sqlStr);
|
||||
String message = datas.get("successData") + "成功" + message1 + ",失败:" + failData;
|
||||
resultMap.put("flag", "true");
|
||||
resultMap.put("message", message);
|
||||
// 调用服务工具类的deletePrcplInterest方法,尝试删除利息计划
|
||||
System.out.println("year" + mapjson);
|
||||
ins.close();
|
||||
} catch (Exception ex) {
|
||||
// 捕获异常,并记录错误日志
|
||||
Logger.error("123" + ex.getMessage(), ex);
|
||||
resultMap.put("flag", "0");
|
||||
resultMap.put("message", ex.getMessage());
|
||||
}
|
||||
|
||||
|
||||
// 返回结果映射
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
public IUAPQueryBS getQueryService() {
|
||||
|
||||
return ServiceLocator.find(IUAPQueryBS.class);
|
||||
}
|
||||
|
||||
public static String calculateHmacSHA256(String data, String key) throws NoSuchAlgorithmException, InvalidKeyException, UnsupportedEncodingException {
|
||||
String algorithm = "HmacSHA256";
|
||||
Mac hmacSHA256 = Mac.getInstance(algorithm);
|
||||
SecretKeySpec secretKey = new SecretKeySpec(key.getBytes(), algorithm);
|
||||
hmacSHA256.init(secretKey);
|
||||
byte[] hashBytes = hmacSHA256.doFinal(data.getBytes());
|
||||
String base64Hash = Base64.encodeBase64String(hashBytes);
|
||||
return URLEncoder.encode(base64Hash, StandardCharsets.UTF_8.toString());
|
||||
}
|
||||
|
||||
|
||||
public static Map httpFW(String urlString, String jsonInputString) {
|
||||
// String jsonInputString = "{\"key\": \"中文\"}"; // 你的 JSON 数据
|
||||
// String urlString = "http://example.com/api"; // 替换为你的 URL
|
||||
System.out.println("请求值");
|
||||
System.out.println(jsonInputString);
|
||||
try {
|
||||
URL url = new URL(urlString);
|
||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||
|
||||
connection.setRequestMethod("POST");
|
||||
connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
|
||||
connection.setDoOutput(true);
|
||||
|
||||
// 发送请求
|
||||
try (OutputStream os = connection.getOutputStream()) {
|
||||
byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8);
|
||||
os.write(input, 0, input.length);
|
||||
}
|
||||
|
||||
// 获取响应码
|
||||
int responseCode = connection.getResponseCode();
|
||||
System.out.println("响应码: " + responseCode);
|
||||
// 根据响应码读取响应
|
||||
InputStream is = (responseCode >= 200 && responseCode < 300) ? connection.getInputStream() : connection.getErrorStream();
|
||||
StringBuilder response = new StringBuilder();
|
||||
|
||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) {
|
||||
String responseLine;
|
||||
while ((responseLine = br.readLine()) != null) {
|
||||
response.append(responseLine.trim());
|
||||
}
|
||||
}
|
||||
|
||||
// 输出响应
|
||||
System.out.println("返回值:");
|
||||
System.out.println(response.toString());
|
||||
// 返回map
|
||||
Map result = JSON.parseObject(response.toString(), HashMap.class);
|
||||
return result;
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public class SSLUtilities {
|
||||
public void disableCertificateValidation() throws Exception {
|
||||
TrustManager[] trustAllCertificates = new TrustManager[]{
|
||||
new X509TrustManager() {
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void checkClientTrusted(X509Certificate[] certs, String authType) {
|
||||
}
|
||||
|
||||
public void checkServerTrusted(X509Certificate[] certs, String authType) {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
SSLContext sc = SSLContext.getInstance("TLS");
|
||||
sc.init(null, trustAllCertificates, new SecureRandom());
|
||||
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
|
||||
}
|
||||
}
|
||||
|
||||
public int executeUpdate(List<String> updateSqls) throws DbException {
|
||||
if (updateSqls == null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ret = 0;
|
||||
PersistenceManager manager = null;
|
||||
JdbcSession session = null;
|
||||
Connection connection = null;
|
||||
|
||||
try {
|
||||
manager = PersistenceManager.getInstance();
|
||||
session = manager.getJdbcSession();
|
||||
connection = session.getConnection(); // 获取实际的数据库连接
|
||||
// connection = ConnectionFactory.getConnection();
|
||||
// 开始事务
|
||||
connection.setAutoCommit(false); // 禁用自动提交,手动管理事务
|
||||
|
||||
// 执行批量操作
|
||||
for (String sql : updateSqls) {
|
||||
session.addBatch(sql);
|
||||
}
|
||||
|
||||
|
||||
// 执行批处理
|
||||
ret = session.executeBatch();
|
||||
|
||||
// 提交事务
|
||||
connection.commit(); // 批处理成功后提交事务
|
||||
|
||||
} catch (DbException e) {
|
||||
if (connection != null) {
|
||||
try {
|
||||
// 如果发生异常,回滚事务
|
||||
connection.rollback();
|
||||
} catch (SQLException rollbackEx) {
|
||||
// 记录回滚异常的详细信息
|
||||
throw new DbException("Error during transaction rollback", rollbackEx) {
|
||||
@Override
|
||||
public boolean isDataIntegrityViolation() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBadSQLGrammar() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
throw e; // 将原始异常抛出
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
if (connection != null) {
|
||||
try {
|
||||
// 恢复自动提交模式,确保不会影响其他操作
|
||||
connection.setAutoCommit(true);
|
||||
} catch (SQLException e) {
|
||||
// 忽略恢复自动提交时的异常
|
||||
}
|
||||
}
|
||||
if (manager != null) {
|
||||
manager.release();
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,165 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<actions>
|
||||
<action>
|
||||
<name>cmp.informer.myBtnClickAction</name>
|
||||
<label>推送测试</label>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.myBtnClickAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.go2cardcheck</name>
|
||||
<label>列表跳转检查</label>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.CmpInformerGo2CardCheckAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.informerquery</name>
|
||||
<label>列表查询</label>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.ListQueryAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.informerqueryone</name>
|
||||
<label>到账通知查询</label>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.InformerQueryAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.informerpagequery</name>
|
||||
<label>列表分页查询</label>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.ListPageQueryAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.informerpublish</name>
|
||||
<label>列表发布</label>
|
||||
<btncode>commitpublish,Compublish</btncode>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.ListPublishAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.informerunpublish</name>
|
||||
<label>列表取消发布</label>
|
||||
<btncode>Cancelpublish</btncode>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.ListUnPublishAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.informergenerate</name>
|
||||
<label>列表生单</label>
|
||||
<btncode>Generate,Confirmgenerate</btncode>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.ListGenerateAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.informerungenerate</name>
|
||||
<label>列表不生单</label>
|
||||
<btncode>Nopublish,Unpublish</btncode>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.ListUnGenerateAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.informerrecgenerate</name>
|
||||
<label>列表恢复生单</label>
|
||||
<btncode>Recgenerate</btncode>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.ListRecGenerateAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.informercombine</name>
|
||||
<label>列表合并生单</label>
|
||||
<btncode>combine</btncode>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.ListCombineAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.informercancelgenerate</name>
|
||||
<label>列表取消生单</label>
|
||||
<btncode>Cancelgenerate,ungenerate,Lungenerate</btncode>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.ListCancelGenerateAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.listdialogdefaultvalue</name>
|
||||
<label>付/收款款结算单补录框设置默认值</label>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.ListDialogDefaultValue</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.informercardquery</name>
|
||||
<label>卡片查询</label>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.CardQueryAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.cardpublish</name>
|
||||
<label>卡片发布</label>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.CardPublishAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.cardunpublish</name>
|
||||
<label>卡片取消发布</label>
|
||||
<btncode>Lcancelpublish,Cancelpublish</btncode>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.CardUnPublishAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.appoint</name>
|
||||
<label>卡片指派</label>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.AppointAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.cardunclaim</name>
|
||||
<label>卡片取消认领</label>
|
||||
<btncode>Cancelclaim,Lunclaim</btncode>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.CardUnClaimAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.cardcancelgenerate</name>
|
||||
<label>卡片取消生成</label>
|
||||
<btncode>Cancelgenerate,Lcancelgenerate</btncode>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.CardUnMakeBillAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.cardgenerate</name>
|
||||
<label>卡片生单</label>
|
||||
<btncode>confirmgenerate,generate</btncode>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.CardGenerateAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.carddialogdefaultvalue</name>
|
||||
<label>付/收款款结算单补录框设置默认值</label>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.CardDialogDefaultValue</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.cardcombine</name>
|
||||
<label>卡片生单</label>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.CardCombineAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.afterevent</name>
|
||||
<label>弹框编辑后事件</label>
|
||||
<clazz>nccloud.web.cmp.informer.informer.handler.InformerAfterEditHandler</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.linkbill</name>
|
||||
<label>联查单据</label>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.InformerLinkBill</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.defaultorg</name>
|
||||
<label>默认组织</label>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.InformerDefaultOrg</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.refund</name>
|
||||
<label>退款</label>
|
||||
<btncode>refundBill,refund</btncode>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.RefundAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.sscinformerquery</name>
|
||||
<label>共享中心列表查询</label>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.SSCListQueryAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.custsupafteredit</name>
|
||||
<label>补录框版本编辑后</label>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.CustSupAtferEditAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.billdateafteredit</name>
|
||||
<label>补录框单据日期编辑后</label>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.BillDateAfterEditAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>cmp.informer.checkispaymentreturn</name>
|
||||
<label>补录框单据日期编辑后</label>
|
||||
<clazz>nccloud.web.cmp.informer.informer.action.CheckIsPaymentreturnAction</clazz>
|
||||
</action>
|
||||
</actions>
|
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<authorizes>
|
||||
<authorize>
|
||||
<!--到账通知鉴权-->
|
||||
<appcode>36070AISC,36070AISCC,36070AIPSSC</appcode>
|
||||
<actions>
|
||||
<action>cmp.informer.go2cardcheck</action>
|
||||
<action>cmp.informer.informerquery</action>
|
||||
<action>cmp.informer.informerpagequery</action>
|
||||
<action>cmp.informer.informerpublish</action>
|
||||
<action>cmp.informer.informerunpublish</action>
|
||||
<action>cmp.informer.informergenerate</action>
|
||||
<action>cmp.informer.informerungenerate</action>
|
||||
<action>cmp.informer.informerrecgenerate</action>
|
||||
<action>cmp.informer.informercombine</action>
|
||||
<action>cmp.informer.informercancelgenerate</action>
|
||||
<action>cmp.informer.informercardquery</action>
|
||||
<action>cmp.informer.cardpublish</action>
|
||||
<action>cmp.informer.cardunpublish</action>
|
||||
<action>cmp.informer.cardunclaim</action>
|
||||
<action>cmp.informer.cardcancelgenerate</action>
|
||||
<action>cmp.informer.cardgenerate</action>
|
||||
<action>cmp.informer.carddialogdefaultvalue</action>
|
||||
<action>cmp.informer.cardcombine</action>
|
||||
<action>cmp.informer.afterevent</action>
|
||||
<action>cmp.informer.linkbill</action>
|
||||
<action>cmp.informer.listdialogdefaultvalue</action>
|
||||
<action>cmp.informer.defaultorg</action>
|
||||
<action>cmp.informer.informerqueryone</action>
|
||||
<action>cmp.informer.appoint</action>
|
||||
<action>cmp.informer.refund</action>
|
||||
<action>cmp.informer.sscinformerquery</action>
|
||||
<action>cmp.informer.custsupafteredit</action>
|
||||
<action>cmp.informer.billdateafteredit</action>
|
||||
<action>cmp.informer.checkispaymentreturn</action>
|
||||
<action>cmp.informer.myBtnClickAction</action>
|
||||
</actions>
|
||||
</authorize>
|
||||
</authorizes>
|
|
@ -1,3 +1,5 @@
|
|||
<component name="fbm" displayname="fbm">
|
||||
<dependencies/>
|
||||
</component>
|
||||
<?xml version="1.0" encoding='gb2312'?>
|
||||
<module displayname="fbm" name="fbm">
|
||||
<dependencies>
|
||||
</dependencies>
|
||||
</module>
|
|
@ -0,0 +1,331 @@
|
|||
package nccloud.web.fbm.fbm.gather.action;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import nc.itf.uap.IUAPQueryBS;
|
||||
import nc.jdbc.framework.JdbcSession;
|
||||
import nc.jdbc.framework.PersistenceManager;
|
||||
import nc.jdbc.framework.exception.DbException;
|
||||
import nc.jdbc.framework.processor.MapListProcessor;
|
||||
import nccloud.framework.service.ServiceLocator;
|
||||
import nccloud.framework.web.action.itf.ICommonAction;
|
||||
import nccloud.framework.web.container.IRequest;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 2005适配2312
|
||||
*
|
||||
* @author mzr
|
||||
* @date 2025/04/03
|
||||
*/
|
||||
public class DzButton implements ICommonAction {
|
||||
|
||||
@Override
|
||||
public Object doAction(IRequest request) {
|
||||
// 初始化结果映射,用于存储处理结果
|
||||
HashMap<String, String> resultMap = new HashMap<String, String>();
|
||||
// 读取请求中的JSON数据
|
||||
|
||||
String json = request.read();
|
||||
Map<String, Object> maps = JSON.parseObject(json, Map.class);
|
||||
if (maps.get("pks") == null) {
|
||||
resultMap.put("result", "请选择行");
|
||||
return resultMap;
|
||||
}
|
||||
int yg = 0;
|
||||
int cg = 0;
|
||||
int sbl = 0;
|
||||
|
||||
JSONArray jsonArray = (JSONArray) maps.get("pks");
|
||||
ArrayList<Object> pks = new ArrayList<>(Arrays.asList(jsonArray.toArray()));
|
||||
|
||||
// 使用 String.join 进行字符串拼接
|
||||
String result = "";
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (pks.size() > 1) {
|
||||
for (int i = 0; i < pks.size(); i++) {
|
||||
sb.append("'").append(pks.get(i)).append("'");
|
||||
if (i < pks.size() - 1) {
|
||||
sb.append(",");
|
||||
}
|
||||
}
|
||||
|
||||
result = sb.toString();
|
||||
} else {
|
||||
result = "'" + (String) pks.get(0) + "'";
|
||||
}
|
||||
// 如果账单编号为空,则返回失败结果
|
||||
try {
|
||||
// 获取当前年份
|
||||
String sql = "select fbm.gatherdate,bank1.pk_bankdoc as fkyh,bank2.pk_bankdoc as skyh,fbm.acceptorbank,fbm.hidereceivebankacc ,holdunit,org.name as orgname , reg.name as pjname,xxb_bon.bdcode,btype.pk_balatype,reg.code,xxe.exsystemcode,\n" +
|
||||
"xxb_bon.exsysval\n" +
|
||||
",invoiceunit,fbmbilltype,fbm.fbmbillno,fbm.pk_register, paybankacc as bankaccount,fbm.payunit,cust.name as bankname,fbm.billmaker,fbm.creator,fbm.note,fbm.money,cust.custsupprop ,cust.custsuptype,fbm.pk_banktype ,fbm.pk_org ,fbm.pk_org_v,fbm.hidereceiveunit, fbm.hidepayunit,fbm.hidepaybankacc ,fbm.hidepaybank ,fbm.paybankacc ,fbm.paybank ,fbm.receiveunit,fbm.receivebankacc ,fbm.receivebank ,hidereceivebank, bankdoc.pk_bankaccbas ,fbm.pk_group \n" +
|
||||
"from fbm_register fbm \n" +
|
||||
"left join bd_cust_supplier cust on fbm.hidepayunit=cust.pk_cust_sup \n" +
|
||||
"left join bd_bankaccbas bankdoc on fbm.receivebankacc = bankdoc.code\n" +
|
||||
"left join bd_notetype reg on fbm.fbmbilltype=reg.pk_notetype\n" +
|
||||
"join xx_bdcontra_b xxb_bon on xxb_bon.exsysval=reg.code\n" +
|
||||
"join xx_bdcontra xxb on xxb.pk_contra=xxb_bon.pk_contra\n" +
|
||||
"join xx_exsystem xxe on xxe.pk_exsystem =xxb.exsystem and xxe.exsystemcode='pkinformer'\n" +
|
||||
"left join org_financeorg org on org.pk_financeorg=fbm.holdunit\n" +
|
||||
"left join bd_bankdoc bank1 on fbm.paybank =bank1.name\n" +
|
||||
"left join bd_bankdoc bank2 on fbm.receivebank =bank2.name\n" +
|
||||
"left join bd_balatype btype on btype.code=xxb_bon.bdcode " +
|
||||
|
||||
" where fbm.pk_register in(" + result + ") ";
|
||||
List<Map<String, Object>> results = (List<Map<String, Object>>) getQueryService().executeQuery(sql, new MapListProcessor());
|
||||
|
||||
List sqlStr = new ArrayList();
|
||||
LocalDateTime creationTime = LocalDateTime.now();
|
||||
|
||||
// 格式化年月日
|
||||
|
||||
DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
String formattedDate = creationTime.format(dateFormatter);
|
||||
// 格式化时分秒
|
||||
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("HH:mm:ss");
|
||||
String formattedTime = creationTime.format(timeFormatter);
|
||||
|
||||
// 格式化时间
|
||||
DateTimeFormatter datatimes = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
String formatteddatatime = creationTime.format(datatimes);
|
||||
yg = results.size();
|
||||
for (int i = 0; i < results.size(); i++) {
|
||||
|
||||
Map<String, Object> row = results.get(i);
|
||||
String bankAccount = (String) row.get("receivebankacc");
|
||||
String gatherdate = (String) row.get("gatherdate");
|
||||
// 本方开户银行名称
|
||||
String bankName = (String) row.get("receiveunit");
|
||||
// 制单人
|
||||
String billMaker = (String) row.get("billmaker");
|
||||
// 托收协议号
|
||||
String consignAgreement = "~";
|
||||
// 记录创建时间
|
||||
String sj = formatteddatatime;
|
||||
// 创建人
|
||||
String creator = (String) row.get("creator");
|
||||
// 收付性质
|
||||
String direction = "receivemoney";
|
||||
// (未明确用途,可根据实际情况使用)
|
||||
String domain = "~";
|
||||
// 制单日期
|
||||
String doOperateDate = formatteddatatime;
|
||||
// 制单时间
|
||||
String doOperateTime = formattedTime;
|
||||
// 标记,通常用于逻辑删除,0 表示未删除
|
||||
int dr = 0;
|
||||
// (未明确用途,可根据实际情况使用)
|
||||
String family = "~";
|
||||
// 未生成标志
|
||||
String generateFlag = "hasnogenerate";
|
||||
// 到账日期
|
||||
String infoDate = gatherdate;
|
||||
// 到账时间
|
||||
String infoDateTime = formattedTime;
|
||||
// 备注
|
||||
String memo = (String) row.get("note");
|
||||
// 修改时间
|
||||
String modifiedTime = formatteddatatime;
|
||||
// 修改人
|
||||
String modifier = (String) row.get("creator");
|
||||
// 金额
|
||||
double money = Double.parseDouble(row.get("money").toString());
|
||||
// 对方账户
|
||||
String oppBankAccount = (String) row.get("paybankacc");
|
||||
// 对方单位内外部标识 custsupprop 0=外部单位;
|
||||
// 1=内部单位;
|
||||
|
||||
String oppInOut;
|
||||
if (row.get("custsupprop") != null && row.get("custsupprop").toString().equals("0")) {
|
||||
oppInOut = "outer";
|
||||
} else {
|
||||
oppInOut = "inner";
|
||||
}
|
||||
// 对方名称
|
||||
String oppUnitName = (String) row.get("payunit");
|
||||
// 对方单位类别
|
||||
Object custsuptype = row.get("custsuptype");
|
||||
String oppUnitType = "cust"; // 默认值
|
||||
|
||||
if (custsuptype != null && custsuptype.toString().equals("2")) {
|
||||
oppUnitType = "supp";
|
||||
}
|
||||
|
||||
// 本方账户对应子户
|
||||
String pkAccSub = (String) row.get("hidereceivebankacc");
|
||||
// (未明确用途,可根据实际情况使用)
|
||||
String pk_balatype = (String) row.get("pk_balatype");
|
||||
// 本方开户银行主键
|
||||
String pkBank = (String) row.get("skyh");
|
||||
// 本方银行账号主键
|
||||
String pkBankAcc = (String) row.get("pk_bankaccbas");// 1
|
||||
// 记账人
|
||||
String pkBankAccer = "~";
|
||||
// 本方银行类别主键
|
||||
String pkBankType = (String) row.get("pk_banktype");
|
||||
|
||||
// 对方单位
|
||||
String pk_oppunit = (String) row.get("hidepayunit");
|
||||
// 对方开户银行账号主键
|
||||
String pk_oppbank = (String) row.get("fkyh");
|
||||
// 对方账户PK
|
||||
String pk_oppacc = (String) row.get("hidepaybankacc");
|
||||
|
||||
|
||||
// 单据类型
|
||||
String pkBillTypeCode = "36S3";
|
||||
// 单据类型主键
|
||||
String pkBillTypeId = "1001Z61000000001SOPF";
|
||||
// (未明确用途,可根据实际情况使用)
|
||||
String pkClaimer = "~";
|
||||
// 币种
|
||||
String pkCurrType = "1002Z0100000000001K1";
|
||||
// (未明确用途,可根据实际情况使用)
|
||||
String pkFundType = "~";
|
||||
// 所属集团
|
||||
String pkGroup = (String) row.get("pk_group");
|
||||
// (未明确用途,可根据实际情况使用主键)
|
||||
String pkInformer = (String) row.get("pk_register");
|
||||
// (未明确用途,可根据实际情况使用)
|
||||
String pkOrg = (String) row.get("pk_org");
|
||||
// 财务组织版本
|
||||
String pkOrgV = (String) row.get("pk_org_v");
|
||||
// 来源单据主键
|
||||
String pkSrc = null;
|
||||
// 制证人
|
||||
String pkVouch = (String) row.get("billmaker");
|
||||
// 收/付款资金组织
|
||||
String recPayFundOrg = "~";
|
||||
// 收/付款资金组织计划项目
|
||||
String recPayFundPlansubj = "~";
|
||||
// (未明确用途,可根据实际情况使用)
|
||||
String recPayInnerAcc = "~";
|
||||
// (未明确用途,可根据实际情况使用)
|
||||
String recPayOrg = "~";
|
||||
// (未明确用途,可根据实际情况使用)
|
||||
String recPayOrgPlansubj = "~";
|
||||
// (未明确用途,可根据实际情况使用)
|
||||
String releaseOrg = "~";
|
||||
// 风格标志,A 可能表示某种风格类型
|
||||
char styleFlag = 'A';
|
||||
// (未明确用途,可根据实际情况使用)
|
||||
String subFamily = "~";
|
||||
// 系统代码
|
||||
String sysCode = "sysnet";
|
||||
// 时间戳
|
||||
String ts = formatteddatatime;
|
||||
// 单据号
|
||||
long timestamp = System.currentTimeMillis();
|
||||
Random random = new Random();
|
||||
int randomNumber = random.nextInt(10000); // 生成0到9999之间的随机数
|
||||
String vBillNo = "36S" + String.format("%d%04d", timestamp, randomNumber);
|
||||
String note_no = (String) row.get("fbmbillno");
|
||||
// String sqlp="insert into cmp_informer(bankaccount,bankname,billmaker,consignagreement,creationtime,creator,direction,domain,doperatedate,doperatetime,dr,family,generateflag,infodate,infodatetime,memo,modifiedtime,modifier,moneyy,oppbankaccount,oppinout,oppunitname,oppunittype,pk_acc_sub,pk_balatype,pk_bank,pk_bankacc,pk_bankaccer,pk_banktype,pk_billtypecode,pk_billtypeid,pk_claimer,pk_currtype,pk_fundtype,pk_group,pk_informer,pk_org,pk_org_v,pk_src,pk_vouch,recpay_fundorg,recpay_fundplansubj,recpay_inneracc,recpay_org,recpay_orgplansubj,release_org,styleflag,subfamily,syscode,ts,vbillno) values('"+num+"','济南热电有限公司','1001A110000000003Q0I','~','"+dam+"','1001A110000000003Q0I','"+pr+"','~','"+transactionDate+"','"+dam+"','0','~','hasnogenerate','"+transactionDate+"','"+timesub+"','"+zhaiYao+"','"+dam+"','1001A110000000003Q0I',"+money+",'"+oppositeAccountNumber+"','"+opp+"','"+oppositeUserName+"','"+opptype+"','"+select[2]+"','~','"+select[0]+"','"+select[1]+"','~','"+select3[0]+"','36S3','1001Z61000000001SOPF','~','1002Z0100000000001K1','~','0001N2100000000002ZE','"+vId+"','0001N710000000001FWC','0001N710000000001FWB','1001A110000000007IWJ','~','~','~','~','~','~','~','A','~','sysnet','"+dam+"','"+fId2+"')"
|
||||
// 形成sql
|
||||
String sqlp = "insert into cmp_informer(bankaccount,bankname,billmaker,consignagreement,creationtime,creator,direction,domain,doperatedate,doperatetime,dr,family,generateflag,infodate,infodatetime,memo,modifiedtime,modifier,moneyy,oppbankaccount,oppinout,oppunitname,oppunittype,pk_acc_sub,pk_balatype,pk_bank,pk_bankacc,pk_bankaccer,pk_banktype,pk_billtypecode,pk_billtypeid,pk_claimer,pk_currtype,pk_fundtype,pk_group,pk_informer,pk_org,pk_org_v,pk_src,pk_vouch,recpay_fundorg,recpay_fundplansubj,recpay_inneracc,recpay_org,recpay_orgplansubj,release_org,styleflag,subfamily,syscode,ts,vbillno,note_no,pk_oppunit,pk_oppbank,pk_oppacc) values('"
|
||||
+ bankAccount + "','" + bankName + "','" + billMaker + "','" + consignAgreement + "','" + formatteddatatime + "','" + creator + "','" + direction + "','" + domain + "','" + doOperateDate + "','" + sj + "','" + dr + "','" + family + "','" + generateFlag + "','" + infoDate + "','" + infoDateTime + "','" + memo + "','" + modifiedTime + "','" + modifier + "','" + money + "','" + oppBankAccount + "','" + oppInOut + "','" + oppUnitName + "','" + oppUnitType + "','" + pkAccSub + "','" + pk_balatype + "','" + pkBank + "','" + pkBankAcc + "','" + pkBankAccer + "','" + pkBankType + "','" + pkBillTypeCode + "','" + pkBillTypeId + "','" + pkClaimer + "','" + pkCurrType + "','" + pkFundType + "','" + pkGroup + "','" + pkInformer + "','" + pkOrg + "','" + pkOrgV + "','" + pkSrc + "','" + pkVouch + "','" + recPayFundOrg + "','" + recPayFundPlansubj + "','" + recPayInnerAcc + "','" + recPayOrg + "','" + recPayOrgPlansubj + "','" + releaseOrg + "','" + styleFlag + "','" + subFamily + "','" + sysCode + "','" + ts + "','" + vBillNo + "','" + note_no + "','" + pk_oppunit + "','" + pk_oppbank + "','" + pk_oppacc + "')";
|
||||
sqlStr.add(sqlp);
|
||||
}
|
||||
int succState = executeUpdate(sqlStr);
|
||||
cg = succState;
|
||||
sbl = yg - succState;
|
||||
resultMap.put("flag", "1");
|
||||
resultMap.put("message", "插入数据成功,已插入" + succState + "条数据");
|
||||
resultMap.put("cg", String.valueOf(cg));
|
||||
resultMap.put("sbl", String.valueOf(sbl));
|
||||
resultMap.put("yg", String.valueOf(yg));
|
||||
// lists转json
|
||||
} catch (Exception ex) {
|
||||
// 捕获异常,并记录错误日志
|
||||
resultMap.put("cg", String.valueOf(0));
|
||||
resultMap.put("sbl", String.valueOf(yg));
|
||||
resultMap.put("yg", String.valueOf(yg));
|
||||
resultMap.put("flag", "0");
|
||||
resultMap.put("message", ex.getMessage());
|
||||
}
|
||||
// 返回结果映射
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
public IUAPQueryBS getQueryService() {
|
||||
return ServiceLocator.find(IUAPQueryBS.class);
|
||||
}
|
||||
|
||||
|
||||
public int executeUpdate(List<String> updateSqls) throws DbException {
|
||||
if (updateSqls == null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ret = 0;
|
||||
PersistenceManager manager = null;
|
||||
JdbcSession session = null;
|
||||
Connection connection = null;
|
||||
|
||||
try {
|
||||
manager = PersistenceManager.getInstance();
|
||||
session = manager.getJdbcSession();
|
||||
connection = session.getConnection(); // 获取实际的数据库连接
|
||||
|
||||
// 开始事务
|
||||
connection.setAutoCommit(false); // 禁用自动提交,手动管理事务
|
||||
|
||||
// 执行批量操作
|
||||
for (String sql : updateSqls) {
|
||||
session.addBatch(sql);
|
||||
}
|
||||
|
||||
// 执行批处理
|
||||
ret = session.executeBatch();
|
||||
|
||||
// 提交事务
|
||||
connection.commit(); // 批处理成功后提交事务
|
||||
|
||||
} catch (DbException e) {
|
||||
if (connection != null) {
|
||||
try {
|
||||
// 如果发生异常,回滚事务
|
||||
connection.rollback();
|
||||
} catch (SQLException rollbackEx) {
|
||||
// 记录回滚异常的详细信息
|
||||
throw new DbException("Error during transaction rollback", rollbackEx) {
|
||||
@Override
|
||||
public boolean isDataIntegrityViolation() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBadSQLGrammar() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
throw e; // 将原始异常抛出
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
if (connection != null) {
|
||||
try {
|
||||
// 恢复自动提交模式,确保不会影响其他操作
|
||||
connection.setAutoCommit(true);
|
||||
} catch (SQLException e) {
|
||||
// 忽略恢复自动提交时的异常
|
||||
}
|
||||
}
|
||||
if (manager != null) {
|
||||
manager.release();
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,327 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<actions>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gatherSave</name>
|
||||
<label>收票登记-保存</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGather4NCCSaveAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>fbm.gather.DzButton</name>
|
||||
<label>收票推送到账</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.DzButton</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>fbm.gather.gatherDelete</name>
|
||||
<label>收票登记-删除</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGather4NCCDeleteAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gatherQuery</name>
|
||||
<label>收票登记-列表查询</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGather4NCCQueryAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gatherPageQuery</name>
|
||||
<label>收票登记-分页查询</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGather4NCCPageQueryAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gatherPrint</name>
|
||||
<label>收票登记-打印</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGatherPrint4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gatherAfterEvent</name>
|
||||
<label>收票登记-编辑后事件</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGather4NCCAfterEventAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gatherBeforeEvent</name>
|
||||
<label>收票登记-编辑前事件</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGather4NCCBeforeEventAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gatherCardQuery</name>
|
||||
<label>收票登记-卡片查询</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGatherCardQuery4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gatherCommit</name>
|
||||
<label>收票登记-提交</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGatherCommit4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gatherUnCommit</name>
|
||||
<label>收票登记-收回</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGatherUnCommit4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gatherVoucher</name>
|
||||
<label>收票登记-制证</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGather4NCCMkVoucherAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gatherUnVoucher</name>
|
||||
<label>收票登记-取消制证</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGather4NCCUnVoucherAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.linkquerysf</name>
|
||||
<label>收票登记-联查收付款单</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.FbmLQuerySFBillAction4NCC</clazz>
|
||||
</action>
|
||||
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gatherReceive</name>
|
||||
<label>收票登记-签收</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGatherRecieve4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gatherReceiveCancel</name>
|
||||
<label>收票登记-取消签收</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGatherRecieveCancel4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gatherReceiveReject</name>
|
||||
<label>收票登记-拒签</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGatherRefuseSign4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gatherElcBillQuery</name>
|
||||
<label>收票登记-待签收/已签收票据查询</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGatherReceivedElcBill4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gatherCopy</name>
|
||||
<label>收票登记-复制</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGather4NCCCopyAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gatherCollectionSettle</name>
|
||||
<label>收票登记-关联收款结算单(弃用)</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGatherCollectionSettle4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gatherCreateGather</name>
|
||||
<label>收票登记-生成收票登记</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGatherCreateGather4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.queryOther</name>
|
||||
<label>收票登记-其他查询</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGatherOtherQueryAction</clazz>
|
||||
</action>
|
||||
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.voucherLink</name>
|
||||
<label>收票登记-凭证反联查</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherNCCVoucherLinkAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.palnLink</name>
|
||||
<label>收票登记-预算反联查</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherNCCNtbLinkAction</clazz>
|
||||
</action>
|
||||
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.bankRegister</name>
|
||||
<label>收票登记-银行登记</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGatherBankRegisterAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.disabled</name>
|
||||
<label>收票登记-作废</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherDisable4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.cancelDisabled</name>
|
||||
<label>收票登记-取消作废</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherCancelDisable4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.quickservice</name>
|
||||
<label>收票登记-快捷业务数据组装</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherQuickservice4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.quickdiscount</name>
|
||||
<label>收票登记-快捷贴现</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherQuickDiscount4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.quickdiscountapp</name>
|
||||
<label>收票登记-快捷贴现申请</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherQuickDiscountApply4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.quickendore</name>
|
||||
<label>收票登记-快捷背书</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherQuickEndore4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.quickconsignbank</name>
|
||||
<label>收票登记-快捷托收</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherQuickConsign4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.quickimpawn</name>
|
||||
<label>收票登记-快捷质押</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherQuickImpawn4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.circulate</name>
|
||||
<label>收票登记-联查票据流转信息</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherLinkCirculate4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.circulateprint</name>
|
||||
<label>票据流转信息-打印</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillCirculatePrint4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.quickServiceAfterEvent</name>
|
||||
<label>快捷业务-编辑后事件</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGatherQuick4NCCAfterEventAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gatheringBill</name>
|
||||
<label>收票登记-关联收款单</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherBusiAR4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.recbill</name>
|
||||
<label>收票登记-关联收款结算单</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherRecbill4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.commissionGathering</name>
|
||||
<label>收票登记-关联委托收款单</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatheringConfig4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.pdfImport</name>
|
||||
<label>收票登记-PDF导入</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.BillGather4NCCPDFImportAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.bankkeeping</name>
|
||||
<label>收票登记-关联银行托管</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherBankKeeping4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.bankbacking</name>
|
||||
<label>收票登记-关联银行领用</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherBankBacking4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.endoring</name>
|
||||
<label>收票登记-关联背书办理</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherEndoring4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.discountapplying</name>
|
||||
<label>收票登记-关联贴现申请</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherDiscountApplying4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.discounting</name>
|
||||
<label>收票登记-关联贴现办理</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherDiscounting4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.consignbanking</name>
|
||||
<label>收票登记-关联银行托收</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherConsignBanking4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.consignbanking</name>
|
||||
<label>收票登记-关联银行托收</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherConsignBanking4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.impawning</name>
|
||||
<label>收票登记-关联票据质押</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherImpawning4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.rreturning</name>
|
||||
<label>收票登记-关联应收票据退票</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherRreturning4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gathernontransablecancell</name>
|
||||
<label>收票登记-不得转让撤销</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherNonTransableCancel4NCCAction</clazz>
|
||||
</action>
|
||||
|
||||
<action>
|
||||
<name>fbm.gather.gatherrecallnontranstablecancell</name>
|
||||
<label>收票登记-撤回不得转让撤销</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherRecallNonTransableCancel4NCCAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>fbm.gather.printcirculate</name>
|
||||
<label>收票登记-票据流转正反面打印(正序)</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherBatchPrintCirculate4NCCAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>fbm.gather.printcirculatedesc</name>
|
||||
<label>收票登记-票据流转正反面打印(倒序)</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherBatchPrintCirculateDESC4NCCAction</clazz>
|
||||
</action>
|
||||
<action>
|
||||
<name>fbm.gather.batchdowncirculate</name>
|
||||
<label>收票登记-批量下载票据流转信息</label>
|
||||
<clazz>nccloud.web.fbm.fbm.gather.action.GatherBatchDownloadCirculate4NCCAction</clazz>
|
||||
</action>
|
||||
</actions>
|
|
@ -0,0 +1,61 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<authorizes>
|
||||
<authorize>
|
||||
<appcode>36180RBR,36180RBR_APPR,36180ET,36180ET_APPR,36180BCI,36180BBS</appcode>
|
||||
<actions>
|
||||
<action>fbm.gather.gatherSave</action>
|
||||
<action>fbm.gather.gatherDelete</action>
|
||||
<action>fbm.gather.gatherQuery</action>
|
||||
<action>fbm.gather.gatherPageQuery</action>
|
||||
<action>fbm.gather.gatherPrint</action>
|
||||
<action>fbm.gather.gatherAfterEvent</action>
|
||||
<action>fbm.gather.gatherBeforeEvent</action>
|
||||
<action>fbm.gather.gatherCardQuery</action>
|
||||
<action>fbm.gather.gatherCommit</action>
|
||||
<action>fbm.gather.gatherUnCommit</action>
|
||||
<action>fbm.gather.gatherVoucher</action>
|
||||
<action>fbm.gather.gatherUnVoucher</action>
|
||||
<action>fbm.gather.gatherReceive</action>
|
||||
<action>fbm.gather.gatherReceiveCancel</action>
|
||||
<action>fbm.gather.gatherReceiveReject</action>
|
||||
<action>fbm.gather.gatherElcBillQuery</action>
|
||||
<action>fbm.gather.gatherCopy</action>
|
||||
<action>fbm.gather.gatherCollectionSettle</action>
|
||||
<action>fbm.gather.gatherCreateGather</action>
|
||||
<action>fbm.gather.linkquerysf</action>
|
||||
<action>fbm.gather.queryOther</action>
|
||||
<action>fbm.gather.voucherLink</action>
|
||||
<action>fbm.gather.palnLink</action>
|
||||
<action>fbm.gather.bankRegister</action>
|
||||
<action>fbm.gather.disabled</action>
|
||||
<action>fbm.gather.cancelDisabled</action>
|
||||
<action>fbm.gather.quickservice</action>
|
||||
<action>fbm.gather.quickdiscount</action>
|
||||
<action>fbm.gather.quickdiscountapp</action>
|
||||
<action>fbm.gather.quickendore</action>
|
||||
<action>fbm.gather.quickconsignbank</action>
|
||||
<action>fbm.gather.quickimpawn</action>
|
||||
<action>fbm.gather.circulate</action>
|
||||
<action>fbm.gather.circulateprint</action>
|
||||
<action>fbm.gather.quickServiceAfterEvent</action>
|
||||
<action>fbm.gather.gatheringBill</action>
|
||||
<action>fbm.gather.recbill</action>
|
||||
<action>fbm.gather.commissionGathering</action>
|
||||
<action>fbm.gather.pdfImport</action>
|
||||
<action>fbm.gather.bankkeeping</action>
|
||||
<action>fbm.gather.bankbacking</action>
|
||||
<action>fbm.gather.endoring</action>
|
||||
<action>fbm.gather.discountapplying</action>
|
||||
<action>fbm.gather.discounting</action>
|
||||
<action>fbm.gather.consignbanking</action>
|
||||
<action>fbm.gather.impawning</action>
|
||||
<action>fbm.gather.rreturning</action>
|
||||
<action>fbm.gather.gathernontransablecancell</action>
|
||||
<action>fbm.gather.gatherrecallnontranstablecancell</action>
|
||||
<action>fbm.gather.printcirculate</action>
|
||||
<action>fbm.gather.printcirculatedesc</action>
|
||||
<action>fbm.gather.batchdowncirculate</action>
|
||||
<action>fbm.gather.DzButton</action>
|
||||
</actions>
|
||||
</authorize>
|
||||
</authorizes>
|
Loading…
Reference in New Issue