/**
  * 新建入口
  *
  * @return
  */
 public String newHead() {
   IUser tuser = UserThreadLocal.get();
   PTUserBO user = userUCC.getSingleById(tuser.getUserTid());
   Iterator<PTDeptBO> deptIte = deptUCC.getDeptByUserId(user.getTid()).iterator();
   // 如果head不为空,创建一个对象保存
   if (head == null) {
     head = new CzPgscZskwhCld();
     head.setNigaoren(String.valueOf(user.getTid()));
     head.setNigaorenxm(user.getUsername());
     head.setNgrq(new Date());
     head.setPgzz(0D);
     head.setZczmjz(0D);
     head.setZjfd(0D);
     head.setZjz(0D);
     head.setJzrzmjz(0D);
     head.setZczmyz(0D);
     head.setCldzt("0");
     if (deptIte.hasNext()) {
       PTDeptBO dept = deptIte.next();
       head.setNgbm(String.valueOf(dept.getRsvdNum1()));
       head.setNgbmmc(dept.getRsvdStr1());
     }
     head.setLxdh(user.getCellphone());
     head.setLssccs(0L);
     // 设置默认的办理部门为风险管理部
     head.setBlbm("风险管理部");
     head.setBlbmbh("11589");
     headService.newHead(head);
     request.setAttribute("headId", head.getId());
     request.getSession().setAttribute("zcczpgscclid", head.getId());
   }
   // request.setAttribute("head", head);
   request.setAttribute("user", user);
   return "tomodify";
 }
 // 查看审查意见
 public String editScyjQuery() {
   IUser tuser = UserThreadLocal.get();
   PTUserBO user = userUCC.getSingleById(tuser.getUserTid());
   radioValue = headService.findRadioValue(pgscYj.getCldId(), String.valueOf(user.getTid()));
   request.setAttribute("user", user);
   return "editScyj";
 }
 // 新增意见
 public String insertScjl() {
   try {
     IUser tuser = UserThreadLocal.get();
     PTUserBO user = userUCC.getSingleById(tuser.getUserTid());
     headService.addScjl(pgscYj, user);
     response.getWriter().print("SUCCESS");
   } catch (Exception e) {
     if (log.isDebugEnabled()) {
       log.debug(e.getStackTrace());
     }
   }
   return null;
 }
 // 保存审查意见
 public String submitScyj() {
   try {
     IUser tuser = UserThreadLocal.get();
     String adviceType = request.getParameter("adviceType");
     headService.submitScyj(pgscYj, String.valueOf(tuser.getUserTid()), adviceType);
     response.getWriter().print("SUCCESS");
   } catch (Exception e) {
     if (log.isDebugEnabled()) {
       log.debug(e.getStackTrace());
     }
   }
   return null;
 }
 // 取得处理单对应的审查意见Json
 public String getMyScyjJson() {
   try {
     IUser tuser = UserThreadLocal.get();
     String returnJson =
         headService.getMyScyjJson(pgscYj.getCldId(), String.valueOf(tuser.getUserTid()));
     response.setCharacterEncoding("UTF-8");
     response.getWriter().print(returnJson);
   } catch (Exception e) {
     if (log.isDebugEnabled()) {
       log.debug(e.getStackTrace());
     }
   }
   return null;
 }
