コード例 #1
0
 /**
  * 修改当前登录用户信息
  *
  * @param
  * @return
  */
 public ActionForward updateUserInfo(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws Exception {
   CommonActionForm cForm = (CommonActionForm) form;
   UserInfoVo userInfoVo = getSessionContainer(request).getUserInfo();
   UserService service = (UserService) getService("userService");
   Dto indDto = cForm.getParamAsDto(request);
   Dto outDto = new BaseDto(G4Constants.TRUE);
   outDto.put("flag", G4Constants.SUCCESS);
   String password = G4Utils.encryptBasedDes(indDto.getAsString("password2"));
   if (password.equals(userInfoVo.getPassword())) {
     service.updateUserItem4IndexPage(indDto);
     outDto.put("flag", G4Constants.SUCCESS);
     userInfoVo.setPassword(G4Utils.encryptBasedDes(indDto.getAsString("password1")));
     getSessionContainer(request).setUserInfo(userInfoVo);
   } else {
     outDto.setSuccess(G4Constants.FALSE);
     outDto.put("flag", G4Constants.FAILURE);
   }
   write(outDto.toJson(), response);
   return mapping.findForward(null);
 }
コード例 #2
0
ファイル: PartServiceImpl.java プロジェクト: javajiao/mg4
 /**
  * 保存托管UI组件脏数据
  *
  * @param pDto
  * @return
  */
 public Dto saveDirtyDatas(Dto pDto) {
   Dto outDto = new BaseDto();
   List list = pDto.getDefaultAList();
   if (!checkUniqueIndex(list)) {
     outDto.setSuccess(G4Constants.FALSE);
     return outDto;
   }
   for (int i = 0; i < list.size(); i++) {
     Dto dto = (BaseDto) list.get(i);
     if (dto.getAsString("remark").equals("null")) {
       dto.put("remark", "");
     }
     if (dto.getAsString("dirtytype").equalsIgnoreCase("1")) {
       dto.put("partid", IDHelper.getPartID());
       g4Dao.insert("Part.savePartItem", dto);
     } else {
       g4Dao.update("Part.updatePartItem", dto);
     }
   }
   outDto.setSuccess(G4Constants.TRUE);
   return outDto;
 }