|
|
@ -185,6 +185,36 @@ public class ZyProductProcessController extends JeecgController<ZyProductProcess |
|
|
|
@ApiOperation(value="产品工序-通过id删除", notes="产品工序-通过id删除") |
|
|
|
@ApiOperation(value="产品工序-通过id删除", notes="产品工序-通过id删除") |
|
|
|
@DeleteMapping(value = "/delete") |
|
|
|
@DeleteMapping(value = "/delete") |
|
|
|
public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
|
|
|
public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
|
|
|
|
|
|
|
ZyProductProcess Zp=zyProductProcessService.getById(id); |
|
|
|
|
|
|
|
String processId=Zp.getProcessId(); |
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
* 首先根据id查到对应的工序id,然后根据对应的工序id,查到他所包含的对应所有属性,属性集合,根据商品id和属性集合进行删除 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* */ |
|
|
|
|
|
|
|
//面料
|
|
|
|
|
|
|
|
List<String> listfabric =zyProductProcessService.findAllFabric(processId); |
|
|
|
|
|
|
|
if(listfabric!=null&&listfabric.size()>0) |
|
|
|
|
|
|
|
for (String s1 : listfabric) { |
|
|
|
|
|
|
|
productFabricService.deleteFabric(Zp.getProductId(),s1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//辅料
|
|
|
|
|
|
|
|
List<String> listAccessories =zyProductProcessService.findAllAccessories(processId); |
|
|
|
|
|
|
|
if(listAccessories!=null&&listAccessories.size()>0) |
|
|
|
|
|
|
|
for (String listAccessory : listAccessories) { |
|
|
|
|
|
|
|
productAccessoriesService.deleteAccessories(Zp.getProductId(),listAccessory); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//工具
|
|
|
|
|
|
|
|
List<String> listOperationtool =zyProductProcessService.findAllOperationtool(processId); |
|
|
|
|
|
|
|
if(listOperationtool!=null&&listOperationtool.size()>0) |
|
|
|
|
|
|
|
for (String s1 : listOperationtool) { |
|
|
|
|
|
|
|
productOperationtoolService.deteleTool(Zp.getProductId(),s1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//设备
|
|
|
|
|
|
|
|
List<String> listMachine =zyProductProcessService.findAllMachine(processId); |
|
|
|
|
|
|
|
if(listMachine!=null&&listMachine.size()>0) |
|
|
|
|
|
|
|
for (String s1 : listMachine) { |
|
|
|
|
|
|
|
productMachineService.deleteMachine(Zp.getProductId(),s1); |
|
|
|
|
|
|
|
} |
|
|
|
zyProductProcessService.removeById(id); |
|
|
|
zyProductProcessService.removeById(id); |
|
|
|
return Result.OK("删除成功!"); |
|
|
|
return Result.OK("删除成功!"); |
|
|
|
} |
|
|
|
} |
|
|
|