|
|
|
@ -1,12 +1,19 @@ |
|
|
|
package com.xujie.sys.modules.part.controller; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.xujie.sys.common.utils.PageUtils; |
|
|
|
import com.xujie.sys.common.utils.R; |
|
|
|
import com.xujie.sys.modules.part.data.PartGroupStdOperationsData; |
|
|
|
import com.xujie.sys.modules.part.data.StandardRoutingOperationData; |
|
|
|
import com.xujie.sys.modules.part.mapper.PartGroupStdOperationsMapper; |
|
|
|
import com.xujie.sys.modules.part.service.PartGroupStdOperationsService; |
|
|
|
import com.xujie.sys.modules.part.service.StandardRoutingOperationService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: |
|
|
|
* @author: jiayang_yue |
|
|
|
@ -21,6 +28,12 @@ public class StandardRoutingOperationController { |
|
|
|
@Autowired |
|
|
|
private StandardRoutingOperationService standardRoutingOperationService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private PartGroupStdOperationsService partGroupStdOperationsService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private PartGroupStdOperationsMapper partGroupStdOperationsMapper; |
|
|
|
|
|
|
|
@PostMapping("/searchStandardRoutingOperationList") |
|
|
|
@ResponseBody |
|
|
|
public R searchStandardRoutingOperationList(@RequestBody StandardRoutingOperationData data) { |
|
|
|
@ -44,7 +57,16 @@ public class StandardRoutingOperationController { |
|
|
|
|
|
|
|
@PostMapping("/deleteStandardRoutingOperation") |
|
|
|
@ResponseBody |
|
|
|
@Transactional |
|
|
|
public R deleteStandardRoutingOperation(@RequestBody StandardRoutingOperationData data) { |
|
|
|
QueryWrapper<PartGroupStdOperationsData> queryWrapper = new QueryWrapper<>(); |
|
|
|
queryWrapper.eq("operation_id", data.getId()) |
|
|
|
.eq("site", data.getSite()) |
|
|
|
.eq("bu_no", data.getBuNo()); |
|
|
|
List<PartGroupStdOperationsData> partGroupStdOperationsData = partGroupStdOperationsMapper.selectList(queryWrapper); |
|
|
|
if (!partGroupStdOperationsData.isEmpty()) { |
|
|
|
throw new RuntimeException("该标准工序已被商品组使用,无法删除!"); |
|
|
|
} |
|
|
|
standardRoutingOperationService.removeById(data.getId()); |
|
|
|
return R.ok(); |
|
|
|
} |
|
|
|
|