|
|
@@ -626,8 +626,7 @@ public class ivtOrderController {
|
|
|
sql = sql.substring(0, sql.length() - 1) + ")";
|
|
|
List<RowMap> costList = DBSql.getMaps(sql, Arrays.stream(serviceArr).toArray());
|
|
|
|
|
|
- if (costList.isEmpty())
|
|
|
- return ResponseObject.newErrResponse("没有找到对应的合同产品");
|
|
|
+ if (costList.isEmpty()) return ResponseObject.newErrResponse("没有找到对应的合同产品");
|
|
|
|
|
|
|
|
|
String costIds = costList.stream().map(cost -> cost.getString("ID")).collect(Collectors.joining(","));
|
|
|
@@ -685,8 +684,7 @@ public class ivtOrderController {
|
|
|
for (RowMap service : services) {
|
|
|
|
|
|
String orderId = service.getString("ORDER_ID");
|
|
|
-
|
|
|
- PaymentPlanService.getInstance().createPaymentPlan(uc, orderId);
|
|
|
+ PaymentPlanService.getInstance().createPaymentPlan(uc, orderId, null);
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -1011,6 +1009,32 @@ public class ivtOrderController {
|
|
|
return ResponseObject.newOkResponse();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据服务ID重新生成采购计划
|
|
|
+ * @param uc
|
|
|
+ * @param serviceId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Mapping("com.awspaas.user.apps.donenow_ivt.ivt_createPaymentPlanByServiceId")
|
|
|
+ public ResponseObject createPaymentPlanByServiceId(UserContext uc, String serviceId) {
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(serviceId)) return ResponseObject.newErrResponse("服务ID不能为空");
|
|
|
+
|
|
|
+ String orderId = DBSql.getString("select ORDER_ID from BO_EU_DNIVT_ORDER_PRODUCT where CONTRACT_SERVICE_ID=?", new Object[]{serviceId});
|
|
|
+ if (StringUtils.isBlank(orderId)) return ResponseObject.newErrResponse("请创建采购订单!");
|
|
|
+
|
|
|
+ if (DBSql.getInt("select count(1) as cnt from BO_EU_DNIVT_ORDER_PAYMENT_PLAN where ORDER_ID = ? and CONTRACT_SERVICE_ID=? AND PAY_AMOUNT is NOT null AND PAY_AMOUNT<>0", new Object[]{orderId, serviceId}) > 0) {
|
|
|
+ return ResponseObject.newErrResponse("付款计划已经开始付款,不能重新生成");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (DBSql.getInt("select count(1) as cnt from BO_EU_DNIVT_ORDER_PAYMENT_PLAN where ORDER_ID = ? and CONTRACT_SERVICE_ID=? ", new Object[]{orderId, serviceId}) == 0) {
|
|
|
+ return ResponseObject.newErrResponse("请创建采购订单!");
|
|
|
+ }
|
|
|
+
|
|
|
+ PaymentPlanService.getInstance().createPaymentPlan(uc, orderId, serviceId);
|
|
|
+
|
|
|
+ return ResponseObject.newOkResponse();
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 创建付款计划
|
|
|
@@ -1074,7 +1098,7 @@ public class ivtOrderController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- PaymentPlanService.getInstance().createPaymentPlan(uc, orderId);
|
|
|
+ PaymentPlanService.getInstance().createPaymentPlan(uc, orderId, null);
|
|
|
|
|
|
//检查 是否创建成功
|
|
|
if (DBSql.getInt("select count(1) CNT from BO_EU_DNIVT_ORDER_PAYMENT_PLAN where ORDER_ID=?", new Object[]{orderId}) == 0)
|
|
|
@@ -1132,8 +1156,7 @@ public class ivtOrderController {
|
|
|
|
|
|
List<RowMap> list = DBSql.getMaps("select * from BO_EU_DNIVT_PAY_REQUEST_DETAIL where BINDID=?", new Object[]{requestBindidId});
|
|
|
|
|
|
- if (list.isEmpty())
|
|
|
- return ResponseObject.newOkResponse();
|
|
|
+ if (list.isEmpty()) return ResponseObject.newOkResponse();
|
|
|
|
|
|
for (RowMap detail : list) {
|
|
|
String PAYMENT_PLAN_ID = detail.getString("PAYMENT_PLAN_ID");
|
|
|
@@ -1188,8 +1211,7 @@ public class ivtOrderController {
|
|
|
*/
|
|
|
@Mapping("com.awspaas.user.apps.donenow_ivt.ivt_reactivate_pu")
|
|
|
public ResponseObject reactivate_pu(UserContext uc, String bindId) {
|
|
|
- if (StringUtils.isBlank(bindId))
|
|
|
- return ResponseObject.newErrResponse("参数错误");
|
|
|
+ if (StringUtils.isBlank(bindId)) return ResponseObject.newErrResponse("参数错误");
|
|
|
if (SDK.getProcessAPI().isEndById(bindId)) {
|
|
|
|
|
|
//未进行 过接收才能 复活
|