| | |
| | | userInfo.getDetail().set("phone",Base64Utils.getBase64Encode(user.getPhone())); |
| | | |
| | | String deptStr = ""; |
| | | if (userInfo.getUser().getDeptId().indexOf(",") > 0){ |
| | | deptStr = userInfo.getUser().getDeptId().split(",")[0]; |
| | | |
| | | String deptIds = userInfo.getUser().getDeptId(); |
| | | if (deptIds.indexOf(",") > 0){ |
| | | deptStr = deptIds.split(",")[0]; |
| | | }else { |
| | | deptStr = userInfo.getUser().getDeptId(); |
| | | deptStr = deptIds; |
| | | } |
| | | |
| | | String resDeptIds = ""; |
| | | |
| | | resDeptIds = sysClient.getResDept(deptIds); |
| | | userInfo.getDetail().set("resDeptIds",resDeptIds); |
| | | |
| | | R<Dept> deptRes = sysClient.getDept(Long.valueOf(deptStr)); |
| | | if (StringUtil.isBlank(deptRes.getData().getAdCode())) { |
| | | // 部门为空 |
| | |
| | | @ApiModelProperty(value = "区划名称") |
| | | private String adCode; |
| | | |
| | | private String adGrad; |
| | | |
| | | private String resGuid; |
| | | |
| | | } |
| | |
| | | String PARAM_VALUE = API_PREFIX + "/param-value"; |
| | | String REGION = API_PREFIX + "/region"; |
| | | |
| | | String UPDATE_DEPT_BY_TB = API_PREFIX + "updateDeptByTb"; |
| | | String GET_RES_DEPT = API_PREFIX + "getResDept"; |
| | | |
| | | /** |
| | | * 获取菜单 |
| | | * |
| | |
| | | @GetMapping(REGION) |
| | | R<Region> getRegion(@RequestParam("code") String code); |
| | | |
| | | @GetMapping(UPDATE_DEPT_BY_TB) |
| | | boolean updateDeptByTb(@RequestParam("adCode") String adCode, @RequestParam("resGuid") String resGuid); |
| | | |
| | | @GetMapping(GET_RES_DEPT) |
| | | String getResDept(@RequestParam("deptIds") String deptIds); |
| | | } |
| | |
| | | return R.fail("获取数据失败"); |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateDeptByTb(String adCode, String resGuid) { |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public String getResDept(String deptIds) { |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | <version>3.0.1.RELEASE</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.gistack</groupId> |
| | | <artifactId>skjcmanager-system-api</artifactId> |
| | | <version>3.0.1.RELEASE</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-excel</artifactId> |
| | | </dependency> |
| | |
| | | import cn.gistack.sm.sjztmd.service.IAttAdBaseService; |
| | | import cn.gistack.sm.sjztmd.service.IAttResBaseService; |
| | | import cn.gistack.sm.sjztmd.vo.AttAdBaseVO; |
| | | import cn.gistack.sm.sjztmd.vo.AttResBaseVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | @ApiOperation(value = "中台水库-查询该行政区下的水库", notes = "中台水库-查询该行政区下的水库") |
| | | @GetMapping(value = "/getListByRegion") |
| | | public R getListByRegion(@ApiIgnore @RequestParam Map<String, Object> obj,Query query) { |
| | | IPage<AttResBase> pageList = attResBaseService.getListByRegion(Condition.getPage(query),obj); |
| | | IPage<AttResBaseVO> pageList = attResBaseService.getListByRegion(Condition.getPage(query),obj); |
| | | return R.data(pageList); |
| | | } |
| | | |
| | |
| | | |
| | | List<AttResBaseGeneralInvestigationVO> selectAttResBaseGeneralInvestigation(IPage<AttResBaseGeneralInvestigationVO> page, @Param("attResBase") AttResBaseGeneralInvestigationVO attResBase); |
| | | |
| | | List<AttResBase> getListByRegion(IPage<AttResBase> page,@Param("obj") Map<String, Object> obj); |
| | | List<AttResBaseVO> getListByRegion(IPage<AttResBaseVO> page,@Param("obj") Map<String, Object> obj); |
| | | |
| | | AttResBase getDetailByCode(@Param("code") String code); |
| | | |
| | |
| | | |
| | | </select> |
| | | |
| | | <select id="getListByRegion" resultType="cn.gistack.sm.sjztmd.entity.AttResBase"> |
| | | |
| | | <sql id="resBase"> |
| | | case when town."ad_grad" = 4 THEN town."ad_code" ELSE NULL END AS townCode, |
| | | case when town."ad_grad" = 4 THEN town."ad_name" ELSE NULL END AS townName, |
| | | case |
| | | when town."ad_grad" = 3 THEN town."ad_code" |
| | | when county."ad_grad" = 3 THEN county."ad_code" END AS countyCode, |
| | | case |
| | | when town."ad_grad" = 3 THEN town."ad_name" |
| | | when county."ad_grad" = 3 THEN county."ad_name" END AS countyName, |
| | | case |
| | | when town."ad_grad" = 2 THEN town."ad_code" |
| | | when county."ad_grad" = 2 THEN county."ad_code" |
| | | ELSE city."ad_code" END AS cityCode, |
| | | case |
| | | when town."ad_grad" = 2 THEN town."ad_name" |
| | | when county."ad_grad" = 2 THEN county."ad_name" |
| | | ELSE city."ad_name" END AS cityName, |
| | | case |
| | | when town."ad_grad" = 1 THEN town."ad_code" |
| | | when county."ad_grad" = 1 THEN county."ad_code" |
| | | when city."ad_grad" = 1 THEN city."ad_code" |
| | | ELSE province."ad_code" END AS provinceCode, |
| | | case |
| | | when town."ad_grad" = 1 THEN town."ad_name" |
| | | when county."ad_grad" = 1 THEN county."ad_name" |
| | | when city."ad_grad" = 1 THEN city."ad_name" |
| | | ELSE province."ad_name" END AS provinceName |
| | | </sql> |
| | | |
| | | <select id="getListByRegion" resultType="cn.gistack.sm.sjztmd.vo.AttResBaseVO"> |
| | | SELECT |
| | | arb."guid", |
| | | arb."code", |
| | |
| | | arb."ad_guid", |
| | | arb."eng_scal", |
| | | arb."res_loc" , |
| | | arb."res_reg_code" |
| | | arb."res_reg_code", |
| | | <include refid="resBase"></include> |
| | | FROM "att_res_base" arb |
| | | left join "att_ad_base" aab on aab."guid" = arb."interior_ad_guid" |
| | | left join "att_ad_base" aa on aab."p_ad_code" = aa."ad_code" |
| | | left join "att_ad_base" ab on aa."p_ad_code" = ab."ad_code" |
| | | left join "att_ad_base" ac on ab."p_ad_code" = ac."ad_code" |
| | | left join "att_ad_base" town on town."guid" = arb."interior_ad_guid" |
| | | left join "att_ad_base" county on town."p_ad_code" = county."ad_code" |
| | | left join "att_ad_base" city on county."p_ad_code" = city."ad_code" |
| | | left join "att_ad_base" province on city."p_ad_code" = province."ad_code" |
| | | WHERE arb."is_deleted"=0 |
| | | <if test="obj.code != null and obj.code != '' "> |
| | | and (aab."ad_code" = #{obj.code} or aa."ad_code" = #{obj.code} or ab."ad_code" = #{obj.code} or ac."ad_code" |
| | | and (town."ad_code" = #{obj.code} or county."ad_code" = #{obj.code} or city."ad_code" = #{obj.code} or province."ad_code" |
| | | = #{obj.code}) |
| | | </if> |
| | | <if test="obj.name !=null and obj.name !=''"> |
| | |
| | | |
| | | Object selectAttResBaseGeneralInvestigation(IPage<AttResBaseGeneralInvestigationVO> page, AttResBaseGeneralInvestigationVO attResBase); |
| | | |
| | | IPage<AttResBase> getListByRegion(IPage<AttResBase> page,Map<String, Object> obj); |
| | | IPage<AttResBaseVO> getListByRegion(IPage<AttResBaseVO> page,Map<String, Object> obj); |
| | | |
| | | AttResBase getDetailByCode(String code); |
| | | |
| | |
| | | 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.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private IRelResLabelService relResLabelService; |
| | | |
| | | @Autowired |
| | | private ISysClient sysClient; |
| | | |
| | | |
| | | @Override |
| | | public IPage<AttResBase> selectAttResBasePage(IPage<AttResBase> page, AttResBase attResBase) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public IPage<AttResBase> getListByRegion(IPage<AttResBase> page,Map<String, Object> obj) { |
| | | public IPage<AttResBaseVO> getListByRegion(IPage<AttResBaseVO> page,Map<String, Object> obj) { |
| | | return page.setRecords(baseMapper.getListByRegion(page,obj)); |
| | | } |
| | | |
| | |
| | | updateBy = updateBy + updateLog; |
| | | //向水库标签表中更新数据 |
| | | relResLabelService.updateEntity(attResBase.getGuid(),attResBase.getLabel()); |
| | | |
| | | //更新机构表中的水库位置 |
| | | sysClient.updateDeptByTb(interiorAdGuid,attResBase.getGuid()); |
| | | |
| | | //向操作记录表中增加记录 |
| | | baseMapper.updateRelResUpdateLoc(attResBase.getGuid(),updateBy); |
| | | return baseMapper.updateResBaseByGuid(attResBase); |
| | |
| | | package cn.gistack.sm.sjztmd.vo; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.AttResBase; |
| | | import lombok.Data; |
| | | import java.io.Serializable; |
| | | |
| | |
| | | * @author Chill |
| | | */ |
| | | @Data |
| | | public class AttResBaseVO implements Serializable { |
| | | public class AttResBaseVO extends AttResBase { |
| | | |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | private String cityCode; |
| | | private String cityName; |
| | | |
| | | /** |
| | | * 区县编号 |
| | | */ |
| | | private String countyCode; |
| | | private String countyName; |
| | | |
| | | private String townCode; |
| | | private String townName; |
| | | } |
| | |
| | | return R.data(deptService.getDeptAndUserTree(treeNode)); |
| | | } |
| | | |
| | | @GetMapping("updateAllDept") |
| | | public R updateAllDept(){ |
| | | int number = deptService.updateAllDept(); |
| | | return R.data(number); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | return R.data(regionService.getById(code)); |
| | | } |
| | | |
| | | @Override |
| | | @GetMapping(UPDATE_DEPT_BY_TB) |
| | | public boolean updateDeptByTb(String adCode, String resGuid) { |
| | | return deptService.updateDeptByTb(adCode,resGuid); |
| | | } |
| | | |
| | | @Override |
| | | @GetMapping(GET_RES_DEPT) |
| | | public String getResDept(String deptIds) { |
| | | return deptService.getResDept(deptIds); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | @MapKey(value = "id") |
| | | Map<String, DeptUserTreeNode> getUserMap(@Param("treeNode") DeptUserTreeNode treeNode); |
| | | |
| | | String getResDept(@Param("deptIds") String deptIds); |
| | | } |
| | |
| | | and bu.dept_id like concat(concat('%',#{treeNode.id}),'%') |
| | | </if> |
| | | </select> |
| | | <select id="getResDept" resultType="java.lang.String"> |
| | | |
| | | SELECT WM_CONCAT(res_guid) |
| | | FROM blade_dept where res_guid is not null and res_guid != '' |
| | | and id in |
| | | <foreach collection="deptIds.split(',')" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | List<TreeNode> getDeptAndUserTree(DeptUserTreeNode treeNode); |
| | | |
| | | int updateAllDept(); |
| | | |
| | | boolean updateDeptByTb(String adCode, String resGuid); |
| | | |
| | | /** |
| | | * 根据机构ids获取水库编码 |
| | | * @param deptIds |
| | | * @return |
| | | */ |
| | | String getResDept(String deptIds); |
| | | } |
| | |
| | | import cn.gistack.common.node.TreeNode; |
| | | import cn.gistack.common.utils.NodeTreeUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.node.ForestNodeMerger; |
| | |
| | | // 处理并返回 |
| | | return NodeTreeUtil.getDeptAndUserNodeTree(deptMap); |
| | | } |
| | | |
| | | @Override |
| | | public int updateAllDept() { |
| | | |
| | | Dept params = new Dept(); |
| | | params.setAdGrad("9"); |
| | | List<Dept> list = list(Condition.getQueryWrapper(params)); |
| | | |
| | | list.forEach(dept -> { |
| | | this.submit(dept); |
| | | }); |
| | | return list.size(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateDeptByTb(String adCode, String resGuid) { |
| | | //根据水库编码找到机构 |
| | | QueryWrapper<Dept> query1 = new QueryWrapper<>(); |
| | | query1.eq("RES_GUID",resGuid); |
| | | Dept resDept = getOne(query1); |
| | | |
| | | //找到移到哪个行政区划下的机构 |
| | | QueryWrapper<Dept> query2 = new QueryWrapper<>(); |
| | | query2.eq("AD_CODE",adCode); |
| | | Dept adCodeDept = getOne(query2); |
| | | |
| | | if (resDept != null && adCodeDept != null){ |
| | | resDept.setParentId(adCodeDept.getId()); |
| | | return this.submit(resDept); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public String getResDept(String deptIds) { |
| | | return baseMapper.getResDept(deptIds); |
| | | } |
| | | } |