From 4db1f914e0c51bed219e0608401f211e3406ece1 Mon Sep 17 00:00:00 2001 From: zhangjun Date: Sun, 12 Jul 2020 18:00:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9app=E7=AB=AF=E5=8F=91?= =?UTF-8?q?=E9=82=AE=E5=AF=84=E5=8F=91=E8=B5=B7=E7=A9=BA=E5=90=88=E5=90=8C?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E6=8F=90=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/BusinessApplyStartServiceImpl.java | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) 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 495c314ad..b5c976ef1 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 @@ -27,6 +27,7 @@ import com.amarsoft.are.jbo.BizObjectManager; import com.amarsoft.are.jbo.JBOFactory; 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.DateUtil; import com.base.util.MultipartDataUtil; @@ -289,24 +290,31 @@ public class BusinessApplyStartServiceImpl implements BusinessApplyStartService System.out.println("======================================="); fieldMap = (Map) testMap.get("fieldMap"); MailArchiveBO bo = new MailArchiveBO(fieldMap,curUser, tx); - bo.businessAppStart(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("taskNo", bo.getSerialNo()); - body.put("serialNo", bo.getSerialNo()); - ReturnMapUtil.setReturnMap(body, - RestfullConstant.baseProperty.get("success").toString(), - "发起成功"); + String userid = fieldMap.get("userid".toLowerCase()) == null ? "": fieldMap.get("userid".toLowerCase()).toString(); // 用户id + ASUser asUser = new ASUser(userid); + String sql = "select case when count(1)>0 then 'true' else 'false' end res 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' or lfmi.ALLHANDOVERSTATUS = 'none') and not exists (select 1 from LB_FILE_MAILARCHIVING_INFO_TEMP lfmit where lfmit.contract_id = lci.id and lfmit.is_flowing = '0') AND EXISTS (SELECT 1 FROM FLOW_OBJECT fo,FLOW_BUSSINESS_OBJECT fbo WHERE fo.objectno=fbo.flow_unid AND fo.phaseno='1000' AND fo.flowno='MortgageFileFlow' AND fbo.contract_id=lci.id) and lci.PROJECT_DEPT = '"+asUser.getOrgID()+"'"; + String res = sqlca.getString(sql); + if("false".equals(res)){ + ReturnMapUtil.setReturnMap(null,RestfullConstant.baseProperty.get("fail").toString(),"没有需要邮寄的合同!!!"); }else{ - ReturnMapUtil.setReturnMap(null, - RestfullConstant.baseProperty.get("fail").toString(), - sReturnInfo); + bo.businessAppStart(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("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(); }