| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- package cn.com.goldenwater.dcproj.controller.wagajs;
- 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.dto.BisInspWagajsBdgDto;
- import cn.com.goldenwater.dcproj.model.BisInspWagajsBdg;
- import cn.com.goldenwater.dcproj.param.TypeParam;
- import cn.com.goldenwater.dcproj.service.BisInspWagajsBdgService;
- import cn.com.goldenwater.dcproj.service.OlBisInspOrgService;
- import cn.com.goldenwater.dcproj.utils.AdLevelUtil;
- import cn.com.goldenwater.dcproj.utils.DateUtils;
- import cn.com.goldenwater.target.CheckException;
- import com.github.pagehelper.PageInfo;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import io.swagger.annotations.ApiParam;
- import org.apache.commons.lang.StringUtils;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- /**
- * @author lhc
- * @date 2021-5-10
- */
- @Api(value = "xxx管理", tags = "xxx管理")
- @RestController
- @RequestMapping("/bis/insp/wagajs/bdg")
- public class BisInspWagajsBdgController extends BaseController {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- private BisInspWagajsBdgService bisInspWagajsBdgService;
- @Autowired
- private OlBisInspOrgService olBisInspOrgService;
- @ApiOperation(value = "修改xxx")
- @RequestMapping(value = "", method = RequestMethod.POST)
- public BaseResponse<BisInspWagajsBdg> insert(@ApiParam(name = "bisInspWagajsBdg", value = "BisInspWagajsBdg", required = true) @RequestBody BisInspWagajsBdg bisInspWagajsBdg) {
- if (StringUtils.isBlank(bisInspWagajsBdg.getId()) ||
- StringUtils.isNotBlank(bisInspWagajsBdg.getRgstrId())) {
- // rgstrId 不为 空 时,传给ID
- bisInspWagajsBdg.setId(bisInspWagajsBdg.getRgstrId());
- }
- if (StringUtils.isBlank(bisInspWagajsBdg.getId())) {
- throw new CheckException("缺少登记表编码!");
- }
- int ret = bisInspWagajsBdgService.update(bisInspWagajsBdg);
- return buildSuccessResponse(bisInspWagajsBdg);
- }
- @ApiOperation(value = "根据ID删除xxx")
- @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
- public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- int ret = bisInspWagajsBdgService.delete(id);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "根据ID获取xxx(单表)")
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public BaseResponse<BisInspWagajsBdg> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- BisInspWagajsBdg bisInspWagajsBdg = bisInspWagajsBdgService.get(id);
- return buildSuccessResponse(bisInspWagajsBdg);
- }
- @ApiOperation(value = "列表--分页")
- @RequestMapping(value = "/findPage", method = RequestMethod.POST)
- public BaseResponse<PageInfo<BisInspWagajsBdgDto>> page(@ApiParam(name = "bisInspWagajsBdgParam", value = "bisInspWagajsBdgParam", required = true)
- @RequestBody TypeParam typeParam) {
- typeParam.setpType(BisInspEnum.WAGAJS.getValue());
- typeParam.setPresId(getCurrentPersId());
- typeParam.setOrgId(getCurrentOrgId());
- typeParam.setNowTime(DateUtils.getToday("yyyy-MM-dd"));
- if (!StringUtils.isBlank(typeParam.getAdCodes())) {
- typeParam.setAdCodes(AdLevelUtil.getListAddvcd(typeParam.getAdCodes()));
- } else {
- typeParam.setAdCodes(AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId())));
- }
- PageInfo<BisInspWagajsBdgDto> rgstrPageInfo = bisInspWagajsBdgService.findObjPageByType(typeParam, null);
- return buildSuccessResponse(rgstrPageInfo);
- }
- }
|