工单变更

highway
zhaoxiaolin 1 year ago
parent fb0a2ab614
commit a5d3d5727d

@ -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));
}
}
Loading…
Cancel
Save