Commit c9176e95 by Java-聂换换

修改用户

parent 76df5e6e
...@@ -11,5 +11,5 @@ import com.thinkgem.jeesite.modules.youka.entity.YoukaCardEntity; ...@@ -11,5 +11,5 @@ import com.thinkgem.jeesite.modules.youka.entity.YoukaCardEntity;
*/ */
@MyBatisDao @MyBatisDao
public interface YoukaCardDao extends CrudDao<YoukaCardEntity> { public interface YoukaCardDao extends CrudDao<YoukaCardEntity> {
public Integer updateIsDebit(YoukaCardEntity entity);
} }
\ No newline at end of file
...@@ -69,14 +69,21 @@ public class YoukaUserService extends CrudService<YoukaUserDao, YoukaUser> { ...@@ -69,14 +69,21 @@ public class YoukaUserService extends CrudService<YoukaUserDao, YoukaUser> {
youkaUserDetail.setUpdateBy(UserUtils.getUser()); youkaUserDetail.setUpdateBy(UserUtils.getUser());
youkaUserDetail.setUserCode(youkaUser.getCode()); youkaUserDetail.setUserCode(youkaUser.getCode());
youkaUserDetailDao.update(youkaUserDetail); if(youkaUserDetailDao.getByUserCode(youkaUser.getCode()) == null){
youkaUserDetail.preInsert();
youkaUserDetail.setCode(IdGen.randomBase62(64));
youkaUserDetailDao.insert(youkaUserDetail);
}else{
youkaUserDetailDao.update(youkaUserDetail);
}
} }
List<YoukaCardEntity> youkaCardEntityList = youkaUser.getYoukaCardEntityList(); List<YoukaCardEntity> youkaCardEntityList = youkaUser.getYoukaCardEntityList();
if(youkaCardEntityList!=null && youkaCardEntityList.size()>0){ if(youkaCardEntityList!=null && youkaCardEntityList.size()>0){
for(YoukaCardEntity youkaCardEntity : youkaCardEntityList){ for(YoukaCardEntity youkaCardEntity : youkaCardEntityList){
if(youkaCardEntity.getIsDebit() != null && !youkaCardEntity.getIsDebit().equals(youkaCardEntity.getIsNewDebit())){ if(youkaCardEntity.getIsDebit() != null && !youkaCardEntity.getIsDebit().equals(youkaCardEntity.getIsNewDebit())){
youkaCardEntity.setIsDebit(youkaCardEntity.getIsNewDebit()); youkaCardEntity.setIsDebit(youkaCardEntity.getIsNewDebit());
youkaCardDao.update(youkaCardEntity); youkaCardDao.updateIsDebit(youkaCardEntity);
} }
} }
} }
...@@ -98,13 +105,14 @@ public class YoukaUserService extends CrudService<YoukaUserDao, YoukaUser> { ...@@ -98,13 +105,14 @@ public class YoukaUserService extends CrudService<YoukaUserDao, YoukaUser> {
YoukaUserDetail youkaUserDetail = youkaUser.getYoukaUserDetail(); YoukaUserDetail youkaUserDetail = youkaUser.getYoukaUserDetail();
if(youkaUserDetail != null){ if(youkaUserDetail != null){
youkaUserDetail.preInsert(); youkaUserDetail.preInsert();
youkaUser.setAvatar(StringUtils.replace(youkaUser.getAvatar(), Global.IMAGE_SAVE_URL,""));
youkaUserDetail.setIdCardFront(StringUtils.replace(youkaUserDetail.getIdCardFront(), Global.IMAGE_SAVE_URL,"")); youkaUserDetail.setIdCardFront(StringUtils.replace(youkaUserDetail.getIdCardFront(), Global.IMAGE_SAVE_URL,""));
youkaUserDetail.setIdCardBack(StringUtils.replace(youkaUserDetail.getIdCardBack(), Global.IMAGE_SAVE_URL,"")); youkaUserDetail.setIdCardBack(StringUtils.replace(youkaUserDetail.getIdCardBack(), Global.IMAGE_SAVE_URL,""));
youkaUserDetail.setIdCardHold(StringUtils.replace(youkaUserDetail.getIdCardHold(), Global.IMAGE_SAVE_URL,"")); youkaUserDetail.setIdCardHold(StringUtils.replace(youkaUserDetail.getIdCardHold(), Global.IMAGE_SAVE_URL,""));
youkaUserDetail.setDebitCard(StringUtils.replace(youkaUserDetail.getDebitCard(), Global.IMAGE_SAVE_URL,"")); youkaUserDetail.setDebitCard(StringUtils.replace(youkaUserDetail.getDebitCard(), Global.IMAGE_SAVE_URL,""));
youkaUserDetail.setUpdateBy(UserUtils.getUser()); youkaUserDetail.setUpdateBy(UserUtils.getUser());
youkaUserDetail.setUserCode(youkaUser.getCode()); youkaUserDetail.setUserCode(youkaUser.getCode());
youkaUserDetail.setCode(IdGen.randomBase62(64));
youkaUserDetailDao.insert(youkaUserDetail); youkaUserDetailDao.insert(youkaUserDetail);
} }
......
...@@ -108,6 +108,12 @@ ...@@ -108,6 +108,12 @@
del_flag = #{delFlag} del_flag = #{delFlag}
WHERE id = #{id} WHERE id = #{id}
</update> </update>
<update id="updateIsDebit">
UPDATE youka_cards SET
is_debit = #{isDebit}
WHERE id = #{id}
</update>
<update id="delete"> <update id="delete">
UPDATE youka_cards SET UPDATE youka_cards SET
......
...@@ -59,7 +59,6 @@ ...@@ -59,7 +59,6 @@
<insert id="insert"> <insert id="insert">
INSERT INTO youka_user_details( INSERT INTO youka_user_details(
`id`,
`code`, `code`,
`user_code`, `user_code`,
`real_name`, `real_name`,
...@@ -74,8 +73,8 @@ ...@@ -74,8 +73,8 @@
`update_date`, `update_date`,
`update_by` `update_by`
) VALUES ( ) VALUES (
#{id},
#{code}, #{code},
#{userCode},
#{realName}, #{realName},
#{idCard}, #{idCard},
#{idCardPlace}, #{idCardPlace},
......
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
</td><%-- </td><%--
<td>${user.roleNames}</td> --%> <td>${user.roleNames}</td> --%>
<shiro:hasPermission name="sys:user:edit"><td> <shiro:hasPermission name="sys:user:edit"><td>
<a href="${ctx}/youka/user/form?id=${user.id}">查看</a> <a href="${ctx}/youka/user/modify?id=${user.id}">查看</a>
<a href="${ctx}/youka/user/real/name/audit?id=${user.id}" >审核</a> <a href="${ctx}/youka/user/real/name/audit?id=${user.id}" >审核</a>
<a href="${ctx}/youka/user/form?id=${user.id}">禁用</a> <a href="${ctx}/youka/user/form?id=${user.id}">禁用</a>
<a href="${ctx}/youka/user/form?id=${user.id}">账户明细</a> <a href="${ctx}/youka/user/form?id=${user.id}">账户明细</a>
......
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>用户管理</title>
<meta name="decorator" content="default"/>
<script type="text/javascript">
$(document).ready(function() {
$("#no").focus();
$("#inputForm").validate({
submitHandler: function(form){
loading('正在提交,请稍等...');
form.submit();
},
errorContainer: "#messageBox",
errorPlacement: function(error, element) {
$("#messageBox").text("输入有误,请先更正。");
if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
error.appendTo(element.parent().parent());
} else {
error.insertAfter(element);
}
}
});
$(".isNewDebit").click(function () {
$(".isDebit").html("否");;
$(".isNewDebit").show();
$(".isNewDebit").val("N");
$this = $(this);
$this.closest("tr").find(".isDebit").html("是");
$this.closest("tr").find(".isNewDebit").hide();
$this.closest("tr").find(".isNewDebitInput").val("Y");
});
});
</script>
</head>
<body>
<ul class="nav nav-tabs">
<li><a href="${ctx}/youka/user/list">用户列表</a></li>
<li class="active"><a href="${ctx}/youka/user/real/name/audit?id=${user.id}">用户<shiro:hasPermission name="sys:user:edit">修改</shiro:hasPermission><shiro:lacksPermission name="sys:user:edit"></shiro:lacksPermission></a></li>
</ul><br/>
<form:form id="inputForm" modelAttribute="youkaUser" action="${ctx}/youka/user/save" method="post" class="form-horizontal">
<form:hidden path="id"/>
<sys:message content="${message}"/>
<div class="control-group">
<label class="control-label">头像:</label>
<div class="controls">
<form:hidden id="nameImage" path="avatar" htmlEscape="false" maxlength="255" class="input-xlarge"/>
<sys:ckfinder input="nameImage" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
</div>
</div>
<div class="control-group">
<label class="control-label">用户登录名:</label>
<div class="controls">
<form:input path="nickname" htmlEscape="false" maxlength="50" class="input-medium required" />
</div>
</div>
<div class="control-group">
<label class="control-label">用户类型:</label>
<div class="controls">
<c:if test="${youkaUser.level eq 'S'}">管理员</c:if>
<c:if test="${youkaUser.level eq 'A'}">王者会员</c:if>
<c:if test="${youkaUser.level eq 'B'}">钻石会员</c:if>
<c:if test="${youkaUser.level eq 'C'}">黄金会员</c:if>
<c:if test="${youkaUser.level eq 'D'}">白银会员</c:if>
<c:if test="${youkaUser.level eq 'E'}">青铜会员</c:if>
</div>
</div>
<div class="control-group">
<label class="control-label">真实姓名:</label>
<div class="controls">
<form:input path="youkaUserDetail.realName" htmlEscape="false" maxlength="50" class="input-medium" />
</div>
</div>
<div class="control-group">
<label class="control-label">身份证号:</label>
<div class="controls">
<form:input path="youkaUserDetail.idCard" htmlEscape="false" maxlength="50" class="input-medium" />
</div>
</div>
<div class="control-group">
<label class="control-label">身份证地址:</label>
<div class="controls">
<form:input path="youkaUserDetail.idCardPlace" htmlEscape="false" maxlength="50" class="input-medium" />
<c:if test="${youkaUser.youkaUserDetail != null }">
${youkaUser.youkaUserDetail.idCard}
</c:if>
</div>
</div>
<div class="control-group">
<label class="control-label">身份证图片:</label>
<div class="controls">
<form:hidden id="idCardFront" path="youkaUserDetail.idCardFront" htmlEscape="false" maxlength="255" class="input-xlarge"/>
<sys:ckfinder input="idCardFront" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
<form:hidden id="idCardBack" path="youkaUserDetail.idCardBack" htmlEscape="false" maxlength="255" class="input-xlarge"/>
<sys:ckfinder input="idCardBack" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
</div>
</div>
<div class="control-group">
<label class="control-label">手持身份证图片:</label>
<div class="controls">
<form:hidden id="idCardHold" path="youkaUserDetail.idCardHold" htmlEscape="false" maxlength="255" class="input-xlarge"/>
<sys:ckfinder input="idCardHold" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
</div>
</div>
<div class="control-group">
<label class="control-label">银行卡正面:</label>
<div class="controls">
<form:hidden id="debitCard" path="youkaUserDetail.debitCard" htmlEscape="false" maxlength="255" class="input-xlarge"/>
<sys:ckfinder input="debitCard" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
</div>
</div>
<div class="control-group">
<label class="control-label">银行卡:</label>
<div class="controls">
<table id="contentTable" class="table table-striped table-bordered" style="display:inline-block;">
<thead><tr><th>序号</th><th style="width: 100px;">银行卡名称</th><th >银行卡类型</th><th >银行卡号</th><th >开户地址</th><th >开户支行</th><th >是否为结算卡</th><%--<th>角色</th> --%><th style="width: 80px;">操作</th></tr></thead>
<tbody>
<c:forEach items="${youkaUser.youkaCardEntityList}" var="card" varStatus="indexs">
<tr>
<td>${indexs.index}</td>
<td>${card.belongBank}</td>
<td>
<c:if test="${card.cardType eq 'D'}">储蓄卡</c:if>
<c:if test="${card.cardType eq 'C'}">信用卡</c:if>
</td>
<td>${card.cardNo}</td>
<td>
${card.cardPlace}
</td>
<td>
${card.cardBank}
</td>
<td class="isDebit">
<c:if test="${card.isDebit eq 'Y'}"></c:if>
<c:if test="${card.isDebit eq 'N'}"></c:if>
</td>
<td>
<input name="youkaCardEntityList[${indexs.index}].isDebit" value="${card.isDebit}" style="display: none;"/>
<input name="youkaCardEntityList[${indexs.index}].id" value="${card.id}" style="display: none;"/>
<input name="youkaCardEntityList[${indexs.index}].isNewDebit" value="${card.isDebit}" style="display: none;" class="isNewDebitInput"/>
<c:if test="${card.isDebit eq 'N'}"><input class="isNewDebit" type="button" value="设置成结算卡"></c:if>
<c:if test="${card.isDebit eq 'Y'}"><input class="isNewDebit" type="button" value="设置成结算卡" style="display: none"></c:if>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
<div class="form-actions">
<shiro:hasPermission name="sys:user:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
</div>
</form:form>
</body>
</html>
\ No newline at end of file
...@@ -39,8 +39,7 @@ ...@@ -39,8 +39,7 @@
<label class="control-label">头像:</label> <label class="control-label">头像:</label>
<div class="controls"> <div class="controls">
<img src="${youkaUser.avatar}"/> <img src="${youkaUser.avatar}"/>
<form:hidden id="nameImage" path="avatar" htmlEscape="false" maxlength="255" class="input-xlarge"/>
<sys:ckfinder input="nameImage" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100" maxHeight="100"/>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
...@@ -69,14 +68,6 @@ ...@@ -69,14 +68,6 @@
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label">身份证号:</label>
<div class="controls">
<c:if test="${youkaUser.youkaUserDetail != null }">
${youkaUser.youkaUserDetail.idCard}
</c:if>
</div>
</div>
<div class="control-group">
<label class="control-label">身份证号码:</label> <label class="control-label">身份证号码:</label>
<div class="controls"> <div class="controls">
<c:if test="${youkaUser.youkaUserDetail != null }"> <c:if test="${youkaUser.youkaUserDetail != null }">
...@@ -116,7 +107,7 @@ ...@@ -116,7 +107,7 @@
<label class="control-label">银行卡正面:</label> <label class="control-label">银行卡正面:</label>
<div class="controls"> <div class="controls">
<c:if test="${youkaUser.youkaUserDetail != null }"> <c:if test="${youkaUser.youkaUserDetail != null }">
<img src="${youkaUser.youkaUserDetail.idCardHold}"> <img src="${youkaUser.youkaUserDetail.debitCard}">
</c:if> </c:if>
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment