package cn.com.goldenwater.dcproj.controller.plan; import cn.com.goldenwater.dcproj.model.BisInspMtprggd; import cn.com.goldenwater.dcproj.param.BisInspMtprggdParam; import cn.com.goldenwater.dcproj.service.BisInspMtprggdService; 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 cn.com.goldenwater.util.common.SqlUtils; 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.Date; import java.util.List; import java.util.Map; /** * @author lhc * @date 2022-3-17 */ @Api(value = "广东月进度计划管理", tags = "广东月进度计划管理") @RestController @RequestMapping("/bis/insp/mtprggd") public class BisInspMtprggdController extends BaseController { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private BisInspMtprggdService bisInspMtprggdService; @Autowired private OlBisInspOrgService olBisInspOrgService; @ApiOperation(value = "添加广东月进度计划") @RequestMapping(value = "/", method = RequestMethod.POST) public BaseResponse insert(@ApiParam(name = "bisInspMtprggd", value = "BisInspMtprggd", required = true) @RequestBody BisInspMtprggd bisInspMtprggd) { bisInspMtprggd.setPersId(getCurrentPersId()); if (StringUtils.isBlank(bisInspMtprggd.getId())) { //设置机构id,省份数据id,人员id bisInspMtprggd.setAdCode(olBisInspOrgService.getProvince(getCurrentOrgId())); bisInspMtprggdService.insert(bisInspMtprggd); } else { bisInspMtprggdService.update(bisInspMtprggd); } return buildSuccessResponse(bisInspMtprggd); } @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 = bisInspMtprggdService.delete(id); return buildSuccessResponse(); } @ApiOperation(value = "更新广东月进度计划信息") @RequestMapping(value = "/update", method = RequestMethod.POST) public BaseResponse update(@ApiParam(name = "bisInspMtprggd", value = "BisInspMtprggd", required = true) @RequestBody BisInspMtprggd bisInspMtprggd) { Assert.notNull(bisInspMtprggd.getId(), "主键id为必填参数"); int ret = bisInspMtprggdService.update(bisInspMtprggd); return buildSuccessResponse(bisInspMtprggd); } @ApiOperation(value = "根据ID获取广东月进度计划(单表)") @RequestMapping(value = "/{id}", method = RequestMethod.GET) public BaseResponse get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) { BisInspMtprggd bisInspMtprggd = bisInspMtprggdService.get(id); return buildSuccessResponse(bisInspMtprggd); } @ApiOperation(value = "获取列表数据") @RequestMapping(value = "/page", method = RequestMethod.POST) public BaseResponse findPcPage(@RequestBody BisInspMtprggdParam bisInspMtprggdParam) { bisInspMtprggdParam.setAdCode(AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo pageInfo = bisInspMtprggdService.findPageInfo(bisInspMtprggdParam); return buildSuccessResponse(pageInfo); } @ApiOperation(value = "获取列表数据") @RequestMapping(value = "/getMonthRefrom", method = RequestMethod.POST) public BaseResponse>> getMonthRefrom(@RequestBody Map parmas) { parmas.put("adCode",AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId()))); List> list = bisInspMtprggdService.getMonthRefrom(parmas); return buildSuccessResponse(list); } @ApiOperation(value = "导出检查表") @RequestMapping(value = "/export", method = RequestMethod.POST) public void export(HttpServletResponse response, @RequestBody Map parmas) { parmas.put("adCode",AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId()))); bisInspMtprggdService.export(response, parmas); } @ApiOperation(value = "导出月进度检查表") @RequestMapping(value = "/exportMonth", method = RequestMethod.POST) public void exportMonth(HttpServletResponse response, @RequestBody BisInspMtprggdParam bisInspMtprggdParam) { bisInspMtprggdParam.setAdCode(AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId()))); bisInspMtprggdService.exportMonth(response, bisInspMtprggdParam,null,null); } }