| | |
| | | package cn.huge.module.ctuser.controller.web; |
| | | |
| | | import cn.huge.base.common.dto.SelectTermDTO; |
| | | import cn.huge.base.common.utils.ReturnFailUtils; |
| | | import cn.huge.base.common.utils.ReturnSucUtils; |
| | | import cn.huge.base.config.CurrentUser; |
| | | import cn.huge.module.ctuser.domain.po.CtUnit; |
| | | import cn.huge.module.ctuser.domain.po.CtUser; |
| | | import cn.huge.module.ctuser.dto.AppearUnitDTO; |
| | | import cn.huge.module.ctuser.service.CtUnitService; |
| | | import cn.huge.module.ctuser.service.CtUserService; |
| | | import cn.huge.module.cust.dto.CtUnitDTO; |
| | | import cn.huge.module.cust.dto.CtUserDTO; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.google.common.collect.Maps; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | /** |
| | | * @title: 客户组织信息表接口api |
| | | * @description: 客户组织信息表接口api |
| | | * @title: 客户组织信息表接口api-web端 |
| | | * @description: 客户组织信息表接口api-web端 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-19 20:04:19 |
| | |
| | | if (StringUtils.isNotBlank(unitName)){ |
| | | terms.put("unitName", unitName); |
| | | } |
| | | // 组织类型,0:政法委,1:综治中心,2:直属部门,3:法院,4:行专业调委会,5:企事业调委会,6:演示测试,9:其他 |
| | | // 组织类型, |
| | | // 调解组织类型(101:综治中心,102:直属部门,103:村居社区,104:行专业调委会,105:企事业调委会,106:演示测试), |
| | | // 行政组织类型(201:政法委,202:其他) |
| | | String unitType = request.getParameter("unitType"); |
| | | if (StringUtils.isNotBlank(unitType)){ |
| | | terms.put("unitType", unitType); |
| | |
| | | if (StringUtils.isNotBlank(dispStatus)){ |
| | | terms.put("dispStatus", dispStatus); |
| | | } |
| | | // 删除状态,0:已删除,1:未删除 |
| | | // 删除状态,0:未删除,1:已删除 |
| | | String deleteStatus = request.getParameter("deleteStatus"); |
| | | if (StringUtils.isNotBlank(deleteStatus)){ |
| | | terms.put("deleteStatus", deleteStatus); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 批量新增-数据迁移 |
| | | * @url {ctx}/api/web/ctUnit/saveCtUnitList |
| | | * @param targetCtUnitList 实体对象 |
| | | * @return Object |
| | | */ |
| | | @PostMapping("/saveCtUnitList") |
| | | public Object saveCtUnitList(@RequestBody List<CtUnit> targetCtUnitList) { |
| | | try { |
| | | service.saveBatch(targetCtUnitList); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取所有组织(包含所有下级子组织)树形结构 |
| | | * @url {ctx}/api/v1/ctUnit/listUnitTree |
| | | * @url {ctx}/api/web/ctUnit/listUnitTree |
| | | * @param userId 登录用户标识称 |
| | | * @return Object |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取组织详情(包含组织下的部门详情) |
| | | * @url {ctx}/api/v1/ctUnit/getUnitAndDept?id= |
| | | * @url {ctx}/api/web/ctUnit/getUnitAndDept?id= |
| | | * @param id 组织编号 |
| | | * @return Object |
| | | */ |
| | |
| | | return ReturnFailUtils.getRepInfo( "查询失败", null); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据主键编号删除单位 |
| | | * @url {ctx}/api/web/ctUnit/removeByIds |
| | | * @param ids 主键编号 |
| | | * @return Object |
| | | * @throws Exception |
| | | */ |
| | | @GetMapping("/removeByIds") |
| | | public Object removeByIds(@RequestParam(value = "ids") String ids) { |
| | | try { |
| | | service.removeById(ids); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | log.error("Controller接口[CtUnitController.removeByIds]请求异常:"+e, e); |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 交办-选择组织 |
| | | * @url {ctx}/api/web/ctUnit/unitChoose |
| | | * @param userId 组织编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/unitChoose") |
| | | public Object unitChoose(@CurrentUser String userId) { |
| | | try { |
| | | List<SelectTermDTO> unitSelectTerms = service.unitChoose(userId); |
| | | return ReturnSucUtils.getRepInfo(unitSelectTerms); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 联合处置申请-选择组织 |
| | | * @url {ctx}/api/web/ctUnit/assistApplyUnitChoose |
| | | * @param userId 组织编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/assistApplyUnitChoose") |
| | | public Object assistApplyUnitChoose(@CurrentUser String userId) { |
| | | try { |
| | | List<SelectTermDTO> unitSelectTerms = service.assistApplyUnitChoose(userId); |
| | | return ReturnSucUtils.getRepInfo(unitSelectTerms); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * web端任务处理-上报-查询上报的目标组织 |
| | | * @url {ctx}/api/web/ctUnit/getAppearToUnit |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/getAppearToUnit") |
| | | public Object getAppearToUnit(@CurrentUser String userId) { |
| | | try { |
| | | // 获取当前登录用户 |
| | | CtUserDTO loginUser = ctUserService.clientGetUserAll(userId); |
| | | CtUnitDTO ctUnitDTO = service.getParentZzzx(loginUser.getUnitId()); |
| | | AppearUnitDTO appearUnitDTO = new AppearUnitDTO(); |
| | | appearUnitDTO.setAuditUnitId(ctUnitDTO.getId()); |
| | | appearUnitDTO.setAuditUnitName(ctUnitDTO.getUnitName()); |
| | | return ReturnSucUtils.getRepInfo(appearUnitDTO); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(e.getMessage()); |
| | | } |
| | | } |
| | | } |