| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.modules.eam.constant.BusinessCodeConst; |
| | | import org.jeecg.modules.eam.constant.OrderCreationMethodEnum; |
| | | import org.jeecg.modules.eam.entity.EamTechnicalStatusEvaluationOrder; |
| | | import org.jeecg.modules.eam.request.EamTechnicalStatusEvaluationOrderQuery; |
| | | import org.jeecg.modules.eam.request.EamTechnicalStatusEvaluationOrderRequest; |
| | | import org.jeecg.modules.eam.service.IEamTechnicalStatusEvaluationOrderService; |
| | | import org.jeecg.modules.system.service.ISysBusinessCodeRuleService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | public class EamTechnicalStatusEvaluationOrderController extends JeecgController<EamTechnicalStatusEvaluationOrder, IEamTechnicalStatusEvaluationOrderService> { |
| | | @Autowired |
| | | private IEamTechnicalStatusEvaluationOrderService eamTechnicalStatusEvaluationOrderService; |
| | | |
| | | @Autowired |
| | | private ISysBusinessCodeRuleService businessCodeRuleService; |
| | | /** |
| | | * 分页列表查询 |
| | | * |
| | |
| | | /** |
| | | * 添加 |
| | | * |
| | | * @param eamTechnicalStatusEvaluationOrder |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "技术状态鉴定工单-添加") |
| | | @ApiOperation(value="技术状态鉴定工单-添加", notes="技术状态鉴定工单-添加") |
| | | @PostMapping(value = "/add") |
| | | public Result<?> add(@RequestBody EamTechnicalStatusEvaluationOrder eamTechnicalStatusEvaluationOrder) { |
| | | eamTechnicalStatusEvaluationOrderService.save(eamTechnicalStatusEvaluationOrder); |
| | | public Result<?> add(@RequestBody EamTechnicalStatusEvaluationOrderRequest request) { |
| | | if (request == null) { |
| | | return Result.error("添加的对象不能为空!"); |
| | | } |
| | | if (CollectionUtil.isEmpty(request.getTableDetailList())) { |
| | | return Result.error("检查项不能为空!"); |
| | | } |
| | | String codeSeq = businessCodeRuleService.generateBusinessCodeSeq(BusinessCodeConst.TECHNICAL_STATUS_EVALUATION_ORDER_CODE_RULE); |
| | | request.setOrderNum(codeSeq); |
| | | request.setCreationMethod(OrderCreationMethodEnum.MANUAL.name()); |
| | | boolean b = eamTechnicalStatusEvaluationOrderService.addTechnicalStatusEvaluationOrder(request); |
| | | if (!b) { |
| | | return Result.error("添加失败!"); |
| | | } |
| | | return Result.OK("添加成功!"); |
| | | } |
| | | |