|
@@ -1,9 +1,11 @@
|
|
|
-package org.jeecg.modules.Itdmgongdanshuju.controller;
|
|
|
+package org.jeecg.modules.itdmgongdanshuju.controller;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
+import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
import org.jeecg.modules.weituochaxun.vo.ItdmWeituoAllVO;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -16,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -47,9 +50,16 @@ public class ItdmGongdanshujuController {
|
|
|
|
|
|
@ApiOperation(value = "工单数据-生成", notes = "工单数据-生成")
|
|
|
@GetMapping("/create")
|
|
|
- public Boolean create(@RequestBody ItdmGongdanDto itdmGongdanDto, HttpServletRequest req) {
|
|
|
+ public Result create(@RequestBody ItdmGongdanDto itdmGongdanDto, HttpServletRequest req) {
|
|
|
+ List<ItdmGongdanShuju> detail = itdmGongdanShujuService.list(new QueryWrapper<ItdmGongdanShuju>().eq("wo_id", itdmGongdanDto.getWoId()));
|
|
|
+ if (detail.size() > 0) {
|
|
|
+ return Result.error("当前工单已有数据,不能重复生成数据");
|
|
|
+ }
|
|
|
Boolean b = itdmGongdanShujuService.generate(itdmGongdanDto);
|
|
|
- return b;
|
|
|
+ if (b) {
|
|
|
+ return Result.OK();
|
|
|
+ }
|
|
|
+ return Result.error("数据生成失败");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -60,4 +70,22 @@ public class ItdmGongdanshujuController {
|
|
|
return itdmGongdanShuju;
|
|
|
}
|
|
|
|
|
|
+ @AutoLog(value = "工单数据-批量删除")
|
|
|
+ @ApiOperation(value="工单数据-批量删除", notes="工单数据-批量删除")
|
|
|
+ //@RequiresPermissions("org.jeecg.modules:itdm_gongdan_shuju:deleteBatch")
|
|
|
+ @DeleteMapping(value = "/deleteBatch")
|
|
|
+ public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
|
+ this.itdmGongdanShujuService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
+ return Result.OK("批量删除成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ @AutoLog(value = "工单数据-编辑")
|
|
|
+ @ApiOperation(value="工单数据-编辑", notes="工单数据-编辑")
|
|
|
+ //@RequiresPermissions("org.jeecg.modules:itdm_gongdan_shuju:edit")
|
|
|
+ @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
+ public Result<String> edit(@RequestBody ItdmGongdanShuju itdmGongdanShuju) {
|
|
|
+ itdmGongdanShujuService.updateById(itdmGongdanShuju);
|
|
|
+ return Result.OK("编辑成功!");
|
|
|
+ }
|
|
|
+
|
|
|
}
|