| | |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @RequestMapping("/StandardTemplate") |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @Api("原始记录模板") |
| | | @Api(tags = "原始记录模板") |
| | | public class StandardTemplateController { |
| | | |
| | | private StandardTemplateService standardTemplateService; |
| | | @ValueClassify("原始记录模板") |
| | | @ValueClassify("标准库") |
| | | @ApiOperation(value = "获取原始记录模板列表") |
| | | @PostMapping("/selectStandardTemplatePageList") |
| | | public Result selectStandardTemplatePageList(@RequestBody Map<String, Object> data) throws Exception { |
| | |
| | | StandardTemplate standardTemplate = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), StandardTemplate.class); |
| | | return Result.success(standardTemplateService.selectStandardTemplatePageList(page, standardTemplate)); |
| | | } |
| | | @ValueClassify("原始记录模板") |
| | | @ValueClassify("标准库") |
| | | @ApiOperation(value = "添加原始记录模板") |
| | | @PostMapping("/addStandardTemplate") |
| | | public Result addStandardTemplate(@RequestBody StandardTemplate standardTemplate) { |
| | | return Result.success(standardTemplateService.addStandardTemplate(standardTemplate)); |
| | | } |
| | | @ValueClassify("原始记录模板") |
| | | @ValueClassify("标准库") |
| | | @ApiOperation(value = "修改原始记录模板") |
| | | @PostMapping("/upStandardTemplate") |
| | | public Result<?> upStandardTemplate(@RequestBody StandardTemplate standardTemplate) { |
| | | return Result.success(standardTemplateService.upStandardTemplate(standardTemplate)); |
| | | } |
| | | @ValueClassify("原始记录模板") |
| | | @ValueClassify("标准库") |
| | | @ApiOperation(value = "删除原始记录模板") |
| | | @PostMapping("/delStandardTemplate") |
| | | public Result<?> delStandardTemplate(Integer id) { |
| | |
| | | return Result.success(standardTemplateService.getStandTempThingById(id)); |
| | | } |
| | | |
| | | @ValueAuth |
| | | @ApiOperation(value = "编辑模板编制") |
| | | @GetMapping("/getEditTemplatePreparation") |
| | | public Result<?> getEditTemplatePreparation(@RequestParam("id") Integer id) { |
| | | StandardTemplate byId = standardTemplateService.getById(id); |
| | | return Result.success("OK", byId.getThing()); |
| | | } |
| | | } |