门店用户

This commit is contained in:
19173159168
2025-07-29 00:25:02 +08:00
parent 826973265e
commit 5c99499084
14 changed files with 629 additions and 33 deletions

View File

@ -23,7 +23,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
* 租车用户信息Controller
*
* @author ruoyi
* @date 2025-07-27
* @date 2025-07-28
*/
@Controller
@RequestMapping("/baseUser/user")

View File

@ -1,5 +1,6 @@
package com.ruoyi.baseUser.domain;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
@ -9,7 +10,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* 租车用户信息对象 zc_base_user
*
* @author ruoyi
* @date 2025-07-27
* @date 2025-07-28
*/
public class ZcBaseUser extends BaseEntity
{
@ -23,9 +24,11 @@ public class ZcBaseUser extends BaseEntity
private String userName;
/** 头像 */
@Excel(name = "头像")
private String avatarUrl;
/** 密码 */
@Excel(name = "密码")
private String password;
/** 手机号 */
@ -33,23 +36,29 @@ public class ZcBaseUser extends BaseEntity
private String phoneNumber;
/** 角色id */
@Excel(name = "租车用户",dictType = "sys_yes_no")
private Long roleId;
@Excel(name = "门店用户",dictType = "sys_yes_no")
private Long isStore;
/** 昵称 */
@Excel(name = "昵称")
private String nickName;
/** 微信小程序 openid */
@Excel(name = "微信小程序openid")
@Excel(name = "微信小程序 openid")
private String wechatOpenid;
/** 支付宝小程序 userid */
@Excel(name = "支付宝小程序userid")
@Excel(name = "支付宝小程序 userid")
private String alipayUserid;
/** 删除标志0代表存在 2代表删除 */
private String delFlag;
/** 用户与门店信息信息 */
private List<ZcBaseUserStore> zcBaseUserStoreList;
public void setId(Long id)
{
this.id = id;
@ -100,6 +109,14 @@ public class ZcBaseUser extends BaseEntity
this.roleId = roleId;
}
public Long getIsStore() {
return isStore;
}
public void setIsStore(Long isStore) {
this.isStore = isStore;
}
public Long getRoleId()
{
return roleId;
@ -141,6 +158,16 @@ public class ZcBaseUser extends BaseEntity
return delFlag;
}
public List<ZcBaseUserStore> getZcBaseUserStoreList()
{
return zcBaseUserStoreList;
}
public void setZcBaseUserStoreList(List<ZcBaseUserStore> zcBaseUserStoreList)
{
this.zcBaseUserStoreList = zcBaseUserStoreList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -150,12 +177,14 @@ public class ZcBaseUser extends BaseEntity
.append("password", getPassword())
.append("phoneNumber", getPhoneNumber())
.append("roleId", getRoleId())
.append("isStore", getIsStore())
.append("nickName", getNickName())
.append("wechatOpenid", getWechatOpenid())
.append("alipayUserid", getAlipayUserid())
.append("delFlag", getDelFlag())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("zcBaseUserStoreList", getZcBaseUserStoreList())
.toString();
}
}

View File

