예제 #1
0
  /** 全部取消------------------------------------------------------------------- */
  public String rollSignQuality() {
    User loginUser = getCurrentUser();

    if (loginUser == null) {
      this.setMsg("用户登陆已过期,请重新登陆!!!");
      logger.info("用户登陆已过期,请重新登陆!!!");
      // return and list
      return shutdown();
    }

    String[] ids = (String[]) ActionContext.getContext().getParameters().get("user_ids");
    if (ids != null && ids.length > 0) {
      for (String idStr : ids) {
        Long id = Long.parseLong(idStr);
        WorkPlaceQuality selected = workPlaceQualityBiz.getEntityById(WorkPlaceQuality.class, id);

        selected.setStatus(WebConstants.REPORT_STATUS_6);

        selected.setSignDate(UtilTools.getCurrentTime());

        selected.setSignName(loginUser.getName());

        workPlaceQualityBiz.saveOrUpdateEntity(selected);
      }
      this.setMsg("成功取消签发(所有)选择!!!");
      logger.info("成功取消签发(所有)选择!!!");
    }
    if (wplaceQualityId != null) {
      return editwPlaceQuality();
    }
    return listWplaceQualitys();
  }
예제 #2
0
  /**
   * 1111 受理提交----------------------------------------------------------------
   *
   * @return
   */
  public String slSingnUp() {

    WorkPlaceQuality fq =
        workPlaceQualityBiz.getEntityById(WorkPlaceQuality.class, workPlaceQuality.getId());
    fq.setStatus(WebConstants.REPORT_STATUS_3); // 提交状态
    workPlaceQualityBiz.saveOrUpdateEntity(fq);
    wplaceQualityId = fq.getId();
    // return listFoodQualitys();
    return editwPlaceQuality();
  }
예제 #3
0
  /**
   * 作业场所受理 删除
   *
   * @return
   */
  public String deleteWorkQuality() {
    User loginUser = getCurrentUser();

    if (loginUser == null) {
      this.setMsg("用户登陆已过期,请重新登陆!!!");
      logger.info("用户登陆已过期,请重新登陆!!!");
      // return and list
      return shutdown();
    }
    String[] ids = (String[]) ActionContext.getContext().getParameters().get("user_ids");
    if (ids != null && ids.length > 0) {
      for (String idStr : ids) {
        Long id = Long.parseLong(idStr);
        WorkPlaceQuality selected = workPlaceQualityBiz.getEntityById(WorkPlaceQuality.class, id);

        if (loginUser.getName().equals(selected.getAcceptName())) {
          if (selected.getStatus() < 3) {
            selected.setDel_flag(true);
            workPlaceQualityBiz.saveOrUpdateEntity(selected);
            NumberCode newCode = new NumberCode();
            newCode.setQualityNum(WebConstants.CATEGORY_QUALITY_ZYC);
            newCode.setShnum(selected.getRecordNum());
            numberCodeBiz.saveOrUpdateEntity(newCode);
          } else {
            this.setMsg("已提交,不能删除!!!");
            if (wplaceQualityId != null) {
              return shutdown();
            }
            return listWplaceQualitys();
          }
        } else {
          this.setMsg("不是你受理的,不能删除!!!");
          if (wplaceQualityId != null) {
            return shutdown();
          }
          return listWplaceQualitys();
        }
      }
      this.setMsg("成功删除(所有)选择!!!");
      logger.info("成功删除(所有)选择!!!");
    }
    if (wplaceQualityId != null) {
      return shutdown();
    }
    return listWplaceQualitys();
  }
