| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- package cn.com.goldenwater.dcproj.controller.ducha;
- import cn.com.goldenwater.core.web.BaseController;
- import cn.com.goldenwater.core.web.BaseResponse;
- import cn.com.goldenwater.dcproj.param.InspObjParam;
- import cn.com.goldenwater.dcproj.service.BisInspAllObj2Service;
- import cn.com.goldenwater.dcproj.service.OlBisInspOrgService;
- import cn.com.goldenwater.target.CheckException;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import io.swagger.annotations.ApiParam;
- import org.apache.commons.lang.StringUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.beans.factory.annotation.Value;
- 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.RestController;
- /**
- * Created by 61618 on 2019/4/17.
- */
- @Api(value = "督查计划相关接口", tags = "督查计划相关接口")
- @RestController
- @RequestMapping("/supervision/plan")
- public class BisInspAllObj2Controller extends BaseController {
- @Value("${export.templatePath}")
- private String templatePath;
- @Value("${impExcel.basePath}")
- private String impExcelPath;
- @Autowired
- private BisInspAllObj2Service bisInspAllObj2Service;
- @Autowired
- private OlBisInspOrgService olBisInspOrgService;
- /**
- * 添加全部督查对象:
- * 1. 根据条件查询所有未添加的督查对象
- * 2. 循环导入数据
- *
- * @param inspObjParam 查询条件
- * @return
- */
- @ApiOperation(value = "添加全部督查对象")
- @RequestMapping(value = "/insertAllObj", method = RequestMethod.POST)
- public BaseResponse<Object> insertAllObj(@ApiParam(name = "InspObjParam", value = "InspObjParam")
- @RequestBody InspObjParam inspObjParam) {
- if (StringUtils.isBlank(inspObjParam.getObjType()) ||
- StringUtils.isBlank(inspObjParam.getInspGroupId())) {
- throw new CheckException("缺少必传参数组ID或督查类别!");
- }
- inspObjParam.setOrgId(getCurrentOrgId());
- inspObjParam.setPersId(getCurrentPersId());
- inspObjParam.setProvince(olBisInspOrgService.getProvinceFlag(getCurrentOrgId()));
- if (StringUtils.isNotBlank(inspObjParam.getOrderBy()) && inspObjParam.getOrderBy().contains("undefined")) {
- inspObjParam.setOrderBy("");
- }
- return buildSuccessResponse(bisInspAllObj2Service.insertAllObj(inspObjParam));
- }
- }
|