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(); }