@Override public void doAfter() throws Exception { // 用户积分 users = userUserProxy.getUserUserByPk(uuId); currentPoint = users.getPoint(); currentPoint = currentPoint == null ? 0L : currentPoint; parameters.put("userId", uuId); Long usedPoint = userUserProxy.getUsedUsersPoint(users.getId()); usedPoint = null == usedPoint ? 0L : usedPoint; aboutToExpiredPoint = userUserProxy.getAboutToExpiredUsersPoint(users.getId()); aboutToExpiredPoint = null == aboutToExpiredPoint ? 0L : aboutToExpiredPoint; search(); }
private UserUser getUsers(String userId) { if (StringUtils.isEmpty(userId)) { alert("无法获取到所必须的参数"); return null; } UserUser targetUser = userUserProxy.getUserUserByUserNo(userId); if (null == targetUser || "N".equalsIgnoreCase(targetUser.getIsValid())) { alert("无法找到该用户或该用户已经无效,无需再次操作"); return null; } if (!StringUtils.isEmpty(targetUser.getUserName())) { targetUser.setUserName(targetUser.getUserName() + "B"); } if (!StringUtils.isEmpty(targetUser.getMobileNumber())) { targetUser.setMobileNumber(targetUser.getMobileNumber() + "B"); } if (!StringUtils.isEmpty(targetUser.getEmail())) { targetUser.setEmail(targetUser.getEmail() + "B"); } if (!StringUtils.isEmpty(targetUser.getMemberShipCard())) { targetUser.setMemberShipCard(targetUser.getMemberShipCard() + "B"); } targetUser.setIsValid("N"); targetUser.setUserPassword("****************"); return targetUser; }
/** 查询 */ public void search() { userPointLogWithDescriptionList.clear(); Long totalRowCount = userUserProxy.getCountUserPointLog(parameters); this.initialPageInfoByMap(totalRowCount, parameters); userPointLogWithDescriptionList = userUserProxy.getPointLog(parameters); }
public void doCancel() { if (StringUtils.isEmpty(userId)) { alert("无法获取到所必须的参数"); return; } if (StringUtils.isEmpty(users.getCancellationReason())) { alert("无法获取到所必须的参数"); return; } if (users.getCancellationReason().length() > 2000) { alert("注销原因过长"); return; } UserUser targetUser = userUserProxy.getUserUserByUserNo(userId); if (targetUser.getPoint() > 0 || (targetUser.getCashBalance() != null && targetUser.getCashBalance() > 0) || (targetUser.getBonusBalance() != null && targetUser.getBonusBalance() > 0)) { ZkMessage.showQuestion( "此账户的存款账户金额、现金账户金额及积分不为0,确认注销吗?", new ZkMsgCallBack() { public void execute() { UserUser targetUser = getUsers(userId); String memo = targetUser.getMemo(); if (null != targetUser) { targetUser.setMemo( "该用户在" + SDF.format(new Date()) + "被" + getSessionUserName() + "注销,原因:" + users.getCancellationReason()); userUserProxy.update(targetUser); petComLogService.insert( "USER_USER", null, targetUser.getId(), getSessionUserName(), "UPDATE_USER_USER", "注销用户", "注销用户,原因是" + users.getCancellationReason() + "原备注:" + memo, null); getComponent().detach(); } } }, new ZkMsgCallBack() { public void execute() {} }); } else { ZkMessage.showQuestion( "您确定需要注销此用户吗?", new ZkMsgCallBack() { public void execute() { UserUser targetUser = getUsers(userId); String memo = targetUser.getMemo(); if (null != targetUser) { targetUser.setMemo( "该用户在" + SDF.format(new Date()) + "被" + getSessionUserName() + "注销,原因:" + users.getCancellationReason()); userUserProxy.update(targetUser); petComLogService.insert( "USER_USER", null, targetUser.getId(), getSessionUserName(), "UPDATE_USER_USER", "注销用户", "注销用户,原因是" + users.getCancellationReason() + " 原备注:" + memo, null); getComponent().detach(); } } }, new ZkMsgCallBack() { public void execute() {} }); } }
@Override public void doBefore() { users = userUserProxy.getUserUserByUserNo(userId); }