From e0a694ac2bbfbdf6095383237fef861a3a0242b7 Mon Sep 17 00:00:00 2001 From: wanggeng <450292408@qq.com> Date: Sat, 6 Nov 2021 16:36:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=83=A8=E9=97=A8=E6=8C=89?= =?UTF-8?q?=E5=9C=B0=E5=8C=BA=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/teammember/TeamMemberController.java | 48 ++++++++++++------- .../pojo/vos/organization/OrganizationVO.java | 20 +++++--- .../impl/EnterpriseServiceImpl.java | 9 +++- .../impl/OrganizationServiceImpl.java | 11 ++++- .../teammember/ITeamMemberService.java | 26 ++++++++++ .../impl/TeamMemberServiceImpl.java | 27 +++++++++++ .../mapper/teammember/team-member-mapper.xml | 4 ++ .../templates/organization/save.html | 5 +- .../templates/organization/update.html | 5 +- 9 files changed, 125 insertions(+), 30 deletions(-) diff --git a/src/main/java/cn/com/tenlion/usercenter/controller/api/teammember/TeamMemberController.java b/src/main/java/cn/com/tenlion/usercenter/controller/api/teammember/TeamMemberController.java index a333104..64c6cd5 100644 --- a/src/main/java/cn/com/tenlion/usercenter/controller/api/teammember/TeamMemberController.java +++ b/src/main/java/cn/com/tenlion/usercenter/controller/api/teammember/TeamMemberController.java @@ -1,5 +1,8 @@ package cn.com.tenlion.usercenter.controller.api.teammember; +import cn.com.tenlion.usercenter.pojo.dtos.teammember.TeamMemberDTO; +import cn.com.tenlion.usercenter.pojo.vos.teammember.TeamMemberVO; +import cn.com.tenlion.usercenter.service.teammember.ITeamMemberService; import ink.wgink.annotation.CheckRequestBodyAnnotation; import ink.wgink.common.base.DefaultBaseController; import ink.wgink.exceptions.ParamsException; @@ -9,9 +12,6 @@ import ink.wgink.pojo.result.ErrorResult; import ink.wgink.pojo.result.SuccessResult; import ink.wgink.pojo.result.SuccessResultData; import ink.wgink.pojo.result.SuccessResultList; -import cn.com.tenlion.usercenter.pojo.dtos.teammember.TeamMemberDTO; -import cn.com.tenlion.usercenter.pojo.vos.teammember.TeamMemberVO; -import cn.com.tenlion.usercenter.service.teammember.ITeamMemberService; import io.swagger.annotations.*; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -41,7 +41,7 @@ public class TeamMemberController extends DefaultBaseController { @PostMapping("save") @CheckRequestBodyAnnotation public SuccessResult save(@RequestBody TeamMemberVO teamMemberVO) { - if(StringUtils.isBlank(teamMemberVO.getTeamId())) { + if (StringUtils.isBlank(teamMemberVO.getTeamId())) { throw new ParamsException("队伍不能为空"); } teamMemberService.save(teamMemberVO); @@ -50,7 +50,7 @@ public class TeamMemberController extends DefaultBaseController { @ApiOperation(value = "删除队伍人员", notes = "删除队伍人员接口") @ApiImplicitParams({ - @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3") + @ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3") }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @DeleteMapping("remove/{ids}") @@ -61,7 +61,7 @@ public class TeamMemberController extends DefaultBaseController { @ApiOperation(value = "修改队伍人员", notes = "修改队伍人员接口") @ApiImplicitParams({ - @ApiImplicitParam(name = "teamMemberId", value = "队伍人员ID", paramType = "path") + @ApiImplicitParam(name = "teamMemberId", value = "队伍人员ID", paramType = "path") }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PutMapping("update/{teamMemberId}") @@ -73,11 +73,11 @@ public class TeamMemberController extends DefaultBaseController { @ApiOperation(value = "队伍人员详情", notes = "队伍人员详情接口") @ApiImplicitParams({ - @ApiImplicitParam(name = "teamMemberId", value = "队伍人员ID", paramType = "path") + @ApiImplicitParam(name = "teamMemberId", value = "队伍人员ID", paramType = "path") }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("get/{teamMemberId}") - public TeamMemberDTO get(@PathVariable("teamMemberId") String teamMemberId) { + public TeamMemberDTO get(@PathVariable("teamMemberId") String teamMemberId) { return teamMemberService.get(teamMemberId); } @@ -99,11 +99,11 @@ public class TeamMemberController extends DefaultBaseController { @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") + @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("listpage") @@ -115,11 +115,11 @@ public class TeamMemberController extends DefaultBaseController { @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") + @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("listpage/team-id/{teamId}") @@ -137,4 +137,16 @@ public class TeamMemberController extends DefaultBaseController { return new SuccessResultData<>(teamMemberService.count(params)); } + @ApiOperation(value = "队伍人员列表", notes = "队伍人员列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "areaCode", value = "地区编码", paramType = "path", required = true), + @ApiImplicitParam(name = "roleId", value = "角色ID", paramType = "path", required = true), + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list/area-code/{areaCode}/role-id/{roleId}") + public List listByAreaCodeAndRoleId(@PathVariable("areaCode") String areaCode, + @PathVariable("roleId") String roleId) { + return teamMemberService.listByAreaCodeAndRoleId(areaCode, roleId); + } + } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/usercenter/pojo/vos/organization/OrganizationVO.java b/src/main/java/cn/com/tenlion/usercenter/pojo/vos/organization/OrganizationVO.java index 2372640..7637231 100644 --- a/src/main/java/cn/com/tenlion/usercenter/pojo/vos/organization/OrganizationVO.java +++ b/src/main/java/cn/com/tenlion/usercenter/pojo/vos/organization/OrganizationVO.java @@ -6,7 +6,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; /** - * * @ClassName: OrganizationVO * @Description: 社会组织 * @Author: CodeFactory @@ -54,8 +53,9 @@ public class OrganizationVO { @ApiModelProperty(name = "masterPhone", value = "负责人联系方式") private String masterPhone; @ApiModelProperty(name = "masterIdCardCode", value = "负责人证件代码") - @CheckNumberAnnotation(name = "负责人证件代码") - private Integer masterIdCardCode; + private String masterIdCardCode; + @ApiModelProperty(name = "masterIdCardCodeName", value = "负责人证件代码名称") + private String masterIdCardCodeName; @ApiModelProperty(name = "masterIdCard", value = "负责人证件号码") private String masterIdCard; @ApiModelProperty(name = "masterIdCardFront", value = "负责人证件正面") @@ -251,14 +251,22 @@ public class OrganizationVO { this.masterPhone = masterPhone; } - public Integer getMasterIdCardCode() { - return masterIdCardCode == null ? 0 : masterIdCardCode; + public String getMasterIdCardCode() { + return masterIdCardCode == null ? "" : masterIdCardCode.trim(); } - public void setMasterIdCardCode(Integer masterIdCardCode) { + public void setMasterIdCardCode(String masterIdCardCode) { this.masterIdCardCode = masterIdCardCode; } + public String getMasterIdCardCodeName() { + return masterIdCardCodeName == null ? "" : masterIdCardCodeName.trim(); + } + + public void setMasterIdCardCodeName(String masterIdCardCodeName) { + this.masterIdCardCodeName = masterIdCardCodeName; + } + public String getMasterIdCard() { return masterIdCard == null ? "" : masterIdCard.trim(); } diff --git a/src/main/java/cn/com/tenlion/usercenter/service/enterprise/impl/EnterpriseServiceImpl.java b/src/main/java/cn/com/tenlion/usercenter/service/enterprise/impl/EnterpriseServiceImpl.java index 9319a4b..79493a2 100644 --- a/src/main/java/cn/com/tenlion/usercenter/service/enterprise/impl/EnterpriseServiceImpl.java +++ b/src/main/java/cn/com/tenlion/usercenter/service/enterprise/impl/EnterpriseServiceImpl.java @@ -5,7 +5,9 @@ import cn.com.tenlion.usercenter.pojo.bos.enterprise.EnterpriseBO; import cn.com.tenlion.usercenter.pojo.dtos.enterprise.EnterpriseDTO; import cn.com.tenlion.usercenter.pojo.pos.enterprise.EnterprisePO; import cn.com.tenlion.usercenter.pojo.vos.enterprise.EnterpriseVO; +import cn.com.tenlion.usercenter.pojo.vos.enterprisegridmember.EnterpriseGridMemberVO; import cn.com.tenlion.usercenter.service.enterprise.IEnterpriseService; +import cn.com.tenlion.usercenter.service.enterprisegridmember.IEnterpriseGridMemberService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import ink.wgink.common.base.DefaultBaseService; @@ -33,6 +35,8 @@ public class EnterpriseServiceImpl extends DefaultBaseService implements IEnterp @Autowired private IEnterpriseDao enterpriseDao; + @Autowired + private IEnterpriseGridMemberService enterpriseGridMemberService; @Override public void save(EnterpriseVO enterpriseVO) { @@ -41,7 +45,10 @@ public class EnterpriseServiceImpl extends DefaultBaseService implements IEnterp @Override public void save(String token, EnterpriseVO enterpriseVO) { - saveReturnId(token, enterpriseVO); + String enterpriseId = saveReturnId(token, enterpriseVO); + EnterpriseGridMemberVO enterpriseGridMemberVO = new EnterpriseGridMemberVO(); + enterpriseGridMemberVO.setEnterpriseId(enterpriseId); + enterpriseGridMemberService.save(token, enterpriseGridMemberVO); } @Override diff --git a/src/main/java/cn/com/tenlion/usercenter/service/organization/impl/OrganizationServiceImpl.java b/src/main/java/cn/com/tenlion/usercenter/service/organization/impl/OrganizationServiceImpl.java index 8c259d8..8b699e9 100644 --- a/src/main/java/cn/com/tenlion/usercenter/service/organization/impl/OrganizationServiceImpl.java +++ b/src/main/java/cn/com/tenlion/usercenter/service/organization/impl/OrganizationServiceImpl.java @@ -5,7 +5,9 @@ import cn.com.tenlion.usercenter.pojo.bos.organization.OrganizationBO; import cn.com.tenlion.usercenter.pojo.dtos.organization.OrganizationDTO; import cn.com.tenlion.usercenter.pojo.pos.organization.OrganizationPO; import cn.com.tenlion.usercenter.pojo.vos.organization.OrganizationVO; +import cn.com.tenlion.usercenter.pojo.vos.organizationgridmember.OrganizationGridMemberVO; import cn.com.tenlion.usercenter.service.organization.IOrganizationService; +import cn.com.tenlion.usercenter.service.organizationgridmember.IOrganizationGridMemberService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import ink.wgink.common.base.DefaultBaseService; @@ -33,6 +35,8 @@ public class OrganizationServiceImpl extends DefaultBaseService implements IOrga @Autowired private IOrganizationDao organizationDao; + @Autowired + private IOrganizationGridMemberService organizationGridMemberService; @Override public void save(OrganizationVO organizationVO) { @@ -41,7 +45,12 @@ public class OrganizationServiceImpl extends DefaultBaseService implements IOrga @Override public void save(String token, OrganizationVO organizationVO) { - saveReturnId(token, organizationVO); + String organizationId = saveReturnId(token, organizationVO); + + OrganizationGridMemberVO organizationGridMemberVO = new OrganizationGridMemberVO(); + organizationGridMemberVO.setOrganizationId(organizationId); + organizationGridMemberVO.setUserId(getAppTokenUser(token).getId()); + organizationGridMemberService.save(token, organizationGridMemberVO); } @Override diff --git a/src/main/java/cn/com/tenlion/usercenter/service/teammember/ITeamMemberService.java b/src/main/java/cn/com/tenlion/usercenter/service/teammember/ITeamMemberService.java index 90a2e93..4eb6d2c 100644 --- a/src/main/java/cn/com/tenlion/usercenter/service/teammember/ITeamMemberService.java +++ b/src/main/java/cn/com/tenlion/usercenter/service/teammember/ITeamMemberService.java @@ -211,4 +211,30 @@ public interface ITeamMemberService { * @return */ SuccessResultList> listPageByTeamId(String teamId, ListPage page); + + /** + * 队伍人员列表 + * + * @param areaCode + * @return + */ + List listPOByAreaCode(String areaCode); + + /** + * 队伍人员列表 + * + * @param userIds + * @param areaCode + * @return + */ + List listByUserIdsAndAreaCode(List userIds, String areaCode); + + /** + * 队伍人员列表 + * + * @param areaCode 地区编码 + * @param roleId 角色ID + * @return + */ + List listByAreaCodeAndRoleId(String areaCode, String roleId); } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/usercenter/service/teammember/impl/TeamMemberServiceImpl.java b/src/main/java/cn/com/tenlion/usercenter/service/teammember/impl/TeamMemberServiceImpl.java index 298563c..d1f7568 100644 --- a/src/main/java/cn/com/tenlion/usercenter/service/teammember/impl/TeamMemberServiceImpl.java +++ b/src/main/java/cn/com/tenlion/usercenter/service/teammember/impl/TeamMemberServiceImpl.java @@ -10,6 +10,7 @@ import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import ink.wgink.common.base.DefaultBaseService; import ink.wgink.exceptions.SearchException; +import ink.wgink.interfaces.role.IRoleUserBaseService; import ink.wgink.interfaces.user.IUserBaseService; import ink.wgink.pojo.ListPage; import ink.wgink.pojo.dtos.user.UserDTO; @@ -36,6 +37,8 @@ public class TeamMemberServiceImpl extends DefaultBaseService implements ITeamMe private ITeamMemberDao teamMemberDao; @Autowired private IUserBaseService userBaseService; + @Autowired + private IRoleUserBaseService roleUserBaseService; @Override public void save(TeamMemberVO teamMemberVO) { @@ -209,6 +212,30 @@ public class TeamMemberServiceImpl extends DefaultBaseService implements ITeamMe return listPage(page); } + @Override + public List listPOByAreaCode(String areaCode) { + Map params = getHashMap(2); + params.put("areaCode", areaCode); + return listPO(params); + } + + @Override + public List listByUserIdsAndAreaCode(List userIds, String areaCode) { + Map params = getHashMap(4); + params.put("userIds", userIds); + params.put("areaCode", areaCode); + return list(params); + } + + @Override + public List listByAreaCodeAndRoleId(String areaCode, String roleId) { + List userIds = roleUserBaseService.listUserId(roleId); + if (userIds.isEmpty()) { + return new ArrayList<>(); + } + return listByUserIdsAndAreaCode(userIds, areaCode); + } + /** * 设置用户 * diff --git a/src/main/resources/mybatis/mapper/teammember/team-member-mapper.xml b/src/main/resources/mybatis/mapper/teammember/team-member-mapper.xml index 09ba51b..0e6f2ee 100644 --- a/src/main/resources/mybatis/mapper/teammember/team-member-mapper.xml +++ b/src/main/resources/mybatis/mapper/teammember/team-member-mapper.xml @@ -340,6 +340,10 @@ AND t1.team_id = #{teamId} + + AND + t1.area_code = #{areaCode} + AND t1.team_member_id IN diff --git a/src/main/resources/templates/organization/save.html b/src/main/resources/templates/organization/save.html index c22da7a..2cb44e7 100644 --- a/src/main/resources/templates/organization/save.html +++ b/src/main/resources/templates/organization/save.html @@ -82,10 +82,11 @@
-
+
- + +
diff --git a/src/main/resources/templates/organization/update.html b/src/main/resources/templates/organization/update.html index 2d425a5..7df6621 100644 --- a/src/main/resources/templates/organization/update.html +++ b/src/main/resources/templates/organization/update.html @@ -82,10 +82,11 @@
-
+
- + +