Beispiel #6
0
 /**
  * 批量变动
  *
  * @return
  */
 public void operateChanageBatch(
     String changeway,
     String changereason,
     String changeValue,
     String bodyIds,
     String headId,
     String isProportion) {
   if (bodyIds != null && bodyIds.length() > 0) {
     if (bodyIds.startsWith(",")) {
       bodyIds = bodyIds.substring(1);
     }
     String ids[] = bodyIds.split(",");
     this.deleteRecord(ids);
     for (int i = 0; i < ids.length; i++) {
       LcCardtemp body = this.findLcCardtempById(ids[i]);
       String cardId = body.getCardinfoid();
       Cardinfo card = this.findCardinfoByCardId(cardId);
       Individualtree tree = this.getIndividualtreeById(changeway);
       String nodevalue = "";
       if (tree != null) {
         nodevalue = tree.getNodevalue();
       }
       Recordhistory record = new Recordhistory();
       if ("1".equals(nodevalue.trim())) { // 原币原值增加
         if ("true".equals(isProportion)) {
           double d = card.getYbyz() * Double.valueOf(changeValue) / 100.0 + card.getYbyz();
           body.setYbyz(d);
         } else {
           body.setYbyz(card.getYbyz() + Double.parseDouble(changeValue));
         }
         body.setJvalue(body.getYbyz() - card.getLjzj());
         body.setJevalue(body.getYbyz() - card.getLjzj());
         record.setName("ybyz");
         record.setBefore(String.valueOf(card.getYbyz()));
       } else if ("2".equals(nodevalue.trim())) { // 原币原值减少
         if ("true".equals(isProportion)) {
           double d = card.getYbyz() - card.getYbyz() * Double.valueOf(changeValue) / 100.0;
           body.setYbyz(d);
         } else {
           body.setYbyz(card.getYbyz() - Double.parseDouble(changeValue));
         }
         body.setJvalue(body.getYbyz() - card.getLjzj());
         body.setJevalue(body.getYbyz() - card.getLjzj());
         record.setName("ybyz");
         record.setBefore(String.valueOf(card.getYbyz()));
       } else if ("3".equals(nodevalue.trim())) { // 管理部门
         body.setGlbm(changeValue);
         record.setName("glbm");
         record.setBefore(String.valueOf(card.getGlbm()));
       } else if ("4".equals(nodevalue.trim())) { // 使用部门
         body.setUsepartment(changeValue);
         record.setName("usepartment");
         record.setBefore(String.valueOf(card.getUsepartment()));
       } else if ("5".equals(nodevalue.trim())) { // 使用状况
         body.setUsestatus(changeValue);
         record.setName("usestatus");
         record.setBefore(String.valueOf(card.getUsestatus()));
       } else if ("6".equals(nodevalue.trim())) { // 折旧类型
         body.setZjtype(changeValue);
         record.setName("zjtype");
         record.setBefore(String.valueOf(card.getZjtype()));
       } else if ("7".equals(nodevalue.trim())) { // 使用月限
         Long yueTotal = Long.parseLong(changeValue);
         Long nian = yueTotal / 12l;
         Long yue = yueTotal % 12l;
         body.setSynx(nian);
         body.setSyyx(yue);
         record.setName("syyx");
         record.setBefore(String.valueOf(card.getSyyx() + card.getSynx() * 12));
       } else if ("9".equals(nodevalue.trim())) { // 净残值
         double bianhua = Double.parseDouble(changeValue);
         body.setJcz(bianhua);
         body.setJczl(bianhua / card.getYbyz() * 100); // 净残值率
         record.setName("jcz");
         record.setBefore(String.valueOf(card.getJcz()));
       } else if ("10".equals(nodevalue.trim())) { // 累计折旧
         body.setLjzj(Double.parseDouble(changeValue));
         body.setJvalue(card.getYbyz() - Double.parseDouble(changeValue));
         body.setJevalue(card.getYbyz() - Double.parseDouble(changeValue));
         record.setName("ljzj");
         record.setBefore(String.valueOf(card.getLjzj()));
       } else if ("11".equals(nodevalue.trim())) { // 卡片类别,
         body.setTypecode(changeValue);
         body.setChildid(changeValue);
         record.setName("typecode");
         record.setBefore(String.valueOf(card.getTypecode()));
       } else if ("12".equals(nodevalue.trim())) { // 增加方式
         body.setAddtype(changeValue);
         record.setName("addtype");
         record.setBefore(String.valueOf(card.getAddtype()));
       } else if ("13".equals(nodevalue.trim())) { // 折旧承担部门
         body.setZjcdbm(changeValue);
         record.setName("zjcdbm");
         record.setBefore(String.valueOf(card.getZjcdbm()));
       } else if ("14".equals(nodevalue.trim())) { // 使用人
         body.setUsername(changeValue);
         record.setName("username");
         record.setBefore(String.valueOf(card.getUsername()));
       }
       body.setChangeway(nodevalue);
       body.setChangereason(changereason);
       this.update(body);
       record.setPkId(headId.toString());
       record.setChangetype("卡片变动");
       record.setZcType("card");
       record.setChangeinfoid(cardId);
       record.setAfter(changeValue);
       record.setZcId(String.valueOf(body.getId()));
       record.setChangedate(new Date());
       IUser user = UserThreadLocal.get();
       record.setChangeperson(user.getUsername());
       record.setChangepersonId(user.getUserTidChar());
       record.setChangeinfoid(String.valueOf(card.getId()));
       // 流程
       CaShead head = this.findCaSheadById(headId);
       record.setWfCode(head.getWfconfigCode());
       // 设置审批状态为0:未审批
       record.setZhuangTai("0");
       record.setBiaoming("lccardtemp");
       this.saveRecord(record);
     }
   }
 }