日照智慧社区接口服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.5 KiB

package com.epmet.controller;
3 years ago
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
3 years ago
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
3 years ago
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.IcResiCollectFormDTO;
3 years ago
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.service.IcResiCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
3 years ago
import java.util.List;
/**
* 居民信息采集表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-03-18
*/
@RestController
@RequestMapping("icresicollect")
public class IcResiCollectController {
@Autowired
private IcResiCollectService icResiCollectService;
/**
* 居民信息采集_提交
*
* @param formDTO
* @return
*/
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody IcResiCollectFormDTO formDTO) {
//效验数据
ValidatorUtils.validateEntity(formDTO, IcResiCollectFormDTO.AddUserInternalGroup.class);
// 内部:internal;外部:external
if ("internal".equals(formDTO.getOrigin())) {
ValidatorUtils.validateEntity(formDTO, IcResiCollectFormDTO.InternalShowGroup.class);
} else if ("external".equals(formDTO.getOrigin())) {
ValidatorUtils.validateEntity(formDTO, IcResiCollectFormDTO.ExternalShowGroup.class);
}
icResiCollectService.save(formDTO);
return new Result();
}
3 years ago
/**
* Desc: 查询采集居民信息
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2022/3/18 19:23
*/
@PostMapping("list")
3 years ago
public Result<PageData<CollectListResultDTO>> getCollectList(@RequestBody CollectListFormDTO formDTO, @LoginUser TokenDto tokenDto){
3 years ago
ValidatorUtils.validateEntity(formDTO,CollectListFormDTO.CollectListForm.class);
3 years ago
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
3 years ago
return new Result<PageData<CollectListResultDTO>>().ok(icResiCollectService.getCollectList(formDTO));
}
}