@ -0,0 +1,114 @@
package com.ruoyi.baseUser.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 用户与门店信息对象 zc_base_user_store
*
* @author ruoyi
* @date 2025-07-28
*/
public class ZcBaseUserStore extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id主键 */
private Long id;
/** 用户名 */
@Excel(name = "用户名")
private Long userId;
private Long operatorId;
@Excel(name = "所属运营商")
private String operatorName;
@Excel(name = "所属门店")
private String storeName;
private Long storeId;
/** 删除标志0代表存在 2代表删除 */
private String delFlag;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setOperatorId(Long operatorId)
{
this.operatorId = operatorId;
}
public Long getOperatorId()
{
return operatorId;
}
public void setStoreId(Long storeId)
{
this.storeId = storeId;
}
public Long getStoreId()
{
return storeId;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
public String getOperatorName() {
return operatorName;
}
public void setOperatorName(String operatorName) {
this.operatorName = operatorName;
}
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("userId", getUserId())
.append("operatorId", getOperatorId())
.append("storeId", getStoreId())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -2,12 +2,13 @@ package com.ruoyi.baseUser.mapper;
import java.util.List;
import com.ruoyi.baseUser.domain.ZcBaseUser;
import com.ruoyi.baseUser.domain.ZcBaseUserStore;
/**
* 租车用户信息Mapper接口
*
* @author ruoyi
* @date 2025-07-27
* @date 2025-07-28
*/
public interface ZcBaseUserMapper
{
@ -58,4 +59,29 @@ public interface ZcBaseUserMapper
* @return 结果
*/
public int deleteZcBaseUserByIds(String[] ids);
/**
* 批量删除用户与门店信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteZcBaseUserStoreByUserIds(String[] ids);
/**
* 批量新增用户与门店信息
*
* @param zcBaseUserStoreList 用户与门店信息列表
* @return 结果
*/
public int batchZcBaseUserStore(List<ZcBaseUserStore> zcBaseUserStoreList);
/**
* 通过租车用户信息主键删除用户与门店信息信息
*
* @param id 租车用户信息ID
* @return 结果
*/
public int deleteZcBaseUserStoreByUserId(Long id);
}

View File

@ -7,7 +7,7 @@ import com.ruoyi.baseUser.domain.ZcBaseUser;
* 租车用户信息Service接口
*
* @author ruoyi
* @date 2025-07-27
* @date 2025-07-28
*/
public interface IZcBaseUserService
{

View File

@ -1,9 +1,16 @@
package com.ruoyi.baseUser.service.impl;
import java.nio.charset.StandardCharsets;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.tomcat.util.security.MD5Encoder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.baseUser.domain.ZcBaseUserStore;
import com.ruoyi.baseUser.mapper.ZcBaseUserMapper;
import com.ruoyi.baseUser.domain.ZcBaseUser;
import com.ruoyi.baseUser.service.IZcBaseUserService;
@ -13,7 +20,7 @@ import com.ruoyi.common.core.text.Convert;
* 租车用户信息Service业务层处理
*
* @author ruoyi
* @date 2025-07-27
* @date 2025-07-28
*/
@Service
public class ZcBaseUserServiceImpl implements IZcBaseUserService
@ -51,11 +58,17 @@ public class ZcBaseUserServiceImpl implements IZcBaseUserService
* @param zcBaseUser 租车用户信息
* @return 结果
*/
@Transactional
@Override
public int insertZcBaseUser(ZcBaseUser zcBaseUser)
{
String md5Hexpwd = DigestUtils.md5Hex(zcBaseUser.getPassword());
zcBaseUser.setPassword(md5Hexpwd);
zcBaseUser.setIsStore(1L);
zcBaseUser.setCreateTime(DateUtils.getNowDate());
return zcBaseUserMapper.insertZcBaseUser(zcBaseUser);
int rows = zcBaseUserMapper.insertZcBaseUser(zcBaseUser);
insertZcBaseUserStore(zcBaseUser);
return rows;
}
/**
@ -64,10 +77,13 @@ public class ZcBaseUserServiceImpl implements IZcBaseUserService
* @param zcBaseUser 租车用户信息
* @return 结果
*/
@Transactional
@Override
public int updateZcBaseUser(ZcBaseUser zcBaseUser)
{
zcBaseUser.setUpdateTime(DateUtils.getNowDate());
zcBaseUserMapper.deleteZcBaseUserStoreByUserId(zcBaseUser.getId());
insertZcBaseUserStore(zcBaseUser);
return zcBaseUserMapper.updateZcBaseUser(zcBaseUser);
}
@ -77,9 +93,11 @@ public class ZcBaseUserServiceImpl implements IZcBaseUserService
* @param ids 需要删除的租车用户信息主键
* @return 结果
*/
@Transactional
@Override
public int deleteZcBaseUserByIds(String ids)
{
zcBaseUserMapper.deleteZcBaseUserStoreByUserIds(Convert.toStrArray(ids));
return zcBaseUserMapper.deleteZcBaseUserByIds(Convert.toStrArray(ids));
}
@ -89,9 +107,36 @@ public class ZcBaseUserServiceImpl implements IZcBaseUserService
* @param id 租车用户信息主键
* @return 结果
*/
@Transactional
@Override
public int deleteZcBaseUserById(Long id)
{
zcBaseUserMapper.deleteZcBaseUserStoreByUserId(id);
return zcBaseUserMapper.deleteZcBaseUserById(id);
}
/**
* 新增用户与门店信息信息
*
* @param zcBaseUser 租车用户信息对象
*/
public void insertZcBaseUserStore(ZcBaseUser zcBaseUser)
{
List<ZcBaseUserStore> zcBaseUserStoreList = zcBaseUser.getZcBaseUserStoreList();
Long id = zcBaseUser.getId();
if (StringUtils.isNotNull(zcBaseUserStoreList))
{
List<ZcBaseUserStore> list = new ArrayList<ZcBaseUserStore>();
for (ZcBaseUserStore zcBaseUserStore : zcBaseUserStoreList)
{
zcBaseUserStore.setUserId(id);
zcBaseUserStore.setCreateTime(DateUtils.getNowDate());
list.add(zcBaseUserStore);
}
if (list.size() > 0)
{
zcBaseUserMapper.batchZcBaseUserStore(list);
}
}
}
}

View File

@ -141,6 +141,20 @@ public class CompanyStoreController extends BaseController
return toAjax(companyStoreService.updateCompanyStore(companyStore));
}
/**
* 修改门店
*/
@RequiresPermissions("operation:store:edit")
@GetMapping("/addStoreUser/{id}")
public String addStoreUser(@PathVariable("id") Long id, ModelMap mmap)
{
CompanyStore companyStore = companyStoreService.selectCompanyStoreById(id);
mmap.put("companyStore", companyStore);
return prefix + "/addStoreUser";
}
/**
* 删除门店
*/

