Esempio n. 1
0
 /**
  * 设置一些值
  *
  * @param entity
  */
 public void setSomething(BusinessContactLetter entity) {
   UserInfo userInfo = super.getUser();
   String documentNumber = commonOrderCodeService.generatorLetterCode(userInfo.getRegionId());
   if (entity.getId() == null) {
     entity.setDocumentNumber("");
   } else {
     StringBuffer issuerUserNames = new StringBuffer();
     String name = "";
     entity.setDocumentNumber(documentNumber);
     if (StringUtils.isNotBlank(entity.getAuditUserId())) {
       entity.setAuditUserName(
           userinfoService.getUserInfoByPersonId(entity.getAuditUserId()).getUserName());
     }
     if (StringUtils.isNotBlank(entity.getIssuerAreaUserIds())) {
       String[] ids = entity.getIssuerAreaUserIds().split(",");
       for (int i = 0; i < ids.length; i++) {
         if (userinfoService.getUserInfoByPersonId(ids[i]) != null) {
           name = userinfoService.getUserInfoByPersonId(ids[i]).getUserName();
         }
         if (name != null) {
           issuerUserNames.append(name).append(";");
         }
       }
     }
     entity.setIssuerAreaUserNames(issuerUserNames.toString());
   }
 }
Esempio n. 2
0
 /**
  * 保存/提交业务联系函
  *
  * @return
  * @throws Exception
  */
 public String save() throws Exception {
   @SuppressWarnings("unchecked")
   List<FileItem> files = (List<FileItem>) super.sessionManager.get("FILES");
   String ids = super.getRequest().getParameter("idff");
   UserInfo userInfo = this.getUser();
   String isSend = this.getRequest().getParameter("entity.isSend");
   String isemegency = this.getRequest().getParameter("entity.isemegency");
   if (null == entity) {
     entity = new BusinessContactLetter();
   }
   if (StringUtils.isBlank(isemegency)) {
     isemegency = "0";
   }
   if (StringUtils.isNotBlank(ids)) {
     entity.setId(ids);
   }
   entity.setDocumentNumber(commonOrderCodeService.generatorLetterCode(userInfo.getRegionId()));
   entity.setIsSend(isSend); // 是否发送短信
   entity.setIsEmergency(isemegency); // 是否紧急
   String isneedCheck = this.getRequest().getParameter("isneedCheck");
   entity.setReleaseTime(new Date()); // 发布时间
   entity.setIsAudit(isneedCheck); // 是否需要审核
   String status = this.getRequest().getParameter("entity.status"); // 状态
   String auditUser = this.getRequest().getParameter("entity.auditUserId");
   if (StringUtils.isNotBlank(auditUser)) { // 如果选择了审核人员 那就要审核了。
     entity.setStatus(Constant4Bcl.WAITCHECK); // 待审核
   } else {
     entity.setStatus(Constant4Bcl.CHECKOFF); // 直接发布
   }
   if (status.equals("0")) {
     entity.setStatus("0"); // 如果点击保存 则依旧是保存处理
   }
   entity = businessContactletterservice.saveBusinessContactletter(entity, userInfo, files);
   boolean b = true;
   String retu = "queryList";
   if (entity != null) {
     b = true;
     retu = setSaveReturn(entity.getId(), b);
   }
   return retu;
 }