예제 #4
0
  /** 提交填报-------------------------------------------------------------------- */
  public String fillQuality() {
    User loginUser = getCurrentUser();

    if (loginUser == null) {
      this.setMsg("用户登陆已过期,请重新登陆!!!");
      logger.info("用户登陆已过期,请重新登陆!!!");
      // return and list
      return shutdown();
    }
    String[] ids = (String[]) ActionContext.getContext().getParameters().get("user_ids");
    if (ids != null && ids.length > 0) {
      for (String idStr : ids) {
        Long id = Long.parseLong(idStr);
        WorkPlaceQuality selected = workPlaceQualityBiz.getEntityById(WorkPlaceQuality.class, id);

        selected.setStatus(WebConstants.REPORT_STATUS_5);

        selected.setFillDate(UtilTools.getCurrentTime());

        selected.setFillName(loginUser.getName());
        libs = workPlaceSampleBiz.getLib(selected);
        WorkPlaceEvalResult wpevalResult = selected.getWorkPlaceEvalResult();
        StandardLibray sl = null;
        if (libs != null && libs.size() > 0) {
          sl = libs.get(0);
          wpevalResult.setEvalRemark("经检测,报告书中的样品符合" + sl.getSlib_code() + sl.getName() + "的要求");
        }

        workPlaceQualityBiz.saveOrUpdateEntity(selected);
      }
      this.setMsg("成功填报(所有)选择!!!");
      logger.info("成功填报(所有)选择!!!");
    }
    if (wplaceQualityId != null) {
      return editwPlaceQuality();
    }
    return listWplaceQualitys();
  }
