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.6 KiB

package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
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;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.IcResiCollectFormDTO;
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;
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();
}
/**
* Desc: 查询采集居民信息
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2022/3/18 19:23
*/
@PostMapping("list")
// public Result<PageData<CollectListResultDTO>> getCollectList(@RequestBody CollectListFormDTO formDTO, @LoginUser TokenDto tokenDto){
public Result<PageData<CollectListResultDTO>> getCollectList(@RequestBody CollectListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,CollectListFormDTO.CollectListForm.class);
formDTO.setUserId("ebcef7c1c63a87a226e59f1e0149d331");
formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
return new Result<PageData<CollectListResultDTO>>().ok(icResiCollectService.getCollectList(formDTO));
}
}