|
@@ -248,6 +248,7 @@ public class PayServiceImpl implements PayService {
|
|
|
|
|
|
//配置客户的sqlist URL
|
|
|
private static final String SQLITE_URL ="jdbc:sqlite:D:/JavaSpace/fbi.dll";
|
|
|
+// private static final String SQLITE_URL ="jdbc:sqlite:D:/FASTBI/FBI/fbi.dll";
|
|
|
/**
|
|
|
* 同步凭证状态
|
|
|
* @param formInstId
|
|
@@ -266,27 +267,41 @@ public class PayServiceImpl implements PayService {
|
|
|
// 创建Statement对象
|
|
|
statement = connection.createStatement();
|
|
|
// 执行查询语句
|
|
|
- String sql = "SELECT * FROM rest_drrecord WHERE instance_id ='" + formInstId + "' ";
|
|
|
+ String sql = "SELECT * FROM rest_drrecord WHERE instance_id ='" + formInstId + "' and status = 1 order by id desc";
|
|
|
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"));
|
|
|
+ log.info("rowsAffected:{}",rowsAffected);
|
|
|
+
|
|
|
+ if (rowsAffected.next()) {
|
|
|
+ int status = rowsAffected.getInt("status");
|
|
|
+ String flag = rowsAffected.getString("flag");
|
|
|
+
|
|
|
+ log.info("flag:{}",flag);
|
|
|
+ log.info("status:{}",status);
|
|
|
+
|
|
|
+ if (status == 1){
|
|
|
+ // 更新付款申请单凭证状态
|
|
|
+ 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"));
|
|
|
+ }
|
|
|
+ //条件查询是成功的、所以不会有状态2
|
|
|
+// else if (status == 2){
|
|
|
+// // 更新付款申请单凭证状态
|
|
|
+// 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("未查询到对应生成凭证成功数据!");
|
|
|
+// }
|
|
|
}else{
|
|
|
- log.info("未查询到对应凭证数据!");
|
|
|
+ log.info("未查询到对应生成凭证成功数据!");
|
|
|
}
|
|
|
-
|
|
|
} catch (ClassNotFoundException | SQLException e) {
|
|
|
e.printStackTrace();
|
|
|
} finally {
|