| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- package cn.com.goldenwater.dcproj.controller.rdwsp;
- import cn.com.goldenwater.core.web.BaseController;
- import cn.com.goldenwater.core.web.BaseResponse;
- import cn.com.goldenwater.dcproj.constValue.BisInspEnum;
- import cn.com.goldenwater.dcproj.dao.AttAdXBaseDao;
- import cn.com.goldenwater.dcproj.dto.AttCountryDto;
- import cn.com.goldenwater.dcproj.dto.BisNewDcuserRelVillDto;
- import cn.com.goldenwater.dcproj.model.*;
- import cn.com.goldenwater.dcproj.param.*;
- import cn.com.goldenwater.dcproj.service.*;
- import cn.com.goldenwater.dcproj.utils.AdLevelUtil;
- import cn.com.goldenwater.id.util.UuidUtil;
- import com.github.pagehelper.PageInfo;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import io.swagger.annotations.ApiParam;
- import org.apache.commons.lang3.StringUtils;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- /**
- * @author lune
- * @date 2020-10-9
- */
- @Api(value = "BIS 农村饮水安全回头看登记表管理",tags="BIS 农村饮水安全回头看登记表管理")
- @RestController
- @RequestMapping("/bis/rdwsp/rgstr")
- public class BisRdwspRgstrController extends BaseController {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- private BisRdwspRgstrService bisRdwspRgstrService;
- @Autowired
- private OlBisInspOrgService olBisInspOrgService;
- @Autowired
- private BisInspRssfdrRgstrService bisInspRssfdrRgstrService;
- @Autowired
- private BisBisRdwspRgstrFeeService bisBisRdwspRgstrFeeService;
- @Autowired
- private BisRdwspRgstrPoorService bisRdwspRgstrPoorService;
- @Autowired
- private AttAdXBaseDao attAdXBaseDao;
- @ApiOperation(value = "添加/修改农村饮水安全回头看登记表")
- @RequestMapping(value = "", method = RequestMethod.POST)
- public BaseResponse<BisRdwspRgstr> insert(@ApiParam(name = "bisRdwspRgstr", value = "BisRdwspRgstr", required = true) @RequestBody BisRdwspRgstr bisRdwspRgstr) {
- if(StringUtils.isBlank(bisRdwspRgstr.getId())) {
- // 生成uuid
- String uuid = UuidUtil.uuid();
- bisRdwspRgstr.setId(uuid);
- bisRdwspRgstrService.insert(bisRdwspRgstr);
- }else{
- bisRdwspRgstrService.update(bisRdwspRgstr);
- }
- return buildSuccessResponse(bisRdwspRgstr);
- }
- @ApiOperation(value = "根据ID删除农村饮水安全回头看登记表")
- @RequestMapping(value = "/del/{id}", method = RequestMethod.GET)
- public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- int ret = bisRdwspRgstrService.delete(id);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "根据ID获取农村饮水安全回头看登记表(单表)")
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public BaseResponse<BisRdwspRgstr> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- BisRdwspRgstr bisRdwspRgstr = bisRdwspRgstrService.get(id);
- return buildSuccessResponse(bisRdwspRgstr);
- }
- @ApiOperation(value = "获取农村饮水安全回头看登记表(列表所有)")
- @RequestMapping(value = "/list", method = RequestMethod.POST)
- public BaseResponse<List<BisRdwspRgstr>> list(@ApiParam(name = "bisRdwspRgstrParam", value = "bisRdwspRgstrParam", required = true) @RequestBody BisRdwspRgstrParam bisRdwspRgstrParam) {
- List<BisRdwspRgstr> bisRdwspRgstrList = bisRdwspRgstrService.findList(bisRdwspRgstrParam);
- return buildSuccessResponse(bisRdwspRgstrList);
- }
- @ApiOperation(value = "获取农村饮水安全回头看登记表(列表--分页)")
- @RequestMapping(value = "/page", method = RequestMethod.POST)
- public BaseResponse<PageInfo<BisRdwspRgstr>> page(@ApiParam(name = "bisRdwspRgstrParam", value = "bisRdwspRgstrParam", required = true) @RequestBody BisRdwspRgstrParam bisRdwspRgstrParam) {
- PageInfo<BisRdwspRgstr> bisRdwspRgstrList = bisRdwspRgstrService.findPageInfo(bisRdwspRgstrParam);
- return buildSuccessResponse(bisRdwspRgstrList);
- }
- @ApiOperation(value = "获取督查登记表列表")
- @RequestMapping(value = "/findRdwspPage", method = RequestMethod.POST)
- public BaseResponse<PageInfo<BisInspWrmRgstr>> findRdwspPage(@RequestBody TypeParam param) {
- param.setProvince(AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId())));
- String adPr = AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId()));
- if (StringUtils.isBlank(param.getAdCode())) {
- param.setAdCode(adPr);
- }
- PageInfo<BisInspWrmRgstr> bisInspWrmRgstrList = bisRdwspRgstrService.findRdwspPage(param);
- return buildSuccessResponse(bisInspWrmRgstrList);
- }
- @ApiOperation(value = "获取督查中县-镇(乡)--村树节点")
- @RequestMapping(value = "/findTree/{code}/{regstrId}", method = RequestMethod.GET)
- public BaseResponse<List<BisNewDcuserRelVillDto>> findTree(
- @ApiParam(name = "code", value = "code", required = true) @PathVariable String code,
- @ApiParam(name = "regstrId", value = "regstrId", required = true) @PathVariable String regstrId) {
- //获取镇,乡
- if(code.length()==12){
- code=code.substring(0, 6);
- }
- List<BisNewDcuserRelVillDto> attAdXBaseList= bisInspRssfdrRgstrService.findZhenListByType(code,regstrId, BisInspEnum.RDWSP.getValue());
- return buildSuccessResponse(attAdXBaseList);
- }
- @ApiOperation(value = "获取县-镇(乡)--村用水户和饮水工程列表")
- @RequestMapping(value = "/findNode/{code}/{regstrId}", method = RequestMethod.GET)
- public BaseResponse<Object> findNode(
- @ApiParam(name = "code", value = "code", required = true) @PathVariable String code,
- @ApiParam(name = "regstrId", value = "regstrId", required = true) @PathVariable String regstrId) {
- //获取镇,乡
- Map<String,Object> map=new HashMap<>();
- BisBisRdwspRgstrFeeParam feeParam=new BisBisRdwspRgstrFeeParam();
- feeParam.setRegstrId(regstrId);
- if(code.length()==12 && code.endsWith("000")){
- code=code.replace("000","");
- }
- feeParam.setAdCode(code);
- List<BisBisRdwspRgstrFee> wateruserInfos=bisBisRdwspRgstrFeeService.findList(feeParam);
- BisRdwspRgstrPoorParam poorParam=new BisRdwspRgstrPoorParam();
- poorParam.setAdCode(code);
- poorParam.setRegstrId(regstrId);
- List<BisRdwspRgstrPoor> countryFeeList=bisRdwspRgstrPoorService.findList(poorParam);
- map.put("waterUsers",countryFeeList);
- map.put("countryPro",wateruserInfos);
- return buildSuccessResponse(map);
- }
- @ApiOperation(value = "添加行政村县下镇(乡)--村树节点,code为县code")
- @RequestMapping(value = "/findCheckTree/{code}/{regstrId}", method = RequestMethod.GET)
- public BaseResponse<List<AttCountryDto>> findCheckTree(
- @ApiParam(name = "code", value = "code", required = true) @PathVariable String code,
- @ApiParam(name = "regstrId", value = "regstrId", required = true) @PathVariable String regstrId
- ){
- code=code.substring(0, 6);
- List<AttCountryDto> zhenDtoList=attAdXBaseDao.findXZCZhenList(code);
- List<AttCountryDto> countryDtoList=attAdXBaseDao.findXZCCunListByType(code,regstrId, BisInspEnum.RDWSP.getValue());
- for(AttCountryDto attCountryDto:zhenDtoList){
- String adCode=attCountryDto.getAdCode().replace("000","");
- List<AttCountryDto> childList=new ArrayList<>();
- for(AttCountryDto countryDto:countryDtoList){
- if(countryDto.getAdCode().startsWith(adCode)){
- childList.add(countryDto);
- }
- }
- attCountryDto.setAttCountryDtoList(childList);
- }
- return buildSuccessResponse(zhenDtoList);
- }
- @ApiOperation(value = "问题栏目:问题列表根据当前登录用户id获取需要督查问题列表")
- @RequestMapping(value = "/list/{persId}", method = RequestMethod.POST)
- public BaseResponse<PageInfo<BisInspPblm>> list(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId
- , @RequestBody(required = false) PlbmParam pblmParam) {
- pblmParam.setPresId(persId);
- PageInfo<BisInspPblm> inspPblmList = bisBisRdwspRgstrFeeService.findPageList(pblmParam);
- return buildSuccessResponse(inspPblmList);
- }
- }
|