From 176499463b61a7c425b7c61fa1ef075e55e6d474 Mon Sep 17 00:00:00 2001 From: zhangjun Date: Fri, 19 Jun 2020 22:46:25 +0800 Subject: [PATCH] =?UTF-8?q?APP=E9=82=AE=E5=AF=84=E5=BD=92=E6=A1=A3?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=8E=B7=E5=8F=96=E6=8E=A5=E5=8F=A3&?= =?UTF-8?q?=E5=BD=92=E6=A1=A3=E5=8F=91=E8=B5=B7=E6=B5=81=E7=A8=8B=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/start/bo/ChangeBusinessBO.java | 9 +++- .../BusinessApplyStartController.java | 2 +- .../start/initiate/MailArchiveBO.java | 34 +++++++++++--- .../impl/BusinessApplyStartServiceImpl.java | 1 - .../center/service/ApplyArchiveService.java | 18 ++++++++ .../service/impl/ApplyArchiveServiceImpl.java | 46 +++++++++++++++++++ .../controller/ApplyChangeController.java | 26 ++++++++++- 7 files changed, 124 insertions(+), 12 deletions(-) create mode 100644 src_app_fresh/apx/com/amarsoft/als/user/change/center/service/ApplyArchiveService.java create mode 100644 src_app_fresh/apx/com/amarsoft/als/user/change/center/service/impl/ApplyArchiveServiceImpl.java diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/bo/ChangeBusinessBO.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/bo/ChangeBusinessBO.java index e40981ecc..66027837d 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/bo/ChangeBusinessBO.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/bo/ChangeBusinessBO.java @@ -53,6 +53,7 @@ public class ChangeBusinessBO implements Serializable { private String operationType; private Map params; + public void setParam(Map fieldMap, String param, Object obj) { obj = fieldMap.get(param.toLowerCase()) == null ? null : fieldMap.get( param.toLowerCase()).toString(); @@ -60,7 +61,7 @@ public class ChangeBusinessBO implements Serializable { public boolean checkKeyField() { if (StringX.isSpace(applyType)) { - msg = "申请编号不能为空!"; + msg = "流程实例号不能为空!"; return false; } if (StringX.isSpace(carAttributes)) { @@ -128,6 +129,7 @@ public class ChangeBusinessBO implements Serializable { this.businessType = RestfullConstant.baseProperty.get("BUSINESS_TYPE") == null ? "" : RestfullConstant.baseProperty.get("BUSINESS_TYPE").toString(); // 业务类型 + this.ProjectName = FlowKey+"-"+CUSTOMERNAME; //更具产品id获取对应的主体信息 @@ -247,7 +249,6 @@ public class ChangeBusinessBO implements Serializable { + LB_DOCATTRIBUTE.CLASS_NAME + " A) " + "AND R.ObjectType='BusinessApplyFlow' and R.proj_id=:projid " + "AND o.DOC_NATURE='01' " + "ORDER BY SERIAL_NUM"; -// R.ObjectType='BusinessApplyFlow' and R.proj_id=:projid BizObjectManager libraryManage = JBOFactory .getBizObjectManager(LB_DOCLIBRARY.CLASS_NAME); BizObjectQuery query = libraryManage.createQuery(sql).setParameter( @@ -442,4 +443,8 @@ public class ChangeBusinessBO implements Serializable { haveCommission = haveCommission; } + public static long getSerialversionuid() { + return serialVersionUID; + } + } 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 37d13cfc4..01afc3d68 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 @@ -52,7 +52,7 @@ public class BusinessApplyStartController { return ReturnMapUtil.rollback(e); } } - + //业务变更和撤销发起 @Path("/changeApply/start") @POST public Map changeApplyStart(@Context HttpServletRequest request, diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/initiate/MailArchiveBO.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/initiate/MailArchiveBO.java index 86ead8b7b..841b5269e 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/initiate/MailArchiveBO.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/initiate/MailArchiveBO.java @@ -34,6 +34,7 @@ public class MailArchiveBO implements Serializable{ private String ProjectName; private String ContractNumber; private String ContractId; + private String FlowKey; private String customertype; private String msg; @@ -41,7 +42,6 @@ public class MailArchiveBO implements Serializable{ private String fixedFlowParam; private String objectNo; private String serialNo; - public void setParam(Map fieldMap, String param, Object obj) { obj = fieldMap.get(param.toLowerCase()) == null ? null : fieldMap.get( param.toLowerCase()).toString(); @@ -61,6 +61,10 @@ public class MailArchiveBO implements Serializable{ return false; } if (StringX.isSpace(ContractNumber)) { + msg = "合同id不能为空!"; + return false; + } + if (StringX.isSpace(FlowKey)) { msg = "互斥id不能为空!"; return false; } @@ -71,14 +75,16 @@ public class MailArchiveBO implements Serializable{ public MailArchiveBO(Map fieldMap, JBOTransaction tx) throws Exception { this.ApplyType = fieldMap.get("ApplyType".toLowerCase()) == null ? "" : fieldMap.get("ApplyType".toLowerCase()).toString(); // 流程实例号 - this.ProjectName = fieldMap.get("projectName".toLowerCase()) == null ? "" - : fieldMap.get("projectName".toLowerCase()).toString(); // 项目名称 + this.ProjectName = fieldMap.get("project_name".toLowerCase()) == null ? "" + : fieldMap.get("project_name".toLowerCase()).toString(); // 项目名称 this.customertype = fieldMap.get("customertype".toLowerCase()) == null ? "" : fieldMap.get("customertype".toLowerCase()).toString(); // 租赁类型 this.CurUserID = fieldMap.get("userid".toLowerCase()) == null ? "" : fieldMap.get("userid".toLowerCase()).toString(); // 客户id this.ContractNumber = fieldMap.get("CONTRACT_NUMBER".toLowerCase()) == null ? "" - : fieldMap.get("CONTRACT_NUMBER".toLowerCase()).toString(); // 邮寄号 + : fieldMap.get("CONTRACT_NUMBER".toLowerCase()).toString(); // 合同号 + this.FlowKey = fieldMap.get("serialNumber".toLowerCase()) == null ? "" + : fieldMap.get("serialNumber".toLowerCase()).toString(); // 邮寄号 } @@ -98,6 +104,8 @@ public class MailArchiveBO implements Serializable{ action.setCustomertype(customertype); map.put("CurUserID", CurUserID); action.setCurUserID(CurUserID); + map.put("FlowKey", FlowKey); + action.setFlowKey(FlowKey); JSONObject jsonObject = JSONObject.fromObject(map); this.fixedFlowParam = jsonObject.toString(); @@ -185,7 +193,6 @@ public class MailArchiveBO implements Serializable{ if (msg.equals("")) { return true; } - // msg += "业务申请 提交风险预警报告"; return false; } @@ -323,7 +330,22 @@ public class MailArchiveBO implements Serializable{ public void setContractId(String contractId) { ContractId = contractId; } - + + public String getContractNumber() { + return ContractNumber; + } + + public void setContractNumber(String contractNumber) { + ContractNumber = contractNumber; + } + + 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/service/impl/BusinessApplyStartServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/impl/BusinessApplyStartServiceImpl.java index 5fcf08216..21cba0740 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 @@ -295,7 +295,6 @@ public class BusinessApplyStartServiceImpl implements BusinessApplyStartService Map body = new HashMap(); body.put("flowUnid", bo.getObjectNo()); body.put("objectNo", bo.getObjectNo()); - //body.put("projectId", bo.getProjectId()); body.put("taskNo", bo.getSerialNo()); body.put("serialNo", bo.getSerialNo()); ReturnMapUtil.setReturnMap(body, diff --git a/src_app_fresh/apx/com/amarsoft/als/user/change/center/service/ApplyArchiveService.java b/src_app_fresh/apx/com/amarsoft/als/user/change/center/service/ApplyArchiveService.java new file mode 100644 index 000000000..e1d3f29ac --- /dev/null +++ b/src_app_fresh/apx/com/amarsoft/als/user/change/center/service/ApplyArchiveService.java @@ -0,0 +1,18 @@ +package apx.com.amarsoft.als.user.change.center.service; + +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.core.Context; + +import com.amarsoft.are.jbo.JBOTransaction; +import com.amarsoft.awe.util.Transaction; +import com.base.util.ReturnMapUtil; + +public interface ApplyArchiveService { + Map applyArchive(@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/user/change/center/service/impl/ApplyArchiveServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/user/change/center/service/impl/ApplyArchiveServiceImpl.java new file mode 100644 index 000000000..d1f4af97a --- /dev/null +++ b/src_app_fresh/apx/com/amarsoft/als/user/change/center/service/impl/ApplyArchiveServiceImpl.java @@ -0,0 +1,46 @@ +package apx.com.amarsoft.als.user.change.center.service.impl; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.amarsoft.are.jbo.JBOTransaction; +import com.amarsoft.awe.util.Transaction; +import com.amarsoft.context.ASUser; +import com.base.constant.RestfullConstant; +import com.base.util.MultipartDataUtil; +import com.base.util.ReturnMapUtil; +import com.tenwa.comm.util.jboutil.DataOperatorUtil; + +import apx.com.amarsoft.als.user.change.center.service.ApplyArchiveService; +//APP获取邮寄归档 +public class ApplyArchiveServiceImpl implements ApplyArchiveService{ + + private Map fieldMap; + + @SuppressWarnings("unchecked") + @Override + public Map applyArchive(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 flowunid = fieldMap.get("flowunid") == null ? "" : fieldMap.get("flowunid").toString(); + String userId = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString(); + ASUser asUser = new ASUser(userId); + String orgID = asUser.getOrgID(); + String sql = ""; + sql = "select lci.distributor_id,lci.id,lci.contract_no,lci.contract_number,lci.contract_status,lci.product_name,lci.product_id,lci.project_id,lci.project_date,lci.project_name,lci.rent_method,lci.leas_form,lci.project_dept,lci.project_manage,lci.end_date,lci.flowunid,lci.is_print,lci.CONTRACT_INVOICE_STATUS,lci.businesstype,lci.car_type,lci.lending_type,lci.inputname,lci.inputtel,lci.havecommission,lci.is_netcar,lci.is_operation,lci.is_affiliated,lci.is_operation_qualification,lci.transportcertid,lci.affiliatedname,lci.netcertname,lci.legalpersonname,lci.affiliateddate,lci.affiliatedenddate,lci.registeredmoney,lci.affiliatedactualaddress,lci.affiliatedaddress,lci.transportdate,lci.netcertid,lci.legalpersonid,lci.has_gps,lci.subjectid,lci.subjectname,lfmi.archiving_person,lfmi.archiving_time,lfmi.allstatus,lfmi.expcompany,lfmi.expnumber,lfmi.allhandoverstatus from lb_contract_info lci left join lb_file_mailarchiving_info lfmi on lfmi.CONTRACT_ID = lci.ID where (lfmi.ALLHANDOVERSTATUS is null or lfmi.ALLHANDOVERSTATUS = 'part') and not exists (select 1 from LB_FILE_MAILARCHIVING_INFO_TEMP lfmit where lfmit.contract_id = lci.id and lfmit.is_flowing = '0') and lci.PROJECT_DEPT = '"+orgID+"' "; + List> dataList = DataOperatorUtil.getDataBySql(sql); + + Map body = new HashMap(); + body.put("datas", dataList); + ReturnMapUtil.setReturnMap(body,RestfullConstant.baseProperty.get("success").toString(), ""); + return ReturnMapUtil.getReturnMap(); + + } + +} diff --git a/src_app_fresh/apx/com/amarsoft/als/user/change/initiate/controller/ApplyChangeController.java b/src_app_fresh/apx/com/amarsoft/als/user/change/initiate/controller/ApplyChangeController.java index 928062adb..71edf4c45 100644 --- a/src_app_fresh/apx/com/amarsoft/als/user/change/initiate/controller/ApplyChangeController.java +++ b/src_app_fresh/apx/com/amarsoft/als/user/change/initiate/controller/ApplyChangeController.java @@ -13,10 +13,12 @@ import com.amarsoft.are.jbo.JBOTransaction; import com.amarsoft.awe.util.Transaction; import com.base.util.ReturnMapUtil; +import apx.com.amarsoft.als.user.change.center.service.ApplyArchiveService; import apx.com.amarsoft.als.user.change.center.service.ApplyBusinessUndoService; import apx.com.amarsoft.als.user.change.center.service.ApplyLicensePlateService; import apx.com.amarsoft.als.user.change.center.service.ApplyOverseeService; import apx.com.amarsoft.als.user.change.center.service.ApplyPaymentService; +import apx.com.amarsoft.als.user.change.center.service.impl.ApplyArchiveServiceImpl; import apx.com.amarsoft.als.user.change.center.service.impl.ApplyBusinessUndoServiceImpl; import apx.com.amarsoft.als.user.change.center.service.impl.ApplyLicensePlateServiceImpl; import apx.com.amarsoft.als.user.change.center.service.impl.ApplyOverseeServiceImpl; @@ -35,7 +37,7 @@ import apx.com.amarsoft.als.user.change.mail.service.ApplyMailService; import apx.com.amarsoft.als.user.change.mail.service.impl.ApplyMailServiceImpl; @Path("/change") public class ApplyChangeController { - //业务变更发起 + //获取业务变更数据 @Path("/business/change") @POST public Map applyChange(@Context HttpServletRequest request, @@ -358,6 +360,26 @@ public class ApplyChangeController { } catch (Exception e) { return ReturnMapUtil.rollback(e); } - } + } + + + //获取邮寄归档数据信息 + @Path("/business/Archive") + @POST + public Map applyArchive(@Context HttpServletRequest request, + @Context HttpServletResponse response, @Context JBOTransaction tx, + @Context Transaction sqlca) throws Exception { + ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca); + ARE.getLog().info( + "[CONTROLLER] ApplyChangeController run ................."); + ARE.getLog().info("[Path] /change/business/Archive" + " run ................."); + + ApplyArchiveService service = new ApplyArchiveServiceImpl(); + try { + return service.applyArchive(request, response, tx, sqlca, ReturnMapUtil); + } catch (Exception e) { + return ReturnMapUtil.rollback(e); + } + } }