提交 220891c1 编写于 作者: wenhao.qin's avatar wenhao.qin

补充上次

上级 7fd074e7
流水线 #43108 已失败 于阶段
package com.pica.cloud.account.account.server.entity;
import java.util.Date;
public class SaaSMenu {
private Integer id;
private Long hospitalId;
private String permissionRoleId;
private String name;
private String url;
private Integer parentId;
private Integer systemType;
private Integer seq;
private Integer deleteFlag;
private Integer creatId;
private Date creatTime;
private Integer modifyId;
private Date modifyTime;
private String icon;
private Integer menuType;
private Integer secondMenuId;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Long getHospitalId() {
return hospitalId;
}
public void setHospitalId(Long hospitalId) {
this.hospitalId = hospitalId;
}
public String getPermissionRoleId() {
return permissionRoleId;
}
public void setPermissionRoleId(String permissionRoleId) {
this.permissionRoleId = permissionRoleId == null ? null : permissionRoleId.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url == null ? null : url.trim();
}
public Integer getParentId() {
return parentId;
}
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
public Integer getSystemType() {
return systemType;
}
public void setSystemType(Integer systemType) {
this.systemType = systemType;
}
public Integer getSeq() {
return seq;
}
public void setSeq(Integer seq) {
this.seq = seq;
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
public Integer getCreatId() {
return creatId;
}
public void setCreatId(Integer creatId) {
this.creatId = creatId;
}
public Date getCreatTime() {
return creatTime;
}
public void setCreatTime(Date creatTime) {
this.creatTime = creatTime;
}
public Integer getModifyId() {
return modifyId;
}
public void setModifyId(Integer modifyId) {
this.modifyId = modifyId;
}
public Date getModifyTime() {
return modifyTime;
}
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon == null ? null : icon.trim();
}
public Integer getMenuType() {
return menuType;
}
public void setMenuType(Integer menuType) {
this.menuType = menuType;
}
public Integer getSecondMenuId() {
return secondMenuId;
}
public void setSecondMenuId(Integer secondMenuId) {
this.secondMenuId = secondMenuId;
}
}
\ No newline at end of file
package com.pica.cloud.account.account.server.mapper;
import com.pica.cloud.account.account.server.entity.SaaSMenu;
import java.util.List;
import java.util.Map;
public interface SaaSMenuMapper {
int deleteByPrimaryKey(Integer id);
int insert(SaaSMenu record);
int insertSelective(SaaSMenu record);
SaaSMenu selectByPrimaryKey(Integer id);
int batchInsert(List<SaaSMenu> list);
List<SaaSMenu> selectByRoleId(String id);
int updateByPrimaryKeySelective(SaaSMenu record);
int updateByPrimaryKey(SaaSMenu record);
int deleteByRoleId(Map<String, Object> map);
}
\ No newline at end of file
......@@ -2,10 +2,12 @@
package com.pica.cloud.account.account.server.service.impl;
import com.pica.cloud.account.account.server.entity.PermissionRole;
import com.pica.cloud.account.account.server.entity.SaaSMenu;
import com.pica.cloud.account.account.server.enums.AccountExceptionEnum;
import com.pica.cloud.account.account.server.enums.SaasRoleEnum;
import com.pica.cloud.account.account.server.mapper.PermissionDoctorRoleMapper;
import com.pica.cloud.account.account.server.mapper.PermissionRoleMapper;
import com.pica.cloud.account.account.server.mapper.SaaSMenuMapper;
import com.pica.cloud.account.account.server.req.HospitalRoleDetailReq;
import com.pica.cloud.account.account.server.req.HospitalRoleListReq;
import com.pica.cloud.account.account.server.resp.*;
......@@ -32,8 +34,11 @@ public class HospitalSaasRoleServiceImpl implements HospitalSaasRoleService {
PermissionRoleMapper permissionRoleMapper;
@Autowired
PermissionDoctorRoleMapper permissionDoctorRoleMapper;
@Autowired
SaaSMenuMapper saaSMenuMapper;
@Override
@Transactional
public int insertAndModify(HospitalRoleDetailReq req, PicaUser user) {
if (StringUtils.isEmpty(req.getName()) || req.getName().trim().length() > 16) {
throw new PicaWarnException(PicaResultCode.DATA_EXCEPTION.code(), "姓名长度≤16字符");
......@@ -69,6 +74,15 @@ public class HospitalSaasRoleServiceImpl implements HospitalSaasRoleService {
role.setModifiedId(Long.valueOf(user.getId()));
role.setModifiedTime(new Date());
num = permissionRoleMapper.insertSelective(role);
List<SaaSMenu> saaSMenus = saaSMenuMapper.selectByRoleId(String.valueOf(4));
saaSMenus.forEach(t -> {
t.setPermissionRoleId(String.valueOf(role.getId()));
t.setModifyId(user.getId());
t.setModifyTime(new Date());
t.setCreatTime(new Date());
t.setCreatId(user.getId());
});
saaSMenuMapper.batchInsert(saaSMenus);
}
return num;
}
......@@ -107,6 +121,7 @@ public class HospitalSaasRoleServiceImpl implements HospitalSaasRoleService {
map.put("modifiedTime", new Date());
permissionRoleMapper.deleteById(map);
permissionDoctorRoleMapper.deleteByRoleId(map);
saaSMenuMapper.deleteByRoleId(map);
return 1;
}
......
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册