天机合同变更和合同撤销app接口

This commit is contained in:
tangfutang 2020-06-09 19:34:49 +08:00
parent 0f0057f530
commit 6506c141de
7 changed files with 308 additions and 2 deletions

View File

@ -25,6 +25,7 @@ import com.amarsoft.awe.util.Transaction;
import com.base.constant.RestfullConstant;
import com.base.util.JsonUtil;
import com.base.util.StringUtil;
import com.tenwa.flow.action.comm.BaseFlowStartAction;
import com.tenwa.lease.flow.contract.contractapproval.ContractApprovalStartAction;
public class MakeContractBusinessBO implements Serializable {
@ -47,6 +48,7 @@ public class MakeContractBusinessBO implements Serializable {
private String isNetCar;
private String gpsVendor;
private String operationType;
private String FlowKey;
private String msg;
private Map<String, String> params;
@ -151,6 +153,11 @@ public class MakeContractBusinessBO implements Serializable {
if( this.gpsVendor==null || this.gpsVendor.length()==0 ){
this.gpsVendor = "null";
}
this.FlowKey = fieldMap.get("flowkey".toLowerCase()) == null ? ""
: fieldMap.get("flowkey".toLowerCase()).toString(); //
this.ContractId = fieldMap.get("contractid".toLowerCase()) == null ? ""
: fieldMap.get("contractid".toLowerCase()).toString(); //
}
public void businessAppStart(JBOTransaction tx) throws Exception {
@ -203,7 +210,99 @@ public class MakeContractBusinessBO implements Serializable {
}
}
public void businessAppChange(JBOTransaction tx) throws Exception {
if (!checkKeyField()) // 校验非空字段
return;
Map<String, Object> map = new HashMap<String, Object>();
BaseFlowStartAction action = new BaseFlowStartAction();
map.put("ApplyType", ApplyType);
action.setApplyType(ApplyType);
map.put("CurUserID", CurUserID);
action.setCurUserID(CurUserID);
map.put("leasform", leasform);
action.setLeasform(leasform);
map.put("ProductId", ProductId);
action.setProductId(ProductId);
map.put("customertype", customertype);
action.setCustomertype(customertype);
map.put("carAttributes", carAttributes);
action.setCarAttributes(carAttributes);
map.put("ProjectName", ProjectName);
action.setProjectName(ProjectName);
map.put("ProjectId", ProjectId);
action.setProjectId(ProjectId);
action.setFlowKey(FlowKey);
map.put("FlowKey", FlowKey);
action.setContractId(ContractId);
map.put("ContractId", ContractId);
map.put("ProjectNo", ProjectNo);
map.put("sourcetype", "app");
map.put("SubjectId", SubjectId);
map.put("SubjectName", SubjectName);
map.put("signType", signType);
map.put("sealType", sealType);
map.put("isNetCar", isNetCar);
map.put("gpsVendor", gpsVendor);
map.put("operationType", operationType);
map.put("TempletNo", "LBChangeInfoTemp");
JSONObject jsonObject = JSONObject.fromObject(map);
this.fixedFlowParam = jsonObject.toString();
action.setFixedFlowParam(fixedFlowParam);
msg = action.initFLow(tx); // 定义流程中需要的参数
params = action.getFlowParam();
objectNo = params.get("FlowUnid");
ContractId = params.get("ProjectId");
if (msg.startsWith("success")) {
serialNo = msg.split("@")[1];
}
}
public void businessAppRepeal(JBOTransaction tx) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
BaseFlowStartAction action = new BaseFlowStartAction();
map.put("ApplyType", ApplyType);
action.setApplyType(ApplyType);
map.put("CurUserID", CurUserID);
action.setCurUserID(CurUserID);
map.put("leasform", leasform);
action.setLeasform(leasform);
map.put("ProductId", ProductId);
action.setProductId(ProductId);
map.put("customertype", customertype);
action.setCustomertype(customertype);
map.put("ProjectName", ProjectName);
action.setProjectName(ProjectName);
map.put("ProjectId", ProjectId);
action.setProjectId(ProjectId);
action.setFlowKey(FlowKey);
map.put("FlowKey", FlowKey);
action.setContractId(ContractId);
map.put("ContractId", ContractId);
map.put("carAttributes", carAttributes);
action.setCarAttributes(carAttributes);
map.put("sourcetype", "app");
JSONObject jsonObject = JSONObject.fromObject(map);
this.fixedFlowParam = jsonObject.toString();
action.setFixedFlowParam(fixedFlowParam);
msg = action.initFLow(tx); // 定义流程中需要的参数
params = action.getFlowParam();
objectNo = params.get("FlowUnid");
ContractId = params.get("ProjectId");
if (msg.startsWith("success")) {
serialNo = msg.split("@")[1];
}
}
@SuppressWarnings("unchecked")
public boolean checkDoc() throws JBOException {
BizObjectManager fboM = JBOFactory
@ -457,4 +556,12 @@ public class MakeContractBusinessBO implements Serializable {
this.gpsVendor = gpsVendor;
}
public String getFlowKey() {
return FlowKey;
}
public void setFlowKey(String flowKey) {
FlowKey = flowKey;
}
}

View File

@ -79,7 +79,7 @@ public class BusinessApplyStartController {
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
ARE.getLog().info(
"[CONTROLLER] BusinessApplyStartController run .................");
ARE.getLog().info("[Path] /apply/changeApply/start" + " run .................");
ARE.getLog().info("[Path] /apply/makeContract/start" + " run .................");
BusinessApplyStartService service = new BusinessApplyStartServiceImpl();
try {
@ -88,6 +88,44 @@ public class BusinessApplyStartController {
return ReturnMapUtil.rollback(e);
}
}
//ºÏͬ±ä¸ü
@Path("/changeContract/start")
@POST
public Map<String, Object> changeContractStart(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca) throws Exception {
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
ARE.getLog().info(
"[CONTROLLER] BusinessApplyStartController run .................");
ARE.getLog().info("[Path] /apply/changeContract/start" + " run .................");
BusinessApplyStartService service = new BusinessApplyStartServiceImpl();
try {
return service.changeContractStart(request, response, tx, sqlca, ReturnMapUtil);
} catch (Exception e) {
return ReturnMapUtil.rollback(e);
}
}
//ºÏͬ³·Ïú
@Path("/repealContract/start")
@POST
public Map<String, Object> repealContractStart(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca) throws Exception {
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
ARE.getLog().info(
"[CONTROLLER] BusinessApplyStartController run .................");
ARE.getLog().info("[Path] /apply/repealContract/start" + " run .................");
BusinessApplyStartService service = new BusinessApplyStartServiceImpl();
try {
return service.repealContractStart(request, response, tx, sqlca, ReturnMapUtil);
} catch (Exception e) {
return ReturnMapUtil.rollback(e);
}
}
//付款申请发起流程
@Path("/payment/start")
@POST

View File

@ -26,7 +26,12 @@ public interface BusinessApplyStartService {
Map<String, Object> makeContractStart(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception;
Map<String, Object> changeContractStart(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception;
Map<String, Object> repealContractStart(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception;
Map<String, Object> PaymentStart(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception;

View File

@ -309,5 +309,67 @@ public class BusinessApplyStartServiceImpl implements BusinessApplyStartService
return ReturnMapUtil.getReturnMap();
}
@Override
public Map<String, Object> changeContractStart(HttpServletRequest request,
HttpServletResponse response, JBOTransaction tx, Transaction sqlca,
ReturnMapUtil ReturnMapUtil) throws Exception {
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
.readRequestParam(request, "UTF-8");
System.out.println("=============合同变更申请参数================================");
System.out.println(testMap.toString());
System.out.println("=======================================");
fieldMap = (Map<String, Object>) testMap.get("fieldMap");
MakeContractBusinessBO bo = new MakeContractBusinessBO(fieldMap, tx,sqlca);
bo.businessAppChange(tx);
tx.commit();
String sReturnInfo = bo.getMsg();
if (sReturnInfo.startsWith("success")) {
Map<String, Object> body = new HashMap<String, Object>();
body.put("flowUnid", bo.getObjectNo());
body.put("objectNo", bo.getObjectNo());
body.put("contractId", bo.getContractId());
body.put("taskNo", bo.getSerialNo());
body.put("serialNo", bo.getSerialNo());
ReturnMapUtil.setReturnMap(body,
RestfullConstant.baseProperty.get("success").toString(),
"发起成功");
}else{
ReturnMapUtil.setReturnMap(null,
RestfullConstant.baseProperty.get("fail").toString(),
sReturnInfo);
}
return ReturnMapUtil.getReturnMap();
}
@Override
public Map<String, Object> repealContractStart(HttpServletRequest request,
HttpServletResponse response, JBOTransaction tx, Transaction sqlca,
ReturnMapUtil ReturnMapUtil) throws Exception {
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
.readRequestParam(request, "UTF-8");
System.out.println("=============合同撤销申请参数================================");
System.out.println(testMap.toString());
System.out.println("=======================================");
fieldMap = (Map<String, Object>) testMap.get("fieldMap");
MakeContractBusinessBO bo = new MakeContractBusinessBO(fieldMap, tx,sqlca);
bo.businessAppRepeal(tx);
tx.commit();
String sReturnInfo = bo.getMsg();
if (sReturnInfo.startsWith("success")) {
Map<String, Object> body = new HashMap<String, Object>();
body.put("flowUnid", bo.getObjectNo());
body.put("objectNo", bo.getObjectNo());
body.put("contractId", bo.getContractId());
body.put("taskNo", bo.getSerialNo());
body.put("serialNo", bo.getSerialNo());
ReturnMapUtil.setReturnMap(body,
RestfullConstant.baseProperty.get("success").toString(),
"发起成功");
}else{
ReturnMapUtil.setReturnMap(null,
RestfullConstant.baseProperty.get("fail").toString(),
sReturnInfo);
}
return ReturnMapUtil.getReturnMap();
}
}

View File

@ -44,6 +44,44 @@ public class ContractMakeController {
return ReturnMapUtil.rollback(e);
}
}
/**
* 获取合同变更列表数据
*/
@Path("/get/contractChangeNumber")
@POST
public Map<String, Object> getContractChangeNumber(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca) throws Exception {
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
ARE.getLog()
.info("[CONTROLLER] BusinessDataController run .................");
ARE.getLog().info(
"[Path] /contract/make/get/contractChangeNumber" + " run .................");
try {
return service.getContractChangeNumber(request, response, tx, sqlca, ReturnMapUtil);
} catch (Exception e) {
return ReturnMapUtil.rollback(e);
}
}
/**
* 获取合同撤销合同列表
*/
@Path("/get/contractRepealnumber")
@POST
public Map<String, Object> getContractRepealnumber(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca) throws Exception {
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
ARE.getLog()
.info("[CONTROLLER] BusinessDataController run .................");
ARE.getLog().info(
"[Path] /contract/make/get/contractRepealnumber" + " run .................");
try {
return service.getContractRepealnumber(request, response, tx, sqlca, ReturnMapUtil);
} catch (Exception e) {
return ReturnMapUtil.rollback(e);
}
}
/**

View File

@ -15,6 +15,14 @@ public interface ContractMakeService {
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
throws Exception;
Map<String, Object> getContractChangeNumber(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
throws Exception;
Map<String, Object> getContractRepealnumber(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
throws Exception;
Map<String, Object> getTemplateNumber(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context JBOTransaction tx,
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)

View File

@ -368,4 +368,52 @@ public class ContractMakeServiceImpl implements ContractMakeService{
};
return message;
}
@Override
public Map<String, Object> getContractChangeNumber(
HttpServletRequest request, HttpServletResponse response,
JBOTransaction tx, Transaction sqlca, ReturnMapUtil ReturnMapUtil)
throws Exception {
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
.readRequestParam(request, "UTF-8");
fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // ²ÎÊý
String userId = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
Map<String, Object> body = new HashMap<String, Object>();
ASUser asUser = new ASUser(userId);
String orgID = asUser.getOrgID();
String sql = "";
if("8006011".equals(orgID)){
sql = "SELECT lci.id as contractid,lult.project_id as projectid,lci.product_id,lci.contract_no flowkey,lci.contract_number,lci.project_name,ci.customername,getItemName('CertType',ci.certtype) certtype,ci.certid,getUserName(lci.project_manage) AS project_manage,getOrgLevelName(lci.project_dept) project_dept,ci.customertype,lci.leas_form,lpi.CAR_TYPE,lpi.IS_NETCAR,psl.operationType,psl.sealType,psl.signType,lci.subjectid,lci.subjectname,lci.inputorgid,lpi.project_no as project_no FROM LB_CONTRACT_INFO lci LEFT JOIN LB_PROJECT_INFO lpi ON lpi.id = lci.project_id LEFT JOIN LB_UNION_LESSEE lult ON lci.id=lult.contract_id LEFT JOIN CUSTOMER_INFO ci ON lult.customer_id=ci.customerid LEFT JOIN PRD_SPECIFIC_LIBRARY psl ON psl.productid = lpi.product_id WHERE lult.is_main='y' AND lci.businesstype='1' AND NOT EXISTS (SELECT 1 FROM LC_CALC_CONDITION_STATUS ccs WHERE ccs.contract_id=lci.id) AND contract_status='21' AND lci.inputorgid='"+orgID+"' ORDER BY lci.contract_number DESC";
}else{
sql="SELECT lci.id as contractid,lult.project_id as projectid,lci.product_id,lci.contract_no flowkey,lci.contract_number,lci.project_name,ci.customername,getItemName('CertType',ci.certtype) certtype,ci.certid,getUserName(lci.project_manage) AS project_manage,getOrgLevelName(lci.project_dept) project_dept,ci.customertype,lci.leas_form,lpi.CAR_TYPE,lpi.IS_NETCAR,psl.operationType,psl.sealType,psl.signType,lci.subjectid,lci.subjectname,lci.inputuserid,lpi.project_no as project_no FROM LB_CONTRACT_INFO lci LEFT JOIN LB_PROJECT_INFO lpi ON lpi.id = lci.project_id LEFT JOIN LB_UNION_LESSEE lult ON lci.id=lult.contract_id LEFT JOIN CUSTOMER_INFO ci ON lult.customer_id=ci.customerid LEFT JOIN PRD_SPECIFIC_LIBRARY psl ON psl.productid = lpi.product_id WHERE lult.is_main='y' AND lci.businesstype='1' AND NOT EXISTS (SELECT 1 FROM LC_CALC_CONDITION_STATUS ccs WHERE ccs.contract_id=lci.id) AND contract_status='21' AND lci.inputuserid='"+userId+"' ORDER BY lci.contract_number DESC ";
}
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
body.put("datas", dataList);
ReturnMapUtil.setReturnMap(body,
RestfullConstant.baseProperty.get("success").toString(), "");
return ReturnMapUtil.getReturnMap();
}
@Override
public Map<String, Object> getContractRepealnumber(
HttpServletRequest request, HttpServletResponse response,
JBOTransaction tx, Transaction sqlca, ReturnMapUtil ReturnMapUtil)
throws Exception {
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
.readRequestParam(request, "UTF-8");
fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // ²ÎÊý
String userId = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
Map<String, Object> body = new HashMap<String, Object>();
ASUser asUser = new ASUser(userId);
String orgID = asUser.getOrgID();
String sql = "";
if("8006011".equals(orgID)){
sql = "SELECT lci.id as contractid,lult.project_id as projectid ,lci.product_id,lci.contract_no FlowKey,lci.contract_number,lci.project_name,ci.customername,getItemName('CertType',ci.certtype) certtype,ci.certid,getUserName(lci.project_manage) as project_manage,getOrgLevelName(lci.project_dept) project_dept,ci.customertype,lci.car_type,lci.leas_form,lpi.project_no as project_no FROM LB_CONTRACT_INFO lci LEFT JOIN lb_project_info lpi ON lpi.id=lci.project_id LEFT JOIN LB_UNION_LESSEE lult on lci.id=lult.contract_id LEFT JOIN CUSTOMER_INFO ci on lult.customer_id=ci.customerid where lult.is_main='y' and lci.businesstype = '1' and not EXISTS (select 1 from LC_CALC_CONDITION_STATUS ccs where ccs.contract_id=lci.id) and contract_status='21' and lci.inputorgid='"+orgID+"' order by lci.contract_number desc";
}else{
sql="SELECT lci.id as contractid,lult.project_id as projectid, lci.product_id,lci.contract_no FlowKey,lci.contract_number,lci.project_name,ci.customername,getItemName('CertType',ci.certtype) certtype,ci.certid,getUserName(lci.project_manage) AS project_manage,getOrgLevelName(lci.project_dept) project_dept,ci.customertype,lci.car_type,lci.leas_form,lpi.project_no as project_no FROM LB_CONTRACT_INFO lci LEFT JOIN lb_project_info lpi ON lpi.id=lci.project_id LEFT JOIN LB_UNION_LESSEE lult ON lci.id=lult.contract_id LEFT JOIN CUSTOMER_INFO ci ON lult.customer_id=ci.customerid WHERE lult.is_main='y' AND lci.businesstype = '1' AND NOT EXISTS (SELECT 1 FROM LC_CALC_CONDITION_STATUS ccs WHERE ccs.contract_id=lci.id) AND contract_status='21' AND lci.PROJECT_MANAGE='"+userId+"' ORDER BY lci.contract_number DESC";
}
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
body.put("datas", dataList);
ReturnMapUtil.setReturnMap(body,
RestfullConstant.baseProperty.get("success").toString(), "");
return ReturnMapUtil.getReturnMap();
}
}