예제 #5
0
  /**
   * 受理保存 修改
   *
   * @return
   */
  public String saveOrupdateWork() {

    User loginUser = getCurrentUser();
    if (loginUser == null) {
      this.setMsg("用户登陆已过期,请重新登陆!!!");
      logger.info("用户登陆已过期,请重新登陆!!!");
      // return list
      return shutdown();
    }
    String area = null;
    if (!UtilTools.isEmpty(town)) {
      area = town; // + "," + street;
      workPlaceQuality.setArea(area);
    }

    WorkPlaceQuality wpDB = null;
    WorkPlaceEvalResult weDB = null;
    // Integer qId = Integer.parseInt(qualityId);
    if (workPlaceQuality != null) {
      // add new
      String slnumber = workPlaceQuality.getNumber_code() + year + slcode;
      String shnumber = year + shnumbercode + shcode;
      workPlaceQuality.setAcceptNum(slnumber);
      workPlaceQuality.setRecordNum(shnumber);
      List<WorkPlaceQuality> cqList =
          workPlaceQualityBiz.getEntitiesByTwoColumn(
              WorkPlaceQuality.class, "acceptNum", slnumber, "del_flag", false);

      if (workPlaceQuality != null && workPlaceQuality.getId() == null) {
        workPlaceQuality.setStatus(WebConstants.REPORT_STATUS_2);
        if (cqList != null && cqList.size() > 0) {
          this.setMsg("受理编号已存在");
          return editwPlaceQuality();
        }
        if (!UtilTools.isEmpty(acceptDate)) {
          workPlaceQuality.setAcceptDate(UtilTools.getStingTime(acceptDate));
          workPlaceQuality.setSampleDate(UtilTools.getStingTime(acceptDate));
        } else {
          workPlaceQuality.setAcceptDate(UtilTools.getCurrentTime());
          workPlaceQuality.setSampleDate(UtilTools.getCurrentTime());
        }

        Quality qlity =
            qualityBiz.getEntityById(Quality.class, workPlaceQuality.getQuality().getId());
        if (aibefore != null) {
          workPlaceQuality.setAibefore(aibefore.toString());
        }
        workPlaceQuality.setQuality(qlity);
        workPlaceQuality.setAcceptName(loginUser.getName());

        workPlaceEvalResult = new WorkPlaceEvalResult();
        workPlaceQuality.setWorkPlaceEvalResult(workPlaceEvalResult);
        workPlaceEvalResult.setWorkPlaceQuality(workPlaceQuality);

        workPlaceQuality = workPlaceQualityBiz.saveOrUpdateEntity(workPlaceQuality);
        wplaceQualityId = workPlaceQuality.getId();
        if (aibefore != null) {
          workPlaceSampleBiz.addSamples(workPlaceQuality, aibefore);
        }
        List<NumberCode> numList =
            numberCodeBiz.getEntitiesByTwoColumn(
                NumberCode.class,
                "qualityNum",
                WebConstants.CATEGORY_QUALITY_ZYC,
                "shnum",
                workPlaceQuality.getRecordNum());
        if (numList != null && numList.size() > 0) {
          numberCodeBiz.deleteEntity(NumberCode.class, numList.get(0).getId());
        }
        return editwPlaceQuality();

      }
      // update exist
      else if (workPlaceQuality != null && workPlaceQuality.getId() != null) {
        if (cqList != null && cqList.size() > 1) {
          this.setMsg("受理编号已存在");
          return editwPlaceQuality();
        }
        wpDB = workPlaceQualityBiz.getEntityById(WorkPlaceQuality.class, workPlaceQuality.getId());
        String accUserName = wpDB.getAcceptName();
        // Template template = templateBiz.getEntityById(Template.class,
        // templateId);
        if (!loginUser.getName().equals(accUserName)) {
          this.setMsg("对不起,不是自已受理的样品不能修改");
          return editwPlaceQuality();
        }

        if (workPlaceQuality.getAcceptDate() != null) {
          wpDB.setAcceptDate(workPlaceQuality.getAcceptDate());
        }

        wpDB.setAddress(workPlaceQuality.getAddress());
        if (!UtilTools.isEmpty(workPlaceQuality.getArea())) {
          wpDB.setArea(workPlaceQuality.getArea());
        }

        Quality qlity =
            qualityBiz.getEntityById(Quality.class, workPlaceQuality.getQuality().getId());

        wpDB.setCheckUnit(workPlaceQuality.getCheckUnit());
        // wpDB.setHbcategory(kitchenQuality.getHbcategory());

        wpDB.setQuality(qlity);

        wpDB.setNumber_code(workPlaceQuality.getNumber_code()); // 检查

        // wpDB.setQuality(kitchenQuality.getQuality());
        wpDB.setRecordNum(workPlaceQuality.getRecordNum());
        // wpDB.setSamplNum(kitchenQuality.getSamplNum());

        wpDB.setSamplSource(workPlaceQuality.getSamplSource());
        wpDB.setSamplUnit(workPlaceQuality.getSamplUnit());

        wpDB.setStandNum(workPlaceQuality.getStandNum());
        wpDB.setStatus(WebConstants.REPORT_STATUS_2); // 修改

        // weDB = wpDB.getWorkPlaceEvalResult();
        // weDB.setModifiedDate(UtilTools.getCurrentTime());
        // weDB.setModifiedName(loginUser.getName());
        // weDB.setEvalRemark(workPlaceEvalResult.getEvalRemark());
        // weDB.setSensAppr(workPlaceEvalResult.getSensAppr());
        // weDB.setSensEval(workPlaceEvalResult.getSensEval());
        // feDB.setSensRemark(kitchenEvalResult.getSensRemark());
        // weDB.setSensSugg(workPlaceEvalResult.getSensSugg());
        if (aibefore != null) {
          wpDB.setAibefore(aibefore.toString());
        }
        // wpDB.setWorkPlaceEvalResult(weDB);
        workPlaceQuality = workPlaceQualityBiz.saveOrUpdateEntity(wpDB);
        wplaceQualityId = workPlaceQuality.getId();
        if (aibefore != null) {
          workPlaceSampleBiz.addSamples(workPlaceQuality, aibefore);
        }
        this.setMsg("修改作业场所样品成功!");
        logger.info("修改作业场所样品成功!");
        return editwPlaceQuality();
      }
    } else {
      ActionContext.getContext().getSession().remove("wplaceQualityId");
      return editwPlaceQuality();
    }

    // return and list
    return editwPlaceQuality();
  }