生产管理修改

liweidong
李涛 3 weeks ago
parent 90770d318e
commit 231292ffdc
  1. 8
      blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/produce/pojo/vo/PrintParentWoLabelVO.java
  2. 8
      blade-service/blade-desk/src/main/java/org/springblade/desk/produce/controller/ProduceMonitorController.java
  3. 2
      blade-service/blade-desk/src/main/java/org/springblade/desk/produce/service/IWorkOrderService.java
  4. 16
      blade-service/blade-desk/src/main/java/org/springblade/desk/produce/service/impl/WorkOrderServiceImpl.java

@ -16,15 +16,15 @@ import java.util.List;
public class PrintParentWoLabelVO { public class PrintParentWoLabelVO {
@Schema(description = "第一列") @Schema(description = "第一列")
private PrintWoLabelVO plOne; private String plOne;
@Schema(description = "第二列") @Schema(description = "第二列")
private PrintWoLabelVO plTwo; private String plTwo;
@Schema(description = "第三列") @Schema(description = "第三列")
private PrintWoLabelVO plThree; private String plThree;
@Schema(description = "第四列") @Schema(description = "第四列")
private PrintWoLabelVO plFour; private String plFour;
} }

@ -14,9 +14,11 @@ import org.springblade.desk.produce.service.IWorkOrderService;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 生产监控 * 生产监控
*
* @author litao * @author litao
*/ */
@RestController @RestController
@ -41,11 +43,11 @@ public class ProduceMonitorController extends BladeController {
return R.data(workOrderService.getPlanDetail(wpId)); return R.data(workOrderService.getPlanDetail(wpId));
} }
@PostMapping("/printWoLabel") @GetMapping("/printWoLabel")
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
@Operation(summary = "打印标签") @Operation(summary = "打印标签")
public R<List<PrintParentWoLabelVO>> printWoLabel(@RequestParam String woIds, @RequestParam Short quantity) { public Map<String, Object> printWoLabel(String woIds, Short quantity) {
return R.data(workOrderService.printWoLabel(Func.toLongList(woIds), quantity)); return workOrderService.printWoLabel(Func.toLongList(woIds), quantity);
} }
@PostMapping("/generateWorkOrder") @PostMapping("/generateWorkOrder")

@ -147,7 +147,7 @@ public interface IWorkOrderService extends BaseService<WorkOrder> {
* @param woIds 订单id * @param woIds 订单id
* @param quantity 数量 * @param quantity 数量
*/ */
List<PrintParentWoLabelVO> printWoLabel(List<Long> woIds, Short quantity); Map<String, Object> printWoLabel(List<Long> woIds, Short quantity);
/** /**
* <p>方法名: generateWorkOrder </p> * <p>方法名: generateWorkOrder </p>

@ -1212,7 +1212,8 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
} }
@Override @Override
public List<PrintParentWoLabelVO> printWoLabel(List<Long> woIds, Short quantity) { public Map<String, Object> printWoLabel(List<Long> woIds, Short quantity) {
Map<String, Object> data = new HashMap<>(1);
if (CollectionUtils.isEmpty(woIds)) { if (CollectionUtils.isEmpty(woIds)) {
return null; return null;
} }
@ -1224,7 +1225,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
List<Long> list = null; List<Long> list = null;
Integer num = 0; Integer num = 0;
int i = 1; int i = 1;
PrintWoLabelVO printWoLabel; String printWoLabel;
PrintParentWoLabelVO printParentWoLabel = null; PrintParentWoLabelVO printParentWoLabel = null;
WorkOrder workOrder; WorkOrder workOrder;
List<PrintParentWoLabelVO> plList = new ArrayList<>(); List<PrintParentWoLabelVO> plList = new ArrayList<>();
@ -1241,11 +1242,11 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
printParentWoLabel = new PrintParentWoLabelVO(); printParentWoLabel = new PrintParentWoLabelVO();
} }
list.add(woId); list.add(woId);
printWoLabel = new PrintWoLabelVO();
workOrder = idMap.get(woId); workOrder = idMap.get(woId);
printWoLabel.setPartCode(yieldOrderMap.get(workOrder.getYoId()).getPartCode()); String partCode = yieldOrderMap.get(workOrder.getYoId()).getPartCode();
printWoLabel.setBatchNo(workOrder.getBatchNo()); String batchNo = workOrder.getBatchNo();
printWoLabel.setMakeQty(workOrder.getMakeQty().toString()); String string = workOrder.getMakeQty().toString();
printWoLabel = String.join("\n\n", partCode, batchNo, string);
if (list.size() == 1) { if (list.size() == 1) {
printParentWoLabel.setPlOne(printWoLabel); printParentWoLabel.setPlOne(printWoLabel);
} }
@ -1264,7 +1265,8 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
} }
i++; i++;
} }
return plList; data.put("data", plList);
return data;
} }
@Override @Override

Loading…
Cancel
Save