View File

@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="password" column="password" />
<result property="phoneNumber" column="phone_number" />
<result property="roleId" column="role_id" />
<result property="isStore" column="is_store" />
<result property="nickName" column="nick_name" />
<result property="wechatOpenid" column="wechat_openid" />
<result property="alipayUserid" column="alipay_userid" />
@ -19,8 +20,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
</resultMap>
<resultMap id="ZcBaseUserZcBaseUserStoreResult" type="ZcBaseUser" extends="ZcBaseUserResult">
<collection property="zcBaseUserStoreList" notNullColumn="sub_id" javaType="java.util.List" resultMap="ZcBaseUserStoreResult" />
</resultMap>
<resultMap type="ZcBaseUserStore" id="ZcBaseUserStoreResult">
<result property="id" column="sub_id" />
<result property="userId" column="sub_user_id" />
<result property="operatorId" column="sub_operator_id" />
<result property="storeId" column="sub_store_id" />
<result property="delFlag" column="sub_del_flag" />
<result property="createBy" column="sub_create_by" />
<result property="createTime" column="sub_create_time" />
<result property="updateBy" column="sub_update_by" />
<result property="updateTime" column="sub_update_time" />
</resultMap>
<sql id="selectZcBaseUserVo">
select id, user_name, avatar_url, password, phone_number, role_id, nick_name, wechat_openid, alipay_userid, del_flag, create_time, update_time from zc_base_user
select id, user_name, avatar_url, password, phone_number, role_id, is_store, nick_name, wechat_openid, alipay_userid, del_flag, create_time, update_time from zc_base_user
</sql>
<select id="selectZcBaseUserList" parameterType="ZcBaseUser" resultMap="ZcBaseUserResult">
@ -32,15 +49,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="password != null and password != ''"> and password = #{password}</if>
<if test="phoneNumber != null and phoneNumber != ''"> and phone_number = #{phoneNumber}</if>
<if test="roleId != null "> and role_id = #{roleId}</if>
<if test="isStore != null "> and is_store = #{isStore}</if>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
<if test="wechatOpenid != null and wechatOpenid != ''"> and wechat_openid = #{wechatOpenid}</if>
<if test="alipayUserid != null and alipayUserid != ''"> and alipay_userid = #{alipayUserid}</if>
</where>
</select>
<select id="selectZcBaseUserById" parameterType="Long" resultMap="ZcBaseUserResult">
<include refid="selectZcBaseUserVo"/>
where id = #{id}
<select id="selectZcBaseUserById" parameterType="Long" resultMap="ZcBaseUserZcBaseUserStoreResult">
select a.id, a.user_name, a.avatar_url, a.password, a.phone_number, a.role_id, a.is_store, a.nick_name, a.wechat_openid, a.alipay_userid, a.del_flag, a.create_time, a.update_time,
b.id as sub_id, b.user_id as sub_user_id, b.operator_id as sub_operator_id, b.store_id as sub_store_id
from zc_base_user a
left join zc_base_user_store b on b.user_id = a.id
where a.del_flag = '0' and a.id = #{id}
</select>
<insert id="insertZcBaseUser" parameterType="ZcBaseUser" useGeneratedKeys="true" keyProperty="id">
@ -51,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="password != null and password != ''">password,</if>
<if test="phoneNumber != null and phoneNumber != ''">phone_number,</if>
<if test="roleId != null">role_id,</if>
<if test="isStore != null">is_store,</if>
<if test="nickName != null">nick_name,</if>
<if test="wechatOpenid != null">wechat_openid,</if>
<if test="alipayUserid != null">alipay_userid,</if>
@ -64,6 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="password != null and password != ''">#{password},</if>
<if test="phoneNumber != null and phoneNumber != ''">#{phoneNumber},</if>
<if test="roleId != null">#{roleId},</if>
<if test="isStore != null">#{isStore},</if>
<if test="nickName != null">#{nickName},</if>
<if test="wechatOpenid != null">#{wechatOpenid},</if>
<if test="alipayUserid != null">#{alipayUserid},</if>
@ -81,6 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="password != null and password != ''">password = #{password},</if>
<if test="phoneNumber != null and phoneNumber != ''">phone_number = #{phoneNumber},</if>
<if test="roleId != null">role_id = #{roleId},</if>
<if test="isStore != null">is_store = #{isStore},</if>
<if test="nickName != null">nick_name = #{nickName},</if>
<if test="wechatOpenid != null">wechat_openid = #{wechatOpenid},</if>
<if test="alipayUserid != null">alipay_userid = #{alipayUserid},</if>
@ -102,4 +126,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<delete id="deleteZcBaseUserStoreByUserIds" parameterType="String">
delete from zc_base_user_store where user_id in
<foreach item="userId" collection="array" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
<delete id="deleteZcBaseUserStoreByUserId" parameterType="Long">
delete from zc_base_user_store where user_id = #{userId}
</delete>
<insert id="batchZcBaseUserStore">
insert into zc_base_user_store( id, user_id, operator_id, store_id, del_flag, create_by, create_time, update_by, update_time) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.userId}, #{item.operatorId}, #{item.storeId}, #{item.delFlag}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
</foreach>
</insert>
</mapper>

