新增部门按地区查询
This commit is contained in:
parent
c568723cff
commit
e0a694ac2b
@ -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);
|
||||
@ -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<TeamMemberDTO> listByAreaCodeAndRoleId(@PathVariable("areaCode") String areaCode,
|
||||
@PathVariable("roleId") String roleId) {
|
||||
return teamMemberService.listByAreaCodeAndRoleId(areaCode, roleId);
|
||||
}
|
||||
|
||||
}
|
@ -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();
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -211,4 +211,30 @@ public interface ITeamMemberService {
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<TeamMemberDTO>> listPageByTeamId(String teamId, ListPage page);
|
||||
|
||||
/**
|
||||
* 队伍人员列表
|
||||
*
|
||||
* @param areaCode
|
||||
* @return
|
||||
*/
|
||||
List<TeamMemberPO> listPOByAreaCode(String areaCode);
|
||||
|
||||
/**
|
||||
* 队伍人员列表
|
||||
*
|
||||
* @param userIds
|
||||
* @param areaCode
|
||||
* @return
|
||||
*/
|
||||
List<TeamMemberDTO> listByUserIdsAndAreaCode(List<String> userIds, String areaCode);
|
||||
|
||||
/**
|
||||
* 队伍人员列表
|
||||
*
|
||||
* @param areaCode 地区编码
|
||||
* @param roleId 角色ID
|
||||
* @return
|
||||
*/
|
||||
List<TeamMemberDTO> listByAreaCodeAndRoleId(String areaCode, String roleId);
|
||||
}
|
@ -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<TeamMemberPO> listPOByAreaCode(String areaCode) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
params.put("areaCode", areaCode);
|
||||
return listPO(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TeamMemberDTO> listByUserIdsAndAreaCode(List<String> userIds, String areaCode) {
|
||||
Map<String, Object> params = getHashMap(4);
|
||||
params.put("userIds", userIds);
|
||||
params.put("areaCode", areaCode);
|
||||
return list(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TeamMemberDTO> listByAreaCodeAndRoleId(String areaCode, String roleId) {
|
||||
List<String> userIds = roleUserBaseService.listUserId(roleId);
|
||||
if (userIds.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return listByUserIdsAndAreaCode(userIds, areaCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置用户
|
||||
*
|
||||
|
@ -340,6 +340,10 @@
|
||||
AND
|
||||
t1.team_id = #{teamId}
|
||||
</if>
|
||||
<if test="areaCode != null and areaCode != ''">
|
||||
AND
|
||||
t1.area_code = #{areaCode}
|
||||
</if>
|
||||
<if test="teamMemberIds != null and teamMemberIds.size > 0">
|
||||
AND
|
||||
t1.team_member_id IN
|
||||
|
@ -82,10 +82,11 @@
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-xs6">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-form-item" pane>
|
||||
<label class="layui-form-label">组织状态</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" id="organizationStatus" name="organizationStatus" class="layui-input" value="" placeholder="请输入组织状态">
|
||||
<input type="radio" name="organizationStatus" value="0" title="不正常">
|
||||
<input type="radio" name="organizationStatus" value="1" title="正常" checked>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -82,10 +82,11 @@
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-xs6">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-form-item" pane>
|
||||
<label class="layui-form-label">组织状态</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" id="organizationStatus" name="organizationStatus" class="layui-input" value="" placeholder="请输入组织状态">
|
||||
<input type="radio" name="organizationStatus" value="0" title="不正常">
|
||||
<input type="radio" name="organizationStatus" value="1" title="正常" checked>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user