|
@@ -17,6 +17,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.sql.*;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -187,9 +188,9 @@ public class PayServiceImpl implements PayService {
|
|
|
//收款联行银行号 付款银行联行号 收款银行实例 企业编码 付款银行简称 付款账户名称 付款开户行 付款银行账号 直连方式
|
|
|
ydClient.operateData(YDParam.builder().formInstId(map.get("formInstId").toString())
|
|
|
.updateFormDataJson(JSON.toJSONString(UtilMap.map("textField_lr7tmvy9, textField_lr7tmvy8, textField_lr7tmvya, textField_lmhln79w, " +
|
|
|
- "textField_li1y52z5, textField_li1y52z4, selectField_li1y52z3, textField_li1y52z2",
|
|
|
+ "selectField_lqalbx97, textField_li1y52z5, textField_li1y52z4, selectField_li1y52z3, textField_li1y52z2",
|
|
|
skmap.get("selectField_lof5vr7d"),fkmap.get("textField_li1w31c4"),mapList1.get(0).get("formInstanceId"),fkmap.get("textField_lmhln79w"),
|
|
|
- fkmap.get("textField_li1w31c1"),fkmap.get("textField_li1w31c3"),fkmap.get("textField_li1w31c2"),fkmap.get("selectField_li1w31c8"))))
|
|
|
+ fkmap.get("textField_li1w31c5"),fkmap.get("textField_li1w31c1"),fkmap.get("textField_li1w31c3"),fkmap.get("textField_li1w31c2"),fkmap.get("selectField_li1w31c8"))))
|
|
|
.build(), YDConf.FORM_OPERATION.update);
|
|
|
}
|
|
|
|
|
@@ -226,7 +227,7 @@ public class PayServiceImpl implements PayService {
|
|
|
log.info("formData{}",formData);
|
|
|
|
|
|
//数据来源明源云则回写
|
|
|
- if ("明源ERP".equals(formData.get("selectField_lqalbx96")) && "稠州银行金华6486".equals(formData.get("textField_loe5he57"))){
|
|
|
+ if ("明源ERP".equals(formData.get("selectField_lqalbx96"))){
|
|
|
//付款成功的更新Erp状态
|
|
|
String erpRsp = UtilHttp.doPost("https://gateway.dslink.net.cn/api/webhook/E185908E63CF407B911FA870642A39A5",
|
|
|
null,null, UtilMap.map("PayGUID, BillCode",formData.get("textField_li1y52yh"),""),new HashMap());
|
|
@@ -243,4 +244,65 @@ public class PayServiceImpl implements PayService {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ //配置客户的sqlist URL
|
|
|
+ private static final String SQLITE_URL ="jdbc:sqlite:D:/JavaSpace/fbi.dll";
|
|
|
+ /**
|
|
|
+ * 同步凭证状态
|
|
|
+ * @param formInstId
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void synProofStatus(String formInstId) {
|
|
|
+
|
|
|
+ //查询凭证实例ID 状态:1成功 2失败 失败信息
|
|
|
+ Connection connection = null;
|
|
|
+ Statement statement = null;
|
|
|
+ try {
|
|
|
+ // 加载SQLite的JDBC驱动程序
|
|
|
+ Class.forName("org.sqlite.JDBC");
|
|
|
+ //创建链接
|
|
|
+ connection = DriverManager.getConnection(SQLITE_URL);
|
|
|
+ // 创建Statement对象
|
|
|
+ statement = connection.createStatement();
|
|
|
+ // 执行查询语句
|
|
|
+ String sql = "SELECT * FROM rest_drrecord WHERE instance_id ='" + formInstId + "' ";
|
|
|
+ ResultSet rowsAffected = statement.executeQuery(sql);
|
|
|
+
|
|
|
+ if ("1".equals(rowsAffected.getString("status"))){
|
|
|
+ // 更新付款申请单凭证状态
|
|
|
+ ydClient.operateData(YDParam.builder()
|
|
|
+ .formInstanceId(formInstId)
|
|
|
+ .updateFormDataJson(JSON.toJSONString(UtilMap.map("textField_lof4wiqt, textField_lof4wiqr","凭证已生成",rowsAffected.getString("record_id"))))
|
|
|
+ .build(), YDConf.FORM_OPERATION.update);
|
|
|
+ log.info("凭证已生成:{}",rowsAffected.getString("note"));
|
|
|
+ }else if ("2".equals(rowsAffected.getString("status"))){
|
|
|
+ // 更新付款申请单凭证状态
|
|
|
+ ydClient.operateData(YDParam.builder()
|
|
|
+ .formInstanceId(formInstId)
|
|
|
+ .updateFormDataJson(JSON.toJSONString(UtilMap.map("textField_lof4wiqt","凭证生成失败")))
|
|
|
+ .build(), YDConf.FORM_OPERATION.update);
|
|
|
+ log.info("凭证生成失败:{}",rowsAffected.getString("note"));
|
|
|
+ }else{
|
|
|
+ log.info("未查询到对应凭证数据!");
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (ClassNotFoundException | SQLException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ // 关闭连接和资源
|
|
|
+ try {
|
|
|
+ if (statement != null) {
|
|
|
+ statement.close();
|
|
|
+ }
|
|
|
+ if (connection != null) {
|
|
|
+ connection.close();
|
|
|
+ }
|
|
|
+ } catch (SQLException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|