|
@@ -1,6 +1,7 @@
|
|
|
package com.awspaas.user.apps.donenow_ctt.controller;
|
|
package com.awspaas.user.apps.donenow_ctt.controller;
|
|
|
|
|
|
|
|
import com.actionsoft.bpms.bo.engine.BO;
|
|
import com.actionsoft.bpms.bo.engine.BO;
|
|
|
|
|
+import com.actionsoft.bpms.bpmn.engine.model.run.delegate.ProcessInstance;
|
|
|
import com.actionsoft.bpms.commons.database.RowMap;
|
|
import com.actionsoft.bpms.commons.database.RowMap;
|
|
|
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
|
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
|
|
import com.actionsoft.bpms.server.UserContext;
|
|
import com.actionsoft.bpms.server.UserContext;
|
|
@@ -14,6 +15,8 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
|
|
import java.sql.Connection;
|
|
import java.sql.Connection;
|
|
|
import java.sql.SQLException;
|
|
import java.sql.SQLException;
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -189,8 +192,7 @@ public class contractCreateController {
|
|
|
*/
|
|
*/
|
|
|
@Mapping(value = "com.awspaas.user.apps.donenow_ctt.contract_cost_delete", desc = "合同产品删除")
|
|
@Mapping(value = "com.awspaas.user.apps.donenow_ctt.contract_cost_delete", desc = "合同产品删除")
|
|
|
public ResponseObject deleteContractProduct(UserContext uc, String costIds) {
|
|
public ResponseObject deleteContractProduct(UserContext uc, String costIds) {
|
|
|
- if (StringUtils.isBlank(costIds))
|
|
|
|
|
- return ResponseObject.newErrResponse("请选择要删除的条目!");
|
|
|
|
|
|
|
+ if (StringUtils.isBlank(costIds)) return ResponseObject.newErrResponse("请选择要删除的条目!");
|
|
|
|
|
|
|
|
String[] costIdArr = costIds.split(",");
|
|
String[] costIdArr = costIds.split(",");
|
|
|
String sql = "SELECT * FROM BO_EU_DNCTT_CONTRACT_COST WHERE ID IN(";
|
|
String sql = "SELECT * FROM BO_EU_DNCTT_CONTRACT_COST WHERE ID IN(";
|
|
@@ -216,7 +218,21 @@ public class contractCreateController {
|
|
|
return ResponseObject.newErrResponse(StringUtils.join(errorList, "、") + ",无法删除!");
|
|
return ResponseObject.newErrResponse(StringUtils.join(errorList, "、") + ",无法删除!");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- String delSql = "DELETE FROM BO_EU_DNCTT_CONTRACT_COST WHERE ID IN(";
|
|
|
|
|
|
|
+ for (RowMap cost : costList) {
|
|
|
|
|
+ SDK.getProcessAPI().deleteById(cost.getString("BINDID"), uc.getUID());
|
|
|
|
|
+ }
|
|
|
|
|
+ return ResponseObject.newOkResponse();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 删除合同服务
|
|
|
|
|
+ */
|
|
|
|
|
+ @Mapping(value = "com.awspaas.user.apps.donenow_ctt.contract_service_delete", desc = "删除合同服务")
|
|
|
|
|
+ public ResponseObject deleteContractService(UserContext uc, String serviceIds) {
|
|
|
|
|
+ String[] costIdArr = serviceIds.split(",");
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ String delSql = "DELETE FROM BO_EU_DNCTT_CONTRACT_SERVICE WHERE ID IN(";
|
|
|
for (int i = 0; costIdArr.length > i; i++) {
|
|
for (int i = 0; costIdArr.length > i; i++) {
|
|
|
delSql += "?,";
|
|
delSql += "?,";
|
|
|
}
|
|
}
|
|
@@ -226,5 +242,36 @@ public class contractCreateController {
|
|
|
return ResponseObject.newOkResponse();
|
|
return ResponseObject.newOkResponse();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 编辑合同服务
|
|
|
|
|
+ */
|
|
|
|
|
+ @Mapping(value = "com.awspaas.user.apps.donenow_ctt.contract_service_edit")
|
|
|
|
|
+ public ResponseObject editContractService(UserContext uc, String serviceId) {
|
|
|
|
|
+
|
|
|
|
|
+ RowMap contractService = DBSql.getMap("SELECT * FROM BO_EU_DNCTT_CONTRACT_SERVICE WHERE ID=?", new Object[]{serviceId});
|
|
|
|
|
+ contractService.remove("ID");
|
|
|
|
|
+ contractService.remove("BINDID");
|
|
|
|
|
+
|
|
|
|
|
+ ProcessInstance contractInstance = SDK.getProcessAPI().createBOProcessInstance("obj_e4b0c7ae587c406b808f3a4785f05e23", uc.getUID(), "服务调整-" + contractService.getString("NAME") + "-" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")));
|
|
|
|
|
+
|
|
|
|
|
+ BO editBO = new BO();
|
|
|
|
|
+ editBO.setAll(contractService);
|
|
|
|
|
+ editBO.set("CONTRACT_SERVICE_ID", serviceId);
|
|
|
|
|
+ editBO.set("OLD_UNIT_PRICE", contractService.get("UNIT_PRICE"));
|
|
|
|
|
+ editBO.set("OLD_TOTAL_PRICE", contractService.get("TOTAL_PRICE"));
|
|
|
|
|
+ editBO.set("OLD_UNIT_COST", contractService.get("UNIT_COST"));
|
|
|
|
|
+ editBO.set("OLD_QUANTITY", contractService.get("QUANTITY"));
|
|
|
|
|
+ editBO.set("OLD_TOTAL_COST", contractService.get("TOTAL_COST"));
|
|
|
|
|
+ editBO.setBindId(contractInstance.getId());
|
|
|
|
|
+
|
|
|
|
|
+ SDK.getBOAPI().create("BO_EU_DNCTT_CONTRACT_SERVICE_EDIT", editBO, contractInstance, uc);
|
|
|
|
|
+
|
|
|
|
|
+ String processUrl = SDK.getFormAPI().getFormURL(SDK.getPortalAPI().getPortalUrl(), uc.getSessionId(), contractInstance.getId(), null, 1, null, editBO.getId(), null, true);
|
|
|
|
|
+
|
|
|
|
|
+ ResponseObject responseObject = ResponseObject.newOkResponse();
|
|
|
|
|
+ responseObject.setData(processUrl);
|
|
|
|
|
+
|
|
|
|
|
+ return responseObject;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|