|  |  | @ -9,9 +9,13 @@ import com.epmet.commons.tools.validator.ValidatorUtils; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.validator.group.AddGroup; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.validator.group.UpdateGroup; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.validator.group.DefaultGroup; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.WorkdiaryServiceTypeDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.form.workdiaryservice.WorkdiaryServiceQueryFormDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.result.WorkdiaryServiceRecordDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.entity.WorkdiaryServiceTypeExcel; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.excel.WorkdiaryServiceRecordExcel; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.WorkdiaryServiceRecordService; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.WorkdiaryServiceTypeService; | 
			
		
	
		
			
				
					|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
			
		
	
		
			
				
					|  |  |  | import org.springframework.web.bind.annotation.*; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | @ -27,56 +31,153 @@ import java.util.Map; | 
			
		
	
		
			
				
					|  |  |  |  * @since v1.0.0 2022-08-23 | 
			
		
	
		
			
				
					|  |  |  |  */ | 
			
		
	
		
			
				
					|  |  |  | @RestController | 
			
		
	
		
			
				
					|  |  |  | @RequestMapping("workdiaryServiceRecord") | 
			
		
	
		
			
				
					|  |  |  | @RequestMapping("workdiaryService") | 
			
		
	
		
			
				
					|  |  |  | public class WorkdiaryServiceRecordController { | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     @Autowired | 
			
		
	
		
			
				
					|  |  |  |     private WorkdiaryServiceRecordService workdiaryServiceRecordService; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     @RequestMapping("page") | 
			
		
	
		
			
				
					|  |  |  |     public Result<PageData<WorkdiaryServiceRecordDTO>> page(@RequestParam Map<String, Object> params){ | 
			
		
	
		
			
				
					|  |  |  |         PageData<WorkdiaryServiceRecordDTO> page = workdiaryServiceRecordService.page(params); | 
			
		
	
		
			
				
					|  |  |  |     @Autowired | 
			
		
	
		
			
				
					|  |  |  |     private WorkdiaryServiceTypeService workdiaryServiceTypeService; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |      * 记录-分页 | 
			
		
	
		
			
				
					|  |  |  |      * @param params | 
			
		
	
		
			
				
					|  |  |  |      * @return | 
			
		
	
		
			
				
					|  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |     @RequestMapping("/record/page") | 
			
		
	
		
			
				
					|  |  |  |     public Result<PageData<WorkdiaryServiceRecordDTO>> recordPage(@RequestBody WorkdiaryServiceQueryFormDTO input){ | 
			
		
	
		
			
				
					|  |  |  |         PageData<WorkdiaryServiceRecordDTO> page = workdiaryServiceRecordService.page(null); | 
			
		
	
		
			
				
					|  |  |  |         return new Result<PageData<WorkdiaryServiceRecordDTO>>().ok(page); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) | 
			
		
	
		
			
				
					|  |  |  |     public Result<WorkdiaryServiceRecordDTO> get(@PathVariable("id") String id){ | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |      * 记录-单条 | 
			
		
	
		
			
				
					|  |  |  |      * @param id | 
			
		
	
		
			
				
					|  |  |  |      * @return | 
			
		
	
		
			
				
					|  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |     @RequestMapping(value = "/record/{id}",method = {RequestMethod.POST,RequestMethod.GET}) | 
			
		
	
		
			
				
					|  |  |  |     public Result<WorkdiaryServiceRecordDTO> recordGet(@PathVariable("id") String id){ | 
			
		
	
		
			
				
					|  |  |  |         WorkdiaryServiceRecordDTO data = workdiaryServiceRecordService.get(id); | 
			
		
	
		
			
				
					|  |  |  |         return new Result<WorkdiaryServiceRecordDTO>().ok(data); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |      * 记录-保存 | 
			
		
	
		
			
				
					|  |  |  |      * @return | 
			
		
	
		
			
				
					|  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |     @NoRepeatSubmit | 
			
		
	
		
			
				
					|  |  |  |     @PostMapping("save") | 
			
		
	
		
			
				
					|  |  |  |     public Result save(@RequestBody WorkdiaryServiceRecordDTO dto){ | 
			
		
	
		
			
				
					|  |  |  |     @PostMapping("/record/save") | 
			
		
	
		
			
				
					|  |  |  |     public Result recordSave(@RequestBody WorkdiaryServiceRecordDTO dto){ | 
			
		
	
		
			
				
					|  |  |  |         //效验数据
 | 
			
		
	
		
			
				
					|  |  |  |         ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); | 
			
		
	
		
			
				
					|  |  |  |         workdiaryServiceRecordService.save(dto); | 
			
		
	
		
			
				
					|  |  |  |         return new Result(); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |      * 记录-更新 | 
			
		
	
		
			
				
					|  |  |  |      * @param | 
			
		
	
		
			
				
					|  |  |  |      * @return | 
			
		
	
		
			
				
					|  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |     @NoRepeatSubmit | 
			
		
	
		
			
				
					|  |  |  |     @PostMapping("update") | 
			
		
	
		
			
				
					|  |  |  |     public Result update(@RequestBody WorkdiaryServiceRecordDTO dto){ | 
			
		
	
		
			
				
					|  |  |  |     @PostMapping("/record/update") | 
			
		
	
		
			
				
					|  |  |  |     public Result recordUpdate(@RequestBody WorkdiaryServiceRecordDTO dto){ | 
			
		
	
		
			
				
					|  |  |  |         //效验数据
 | 
			
		
	
		
			
				
					|  |  |  |         ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); | 
			
		
	
		
			
				
					|  |  |  |         workdiaryServiceRecordService.update(dto); | 
			
		
	
		
			
				
					|  |  |  |         return new Result(); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     @PostMapping("delete") | 
			
		
	
		
			
				
					|  |  |  |     public Result delete(@RequestBody String[] ids){ | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |      * 记录-删除 | 
			
		
	
		
			
				
					|  |  |  |      * @return | 
			
		
	
		
			
				
					|  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |     @PostMapping("/record/delete") | 
			
		
	
		
			
				
					|  |  |  |     public Result recordDelete(@RequestBody String[] ids){ | 
			
		
	
		
			
				
					|  |  |  |         //效验数据
 | 
			
		
	
		
			
				
					|  |  |  |         AssertUtils.isArrayEmpty(ids, "id"); | 
			
		
	
		
			
				
					|  |  |  |         workdiaryServiceRecordService.delete(ids); | 
			
		
	
		
			
				
					|  |  |  |         return new Result(); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     @GetMapping("export") | 
			
		
	
		
			
				
					|  |  |  |     public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |      * 记录-导出 | 
			
		
	
		
			
				
					|  |  |  |      * @return | 
			
		
	
		
			
				
					|  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |     @GetMapping("/record/export") | 
			
		
	
		
			
				
					|  |  |  |     public void recordExport(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { | 
			
		
	
		
			
				
					|  |  |  |         List<WorkdiaryServiceRecordDTO> list = workdiaryServiceRecordService.list(params); | 
			
		
	
		
			
				
					|  |  |  |         ExcelUtils.exportExcelToTarget(response, null, list, WorkdiaryServiceRecordExcel.class); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |      * 服务类型-分页 | 
			
		
	
		
			
				
					|  |  |  |      * @return | 
			
		
	
		
			
				
					|  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |     @RequestMapping("/serviceType/page") | 
			
		
	
		
			
				
					|  |  |  |     public Result<PageData<WorkdiaryServiceTypeDTO>> serviceTypePage(@RequestParam Map<String, Object> params){ | 
			
		
	
		
			
				
					|  |  |  |         PageData<WorkdiaryServiceTypeDTO> page = workdiaryServiceTypeService.page(params); | 
			
		
	
		
			
				
					|  |  |  |         return new Result<PageData<WorkdiaryServiceTypeDTO>>().ok(page); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |      * 服务类型-单条 | 
			
		
	
		
			
				
					|  |  |  |      * @return | 
			
		
	
		
			
				
					|  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |     @RequestMapping(value = "/serviceType/{id}",method = {RequestMethod.POST,RequestMethod.GET}) | 
			
		
	
		
			
				
					|  |  |  |     public Result<WorkdiaryServiceTypeDTO> serviceTypeGet(@PathVariable("id") String id){ | 
			
		
	
		
			
				
					|  |  |  |         WorkdiaryServiceTypeDTO data = workdiaryServiceTypeService.get(id); | 
			
		
	
		
			
				
					|  |  |  |         return new Result<WorkdiaryServiceTypeDTO>().ok(data); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |      * 服务类型-保存 | 
			
		
	
		
			
				
					|  |  |  |      * @return | 
			
		
	
		
			
				
					|  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |     @NoRepeatSubmit | 
			
		
	
		
			
				
					|  |  |  |     @PostMapping("/serviceType/save") | 
			
		
	
		
			
				
					|  |  |  |     public Result serviceTypeSave(@RequestBody WorkdiaryServiceTypeDTO dto){ | 
			
		
	
		
			
				
					|  |  |  |         //效验数据
 | 
			
		
	
		
			
				
					|  |  |  |         ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); | 
			
		
	
		
			
				
					|  |  |  |         workdiaryServiceTypeService.save(dto); | 
			
		
	
		
			
				
					|  |  |  |         return new Result(); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |      * 服务类型-更新 | 
			
		
	
		
			
				
					|  |  |  |      * @return | 
			
		
	
		
			
				
					|  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |     @NoRepeatSubmit | 
			
		
	
		
			
				
					|  |  |  |     @PostMapping("/serviceType/update") | 
			
		
	
		
			
				
					|  |  |  |     public Result serviceTypeUpdate(@RequestBody WorkdiaryServiceTypeDTO dto){ | 
			
		
	
		
			
				
					|  |  |  |         //效验数据
 | 
			
		
	
		
			
				
					|  |  |  |         ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); | 
			
		
	
		
			
				
					|  |  |  |         workdiaryServiceTypeService.update(dto); | 
			
		
	
		
			
				
					|  |  |  |         return new Result(); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |      * 服务类型-删除 | 
			
		
	
		
			
				
					|  |  |  |      * @return | 
			
		
	
		
			
				
					|  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |     @PostMapping("/serviceType/delete") | 
			
		
	
		
			
				
					|  |  |  |     public Result serviceTypeDelete(@RequestBody String[] ids){ | 
			
		
	
		
			
				
					|  |  |  |         //效验数据
 | 
			
		
	
		
			
				
					|  |  |  |         AssertUtils.isArrayEmpty(ids, "id"); | 
			
		
	
		
			
				
					|  |  |  |         workdiaryServiceTypeService.delete(ids); | 
			
		
	
		
			
				
					|  |  |  |         return new Result(); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |      * 服务类型-导出 | 
			
		
	
		
			
				
					|  |  |  |      * @return | 
			
		
	
		
			
				
					|  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |     @GetMapping("/serviceType/export") | 
			
		
	
		
			
				
					|  |  |  |     public void serviceTypeExport(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { | 
			
		
	
		
			
				
					|  |  |  |         List<WorkdiaryServiceTypeDTO> list = workdiaryServiceTypeService.list(params); | 
			
		
	
		
			
				
					|  |  |  |         ExcelUtils.exportExcelToTarget(response, null, list, WorkdiaryServiceTypeExcel.class); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | } | 
			
		
	
	
		
			
				
					|  |  | 
 |