工作站绑定工序
This commit is contained in:
parent
1f428ebcde
commit
f84970a5c2
@ -4,6 +4,10 @@ import java.util.List;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import com.ktg.common.constant.UserConstants;
|
import com.ktg.common.constant.UserConstants;
|
||||||
|
import com.ktg.mes.md.domain.MdWorkshop;
|
||||||
|
import com.ktg.mes.md.service.IMdWorkshopService;
|
||||||
|
import com.ktg.mes.pro.domain.ProProcess;
|
||||||
|
import com.ktg.mes.pro.service.IProProcessService;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@ -36,6 +40,12 @@ public class MdWorkstationController extends BaseController
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IMdWorkstationService mdWorkstationService;
|
private IMdWorkstationService mdWorkstationService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IProProcessService proProcessService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMdWorkshopService mdWorkshopService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询工作站列表
|
* 查询工作站列表
|
||||||
*/
|
*/
|
||||||
@ -85,6 +95,13 @@ public class MdWorkstationController extends BaseController
|
|||||||
if(UserConstants.NOT_UNIQUE.equals(mdWorkstationService.checkWorkStationNameUnique(mdWorkstation))){
|
if(UserConstants.NOT_UNIQUE.equals(mdWorkstationService.checkWorkStationNameUnique(mdWorkstation))){
|
||||||
return AjaxResult.error("工作站名称已存在!");
|
return AjaxResult.error("工作站名称已存在!");
|
||||||
}
|
}
|
||||||
|
ProProcess process = proProcessService.selectProProcessByProcessId(mdWorkstation.getProcessId());
|
||||||
|
mdWorkstation.setProcessCode(process.getProcessCode());
|
||||||
|
mdWorkstation.setProcessName(process.getProcessName());
|
||||||
|
|
||||||
|
MdWorkshop workshop = mdWorkshopService.selectMdWorkshopByWorkshopId(mdWorkstation.getWorkshopId());
|
||||||
|
mdWorkstation.setWorkshopCode(workshop.getWorkshopCode());
|
||||||
|
mdWorkstation.setWorkshopName(workshop.getWorkshopName());
|
||||||
return toAjax(mdWorkstationService.insertMdWorkstation(mdWorkstation));
|
return toAjax(mdWorkstationService.insertMdWorkstation(mdWorkstation));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,6 +119,13 @@ public class MdWorkstationController extends BaseController
|
|||||||
if(UserConstants.NOT_UNIQUE.equals(mdWorkstationService.checkWorkStationNameUnique(mdWorkstation))){
|
if(UserConstants.NOT_UNIQUE.equals(mdWorkstationService.checkWorkStationNameUnique(mdWorkstation))){
|
||||||
return AjaxResult.error("工作站名称已存在!");
|
return AjaxResult.error("工作站名称已存在!");
|
||||||
}
|
}
|
||||||
|
ProProcess process = proProcessService.selectProProcessByProcessId(mdWorkstation.getProcessId());
|
||||||
|
mdWorkstation.setProcessCode(process.getProcessCode());
|
||||||
|
mdWorkstation.setProcessName(process.getProcessName());
|
||||||
|
|
||||||
|
MdWorkshop workshop = mdWorkshopService.selectMdWorkshopByWorkshopId(mdWorkstation.getWorkshopId());
|
||||||
|
mdWorkstation.setWorkshopCode(workshop.getWorkshopCode());
|
||||||
|
mdWorkstation.setWorkshopName(workshop.getWorkshopName());
|
||||||
return toAjax(mdWorkstationService.updateMdWorkstation(mdWorkstation));
|
return toAjax(mdWorkstationService.updateMdWorkstation(mdWorkstation));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ import com.ktg.common.core.page.TableDataInfo;
|
|||||||
* @date 2022-05-11
|
* @date 2022-05-11
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/pro/process")
|
@RequestMapping("/mes/pro/process")
|
||||||
public class ProProcessController extends BaseController
|
public class ProProcessController extends BaseController
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -40,7 +40,7 @@ public class ProProcessController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 查询生产工序列表
|
* 查询生产工序列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('pro:process:list')")
|
@PreAuthorize("@ss.hasPermi('mes:pro:process:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(ProProcess proProcess)
|
public TableDataInfo list(ProProcess proProcess)
|
||||||
{
|
{
|
||||||
@ -53,7 +53,7 @@ public class ProProcessController extends BaseController
|
|||||||
* 查询所有可用工序的清单
|
* 查询所有可用工序的清单
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('pro:process:list')")
|
@PreAuthorize("@ss.hasPermi('mes:pro:process:list')")
|
||||||
@GetMapping("/listAll")
|
@GetMapping("/listAll")
|
||||||
public AjaxResult listAll(){
|
public AjaxResult listAll(){
|
||||||
ProProcess process = new ProProcess();
|
ProProcess process = new ProProcess();
|
||||||
@ -65,7 +65,7 @@ public class ProProcessController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 导出生产工序列表
|
* 导出生产工序列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('pro:process:export')")
|
@PreAuthorize("@ss.hasPermi('mes:pro:process:export')")
|
||||||
@Log(title = "生产工序", businessType = BusinessType.EXPORT)
|
@Log(title = "生产工序", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, ProProcess proProcess)
|
public void export(HttpServletResponse response, ProProcess proProcess)
|
||||||
@ -78,7 +78,7 @@ public class ProProcessController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 获取生产工序详细信息
|
* 获取生产工序详细信息
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('pro:process:query')")
|
@PreAuthorize("@ss.hasPermi('mes:pro:process:query')")
|
||||||
@GetMapping(value = "/{processId}")
|
@GetMapping(value = "/{processId}")
|
||||||
public AjaxResult getInfo(@PathVariable("processId") Long processId)
|
public AjaxResult getInfo(@PathVariable("processId") Long processId)
|
||||||
{
|
{
|
||||||
@ -88,7 +88,7 @@ public class ProProcessController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 新增生产工序
|
* 新增生产工序
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('pro:process:add')")
|
@PreAuthorize("@ss.hasPermi('mes:pro:process:add')")
|
||||||
@Log(title = "生产工序", businessType = BusinessType.INSERT)
|
@Log(title = "生产工序", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody ProProcess proProcess)
|
public AjaxResult add(@RequestBody ProProcess proProcess)
|
||||||
@ -105,7 +105,7 @@ public class ProProcessController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 修改生产工序
|
* 修改生产工序
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('pro:process:edit')")
|
@PreAuthorize("@ss.hasPermi('mes:pro:process:edit')")
|
||||||
@Log(title = "生产工序", businessType = BusinessType.UPDATE)
|
@Log(title = "生产工序", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody ProProcess proProcess)
|
public AjaxResult edit(@RequestBody ProProcess proProcess)
|
||||||
@ -122,7 +122,7 @@ public class ProProcessController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 删除生产工序
|
* 删除生产工序
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('pro:process:remove')")
|
@PreAuthorize("@ss.hasPermi('mes:pro:process:remove')")
|
||||||
@Log(title = "生产工序", businessType = BusinessType.DELETE)
|
@Log(title = "生产工序", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{processIds}")
|
@DeleteMapping("/{processIds}")
|
||||||
public AjaxResult remove(@PathVariable Long[] processIds)
|
public AjaxResult remove(@PathVariable Long[] processIds)
|
||||||
|
Loading…
Reference in New Issue
Block a user