diff --git a/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/logistics/pojo/entity/PrYieldOrder.java b/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/logistics/pojo/entity/PrYieldOrder.java new file mode 100644 index 00000000..70ee60fa --- /dev/null +++ b/blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/logistics/pojo/entity/PrYieldOrder.java @@ -0,0 +1,224 @@ +package org.springblade.desk.logistics.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +@Schema(description = "生产报工订单视图 PJ_YIELD_ORDER") +@TableName("PR_YIELD_ORDER") // 你创建的视图名 +public class PrYieldOrder implements Serializable { + + @Schema(description = "生产订单ID") + @TableField("YO_ID") + private Long yoId; + + @Schema(description = "生产订单编号") + @TableField("YO_CODE") + private String yoCode; + + @Schema(description = "计划订单编号") + @TableField("PO_CODE") + private String poCode; + + @Schema(description = "零件编号") + @TableField("PART_CODE") + private String partCode; + + @Schema(description = "产品型号") + @TableField("PRODUCT_TYPE") + private String productType; + + @Schema(description = "零件名称") + @TableField("PART_NAME") + private String partName; + + @Schema(description = "镀种") + @TableField("PLATE") + private String plate; + + @Schema(description = "产品标识") + @TableField("PROD_IDENT") + private String prodIdent; + + @Schema(description = "使用部门") + @TableField("USE_DEPT") + private String useDept; + + @Schema(description = "面积") + @TableField("PO_AREA") + private BigDecimal poArea; + + @Schema(description = "需求日期") + @TableField("DEMAND_DATE") + private Date demandDate; + + @Schema(description = "计划员") + @TableField("PLAN_USER") + private String planUser; + + @Schema(description = "下发日期") + @TableField("RELEASE_DATE") + private Date releaseDate; + + @Schema(description = "备注") + @TableField("MEMO") + private String memo; + + @Schema(description = "路线卡号") + @TableField("CARD_NO") + private String cardNo; + + @Schema(description = "批次号") + @TableField("BATCH_NO") + private String batchNo; + + @Schema(description = "是否场内生产") + @TableField("SITE_WORK") + private Integer siteWork; + + @Schema(description = "订单数量") + @TableField("PO_QTY") + private BigDecimal poQty; + + @Schema(description = "同步时间") + @TableField("SYNC_TIME") + private Date syncTime; + + @Schema(description = "当前状态") + @TableField("CUR_STATUS") + private Integer curStatus; + + @Schema(description = "B号") + @TableField("ROAM_NO") + private String roamNo; + + @Schema(description = "一级工艺") + @TableField("PRIMARY_CRAFT") + private String primaryCraft; + + @Schema(description = "下级B号") + @TableField("NEXT_ROAM") + private String nextRoam; + + @Schema(description = "PDM地址") + @TableField("PDM_URL") + private String pdmUrl; + + @Schema(description = "优先级") + @TableField("PRIORITY") + private Integer priority; + + @Schema(description = "保管员") + @TableField("CUSTODIAN") + private String custodian; + + @Schema(description = "返工单号") + @TableField("REWORK_CODE") + private String reworkCode; + + @Schema(description = "返工顺序") + @TableField("REWORK_NO") + private Long reworkNo; + + @Schema(description = "委托车间") + @TableField("ENTRUST_DEPT") + private String entrustDept; + + @Schema(description = "返工备注") + @TableField("REWORK_MEMO") + private String reworkMemo; + + @Schema(description = "失败备注") + @TableField("FAILURE_MEMO") + private String failureMemo; + + @Schema(description = "业务类型") + @TableField("BUSINESS_TYPE") + private Integer businessType; + + @Schema(description = "失败人") + @TableField("FAILURE_MAN") + private String failureMan; + + @Schema(description = "失败时间") + @TableField("FAILURE_TIME") + private Date failureTime; + + @Schema(description = "工序序号") + @TableField("RECSEQNO") + private String recseqno; + + @Schema(description = "推车ID") + @TableField("CART_ID") + private Long cartId; + + @Schema(description = "工艺ID") + @TableField("CRAFTID") + private Long craftid; + + @Schema(description = "工艺ID") + @TableField("CRAFT_ID") + private Long craftId; + + @Schema(description = "手动增加标识") + @TableField("MANUAL_INCREASE") + private Integer manualIncrease; + + @Schema(description = "报工类型") + @TableField("YIELD_TYPE") + private Integer yieldType; + + @Schema(description = "父订单ID") + @TableField("FATHER_YO_ID") + private Long fatherYoId; + + @Schema(description = "外协转工标识") + @TableField("NEWLEV_FLAG") + private String newlevFlag; + + @Schema(description = "是否可生产") + @TableField("PRODUCE_BOOL") + private Integer produceBool; + + @Schema(description = "使用部门编码") + @TableField("USE_DEPTCODE") + private String useDeptcode; + + @Schema(description = "产品产线") + @TableField("PO_PROD_LINE") + private String poProdLine; + + @Schema(description = "订单备注") + @TableField("PO_MEMO") + private String poMemo; + + @Schema(description = "烧结模具准备状态") + @TableField("SJ_MOLD_PREPARATION") + private Long sjMoldPreparation; + + @Schema(description = "烧结齐套准备状态") + @TableField("SJ_KIT_PREPARATION") + private Long sjKitPreparation; + + @Schema(description = "配套人") + @TableField("PK_USERNAME") + private String pkUsername; + + @Schema(description = "配套时间") + @TableField("PK_DATE") + private Date pkDate; + + @Schema(description = "齐套操作人") + @TableField("KIT_PREPARATION_MAN") + private Long kitPreparationMan; + + @Schema(description = "齐套操作时间") + @TableField("KIT_PREPARATION_TIME") + private Date kitPreparationTime; +} \ No newline at end of file diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/controller/PipelineController.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/controller/PipelineController.java index abe08240..3381cd89 100644 --- a/blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/controller/PipelineController.java +++ b/blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/controller/PipelineController.java @@ -85,7 +85,8 @@ public class PipelineController extends BladeController { returnToWarehouseDto.setBoxBarcode(boxBarcode); R wcIdR = iOrderBoxService.getWcId(boxBarcode); LinkedHashMap map = (LinkedHashMap) wcIdR.getData(); - if (map==null) { + System.out.println("wcIdR = " + wcIdR); + if (map==null) { return R.fail("未查询到该箱条码的作业中心"); } returnToWarehouseDto.setEndWcId((Long) map.get("wcId")); diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/mapper/PrYieldOrderMapper.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/mapper/PrYieldOrderMapper.java new file mode 100644 index 00000000..18cc47fc --- /dev/null +++ b/blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/mapper/PrYieldOrderMapper.java @@ -0,0 +1,16 @@ +package org.springblade.desk.logistics.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; +import org.springblade.desk.logistics.pojo.entity.Location; +import org.springblade.desk.logistics.pojo.entity.PrYieldOrder; +import org.springblade.desk.logistics.pojo.vo.LocationVO; + +import java.util.List; + +public interface PrYieldOrderMapper extends BaseMapper { + + + +} diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/mapper/PrYieldOrderMapper.xml b/blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/mapper/PrYieldOrderMapper.xml new file mode 100644 index 00000000..1311cd82 --- /dev/null +++ b/blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/mapper/PrYieldOrderMapper.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/service/IPrYieldOrderService.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/service/IPrYieldOrderService.java new file mode 100644 index 00000000..6b5c2386 --- /dev/null +++ b/blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/service/IPrYieldOrderService.java @@ -0,0 +1,45 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.desk.logistics.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.springblade.core.mp.base.BaseService; +import org.springblade.desk.logistics.pojo.entity.PrWorkPlan; +import org.springblade.desk.logistics.pojo.entity.PrYieldOrder; +import org.springblade.desk.logistics.pojo.entity.WeighData; + +import java.math.BigDecimal; + +/** + * 物流称重存储 服务类 + * + * @author BladeX + * @since 2025-11-12 + */ +public interface IPrYieldOrderService extends IService { + + +} diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/service/impl/IOrderBoxServiceImpl.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/service/impl/IOrderBoxServiceImpl.java index c12551ef..160af82c 100644 --- a/blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/service/impl/IOrderBoxServiceImpl.java +++ b/blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/service/impl/IOrderBoxServiceImpl.java @@ -125,6 +125,7 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { private final IPrWorkPlanService prWorkPlanService; private final IPrWorkOrderService prWorkOrderService; private final IStationCenterService stationCenterService; + private final IPrYieldOrderService prYieldOrderService; // ========================== 构造器注入 ========================== @@ -148,7 +149,7 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { ILocationService locationService, AgvTaskTypeUtil agvTaskTypeUtil, IBsWorkCenterService bsWorkCenterService, - ITaskExecuteRecordService taskExecuteRecordService, IWorkOrderService workOrderService, IWorkPlanService workPlanService, IPrWorkPlanService prWorkPlanService, IPrWorkOrderService prWorkOrderService, IStationCenterService stationCenterService) { + ITaskExecuteRecordService taskExecuteRecordService, IWorkOrderService workOrderService, IWorkPlanService workPlanService, IPrWorkPlanService prWorkPlanService, IPrWorkOrderService prWorkOrderService, IStationCenterService stationCenterService, IPrYieldOrderService prYieldOrderService) { this.yieldOrderService = yieldOrderService; this.taskService = taskService; this.orderBindService = orderBindService; @@ -162,6 +163,7 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { this.prWorkPlanService = prWorkPlanService; this.prWorkOrderService = prWorkOrderService; this.stationCenterService = stationCenterService; + this.prYieldOrderService = prYieldOrderService; } // ========================== 核心业务方法 ========================== @@ -459,13 +461,29 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { LinkedHashMap map = new LinkedHashMap<>(); map.put("wcId",wcID); if (DistinguishRegionsEnum.includeByWcName(workCenter.getWcName())) { - String useDept = yieldOrderService.list(new LambdaQueryWrapper().eq(YieldOrder::getCardNo, orderBindList.get(0).getCardNo())).get(0).getUseDept(); + List list = yieldOrderService.list(new LambdaQueryWrapper().eq(YieldOrder::getCardNo, orderBindList.get(0).getCardNo())); + String useDept =""; + if (list!=null&&list.size()!=0) { + useDept= list.get(0).getUseDept(); + }else { + List list1 = prYieldOrderService.list(new LambdaQueryWrapper().eq(PrYieldOrder::getCardNo, orderBindList.get(0).getCardNo())); + if (list1!=null&&list1.size()!=0) { + useDept= list1.get(0).getUseDept(); + } + } String code = DistinguishRegionsEnum.wcNameByCode(workCenter.getWcName()); String logisticsAnagementRegion = DictCache.getValue(code, useDept); - map.put("stationRegion",logisticsAnagementRegion); + System.out.println("logisticsAnagementRegion = " + logisticsAnagementRegion); + if (logisticsAnagementRegion!=null) { + map.put("stationRegion",logisticsAnagementRegion); + }else { + List freeStationList = stationService.getStatusStationList(null, false,wcID, STATION_RECEIVE_ONLY, false); + map.put("stationRegion",freeStationList.get(0).getStationRegion()); + } + }else { - List statusStationList = stationService.getStatusStationList(STATUS_FREE, true,wcID, CONVEYOR_LINE_RECEIVE_ONLY, false); + List statusStationList = stationService.getStatusStationList(null, true,wcID, CONVEYOR_LINE_RECEIVE_ONLY, false); map.put("stationRegion",statusStationList.get(0).getStationRegion()); } return R.data(map); @@ -1107,7 +1125,7 @@ public class IOrderBoxServiceImpl implements IOrderBoxService { for (String stationRegion : stationRegionList) { StationRegionVo stationRegionVo = new StationRegionVo(); stationRegionVo.setStationRegion(stationRegion); - List stationList = freeStationList.stream().filter(s -> stationRegion.equals(s.getStationRegion())).map(StationVO::getStationCode).distinct().collect(Collectors.toUnmodifiableList()); + List stationList = freeStationList.stream().filter(s -> stationRegion!=null&&s.getStationRegion()!=null&&stationRegion.equals(s.getStationRegion())).map(StationVO::getStationCode).distinct().collect(Collectors.toUnmodifiableList()); stationRegionVo.setStationCodeList(stationList); list.add(stationRegionVo); } diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/service/impl/PrYieldOrderServiceImpl.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/service/impl/PrYieldOrderServiceImpl.java new file mode 100644 index 00000000..5f6700c4 --- /dev/null +++ b/blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/service/impl/PrYieldOrderServiceImpl.java @@ -0,0 +1,49 @@ +package org.springblade.desk.logistics.service.impl; /** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.extern.slf4j.Slf4j; +import org.springblade.desk.logistics.mapper.PrWorkPlanMapper; +import org.springblade.desk.logistics.mapper.PrYieldOrderMapper; +import org.springblade.desk.logistics.pojo.entity.PrWorkPlan; +import org.springblade.desk.logistics.pojo.entity.PrYieldOrder; +import org.springblade.desk.logistics.service.IPrWorkPlanService; +import org.springblade.desk.logistics.service.IPrYieldOrderService; +import org.springframework.stereotype.Service; + +/** + * 车间订单、 服务实现类 + * + * @author BladeX + * @since 2025-11-12 + */ +@Service +@Slf4j +public class PrYieldOrderServiceImpl extends ServiceImpl implements IPrYieldOrderService { + + +}