Commit 4290fc3f authored by suhuiguang's avatar suhuiguang

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

parent c211c576
......@@ -62,6 +62,9 @@ public class TzsUserInfoDto extends BaseDto {
@ApiModelProperty(value = "单位名称")
private String unitName;
@ApiModelProperty(value = "单位编码")
private String unitCode;
@ApiModelProperty(value = "平台账号id")
private String amosUserId;
......
......@@ -105,6 +105,14 @@ public class TzsUserInfo extends BaseEntity {
*/
@TableField("unit_name")
private String unitName;
/**
* 企业编码
*/
@TableField("unit_code")
private String unitCode;
/**
* 头像
*/
......
......@@ -4,27 +4,28 @@
<select id="selectPageMessage" resultType="com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto">
SELECT
sequence_nbr ,
name,
certificate_type,
certificate_num,
post,
phone,
birthday,
unit_name,
speciality,
profile,
amos_user_name,
amos_user_id,
lock_status,
CASE
WHEN gender = 1 THEN
'男' ELSE '女'
END AS gender
sequence_nbr,
name,
certificate_type,
certificate_num,
post,
phone,
birthday,
unit_name,
speciality,
profile,
amos_user_name,
amos_user_id,
lock_status,
CASE
WHEN gender = 1 THEN
'男' ELSE '女'
END AS gender
FROM
tzs_user_info
tzs_user_info
<where>
is_delete = false
is_delete = false
and unit_code = #{dto.unitCode}
<if test="dto.name != '' and dto.name != null">
and name like concat('%',#{dto.name},'%')
</if>
......
......@@ -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.service.ITzsUserInfoService;
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.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
......@@ -18,8 +19,10 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
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.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.ResponseModel;
......@@ -44,14 +47,12 @@ public class TzsUserInfoController extends BaseController {
public ResponseModel<TzsUserInfoDto> save(@RequestBody JSONObject map) {
Map<String, Object> userInfo = (Map<String, Object>)map.get("userInfo");
TzsUserInfoDto tzsUserInfo = JSON.parseObject(JSON.toJSONString(userInfo), TzsUserInfoDto.class);
AgencyUserModel me = Privilege.agencyUserClient.getme().getResult();
if(!ObjectUtils.isEmpty(me)){
List<CompanyModel> companys = me.getCompanys();
if (!ObjectUtils.isEmpty(companys)){
tzsUserInfo.setUnitName(companys.get(0).getCompanyName());
}
List<CompanyModel> companyModels = FeignUtil.remoteCall(()->Privilege.companyClient.queryListByChild(RequestContext.getExeUserId()));
if(companyModels.isEmpty()){
throw new BadRequest("未指定人员归属单位信息");
}
tzsUserInfo.setUnitName(companyModels.get(0).getCompanyName());
tzsUserInfo.setUnitCode(companyModels.get(0).getCompanyCode());
Map<String, Object> qualificationsInfo = (Map<String, Object>)map.get("qualificationsInfo");
Object subForm = qualificationsInfo.get("subForm");
List<TzsUserQualifications> list = JSON.parseArray(JSON.toJSONString(subForm), TzsUserQualifications.class);
......@@ -70,13 +71,12 @@ public class TzsUserInfoController extends BaseController {
@RequestParam Long rowId) {
Map<String, Object> userInfo = (Map<String, Object>)map.get("userInfo");
TzsUserInfo tzsUserInfo = JSON.parseObject(JSON.toJSONString(userInfo), TzsUserInfo.class);
AgencyUserModel me = Privilege.agencyUserClient.getme().getResult();
if(!ObjectUtils.isEmpty(me)){
List<CompanyModel> companys = me.getCompanys();
if (!ObjectUtils.isEmpty(companys)){
tzsUserInfo.setUnitName(companys.get(0).getCompanyName());
}
List<CompanyModel> companyModels = FeignUtil.remoteCall(()->Privilege.companyClient.queryListByChild(RequestContext.getExeUserId()));
if(companyModels.isEmpty()){
throw new BadRequest("未指定人员归属单位信息");
}
tzsUserInfo.setUnitName(companyModels.get(0).getCompanyName());
tzsUserInfo.setUnitCode(companyModels.get(0).getCompanyCode());
Map<String, Object> qualificationsInfo = (Map<String, Object>)map.get("qualificationsInfo");
Object subForm = qualificationsInfo.get("subForm");
List<TzsUserQualifications> list = JSON.parseArray(JSON.toJSONString(subForm), TzsUserQualifications.class);
......@@ -113,10 +113,16 @@ public class TzsUserInfoController extends BaseController {
public ResponseModel<IPage<TzsUserInfoDto>> queryForPage(@RequestParam(value = "current") String current,
@RequestParam(value = "size") String size,
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.setCurrent(Long.parseLong(current));
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