Commit edb21db1 authored by tianyiming's avatar tianyiming

两员配备编辑人员bug修改

parent ac9ac754
...@@ -51,4 +51,6 @@ public interface ITzsUserInfoService extends IService<TzsUserInfo> { ...@@ -51,4 +51,6 @@ public interface ITzsUserInfoService extends IService<TzsUserInfo> {
Boolean createUnitPerson(); Boolean createUnitPerson();
void testGroup(String groupSeq); void testGroup(String groupSeq);
void deleteGroupAndPersonRelation(String postName, String amosUserId);
} }
...@@ -14,6 +14,7 @@ import com.yeejoin.amos.boot.module.tcm.api.dto.GroupAndPersonInfoDto; ...@@ -14,6 +14,7 @@ import com.yeejoin.amos.boot.module.tcm.api.dto.GroupAndPersonInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsEquipListDto;
import com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto; import com.yeejoin.amos.boot.module.tcm.api.dto.TzsUserInfoDto;
import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo; import com.yeejoin.amos.boot.module.tcm.api.entity.TzsUserInfo;
import com.yeejoin.amos.boot.module.tcm.api.enums.TwoStipulateGroupEnum;
import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsUserInfoMapper; import com.yeejoin.amos.boot.module.tcm.api.mapper.TzsUserInfoMapper;
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;
...@@ -132,6 +133,14 @@ public class TzsUserInfoController extends BaseController { ...@@ -132,6 +133,14 @@ public class TzsUserInfoController extends BaseController {
if(ObjectUtils.isEmpty(companyModel)){ if(ObjectUtils.isEmpty(companyModel)){
throw new BadRequest("未指定人员归属单位信息"); throw new BadRequest("未指定人员归属单位信息");
} }
//删除人员与组的关系
QueryWrapper<TzsUserInfo> queryWrapper2 = new QueryWrapper<>();
queryWrapper2.eq("sequence_nbr",rowId);
queryWrapper2.eq("is_delete",false);
TzsUserInfo selectOne = tzsUserInfoMapper.selectOne(queryWrapper2);
tzsUserInfoServiceImpl.deleteGroupAndPersonRelation(selectOne.getPostName(),selectOne.getAmosUserId());
tzsUserInfo.setUnitName(companyModel.getCompanyName()); tzsUserInfo.setUnitName(companyModel.getCompanyName());
tzsUserInfo.setUnitCode(companyModel.getCompanyCode()); tzsUserInfo.setUnitCode(companyModel.getCompanyCode());
// Map<String, Object> qualificationsInfo = (Map<String, Object>)map.get("qualificationsInfo"); // Map<String, Object> qualificationsInfo = (Map<String, Object>)map.get("qualificationsInfo");
...@@ -139,7 +148,15 @@ public class TzsUserInfoController extends BaseController { ...@@ -139,7 +148,15 @@ public class TzsUserInfoController extends BaseController {
// List<TzsUserQualifications> list = JSON.parseArray(JSON.toJSONString(subForm), TzsUserQualifications.class); // List<TzsUserQualifications> list = JSON.parseArray(JSON.toJSONString(subForm), TzsUserQualifications.class);
tzsUserInfo.setSequenceNbr(rowId); tzsUserInfo.setSequenceNbr(rowId);
tzsUserInfo.setRecDate(new Date()); tzsUserInfo.setRecDate(new Date());
tzsUserInfo.setPostName(tzsUserInfoServiceImpl.setPostName(tzsUserInfo.getPost())); String postName = tzsUserInfoServiceImpl.setPostName(tzsUserInfo.getPost());
tzsUserInfo.setPostName(postName);
// 添加新的人员与组的关系
String[] split = postName.split(",");
List<String> ids = new ArrayList<>();
ids.add(selectOne.getAmosUserId());
for (String s : split) {
Privilege.groupUserClient.create(TwoStipulateGroupEnum.getId.get(s), ids);
}
tzsUserInfoServiceImpl.updateById(tzsUserInfo); tzsUserInfoServiceImpl.updateById(tzsUserInfo);
// if (!ObjectUtils.isEmpty(list)){ // if (!ObjectUtils.isEmpty(list)){
// tzsUserInfoService.updateQualificationsMessage(String.valueOf(tzsUserInfo.getSequenceNbr()),list); // tzsUserInfoService.updateQualificationsMessage(String.valueOf(tzsUserInfo.getSequenceNbr()),list);
......
...@@ -166,13 +166,20 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -166,13 +166,20 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
for (TzsUserInfo userInfo : tzsUserInfos) { for (TzsUserInfo userInfo : tzsUserInfos) {
tzsUserEquipMapper.delete(new QueryWrapper<TzsUserEquip>().eq("user_seq", userInfo.getSequenceNbr())); tzsUserEquipMapper.delete(new QueryWrapper<TzsUserEquip>().eq("user_seq", userInfo.getSequenceNbr()));
Privilege.agencyUserClient.multDeleteUser(userInfo.getAmosUserId()); Privilege.agencyUserClient.multDeleteUser(userInfo.getAmosUserId());
String[] split = userInfo.getPostName().split(","); deleteGroupAndPersonRelation(userInfo.getPostName(),userInfo.getAmosUserId());
for (String s : split) {
Privilege.groupUserClient.deleteGroupUser(TwoStipulateGroupEnum.getId.get(s), userInfo.getAmosUserId());
} }
} }
@Override
public void deleteGroupAndPersonRelation(String postName, String amosUserId) {
String[] split = postName.split(",");
for (String s : split) {
Privilege.groupUserClient.deleteGroupUser(TwoStipulateGroupEnum.getId.get(s), amosUserId);
}
} }
@Override @Override
public Map<String, Object> getDetail(Long id) { public Map<String, Object> getDetail(Long id) {
Map<String, Object> maps = new HashMap<>(); Map<String, Object> maps = new HashMap<>();
...@@ -408,7 +415,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI ...@@ -408,7 +415,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
@Override @Override
public List<TzsUserInfo> getSafetyList(String companyCode) { public List<TzsUserInfo> getSafetyList(String companyCode) {
return tzsUserInfoMapper.selectList(new QueryWrapper<TzsUserInfo>().eq("unit_code", companyCode).like("post", 6549)); return tzsUserInfoMapper.selectList(new QueryWrapper<TzsUserInfo>().eq("unit_code", companyCode).eq("is_delete",false).like("post", 6549));
} }
@Override @Override
......
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