| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- package cn.com.goldenwater.dcproj.controller.ducha;
- import cn.com.goldenwater.dcproj.model.BisInspPlanYear;
- import cn.com.goldenwater.dcproj.model.BisInspPlanYearPrg;
- import cn.com.goldenwater.dcproj.param.BisInspPlanYearParam;
- import cn.com.goldenwater.dcproj.param.BisInspPlanYearPrgParam;
- import cn.com.goldenwater.dcproj.service.BisInspPlanYearPrgService;
- import cn.com.goldenwater.core.web.BaseController;
- import cn.com.goldenwater.core.web.BaseResponse;
- import cn.com.goldenwater.dcproj.service.OlBisInspOrgService;
- 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.util.Assert;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.RestController;
- import javax.servlet.http.HttpServletResponse;
- import java.util.List;
- /**
- * @author lhc
- * @date 2022-3-3
- */
- @Api(value = "山东年度计划月进度情况管理", tags = "山东年度计划月进度情况管理")
- @RestController
- @RequestMapping("/bis/insp/plan/year/prg")
- public class BisInspPlanYearPrgController extends BaseController {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- private BisInspPlanYearPrgService bisInspPlanYearPrgService;
- @Autowired
- private OlBisInspOrgService olBisInspOrgService;
- @ApiOperation(value = "添加山东年度计划月进度情况")
- @RequestMapping(value = "/", method = RequestMethod.POST)
- public BaseResponse<BisInspPlanYearPrg> insert(@ApiParam(name = "bisInspPlanYearPrg", value = "BisInspPlanYearPrg", required = true) @RequestBody BisInspPlanYearPrg bisInspPlanYearPrg) {
- if (StringUtils.isBlank(bisInspPlanYearPrg.getId())) {
- bisInspPlanYearPrg.setAdCode(olBisInspOrgService.getProvince(getCurrentOrgId()));
- bisInspPlanYearPrg.setPersId(getCurrentPersId());
- bisInspPlanYearPrgService.insert(bisInspPlanYearPrg);
- } else {
- bisInspPlanYearPrgService.update(bisInspPlanYearPrg);
- }
- return buildSuccessResponse(bisInspPlanYearPrg);
- }
- @ApiOperation(value = "根据ID删除山东年度计划月进度情况")
- @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
- public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- int ret = bisInspPlanYearPrgService.delete(id);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "更新山东年度计划月进度情况信息")
- @RequestMapping(value = "/update", method = RequestMethod.POST)
- public BaseResponse<BisInspPlanYearPrg> update(@ApiParam(name = "bisInspPlanYearPrg", value = "BisInspPlanYearPrg", required = true) @RequestBody BisInspPlanYearPrg bisInspPlanYearPrg) {
- Assert.notNull(bisInspPlanYearPrg.getId(), "主键id为必填参数");
- int ret = bisInspPlanYearPrgService.update(bisInspPlanYearPrg);
- return buildSuccessResponse(bisInspPlanYearPrg);
- }
- @ApiOperation(value = "根据ID获取山东年度计划月进度情况(单表)")
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public BaseResponse<BisInspPlanYearPrg> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- BisInspPlanYearPrg bisInspPlanYearPrg = bisInspPlanYearPrgService.get(id);
- return buildSuccessResponse(bisInspPlanYearPrg);
- }
- @ApiOperation(value = "根据年ID获取山东年度计划月进度情况(单表)")
- @RequestMapping(value = "/getPlanByYearId/{id}", method = RequestMethod.GET)
- public BaseResponse<List<BisInspPlanYearPrg>> getPlanByYearId(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- List<BisInspPlanYearPrg> bisInspPlanYearPrgs = bisInspPlanYearPrgService.getPlanByYearId(id);
- return buildSuccessResponse(bisInspPlanYearPrgs);
- }
- @ApiOperation(value = "获取列 表(分页)")
- @RequestMapping(value = "/findPageList", method = RequestMethod.POST)
- public BaseResponse<List<BisInspPlanYearPrg>> findPageList(@ApiParam(name = "BisInspPlanYearPrgParam", value = "BisInspPlanYearPrgParam", required = true) @RequestBody BisInspPlanYearPrgParam bisInspPlanYearPrgParam) {
- bisInspPlanYearPrgParam.setAdCode(AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId())));
- List<BisInspPlanYearPrg> bisInspPlanYearPrgList = bisInspPlanYearPrgService.findPageList(bisInspPlanYearPrgParam);
- return buildSuccessResponse(bisInspPlanYearPrgList);
- }
- @ApiOperation(value = "督查计划进度月报导出")
- @RequestMapping(value = "/export", method = RequestMethod.POST)
- public void export(HttpServletResponse response, @RequestBody BisInspPlanYearPrgParam bisInspPlanYearPrgParam) {
- bisInspPlanYearPrgParam.setOrgId(getCurrentOrgId());
- bisInspPlanYearPrgService.export(response, bisInspPlanYearPrgParam,null);
- }
- @ApiOperation(value = "导出下月计划")
- @RequestMapping(value = "/export1", method = RequestMethod.POST)
- public void export1(HttpServletResponse response, @RequestBody BisInspPlanYearPrgParam bisInspPlanYearPrgParam) {
- bisInspPlanYearPrgParam.setOrgId(getCurrentOrgId());
- bisInspPlanYearPrgService.export1(response, bisInspPlanYearPrgParam,null);
- }
- }
|