Browse Source

政府端-获取组织机构列表

master
sunyuchao 6 years ago
parent
commit
60435a2c82
  1. 43
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyListFormDTO.java
  2. 51
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java
  3. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java
  4. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  5. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java
  6. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  7. 11
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

43
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyListFormDTO.java

@ -0,0 +1,43 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 获取组织列表-接口入参
*
* @author sun
*/
@Data
public class AgencyListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 机关组织Id
*/
@NotBlank(message = "组织机构ID不能为空")
private String agencyId;
}

51
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java

@ -0,0 +1,51 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 获取组织列表-接口返参
*
* @author sun
*/
@Data
public class AgencyListResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 机关组织Id
*/
private String agencyId;
/**
* 机关组织名称
*/
private String agencyName;
/**
* 总人数
*/
private Integer totalUser;
}

13
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java

@ -20,6 +20,7 @@ package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AddAgencyResultDTO;
import com.epmet.dto.result.AgencyListResultDTO;
import com.epmet.dto.result.AgencydetailResultDTO;
import com.epmet.dto.result.SubAgencyResultDTO;
import com.epmet.service.AgencyService;
@ -29,6 +30,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 组织机构
@ -97,4 +100,14 @@ public class AgencyController {
return agencyService.subAgencyList(formDTO);
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 获取组织列表
*/
@PostMapping("agencylist")
public Result<List<AgencyListResultDTO>> agencyList(@RequestBody AgencyListFormDTO formDTO) {
return agencyService.agencyList(formDTO);
}
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -18,6 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.AgencyListResultDTO;
import com.epmet.dto.result.ParentListResultDTO;
import com.epmet.dto.result.StaffOrgsResultDTO;
import com.epmet.dto.result.SubListResultDTO;
@ -59,4 +60,12 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
* @Description 组织首页-下级机关列表
**/
List<SubListResultDTO> selectSubAgencyById(@Param("pId") String pId);
/**
* @param pId
* @return
* @Author sun
* @Description 获取组织列表
**/
List<AgencyListResultDTO> selectAgencyList(@Param("pId") String pId);
}

13
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java

@ -22,10 +22,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AddAgencyResultDTO;
import com.epmet.dto.result.AgencydetailResultDTO;
import com.epmet.dto.result.StaffOrgsResultDTO;
import com.epmet.dto.result.SubAgencyResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity;
import java.util.List;
@ -77,4 +74,12 @@ public interface AgencyService {
* @Description 组织首页-下级机关列表
*/
Result<SubAgencyResultDTO> subAgencyList(SubAgencyFormDTO formDTO);
/**
* @param formDTO
* @return
* @Author sun
* @Description 获取组织列表
*/
Result<List<AgencyListResultDTO>> agencyList(AgencyListFormDTO formDTO);
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -182,4 +182,16 @@ public class AgencyServiceImpl implements AgencyService {
subAgencyResultDTO.setSubAgencyCount(agencyList.size());
return new Result<SubAgencyResultDTO>().ok(subAgencyResultDTO);
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 获取组织列表
*/
@Override
public Result<List<AgencyListResultDTO>> agencyList(AgencyListFormDTO formDTO) {
List<AgencyListResultDTO> agencyList = customerAgencyDao.selectAgencyList(formDTO.getAgencyId());
return new Result<List<AgencyListResultDTO>>().ok(agencyList);
}
}

11
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -59,4 +59,15 @@
AND pid = #{pId}
ORDER BY CREATED_TIME DESC
</select>
<select id="selectAgencyList" resultType="com.epmet.dto.result.AgencyListResultDTO">
SELECT
id AS 'agencyId',
organization_name AS 'agencyName',
total_user AS 'totalUser'
FROM customer_agency
WHERE del_flag = '0'
AND pid = #{pId}
ORDER BY CREATED_TIME DESC
</select>
</mapper>
Loading…
Cancel
Save