From 6506c141dec2b41178a3dbf03987dc9f9d632e7e Mon Sep 17 00:00:00 2001 From: tangfutang Date: Tue, 9 Jun 2020 19:34:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A9=E6=9C=BA=E5=90=88=E5=90=8C=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E5=92=8C=E5=90=88=E5=90=8C=E6=92=A4=E9=94=80app?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../start/bo/MakeContractBusinessBO.java | 107 ++++++++++++++++++ .../BusinessApplyStartController.java | 40 ++++++- .../service/BusinessApplyStartService.java | 7 +- .../impl/BusinessApplyStartServiceImpl.java | 62 ++++++++++ .../controller/ContractMakeController.java | 38 +++++++ .../make/service/ContractMakeService.java | 8 ++ .../service/impl/ContractMakeServiceImpl.java | 48 ++++++++ 7 files changed, 308 insertions(+), 2 deletions(-) diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/bo/MakeContractBusinessBO.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/bo/MakeContractBusinessBO.java index 7a913690e..524a1c3f0 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/bo/MakeContractBusinessBO.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/bo/MakeContractBusinessBO.java @@ -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 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 map = new HashMap(); + 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 map = new HashMap(); + 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; + } + } diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/controller/BusinessApplyStartController.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/controller/BusinessApplyStartController.java index c1a693fc8..2f6a57191 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/controller/BusinessApplyStartController.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/controller/BusinessApplyStartController.java @@ -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 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 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 diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/BusinessApplyStartService.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/BusinessApplyStartService.java index d9da42119..1d2694dbb 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/BusinessApplyStartService.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/BusinessApplyStartService.java @@ -26,7 +26,12 @@ public interface BusinessApplyStartService { Map makeContractStart(@Context HttpServletRequest request, @Context HttpServletResponse response, @Context JBOTransaction tx, @Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception; - + Map changeContractStart(@Context HttpServletRequest request, + @Context HttpServletResponse response, @Context JBOTransaction tx, + @Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception; + Map repealContractStart(@Context HttpServletRequest request, + @Context HttpServletResponse response, @Context JBOTransaction tx, + @Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception; Map PaymentStart(@Context HttpServletRequest request, @Context HttpServletResponse response, @Context JBOTransaction tx, @Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception; diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/impl/BusinessApplyStartServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/impl/BusinessApplyStartServiceImpl.java index 0dfbea54e..841e7539e 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/impl/BusinessApplyStartServiceImpl.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/impl/BusinessApplyStartServiceImpl.java @@ -309,5 +309,67 @@ public class BusinessApplyStartServiceImpl implements BusinessApplyStartService return ReturnMapUtil.getReturnMap(); } + @Override + public Map changeContractStart(HttpServletRequest request, + HttpServletResponse response, JBOTransaction tx, Transaction sqlca, + ReturnMapUtil ReturnMapUtil) throws Exception { + Map testMap = (Map) MultipartDataUtil + .readRequestParam(request, "UTF-8"); + System.out.println("=============合同变更申请参数================================"); + System.out.println(testMap.toString()); + System.out.println("======================================="); + fieldMap = (Map) testMap.get("fieldMap"); + MakeContractBusinessBO bo = new MakeContractBusinessBO(fieldMap, tx,sqlca); + bo.businessAppChange(tx); + tx.commit(); + String sReturnInfo = bo.getMsg(); + if (sReturnInfo.startsWith("success")) { + Map body = new HashMap(); + 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 repealContractStart(HttpServletRequest request, + HttpServletResponse response, JBOTransaction tx, Transaction sqlca, + ReturnMapUtil ReturnMapUtil) throws Exception { + Map testMap = (Map) MultipartDataUtil + .readRequestParam(request, "UTF-8"); + System.out.println("=============合同撤销申请参数================================"); + System.out.println(testMap.toString()); + System.out.println("======================================="); + fieldMap = (Map) testMap.get("fieldMap"); + MakeContractBusinessBO bo = new MakeContractBusinessBO(fieldMap, tx,sqlca); + bo.businessAppRepeal(tx); + tx.commit(); + String sReturnInfo = bo.getMsg(); + if (sReturnInfo.startsWith("success")) { + Map body = new HashMap(); + 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(); + } } diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/contract/make/controller/ContractMakeController.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/contract/make/controller/ContractMakeController.java index 0ddb31622..3e34a997e 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/contract/make/controller/ContractMakeController.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/contract/make/controller/ContractMakeController.java @@ -44,6 +44,44 @@ public class ContractMakeController { return ReturnMapUtil.rollback(e); } } + /** + * 获取合同变更列表数据 + */ + @Path("/get/contractChangeNumber") + @POST + public Map 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 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); + } + } /** diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/contract/make/service/ContractMakeService.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/contract/make/service/ContractMakeService.java index d8c9a2999..e960bbf51 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/contract/make/service/ContractMakeService.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/contract/make/service/ContractMakeService.java @@ -15,6 +15,14 @@ public interface ContractMakeService { @Context HttpServletResponse response, @Context JBOTransaction tx, @Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception; + Map getContractChangeNumber(@Context HttpServletRequest request, + @Context HttpServletResponse response, @Context JBOTransaction tx, + @Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) + throws Exception; + Map getContractRepealnumber(@Context HttpServletRequest request, + @Context HttpServletResponse response, @Context JBOTransaction tx, + @Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) + throws Exception; Map getTemplateNumber(@Context HttpServletRequest request, @Context HttpServletResponse response, @Context JBOTransaction tx, @Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/contract/make/service/impl/ContractMakeServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/contract/make/service/impl/ContractMakeServiceImpl.java index f5d26eb81..a66ea429e 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/contract/make/service/impl/ContractMakeServiceImpl.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/contract/make/service/impl/ContractMakeServiceImpl.java @@ -368,4 +368,52 @@ public class ContractMakeServiceImpl implements ContractMakeService{ }; return message; } + @Override + public Map getContractChangeNumber( + HttpServletRequest request, HttpServletResponse response, + JBOTransaction tx, Transaction sqlca, ReturnMapUtil ReturnMapUtil) + throws Exception { + Map testMap = (Map) MultipartDataUtil + .readRequestParam(request, "UTF-8"); + fieldMap = (Map) testMap.get("fieldMap"); // 参数 + String userId = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString(); + Map body = new HashMap(); + 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> dataList = DataOperatorUtil.getDataBySql(sql); + body.put("datas", dataList); + ReturnMapUtil.setReturnMap(body, + RestfullConstant.baseProperty.get("success").toString(), ""); + return ReturnMapUtil.getReturnMap(); + } + @Override + public Map getContractRepealnumber( + HttpServletRequest request, HttpServletResponse response, + JBOTransaction tx, Transaction sqlca, ReturnMapUtil ReturnMapUtil) + throws Exception { + Map testMap = (Map) MultipartDataUtil + .readRequestParam(request, "UTF-8"); + fieldMap = (Map) testMap.get("fieldMap"); // 参数 + String userId = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString(); + Map body = new HashMap(); + 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> dataList = DataOperatorUtil.getDataBySql(sql); + body.put("datas", dataList); + ReturnMapUtil.setReturnMap(body, + RestfullConstant.baseProperty.get("success").toString(), ""); + return ReturnMapUtil.getReturnMap(); + } }