View File

@ -6,12 +6,19 @@
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-user-add">
<h4 class="form-header h4">租车用户信息信息</h4>
<div class="form-group">
<label class="col-sm-3 control-label is-required">用户名:</label>
<div class="col-sm-8">
<input name="userName" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">头像:</label>
<div class="col-sm-8">
<textarea name="avatarUrl" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">密码:</label>
<div class="col-sm-8">
@ -43,6 +50,22 @@
<input name="alipayUserid" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">删除标志:</label>
<div class="col-sm-8">
<input name="delFlag" class="form-control" type="text">
</div>
</div>
<h4 class="form-header h4">用户与门店信息信息</h4>
<div class="row">
<div class="col-sm-12">
<button type="button" class="btn btn-white btn-sm" onclick="addRow()"><i class="fa fa-plus"> 增加</i></button>
<button type="button" class="btn btn-white btn-sm" onclick="sub.delRow()"><i class="fa fa-minus"> 删除</i></button>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
@ -57,6 +80,116 @@
$.operate.save(prefix + "/add", $('#form-user-add').serialize());
}
}
$(function() {
var options = {
pagination: false,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
sidePagination: "client",
columns: [{
checkbox: true
},
{
field: 'index',
align: 'center',
title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
}
},
{
field: 'operatorId',
align: 'center',
title: '${comment}',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcBaseUserStoreList[%s].operatorId' value='%s'>", index, value);
return html;
}
},
{
field: 'storeId',
align: 'center',
title: '${comment}',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcBaseUserStoreList[%s].storeId' value='%s'>", index, value);
return html;
}
},
{
field: 'delFlag',
align: 'center',
title: '删除标志',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcBaseUserStoreList[%s].delFlag' value='%s'>", index, value);
return html;
}
},
{
field: 'createBy',
align: 'center',
title: '${comment}',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcBaseUserStoreList[%s].createBy' value='%s'>", index, value);
return html;
}
},
{
field: 'createTime',
align: 'center',
title: '创建时间',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcBaseUserStoreList[%s].createTime' value='%s'>", index, value);
return html;
}
},
{
field: 'updateBy',
align: 'center',
title: '${comment}',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcBaseUserStoreList[%s].updateBy' value='%s'>", index, value);
return html;
}
},
{
field: 'updateTime',
align: 'center',
title: '更新时间',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcBaseUserStoreList[%s].updateTime' value='%s'>", index, value);
return html;
}
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var value = $.common.isNotEmpty(row.index) ? row.index : $.table.serialNumber(index);
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="sub.delRowByIndex(\'' + value + '\')"><i class="fa fa-remove"></i>删除</a>';
}
}]
};
$.table.init(options);
});
function addRow() {
var count = $("#" + table.options.id).bootstrapTable('getData').length;
var row = {
index: $.table.serialNumber(count),
operatorId: "",
storeId: "",
delFlag: "",
createBy: "",
createTime: "",
updateBy: "",
updateTime: "",
}
sub.addRow(row);
}
</script>
</body>
</html>

