|
|
@ -4,12 +4,17 @@ import java.util.List;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
|
|
import com.hw.common.core.constant.MesConstants;
|
|
|
|
import com.hw.common.core.constant.MesConstants;
|
|
|
|
|
|
|
|
import com.hw.common.core.domain.R;
|
|
|
|
|
|
|
|
import com.hw.common.security.annotation.InnerAuth;
|
|
|
|
|
|
|
|
import com.hw.mes.api.domain.vo.MesPdaProductPlanVo;
|
|
|
|
import com.hw.mes.domain.MesBaseRouteProcess;
|
|
|
|
import com.hw.mes.domain.MesBaseRouteProcess;
|
|
|
|
import com.hw.mes.domain.MesProductOrder;
|
|
|
|
import com.hw.mes.domain.MesProductOrder;
|
|
|
|
|
|
|
|
import com.hw.mes.domain.MesProductPlanDetail;
|
|
|
|
import com.hw.mes.domain.vo.MesProductPlanDeleteVo;
|
|
|
|
import com.hw.mes.domain.vo.MesProductPlanDeleteVo;
|
|
|
|
import com.hw.mes.domain.vo.MesProductPlanEditVo;
|
|
|
|
import com.hw.mes.domain.vo.MesProductPlanEditVo;
|
|
|
|
import com.hw.mes.service.IMesBaseProcessInfoService;
|
|
|
|
import com.hw.mes.service.IMesBaseProcessInfoService;
|
|
|
|
import com.hw.mes.service.IMesBaseRouteProcessService;
|
|
|
|
import com.hw.mes.service.IMesBaseRouteProcessService;
|
|
|
|
|
|
|
|
import com.hw.mes.service.IMesProductPlanDetailService;
|
|
|
|
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;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
@ -37,11 +42,13 @@ import com.hw.common.core.web.page.TableDataInfo;
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RestController
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("/productplan")
|
|
|
|
@RequestMapping("/productplan")
|
|
|
|
public class MesProductPlanController extends BaseController
|
|
|
|
public class MesProductPlanController extends BaseController {
|
|
|
|
{
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private IMesProductPlanService mesProductPlanService;
|
|
|
|
private IMesProductPlanService mesProductPlanService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private IMesProductPlanDetailService mesProductPlanDetailService;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private IMesBaseProcessInfoService mesBaseProcessInfoService;
|
|
|
|
private IMesBaseProcessInfoService mesBaseProcessInfoService;
|
|
|
|
|
|
|
|
|
|
|
@ -53,8 +60,7 @@ public class MesProductPlanController extends BaseController
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RequiresPermissions("mes:productplan:list")
|
|
|
|
@RequiresPermissions("mes:productplan:list")
|
|
|
|
@GetMapping("/list")
|
|
|
|
@GetMapping("/list")
|
|
|
|
public TableDataInfo list(MesProductPlan mesProductPlan)
|
|
|
|
public TableDataInfo list(MesProductPlan mesProductPlan) {
|
|
|
|
{
|
|
|
|
|
|
|
|
startPage();
|
|
|
|
startPage();
|
|
|
|
List<MesProductPlan> list = mesProductPlanService.selectMesProductPlanList(mesProductPlan);
|
|
|
|
List<MesProductPlan> list = mesProductPlanService.selectMesProductPlanList(mesProductPlan);
|
|
|
|
return getDataTable(list);
|
|
|
|
return getDataTable(list);
|
|
|
@ -62,12 +68,12 @@ public class MesProductPlanController extends BaseController
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询生产派工List
|
|
|
|
* 查询生产派工List
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param mesProductPlan
|
|
|
|
* @param mesProductPlan
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping("/selectProductPlans")
|
|
|
|
@GetMapping("/selectProductPlans")
|
|
|
|
public AjaxResult selectProductPlans(MesProductPlan mesProductPlan)
|
|
|
|
public AjaxResult selectProductPlans(MesProductPlan mesProductPlan) {
|
|
|
|
{
|
|
|
|
|
|
|
|
List<MesProductPlan> list = mesProductPlanService.selectMesProductPlanJoinProcessList(mesProductPlan);
|
|
|
|
List<MesProductPlan> list = mesProductPlanService.selectMesProductPlanJoinProcessList(mesProductPlan);
|
|
|
|
return success(list);
|
|
|
|
return success(list);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -78,8 +84,7 @@ public class MesProductPlanController extends BaseController
|
|
|
|
@RequiresPermissions("mes:productplan:export")
|
|
|
|
@RequiresPermissions("mes:productplan:export")
|
|
|
|
@Log(title = "生产派工", businessType = BusinessType.EXPORT)
|
|
|
|
@Log(title = "生产派工", businessType = BusinessType.EXPORT)
|
|
|
|
@PostMapping("/export")
|
|
|
|
@PostMapping("/export")
|
|
|
|
public void export(HttpServletResponse response, MesProductPlan mesProductPlan)
|
|
|
|
public void export(HttpServletResponse response, MesProductPlan mesProductPlan) {
|
|
|
|
{
|
|
|
|
|
|
|
|
List<MesProductPlan> list = mesProductPlanService.selectMesProductPlanList(mesProductPlan);
|
|
|
|
List<MesProductPlan> list = mesProductPlanService.selectMesProductPlanList(mesProductPlan);
|
|
|
|
ExcelUtil<MesProductPlan> util = new ExcelUtil<MesProductPlan>(MesProductPlan.class);
|
|
|
|
ExcelUtil<MesProductPlan> util = new ExcelUtil<MesProductPlan>(MesProductPlan.class);
|
|
|
|
util.exportExcel(response, list, "生产派工数据");
|
|
|
|
util.exportExcel(response, list, "生产派工数据");
|
|
|
@ -90,8 +95,7 @@ public class MesProductPlanController extends BaseController
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RequiresPermissions("mes:productplan:query")
|
|
|
|
@RequiresPermissions("mes:productplan:query")
|
|
|
|
@GetMapping(value = "/{planId}")
|
|
|
|
@GetMapping(value = "/{planId}")
|
|
|
|
public AjaxResult getInfo(@PathVariable("planId") Long planId)
|
|
|
|
public AjaxResult getInfo(@PathVariable("planId") Long planId) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return success(mesProductPlanService.selectMesProductPlanByPlanId(planId));
|
|
|
|
return success(mesProductPlanService.selectMesProductPlanByPlanId(planId));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -101,8 +105,7 @@ public class MesProductPlanController extends BaseController
|
|
|
|
@RequiresPermissions("mes:productplan:add")
|
|
|
|
@RequiresPermissions("mes:productplan:add")
|
|
|
|
@Log(title = "生产派工", businessType = BusinessType.INSERT)
|
|
|
|
@Log(title = "生产派工", businessType = BusinessType.INSERT)
|
|
|
|
@PostMapping
|
|
|
|
@PostMapping
|
|
|
|
public AjaxResult add(@RequestBody MesProductPlan mesProductPlan)
|
|
|
|
public AjaxResult add(@RequestBody MesProductPlan mesProductPlan) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return toAjax(mesProductPlanService.insertMesProductPlan(mesProductPlan));
|
|
|
|
return toAjax(mesProductPlanService.insertMesProductPlan(mesProductPlan));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -112,8 +115,7 @@ public class MesProductPlanController extends BaseController
|
|
|
|
@RequiresPermissions("mes:productplan:edit")
|
|
|
|
@RequiresPermissions("mes:productplan:edit")
|
|
|
|
@Log(title = "生产派工", businessType = BusinessType.UPDATE)
|
|
|
|
@Log(title = "生产派工", businessType = BusinessType.UPDATE)
|
|
|
|
@PutMapping
|
|
|
|
@PutMapping
|
|
|
|
public AjaxResult edit(@RequestBody MesProductPlan mesProductPlan)
|
|
|
|
public AjaxResult edit(@RequestBody MesProductPlan mesProductPlan) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return toAjax(mesProductPlanService.updateMesProductPlan(mesProductPlan));
|
|
|
|
return toAjax(mesProductPlanService.updateMesProductPlan(mesProductPlan));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -123,8 +125,7 @@ public class MesProductPlanController extends BaseController
|
|
|
|
@RequiresPermissions("mes:productplan:remove")
|
|
|
|
@RequiresPermissions("mes:productplan:remove")
|
|
|
|
@Log(title = "生产派工", businessType = BusinessType.DELETE)
|
|
|
|
@Log(title = "生产派工", businessType = BusinessType.DELETE)
|
|
|
|
@DeleteMapping("/{planIds}")
|
|
|
|
@DeleteMapping("/{planIds}")
|
|
|
|
public AjaxResult remove(@PathVariable Long[] planIds)
|
|
|
|
public AjaxResult remove(@PathVariable Long[] planIds) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return toAjax(mesProductPlanService.deleteMesProductPlanByPlanIds(planIds));
|
|
|
|
return toAjax(mesProductPlanService.deleteMesProductPlanByPlanIds(planIds));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -144,8 +145,7 @@ public class MesProductPlanController extends BaseController
|
|
|
|
@RequiresPermissions("mes:productplan:add")
|
|
|
|
@RequiresPermissions("mes:productplan:add")
|
|
|
|
@Log(title = "生产派工", businessType = BusinessType.INSERT)
|
|
|
|
@Log(title = "生产派工", businessType = BusinessType.INSERT)
|
|
|
|
@PostMapping("/orderAddMesProductPlanList")
|
|
|
|
@PostMapping("/orderAddMesProductPlanList")
|
|
|
|
public AjaxResult orderAddMesProductPlanList(@RequestBody MesProductPlanEditVo productPlanEditVo)
|
|
|
|
public AjaxResult orderAddMesProductPlanList(@RequestBody MesProductPlanEditVo productPlanEditVo) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return toAjax(mesProductPlanService.orderAddMesProductPlanList(productPlanEditVo));
|
|
|
|
return toAjax(mesProductPlanService.orderAddMesProductPlanList(productPlanEditVo));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -175,32 +175,31 @@ public class MesProductPlanController extends BaseController
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取生产派工图纸List列表
|
|
|
|
* 获取生产派工图纸List列表
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param dispatchCode
|
|
|
|
* @param dispatchCode
|
|
|
|
* @param processId
|
|
|
|
* @param processId
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping(value = "/drawingList/{dispatchCode}/{processId}")
|
|
|
|
@GetMapping(value = "/drawingList/{dispatchCode}/{processId}")
|
|
|
|
public AjaxResult getDispatchDrawingList(@PathVariable("dispatchCode") String dispatchCode,
|
|
|
|
public AjaxResult getDispatchDrawingList(@PathVariable("dispatchCode") String dispatchCode,
|
|
|
|
@PathVariable("processId") Long processId)
|
|
|
|
@PathVariable("processId") Long processId) {
|
|
|
|
{
|
|
|
|
return success(mesProductPlanService.getDispatchAttachList(dispatchCode, processId, MesConstants.MES_ATTACH_TYPE_DRAWING));
|
|
|
|
return success(mesProductPlanService.getDispatchAttachList(dispatchCode,processId, MesConstants.MES_ATTACH_TYPE_DRAWING));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取生产派工SOP附件List列表
|
|
|
|
* 获取生产派工SOP附件List列表
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param dispatchCode
|
|
|
|
* @param dispatchCode
|
|
|
|
* @param processId
|
|
|
|
* @param processId
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping(value = "/SOPAttachList/{dispatchCode}/{processId}")
|
|
|
|
@GetMapping(value = "/SOPAttachList/{dispatchCode}/{processId}")
|
|
|
|
public AjaxResult getDispatchSOPAttachList(@PathVariable("dispatchCode") String dispatchCode,
|
|
|
|
public AjaxResult getDispatchSOPAttachList(@PathVariable("dispatchCode") String dispatchCode,
|
|
|
|
@PathVariable("processId") Long processId)
|
|
|
|
@PathVariable("processId") Long processId) {
|
|
|
|
{
|
|
|
|
return success(mesProductPlanService.getDispatchAttachList(dispatchCode, processId, MesConstants.MES_ATTACH_TYPE_SOP));
|
|
|
|
return success(mesProductPlanService.getDispatchAttachList(dispatchCode,processId,MesConstants.MES_ATTACH_TYPE_SOP));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 工单撤回
|
|
|
|
* 工单撤回
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -213,35 +212,72 @@ public class MesProductPlanController extends BaseController
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取工序及关联生产人员信息
|
|
|
|
* 获取工序及关联生产人员信息
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param mesBaseRouteProcess
|
|
|
|
* @param mesBaseRouteProcess
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping(value = "/getBaseRouteProcesses")
|
|
|
|
@GetMapping(value = "/getBaseRouteProcesses")
|
|
|
|
public AjaxResult getBaseRouteProcesses(MesBaseRouteProcess mesBaseRouteProcess)
|
|
|
|
public AjaxResult getBaseRouteProcesses(MesBaseRouteProcess mesBaseRouteProcess) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return success(mesBaseRouteProcessService.selectMesBaseRouteProcessJoinList(mesBaseRouteProcess));
|
|
|
|
return success(mesBaseRouteProcessService.selectMesBaseRouteProcessJoinList(mesBaseRouteProcess));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取工艺路线下所有工序及关联生产人员信息
|
|
|
|
* 获取工艺路线下所有工序及关联生产人员信息
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param routeId 工艺路线ID
|
|
|
|
* @param routeId 工艺路线ID
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping(value = "/getProcessUsers/{routeId}")
|
|
|
|
@GetMapping(value = "/getProcessUsers/{routeId}")
|
|
|
|
public AjaxResult getProcessUsers(@PathVariable("routeId") Long routeId)
|
|
|
|
public AjaxResult getProcessUsers(@PathVariable("routeId") Long routeId) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return success(mesBaseProcessInfoService.getProcessUsersByRouteId(routeId));
|
|
|
|
return success(mesBaseProcessInfoService.getProcessUsersByRouteId(routeId));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 根据派工单号删除生产计划
|
|
|
|
* 根据派工单号删除生产计划
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param mesProductPlanDeleteVo 生产计划删除VO对象
|
|
|
|
* @param mesProductPlanDeleteVo 生产计划删除VO对象
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@PostMapping(value = "/deleteProductPlansByDispatchCode")
|
|
|
|
@PostMapping(value = "/deleteProductPlansByDispatchCode")
|
|
|
|
public AjaxResult deleteProductPlansByDispatchCode(@RequestBody MesProductPlanDeleteVo mesProductPlanDeleteVo)
|
|
|
|
public AjaxResult deleteProductPlansByDispatchCode(@RequestBody MesProductPlanDeleteVo mesProductPlanDeleteVo) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return success(mesProductPlanService.deleteProductPlansByDispatchCode(mesProductPlanDeleteVo));
|
|
|
|
return success(mesProductPlanService.deleteProductPlansByDispatchCode(mesProductPlanDeleteVo));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 五楼组装工序开始任务
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Log(title = "生产派工", businessType = BusinessType.START)
|
|
|
|
|
|
|
|
@PostMapping("/start5thFloorInstall")
|
|
|
|
|
|
|
|
@InnerAuth
|
|
|
|
|
|
|
|
public R<?> start5thFloorInstall(@RequestBody MesPdaProductPlanVo mesPdaProductPlanVo) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
MesProductPlanDetail mesProductPlanDetail = new MesProductPlanDetail();
|
|
|
|
|
|
|
|
mesProductPlanDetail.setMaterialBarcode(mesPdaProductPlanVo.getMaterialBarcode());
|
|
|
|
|
|
|
|
mesProductPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail, MesConstants.MES_START_TYPE_FIFTH_FLOOR_INSTALL);
|
|
|
|
|
|
|
|
return R.ok("start successfully");
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
return R.fail(e.getMessage());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 五楼组装工序结束任务
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Log(title = "生产派工", businessType = BusinessType.COMPLETE)
|
|
|
|
|
|
|
|
@PostMapping("/complete5thFloorInstall")
|
|
|
|
|
|
|
|
@InnerAuth
|
|
|
|
|
|
|
|
public R<?> complete5thFloorInstall(@RequestBody MesPdaProductPlanVo mesPdaProductPlanVo) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
MesProductPlanDetail mesProductPlanDetail = new MesProductPlanDetail();
|
|
|
|
|
|
|
|
mesProductPlanDetail.setMaterialBarcode(mesPdaProductPlanVo.getMaterialBarcode());
|
|
|
|
|
|
|
|
mesProductPlanDetailService.completeMesProductPlanDetail(mesProductPlanDetail);
|
|
|
|
|
|
|
|
return R.ok("complete successfully");
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
return R.fail(e.getMessage());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|