店铺详情页功能

This commit is contained in:
ly19960718 2021-03-24 17:31:41 +08:00
parent e33fa4ea3a
commit 7a43d9a7d6
28 changed files with 505 additions and 133 deletions

View File

@ -34,6 +34,26 @@ public class ShopMemberController extends DefaultBaseController {
@Autowired
private IShopMemberService shopMemberService;
@ApiOperation(value = "店铺会员分页列表", notes = "店铺会员分页列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listpagebyshopid/{shopId}")
public SuccessResultList<List<ShopMemberDTO>> listpagebyShopId(@PathVariable("shopId") String shopId, ListPage page) {
Map<String, Object> params = requestParams();
params.put("shopId",shopId);
page.setParams(params);
return shopMemberService.listPage(page);
}
@ApiOperation(value = "新增", notes = "新增接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("save")

View File

@ -34,6 +34,28 @@ public class ShopPositionController extends DefaultBaseController {
@Autowired
private IShopPositionService shopPositionService;
@ApiOperation(value = "店铺人员分页列表", notes = "店铺人员分页列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listpagebyshopid/{shopId}")
public SuccessResultList<List<ShopPositionDTO>> listpageByShopId(@PathVariable("shopId") String shopId,ListPage page) {
Map<String, Object> params = requestParams();
params.put("shopId",shopId);
page.setParams(params);
return shopPositionService.listPage(page);
}
@ApiOperation(value = "新增", notes = "新增接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("save")

View File

@ -4,9 +4,11 @@ import cn.com.tenlion.pojo.dtos.shop.ShopDTO;
import cn.com.tenlion.pojo.vos.shop.ShopVO;
import cn.com.tenlion.service.shop.IShopService;
import ink.wgink.annotation.CheckRequestBodyAnnotation;
import ink.wgink.app.AppTokenManager;
import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.app.AppTokenUser;
import ink.wgink.pojo.result.ErrorResult;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultData;
@ -46,9 +48,10 @@ public class ShopAppController extends DefaultBaseController {
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("myListPage")
public SuccessResultList<List<ShopDTO>> myListPage(ListPage page) {
public SuccessResultList<List<ShopDTO>> myListPage(@RequestHeader("token") String token,ListPage page) {
Map<String, Object> params = requestParams();
params.put("creator","1");
AppTokenUser appTokenUser = AppTokenManager.getInstance().getToken(token).getAppTokenUser();
params.put("creator",appTokenUser.getId());
page.setParams(params);
return shopService.listPage(page);
}

View File

@ -10,6 +10,7 @@ package cn.com.tenlion.pojo.bos.shopmember;
**/
public class ShopMemberBO {
private String memberId;
private String shopId;
private String userId;
private Integer memberLevel;
@ -19,8 +20,16 @@ public class ShopMemberBO {
private String modifier;
private Integer isDelete;
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
public String getShopId() {
return shopId == null ? "" : shopId.trim();
return shopId == null ? "" : shopId.trim();
}
public void setShopId(String shopId) {

View File

@ -10,17 +10,27 @@ package cn.com.tenlion.pojo.bos.shopstaff;
**/
public class ShopStaffBO {
private String staffId;
private String shopId;
private String userId;
private String positionId;
private Integer isLeader;
private Integer isAdmin;
private Integer auditStatus;
private String gmtCreate;
private String creator;
private String gmtModified;
private String modifier;
private Integer isDelete;
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getShopId() {
return shopId == null ? "" : shopId.trim();
}
@ -61,6 +71,14 @@ public class ShopStaffBO {
this.isAdmin = isAdmin;
}
public Integer getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(Integer auditStatus) {
this.auditStatus = auditStatus;
}
public String getGmtCreate() {
return gmtCreate == null ? "" : gmtCreate.trim();
}

View File

@ -26,11 +26,8 @@ public class ShopDTO {
private Double shopStar;
@ApiModelProperty(name = "shopLogo", value = "店铺LOGO文件ID")
private String shopLogo;
@ApiModelProperty(name = "shopTemplateId", value = "模板ID")
private Integer shopTemplateId;
@ApiModelProperty(name = "userEvaluate", value = "用户评价分数满分10分通过用户对商品的满意度计算")
private Double userEvaluate;
@ApiModelProperty(name = "isOpen", value = "是否营业 0:未开业1:开业中")
@ -45,6 +42,8 @@ public class ShopDTO {
private String gmtCreate;
@ApiModelProperty(name = "creator", value = "创建人")
private String creator;
@ApiModelProperty(name = "creatorName", value = "创建人")
private String creatorName;
public String getShopId() {
@ -160,4 +159,12 @@ public class ShopDTO {
public void setIsCertification(Integer isCertification) {
this.isCertification = isCertification;
}
public String getCreatorName() {
return creatorName;
}
public void setCreatorName(String creatorName) {
this.creatorName = creatorName;
}
}

View File

@ -14,15 +14,32 @@ import io.swagger.annotations.ApiModelProperty;
@ApiModel
public class ShopMemberDTO {
@ApiModelProperty(name = "memberId", value = "主键 ID")
private String memberId;
@ApiModelProperty(name = "shopId", value = "商铺ID")
private String shopId;
@ApiModelProperty(name = "userId", value = "用户ID")
private String userId;
@ApiModelProperty(name = "userName", value = "用户姓名")
private String userName;
@ApiModelProperty(name = "userUserName", value = "用户名")
private String userUserName;
@ApiModelProperty(name = "memberLevel", value = "会员等级")
private Integer memberLevel;
@ApiModelProperty(name = "gmtCreate", value = "创建时间")
private String gmtCreate;
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
public String getShopId() {
return shopId == null ? "" : shopId.trim();
}
@ -31,6 +48,9 @@ public class ShopMemberDTO {
this.shopId = shopId;
}
public String getUserId() {
return userId == null ? "" : userId.trim();
}
@ -39,6 +59,22 @@ public class ShopMemberDTO {
this.userId = userId;
}
public String getUserName() {
return userName == null ? "" : userName.trim();
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserUserName() {
return userUserName;
}
public void setUserUserName(String userUserName) {
this.userUserName = userUserName;
}
public Integer getMemberLevel() {
return memberLevel == null ? 0 : memberLevel;
}

View File

@ -28,6 +28,10 @@ public class ShopPositionDTO {
private String gmtCreate;
@ApiModelProperty(name = "creator", value = "创建人")
private String creator;
@ApiModelProperty(name = "creatorName", value = "创建人姓名")
private String creatorName;
public String getPositionId() {
return positionId == null ? "" : positionId.trim();
@ -85,5 +89,11 @@ public class ShopPositionDTO {
this.creator = creator;
}
public String getCreatorName() {
return creatorName;
}
public void setCreatorName(String creatorName) {
this.creatorName = creatorName;
}
}

View File

@ -14,6 +14,9 @@ import io.swagger.annotations.ApiModelProperty;
@ApiModel
public class ShopStaffDTO {
@ApiModelProperty(name = "staffId", value = "主键 ID")
private String staffId;
@ApiModelProperty(name = "shopId", value = "店铺ID")
private String shopId;
@ApiModelProperty(name = "userId", value = "员工ID")
@ -30,6 +33,11 @@ public class ShopStaffDTO {
private Integer isLeader;
@ApiModelProperty(name = "isAdmin", value = "是否为管理员")
private Integer isAdmin;
@ApiModelProperty(name = "auditStatus", value = "审核状态 0未审核 1审核通过 -1审核不通过")
private Integer auditStatus;
@ApiModelProperty(name = "gmtCreate", value = "创建时间")
private String gmtCreate;
@ApiModelProperty(name = "creator", value = "创建人")
@ -39,6 +47,14 @@ public class ShopStaffDTO {
@ApiModelProperty(name = "modifier", value = "修改人")
private String modifier;
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getShopId() {
return shopId == null ? "" : shopId.trim();
}
@ -79,6 +95,14 @@ public class ShopStaffDTO {
this.isAdmin = isAdmin;
}
public Integer getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(Integer auditStatus) {
this.auditStatus = auditStatus;
}
public String getGmtCreate() {
return gmtCreate == null ? "" : gmtCreate.trim();
}

View File

@ -9,7 +9,7 @@ package cn.com.tenlion.pojo.pos.shopmember;
* @Version: 3.0
**/
public class ShopMemberPO {
private String memberId;
private String shopId;
private String userId;
private Integer memberLevel;
@ -19,6 +19,14 @@ public class ShopMemberPO {
private String modifier;
private Integer isDelete;
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
public String getShopId() {
return shopId == null ? "" : shopId.trim();
}

View File

@ -10,17 +10,28 @@ package cn.com.tenlion.pojo.pos.shopstaff;
**/
public class ShopStaffPO {
private String staffId;
private String shopId;
private String userId;
private String positionId;
private Integer isLeader;
private Integer isAdmin;
private Integer auditStatus;
private String gmtCreate;
private String creator;
private String gmtModified;
private String modifier;
private Integer isDelete;
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getShopId() {
return shopId == null ? "" : shopId.trim();
}
@ -61,6 +72,14 @@ public class ShopStaffPO {
this.isAdmin = isAdmin;
}
public Integer getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(Integer auditStatus) {
this.auditStatus = auditStatus;
}
public String getGmtCreate() {
return gmtCreate == null ? "" : gmtCreate.trim();
}

View File

@ -16,6 +16,9 @@ import io.swagger.annotations.ApiModelProperty;
@ApiModel
public class ShopMemberVO {
@ApiModelProperty(name = "memberId", value = "主键 ID")
private String memberId;
@ApiModelProperty(name = "shopId", value = "商铺ID")
private String shopId;
@ApiModelProperty(name = "userId", value = "用户ID")
@ -27,6 +30,15 @@ public class ShopMemberVO {
@CheckEmptyAnnotation(name = "创建时间", verifyType = "datetime")
private String gmtCreate;
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
public String getShopId() {
return shopId == null ? "" : shopId.trim();
}

View File

@ -16,6 +16,9 @@ import io.swagger.annotations.ApiModelProperty;
@ApiModel
public class ShopStaffVO {
@ApiModelProperty(name = "staffId", value = "主键 ID")
private String staffId;
@ApiModelProperty(name = "shopId", value = "店铺ID")
private String shopId;
@ApiModelProperty(name = "userId", value = "员工ID")
@ -29,6 +32,15 @@ public class ShopStaffVO {
@CheckNumberAnnotation(name = "是否为管理员")
private Integer isAdmin;
public String getStaffId() {
return staffId;
}
public void setStaffId(String staffId) {
this.staffId = staffId;
}
public String getShopId() {
return shopId == null ? "" : shopId.trim();
}

View File

@ -1,5 +1,6 @@
package cn.com.tenlion.service.shop.impl;
import cn.com.tenlion.accesstokenmanager.AccessTokenManager;
import cn.com.tenlion.dao.shop.IShopDao;
import cn.com.tenlion.pojo.bos.shop.ShopBO;
import cn.com.tenlion.pojo.dtos.shop.ShopDTO;
@ -14,11 +15,15 @@ import cn.com.tenlion.service.shopauditlog.IShopAuditLogService;
import cn.com.tenlion.service.shopindusrty.IShopIndusrtyService;
import cn.com.tenlion.service.shopposition.IShopPositionService;
import cn.com.tenlion.service.shopstaff.IShopStaffService;
import ink.wgink.app.AppTokenManager;
import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.common.component.SecurityComponent;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.app.AppTokenUser;
import ink.wgink.pojo.dtos.user.UserDTO;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.service.user.service.IUserService;
import ink.wgink.util.map.HashMapUtil;
import ink.wgink.util.UUIDUtil;
@ -50,11 +55,8 @@ public class ShopServiceImpl extends DefaultBaseService implements IShopService
private IShopStaffService shopStaffService;
@Autowired
private IShopPositionService shopPositionServicel;
@Autowired
protected SecurityComponent securityComponent;
private IUserService userService;
@ -92,15 +94,16 @@ public class ShopServiceImpl extends DefaultBaseService implements IShopService
shoppositionvo.setShopId(shopId);
shoppositionvo.setPositionName("店长");
shoppositionvo.setPositionOrder(1.0);
String positonId = shopPositionServicel.saveReturnId(shoppositionvo);
String positonId = shopPositionServicel.saveReturnId(token,shoppositionvo);
LOG.info("新增员工表");
ShopStaffVO shopstaffvo = new ShopStaffVO();
shopstaffvo.setShopId(shopId);
shopstaffvo.setUserId(securityComponent.getCurrentUser().getUserId());
AppTokenUser appTokenUser = AppTokenManager.getInstance().getToken(token).getAppTokenUser();
shopstaffvo.setUserId(appTokenUser.getId());
shopstaffvo.setPositionId(positonId);
shopstaffvo.setIsAdmin(0);
shopstaffvo.setIsLeader(1);
shopStaffService.save(shopstaffvo);
shopStaffService.save(token,shopstaffvo);
return shopId;
}
@ -183,7 +186,14 @@ public class ShopServiceImpl extends DefaultBaseService implements IShopService
@Override
public List<ShopDTO> list(Map<String, Object> params) {
return shopDao.list(params);
List<ShopDTO> list = shopDao.list(params);
for (ShopDTO shopDTO : list) {
UserDTO userDTO = userService.get(shopDTO.getCreator());
if(userDTO != null){
shopDTO.setCreatorName(userDTO.getUserName());
}
}
return list;
}
@Override

View File

@ -2,8 +2,10 @@ package cn.com.tenlion.service.shopmember.impl;
import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.dtos.user.UserDTO;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.service.user.service.IUserService;
import ink.wgink.util.map.HashMapUtil;
import ink.wgink.util.UUIDUtil;
import cn.com.tenlion.dao.shopmember.IShopMemberDao;
@ -32,6 +34,8 @@ public class ShopMemberServiceImpl extends DefaultBaseService implements IShopMe
@Autowired
private IShopMemberDao shopMemberDao;
@Autowired
private IUserService userService;
@Override
public void save(ShopMemberVO shopMemberVO) {
@ -52,7 +56,7 @@ public class ShopMemberServiceImpl extends DefaultBaseService implements IShopMe
public String saveReturnId(String token, ShopMemberVO shopMemberVO) {
String shopMemberId = UUIDUtil.getUUID();
Map<String, Object> params = HashMapUtil.beanToMap(shopMemberVO);
params.put("shopMemberId", shopMemberId);
params.put("memberId", shopMemberId);
if (StringUtils.isBlank(token)) {
setSaveInfo(params);
} else {
@ -70,7 +74,7 @@ public class ShopMemberServiceImpl extends DefaultBaseService implements IShopMe
@Override
public void remove(String token, List<String> ids) {
Map<String, Object> params = getHashMap(2);
params.put("shopMemberIds", ids);
params.put("memberIds", ids);
if (StringUtils.isBlank(token)) {
setUpdateInfo(params);
} else {
@ -82,7 +86,7 @@ public class ShopMemberServiceImpl extends DefaultBaseService implements IShopMe
@Override
public void delete(List<String> ids) {
Map<String, Object> params = getHashMap(2);
params.put("shopMemberIds", ids);
params.put("memberIds", ids);
shopMemberDao.delete(params);
}
@ -94,7 +98,7 @@ public class ShopMemberServiceImpl extends DefaultBaseService implements IShopMe
@Override
public void update(String token, String shopMemberId, ShopMemberVO shopMemberVO) {
Map<String, Object> params = HashMapUtil.beanToMap(shopMemberVO);
params.put("shopMemberId", shopMemberId);
params.put("memberId", shopMemberId);
if (StringUtils.isBlank(token)) {
setUpdateInfo(params);
} else {
@ -111,8 +115,15 @@ public class ShopMemberServiceImpl extends DefaultBaseService implements IShopMe
@Override
public ShopMemberDTO get(String shopMemberId) {
Map<String, Object> params = super.getHashMap(2);
params.put("shopMemberId", shopMemberId);
return get(params);
params.put("memberId", shopMemberId);
ShopMemberDTO shopMemberDTO = get(params);
if(shopMemberDTO != null){
UserDTO userDTO = userService.get(shopMemberDTO.getUserId());
if(userDTO != null){
shopMemberDTO.setUserName(userDTO.getUserName());
}
}
return shopMemberDTO;
}
@Override
@ -123,7 +134,7 @@ public class ShopMemberServiceImpl extends DefaultBaseService implements IShopMe
@Override
public ShopMemberBO getBO(String shopMemberId) {
Map<String, Object> params = super.getHashMap(2);
params.put("shopMemberId", shopMemberId);
params.put("memberId", shopMemberId);
return getBO(params);
}
@ -135,13 +146,23 @@ public class ShopMemberServiceImpl extends DefaultBaseService implements IShopMe
@Override
public ShopMemberPO getPO(String shopMemberId) {
Map<String, Object> params = super.getHashMap(2);
params.put("shopMemberId", shopMemberId);
params.put("memberId", shopMemberId);
return getPO(params);
}
@Override
public List<ShopMemberDTO> list(Map<String, Object> params) {
return shopMemberDao.list(params);
List<ShopMemberDTO> list = shopMemberDao.list(params);
for (ShopMemberDTO shopMemberDTO : list) {
if(shopMemberDTO != null){
UserDTO userDTO = userService.get(shopMemberDTO.getUserId());
if(userDTO != null){
shopMemberDTO.setUserName(userDTO.getUserName());
shopMemberDTO.setUserUserName(userDTO.getUserUsername());
}
}
}
return list;
}
@Override

View File

@ -2,8 +2,10 @@ package cn.com.tenlion.service.shopposition.impl;
import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.dtos.user.UserDTO;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.service.user.service.IUserService;
import ink.wgink.util.map.HashMapUtil;
import ink.wgink.util.UUIDUtil;
import cn.com.tenlion.dao.shopposition.IShopPositionDao;
@ -32,6 +34,8 @@ public class ShopPositionServiceImpl extends DefaultBaseService implements IShop
@Autowired
private IShopPositionDao shopPositionDao;
@Autowired
private IUserService userServicel;
@Override
public void save(ShopPositionVO shopPositionVO) {
@ -94,7 +98,7 @@ public class ShopPositionServiceImpl extends DefaultBaseService implements IShop
@Override
public void update(String token, String shopPositionId, ShopPositionVO shopPositionVO) {
Map<String, Object> params = HashMapUtil.beanToMap(shopPositionVO);
params.put("shopPositionId", shopPositionId);
params.put("positionId", shopPositionId);
if (StringUtils.isBlank(token)) {
setUpdateInfo(params);
} else {
@ -111,8 +115,13 @@ public class ShopPositionServiceImpl extends DefaultBaseService implements IShop
@Override
public ShopPositionDTO get(String shopPositionId) {
Map<String, Object> params = super.getHashMap(2);
params.put("shopPositionId", shopPositionId);
return get(params);
params.put("positionId", shopPositionId);
ShopPositionDTO shopPositionDTO = get(params);
UserDTO userDTO = userServicel.get(shopPositionDTO.getCreator());
if(userDTO != null){
shopPositionDTO.setCreatorName(userDTO.getUserName());
}
return shopPositionDTO;
}
@Override
@ -123,7 +132,7 @@ public class ShopPositionServiceImpl extends DefaultBaseService implements IShop
@Override
public ShopPositionBO getBO(String shopPositionId) {
Map<String, Object> params = super.getHashMap(2);
params.put("shopPositionId", shopPositionId);
params.put("positionId", shopPositionId);
return getBO(params);
}
@ -135,13 +144,20 @@ public class ShopPositionServiceImpl extends DefaultBaseService implements IShop
@Override
public ShopPositionPO getPO(String shopPositionId) {
Map<String, Object> params = super.getHashMap(2);
params.put("shopPositionId", shopPositionId);
params.put("positionId", shopPositionId);
return getPO(params);
}
@Override
public List<ShopPositionDTO> list(Map<String, Object> params) {
return shopPositionDao.list(params);
List<ShopPositionDTO> list = shopPositionDao.list(params);
for (ShopPositionDTO shopPositionDTO : list) {
UserDTO userDTO = userServicel.get(shopPositionDTO.getCreator());
if(userDTO != null){
shopPositionDTO.setCreatorName(userDTO.getUserName());
}
}
return list;
}
@Override

View File

@ -1,9 +1,13 @@
package cn.com.tenlion.service.shopstaff.impl;
import cn.com.tenlion.pojo.dtos.shopposition.ShopPositionDTO;
import cn.com.tenlion.service.shopposition.IShopPositionService;
import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.dtos.user.UserDTO;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.service.user.service.IUserService;
import ink.wgink.util.map.HashMapUtil;
import ink.wgink.util.UUIDUtil;
import cn.com.tenlion.dao.shopstaff.IShopStaffDao;
@ -32,6 +36,11 @@ public class ShopStaffServiceImpl extends DefaultBaseService implements IShopSta
@Autowired
private IShopStaffDao shopStaffDao;
@Autowired
private IUserService userService;
@Autowired
private IShopPositionService shopPositionService;
@Override
public void save(ShopStaffVO shopStaffVO) {
@ -53,6 +62,7 @@ public class ShopStaffServiceImpl extends DefaultBaseService implements IShopSta
String shopStaffId = UUIDUtil.getUUID();
Map<String, Object> params = HashMapUtil.beanToMap(shopStaffVO);
params.put("shopStaffId", shopStaffId);
params.put("auditResult", "1");
if (StringUtils.isBlank(token)) {
setSaveInfo(params);
} else {
@ -70,7 +80,7 @@ public class ShopStaffServiceImpl extends DefaultBaseService implements IShopSta
@Override
public void remove(String token, List<String> ids) {
Map<String, Object> params = getHashMap(2);
params.put("shopStaffIds", ids);
params.put("staffIds", ids);
if (StringUtils.isBlank(token)) {
setUpdateInfo(params);
} else {
@ -82,7 +92,7 @@ public class ShopStaffServiceImpl extends DefaultBaseService implements IShopSta
@Override
public void delete(List<String> ids) {
Map<String, Object> params = getHashMap(2);
params.put("shopStaffIds", ids);
params.put("staffIds", ids);
shopStaffDao.delete(params);
}
@ -94,7 +104,7 @@ public class ShopStaffServiceImpl extends DefaultBaseService implements IShopSta
@Override
public void update(String token, String shopStaffId, ShopStaffVO shopStaffVO) {
Map<String, Object> params = HashMapUtil.beanToMap(shopStaffVO);
params.put("shopStaffId", shopStaffId);
params.put("staffId", shopStaffId);
if (StringUtils.isBlank(token)) {
setUpdateInfo(params);
} else {
@ -111,8 +121,19 @@ public class ShopStaffServiceImpl extends DefaultBaseService implements IShopSta
@Override
public ShopStaffDTO get(String shopStaffId) {
Map<String, Object> params = super.getHashMap(2);
params.put("shopStaffId", shopStaffId);
return get(params);
params.put("staffId", shopStaffId);
ShopStaffDTO shopStaffDTO = get(params);
if(shopStaffDTO != null){
UserDTO userDTO = userService.get(shopStaffDTO.getUserId());
if(userDTO != null){
shopStaffDTO.setUserName(userDTO.getUserName());
}
ShopPositionDTO shopPositionDTO = shopPositionService.get(shopStaffDTO.getPositionId());
if(shopPositionDTO != null){
shopStaffDTO.setPositionName(shopPositionDTO.getPositionName());
}
}
return shopStaffDTO;
}
@Override
@ -123,7 +144,7 @@ public class ShopStaffServiceImpl extends DefaultBaseService implements IShopSta
@Override
public ShopStaffBO getBO(String shopStaffId) {
Map<String, Object> params = super.getHashMap(2);
params.put("shopStaffId", shopStaffId);
params.put("staffId", shopStaffId);
return getBO(params);
}
@ -135,13 +156,26 @@ public class ShopStaffServiceImpl extends DefaultBaseService implements IShopSta
@Override
public ShopStaffPO getPO(String shopStaffId) {
Map<String, Object> params = super.getHashMap(2);
params.put("shopStaffId", shopStaffId);
params.put("staffId", shopStaffId);
return getPO(params);
}
@Override
public List<ShopStaffDTO> list(Map<String, Object> params) {
return shopStaffDao.list(params);
List<ShopStaffDTO> list = shopStaffDao.list(params);
for (ShopStaffDTO shopStaffDTO : list) {
if(shopStaffDTO != null){
UserDTO userDTO = userService.get(shopStaffDTO.getUserId());
if(userDTO != null){
shopStaffDTO.setUserName(userDTO.getUserName());
}
ShopPositionDTO shopPositionDTO = shopPositionService.get(shopStaffDTO.getPositionId());
if(shopPositionDTO != null){
shopStaffDTO.setPositionName(shopPositionDTO.getPositionName());
}
}
}
return list;
}
@Override

View File

@ -141,7 +141,7 @@
shop_summary = #{shopSummary},
</if>
<if test="shopAddress != null and shopAddress != ''">
shop_address = #{shopAddress},
shop_address = #{shopAddress},
</if>
<if test="shopStar != null">
shop_star = #{shopStar},
@ -164,12 +164,6 @@
<if test="isLogOff != null">
is_log_off = #{isLogOff},
</if>
<if test="gmtCreate != null and gmtCreate != ''">
gmt_create = #{gmtCreate},
</if>
<if test="creator != null and creator != ''">
creator = #{creator},
</if>
<if test="gmtModified != null and gmtModified != ''">
gmt_modified = #{gmtModified},
</if>
@ -305,7 +299,7 @@
AND
t1.creator = #{creator}
</if>
ORDER BY t1.gmt_create DESC
</select>
<!-- 列表-->

View File

@ -3,6 +3,7 @@
<mapper namespace="cn.com.tenlion.dao.shopmember.IShopMemberDao">
<resultMap id="shopMemberDTO" type="cn.com.tenlion.pojo.dtos.shopmember.ShopMemberDTO">
<result column="member_id" property="memberId"/>
<result column="shop_id" property="shopId"/>
<result column="user_id" property="userId"/>
<result column="member_level" property="memberLevel"/>
@ -10,6 +11,7 @@
</resultMap>
<resultMap id="shopMemberBO" type="cn.com.tenlion.pojo.bos.shopmember.ShopMemberBO">
<result column="member_id" property="memberId"/>
<result column="shop_id" property="shopId"/>
<result column="user_id" property="userId"/>
<result column="member_level" property="memberLevel"/>
@ -21,6 +23,7 @@
</resultMap>
<resultMap id="shopMemberPO" type="cn.com.tenlion.pojo.pos.shopmember.ShopMemberPO">
<result column="member_id" property="memberId"/>
<result column="shop_id" property="shopId"/>
<result column="user_id" property="userId"/>
<result column="member_level" property="memberLevel"/>
@ -33,6 +36,7 @@
<insert id="save" parameterType="map">
INSERT INTO svc_shop_member(
member_id,
shop_id,
user_id,
member_level,
@ -42,6 +46,7 @@
modifier,
is_delete
) VALUES(
#{memberId},
#{shopId},
#{userId},
#{memberLevel},
@ -61,12 +66,21 @@
modifier = #{modifier},
is_delete = 1
WHERE
member_id IN
<foreach collection="memberIds" index="index" open="(" separator="," close=")">
#{memberIds[${index}]}
</foreach>
</update>
<update id="delete" parameterType="map">
DELETE FROM
svc_shop_member
WHERE
member_id IN
<foreach collection="memberIds" index="index" open="(" separator="," close=")">
#{memberIds[${index}]}
</foreach>
</update>
<update id="update" parameterType="map">
@ -98,23 +112,27 @@
is_delete = #{isDelete}
</if>
WHERE
member_id = #{memberId}
</update>
<select id="get" parameterType="map" resultMap="shopMemberDTO">
SELECT
t1.member_id,
t1.shop_id,
t1.user_id,
t1.member_level,
t1.gmt_create,
1
t1.gmt_create
FROM
svc_shop_member t1
WHERE
t1.is_delete = 0
AND
t1.member_id = #{memberId}
</select>
<select id="getBO" parameterType="map" resultMap="shopMemberBO">
SELECT
t1.member_id,
t1.shop_id,
t1.user_id,
t1.member_level,
@ -127,10 +145,13 @@
svc_shop_member t1
WHERE
t1.is_delete = 0
AND
t1.member_id = #{memberId}
</select>
<select id="getPO" parameterType="map" resultMap="shopMemberPO">
SELECT
t1.member_id,
t1.shop_id,
t1.user_id,
t1.member_level,
@ -143,15 +164,17 @@
svc_shop_member t1
WHERE
t1.is_delete = 0
AND
t1.member_id = #{memberId}
</select>
<select id="list" parameterType="map" resultMap="shopMemberDTO">
SELECT
t1.member_id,
t1.shop_id,
t1.user_id,
t1.member_level,
t1.gmt_create,
1
t1.gmt_create
FROM
svc_shop_member t1
WHERE
@ -177,6 +200,7 @@
<select id="listBO" parameterType="map" resultMap="shopMemberBO">
SELECT
t1.member_id,
t1.shop_id,
t1.user_id,
t1.member_level,
@ -206,6 +230,7 @@
<select id="listPO" parameterType="map" resultMap="shopMemberPO">
SELECT
t1.member_id,
t1.shop_id,
t1.user_id,
t1.member_level,

View File

@ -72,12 +72,20 @@
modifier = #{modifier},
is_delete = 1
WHERE
position_id IN
<foreach collection="shopPositionIds" index="index" open="(" separator="," close=")">
#{shopPositionIds[${index}]}
</foreach>
</update>
<update id="delete" parameterType="map">
DELETE FROM
svc_shop_position
WHERE
position_id IN
<foreach collection="shopPositionIds" index="index" open="(" separator="," close=")">
#{shopPositionIds[${index}]}
</foreach>
</update>
<update id="update" parameterType="map">
@ -115,6 +123,7 @@
is_delete = #{isDelete}
</if>
WHERE
position_id = #{positionId}
</update>
<select id="get" parameterType="map" resultMap="shopPositionDTO">
@ -124,11 +133,14 @@
t1.position_name,
t1.position_summary,
t1.position_order,
1
t1.creator,
t1.gmt_modified
FROM
svc_shop_position t1
WHERE
t1.is_delete = 0
AND
t1.position_id = #{positionId}
</select>
<select id="getBO" parameterType="map" resultMap="shopPositionBO">
@ -147,6 +159,8 @@
svc_shop_position t1
WHERE
t1.is_delete = 0
AND
t1.position_id = #{positionId}
</select>
<select id="getPO" parameterType="map" resultMap="shopPositionPO">
@ -165,6 +179,8 @@
svc_shop_position t1
WHERE
t1.is_delete = 0
AND
t1.position_id = #{positionId}
</select>
<select id="list" parameterType="map" resultMap="shopPositionDTO">
@ -183,7 +199,7 @@
t1.is_delete = 0
<if test="keywords != null and keywords != ''">
AND (
t1.id LIKE CONCAT('%', #{keywords}, '%')
t1.position_name LIKE CONCAT('%', #{keywords}, '%')
)
</if>
<if test="startTime != null and startTime != ''">
@ -198,6 +214,7 @@
AND
t1.shop_id = #{shopId}
</if>
ORDER BY t1.position_order
</select>
<select id="listBO" parameterType="map" resultMap="shopPositionBO">

View File

@ -3,12 +3,14 @@
<mapper namespace="cn.com.tenlion.dao.shopstaff.IShopStaffDao">
<resultMap id="shopStaffDTO" type="cn.com.tenlion.pojo.dtos.shopstaff.ShopStaffDTO">
<result column="staff_id" property="staffId"/>
<result column="shop_id" property="shopId"/>
<result column="user_id" property="userId"/>
<result column="position_id" property="positionId"/>
<result column="position_name" property="positionName"/>
<result column="is_leader" property="isLeader"/>
<result column="is_admin" property="isAdmin"/>
<result column="audit_status" property="auditStatus"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="creator" property="creator"/>
<result column="gmt_modified" property="gmtModified"/>
@ -16,11 +18,13 @@
</resultMap>
<resultMap id="shopStaffBO" type="cn.com.tenlion.pojo.bos.shopstaff.ShopStaffBO">
<result column="staff_id" property="staffId"/>
<result column="shop_id" property="shopId"/>
<result column="user_id" property="userId"/>
<result column="position_id" property="positionId"/>
<result column="is_leader" property="isLeader"/>
<result column="is_admin" property="isAdmin"/>
<result column="audit_status" property="auditStatus"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="creator" property="creator"/>
<result column="gmt_modified" property="gmtModified"/>
@ -29,11 +33,13 @@
</resultMap>
<resultMap id="shopStaffPO" type="cn.com.tenlion.pojo.pos.shopstaff.ShopStaffPO">
<result column="staff_id" property="staffId"/>
<result column="shop_id" property="shopId"/>
<result column="user_id" property="userId"/>
<result column="position_id" property="positionId"/>
<result column="is_leader" property="isLeader"/>
<result column="is_admin" property="isAdmin"/>
<result column="audit_status" property="auditStatus"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="creator" property="creator"/>
<result column="gmt_modified" property="gmtModified"/>
@ -43,22 +49,26 @@
<insert id="save" parameterType="map">
INSERT INTO svc_shop_staff(
staff_id,
shop_id,
user_id,
position_id,
is_leader,
is_admin,
audit_status,
gmt_create,
creator,
gmt_modified,
modifier,
is_delete
) VALUES(
#{staffId},
#{shopId},
#{userId},
#{positionId},
#{isLeader},
#{isAdmin},
#{auditStatus},
#{gmtCreate},
#{creator},
#{gmtModified},
@ -75,12 +85,20 @@
modifier = #{modifier},
is_delete = 1
WHERE
staffIds IN
<foreach collection="staffIds" index="index" open="(" separator="," close=")">
#{staffIds[${index}]}
</foreach>
</update>
<update id="delete" parameterType="map">
DELETE FROM
svc_shop_staff
WHERE
staffIds IN
<foreach collection="staffIds" index="index" open="(" separator="," close=")">
#{staffIds[${index}]}
</foreach>
</update>
<update id="update" parameterType="map">
@ -118,30 +136,35 @@
is_delete = #{isDelete}
</if>
WHERE
staff_id = #{staffId}
</update>
<select id="get" parameterType="map" resultMap="shopStaffDTO">
SELECT
t1.staff_id,
t1.shop_id,
t1.user_id,
t1.position_id,
t1.is_leader,
t1.is_admin,
t1.gmt_create,
1
t1.audit_status,
t1.gmt_create
FROM
svc_shop_staff t1
WHERE
t1.is_delete = 0
AND staff_id = #{staffId}
</select>
<select id="getBO" parameterType="map" resultMap="shopStaffBO">
SELECT
t1.staff_id,
t1.shop_id,
t1.user_id,
t1.position_id,
t1.is_leader,
t1.is_admin,
t1.audit_status,
t1.gmt_create,
t1.creator,
t1.gmt_modified,
@ -151,15 +174,18 @@
svc_shop_staff t1
WHERE
t1.is_delete = 0
AND staff_id = #{staffId}
</select>
<select id="getPO" parameterType="map" resultMap="shopStaffPO">
SELECT
t1.staff_id,
t1.shop_id,
t1.user_id,
t1.position_id,
t1.is_leader,
t1.is_admin,
t1.audit_status,
t1.gmt_create,
t1.creator,
t1.gmt_modified,
@ -169,15 +195,18 @@
svc_shop_staff t1
WHERE
t1.is_delete = 0
AND staff_id = #{staffId}
</select>
<select id="list" parameterType="map" resultMap="shopStaffDTO">
SELECT
t1.staff_id,
t1.shop_id,
t1.user_id,
t1.position_id,
t1.is_leader,
t1.is_admin,
t1.audit_status,
t2.position_name
FROM
svc_shop_staff t1
@ -206,11 +235,13 @@
<select id="listBO" parameterType="map" resultMap="shopStaffBO">
SELECT
t1.staff_id,
t1.shop_id,
t1.user_id,
t1.position_id,
t1.is_leader,
t1.is_admin,
t1.audit_status,
t1.gmt_create,
t1.creator,
t1.gmt_modified,
@ -237,11 +268,13 @@
<select id="listPO" parameterType="map" resultMap="shopStaffPO">
SELECT
t1.staff_id,
t1.shop_id,
t1.user_id,
t1.position_id,
t1.is_leader,
t1.is_admin,
t1.audit_status,
t1.gmt_create,
t1.creator,
t1.gmt_modified,

View File

@ -35,6 +35,8 @@
<script type="text/html" id="barDemo">
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="show">详情</a>
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="staff">人员</a>
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="position">职位</a>
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="member">会员</a>
</script>
</div>
@ -78,7 +80,7 @@
[
{type:'checkbox', fixed: 'left'},
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
{field:'cz', width:180, title: '操作', align:'center', toolbar: '#barDemo'},
{field:'cz', width:220, title: '操作', align:'center', toolbar: '#barDemo'},
{field: 'shopLogo', width: 180, title: '店铺LOGO', align:'center',
templet: function(row) {
var rowData = row[this.field];
@ -129,7 +131,7 @@
return rowData;
}
},
{field: 'creator', width: 180, title: '注册人', align:'center',
{field: 'creatorName', width: 180, title: '注册人', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
@ -303,7 +305,7 @@
reloadTable();
}
})
} else if (event === 'staff'){
}else if (event === 'staff'){
layer.open({
type: 2,
title: false,
@ -316,6 +318,32 @@
reloadTable();
}
})
} else if (event === 'position'){
layer.open({
type: 2,
title: false,
closeBtn: 0,
area: ['90%', '90%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/shopposition/list.html?shopId={shopId}', [data.shopId]),
end: function () {
reloadTable();
}
})
} else if (event === 'member'){
layer.open({
type: 2,
title: false,
closeBtn: 0,
area: ['90%', '90%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/shopmember/list.html?shopId={shopId}', [data.shopId]),
end: function () {
reloadTable();
}
})
}
});
});

View File

@ -26,7 +26,7 @@
<label class="layui-form-label">店铺LOGO</label>
<div class="layui-input-block" id="logview">
<input type="hidden" id="shopLogo" name="shopLogo">
<img src="" id="showLogoImg" style="height: 100px;width: 100px">
<img src="" id="showLogoImg" style="height: 100px;width: 100px;margin-left: 20px">
</div>
</div>
<div class="layui-form-item">
@ -38,8 +38,8 @@
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">店铺简介</label>
<div class="layui-input-block">
<textarea id="shopSummary" name="shopSummary" class="layui-textarea" placeholder="请输入店铺简介" readonly="readonly"></textarea>
</div>
<textarea id="shopSummary" name="shopSummary" class="layui-textarea" placeholder="请输入店铺简介" readonly="readonly"></textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">店铺地址</label>

View File

@ -34,12 +34,12 @@
<!-- 表头按钮组 -->
<script type="text/html" id="headerToolBar">
<div class="layui-btn-group">
<button type="button" class="layui-btn layui-btn-sm" lay-event="saveEvent">
<!-- <button type="button" class="layui-btn layui-btn-sm" lay-event="saveEvent">
<i class="fa fa-lg fa-plus"></i> 新增
</button>
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="updateEvent">
<i class="fa fa-lg fa-edit"></i> 编辑
</button>
</button>-->
<button type="button" class="layui-btn layui-btn-danger layui-btn-sm" lay-event="removeEvent">
<i class="fa fa-lg fa-trash"></i> 删除
</button>
@ -65,14 +65,15 @@
var laydate = layui.laydate;
var common = layui.common;
var resizeTimeout = null;
var tableUrl = 'api/shopmember/listpage';
var tableUrl = 'api/shopmember/listpagebyshopid/{shopId}';
var shopId = top.restAjax.params(window.location.href).shopId;
// 初始化表格
function initTable() {
table.render({
elem: '#dataTable',
id: 'dataTable',
url: top.restAjax.path(tableUrl, []),
url: top.restAjax.path(tableUrl, [shopId]),
width: admin.screen() > 1 ? '100%' : '',
height: $win.height() - 90,
limit: 20,
@ -86,7 +87,7 @@
[
{type:'checkbox', fixed: 'left'},
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
{field: 'shopId', width: 180, title: '店铺ID', align:'center',
{field: 'userName', width: 180, title: '用户姓名', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
@ -95,7 +96,7 @@
return rowData;
}
},
{field: 'userId', width: 180, title: '用户ID', align:'center',
{field: 'userUserName', width: 180, title: '用户名', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
@ -138,7 +139,7 @@
// 重载表格
function reloadTable(currentPage) {
table.reload('dataTable', {
url: top.restAjax.path(tableUrl, []),
url: top.restAjax.path(tableUrl, [shopId]),
where: {
keywords: $('#keywords').val(),
startTime: $('#startTime').val(),

View File

@ -34,9 +34,9 @@
<!-- 表头按钮组 -->
<script type="text/html" id="headerToolBar">
<div class="layui-btn-group">
<button type="button" class="layui-btn layui-btn-sm" lay-event="saveEvent">
<!-- <button type="button" class="layui-btn layui-btn-sm" lay-event="saveEvent">
<i class="fa fa-lg fa-plus"></i> 新增
</button>
</button>-->
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="updateEvent">
<i class="fa fa-lg fa-edit"></i> 编辑
</button>
@ -65,14 +65,15 @@
var laydate = layui.laydate;
var common = layui.common;
var resizeTimeout = null;
var tableUrl = 'api/shopposition/listpage';
var tableUrl = 'api/shopposition/listpagebyshopid/{shopId}';
var shopId = top.restAjax.params(window.location.href).shopId;
// 初始化表格
function initTable() {
table.render({
elem: '#dataTable',
id: 'dataTable',
url: top.restAjax.path(tableUrl, []),
url: top.restAjax.path(tableUrl, [shopId]),
width: admin.screen() > 1 ? '100%' : '',
height: $win.height() - 90,
limit: 20,
@ -86,15 +87,6 @@
[
{type:'checkbox', fixed: 'left'},
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
{field: 'shopId', width: 180, title: '店铺', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'positionName', width: 180, title: '职位名称', align:'center',
templet: function(row) {
var rowData = row[this.field];
@ -131,7 +123,7 @@
return rowData;
}
},
{field: 'creator', width: 180, title: '创建人', align:'center',
{field: 'creatorName', width: 180, title: '创建人', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
@ -156,7 +148,7 @@
// 重载表格
function reloadTable(currentPage) {
table.reload('dataTable', {
url: top.restAjax.path(tableUrl, []),
url: top.restAjax.path(tableUrl, [shopId]),
where: {
keywords: $('#keywords').val(),
startTime: $('#startTime').val(),
@ -246,7 +238,7 @@
area: ['100%', '100%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/shopposition/update.html?shopPositionId={shopPositionId}', [checkDatas[0].shopPositionId]),
content: top.restAjax.path('route/shopposition/update.html?shopPositionId={shopPositionId}', [checkDatas[0].positionId]),
end: function() {
reloadTable();
}
@ -261,7 +253,7 @@
if(i > 1) {
ids += '_';
}
ids += item['shopPositionId'];
ids += item['positionId'];
}
removeData(ids);
}

View File

@ -22,18 +22,18 @@
</div>
<div class="layui-card-body" style="padding: 15px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="layui-form-item">
<label class="layui-form-label">职位ID</label>
<div class="layui-input-block">
<input type="text" id="positionId" name="positionId" class="layui-input" value="" placeholder="请输入职位ID" maxlength="36">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">店铺ID</label>
<div class="layui-input-block">
<input type="text" id="shopId" name="shopId" class="layui-input" value="" placeholder="请输入店铺ID" maxlength="36">
</div>
</div>
<!--<div class="layui-form-item">-->
<!--<label class="layui-form-label">职位ID</label>-->
<!--<div class="layui-input-block">-->
<!--<input type="text" id="positionId" name="positionId" class="layui-input" value="" placeholder="请输入职位ID" maxlength="36">-->
<!--</div>-->
<!--</div>-->
<!--<div class="layui-form-item">-->
<!--<label class="layui-form-label">店铺ID</label>-->
<!--<div class="layui-input-block">-->
<!--<input type="text" id="shopId" name="shopId" class="layui-input" value="" placeholder="请输入店铺ID" maxlength="36">-->
<!--</div>-->
<!--</div>-->
<div class="layui-form-item">
<label class="layui-form-label">职位名称</label>
<div class="layui-input-block">
@ -55,7 +55,7 @@
<div class="layui-form-item layui-layout-admin">
<div class="layui-input-block">
<div class="layui-footer" style="left: 0;">
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交编辑</button>
<!--<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交编辑</button>-->
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
</div>
</div>

View File

@ -34,9 +34,9 @@
<!-- 表头按钮组 -->
<script type="text/html" id="headerToolBar">
<div class="layui-btn-group">
<button type="button" class="layui-btn layui-btn-sm" lay-event="saveEvent">
<i class="fa fa-lg fa-plus"></i> 新增
</button>
<!--<button type="button" class="layui-btn layui-btn-sm" lay-event="saveEvent">-->
<!--<i class="fa fa-lg fa-plus"></i> 新增-->
<!--</button>-->
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="updateEvent">
<i class="fa fa-lg fa-edit"></i> 编辑
</button>
@ -238,7 +238,7 @@
area: ['100%', '100%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/shopstaff/update.html?shopStaffId={shopStaffId}', [checkDatas[0].shopStaffId]),
content: top.restAjax.path('route/shopstaff/update.html?shopStaffId={shopStaffId}', [checkDatas[0].staffId]),
end: function() {
reloadTable();
}
@ -253,7 +253,7 @@
if(i > 1) {
ids += '_';
}
ids += item['shopStaffId'];
ids += item['staffId'];
}
removeData(ids);
}

View File

@ -22,46 +22,45 @@
</div>
<div class="layui-card-body" style="padding: 15px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm">
<!--<div class="layui-form-item">-->
<!--<label class="layui-form-label">店铺ID</label>-->
<!--<div class="layui-input-block">-->
<!--<input type="text" id="shopId" name="shopId" class="layui-input" value="" placeholder="请输入店铺ID" maxlength="36">-->
<!--</div>-->
<!--</div>-->
<input type="hidden" id="shopId" name="shopId" class="layui-input" value="" placeholder="请输入店铺ID" maxlength="36">
<div class="layui-form-item">
<label class="layui-form-label">店铺ID</label>
<label class="layui-form-label">姓名</label>
<div class="layui-input-block">
<input type="text" id="shopId" name="shopId" class="layui-input" value="" placeholder="请输入店铺ID" maxlength="36">
<input type="hidden" id="userId" name="userId" class="layui-input" value="" placeholder="请输入员工ID" maxlength="36">
<input type="text" id="userName" name="userName" class="layui-input" value="" readonly="readonly">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">员工ID</label>
<label class="layui-form-label">职位</label>
<div class="layui-input-block">
<input type="text" id="userId" name="userId" class="layui-input" value="" placeholder="请输入员工ID" maxlength="36">
<input type="hidden" id="positionId" name="positionId" class="layui-input" value="" placeholder="请输入职位ID" maxlength="36">
<input type="text" id="positionName" name="positionName" class="layui-input" value="" readonly="readonly">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">职位ID</label>
<label class="layui-form-label">店长</label>
<div class="layui-input-block">
<input type="text" id="positionId" name="positionId" class="layui-input" value="" placeholder="请输入职位ID" maxlength="36">
<input type="hidden" id="isLeader" name="isLeader" class="layui-input" value="" placeholder="请输入是否店长(领导) 0否 1是" lay-verify="required">
<input type="text" id="isLeaderName" name="isLeaderName" class="layui-input" value="" placeholder="请输入是否店长(领导) 0否 1是" lay-verify="required" readonly="readonly">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">是否店长(领导) 0否 1是</label>
<label class="layui-form-label">管理员</label>
<div class="layui-input-block">
<input type="number" id="isLeader" name="isLeader" class="layui-input" value="" placeholder="请输入是否店长(领导) 0否 1是" lay-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">是否为管理员</label>
<div class="layui-input-block">
<input type="number" id="isAdmin" name="isAdmin" class="layui-input" value="" placeholder="请输入是否为管理员" lay-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">创建时间</label>
<div class="layui-input-block">
<input type="text" id="gmtCreate" name="gmtCreate" class="layui-input" value="" placeholder="请选择创建时间" lay-verify="required" readonly style="cursor: pointer;">
<input type="hidden" id="isAdmin" name="isAdmin" class="layui-input" value="" placeholder="请输入是否为管理员" lay-verify="required">
<input type="text" id="isAdminName" name="isAdminName" class="layui-input" value="" placeholder="请输入是否为管理员" lay-verify="required" readonly="readonly">
</div>
</div>
<div class="layui-form-item layui-layout-admin">
<div class="layui-input-block">
<div class="layui-footer" style="left: 0;">
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交编辑</button>
<!--<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交编辑</button>-->
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
</div>
</div>
@ -144,15 +143,7 @@
}
}
// 初始化创建时间时间戳
function initGmtCreateDateTime() {
laydate.render({
elem: '#gmtCreate',
type: 'datetime',
value: new Date(),
trigger: 'click'
});
}
// 初始化内容
@ -163,9 +154,19 @@
for(var i in data) {
dataFormData[i] = data[i] +'';
}
if(data.isLeader == 0){
dataFormData['isLeaderName'] = "否";
}else{
dataFormData['isLeaderName'] = "是";
}
if(data.isAdmin == 0){
dataFormData['isAdminName'] = "否";
}else{
dataFormData['isAdminName'] = "是";
}
form.val('dataForm', dataFormData);
form.render(null, 'dataForm');
initGmtCreateDateTime();
}, function(code, data) {
top.dialog.msg(data.msg);
}, function() {