/*
|
* Copyright (c) 2018-2025, ztt All rights reserved.
|
*
|
* Redistribution and use in source and binary forms, with or without
|
* modification, are permitted provided that the following conditions are met:
|
*
|
* Redistributions of source code must retain the above copyright notice,
|
* this list of conditions and the following disclaimer.
|
* Redistributions in binary form must reproduce the above copyright
|
* notice, this list of conditions and the following disclaimer in the
|
* documentation and/or other materials provided with the distribution.
|
* Neither the name of the pig4cloud.com developer nor the names of its
|
* contributors may be used to endorse or promote products derived from
|
* this software without specific prior written permission.
|
* Author: ztt
|
*/
|
|
package com.chinaztt.mes.production.controller;
|
|
import com.alibaba.excel.EasyExcel;
|
import com.alibaba.excel.ExcelWriter;
|
import com.alibaba.excel.write.metadata.WriteSheet;
|
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.chinaztt.mes.common.wrapper.QueryWrapperUtil;
|
import com.chinaztt.mes.production.config.ProductOutputSubmitConfig;
|
import com.chinaztt.mes.production.dto.*;
|
import com.chinaztt.mes.production.entity.ProductInput;
|
import com.chinaztt.mes.production.entity.ProductMain;
|
import com.chinaztt.mes.production.entity.ProductOutput;
|
import com.chinaztt.mes.production.excel.ProductOutPutData;
|
import com.chinaztt.mes.production.service.ProductMainService;
|
import com.chinaztt.mes.warehouse.dto.StockDTO;
|
import com.chinaztt.ztt.common.core.util.R;
|
import com.chinaztt.ztt.common.log.annotation.SysLog;
|
import com.chinaztt.ztt.common.security.annotation.Inner;
|
import com.chinaztt.ztt.common.sequence.sequence.Sequence;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.AllArgsConstructor;
|
import org.apache.commons.lang3.StringUtils;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.servlet.http.HttpServletResponse;
|
import java.io.IOException;
|
import java.net.URLEncoder;
|
import java.time.LocalDateTime;
|
import java.time.format.DateTimeFormatter;
|
import java.util.List;
|
|
|
/**
|
* 报工主表
|
*
|
* @author cxf
|
* @date 2020-11-17 10:12:27
|
*/
|
@RestController
|
@AllArgsConstructor
|
@RequestMapping("/product")
|
@Api(value = "product", tags = "报工主表管理")
|
public class ProductMainController {
|
|
private final ProductMainService productMainService;
|
|
private final ProductOutputSubmitConfig productOutputSubmitConfig;
|
|
private Sequence sequence;
|
|
/**
|
* 根据工单id和工作站id获取报工主表
|
*
|
* @param productMain productMain
|
* @return R
|
*/
|
@ApiOperation(value = "根据工单id和工作站id获取报工主表", notes = "根据工单id和工作站id获取报工主表")
|
@GetMapping("/getProductMain")
|
public R getProductMain(ProductMain productMain) {
|
return R.ok(productMainService.list(Wrappers.query(productMain).orderByDesc("create_time")));
|
}
|
|
/**
|
* 获取报工单列表
|
*
|
* @param productMain
|
* @return
|
*/
|
@ApiOperation(value = "获取报工单列表", notes = "获取报工单列表")
|
@GetMapping("/getProductMainV1")
|
public R getProductMainV1(Page page, ProductMainListDTO productMain) {
|
return R.ok(productMainService.getList(page,QueryWrapperUtil.gen(productMain)));
|
}
|
|
/**
|
* 工作站id获取报工产出
|
*
|
* @param productOutputDTO productOutputDTO
|
* @return R
|
*/
|
@Inner(false)
|
@ApiOperation(value = "工作站id获取报工产出", notes = "工作站id获取报工产出")
|
@GetMapping("/getProductOut")
|
public R getProductOut(Page page, ProductOutputDTO productOutputDTO) {
|
Long id = productOutputDTO.getWorkstationId();
|
productOutputDTO.setWorkstationId(null);
|
return R.ok(productMainService.getProductOut(page, QueryWrapperUtil.gen(productOutputDTO), id));
|
}
|
|
/**
|
* 根据工单id获取绑定的工序的工步
|
*
|
* @param id
|
* @return R
|
*/
|
@ApiOperation(value = "根据工单id获取绑定的工序的工步", notes = "根据工单id获取绑定的工序的工步")
|
@GetMapping("/getStep/{id}")
|
public R getStep(@PathVariable Long id) {
|
return R.ok(productMainService.getStep(id));
|
}
|
|
/**
|
* 根据工单id获取已经绑定的工步
|
*
|
* @param id
|
* @return R
|
*/
|
@ApiOperation(value = "根据工单id获取已经绑定的工步", notes = "根据工单id获取已经绑定的工步")
|
@GetMapping("/getProductStep/{id}")
|
public R getProductStep(@PathVariable Long id) {
|
return R.ok(productMainService.getProductStep(id));
|
}
|
|
|
/**
|
* 根据工单id和sn号获取已经绑定的工步
|
*
|
* @param id
|
* @return R
|
*/
|
@ApiOperation(value = "根据工单id和sn号获取已经绑定的工步", notes = "根据工单id和sn号获取已经绑定的工步")
|
@GetMapping("/getProductStepBySn")
|
public R getProductStepBySn(@RequestParam("id")Long id,@RequestParam("sn")String sn) {
|
return R.ok(productMainService.getProductStepBySn(id,sn));
|
}
|
|
/**
|
* 根据工步记录id,查询出工步记录的所有信息
|
*
|
* @param id
|
* @return R
|
*/
|
@ApiOperation(value = "根据工步记录id,查询出工步记录的所有信息", notes = "根据工步记录id,查询出工步记录的所有信息")
|
@GetMapping("/getAllProductStep/{id}")
|
public R getAllProductStep(@PathVariable Long id) {
|
return R.ok(productMainService.getAllProductStep(id));
|
}
|
|
/**
|
* 根据报工主表id获取投入产出明细
|
*
|
* @param id id
|
* @return R
|
*/
|
@ApiOperation(value = "根据报工主表id获取投入产出明细", notes = "根据报工主表id获取投入产出明细")
|
@GetMapping("/getProductMain/{id}")
|
public R getProductMainById(@PathVariable Long id) {
|
return R.ok(productMainService.getProductMainById(id));
|
}
|
|
/**
|
* 根据产出id获取产出明细
|
*
|
* @param id id
|
* @return R
|
*/
|
@ApiOperation(value = "根据产出id获取产出明细", notes = "根据产出id获取产出明细")
|
@GetMapping("/getProductMain/productOutPut/{id}")
|
public R getProductOutPutById(@PathVariable Long id) {
|
return R.ok(productMainService.getProductOutPutById(id));
|
}
|
|
/**
|
* 分页查询
|
*
|
* @param page 分页对象
|
* @param productMain 报工主表
|
* @return
|
*/
|
@ApiOperation(value = "分页查询", notes = "分页查询")
|
@GetMapping("/page")
|
public R getProductMainPage(Page page, ProductMain productMain) {
|
return R.ok(productMainService.page(page, Wrappers.query(productMain)));
|
}
|
|
/**
|
* 根据id取消报工
|
*
|
* @param id id
|
* @return R
|
*/
|
@ApiOperation(value = "根据id取消报工", notes = "根据id取消报工")
|
@DeleteMapping("/cancelProductMainById/{id}")
|
public R cancelProductMainById(@PathVariable Long id) {
|
return R.ok(productMainService.cancelProductMainById(id));
|
}
|
|
/**
|
* 批量取消报工
|
*
|
* @param ids ids
|
* @return R
|
*/
|
@ApiOperation(value = "批量取消报工", notes = "批量取消报工")
|
@DeleteMapping("/batchCancelProductMain")
|
public R batchCancelProductMain(@RequestBody List<Long> ids) {
|
return R.ok(productMainService.batchCancelProductMain(ids));
|
}
|
|
/**
|
* 新增产出
|
*
|
* @param productMainDTO 报工产出
|
* @return R
|
*/
|
@ApiOperation(value = "新增产出", notes = "新增产出")
|
@PostMapping("/saveProductOutput")
|
public R saveProductOutput(@RequestBody ProductMainDTO productMainDTO) {
|
return R.ok(productMainService.saveProductOutput(productMainDTO));
|
}
|
|
|
/**
|
* 批量新增产出 用于拉丝 复绕等工序产出 一对多 这种报工产出的填写
|
*
|
* @param productMainDTO 批量产出
|
* @return R
|
*/
|
@ApiOperation(value = "批量新增产出", notes = "批量新增产出")
|
@PostMapping("/batchSaveProductOutput")
|
public R batchSaveProductOutput(@RequestBody ProductMainDTO productMainDTO) {
|
return R.ok(productMainService.batchSaveProductOutput(productMainDTO));
|
}
|
|
/**
|
* 批量报工
|
*
|
* @param productMainDTO
|
* @return
|
*/
|
@ApiOperation(value = "批量报工", notes = "批量报工")
|
@PostMapping("/batchSaveProductMain")
|
public R batchSaveProductMain(@RequestBody List<ProductMainDTO> productMainDTOList) {
|
return R.ok(productMainService.batchSaveProductMain(productMainDTOList));
|
}
|
|
/**
|
* 报工校验投料是否充足
|
* @param productMainDTOList
|
* @return
|
*/
|
@ApiOperation(value = "检验投料是否充足", notes = "检验投料是否充足")
|
@PostMapping("/validateOverFeed")
|
public R validateOverFeed(@RequestBody List<ProductMainDTO> productMainDTOList) {
|
return productMainService.validateOverFeed(productMainDTOList);
|
}
|
|
@ApiOperation(value = "校验报工产量是否超出工单计划数量", notes = "校验报工产量是否超过工单计划数量")
|
@PostMapping("/validateOverProduction")
|
public R validateOverProduction(@RequestBody List<ProductMainDTO> productMainDTOList) {
|
return productMainService.validateOverProduction(productMainDTOList);
|
}
|
|
@ApiOperation(value = "校验提交密码", notes = "校验提交密码")
|
@PostMapping("/checkSubmitPassword")
|
public R checkSubmitPassword(String password) {
|
return R.ok(StringUtils.equals(productOutputSubmitConfig.getSubmitPassword(), password));
|
}
|
|
|
@ApiOperation(value = "校验零件是否为原材料", notes = "校验零件是否为原材料")
|
@PostMapping("/checkRawPart")
|
public R checkRawPart(@RequestBody List<String> partNoList) {
|
return productMainService.checkRawPart(partNoList);
|
}
|
/**
|
* 批量更新报工
|
*
|
* @param productMainDTOList
|
* @return
|
*/
|
@ApiOperation(value = "批量更新报工", notes = "批量更新报工")
|
@PutMapping("/batchUpdateProductMain")
|
public R batchUpdateProductMain(@RequestBody List<ProductMainDTO> productMainDTOList) {
|
return R.ok(productMainService.batchUpdateProductMain(productMainDTOList));
|
}
|
|
/**
|
* 新增或修改工步信息
|
*
|
* @param productStepDTO 工步
|
* @param productStepDTO 工步
|
* @return R
|
*/
|
@ApiOperation(value = "新增或修改工步信息", notes = "新增或修改工步信息")
|
@PostMapping("/addOrUpdateStep")
|
public R addOrUpdateStep(@RequestBody ProductStepDTO productStepDTO) {
|
return R.ok(productMainService.addOrUpdateStep(productStepDTO));
|
}
|
|
/**
|
* @param id
|
* @param event
|
* @return
|
*/
|
@ApiOperation(value = "更改状态", notes = "更改状态")
|
@SysLog("更改状态")
|
@PostMapping("/state/{id}/{event}")
|
public R changeState(@PathVariable Long id, @PathVariable String event) {
|
return productMainService.changeState(id, event);
|
}
|
|
@ApiOperation(value = "更新报工单状态为处理中", notes = "更新报工单状态为处理中")
|
@PostMapping("/state/process")
|
public R process(@RequestBody List<Long> ids) {
|
return productMainService.process(ids);
|
}
|
|
/**
|
* 批量更改报工单状态
|
*
|
* @param ids
|
* @param event
|
* @return
|
*/
|
@ApiOperation(value = "批量更改报工单状态", notes = "批量更改报工单状态")
|
@SysLog("批量更改报工单状态")
|
@PostMapping("/state/batchChange/{event}")
|
public R batchChange(@RequestBody List<Long> ids, @PathVariable String event) {
|
return R.ok(this.productMainService.batchChange(ids, event));
|
}
|
|
/**
|
* 更新产出
|
*
|
* @param productMainDTO 报工产出
|
* @return R
|
*/
|
@ApiOperation(value = "更新产出", notes = "更新产出")
|
@PostMapping("/updateProductOutput")
|
public R updateProductOutput(@RequestBody ProductMainDTO productMainDTO) {
|
return R.ok(productMainService.updateProductOutput(productMainDTO));
|
}
|
|
/**
|
* 根据产出id删除产出
|
*
|
* @param id id
|
* @return R
|
*/
|
@ApiOperation(value = "根据产出id删除产出", notes = "根据产出id删除产出")
|
@DeleteMapping("/deleteProductOutputById/{id}")
|
public R deleteProductOutputById(@PathVariable Long id) {
|
return R.ok(productMainService.deleteProductOutputById(id));
|
}
|
|
/**
|
* 根据产出ids删除产出
|
*
|
* @param ids id
|
* @return R
|
*/
|
@ApiOperation(value = "批量删除产出", notes = "批量删除删除产出")
|
@PostMapping("/deleteProductOutputByIds")
|
public R deleteProductOutputByIds(@RequestBody List<Long> ids) {
|
return R.ok(productMainService.deleteProductOutputByIds(ids));
|
}
|
|
|
/**
|
* 查询交班产出
|
*
|
* @param workstationId 工作站id
|
* @param opeartionTaskId 工单id
|
* @return
|
*/
|
@ApiOperation(value = "查询交班产出", notes = "查询交班产出")
|
@GetMapping("/getShiftProductOutByOpIdAndWsId/{workstationId}/{opeartionTaskId}")
|
public R getShiftProductOutByOpIdAndWsId(@PathVariable Long workstationId, @PathVariable Long opeartionTaskId) {
|
return R.ok(productMainService.getShiftedProductByWidAndOpId(workstationId, opeartionTaskId));
|
}
|
|
/**
|
* 新增投入
|
*
|
* @param productInputDTO 报工投入
|
* @return R
|
*/
|
@ApiOperation(value = "新增投入", notes = "新增投入")
|
@PostMapping("/saveProductInput")
|
public R saveProductInput(@RequestBody ProductInputDTO productInputDTO) {
|
return R.ok(productMainService.saveProductInput(productInputDTO));
|
}
|
|
/**
|
* 更新投入
|
*
|
* @param productInput 报工投入
|
* @return R
|
*/
|
@ApiOperation(value = "更新投入", notes = "更新投入")
|
@PostMapping("/updateProductInput")
|
public R updateProductInput(@RequestBody ProductInput productInput) {
|
return R.ok(productMainService.updateProductInput(productInput));
|
}
|
|
/**
|
* 根据投入id删除投入
|
*
|
* @param id id
|
* @return R
|
*/
|
@ApiOperation(value = "根据投入id删除投入", notes = "根据投入id删除投入")
|
@DeleteMapping("/deleteProductInputById/{id}")
|
public R deleteProductInputById(@PathVariable Long id) {
|
return R.ok(productMainService.deleteProductInputById(id));
|
}
|
|
/**
|
* 根据工步记录id,删除工步记录的所有信息
|
*
|
* @param id id
|
* @return R
|
*/
|
@ApiOperation(value = "根据工步记录id,删除工步记录的所有信息", notes = "根据工步记录id,删除工步记录的所有信息")
|
@DeleteMapping("/deleteProductStep/{id}")
|
public R deleteProductStep(@PathVariable Long id) {
|
return R.ok(productMainService.deleteProductStep(id));
|
}
|
|
/**
|
* 分页查询生产进度
|
*
|
* @param page 分页
|
* @param productOutputDTO 生产进度
|
* @return
|
*/
|
@ApiOperation(value = "分页查询", notes = "分页查询")
|
@GetMapping("/getProductionProgress/page")
|
public R getProductionProgress(Page page, ProductOutputDTO productOutputDTO) {
|
return R.ok(productMainService.getProductionProgress(page, QueryWrapperUtil.gen(productOutputDTO)));
|
}
|
|
/**
|
* 分页查询汇报产出
|
*
|
* @param page 分页
|
* @param productOutputDTO 汇报产出
|
* @return
|
*/
|
@ApiOperation(value = "分页查询", notes = "分页查询")
|
@GetMapping("/getOutputList")
|
public R getOutputList(Page page, ProductOutputDTO productOutputDTO) {
|
return R.ok(productMainService.getOutputList(page, QueryWrapperUtil.gen(productOutputDTO), productOutputDTO));
|
}
|
|
/**
|
* 扫码产出列表
|
*
|
* @param productOutputDTO 扫码产出列表
|
* @return
|
*/
|
@ApiOperation(value = "扫码产出列表", notes = "扫码产出列表")
|
@GetMapping("/getOutputListByScan")
|
public R getOutputListByScan(ProductOutputDTO productOutputDTO) {
|
return R.ok(productMainService.getOutputListByScan(productOutputDTO));
|
}
|
|
/**
|
* @param productMain
|
* @return
|
*/
|
@GetMapping("/productMain")
|
@Inner(value = false)
|
public R loadProductMain(ProductMain productMain) {
|
return R.ok(productMainService.list(Wrappers.query(productMain)));
|
}
|
|
/**
|
* @param ids
|
* @param event
|
* @return
|
*/
|
@ApiOperation(value = "更改报工产出状态", notes = "更改报工产出状态")
|
@SysLog("更改报工产出状态")
|
@PostMapping("/productOutPutState/{event}")
|
public R changeProductOutPutState(@RequestBody List<Long> ids, @PathVariable String event) {
|
return productMainService.changeProductOutPutState(ids, event);
|
}
|
|
/**
|
* 根据报工单id交班或取消
|
*
|
* @param id
|
* @param event
|
* @return
|
*/
|
@ApiOperation(value = "根据报工单id交班或取消", notes = "根据报工单id交班或取消")
|
@SysLog("根据报工单id交班或取消")
|
@PostMapping("/productOutPutStateByMainId/{id}/{event}")
|
public R changeProductOutPutStateByMainId(@PathVariable Long id, @PathVariable String event) {
|
return productMainService.changeProductOutPutStateByMainId(id, event);
|
}
|
|
/**
|
* 获取打印url
|
*
|
* @param type 1 装备 2射频 3装备射频sn打印 4射频小页签打印
|
* @param id
|
* @return
|
*/
|
@ApiOperation(value = "获取打印url", notes = "获取打印url")
|
@GetMapping("/getPrintUrl")
|
public R getPrintUrl(Integer type, Long id, String sn) {
|
return R.ok(productMainService.getPrintUrl(type, id, sn));
|
}
|
|
/**
|
* 根据报工id获取已经绑定的工步
|
*
|
* @param productStepDTO
|
* @return R
|
*/
|
@ApiOperation(value = "根据报工id获取已经绑定的工步", notes = "根据报工id获取已经绑定的工步")
|
@GetMapping("/getProductStep")
|
public R getProductStep(Page page, ProductStepDTO productStepDTO) {
|
productStepDTO.setStaffId(null);
|
return R.ok(productMainService.getProductStep(page, QueryWrapperUtil.gen(productStepDTO)));
|
}
|
|
/**
|
* 判断投料是否足够
|
*
|
* @param productStepDTO 工步
|
* @return R
|
*/
|
@ApiOperation(value = "判断投料是否足够", notes = "判断投料是否足够")
|
@PostMapping("/autoAddInput")
|
public R judgeAddInput(@RequestBody ProductStepDTO productStepDTO) {
|
return R.ok(productMainService.judgeAddInput(productStepDTO));
|
}
|
|
/**
|
* 根据工单id获取生成的SN号
|
*
|
* @param operationTaskId
|
* @return
|
*/
|
@ApiOperation(value = "根据工单id获取生成的SN号", notes = "根据工单id获取生成的SN号")
|
@GetMapping("/getGenerateSN")
|
public R getGenerateSN(Long operationTaskId) {
|
return R.ok(productMainService.getGenerateSN(operationTaskId));
|
}
|
|
|
/**
|
* 根据客户订单号查询段产搞的productSns
|
*
|
* @param customerOrderNo
|
* @return
|
*/
|
@ApiOperation(value = "根据客户订单号查询段产搞的productSns", notes = "根据客户订单号查询段产搞的productSns")
|
@GetMapping("/getGenerateSnByCustomerOrderNo")
|
public R getGenerateSnByCustomerOrderNo(String customerOrderNo) {
|
return R.ok(productMainService.getGenerateSnByCustomerOrderNo(customerOrderNo));
|
}
|
|
/**
|
* 导出
|
*
|
* @param operationTaskId 上班记录-人工明细
|
* @return
|
*/
|
@ApiOperation(value = "导出", notes = "导出")
|
@Inner(false)
|
@PostMapping("/exportProductOutPut")
|
public void exportProductOutPut(HttpServletResponse response, Long operationTaskId, Long workstationId) throws IOException {
|
response.setContentType("application/vnd.ms-excel");
|
response.setCharacterEncoding("UTF-8");
|
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
|
String fileName = URLEncoder.encode("报工产出", "UTF-8");
|
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xls");
|
try {
|
//新建ExcelWriter
|
ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).build();
|
//获取sheet0对象
|
WriteSheet mainSheet = EasyExcel.writerSheet(0, "报工产出").head(ProductOutPutData.class).build();
|
//向sheet0写入数据 传入空list这样只导出表头
|
excelWriter.write(productMainService.exportList(operationTaskId, workstationId), mainSheet);
|
//关闭流
|
excelWriter.finish();
|
} catch (IOException e) {
|
throw new RuntimeException("导出失败");
|
}
|
}
|
|
@ApiOperation(value = "根据工单查找SN号", notes = "根据工单查找SN号")
|
@GetMapping("/getSNByTaskId")
|
public R getSNByTaskId(Long taskId){
|
String SN = productMainService.getSNByTaskId(taskId);
|
if (StringUtils.isNotBlank(SN)) {
|
long count = productMainService.getOutputByBatchNo(SN);
|
if (count > 0) {
|
return R.failed(SN + "已有产出,无法再次产出");
|
} else {
|
return R.ok(SN);
|
}
|
} else {
|
return R.ok();
|
}
|
}
|
|
@ApiOperation(value = "多次批量标签打印", notes = "多次批量标签打印")
|
@GetMapping("/batchLabelPrintTimes")
|
public R batchLabelPrintTimes(@RequestParam("ids") List<Long> ids) {
|
return R.ok(productMainService.batchLabelPrintTimes(ids));
|
}
|
|
@ApiOperation(value = "批量标签打印check", notes = "批量标签打印check")
|
@GetMapping("/checkBatchLabelPrint")
|
public R checkBatchLabelPrint(@RequestParam("ids") List<Long> ids,@RequestParam("isSubmit") Boolean isSubmit){
|
return R.ok(productMainService.checkBatchLabelPrint(ids,isSubmit));
|
}
|
|
@ApiOperation(value = "批量标签打印密码校验", notes = "批量标签打印密码校验")
|
@GetMapping("/checkLabelPrintPassword")
|
public R checkLabelPrintPassword(@RequestParam("password")String password,@RequestParam("ids") List<Long> ids,@RequestParam("isSubmit") Boolean isSubmit) {
|
return productMainService.checkLabelPrintPassword(password,ids,isSubmit);
|
}
|
|
@ApiOperation(value = "批量更新打印次数", notes = "批量更新打印次数")
|
@GetMapping("/updatePrintNum")
|
public R updatePrintNum(@RequestParam("ids") List<Long> ids) {
|
return productMainService.updatePrintNum(ids);
|
}
|
|
|
@ApiOperation(value = "批量标签打印", notes = "批量标签打印")
|
@GetMapping("/batchLabelPrint")
|
@Inner(false)
|
public R batchLabelPrint(@RequestParam("ids") List<Long> ids) {
|
return R.ok(productMainService.batchLabelPrint(ids));
|
}
|
|
@ApiOperation(value = "根据销售订单号查找零件", notes = "根据销售订单号查找零件")
|
@GetMapping("/getPartNamesByOrderNo")
|
public R getPartNamesByOrderNo(String customerOrderNo) {
|
return R.ok(productMainService.getPartNamesByOrderNo(customerOrderNo));
|
}
|
|
@ApiOperation(value = "根据销售订单号和零件名称查找成品sn", notes = "根据销售订单号和零件名称查找成品sn")
|
@GetMapping("/getProductSnByCustomerNoAndPartName")
|
public R getProductSnByCustomerNoAndPartName(String customerOrderNo, String partName){
|
return R.ok(productMainService.getProductSnByCustomerNoAndPartName(customerOrderNo, partName));
|
}
|
|
@ApiOperation(value = "校验当前工单是否是最后一道工序工单", notes = "校验当前工单是否是最后一道工序工单")
|
@GetMapping("/validateIsLastOperation/{id}")
|
public R validateIsLastOperation(@PathVariable Long id) {
|
return R.ok(productMainService.validateIsLastOperation(id));
|
}
|
|
@ApiOperation(value = "校验是否是交班后产出", notes = "校验是否是交班后产出")
|
@PostMapping("/validateChangeProductOut")
|
public R validateChangeProductOut(@RequestBody List<ProductOutput> list) {
|
return R.ok(productMainService.validateChangeProductOut(list));
|
}
|
|
|
@ApiOperation(value = "报工单状态重置为草稿", notes = "报工单状态重置为草稿")
|
@PostMapping("/resetState")
|
@PreAuthorize("@pms.hasPermission('product_state_reset')")
|
public R resetState(@RequestBody List<Long> ids) {
|
return R.ok(productMainService.resetState(ids));
|
}
|
|
|
@ApiOperation(value = "获取草稿状态的报工产出", notes = "获取草稿状态的报工产出")
|
@GetMapping("/getDraftProductOut/{id}")
|
public R getDraftProductOut(@PathVariable Long id) {
|
return R.ok(productMainService.getDraftProductOut(id));
|
}
|
|
@ApiOperation(value = "校验工步是否完成", notes = "校验工步是否完成")
|
@GetMapping("/validateStepFinish/{outBatchNo}")
|
public R validateStepFinish(@PathVariable String outBatchNo) {
|
return R.ok(productMainService.validateStepFinish(outBatchNo));
|
}
|
|
@ApiOperation(value = "新增库存新增SN号校重", notes = "新增库存新增SN号校重")
|
@PostMapping("/checkSn")
|
public R checkSn(@RequestBody StockDTO stockDTO) {
|
return R.ok(productMainService.checkSn(stockDTO));
|
}
|
|
}
|