Commit 4290fc3f authored by suhuiguang's avatar suhuiguang

1.人员列表未过滤公司bug

parent c211c576
...@@ -62,6 +62,9 @@ public class TzsUserInfoDto extends BaseDto { ...@@ -62,6 +62,9 @@ public class TzsUserInfoDto extends BaseDto {
@ApiModelProperty(value = "单位名称") @ApiModelProperty(value = "单位名称")
private String unitName; private String unitName;
@ApiModelProperty(value = "单位编码")
private String unitCode;
@ApiModelProperty(value = "平台账号id") @ApiModelProperty(value = "平台账号id")
private String amosUserId; private String amosUserId;
......
...@@ -105,6 +105,14 @@ public class TzsUserInfo extends BaseEntity { ...@@ -105,6 +105,14 @@ public class TzsUserInfo extends BaseEntity {
*/ */
@TableField("unit_name") @TableField("unit_name")
private String unitName; private String unitName;
/**
* 企业编码
*/
@TableField("unit_code")
private String unitCode;
/** /**
* 头像 * 头像
*/ */
......
...@@ -4,27 +4,28 @@ ...@@ -4,27 +4,28 @@
<select id="selectPageMessage" resultType="com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto"> <select id="selectPageMessage" resultType="com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto">
SELECT SELECT
sequence_nbr , sequence_nbr,
name, name,
certificate_type, certificate_type,
certificate_num, certificate_num,
post, post,
phone, phone,
birthday, birthday,
unit_name, unit_name,
speciality, speciality,
profile, profile,
amos_user_name, amos_user_name,
amos_user_id, amos_user_id,
lock_status, lock_status,
CASE CASE
WHEN gender = 1 THEN WHEN gender = 1 THEN
'男' ELSE '女' '男' ELSE '女'
END AS gender END AS gender
FROM FROM
tzs_user_info tzs_user_info
<where> <where>
is_delete = false is_delete = false
and unit_code = #{dto.unitCode}
<if test="dto.name != '' and dto.name != null"> <if test="dto.name != '' and dto.name != null">
and name like concat('%',#{dto.name},'%') and name like concat('%',#{dto.name},'%')
</if> </if>
......
...@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo; ...@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserQualifications; import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserQualifications;
import com.yeejoin.amos.boot.module.tcm.api.service.ITzsUserInfoService; import com.yeejoin.amos.boot.module.tcm.api.service.ITzsUserInfoService;
import com.yeejoin.amos.boot.module.tcm.biz.service.impl.TzsUserInfoServiceImpl; import com.yeejoin.amos.boot.module.tcm.biz.service.impl.TzsUserInfoServiceImpl;
import com.yeejoin.amos.component.feign.utils.FeignUtil;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
...@@ -18,8 +19,10 @@ import io.swagger.annotations.ApiOperation; ...@@ -18,8 +19,10 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -44,14 +47,12 @@ public class TzsUserInfoController extends BaseController { ...@@ -44,14 +47,12 @@ public class TzsUserInfoController extends BaseController {
public ResponseModel<TzsUserInfoDto> save(@RequestBody JSONObject map) { public ResponseModel<TzsUserInfoDto> save(@RequestBody JSONObject map) {
Map<String, Object> userInfo = (Map<String, Object>)map.get("userInfo"); Map<String, Object> userInfo = (Map<String, Object>)map.get("userInfo");
TzsUserInfoDto tzsUserInfo = JSON.parseObject(JSON.toJSONString(userInfo), TzsUserInfoDto.class); TzsUserInfoDto tzsUserInfo = JSON.parseObject(JSON.toJSONString(userInfo), TzsUserInfoDto.class);
AgencyUserModel me = Privilege.agencyUserClient.getme().getResult(); List<CompanyModel> companyModels = FeignUtil.remoteCall(()->Privilege.companyClient.queryListByChild(RequestContext.getExeUserId()));
if(!ObjectUtils.isEmpty(me)){ if(companyModels.isEmpty()){
List<CompanyModel> companys = me.getCompanys(); throw new BadRequest("未指定人员归属单位信息");
if (!ObjectUtils.isEmpty(companys)){
tzsUserInfo.setUnitName(companys.get(0).getCompanyName());
}
} }
tzsUserInfo.setUnitName(companyModels.get(0).getCompanyName());
tzsUserInfo.setUnitCode(companyModels.get(0).getCompanyCode());
Map<String, Object> qualificationsInfo = (Map<String, Object>)map.get("qualificationsInfo"); Map<String, Object> qualificationsInfo = (Map<String, Object>)map.get("qualificationsInfo");
Object subForm = qualificationsInfo.get("subForm"); Object subForm = qualificationsInfo.get("subForm");
List<TzsUserQualifications> list = JSON.parseArray(JSON.toJSONString(subForm), TzsUserQualifications.class); List<TzsUserQualifications> list = JSON.parseArray(JSON.toJSONString(subForm), TzsUserQualifications.class);
...@@ -70,13 +71,12 @@ public class TzsUserInfoController extends BaseController { ...@@ -70,13 +71,12 @@ public class TzsUserInfoController extends BaseController {
@RequestParam Long rowId) { @RequestParam Long rowId) {
Map<String, Object> userInfo = (Map<String, Object>)map.get("userInfo"); Map<String, Object> userInfo = (Map<String, Object>)map.get("userInfo");
TzsUserInfo tzsUserInfo = JSON.parseObject(JSON.toJSONString(userInfo), TzsUserInfo.class); TzsUserInfo tzsUserInfo = JSON.parseObject(JSON.toJSONString(userInfo), TzsUserInfo.class);
AgencyUserModel me = Privilege.agencyUserClient.getme().getResult(); List<CompanyModel> companyModels = FeignUtil.remoteCall(()->Privilege.companyClient.queryListByChild(RequestContext.getExeUserId()));
if(!ObjectUtils.isEmpty(me)){ if(companyModels.isEmpty()){
List<CompanyModel> companys = me.getCompanys(); throw new BadRequest("未指定人员归属单位信息");
if (!ObjectUtils.isEmpty(companys)){
tzsUserInfo.setUnitName(companys.get(0).getCompanyName());
}
} }
tzsUserInfo.setUnitName(companyModels.get(0).getCompanyName());
tzsUserInfo.setUnitCode(companyModels.get(0).getCompanyCode());
Map<String, Object> qualificationsInfo = (Map<String, Object>)map.get("qualificationsInfo"); Map<String, Object> qualificationsInfo = (Map<String, Object>)map.get("qualificationsInfo");
Object subForm = qualificationsInfo.get("subForm"); Object subForm = qualificationsInfo.get("subForm");
List<TzsUserQualifications> list = JSON.parseArray(JSON.toJSONString(subForm), TzsUserQualifications.class); List<TzsUserQualifications> list = JSON.parseArray(JSON.toJSONString(subForm), TzsUserQualifications.class);
...@@ -113,10 +113,16 @@ public class TzsUserInfoController extends BaseController { ...@@ -113,10 +113,16 @@ public class TzsUserInfoController extends BaseController {
public ResponseModel<IPage<TzsUserInfoDto>> queryForPage(@RequestParam(value = "current") String current, public ResponseModel<IPage<TzsUserInfoDto>> queryForPage(@RequestParam(value = "current") String current,
@RequestParam(value = "size") String size, @RequestParam(value = "size") String size,
TzsUserInfoDto dto) { TzsUserInfoDto dto) {
List<CompanyModel> companyModels = FeignUtil.remoteCall(()->Privilege.companyClient.queryListByChild(RequestContext.getExeUserId()));
if(companyModels.isEmpty()){
throw new BadRequest("未指定人员归属单位信息");
}
dto.setUnitCode(companyModels.get(0).getCompanyCode());
Page<TzsUserInfoDto> page = new Page<>(); Page<TzsUserInfoDto> page = new Page<>();
page.setCurrent(Long.parseLong(current)); page.setCurrent(Long.parseLong(current));
page.setSize(Long.parseLong(size)); page.setSize(Long.parseLong(size));
return ResponseHelper.buildResponse(tzsUserInfoService.page( dto,page)); return ResponseHelper.buildResponse(tzsUserInfoService.page(dto,page));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment