|
@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
import com.yihu.jw.base.dao.equipment.WlyyUserAreaDao;
|
|
|
|
import com.yihu.jw.base.dao.equipment.WlyyUserEquipmentDao;
|
|
import com.yihu.jw.base.dao.role.BaseRoleMenuDao;
|
|
import com.yihu.jw.base.dao.role.BaseRoleMenuDao;
|
|
import com.yihu.jw.base.dao.role.RoleDao;
|
|
import com.yihu.jw.base.dao.role.RoleDao;
|
|
import com.yihu.jw.base.dao.saas.SaasDao;
|
|
import com.yihu.jw.base.dao.saas.SaasDao;
|
|
@ -15,6 +17,8 @@ import com.yihu.jw.entity.base.org.BaseOrgUserDO;
|
|
import com.yihu.jw.entity.base.role.RoleDO;
|
|
import com.yihu.jw.entity.base.role.RoleDO;
|
|
import com.yihu.jw.entity.base.saas.SaasDO;
|
|
import com.yihu.jw.entity.base.saas.SaasDO;
|
|
import com.yihu.jw.entity.base.user.UserDO;
|
|
import com.yihu.jw.entity.base.user.UserDO;
|
|
|
|
import com.yihu.jw.entity.equipment.WlyyUserAreaDO;
|
|
|
|
import com.yihu.jw.entity.equipment.WlyyUserEquipmentDO;
|
|
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
|
|
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
|
|
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
|
|
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
|
|
import com.yihu.jw.restmodel.base.wx.WxGraphicMessageVO;
|
|
import com.yihu.jw.restmodel.base.wx.WxGraphicMessageVO;
|
|
@ -68,7 +72,9 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
|
|
private OrgTreeService orgTreeService;
|
|
private OrgTreeService orgTreeService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private BaseOrgSaasService baseOrgSaasService;
|
|
|
|
|
|
private WlyyUserAreaDao userAreaDao;
|
|
|
|
@Autowired
|
|
|
|
private WlyyUserEquipmentDao userEquipmentDao;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private StringRedisTemplate redisTemplate;
|
|
private StringRedisTemplate redisTemplate;
|
|
@ -320,6 +326,9 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
|
|
JSONObject jsonObject = JSONObject.parseObject(jsonData);
|
|
JSONObject jsonObject = JSONObject.parseObject(jsonData);
|
|
JSONObject user = jsonObject.getJSONObject("user");
|
|
JSONObject user = jsonObject.getJSONObject("user");
|
|
JSONArray org = jsonObject.getJSONArray("org");
|
|
JSONArray org = jsonObject.getJSONArray("org");
|
|
|
|
JSONArray area = jsonObject.getJSONArray("area");
|
|
|
|
JSONArray equipment = jsonObject.getJSONArray("equipment");
|
|
|
|
|
|
//归属租户为默认租户,表示用户为超级管理员,不需要机构
|
|
//归属租户为默认租户,表示用户为超级管理员,不需要机构
|
|
if (null == user || CollectionUtils.isEmpty(org) && !user.getString("saasId").equalsIgnoreCase(defaultSaasId)) {
|
|
if (null == user || CollectionUtils.isEmpty(org) && !user.getString("saasId").equalsIgnoreCase(defaultSaasId)) {
|
|
result.put("msg", "请点击机构管理选择所在机构");
|
|
result.put("msg", "请点击机构管理选择所在机构");
|
|
@ -354,6 +363,44 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
|
|
}
|
|
}
|
|
baseOrgUserService.batchInsert(orgList);
|
|
baseOrgUserService.batchInsert(orgList);
|
|
}
|
|
}
|
|
|
|
//area:[{"city":"","cityName":"","town":"","townName":"","hospital":"","hospitalName":""}]
|
|
|
|
//用户所属区域添加
|
|
|
|
if (area!=null&&area.size()!=0){
|
|
|
|
userAreaDao.deleteByUserId(userDO.getId());
|
|
|
|
for (int i=0;i<area.size();i++){
|
|
|
|
JSONObject object = area.getJSONObject(i);
|
|
|
|
WlyyUserAreaDO userAreaDO = new WlyyUserAreaDO();
|
|
|
|
userAreaDO.setUserId(userDO.getId());
|
|
|
|
userAreaDO.setCity(object.getString("city"));
|
|
|
|
userAreaDO.setCityName(object.getString("cityName"));
|
|
|
|
userAreaDO.setTown(object.getString("town"));
|
|
|
|
userAreaDO.setTownName(object.getString("townName"));
|
|
|
|
if (!StringUtils.isEmpty(object.getString("hospital"))){
|
|
|
|
userAreaDO.setHospital(object.getString("hospital"));
|
|
|
|
userAreaDO.setHospitalName(object.getString("hospitalName"));
|
|
|
|
}
|
|
|
|
userAreaDO.setCreateTime(new Date());
|
|
|
|
userAreaDO.setUpdateTime(new Date());
|
|
|
|
userAreaDO.setDel(1);
|
|
|
|
userAreaDao.save(userAreaDO);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//用户所管设备添加
|
|
|
|
//equipment:[{"equipmentId":"","equipmentName":""}]
|
|
|
|
if (equipment!=null&&equipment.size()!=0){
|
|
|
|
userEquipmentDao.deleteByUserId(userDO.getId());
|
|
|
|
for (int i=0;i<equipment.size();i++){
|
|
|
|
JSONObject object = equipment.getJSONObject(i);
|
|
|
|
WlyyUserEquipmentDO userEquipmentDO = new WlyyUserEquipmentDO();
|
|
|
|
userEquipmentDO.setDel(1);
|
|
|
|
userEquipmentDO.setUserId(userDO.getId());
|
|
|
|
userEquipmentDO.setEquipmentId(object.getString("equipmentId"));
|
|
|
|
userEquipmentDO.setEquipmentName(object.getString("equipmentName"));
|
|
|
|
userEquipmentDO.setCreateTime(new Date());
|
|
|
|
userEquipmentDO.setUpdateTime(new Date());
|
|
|
|
userEquipmentDao.save(userEquipmentDO);
|
|
|
|
}
|
|
|
|
}
|
|
JSONObject returnMsg = new JSONObject();
|
|
JSONObject returnMsg = new JSONObject();
|
|
returnMsg.put("username",userDO.getUsername());
|
|
returnMsg.put("username",userDO.getUsername());
|
|
returnMsg.put("password",userDO.getIdcard().substring(userDO.getIdcard().length()-6,userDO.getIdcard().length()));
|
|
returnMsg.put("password",userDO.getIdcard().substring(userDO.getIdcard().length()-6,userDO.getIdcard().length()));
|