View File

@ -6,6 +6,7 @@
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-user-edit" th:object="${zcBaseUser}">
<h4 class="form-header h4">租车用户信息信息</h4>
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label is-required">用户名:</label>
@ -14,12 +15,6 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">密码:</label>
<div class="col-sm-8">
<input name="password" th:field="*{password}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">手机号:</label>
<div class="col-sm-8">
@ -33,6 +28,22 @@
<input name="nickName" th:field="*{nickName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">门店用户:</label>
<div class="col-sm-8">
<select name="roleId" class="form-control m-b" th:with="type=${@dict.getType('key_yes_no')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{roleId}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">门店用户:</label>
<div class="col-sm-8">
<select name="isStore" class="form-control m-b" th:with="type=${@dict.getType('key_yes_no')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{isStore}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">微信小程序openid</label>
<div class="col-sm-8">
@ -45,6 +56,16 @@
<input name="alipayUserid" th:field="*{alipayUserid}" class="form-control" type="text">
</div>
</div>
<h4 class="form-header h4">用户门店信息</h4>
<div class="row">
<div class="col-sm-12">
<!-- <button type="button" class="btn btn-white btn-sm" onclick="addRow()"><i class="fa fa-plus"> 增加</i></button>-->
<!-- <button type="button" class="btn btn-white btn-sm" onclick="sub.delRow()"><i class="fa fa-minus"> 删除</i></button>-->
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
@ -59,6 +80,85 @@
$.operate.save(prefix + "/edit", $('#form-user-edit').serialize());
}
}
$(function() {
var options = {
data: [[${zcBaseUser.zcBaseUserStoreList}]],
pagination: false,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
sidePagination: "client",
columns: [{
checkbox: true
},
{
field: 'index',
align: 'center',
title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
}
},
{
field: 'storeName',
align: 'center',
title: '关联门店',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcBaseUserStoreList[%s].storeId' value='%s'>", index, value);
return html;
}
},
{
field: 'operatorName',
align: 'center',
title: '门店所属运营商',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcBaseUserStoreList[%s].operatorId' value='%s'>", index, value);
return html;
}
},
{
field: 'createTime',
align: 'center',
title: '创建时间',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='zcBaseUserStoreList[%s].createTime' value='%s'>", index, value);
return html;
}
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var value = $.common.isNotEmpty(row.index) ? row.index : $.table.serialNumber(index);
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="sub.delRowByIndex(\'' + value + '\')"><i class="fa fa-remove"></i>删除</a>';
}
}]
};
$.table.init(options);
});
function addRow() {
var count = $("#" + table.options.id).bootstrapTable('getData').length;
var row = {
index: $.table.serialNumber(count),
operatorId: "",
storeId: "",
delFlag: "",
createBy: "",
createTime: "",
updateBy: "",
updateTime: "",
}
sub.addRow(row);
}
</script>
</body>
</html>

