|
|
|
@ -0,0 +1,109 @@
|
|
|
|
|
package com.op.mes.controller;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PutMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
import com.op.common.log.annotation.Log;
|
|
|
|
|
import com.op.common.log.enums.BusinessType;
|
|
|
|
|
import com.op.common.security.annotation.RequiresPermissions;
|
|
|
|
|
import com.op.mes.domain.ProOrderWorkorder;
|
|
|
|
|
import com.op.mes.service.IProOrderWorkorderService;
|
|
|
|
|
import com.op.common.core.web.controller.BaseController;
|
|
|
|
|
import com.op.common.core.web.domain.AjaxResult;
|
|
|
|
|
import com.op.common.core.utils.poi.ExcelUtil;
|
|
|
|
|
import com.op.common.core.web.page.TableDataInfo;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生产工单Controller
|
|
|
|
|
*
|
|
|
|
|
* @author Open Platform
|
|
|
|
|
* @date 2023-07-26
|
|
|
|
|
*/
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/pro/workorder")
|
|
|
|
|
public class ProOrderWorkorderController extends BaseController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private IProOrderWorkorderService proOrderWorkorderService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询生产工单列表
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("mes:proworkorder:list")
|
|
|
|
|
@GetMapping("/list")
|
|
|
|
|
public TableDataInfo list(ProOrderWorkorder proOrderWorkorder) {
|
|
|
|
|
startPage();
|
|
|
|
|
List<ProOrderWorkorder> list = proOrderWorkorderService.selectProOrderWorkorderList(proOrderWorkorder);
|
|
|
|
|
return getDataTable(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 导出生产工单列表
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("mes:proworkorder:export")
|
|
|
|
|
@Log(title = "生产工单", businessType = BusinessType.EXPORT)
|
|
|
|
|
@PostMapping("/export")
|
|
|
|
|
public void export(HttpServletResponse response, ProOrderWorkorder proOrderWorkorder) {
|
|
|
|
|
List<ProOrderWorkorder> list = proOrderWorkorderService.selectProOrderWorkorderList(proOrderWorkorder);
|
|
|
|
|
ExcelUtil<ProOrderWorkorder> util = new ExcelUtil<ProOrderWorkorder>(ProOrderWorkorder.class);
|
|
|
|
|
util.exportExcel(response, list, "生产工单数据");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取生产工单详细信息
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("mes:proworkorder:query")
|
|
|
|
|
@GetMapping(value = "/{workorderId}")
|
|
|
|
|
public AjaxResult getInfo(@PathVariable("workorderId") String workorderId) {
|
|
|
|
|
return success(proOrderWorkorderService.selectProOrderWorkorderByWorkorderId(workorderId));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 新增生产工单
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("mes:proworkorder:add")
|
|
|
|
|
@Log(title = "生产工单", businessType = BusinessType.INSERT)
|
|
|
|
|
@PostMapping
|
|
|
|
|
public AjaxResult add(@RequestBody ProOrderWorkorder proOrderWorkorder) {
|
|
|
|
|
return toAjax(proOrderWorkorderService.insertProOrderWorkorder(proOrderWorkorder));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改生产工单
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("mes:proworkorder:edit")
|
|
|
|
|
@Log(title = "生产工单", businessType = BusinessType.UPDATE)
|
|
|
|
|
@PutMapping
|
|
|
|
|
public AjaxResult edit(@RequestBody ProOrderWorkorder proOrderWorkorder) {
|
|
|
|
|
return toAjax(proOrderWorkorderService.updateProOrderWorkorder(proOrderWorkorder));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 删除生产工单
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("mes:proworkorder:remove")
|
|
|
|
|
@Log(title = "生产工单", businessType = BusinessType.DELETE)
|
|
|
|
|
@DeleteMapping("/{workorderIds}")
|
|
|
|
|
public AjaxResult remove(@PathVariable String[] workorderIds) {
|
|
|
|
|
//什么时候可以删除工单?TODO;没进入生产之前都可以?
|
|
|
|
|
|
|
|
|
|
return toAjax(proOrderWorkorderService.deleteProOrderWorkorderByWorkorderIds(workorderIds));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 下发生产工单
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("mes:proworkorder:edit")
|
|
|
|
|
@Log(title = "下发生产工单", businessType = BusinessType.OTHER)
|
|
|
|
|
@PostMapping("/downWorkorder/{workorderIds}")
|
|
|
|
|
public AjaxResult downWorkorder(@PathVariable String[] workorderIds) {
|
|
|
|
|
return toAjax(proOrderWorkorderService.downProOrderWorkorderByWorkorderIds(workorderIds));
|
|
|
|
|
}
|
|
|
|
|
}
|