| | |
| | | package cn.gistack.sm.sjztmd.service.impl; |
| | | |
| | | import cn.gistack.sm.intelligentCall.mapper.CallTaskMapper; |
| | | import cn.gistack.sm.sjztmd.dto.AttResBaseUserDTO; |
| | | import cn.gistack.sm.sjztmd.entity.AttAdBase; |
| | | import cn.gistack.sm.sjztmd.entity.AttResBase; |
| | | import cn.gistack.sm.sjztmd.entity.RelResLabel; |
| | | import cn.gistack.sm.sjztmd.excel.AttResBaseUserExcel; |
| | | import cn.gistack.sm.sjztmd.mapper.AttResBaseMapper; |
| | | import cn.gistack.sm.sjztmd.service.IAttResBaseService; |
| | | import cn.gistack.sm.sjztmd.service.IRelResLabelService; |
| | | import cn.gistack.sm.sjztmd.vo.*; |
| | | import cn.gistack.system.feign.ISysClient; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @ClassName AttResBaseServiceImpl |
| | |
| | | @DS("zt") |
| | | public class AttResBaseServiceImpl extends ServiceImpl<AttResBaseMapper, AttResBase> implements IAttResBaseService { |
| | | |
| | | @Autowired |
| | | private CallTaskMapper callTaskMapper; |
| | | |
| | | @Autowired |
| | | private IRelResLabelService relResLabelService; |
| | | |
| | | @Autowired |
| | | private ISysClient sysClient; |
| | | |
| | | |
| | | @Override |
| | | public IPage<AttResBase> selectAttResBasePage(IPage<AttResBase> page, AttResBase attResBase) { |
| | | return page.setRecords(baseMapper.selectAttResBasePage(page,attResBase)); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<AttResBase> getListByRegion(IPage<AttResBase> page,Map<String, Object> obj) { |
| | | public Object selectAttResBaseGeneralInvestigation(IPage<AttResBaseGeneralInvestigationVO> page, AttResBaseGeneralInvestigationVO attResBase) { |
| | | |
| | | if (attResBase.getIsPage()){ |
| | | return page.setRecords(baseMapper.selectAttResBaseGeneralInvestigation(page,attResBase)); |
| | | }else { |
| | | return baseMapper.selectAttResBaseGeneralInvestigation(null,attResBase); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public IPage<AttResBaseVO> getListByRegion(IPage<AttResBaseVO> page,Map<String, Object> obj) { |
| | | return page.setRecords(baseMapper.getListByRegion(page,obj)); |
| | | } |
| | | |
| | |
| | | public AttResBase getDetailByCode(String code) { |
| | | return baseMapper.getDetailByCode(code); |
| | | } |
| | | |
| | | /** |
| | | * 获取水库对应责任人分页数据 |
| | | * @param params 条件查询参数对象 |
| | | * @param page 分页查询参数对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object getAttResBaseUserPage(IPage<AttResBaseUserDTO> page,Map<String, Object> params) { |
| | | |
| | | Object isExport = params.get("isExport"); |
| | | // 判断是否导出,导出不分页 |
| | | if (null != isExport && !isExport.equals("")) { |
| | | return baseMapper.getAttResBaseUserPage(null,params); |
| | | } |
| | | List<AttResBaseUserDTO> attResBaseUserDTOList = baseMapper.getAttResBaseUserPage(page,params); |
| | | // 返回数据 |
| | | return page.setRecords(attResBaseUserDTOList); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<AttResBaseUserExcel> exportAttResBaseUser(Map<String, Object> params) { |
| | | |
| | | |
| | | List<AttResBaseUserExcel> attResBaseUserDTOList = baseMapper.getAttResBaseUserExcel(params); |
| | | return attResBaseUserDTOList; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean updateResBaseByGuid(AttResBase attResBase) { |
| | | attResBase.setUpdateTime(DateUtil.now()); |
| | | |
| | | String updateBy = baseMapper.getUpdateLog(attResBase.getGuid()); |
| | | if (StringUtil.isBlank(updateBy)){ |
| | | updateBy = ""; |
| | | } |
| | | BladeUser user = AuthUtil.getUser(); |
| | | //修改人基础信息 |
| | | String account = user.getAccount(); |
| | | String userName = user.getUserName(); |
| | | String nowTime = DateUtil.format(DateUtil.now(),DateUtil.PATTERN_DATETIME); |
| | | |
| | | String updateUser = StringUtil.format("[{}-{}-{}]",account,userName,nowTime); |
| | | |
| | | //修改的东西 |
| | | String interiorAdGuid = attResBase.getInteriorAdGuid(); |
| | | String label = attResBase.getLabel(); |
| | | String heightBaseStdTp = attResBase.getHeightBaseStdTp(); |
| | | String isGate = attResBase.getIsGate(); |
| | | |
| | | String updateLog = ""; |
| | | List<String> strList = new ArrayList<>(); |
| | | if (StringUtil.isNotBlank(interiorAdGuid)){ |
| | | strList.add("行政区划修改为"+ interiorAdGuid); |
| | | } |
| | | strList.add("标签修改为"+label); |
| | | strList.add("高程基准面修改为"+heightBaseStdTp); |
| | | strList.add("是否有闸修改为"+isGate); |
| | | |
| | | String updateContent = String.join("、",strList); |
| | | |
| | | updateLog = updateUser + updateContent + ";"; |
| | | updateBy = updateBy + updateLog; |
| | | //向水库标签表中更新数据 |
| | | relResLabelService.updateEntity(attResBase.getGuid(),attResBase.getLabel()); |
| | | |
| | | //更新机构表中的水库位置 |
| | | sysClient.updateDeptByTb(interiorAdGuid,attResBase.getGuid()); |
| | | |
| | | //向操作记录表中增加记录 |
| | | baseMapper.updateRelResUpdateLoc(attResBase.getGuid(),updateBy); |
| | | return baseMapper.updateResBaseByGuid(attResBase); |
| | | } |
| | | |
| | | /** |
| | | * 查询当前水库对应的市级编号和县区编号 |
| | | * @param res_cd |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AttResBaseVO getCityCountyCodeByResGuid(String res_cd) { |
| | | return baseMapper.getCityCountyCodeByResGuid(res_cd); |
| | | } |
| | | |
| | | /** |
| | | * 根据水库编码获取行政区数据 |
| | | * @param guid |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AttResAdVO getWaterRegionInfoByResGuid(String guid) { |
| | | return baseMapper.getWaterRegionInfoByResGuid(guid); |
| | | } |
| | | |
| | | @Override |
| | | public int getDimResInfoACount() { |
| | | return baseMapper.getDimResInfoACount(); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean updateIsShowStatus(String ids, Integer status) { |
| | | return baseMapper.updateIsShowStatus(ids,status); |
| | | } |
| | | |
| | | /** |
| | | * 根据水库名称、所在区域查询改水库的数量 |
| | | * @param resName 水库名称 |
| | | * @param countyCode 区县 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Integer getWaterCountByResNameAndCountyName(String resName, String countyCode) { |
| | | return baseMapper.getWaterCountByResNameAndCountyName(resName,countyCode); |
| | | } |
| | | |
| | | @Override |
| | | public AttResAdVO getResAd(String resId) { |
| | | return baseMapper.getResAd(resId); |
| | | } |
| | | |
| | | @Override |
| | | public AttAdBase getYwxtResInfo(String cityName, String countyName) { |
| | | return baseMapper.getYwxtResInfo(cityName,countyName); |
| | | } |
| | | |
| | | } |