| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- 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.constValue.SplitValue;
- import cn.com.goldenwater.dcproj.model.BisInspScheme;
- import cn.com.goldenwater.dcproj.service.BisInspSchemeService;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import io.swagger.annotations.ApiParam;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.util.Date;
- import java.util.List;
- import java.util.UUID;
- /**
- * @author lune
- * @date 2019-2-18
- */
- @Api(value = "督查工作方案", tags = "02督查工作方案")
- @RestController
- @RequestMapping("/dc/insp/scheme")
- public class BisInspSchemeController extends BaseController {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- private BisInspSchemeService bisInspSchemeService;
- @ApiOperation(value = "添加督查工作方案", notes = "参数字段说明:{\n\r" +
- " \"schmTitle\":\"方案标题\",\n\r" +
- " \"schmContent\":\"方案内容\",\n\r" +
- " \"schmSttm\":\"方案开始时间\",\n\r" +
- " \"schmEnttm\":\"方案结束时间\",\n\r" +
- " \"fileList(上传文件列表) \":[\n\r" +
- " {\n\r" +
- " \"id \":\"文件主键\",\n\r" +
- " }\n\r" +
- " ]\n\r" +
- " };\n\r" +
- "返回结构说明:{\n\r" +
- " \"success\":\"是否成功(true为成功,false为失败)\",\n\r" +
- " \"code\":\"错误代码\",\n\r" +
- " \"data(数据信息)\":\"null\",\n\r" +
- " }")
- @RequestMapping(value = "", method = RequestMethod.POST)
- public BaseResponse<String> insert(@ApiParam(name = "bisInspScheme", value = "BisInspScheme", required = true) @RequestBody BisInspScheme bisInspScheme) {
- String uuid = UUID.randomUUID().toString().replace(SplitValue.HENG_SPLIT, "");
- bisInspScheme.setSchmId(uuid);
- bisInspScheme.setSchmIntm(new Date());
- int ret = bisInspSchemeService.insert(bisInspScheme);
- return buildSuccessResponse(uuid);
- }
- @ApiOperation(value = "根据机构id获取督查方案列表")
- @RequestMapping(value = "/getDCFAListByOrgId", method = RequestMethod.GET)
- public BaseResponse<List<BisInspScheme>> getDCFAListByOrgId(@RequestParam("id") String id) {
- List<BisInspScheme> list = bisInspSchemeService.getDCFAListByOrgId(id);
- return buildSuccessResponse(list);
- }
- @ApiOperation(value = "根据督查类型获取督查方案列表", notes = "参数字段说明:{\n\r" +
- " \"type\":\"督查类型(1小水库2农村饮水工程3水毁修复情况4 172工程)\",\n\r" +
- " };\n\r" +
- "返回结构说明:{\n\r" +
- " \"success\":\"是否成功(true为成功,false为失败)\",\n\r" +
- " \"code\":\"错误代码\",\n\r" +
- " \"message\":\"描述信息\",\n\r" +
- " \"throwable\":\"异常信息\",\n\r" +
- " \"data(数据信息)\":[\n\r" +
- " {\n\r" +
- " \"guid\":\"机构id\",\n\r" +
- " \"schmId\":\"督导方案id\",\n\r" +
- " \"schmTitle\":\"督导方案标题\",\n\r" +
- " \"schmContent\":\"督导方案内容\",\n\r" +
- " \"schmMkps\":\"方案制作人id\",\n\r" +
- " \"schmSttm\":\"方案开始时间\",\n\r" +
- " \"schmEnttm\":\"方案结束时间\",\n\r" +
- " \"schmIntm\":\"方案录入时间\",\n\r" +
- " \"schmUptm\":\"方案最后修改时间\",\n\r" +
- " \"schmNote\":\"备注\",\n\r" +
- " }\n\r" +
- " ]\n\r" +
- " }")
- @RequestMapping(value = "/getDCFAListByType", method = RequestMethod.GET)
- public BaseResponse<List<BisInspScheme>> getDCFAListByType(@RequestParam("type") String type) {
- List<BisInspScheme> list = bisInspSchemeService.getDCFAListByType(type);
- return buildSuccessResponse(list);
- }
- }
|