|
@@ -20,118 +20,118 @@ import java.util.List;
|
|
|
/**
|
|
|
* Created by CodeGenerator on 2025/07/11.
|
|
|
*/
|
|
|
-@Api(tags = "[后台]systemFormTemp管理")
|
|
|
+@Api(tags = "[后台]表单管理")
|
|
|
@RestController
|
|
|
@RequestMapping("/system/form/temp")
|
|
|
public class SystemFormTempController {
|
|
|
|
|
|
- private static Logger log = LoggerFactory.getLogger(SystemFormTempController.class);
|
|
|
+ private static Logger log = LoggerFactory.getLogger(SystemFormTempController.class);
|
|
|
|
|
|
@Resource
|
|
|
private SystemFormTempService systemFormTempService;
|
|
|
|
|
|
@PostMapping("/add")
|
|
|
- @ApiOperation(value = "systemFormTemp新增", httpMethod = "POST")
|
|
|
- public Result add(@RequestBody SystemFormTemp systemFormTemp, Long userId) {
|
|
|
- if (systemFormTemp == null) {
|
|
|
- return Result.fail(ResultCode.OBJECT_IS_NULL);
|
|
|
- }
|
|
|
- if (userId == null) {
|
|
|
- return Result.fail(ResultCode.USERID_IS_NULL);
|
|
|
- }
|
|
|
- try {
|
|
|
- systemFormTemp.setCreateTime(new Date());
|
|
|
- systemFormTemp.setCreateUserId(userId);
|
|
|
- systemFormTempService.save(systemFormTemp);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("新增对象操作异常e:{}", e);
|
|
|
- return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
|
|
|
- }
|
|
|
+ @ApiOperation(value = "表单新增", httpMethod = "POST")
|
|
|
+ public Result add(@RequestBody SystemFormTemp systemFormTemp, Long userId) {
|
|
|
+ if (systemFormTemp == null) {
|
|
|
+ return Result.fail(ResultCode.OBJECT_IS_NULL);
|
|
|
+ }
|
|
|
+ if (userId == null) {
|
|
|
+ return Result.fail(ResultCode.USERID_IS_NULL);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ systemFormTemp.setCreateTime(new Date());
|
|
|
+ systemFormTemp.setCreateUserId(userId);
|
|
|
+ systemFormTempService.save(systemFormTemp);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("新增对象操作异常e:{}", e);
|
|
|
+ return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
|
|
|
+ }
|
|
|
return Result.success();
|
|
|
}
|
|
|
|
|
|
@PostMapping("/delete")
|
|
|
- @ApiOperation(value = "systemFormTemp删除", httpMethod = "POST")
|
|
|
- public Result delete(@RequestParam Long id, Long userId) {
|
|
|
- if (id == null) {
|
|
|
- return Result.fail(ResultCode.ID_IS_NULL);
|
|
|
- }
|
|
|
- if (userId == null) {
|
|
|
- return Result.fail(ResultCode.USERID_IS_NULL);
|
|
|
- }
|
|
|
- try {
|
|
|
+ @ApiOperation(value = "表单删除", httpMethod = "POST")
|
|
|
+ public Result delete(@RequestParam Long id, Long userId) {
|
|
|
+ if (id == null) {
|
|
|
+ return Result.fail(ResultCode.ID_IS_NULL);
|
|
|
+ }
|
|
|
+ if (userId == null) {
|
|
|
+ return Result.fail(ResultCode.USERID_IS_NULL);
|
|
|
+ }
|
|
|
+ try {
|
|
|
SystemFormTemp systemFormTemp = new SystemFormTemp();
|
|
|
- systemFormTemp.setId(id);
|
|
|
- systemFormTemp.setIsDelete(1);
|
|
|
- systemFormTempService.update(systemFormTemp);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("删除对象操作异常e:{}", e);
|
|
|
- return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
|
|
|
- }
|
|
|
+ systemFormTemp.setId(id);
|
|
|
+ systemFormTemp.setIsDelete(1);
|
|
|
+ systemFormTempService.update(systemFormTemp);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("删除对象操作异常e:{}", e);
|
|
|
+ return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
|
|
|
+ }
|
|
|
return Result.success();
|
|
|
}
|
|
|
|
|
|
@PostMapping("/update")
|
|
|
- @ApiOperation(value = "systemFormTemp更新", httpMethod = "POST")
|
|
|
- public Result update(@RequestBody SystemFormTemp systemFormTemp, Long userId) {
|
|
|
- if (systemFormTemp == null) {
|
|
|
- return Result.fail(ResultCode.OBJECT_IS_NULL);
|
|
|
- }
|
|
|
- if (systemFormTemp.getId() == null) {
|
|
|
- return Result.fail(ResultCode.ID_IS_NULL);
|
|
|
- }
|
|
|
- if (userId == null) {
|
|
|
- return Result.fail(ResultCode.USERID_IS_NULL);
|
|
|
- }
|
|
|
- try {
|
|
|
- systemFormTemp.setUpdateTime(new Date());
|
|
|
- systemFormTemp.setUpdateUserId(userId);
|
|
|
- systemFormTempService.update(systemFormTemp);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("更新对象操作异常e:{}", e);
|
|
|
- return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
|
|
|
- }
|
|
|
+ @ApiOperation(value = "表单更新", httpMethod = "POST")
|
|
|
+ public Result update(@RequestBody SystemFormTemp systemFormTemp, Long userId) {
|
|
|
+ if (systemFormTemp == null) {
|
|
|
+ return Result.fail(ResultCode.OBJECT_IS_NULL);
|
|
|
+ }
|
|
|
+ if (systemFormTemp.getId() == null) {
|
|
|
+ return Result.fail(ResultCode.ID_IS_NULL);
|
|
|
+ }
|
|
|
+ if (userId == null) {
|
|
|
+ return Result.fail(ResultCode.USERID_IS_NULL);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ systemFormTemp.setUpdateTime(new Date());
|
|
|
+ systemFormTemp.setUpdateUserId(userId);
|
|
|
+ systemFormTempService.update(systemFormTemp);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("更新对象操作异常e:{}", e);
|
|
|
+ return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
|
|
|
+ }
|
|
|
return Result.success();
|
|
|
}
|
|
|
|
|
|
@PostMapping("/detail")
|
|
|
- @ApiOperation(value = "systemFormTemp获取详情", httpMethod = "POST")
|
|
|
- public Result<SystemFormTemp> detail(@RequestParam Long id, Long userId) {
|
|
|
- if (id == null) {
|
|
|
- return Result.fail(ResultCode.ID_IS_NULL);
|
|
|
- }
|
|
|
- if (userId == null) {
|
|
|
- return Result.fail(ResultCode.USERID_IS_NULL);
|
|
|
- }
|
|
|
- SystemFormTemp systemFormTemp = null;
|
|
|
- try {
|
|
|
- systemFormTemp = systemFormTempService.findById(id);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("查询对象操作异常e:{}", e);
|
|
|
- return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
|
|
|
- }
|
|
|
+ @ApiOperation(value = "表单获取详情", httpMethod = "POST")
|
|
|
+ public Result<SystemFormTemp> detail(@RequestParam Long id, Long userId) {
|
|
|
+ if (id == null) {
|
|
|
+ return Result.fail(ResultCode.ID_IS_NULL);
|
|
|
+ }
|
|
|
+ if (userId == null) {
|
|
|
+ return Result.fail(ResultCode.USERID_IS_NULL);
|
|
|
+ }
|
|
|
+ SystemFormTemp systemFormTemp = null;
|
|
|
+ try {
|
|
|
+ systemFormTemp = systemFormTempService.findById(id);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("查询对象操作异常e:{}", e);
|
|
|
+ return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
|
|
|
+ }
|
|
|
return Result.success(systemFormTemp);
|
|
|
}
|
|
|
|
|
|
@PostMapping("/list")
|
|
|
- @ApiOperation(value = "systemFormTemp获取列表", httpMethod = "POST")
|
|
|
- public Result<List<SystemFormTemp>> list(@RequestBody SystemFormTemp systemFormTemp, @RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "0") Integer size, Long userId) {
|
|
|
- if (userId == null) {
|
|
|
- return Result.fail(ResultCode.USERID_IS_NULL);
|
|
|
- }
|
|
|
+ @ApiOperation(value = "表单获取列表", httpMethod = "POST")
|
|
|
+ public Result<List<SystemFormTemp>> list(@RequestBody SystemFormTemp systemFormTemp, @RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "0") Integer size, Long userId) {
|
|
|
+ if (userId == null) {
|
|
|
+ return Result.fail(ResultCode.USERID_IS_NULL);
|
|
|
+ }
|
|
|
PageHelper.startPage(page, size);
|
|
|
|
|
|
Condition condition = new Condition(systemFormTemp.getClass());
|
|
|
// Criteria criteria = condition.createCriteria();
|
|
|
// criteria.andEqualTo("name", city.getName());
|
|
|
- PageInfo pageInfo = null;
|
|
|
- try {
|
|
|
- List<SystemFormTemp> list = systemFormTempService.findByCondition(condition);
|
|
|
- pageInfo = new PageInfo(list);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("查询对象操作异常e:{}", e);
|
|
|
- return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
|
|
|
- }
|
|
|
+ PageInfo pageInfo = null;
|
|
|
+ try {
|
|
|
+ List<SystemFormTemp> list = systemFormTempService.findByCondition(condition);
|
|
|
+ pageInfo = new PageInfo(list);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("查询对象操作异常e:{}", e);
|
|
|
+ return Result.fail(ResultCode.INTERNAL_SERVER_ERROR);
|
|
|
+ }
|
|
|
return Result.success(pageInfo);
|
|
|
}
|
|
|
}
|