| | |
| | | package cn.gistack.sm.sjztmd.service.impl; |
| | | |
| | | import cn.gistack.sm.intelligentCall.entity.Scene; |
| | | import cn.gistack.sm.sjztmd.entity.AttResManagePerson; |
| | | import cn.gistack.sm.sjztmd.entity.PatrolResponsiblePerson; |
| | | import cn.gistack.sm.sjztmd.mapper.AttResManagePersonMapper; |
| | | import cn.gistack.sm.sjztmd.service.IAttResBaseService; |
| | | import cn.gistack.sm.sjztmd.service.IAttResManagePersonService; |
| | | import cn.gistack.sm.sjztmd.vo.AttResBaseVO; |
| | | import cn.gistack.sm.sjztmd.vo.PersonVO; |
| | | import cn.gistack.sm.sjztmd.vo.UserPersonVO; |
| | | import cn.gistack.system.user.entity.User; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IUserClient userClient; |
| | | |
| | | @Autowired |
| | | private IAttResBaseService attResBaseService; |
| | | |
| | | @Override |
| | | public Boolean saveOrUpdateResManagePerson(AttResManagePerson attResManagePerson) { |
| | |
| | | User user = new User(); |
| | | user.setId(Long.parseLong(vo.getUserPhone())); |
| | | user.setAccount(vo.getUserPhone()); |
| | | user.setPassword("383977f7a48c4600a6cadff28f4340cee30f3011"); |
| | | user.setPassword("Zhsk@123456"); |
| | | user.setRoleId(vo.getRoleId()); |
| | | // 如果是巡查责任人,设置为默认部门 |
| | | if (user.getRoleId().equals("1642713427301355522")) { |
| | | user.setDeptId(String.valueOf(Integer.parseInt(vo.getAdCode()) + 1)); |
| | | user.setDeptId(String.valueOf(Long.valueOf(vo.getAdCode()) + 1)); |
| | | } else { |
| | | user.setDeptId(vo.getAdCode()); |
| | | } |
| | |
| | | user.setRealName(vo.getUserName().trim()); |
| | | user.setPhone(vo.getUserPhone()); |
| | | try { |
| | | R<List<User>> listR = userClient.userInfoByPhoneOrAccount("000000",user.getPhone()); |
| | | // 存在不保存 |
| | | if (listR.getData().size() > 0) { |
| | | continue; |
| | | } |
| | | R<Boolean> ret = userClient.saveUser(user); |
| | | if (ret.getData()) { |
| | | i++; |
| | |
| | | public Set<String> getPersonListByWaterCodeList(List<String> list) { |
| | | return baseMapper.getPersonListByWaterCodeList(list); |
| | | } |
| | | |
| | | /** |
| | | * 根据水库编号查询市县水利部人员姓名及联系方式 |
| | | * @param res_cd 水库编号 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<PersonVO> getCityCountyPersonListByResGuid(String res_cd) { |
| | | List<PersonVO> personVOList = new ArrayList<>(); |
| | | // 查询当前水库对应的市级编号和县区编号 |
| | | AttResBaseVO attResBaseVO = attResBaseService.getCityCountyCodeByResGuid(res_cd); |
| | | if (null!= attResBaseVO) { |
| | | // 通过编号查询对应的人员 |
| | | List<PersonVO> cityPerson = baseMapper.getCityCountyPersonListByResGuid(attResBaseVO.getCityCode(), "sdglywuser", "市州水库管理业务人员"); |
| | | List<PersonVO> countyPerson = baseMapper.getCityCountyPersonListByResGuid(attResBaseVO.getCountyCode(), "qxglywuser", "区县水库管理业务人员"); |
| | | // 和 |
| | | personVOList.addAll(cityPerson); |
| | | personVOList.addAll(countyPerson); |
| | | } |
| | | // 返回 |
| | | return personVOList; |
| | | } |
| | | |
| | | @DS("master") |
| | | @Override |
| | | public List<PatrolResponsiblePerson> getPatrolResponsiblePersonByResCdList(List<String> reservoirList) { |
| | | return baseMapper.getPatrolResponsiblePersonByResCdList(reservoirList); |
| | | } |
| | | |
| | | /** |
| | | * 通过水库代码获取水库及巡查责任人信息 |
| | | * @param stringList |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Set<Scene> getPatrolPersonListByWaterCodeList(List<String> stringList) { |
| | | return baseMapper.getPatrolPersonListByWaterCodeList(stringList); |
| | | } |
| | | } |