diff --git a/src/main/java/cn/com/tenlion/controller/api/shopmember/ShopMemberController.java b/src/main/java/cn/com/tenlion/controller/api/shopmember/ShopMemberController.java index 1d7c720..658c596 100644 --- a/src/main/java/cn/com/tenlion/controller/api/shopmember/ShopMemberController.java +++ b/src/main/java/cn/com/tenlion/controller/api/shopmember/ShopMemberController.java @@ -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> listpagebyShopId(@PathVariable("shopId") String shopId, ListPage page) { + Map 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") diff --git a/src/main/java/cn/com/tenlion/controller/api/shopposition/ShopPositionController.java b/src/main/java/cn/com/tenlion/controller/api/shopposition/ShopPositionController.java index 96d632f..e320620 100644 --- a/src/main/java/cn/com/tenlion/controller/api/shopposition/ShopPositionController.java +++ b/src/main/java/cn/com/tenlion/controller/api/shopposition/ShopPositionController.java @@ -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> listpageByShopId(@PathVariable("shopId") String shopId,ListPage page) { + Map 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") diff --git a/src/main/java/cn/com/tenlion/controller/app/apis/shop/ShopAppController.java b/src/main/java/cn/com/tenlion/controller/app/apis/shop/ShopAppController.java index a1d8f66..347b282 100644 --- a/src/main/java/cn/com/tenlion/controller/app/apis/shop/ShopAppController.java +++ b/src/main/java/cn/com/tenlion/controller/app/apis/shop/ShopAppController.java @@ -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> myListPage(ListPage page) { + public SuccessResultList> myListPage(@RequestHeader("token") String token,ListPage page) { Map 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); } diff --git a/src/main/java/cn/com/tenlion/pojo/bos/shopmember/ShopMemberBO.java b/src/main/java/cn/com/tenlion/pojo/bos/shopmember/ShopMemberBO.java index 73da003..8d4ae2d 100644 --- a/src/main/java/cn/com/tenlion/pojo/bos/shopmember/ShopMemberBO.java +++ b/src/main/java/cn/com/tenlion/pojo/bos/shopmember/ShopMemberBO.java @@ -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) { diff --git a/src/main/java/cn/com/tenlion/pojo/bos/shopstaff/ShopStaffBO.java b/src/main/java/cn/com/tenlion/pojo/bos/shopstaff/ShopStaffBO.java index 1023d2c..047e8c7 100644 --- a/src/main/java/cn/com/tenlion/pojo/bos/shopstaff/ShopStaffBO.java +++ b/src/main/java/cn/com/tenlion/pojo/bos/shopstaff/ShopStaffBO.java @@ -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(); } diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/shop/ShopDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/shop/ShopDTO.java index 583e0a4..17a03ba 100644 --- a/src/main/java/cn/com/tenlion/pojo/dtos/shop/ShopDTO.java +++ b/src/main/java/cn/com/tenlion/pojo/dtos/shop/ShopDTO.java @@ -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; + } } diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/shopmember/ShopMemberDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/shopmember/ShopMemberDTO.java index a5c6758..be85dc0 100644 --- a/src/main/java/cn/com/tenlion/pojo/dtos/shopmember/ShopMemberDTO.java +++ b/src/main/java/cn/com/tenlion/pojo/dtos/shopmember/ShopMemberDTO.java @@ -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; } diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/shopposition/ShopPositionDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/shopposition/ShopPositionDTO.java index 0b6e2fc..635712f 100644 --- a/src/main/java/cn/com/tenlion/pojo/dtos/shopposition/ShopPositionDTO.java +++ b/src/main/java/cn/com/tenlion/pojo/dtos/shopposition/ShopPositionDTO.java @@ -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; + } } diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/shopstaff/ShopStaffDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/shopstaff/ShopStaffDTO.java index 511321a..a104a72 100644 --- a/src/main/java/cn/com/tenlion/pojo/dtos/shopstaff/ShopStaffDTO.java +++ b/src/main/java/cn/com/tenlion/pojo/dtos/shopstaff/ShopStaffDTO.java @@ -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(); } diff --git a/src/main/java/cn/com/tenlion/pojo/pos/shopmember/ShopMemberPO.java b/src/main/java/cn/com/tenlion/pojo/pos/shopmember/ShopMemberPO.java index 9ba37e0..92a6e50 100644 --- a/src/main/java/cn/com/tenlion/pojo/pos/shopmember/ShopMemberPO.java +++ b/src/main/java/cn/com/tenlion/pojo/pos/shopmember/ShopMemberPO.java @@ -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(); } diff --git a/src/main/java/cn/com/tenlion/pojo/pos/shopstaff/ShopStaffPO.java b/src/main/java/cn/com/tenlion/pojo/pos/shopstaff/ShopStaffPO.java index bde8b52..7a9998f 100644 --- a/src/main/java/cn/com/tenlion/pojo/pos/shopstaff/ShopStaffPO.java +++ b/src/main/java/cn/com/tenlion/pojo/pos/shopstaff/ShopStaffPO.java @@ -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(); } diff --git a/src/main/java/cn/com/tenlion/pojo/vos/shopmember/ShopMemberVO.java b/src/main/java/cn/com/tenlion/pojo/vos/shopmember/ShopMemberVO.java index e84dd0e..6fe2a99 100644 --- a/src/main/java/cn/com/tenlion/pojo/vos/shopmember/ShopMemberVO.java +++ b/src/main/java/cn/com/tenlion/pojo/vos/shopmember/ShopMemberVO.java @@ -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(); } diff --git a/src/main/java/cn/com/tenlion/pojo/vos/shopstaff/ShopStaffVO.java b/src/main/java/cn/com/tenlion/pojo/vos/shopstaff/ShopStaffVO.java index 326da0f..48949e8 100644 --- a/src/main/java/cn/com/tenlion/pojo/vos/shopstaff/ShopStaffVO.java +++ b/src/main/java/cn/com/tenlion/pojo/vos/shopstaff/ShopStaffVO.java @@ -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(); } diff --git a/src/main/java/cn/com/tenlion/service/shop/impl/ShopServiceImpl.java b/src/main/java/cn/com/tenlion/service/shop/impl/ShopServiceImpl.java index b893171..572ac7d 100644 --- a/src/main/java/cn/com/tenlion/service/shop/impl/ShopServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/shop/impl/ShopServiceImpl.java @@ -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 list(Map params) { - return shopDao.list(params); + List list = shopDao.list(params); + for (ShopDTO shopDTO : list) { + UserDTO userDTO = userService.get(shopDTO.getCreator()); + if(userDTO != null){ + shopDTO.setCreatorName(userDTO.getUserName()); + } + } + return list; } @Override diff --git a/src/main/java/cn/com/tenlion/service/shopmember/impl/ShopMemberServiceImpl.java b/src/main/java/cn/com/tenlion/service/shopmember/impl/ShopMemberServiceImpl.java index 52cc93f..1f106f6 100644 --- a/src/main/java/cn/com/tenlion/service/shopmember/impl/ShopMemberServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/shopmember/impl/ShopMemberServiceImpl.java @@ -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 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 ids) { Map 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 ids) { Map 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 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 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 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 params = super.getHashMap(2); - params.put("shopMemberId", shopMemberId); + params.put("memberId", shopMemberId); return getPO(params); } @Override public List list(Map params) { - return shopMemberDao.list(params); + List 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 diff --git a/src/main/java/cn/com/tenlion/service/shopposition/impl/ShopPositionServiceImpl.java b/src/main/java/cn/com/tenlion/service/shopposition/impl/ShopPositionServiceImpl.java index f951447..ad8cf90 100644 --- a/src/main/java/cn/com/tenlion/service/shopposition/impl/ShopPositionServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/shopposition/impl/ShopPositionServiceImpl.java @@ -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 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 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 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 params = super.getHashMap(2); - params.put("shopPositionId", shopPositionId); + params.put("positionId", shopPositionId); return getPO(params); } @Override public List list(Map params) { - return shopPositionDao.list(params); + List list = shopPositionDao.list(params); + for (ShopPositionDTO shopPositionDTO : list) { + UserDTO userDTO = userServicel.get(shopPositionDTO.getCreator()); + if(userDTO != null){ + shopPositionDTO.setCreatorName(userDTO.getUserName()); + } + } + return list; } @Override diff --git a/src/main/java/cn/com/tenlion/service/shopstaff/impl/ShopStaffServiceImpl.java b/src/main/java/cn/com/tenlion/service/shopstaff/impl/ShopStaffServiceImpl.java index 0c7e9c9..d355fa0 100644 --- a/src/main/java/cn/com/tenlion/service/shopstaff/impl/ShopStaffServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/shopstaff/impl/ShopStaffServiceImpl.java @@ -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 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 ids) { Map 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 ids) { Map 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 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 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 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 params = super.getHashMap(2); - params.put("shopStaffId", shopStaffId); + params.put("staffId", shopStaffId); return getPO(params); } @Override public List list(Map params) { - return shopStaffDao.list(params); + List 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 diff --git a/src/main/resources/mybatis/mapper/shop/shop-mapper.xml b/src/main/resources/mybatis/mapper/shop/shop-mapper.xml index 8821d56..8d116b6 100644 --- a/src/main/resources/mybatis/mapper/shop/shop-mapper.xml +++ b/src/main/resources/mybatis/mapper/shop/shop-mapper.xml @@ -141,7 +141,7 @@ shop_summary = #{shopSummary}, - shop_address = #{shopAddress}, + shop_address = #{shopAddress}, shop_star = #{shopStar}, @@ -164,12 +164,6 @@ is_log_off = #{isLogOff}, - - gmt_create = #{gmtCreate}, - - - creator = #{creator}, - gmt_modified = #{gmtModified}, @@ -305,7 +299,7 @@ AND t1.creator = #{creator} - + ORDER BY t1.gmt_create DESC diff --git a/src/main/resources/mybatis/mapper/shopmember/shopmember-mapper.xml b/src/main/resources/mybatis/mapper/shopmember/shopmember-mapper.xml index c9a6c79..319d427 100644 --- a/src/main/resources/mybatis/mapper/shopmember/shopmember-mapper.xml +++ b/src/main/resources/mybatis/mapper/shopmember/shopmember-mapper.xml @@ -3,6 +3,7 @@ + @@ -10,6 +11,7 @@ + @@ -21,6 +23,7 @@ + @@ -33,6 +36,7 @@ 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 + + #{memberIds[${index}]} + + DELETE FROM svc_shop_member WHERE + member_id IN + + #{memberIds[${index}]} + @@ -98,23 +112,27 @@ is_delete = #{isDelete} WHERE + member_id = #{memberId} SELECT + t1.member_id, t1.shop_id, t1.user_id, t1.member_level, @@ -206,6 +230,7 @@ @@ -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 + 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 + 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 @@ - +
@@ -38,8 +38,8 @@
- -
+ +
diff --git a/src/main/resources/static/route/shopmember/list.html b/src/main/resources/static/route/shopmember/list.html index 8113a1d..e7b5abd 100644 --- a/src/main/resources/static/route/shopmember/list.html +++ b/src/main/resources/static/route/shopmember/list.html @@ -34,12 +34,12 @@