View File

@ -21,10 +21,19 @@
</li>
<li>
<label>昵称</label>
<input type="text" name="nickName"/>
<label>门店用户</label>
<select name="roleId" th:with="type=${@dict.getType('key_yes_no')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>租车用户:</label>
<select name="isStore" th:with="type=${@dict.getType('key_yes_no')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
@ -35,9 +44,9 @@
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="baseUser:user:add">-->
<!-- <i class="fa fa-plus"></i> 添加-->
<!-- </a>-->
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="baseUser:user:add">
<i class="fa fa-plus"></i> 添加
</a>
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="baseUser:user:edit">-->
<!-- <i class="fa fa-edit"></i> 修改-->
<!-- </a>-->
@ -57,6 +66,7 @@
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('baseUser:user:edit')}]];
var removeFlag = [[${@permission.hasPermi('baseUser:user:remove')}]];
var yesNoDatas = [[${@dict.getType('key_yes_no')}]];
var prefix = ctx + "baseUser/user";
$(function() {
@ -95,12 +105,26 @@
field: 'alipayUserid',
title: '支付宝小程序'
},
{
field: 'roleId',
title: '租车用户',
formatter: function(value, row, index) {
return $.table.selectDictLabel(yesNoDatas, value);
}
},
{
field: 'isStore',
title: '门店用户',
formatter: function(value, row, index) {
return $.table.selectDictLabel(yesNoDatas, value);
}
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}

View File

@ -122,7 +122,7 @@
// 检查初始选中项
if(currentRentalType === '1') {
$overdueFeeGroup.hide().find('input').val('');
//$overdueFeeGroup.hide().find('input').val('');
}else if(currentRentalType === '3') {
$rentalDaysGroup.show();
}
@ -140,11 +140,11 @@
currentRentalType = newRentalType;
// 处理逾期金额显示/隐藏
if(newRentalType === '1') {
$overdueFeeGroup.hide().find('input').val('');
} else {
$overdueFeeGroup.show();
}
// if(newRentalType === '1') {
// $overdueFeeGroup.hide().find('input').val('');
// } else {
// $overdueFeeGroup.show();
// }
// 处理租赁天数显示/隐藏
if(newRentalType === '3') {
$rentalDaysGroup.show();

View File

@ -0,0 +1,64 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增门店用户信息')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-user-add">
<input class='form-control' type='text' name='zcBaseUserStoreList[0].operatorId' th:value='${companyStore.operatingCompanyId}'>
<input class='form-control' type='text' name='zcBaseUserStoreList[0].storeId' th:value="${companyStore.id}" >
<div class="form-group">
<label class="col-sm-3 control-label is-required">用户名:</label>
<div class="col-sm-8">
<input name="userName" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">密码:</label>
<div class="col-sm-8">
<input name="password" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">手机号:</label>
<div class="col-sm-8">
<input name="phoneNumber" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">昵称:</label>
<div class="col-sm-8">
<input name="nickName" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">微信小程序openid</label>
<div class="col-sm-8">
<input name="wechatOpenid" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">支付宝小程序userid</label>
<div class="col-sm-8">
<input name="alipayUserid" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "baseUser/user"
$("#form-user-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-user-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -194,6 +194,7 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="assStoreUser(\'' + row.id + '\')"><i class="fa fa-edit"></i>门店用户</a> ');
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
if (row.status == 1) {
@ -221,6 +222,10 @@
$.operate.post(prefix + "/changeStatus", { "id": id, "status": 0 });
})
}
function assStoreUser(id){
$.modal.open("添加门店用户", prefix + "/addStoreUser/" + id);
}
</script>
</body>
</html>