mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
Merge branch 'main' of http://192.168.1.205:9980/cf_devdept2/cf_imes_server
This commit is contained in:
+2
@@ -16,6 +16,8 @@ public class ErrorCodeConstants {
|
||||
public static final ErrorCode LIST_CHANGES_ARE_PROHIBITED = new ErrorCode(1_001_107_003, "当前排单有板材已开料,禁止更改");
|
||||
|
||||
public static final ErrorCode PLATE_ERROR = new ErrorCode(1_001_107_005, "当前新增的板材非同一类型的板材,禁止更改");
|
||||
public static final ErrorCode PLAN_PLATE_IS_ALL_CUT = new ErrorCode(1_001_107_006, "排单号:{} 的板材已全部开料,禁止删除!");
|
||||
public static final ErrorCode PLAN_NOT_DATA_EXISTS = new ErrorCode(1_001_107_007, "排单号:{} 不存在,无法进行操作,请检查排单数据");
|
||||
|
||||
|
||||
|
||||
|
||||
+7
-91
@@ -43,7 +43,6 @@ import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR;
|
||||
import static com.cf.imes.framework.common.util.json.JsonUtils.toJsonString;
|
||||
@@ -161,7 +160,6 @@ public class OrderPlanApiImpl implements OrderPlanApi{
|
||||
|
||||
List<OptimizeBoardModelDO> optimizeBoardModelDOS = buildBoardByPlanId(planId, ORDER_REMAIN_PLATE_MODEL, 10);
|
||||
|
||||
List<String> goodsIds = optimizeBoardModelDOS.stream().map(OptimizeBoardModelDO::getGoodsId).toList();
|
||||
|
||||
|
||||
JsonNode jsonNode = JsonUtils.parseTree(JsonUtils.toJsonString(optimizeBoardModelDOS));
|
||||
@@ -173,11 +171,6 @@ public class OrderPlanApiImpl implements OrderPlanApi{
|
||||
String filed2 = "place_block_number".equals(filed) ? ",{placeBlockNumber:"+jsonNode.get("placeBlockNumber").asLong()+"}]" : "";
|
||||
|
||||
|
||||
// String sql = " select from order_goods where organ_id = #{organId} and deleted = false";
|
||||
//
|
||||
// sql = sql.replace("#{organId}", getUserOrganId() + "");
|
||||
|
||||
|
||||
List<GoodsDO> goodsDO = goodsMapper.selectPlanGoodsDataSource(conversion(filed),planId,getUserOrganId());
|
||||
|
||||
|
||||
@@ -208,16 +201,6 @@ public class OrderPlanApiImpl implements OrderPlanApi{
|
||||
@Override
|
||||
public String getPlan(Long planId,String filed) {
|
||||
|
||||
|
||||
// String sql = " select from order_plan where id =#{planId} and organ_id = #{organId} and deleted = false";
|
||||
//
|
||||
// sql = sql.replace("#{organId}", getUserOrganId() + "").replace("#{planId}", planId + "");
|
||||
//
|
||||
// String toInsert = filed.replaceAll("\\[|\\]", "");
|
||||
|
||||
// List<PlanDO> planDOS = planMapper.seleTestSQL(conversion(sql, filed));
|
||||
|
||||
|
||||
List<PlanDO> planDOS = planMapper.selectPlanDataSource(conversion(filed),planId,getUserOrganId());
|
||||
|
||||
return toJsonString(planDOS);
|
||||
@@ -257,12 +240,6 @@ public class OrderPlanApiImpl implements OrderPlanApi{
|
||||
@Override
|
||||
public String apiGetPlanRemainPlate(Long planId, String field) {
|
||||
|
||||
|
||||
// String sql = " select from order_remain_plate where organ_id = #{organId} and plan_id = #{planId} and deleted = false";
|
||||
//
|
||||
// sql = sql.replace("#{organId}", getUserOrganId() + "").replace("#{planId}", planId + "");
|
||||
|
||||
|
||||
List<RemainPlateDO> remainPlateDOS = remainPlateMapper.selectPlanRemainDataSource(conversion(field),planId,getUserOrganId());
|
||||
|
||||
|
||||
@@ -275,19 +252,6 @@ public class OrderPlanApiImpl implements OrderPlanApi{
|
||||
@Override
|
||||
public String apiGetPlanPlate(Long planId, String field) {
|
||||
|
||||
|
||||
// List<OptimizeBoardModelDO> optimizeBoardModelDOS = buildBoardByPlanId(planId, ORDER_REMAIN_PLATE_MODEL, 99);
|
||||
//
|
||||
//
|
||||
// List<String> goodsIds = optimizeBoardModelDOS.stream().map(OptimizeBoardModelDO::getGoodsId).toList();
|
||||
//
|
||||
//
|
||||
// List<Long> orderIds = BeanUtils.toBean(optimizeBoardModelDOS.stream().map(OptimizeBoardModelDO::getOrderId).toList(), Long.class);
|
||||
//
|
||||
//
|
||||
// List<Long> goodsIdList = goodsMapper.selectListByGoodsIdList(goodsIds,orderIds, getUserOrganId())
|
||||
// .stream().map(GoodsDO::getId).toList();
|
||||
|
||||
List<GoodsDO> goodsDOS = goodsMapper.selectPlanGoods(planId, getUserOrganId());
|
||||
|
||||
List<Long> goodsIds = goodsDOS.stream().map(GoodsDO::getId).distinct().toList();
|
||||
@@ -322,7 +286,6 @@ public class OrderPlanApiImpl implements OrderPlanApi{
|
||||
|
||||
List<String> esData = new ArrayList<>();
|
||||
|
||||
// todo 目前只考虑非混单的情况,混单的情况待解决
|
||||
List<Long> plateIds = getPlateIds(planId);
|
||||
|
||||
|
||||
@@ -339,9 +302,8 @@ public class OrderPlanApiImpl implements OrderPlanApi{
|
||||
BigDecimal splitLength = BigDecimal.valueOf(jsonNode.get("splitLength").asDouble());
|
||||
BigDecimal splitWidth = BigDecimal.valueOf(jsonNode.get("splitWidth").asDouble());
|
||||
|
||||
filedData.add( "splitArea".equals(field)? "splitArea:"+ splitLength.multiply(splitWidth) : field+":"+jsonNode.get(field).asText() );
|
||||
filedData.add( "splitArea".equals(field)? "splitArea:"+ splitLength.multiply(splitWidth) : field+":"+jsonNode.get(field).asText());
|
||||
|
||||
// filedData.add(field+":"+jsonNode.get(field).asText());
|
||||
}
|
||||
|
||||
|
||||
@@ -360,13 +322,6 @@ public class OrderPlanApiImpl implements OrderPlanApi{
|
||||
@Override
|
||||
public String apiGetPlanBodyOrRoom(Long planId, String field) {
|
||||
|
||||
// List<Long> plateIds = getPlateIds(planId);
|
||||
//
|
||||
//
|
||||
// List<OrderItemDO> orderItemDOS = orderItemMapper.selectPlateIdList(plateIds, getUserOrganId());
|
||||
//
|
||||
// List<Long> bodyIds = orderItemDOS.stream().map(OrderItemDO::getBodyId).distinct().toList();
|
||||
|
||||
|
||||
List<Long> bodyIds = goodsMapper.selectPlanBodyIds(planId, getUserOrganId());
|
||||
|
||||
@@ -384,15 +339,6 @@ public class OrderPlanApiImpl implements OrderPlanApi{
|
||||
public String apiGetPlanGroup(Long planId, String field) {
|
||||
|
||||
|
||||
// List<Long> plateIds = getPlateIds(planId);
|
||||
//
|
||||
//// List<Long> plateIds = Arrays.asList(1825367895442456579L, 1825367895308238851L, 1824334800400416772L);
|
||||
//
|
||||
// List<OrderItemDO> orderItemDOS = orderItemMapper.selectPlateIdList(plateIds, getUserOrganId());
|
||||
//
|
||||
// List<Long> groupIds = orderItemDOS.stream().map(OrderItemDO::getGroupId).distinct().toList();
|
||||
|
||||
|
||||
List<Long> groupIds = goodsMapper.selectPlanGroupListDataSource(planId, getUserOrganId());
|
||||
|
||||
if(groupIds.isEmpty()){
|
||||
@@ -419,16 +365,6 @@ public class OrderPlanApiImpl implements OrderPlanApi{
|
||||
@Override
|
||||
public String apiGetPlanParts(Long planId, String field) {
|
||||
|
||||
|
||||
// List<OptimizeBoardModelDO> optimizeBoardModelDOS = buildBoardByPlanId(planId, ORDER_REMAIN_PLATE_MODEL, 10);
|
||||
//
|
||||
//
|
||||
// String orderNos = optimizeBoardModelDOS.stream().map(OptimizeBoardModelDO::getOrderId).toList().toString();
|
||||
//
|
||||
//
|
||||
// List<Long> orderIds = JSON.parseArray(orderNos).toJavaList(Long.class);
|
||||
|
||||
|
||||
List<Long> orderIds = goodsMapper.selectPlanGoods(planId, getUserOrganId()).stream().map(GoodsDO::getOrderId).distinct().toList();
|
||||
|
||||
|
||||
@@ -455,21 +391,13 @@ public class OrderPlanApiImpl implements OrderPlanApi{
|
||||
@Override
|
||||
public String apiGetEsParts(Long planId, List<String> fields) {
|
||||
|
||||
|
||||
// List<OptimizeBoardModelDO> optimizeBoardModelDOS = buildBoardByPlanId(planId, ORDER_REMAIN_PLATE_MODEL, 10);
|
||||
//
|
||||
//
|
||||
// String orderNos = optimizeBoardModelDOS.stream().map(OptimizeBoardModelDO::getOrderId).toList().toString();
|
||||
//
|
||||
//
|
||||
// List<Long> orderIds = JSON.parseArray(orderNos).toJavaList(Long.class);
|
||||
|
||||
|
||||
List<Long> orderIds = goodsMapper.selectPlanGoods(planId, getUserOrganId()).stream().map(GoodsDO::getOrderId).distinct().toList();
|
||||
|
||||
int partNum = orderPartsMapper.selectPartList(orderIds, getUserOrganId()).size();
|
||||
|
||||
List<String> esData = new ArrayList<>();
|
||||
|
||||
List<OrderPartsRemark> orderPartsRemarks = buildOrderPartsByOrderId(orderIds, ORDER_PARTS_REMARK_MODEL, 999);
|
||||
List<OrderPartsRemark> orderPartsRemarks = buildOrderPartsByOrderId(orderIds, ORDER_PARTS_REMARK_MODEL, partNum);
|
||||
|
||||
|
||||
for (OrderPartsRemark orderPartsRemark : orderPartsRemarks) {
|
||||
@@ -510,18 +438,6 @@ public class OrderPlanApiImpl implements OrderPlanApi{
|
||||
// 根据排单ID获取对应的板材ID
|
||||
private List<Long> getPlateIds(Long planId) {
|
||||
|
||||
|
||||
// List<OptimizeBoardModelDO> optimizeBoardModelDOS = buildBoardByPlanId(planId, ORDER_REMAIN_PLATE_MODEL, 10);
|
||||
//
|
||||
// List<String> goodsIds = optimizeBoardModelDOS.stream().map(OptimizeBoardModelDO::getGoodsId).toList();
|
||||
//
|
||||
//
|
||||
// List<Long> orderIds = BeanUtils.toBean(optimizeBoardModelDOS.stream().map(OptimizeBoardModelDO::getOrderId).toList(), Long.class);
|
||||
//
|
||||
// List<Long> ids = goodsMapper.selectListByGoodsIdList(goodsIds, orderIds, getUserOrganId()).stream().map(GoodsDO::getId).toList();
|
||||
//
|
||||
// plateMapper.selectGoodsPlateList(ids, getUserOrganId()).stream().map(PlateDO::getId).toList();
|
||||
|
||||
return goodsMapper.selectPlanPlateList(planId, getUserOrganId());
|
||||
|
||||
}
|
||||
@@ -538,7 +454,7 @@ public class OrderPlanApiImpl implements OrderPlanApi{
|
||||
SearchResponse<OrderPartsRemark> search = elasticsearchClient.search(builder.build(), OrderPartsRemark.class);
|
||||
List<Hit<OrderPartsRemark>> hits = search.hits().hits();
|
||||
if (CollUtil.isNotEmpty(hits)) {
|
||||
return hits.stream().map(Hit::source).collect(Collectors.toList());
|
||||
return hits.stream().map(Hit::source).toList();
|
||||
}
|
||||
return new ArrayList<>();
|
||||
} catch (IOException e) {
|
||||
@@ -560,7 +476,7 @@ public class OrderPlanApiImpl implements OrderPlanApi{
|
||||
SearchResponse<OptimizeBoardModelDO> search = elasticsearchClient.search(builder.build(), OptimizeBoardModelDO.class);
|
||||
List<Hit<OptimizeBoardModelDO>> hits = search.hits().hits();
|
||||
if (CollUtil.isNotEmpty(hits)) {
|
||||
return hits.stream().map(Hit::source).collect(Collectors.toList());
|
||||
return hits.stream().map(Hit::source).toList();
|
||||
}
|
||||
return new ArrayList<>();
|
||||
} catch (IOException e) {
|
||||
@@ -582,7 +498,7 @@ public class OrderPlanApiImpl implements OrderPlanApi{
|
||||
SearchResponse<OrderModelDO> search = elasticsearchClient.search(builder.build(), OrderModelDO.class);
|
||||
List<Hit<OrderModelDO>> hits = search.hits().hits();
|
||||
if (CollUtil.isNotEmpty(hits)) {
|
||||
return hits.stream().map(Hit::source).collect(Collectors.toList());
|
||||
return hits.stream().map(Hit::source).toList();
|
||||
}
|
||||
return new ArrayList<>();
|
||||
} catch (IOException e) {
|
||||
|
||||
+91
-19
@@ -1,17 +1,15 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.bo.OrderSource;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.CuttingStatusRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.SavePlanPlateResultReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.AddRemainReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.GetSourceDataReq;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateOptimize;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.bo.PlanProcessSchemeList;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.*;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderModelDO;
|
||||
import com.cf.imes.module.executor.service.optimizeplan.OptimizePlanService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -56,23 +54,29 @@ public class OptimizePlanController {
|
||||
|
||||
|
||||
@GetMapping("commit")
|
||||
@Operation(summary = "开料")
|
||||
@Parameters({
|
||||
@Parameter(name = "planId", description = "排单ID", required = true, example = "1024"),
|
||||
@Parameter(name = "goodsNo", description = "开料的大板编号", required = true, example = "1")
|
||||
})
|
||||
@Operation(summary = "开始开料")
|
||||
@Parameter(name = "planId", description = "排单ID", required = true)
|
||||
@Parameter(name = "goodsNo", description = "开料的大板编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
||||
public CommonResult<Boolean> commit(@RequestParam("planId") @NotNull(message = "排单ID不能为空") Long planId,
|
||||
@RequestParam("goodsId") @NotNull(message = "实际开料的大板ID不能为空") String goodsId,
|
||||
@RequestParam("planConfigId") @NotNull(message = "方案组的配置项ID") Long planConfigId,
|
||||
@RequestParam("goodsNo") @NotEmpty(message = "排单异常,请重新优化或重新进入排单") List<Long> goodsNo) {
|
||||
|
||||
return CommonResult.success(optimizePlanService.commit(planId,goodsNo));
|
||||
return CommonResult.success(optimizePlanService.commit(planId,goodsId,planConfigId,goodsNo));
|
||||
}
|
||||
|
||||
@GetMapping("/endCutting")
|
||||
@Operation(summary = "结束开料")
|
||||
@Parameter(name = "planId", description = "排单ID", required = true)
|
||||
@Parameter(name = "planConfigId", description = "方案组的配置项ID", required = true)
|
||||
@Parameter(name = "goodsNo", description = "开料的大板编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
||||
public CommonResult<Boolean> endCutting(@RequestParam @Valid @NotNull(message = "排单id不能空") Long planId) {
|
||||
return success(optimizePlanService.endCutting(planId));
|
||||
public CommonResult<Boolean> endCutting(@RequestParam("planId") @NotNull(message = "排单ID不能为空") Long planId,
|
||||
@RequestParam("goodsId") @NotNull(message = "实际开料的大板ID不能为空") String goodsId,
|
||||
@RequestParam("planConfigId") @NotNull(message = "方案组的配置项ID不能为空") Long planConfigId,
|
||||
@RequestParam("goodsNo") @NotEmpty(message = "排单异常,请重新优化或重新进入排单") List<Long> goodsNo) {
|
||||
return success(optimizePlanService.endCutting(planId,goodsId,goodsNo,planConfigId));
|
||||
}
|
||||
|
||||
|
||||
@@ -90,12 +94,10 @@ public class OptimizePlanController {
|
||||
@Operation(summary = "获取生产单源数据")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
||||
public CommonResult<OrderSource> getOrderSource(@Schema(description = "生产单id") @RequestParam(required = false) Long orderId,
|
||||
@Schema(description = "大板IDS-大板分类的IDS") @RequestParam(required = false) List<Long> ids,
|
||||
@Schema(description = "排单id") @RequestParam(required = false) Long planId,
|
||||
@Schema(description = "机台Id")
|
||||
@NotNull(message = "当前排单对应的机台为空,请检查机台信息或重新选择机台") @RequestParam("machineId") Long machineId
|
||||
@Schema(description = "机台Id") @RequestParam(required = false) Long machineId
|
||||
) {
|
||||
return CommonResult.success(optimizePlanService.getOrderSource(orderId, planId, machineId,ids));
|
||||
return CommonResult.success(optimizePlanService.getOrderSource(orderId, planId, machineId));
|
||||
|
||||
}
|
||||
|
||||
@@ -110,7 +112,7 @@ public class OptimizePlanController {
|
||||
|
||||
|
||||
@PostMapping("/saveOptimizationResults")
|
||||
@Operation(summary = "保存优化后的数据")
|
||||
@Operation(summary = "保存优化生产后的数据")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
||||
public CommonResult<Boolean> saveOptimizationResults(@Valid @RequestBody SavePlanPlateResultReqVO req ) {
|
||||
|
||||
@@ -121,6 +123,47 @@ public class OptimizePlanController {
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/saveProcessSchemeResults")
|
||||
@Operation(summary = "保存方案组的优化信息")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
||||
public CommonResult<Boolean> saveProcessSchemeResults(@RequestBody SaveProcessSchemeReqVO saveProcessSchemeReqVO) {
|
||||
|
||||
optimizePlanService.saveProcessSchemeResults(saveProcessSchemeReqVO);
|
||||
|
||||
return CommonResult.success(true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/getProcessSchemeConfig")
|
||||
@Operation(summary = "查询加工方案组对应的配置信息")
|
||||
@Parameter(name = "planId", description = "排单ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack:query')")
|
||||
public CommonResult<PlanProcessSchemeList> getProcessSchemeConfig(@Schema(description = "方案组ID") @NotNull(message = "方案组的ID不能为空") Long processId,
|
||||
@Schema(description = "排单id") @RequestParam(required = false) Long planId) {
|
||||
|
||||
return success(optimizePlanService.getProcessSchemeConfig(processId,planId));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@PutMapping("/updateProcessScheme")
|
||||
@Operation(summary = "修改排单对应的方案组的是否锁单")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:update')")
|
||||
public CommonResult<Boolean> updateProcessScheme(@RequestBody PlanProcessSchemeReqVO reqVO) {
|
||||
optimizePlanService.updateProcessScheme(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/getPlateModel")
|
||||
@Operation(summary = "查询当前生产单的板材造型信息")
|
||||
@Parameter(name = "orderId", description = "生产单Id", required = true)
|
||||
@@ -131,6 +174,35 @@ public class OptimizePlanController {
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/getPlanPlateData")
|
||||
@Operation(summary = "未排单获取板材的所有数据")
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack:query')")
|
||||
public CommonResult<OrderSource> getNoPlanPlateData (@Valid NoPlanFilterPlateReqVO reqVO) {
|
||||
|
||||
return success(optimizePlanService.getNoPlanPlateData(reqVO));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/getOrderDataFilter")
|
||||
@Operation(summary = "未排单高级筛选-订单分组")
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack:query')")
|
||||
public CommonResult<PageResult<OrderRespVOCopy>> getOrderPlateDataFilter (@Valid FilterDataPageReqVO pageReqVO) {
|
||||
|
||||
return success(optimizePlanService.getOrderPlateDataFilter(pageReqVO));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getGoodsDataFilter")
|
||||
@Operation(summary = "未排单高级筛选-板材分组")
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack:query')")
|
||||
public CommonResult<PageResult<OrderGoodsResp>> getGoodsPlateDataFilter (@Valid FilterDataPageReqVO pageReqVO) {
|
||||
|
||||
return success(optimizePlanService.getGoodsPlateDataFilter(pageReqVO));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+19
-39
@@ -10,8 +10,6 @@ import com.cf.imes.framework.excel.core.util.ExcelUtils;
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.bo.OrderRoomBodyList;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.NotPlanGoodsReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.NotPlanGoodsRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
||||
import com.cf.imes.module.executor.service.plan.PlanService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@@ -29,7 +27,6 @@ import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
import static com.cf.imes.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
@@ -46,8 +43,9 @@ public class PlanController {
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建排单")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:create')")
|
||||
public CommonResult<Map<String,Long>> createPlan(@Validated(CreateGroup.class) @RequestBody PlanSaveReqVO createReqVO) {
|
||||
return success(planService.createPlan(createReqVO));
|
||||
public CommonResult<Boolean> createPlan(@Validated(CreateGroup.class) @RequestBody PlanSaveReqVO createReqVO) {
|
||||
planService.createPlan(createReqVO);
|
||||
return success(Boolean.TRUE);
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@@ -98,13 +96,26 @@ public class PlanController {
|
||||
return success(BeanUtils.toBean(pageResult, PlanRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("getPlanList")
|
||||
@Operation(summary = "查询排单(未分页)")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:orderlist')")
|
||||
public CommonResult<List<PlanRespVO>> getPlanList() {
|
||||
|
||||
return success(planService.getPlanList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/setSort")
|
||||
@Operation(summary = "设置排单优先级")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:priority')")
|
||||
public CommonResult<Boolean> setSort(@Valid @NotEmpty(message = "参数不能空") @RequestBody List<SortVO> list) {
|
||||
return success(planService.setSort(list));
|
||||
public CommonResult<Boolean> setSort(@Valid @NotEmpty(message = "参数不能空") @RequestBody List<SortVO> sortVos) {
|
||||
return success(planService.setSort(sortVos));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("getNotPlanOrderListPage")
|
||||
@Operation(summary = "获取未排单的生产单分页列表")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:query')")
|
||||
@@ -113,14 +124,6 @@ public class PlanController {
|
||||
}
|
||||
|
||||
|
||||
// 目前因为这个接口没有使用,所以这个接口里代码没有进行更改
|
||||
@GetMapping("getNotPlanOrderPlateList")
|
||||
@Operation(summary = "获取未排单的板材分页列表")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:query')")
|
||||
public CommonResult<List<NotPlanOrderPlateRespVO>> getOrderPlateList(@Valid OrderPageReqVOCopy pageReqVO) {
|
||||
return success(planService.getOrderPlateList(pageReqVO));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("getNotPlanGoodsListPage")
|
||||
@Operation(summary = "获取未排单的大板板材分页列表")
|
||||
@@ -131,29 +134,6 @@ public class PlanController {
|
||||
|
||||
|
||||
|
||||
@PostMapping("getNotOptimizeGoodsList")
|
||||
@Operation(summary = "优化界面未排单的大板板材分页列表")
|
||||
@PreAuthorize("@ss.hasPermission('executor:plan:query')")
|
||||
public CommonResult<List<NotPlanGoodsRespVO>> getNotOptimizeGoodsList(@Valid @RequestBody NotPlanGoodsReqVO reqVO) {
|
||||
return success(planService.getNotOptimizeGoodsList(reqVO));
|
||||
}
|
||||
|
||||
|
||||
// @GetMapping("getNotPlanGoodsListPageByOrderId")
|
||||
// @Operation(summary = "根据生产单id获取未排单的商品分页列表")
|
||||
// @PreAuthorize("@ss.hasPermission('executor:plan:query')")
|
||||
public CommonResult<PageResult<PlanGoodsVO>> getNotPlanGoodsListPageByOrderId(@Valid NotPlanGoodsListPageVO pageVO) {
|
||||
return success(planService.getNotPlanGoodsListPageByOrderId(pageVO));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("addPlate")
|
||||
@Operation(summary = "添加板材")
|
||||
@PreAuthorize("@ss.hasPermission('executor:plan:update')")
|
||||
public CommonResult<Boolean> addPlate(@Valid @RequestBody AddPlateReq req) {
|
||||
return success(planService.addPlate(req));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出排单 Excel")
|
||||
@@ -195,7 +175,7 @@ public class PlanController {
|
||||
@Operation(summary = "获取未排单的生产单的柜体和房间名称")
|
||||
@Parameter(name = "orderIds", description = "生产单ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:orderlist')")
|
||||
public CommonResult<List<OrderRoomBodyList>> getOrderRoomBody(@Valid @RequestParam List<Long> orderIds) {
|
||||
public CommonResult<List<OrderRoomBodyList>> getOrderRoomBody(@Valid @RequestParam @Size(max = 20,message = "最多可同时查询20个生产单信息") List<Long> orderIds) {
|
||||
|
||||
return success(planService.getOrderRoomBody(orderIds));
|
||||
}
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.bo;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
public class OrderGoodsFilterList {
|
||||
|
||||
|
||||
@Schema(description = "商品名称")
|
||||
private List<String> goodsName;
|
||||
|
||||
@Schema(description = "商品材质")
|
||||
private List<String> material;
|
||||
|
||||
@Schema(description = "商品颜色")
|
||||
private List<String> color;
|
||||
|
||||
@Schema(description = "厚")
|
||||
private List<BigDecimal> thickness;
|
||||
|
||||
@Schema(description = "商品纹理")
|
||||
private List<Boolean> texture;
|
||||
|
||||
@Schema(description = "商品品牌")
|
||||
private List<String> brand;
|
||||
|
||||
|
||||
}
|
||||
+4
-4
@@ -5,7 +5,7 @@ import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.OptimizeRe
|
||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.PrintOrderPackReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.PrintOrderPartsRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.GoodsReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateDetialRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateDetailRespVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.OptimizeBoardModelDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderModelDO;
|
||||
@@ -42,15 +42,15 @@ public class OrderSource {
|
||||
private PlanDO plan;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "生产单列表")
|
||||
private List<OrderDO> orderList;
|
||||
|
||||
@Schema(description = "板材-大板列表")
|
||||
|
||||
@Schema(description = "大板板材列表-原板材的信息数据")
|
||||
private List<GoodsReqVO> goodsList;
|
||||
|
||||
@Schema(description = "小板列表")
|
||||
private List<PlateDetialRespVO> plateList;
|
||||
private List<PlateDetailRespVO> plateList;
|
||||
|
||||
@Schema(description = "小板造型列表")
|
||||
private List<OrderModelDO> plateModels;
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.bo;
|
||||
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.SaveProcessSchemeModelDO;
|
||||
import com.cf.imes.module.system.api.systemconfig.dto.ProcessSchemeDTO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PlanProcessSchemeList {
|
||||
|
||||
|
||||
|
||||
@Schema(description = "排单对应的方案组的优化信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<SaveProcessSchemeModelDO> saveProcessSchemeReqVOS;
|
||||
|
||||
|
||||
@Schema(description = "加工方案中的配置的信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<ProcessSchemeDTO> processSchemeList;
|
||||
|
||||
}
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.saveOptimize;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
|
||||
|
||||
@Data
|
||||
public class ActualGoodsList {
|
||||
|
||||
|
||||
@Schema(description = "余料板ID")
|
||||
private Long remainId;
|
||||
|
||||
|
||||
@Schema(description = "商品 ID-大板的实际ID")
|
||||
private String goodsId;
|
||||
|
||||
|
||||
@Schema(description = "商品名称")
|
||||
private String goodsName;
|
||||
|
||||
|
||||
@Schema(description = "材质:颗粒板、欧松板、多层板、生态板、禾香板、密度板、实木、铝蜂窝板、铝塑板")
|
||||
private String material;
|
||||
|
||||
|
||||
@Schema(description = "颜色")
|
||||
private String color;
|
||||
|
||||
|
||||
@Schema(description = "背面颜色")
|
||||
private String colorBlack;
|
||||
|
||||
|
||||
@Schema(description = "纹路")
|
||||
private Boolean texture;
|
||||
|
||||
|
||||
@Schema(description = "宽度")
|
||||
private BigDecimal width;
|
||||
|
||||
|
||||
@Schema(description = "高度")
|
||||
private BigDecimal height;
|
||||
|
||||
|
||||
@Schema(description = "厚度")
|
||||
private BigDecimal thickness;
|
||||
|
||||
|
||||
@Schema(description = "价格")
|
||||
private BigDecimal price;
|
||||
|
||||
|
||||
@Schema(description = "品牌")
|
||||
private String brand;
|
||||
|
||||
|
||||
@Schema(description = "规格")
|
||||
private String spec;
|
||||
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
private BigDecimal length;
|
||||
|
||||
|
||||
private Boolean isRealCuttingBoard;
|
||||
|
||||
|
||||
private Integer count;
|
||||
|
||||
|
||||
|
||||
private String cutKnifeName;
|
||||
|
||||
|
||||
|
||||
private String placeBoardJSON;
|
||||
|
||||
|
||||
|
||||
private Integer usedCount;
|
||||
|
||||
|
||||
private BigDecimal avgUsageRateAll;
|
||||
|
||||
|
||||
private BigDecimal avgUsageRateExcludeLastBoard;
|
||||
|
||||
|
||||
private BigDecimal usageRateLastBoard;
|
||||
|
||||
|
||||
|
||||
}
|
||||
+16
-2
@@ -16,7 +16,21 @@ public class CuttingStatusRespVO {
|
||||
private Long planId;
|
||||
|
||||
|
||||
@Schema(description = "取消开料的大板编号")
|
||||
private List<Long> goodsNo;
|
||||
@Schema(description = "实际开料的大板ID")
|
||||
@NotNull(message = "实际开料的大板ID不能为空")
|
||||
private List<String> goodsId;
|
||||
|
||||
|
||||
@Schema(description = "方案组的配置项ID")
|
||||
@NotNull(message = "方案组的配置项ID不能为空")
|
||||
private Long planConfigId;
|
||||
|
||||
|
||||
@Schema(description = "开料状态")
|
||||
@NotNull(message = "开料状态不能为空")
|
||||
private Integer cutedType;
|
||||
|
||||
// @Schema(description = "取消开料的大板编号")
|
||||
// private List<Long> goodsNo;
|
||||
|
||||
}
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.saveOptimize;
|
||||
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Data
|
||||
public class FilterDataPageReqVO extends PageParam {
|
||||
|
||||
|
||||
@Schema(description = "筛选条件")
|
||||
private String config;
|
||||
|
||||
|
||||
@Schema(description = "生产单号")
|
||||
@Size(max = 20,message = "最多可同时查询 20 个")
|
||||
private List<Long> orderIds;
|
||||
|
||||
@Schema(description = "大板的实际ID")
|
||||
@Size(max = 20,message = "最多可同时查询 20 个")
|
||||
private List<String> goodsIds;
|
||||
|
||||
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.saveOptimize;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 未排单板材筛选
|
||||
*/
|
||||
@Valid
|
||||
@Data
|
||||
public class NoPlanFilterPlateReqVO {
|
||||
|
||||
|
||||
// @Schema(description = "机台ID",requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// private Long machineId;
|
||||
|
||||
|
||||
@Schema(description = "生产单ID",requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "生产单ID不能为空")
|
||||
private List<Long> orderIds;
|
||||
|
||||
|
||||
@Schema(description = "实际优化的大板ID-这个是混单和非混单都用",requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "大板ID不能为空")
|
||||
private List<String> goodsIdList;
|
||||
|
||||
|
||||
// @Schema(description = "实际优化的大板ID-这个只用于混单传入实际优化的大板ID")
|
||||
// private String goodsId;
|
||||
//
|
||||
//
|
||||
// @Schema(description = "板材过滤条件-传没有勾选的")
|
||||
// @Size(max = 7,message = "板材过滤条件数量不正确")
|
||||
// private List<String> filter;
|
||||
//
|
||||
//
|
||||
// @Schema(description = "是否混单", requiredMode = Schema.RequiredMode.REQUIRED, example = "false")
|
||||
// @NotNull(message = "混单的判断条件不能为空")
|
||||
// private Boolean isMix;
|
||||
|
||||
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.saveOptimize;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
|
||||
@Data
|
||||
public class PlanProcessSchemeReqVO {
|
||||
|
||||
|
||||
|
||||
@Schema(description = "排单ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "排单ID不能为空")
|
||||
private Long planId;
|
||||
|
||||
|
||||
@Schema(description = "加工方案组的配置项ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "加工方案组的配置项ID不能为空")
|
||||
private Long planConfigId;
|
||||
|
||||
|
||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "状态不能为空")
|
||||
private Boolean isLock;
|
||||
|
||||
}
|
||||
+19
@@ -68,4 +68,23 @@ public class PrintOrderPartsRespVO {
|
||||
private String type;
|
||||
|
||||
|
||||
@Schema(description = "配件颜色", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String partsColor;
|
||||
|
||||
@Schema(description = "配件宽度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Double partsWidth;
|
||||
|
||||
@Schema(description = "配件长度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Double partsLength;
|
||||
|
||||
@Schema(description = "配件厚度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Double partsThickness;
|
||||
|
||||
@Schema(description = "配件主类:1封边2五金3组件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String category;
|
||||
|
||||
@Schema(description = "子配件ID列表,复合部件时记录子配件ID,半角逗号分隔", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String subparts;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+161
@@ -0,0 +1,161 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.saveOptimize;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
@Data
|
||||
public class RemainBoardInfo {
|
||||
|
||||
|
||||
@Schema(description = "余料板ID")
|
||||
private Long remainId;
|
||||
|
||||
@Schema(description = "商品 ID-大板的实际ID")
|
||||
private String goodsId;
|
||||
|
||||
@Schema(description = "商品名称")
|
||||
private String goodsName;
|
||||
|
||||
@Schema(description = "余料板材质")
|
||||
private String material;
|
||||
|
||||
@Schema(description = "余料板颜色")
|
||||
private String color;
|
||||
|
||||
|
||||
@Schema(description = "余料板颜色")
|
||||
private String colorBlack;
|
||||
|
||||
|
||||
@Schema(description = "纹路 纹路(0正纹1可翻转2反纹)")
|
||||
private Boolean texture;
|
||||
|
||||
|
||||
@Schema(description = "余料板宽")
|
||||
private Double width;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "余料板长")
|
||||
private Double length;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "余料板厚度")
|
||||
private Double thickness;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "价格")
|
||||
private BigDecimal price;
|
||||
|
||||
|
||||
@Schema(description = "品牌")
|
||||
private String brand;
|
||||
|
||||
|
||||
@Schema(description = "规格")
|
||||
private String spec;
|
||||
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
private Integer cutedType;
|
||||
|
||||
private String height;
|
||||
|
||||
|
||||
private Boolean isRealCuttingBoard;
|
||||
|
||||
|
||||
@Schema(description = "余料板数量")
|
||||
private Integer count;
|
||||
|
||||
|
||||
private String cutKnifeName;
|
||||
|
||||
|
||||
private String placeBoardJSON;
|
||||
|
||||
|
||||
private Integer usedCount;
|
||||
|
||||
|
||||
private BigDecimal avgUsageRateAll;
|
||||
|
||||
|
||||
private BigDecimal avgUsageRateExcludeLastBoard;
|
||||
|
||||
|
||||
private BigDecimal usageRateLastBoard;
|
||||
|
||||
|
||||
private List<PlaceBoardList> placeBoardList;
|
||||
|
||||
|
||||
@Data
|
||||
public static class PlaceBoardList {
|
||||
|
||||
private Integer boardId;
|
||||
|
||||
private Double width;
|
||||
|
||||
private Double length;
|
||||
|
||||
private Boolean isRemainBoard;
|
||||
|
||||
private String remainNo;
|
||||
|
||||
private Integer remainId;
|
||||
|
||||
private Boolean isScrap;
|
||||
|
||||
private List<Objects> points;
|
||||
|
||||
private List<Blocks> blocks;
|
||||
|
||||
private List<Objects> objects;
|
||||
|
||||
private BigDecimal area;
|
||||
|
||||
private Boolean isTwoFaceProcess;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Data
|
||||
public static class Blocks {
|
||||
|
||||
private String blockId;
|
||||
|
||||
private String blockNo;
|
||||
|
||||
private Integer boardId;
|
||||
|
||||
private BigDecimal placeX;
|
||||
|
||||
private BigDecimal placeY;
|
||||
|
||||
private BigDecimal width;
|
||||
|
||||
private BigDecimal length;
|
||||
|
||||
private Integer placeStyle;
|
||||
|
||||
private BigDecimal area;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+61
@@ -4,6 +4,8 @@ package com.cf.imes.module.executor.controller.admin.plan.saveOptimize;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "优化生产使用的余料板的信息")
|
||||
public class RemainBoardList {
|
||||
@@ -66,4 +68,63 @@ public class RemainBoardList {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Schema(description = "余料板ID")
|
||||
private Long remainId;
|
||||
|
||||
|
||||
@Schema(description = "商品 ID-大板的实际ID")
|
||||
private String goodsId;
|
||||
|
||||
|
||||
@Schema(description = "商品名称")
|
||||
private String goodsName;
|
||||
|
||||
|
||||
|
||||
|
||||
@Schema(description = "价格")
|
||||
private BigDecimal price;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "规格")
|
||||
private String spec;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private Boolean isRealCuttingBoard;
|
||||
|
||||
|
||||
|
||||
private String cutKnifeName;
|
||||
|
||||
|
||||
|
||||
private String placeBoardJSON;
|
||||
|
||||
|
||||
|
||||
private Integer usedCount;
|
||||
|
||||
|
||||
private BigDecimal avgUsageRateAll;
|
||||
|
||||
|
||||
private BigDecimal avgUsageRateExcludeLastBoard;
|
||||
|
||||
|
||||
private BigDecimal usageRateLastBoard;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+4
-4
@@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@@ -17,10 +18,9 @@ public class SavePlanPlateResultReqVO {
|
||||
private List<OptimizeBoardModelDO> optimizeBoardModelDOS;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "优化后的余料板数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<OptimizeRemainPlate> optimizeRemainPlates;
|
||||
|
||||
@Schema(description = "方案组的配置项ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "方案组的配置项ID不能为空")
|
||||
private Long planConfigId;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.saveOptimize;
|
||||
|
||||
|
||||
import com.cf.imes.framework.es.core.dal.ESDocument;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author 保存加工方案组信息
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SaveProcessSchemeModelDO extends ESDocument {
|
||||
|
||||
|
||||
@Schema(description = "排单ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long planId;
|
||||
|
||||
|
||||
@Schema(description = "是否已经优化", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Boolean isOptimized;
|
||||
|
||||
|
||||
@Schema(description = "加工方案组的配置项ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long planConfigId;
|
||||
|
||||
|
||||
@Schema(description = "配置项的名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String planName;
|
||||
|
||||
|
||||
@Schema(description = "大板数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Integer goodsNum;
|
||||
|
||||
|
||||
@Schema(description = "小板数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long plateNum;
|
||||
|
||||
|
||||
@Schema(description = "机台类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Integer machineType;
|
||||
|
||||
|
||||
@Schema(description = "优化信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String setting;
|
||||
|
||||
|
||||
@Schema(description = "排单对应的优化生产的优化数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String planOptimize;
|
||||
|
||||
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.saveOptimize;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
public class SaveProcessSchemeReqVO {
|
||||
|
||||
|
||||
@Schema(description = "方案组ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "方案组的ID不能为空")
|
||||
private Long processId;
|
||||
|
||||
|
||||
@Schema(description = "方案组保存的优化信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "方案组保存的优化信息不能为空")
|
||||
private List<SaveProcessSchemeModelDO> modelDOList;
|
||||
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class AdvancedScreeningConfig {
|
||||
|
||||
|
||||
@Schema(description = "MySQL筛选的条件-板材的筛选数据")
|
||||
private String plateDataFilter;
|
||||
|
||||
|
||||
@Schema(description = "连接两个条件的逻辑运算符")
|
||||
private String logicalOperator;
|
||||
|
||||
|
||||
@Schema(description = "ES筛选的条件-造型的筛选数据")
|
||||
private String modelDataFilter;
|
||||
|
||||
|
||||
// @Valid
|
||||
// @Data
|
||||
// public static class FilterCriteria {
|
||||
//
|
||||
// // 条件字段名
|
||||
// private String fieldKey;
|
||||
//
|
||||
// // 逻辑运算符
|
||||
// private String operator;
|
||||
//
|
||||
// // 值
|
||||
// private String fieldValue;
|
||||
//
|
||||
// // 连接下一个判断的逻辑运算符
|
||||
// private String nextOperator;
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||
|
||||
|
||||
import com.cf.imes.framework.es.core.valid.CreateGroup;
|
||||
import com.cf.imes.framework.es.core.valid.UpdateGroup;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "智能分线创建排单")
|
||||
@Data
|
||||
public class BranchingPlanSaveReqVO {
|
||||
|
||||
|
||||
@Schema(description = "机台 ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "机台 ID不能为空")
|
||||
private Long machineId;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "生产单id与商品id 列表,修改排单时,只传入新增的那一部分",requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Valid
|
||||
private List<BranchingPlanSaveReqVO.Item> itemList;
|
||||
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "生产单的商品id")
|
||||
@NotNull(message = "生产单数据错误,请检查生产单数据或重新导入,排单创建失败",groups = {UpdateGroup.class, CreateGroup.class})
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "生产单id")
|
||||
@NotNull(message = "生产单数据错误,请检查生产单数据或重新导入,排单创建失败",groups = {UpdateGroup.class, CreateGroup.class})
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "板材库大板id")
|
||||
@NotNull(message = "生产单数据错误,请检查生产单数据或重新导入,排单创建失败",groups = {UpdateGroup.class, CreateGroup.class})
|
||||
private String goodsId;
|
||||
|
||||
@Schema(description = "余料板ID")
|
||||
private Long remainPlateId;
|
||||
|
||||
}
|
||||
}
|
||||
+13
-5
@@ -3,26 +3,26 @@ package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.Setter;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 生产单商品表")
|
||||
@Data
|
||||
@Setter
|
||||
public class GoodsReqVO {
|
||||
|
||||
|
||||
@Schema(description = "主键-大板分类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4109")
|
||||
private Long id;
|
||||
|
||||
|
||||
@Schema(description = "余料板ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4109")
|
||||
private Long remainId;
|
||||
|
||||
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "12114")
|
||||
private Long orderId;
|
||||
|
||||
@@ -53,7 +53,7 @@ public class GoodsReqVO {
|
||||
@Schema(description = "厚度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private BigDecimal thickness;
|
||||
|
||||
@Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "7305")
|
||||
@Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "品牌", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@@ -62,9 +62,17 @@ public class GoodsReqVO {
|
||||
@Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜")
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "大板对应的小板数量")
|
||||
private Long plateNum;
|
||||
|
||||
@Schema(description = "大板对应的小板平方数")
|
||||
private BigDecimal plateArea;
|
||||
|
||||
@Schema(description = "生产单商品列表")
|
||||
private List<GoodsReqVO> goodsReqVOS;
|
||||
|
||||
|
||||
@Schema(description = "创建人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
|
||||
+2
@@ -48,6 +48,8 @@ public class OrderGoodsResp {
|
||||
@Schema(description = "生产单信息")
|
||||
private List<OrderRespVOCopy> orderList;
|
||||
|
||||
@Schema(description = "随机数据-唯一标识")
|
||||
private String sort;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+10
-5
@@ -8,6 +8,7 @@ import org.hibernate.validator.constraints.Length;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.Pattern;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
@@ -83,17 +84,21 @@ public class OrderPageReqVOCopy extends PageParam {
|
||||
private BigDecimal widthMaxRang;
|
||||
|
||||
|
||||
// todo 目前商品ID的数据筛选只解决了非混单的情况(非混单,数据类型为Long即可,混单情况需要改变),混单数据筛选待解决
|
||||
@Schema(description = "商品ID-板材库对应的大板ID")
|
||||
private String goodsId;
|
||||
@Schema(description = "商品ID-板材库对应的大板ID-由板材查询生产单时传")
|
||||
@Size(max = 20,message = "最多可同时查询20个板材")
|
||||
private List<String> goodsId;
|
||||
|
||||
@Schema(description = "排单ID-修改排单时为必传条件")
|
||||
private Long planId;
|
||||
|
||||
@Schema(description = "大板分类ID")
|
||||
private List<Long> ids;
|
||||
@Schema(description = "房间ID")
|
||||
private List<Long> roomId;
|
||||
|
||||
@Schema(description = "柜体ID")
|
||||
private List<Long> bodyId;
|
||||
|
||||
@Schema(description = "生产单ids")
|
||||
@Size(max = 20,message = "最多可同时查询20个生产单")
|
||||
private List<Long> orderIds;
|
||||
|
||||
}
|
||||
|
||||
+2
-6
@@ -41,20 +41,16 @@ public class OrderRespVOCopy {
|
||||
@Schema(description = "更新时间")
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private Date updateTime;
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private Date createTime;
|
||||
@Schema(description = "片数")
|
||||
private int num;
|
||||
@Schema(description = "平方")
|
||||
private BigDecimal area = new BigDecimal("0");
|
||||
@Schema(description = "商品id")
|
||||
private String goodsId;
|
||||
// @Schema(description = "商品名称")
|
||||
// private String goodsName;
|
||||
|
||||
@Schema(description = "订单对应的板件的信息")
|
||||
private List<PlatePage> platePages;
|
||||
|
||||
// @Schema(description = "颜色")
|
||||
// private String color;
|
||||
// @Schema(description = "材质:颗粒板、欧松板、多层板、生态板、禾香板、密度板、实木、铝蜂窝板、铝塑板")
|
||||
// private String material;
|
||||
}
|
||||
+1
-3
@@ -1,10 +1,8 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -23,7 +21,7 @@ public class PlanOrderRespVO {
|
||||
private Long planId;
|
||||
|
||||
@Schema(description = "生产单日期")
|
||||
@NotNull(message = "交付日期不能为空")
|
||||
@NotNull(message = "生产单日期不能为空")
|
||||
private LocalDateTime orderDate;
|
||||
|
||||
@Schema(description = "交付日期")
|
||||
|
||||
+5
-7
@@ -1,7 +1,6 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.module.executor.validation.plan.PlanStatusValid;
|
||||
import com.cf.imes.module.executor.validation.plan.PlanTypeValid;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -12,6 +11,7 @@ import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@@ -34,16 +34,14 @@ public class PlanPageReqVO extends PageParam {
|
||||
@Schema(description = "排序优先级")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "排单类型:1 混单排单,2 生产单排单", example = "2")
|
||||
@Schema(description = "排单类型:1 混单排单,2 生产单排单")
|
||||
@PlanTypeValid
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "排单状态:0 未开料,1 开料中,2 已开料", example = "1")
|
||||
@PlanStatusValid
|
||||
private Integer status;
|
||||
@Schema(description = "排单状态:0 未开料,1 开料中,2 已开料")
|
||||
// @PlanStatusValid
|
||||
private List<Integer> status;
|
||||
|
||||
// @Schema(description = "是否支付:0 否,1 是")
|
||||
// private Boolean isPay;
|
||||
|
||||
@Schema(description = "机台 ID", example = "16707")
|
||||
private Long machineId;
|
||||
|
||||
+11
-9
@@ -19,7 +19,7 @@ public class PlanRespVO {
|
||||
|
||||
@Schema(description = "排序优先级", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("排序优先级")
|
||||
private Integer sort;
|
||||
private Long sort;
|
||||
|
||||
@Schema(description = "排单类型:1 混单排单,2 生产单排单", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("排单类型:1 混单排单,2 生产单排单")
|
||||
@@ -29,14 +29,16 @@ public class PlanRespVO {
|
||||
@ExcelProperty("排单状态:0 新单,1 板材已申请,2 开料中,3 已开料")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "板材过滤条件")
|
||||
private String filter;
|
||||
|
||||
@Schema(description = "机台 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16707")
|
||||
@ExcelProperty("机台 ID")
|
||||
private Long machineId;
|
||||
@Schema(description = "方案 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16707")
|
||||
@ExcelProperty("方案 ID")
|
||||
private Long processId;
|
||||
|
||||
@Schema(description = "机台 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16707")
|
||||
@ExcelProperty("机台 名称")
|
||||
private String machineName;
|
||||
@Schema(description = "方案 名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "16707")
|
||||
@ExcelProperty("方案 名称")
|
||||
private String processName;
|
||||
|
||||
@Schema(description = "计划时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("计划时间")
|
||||
@@ -73,8 +75,8 @@ public class PlanRespVO {
|
||||
private LocalDateTime produceTime;
|
||||
|
||||
|
||||
@Schema(description = "优化大板片数")
|
||||
private Long optimizeGoodsCount;
|
||||
@Schema(description = "大板总数")
|
||||
private Long goodsCount;
|
||||
|
||||
|
||||
@Schema(description = "已开料的大板片数")
|
||||
|
||||
+28
-61
@@ -1,94 +1,61 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||
|
||||
import com.cf.imes.framework.es.core.valid.CreateGroup;
|
||||
import com.cf.imes.framework.es.core.valid.UpdateGroup;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.OrderPlateIds;
|
||||
import com.cf.imes.module.executor.validation.plan.PlanStatusValid;
|
||||
import com.cf.imes.module.executor.validation.plan.PlanTypeValid;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 生产单开料排单新增/修改 Request VO")
|
||||
@Data
|
||||
public class PlanSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "排单数据异常,请重新操作",groups = UpdateGroup.class)
|
||||
@Schema(description = "ID")
|
||||
// @NotNull(message = "排单数据异常,请重新操作",groups = UpdateGroup.class)
|
||||
@Max(value = 0x7fffffffffffffffL,message = "排单号异常,无法更新排单数据")
|
||||
private Long id;
|
||||
|
||||
|
||||
@Schema(description = "排序优先级")
|
||||
private Long sort;
|
||||
@Schema(description = "是否开启混单", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Boolean isMix;
|
||||
|
||||
|
||||
@Schema(description = "排单类型:1 混单排单,2 生产单排单", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "排单类型:1 混单排单,2 生产单排单不能为空", groups = CreateGroup.class)
|
||||
@PlanTypeValid
|
||||
private Integer type;
|
||||
|
||||
|
||||
@Schema(description = "排单状态:0 未开料,1 开料中,2 已开料", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "排单状态:0 未开料,1 开料中,2 已开料 不能为空", groups = CreateGroup.class)
|
||||
@Schema(description = "排单状态:0 未开料,1 开料中,2 已开料,3 已投产")
|
||||
// @NotNull(message = "排单状态:0 未开料,1 已投产,2 开料中,3 已开料", groups = UpdateGroup.class)
|
||||
@PlanStatusValid
|
||||
private Integer status;
|
||||
|
||||
|
||||
@Schema(description = "机台 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16707")
|
||||
@NotNull(message = "机台 ID不能为空")
|
||||
private Long machineId;
|
||||
@Schema(description = "需要进行排单的板材信息")
|
||||
private SavePlanPlateList savePlanPlateList;
|
||||
|
||||
|
||||
@Schema(description = "计划时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime planTime;
|
||||
@Schema(description = "方案ID")
|
||||
private Long processId;
|
||||
|
||||
|
||||
@Schema(description = "新增的小板ID")
|
||||
private List<OrderPlateIds> insertOrderPlateIds;
|
||||
|
||||
|
||||
@Schema(description = "去除的小板ID")
|
||||
private List<OrderPlateIds> deleteOrderPlateIds;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "备注")
|
||||
@Length(max = 255, message = "备注长度不能超过255个字符")
|
||||
private String remark;
|
||||
|
||||
// @Schema(description = "排单类型:1 混单排单,2 生产单排单", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// @NotNull(message = "排单类型:1 混单排单,2 生产单排单不能为空", groups = CreateGroup.class)
|
||||
// @PlanTypeValid
|
||||
// private Integer type;
|
||||
|
||||
|
||||
@Schema(description = "生产操作人")
|
||||
private String operator;
|
||||
|
||||
// @Schema(description = "板材过滤条件")
|
||||
// @Size(max = 7,message = "板材过滤条件数量不正确")
|
||||
// private List<String> filter;
|
||||
|
||||
|
||||
@Schema(description = "生产时间")
|
||||
private LocalDateTime produceTime;
|
||||
|
||||
|
||||
@Schema(description = "生产单id与商品id 列表,修改排单时,只传入新增的那一部分",requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Valid
|
||||
private List<Item> itemList;
|
||||
|
||||
|
||||
@Schema(description = "去除的大板分类ID")
|
||||
private List<Long> deleteIds;
|
||||
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "生产单的商品id")
|
||||
@NotNull(message = "生产单数据错误,请检查生产单数据或重新导入,排单创建失败",groups = {UpdateGroup.class, CreateGroup.class})
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "生产单id")
|
||||
@NotNull(message = "生产单数据错误,请检查生产单数据或重新导入,排单创建失败",groups = {UpdateGroup.class, CreateGroup.class})
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "板材库大板id")
|
||||
@NotNull(message = "生产单数据错误,请检查生产单数据或重新导入,排单创建失败",groups = {UpdateGroup.class, CreateGroup.class})
|
||||
private String goodsId;
|
||||
|
||||
@Schema(description = "余料板ID")
|
||||
private Long remainPlateId;
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -10,7 +10,7 @@ import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 生产单板件 Response VO")
|
||||
@Data
|
||||
public class PlateDetialRespVO {
|
||||
public class PlateDetailRespVO {
|
||||
|
||||
@Schema(description = "板件ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long plateId;
|
||||
@@ -49,6 +49,8 @@ public class PlateDetialRespVO {
|
||||
@Schema(description = "板编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String plateNo;
|
||||
|
||||
@Schema(description = "自定义板编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String customPlateNo;
|
||||
|
||||
@Schema(description = "板名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String name;
|
||||
+18
-4
@@ -8,10 +8,16 @@ import java.math.BigDecimal;
|
||||
@Data
|
||||
public class PlateResList {
|
||||
|
||||
@Schema(description = "排单ID")
|
||||
private Long planId;
|
||||
@Schema(description = "板材id")
|
||||
private Long plateId;
|
||||
@Schema(description = "板材库大板id-大板的实际ID")
|
||||
private String goodsId;
|
||||
@Schema(description = "生产单id")
|
||||
private Long orderId;
|
||||
@Schema(description = "大板的分类ID")
|
||||
private Long id;
|
||||
@Schema(description = "房间id")
|
||||
private Long roomId;
|
||||
@Schema(description = "房间名称")
|
||||
@@ -20,18 +26,20 @@ public class PlateResList {
|
||||
private Long bodyId;
|
||||
@Schema(description = "柜体名称")
|
||||
private String bodyName;
|
||||
@Schema(description = "自定义板材编号")
|
||||
@Schema(description = "板编号")
|
||||
private String plateNo;
|
||||
@Schema(description = "自定义板编号")
|
||||
private String customPlateNo;
|
||||
@Schema(description = "板材名称")
|
||||
private String plateName;
|
||||
@Schema(description = "商品颜色")
|
||||
private String color;
|
||||
@Schema(description = "小板宽")
|
||||
private String width;
|
||||
private BigDecimal width;
|
||||
@Schema(description = "小板高")
|
||||
private String height;
|
||||
private BigDecimal height;
|
||||
@Schema(description = "小板厚")
|
||||
private String thickness;
|
||||
private BigDecimal thickness;
|
||||
@Schema(description = "面积")
|
||||
private BigDecimal area;
|
||||
@Schema(description = "左封边厚度")
|
||||
@@ -46,6 +54,12 @@ public class PlateResList {
|
||||
private Boolean isSpecialShaped;
|
||||
@Schema(description = "是否造型")
|
||||
private Boolean isSculpt;
|
||||
@Schema(description = "是否排孔")
|
||||
private Boolean isRowHole;
|
||||
@Schema(description = "材质")
|
||||
private String material;
|
||||
@Schema(description = "纹路")
|
||||
private Boolean texture;
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
}
|
||||
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||
|
||||
import com.cf.imes.framework.es.core.valid.CreateGroup;
|
||||
import com.cf.imes.framework.es.core.valid.UpdateGroup;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class SavePlanPlateList {
|
||||
|
||||
|
||||
|
||||
@Schema(description = "小板的信息列表",requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Valid
|
||||
private List<SavePlanPlateList.PlateItemList> plateItemList;
|
||||
|
||||
|
||||
@Schema(description = "大板的信息列表",requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Valid
|
||||
private List<SavePlanPlateList.GoodsItemList> goodsItemList;
|
||||
|
||||
|
||||
|
||||
|
||||
@Data
|
||||
public static class PlateItemList {
|
||||
|
||||
@Schema(description = "生产单id")
|
||||
@NotNull(message = "生产单数据错误,请检查生产单数据或重新导入,排单创建失败",groups = {UpdateGroup.class, CreateGroup.class})
|
||||
private Long plateId;
|
||||
|
||||
@Schema(description = "生产单的商品id")
|
||||
@NotNull(message = "生产单数据错误,请检查生产单数据或重新导入,排单创建失败",groups = {UpdateGroup.class, CreateGroup.class})
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "生产单id")
|
||||
@NotNull(message = "生产单数据错误,请检查生产单数据或重新导入,排单创建失败",groups = {UpdateGroup.class, CreateGroup.class})
|
||||
private Long orderId;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Data
|
||||
public static class GoodsItemList {
|
||||
|
||||
|
||||
@Schema(description = "生产单的商品id")
|
||||
@NotNull(message = "生产单数据错误,请检查生产单数据或重新导入,排单创建失败",groups = {UpdateGroup.class, CreateGroup.class})
|
||||
private Long id;
|
||||
|
||||
|
||||
@Schema(description = "板材库大板id-这个在新版还是需要的")
|
||||
@NotNull(message = "生产单数据错误,请检查生产单数据或重新导入,排单创建失败",groups = {UpdateGroup.class, CreateGroup.class})
|
||||
private String goodsId;
|
||||
|
||||
|
||||
@Schema(description = "大板的材质")
|
||||
private String material;
|
||||
|
||||
|
||||
@Schema(description = "大板的厚度")
|
||||
private Integer thickness;
|
||||
|
||||
|
||||
@Schema(description = "大板的颜色")
|
||||
private String color;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class SavePlanPlateResult {
|
||||
|
||||
@NotNull(message = "排单id")
|
||||
@Schema(description = "排单id")
|
||||
private Long planId;
|
||||
|
||||
@Schema(description = "文件附件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "文件附件不能为空")
|
||||
private MultipartFile placeOrder;
|
||||
|
||||
@Schema(description = "文件附件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "文件附件不能为空")
|
||||
private MultipartFile placeData;
|
||||
}
|
||||
|
||||
+5
-1
@@ -12,7 +12,7 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
@Valid
|
||||
public class SortVO {
|
||||
@Schema(description = "排单id")
|
||||
@Schema(description = "排单id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "排单id 不能空")
|
||||
private Long planId;
|
||||
|
||||
@@ -20,4 +20,8 @@ public class SortVO {
|
||||
@NotNull(message = "排序不能空")
|
||||
private Long sort;
|
||||
|
||||
@Schema(description = "是否置顶", requiredMode = Schema.RequiredMode.REQUIRED,example = "false")
|
||||
// @NotNull(message = "是否置顶不能空")
|
||||
private Boolean isTopUp;
|
||||
|
||||
}
|
||||
|
||||
+21
-5
@@ -6,8 +6,10 @@ import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.excel.core.util.ExcelUtils;
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateGoodDO;
|
||||
import com.cf.imes.module.executor.service.plate.PlateService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@@ -76,13 +78,27 @@ public class PlateController {
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得生产单板件分页")
|
||||
@PreAuthorize("@ss.hasPermission('executor:plate:query')")
|
||||
public CommonResult<PageResult<PlateRespVO>> getPlatePage(@Valid PlatePageReqVO pageReqVO) {
|
||||
PageResult<PlateDO> pageResult = plateService.getPlatePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PlateRespVO.class));
|
||||
@Operation(summary = "未排单获取实际板材")
|
||||
// @PreAuthorize("@ss.hasPermission('executor:plate:query')")
|
||||
public CommonResult<PageResult<PlateGoodDO>> getGoodsPlate(@Valid GoodsPlateFilterPageReqVO pageReqVO) {
|
||||
|
||||
return success(plateService.getGoodsPlate(pageReqVO));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/getPlatePage")
|
||||
@Operation(summary = "获取未排单的生产单板件")
|
||||
// @PreAuthorize("@ss.hasPermission('executor:plate:query')")
|
||||
public CommonResult<PageResult<PlateResList>> getPlatePage(@Valid NoPlanPlatePageReqVO reqVO) {
|
||||
|
||||
return success(plateService.getOrderPlatePage(reqVO));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出生产单板件 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('executor:plate:export')")
|
||||
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plate.vo;
|
||||
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.validation.NumberValid;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author 分页
|
||||
*/
|
||||
@Schema(description = "未排单查询实际板材分页")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class GoodsPlateFilterPageReqVO extends PageParam {
|
||||
|
||||
|
||||
@Schema(description = "排单ID",requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "排单ID不能为空")
|
||||
private Long planId;
|
||||
|
||||
|
||||
@Schema(description = "厚度",requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "厚度不能为空")
|
||||
private BigDecimal thickness;
|
||||
|
||||
|
||||
@Schema(description = "材质",requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "材质不能为空")
|
||||
private String material;
|
||||
|
||||
|
||||
@Schema(description = "颜色",requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "颜色不能为空")
|
||||
private String color;
|
||||
|
||||
|
||||
@Schema(description = "大板的实际ID")
|
||||
private String goodsIds;
|
||||
|
||||
|
||||
@Schema(description = "商品名称")
|
||||
private String goodsName;
|
||||
|
||||
@Schema(description = "选择实际板材的颜色字段")
|
||||
private String filterColor;
|
||||
|
||||
|
||||
@Schema(description = "是否有纹路")
|
||||
private Boolean texture;
|
||||
|
||||
|
||||
@Schema(description = "规格")
|
||||
private String spec;
|
||||
|
||||
|
||||
@Schema(description = "长 小范围")
|
||||
@NumberValid(name = "长度")
|
||||
private BigDecimal longMinRang;
|
||||
|
||||
|
||||
@Schema(description = "长 大范围")
|
||||
@NumberValid(name = "长度")
|
||||
private BigDecimal longMaxRang;
|
||||
|
||||
|
||||
@Schema(description = "宽 小范围")
|
||||
@NumberValid(name = "宽度")
|
||||
private BigDecimal widthMinRang;
|
||||
|
||||
|
||||
@Schema(description = "宽 大范围")
|
||||
@NumberValid(name = "宽度")
|
||||
private BigDecimal widthMaxRang;
|
||||
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plate.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class KaiLiaoSize {
|
||||
private Double width;
|
||||
private Double height;
|
||||
}
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plate.vo;
|
||||
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.validation.NumberValid;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class NoPlanPlatePageReqVO extends PageParam {
|
||||
|
||||
|
||||
@Schema(description = "生产单id")
|
||||
@Pattern(regexp = "^[0-9]*$",message = "生产单号必须为数字")
|
||||
@Length(max = 19,message = "生产单号长度不能超过19位")
|
||||
private String orderId;
|
||||
|
||||
|
||||
@Schema(description = "板编号")
|
||||
private String plateNo;
|
||||
|
||||
@Schema(description = "大板")
|
||||
private List<Long> goodsIdList;
|
||||
|
||||
@Schema(description = "板号-小板ID")
|
||||
private String plateId;
|
||||
|
||||
|
||||
@Schema(description = "自定义板编号")
|
||||
private String customPlateNo;
|
||||
|
||||
|
||||
@Schema(description = "材质-在排单界面添加板材时为必传的")
|
||||
private String material;
|
||||
|
||||
|
||||
@Schema(description = "颜色-在排单界面添加板材时为必传的")
|
||||
private String color;
|
||||
|
||||
|
||||
@Schema(description = "厚度-在排单界面添加板材时为必传的")
|
||||
private Integer thickness;
|
||||
|
||||
|
||||
@Schema(description = "板名称")
|
||||
private String name;
|
||||
|
||||
|
||||
@Schema(description = "长 小范围")
|
||||
@NumberValid(name = "长度")
|
||||
private BigDecimal longMinRang;
|
||||
|
||||
|
||||
@Schema(description = "长 大范围")
|
||||
@NumberValid(name = "长度")
|
||||
private BigDecimal longMaxRang;
|
||||
|
||||
|
||||
@Schema(description = "宽 小范围")
|
||||
@NumberValid(name = "宽度")
|
||||
private BigDecimal widthMinRang;
|
||||
|
||||
|
||||
@Schema(description = "宽 大范围")
|
||||
@NumberValid(name = "宽度")
|
||||
private BigDecimal widthMaxRang;
|
||||
|
||||
|
||||
@Schema(description = "厚 小范围")
|
||||
@NumberValid(name = "厚度")
|
||||
private BigDecimal thicknessMinRang;
|
||||
|
||||
|
||||
@Schema(description = "厚 大范围")
|
||||
@NumberValid(name = "厚度")
|
||||
private BigDecimal thicknessMaxRang;
|
||||
|
||||
|
||||
@Schema(description = "纹路")
|
||||
private Boolean texture;
|
||||
|
||||
|
||||
@Schema(description = "异形")
|
||||
private Boolean isSpecialShaped;
|
||||
|
||||
|
||||
@Schema(description = "造型")
|
||||
private Boolean isSculpt;
|
||||
|
||||
|
||||
@Schema(description = "是否排孔")
|
||||
private Boolean isRowHole;
|
||||
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plate.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class OffSet {
|
||||
private Integer x;
|
||||
private Integer y;
|
||||
private Integer z;
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plate.vo;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - 查询板件")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class OrderPlateIds {
|
||||
|
||||
|
||||
@Schema(description = "大板ID-大板分类的ID")
|
||||
private Long id;
|
||||
|
||||
|
||||
@Schema(description = "生产单ID")
|
||||
private Long orderId;
|
||||
|
||||
|
||||
@Schema(description = "板材ID")
|
||||
private Long plateId;
|
||||
|
||||
|
||||
@Schema(description = "删除和添加小板时传入")
|
||||
private Long planId;
|
||||
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plate.vo;
|
||||
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList;
|
||||
import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderModelDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author 未排单的小板和造型的信息
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class PlateModelDetailRespVO {
|
||||
|
||||
|
||||
@Schema(description = "未排单的小板的信息数据")
|
||||
private PageResult<PlateResList> plateResLists;
|
||||
|
||||
|
||||
@Schema(description = "小板造型列表")
|
||||
private List<OrderModelDO> plateModels;
|
||||
|
||||
|
||||
}
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plate.vo;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - 查询板件")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class ProcessPlateReqVO {
|
||||
|
||||
|
||||
@Schema(description = "工序类型",requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long processType;
|
||||
|
||||
|
||||
@Schema(description = "生产单号",requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long orderId;
|
||||
|
||||
|
||||
@Schema(description = "工序明细ID",requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long stepItemId;
|
||||
|
||||
|
||||
@Schema(description = "柜体ID")
|
||||
private Long bodyId;
|
||||
|
||||
|
||||
|
||||
}
|
||||
+6
@@ -17,6 +17,9 @@ import java.util.List;
|
||||
public class CutedBoardInfo {
|
||||
|
||||
|
||||
@Schema(description = "实际开料的大板ID")
|
||||
private String goodsId;
|
||||
|
||||
@Schema(description = "已开料大板数量")
|
||||
private Long cutedBoardNumber;
|
||||
|
||||
@@ -25,4 +28,7 @@ public class CutedBoardInfo {
|
||||
private List<Long> cutedBoardList;
|
||||
|
||||
|
||||
@Schema(description = "开料中的大板编号")
|
||||
private List<Long> cutedBoardIsCuttingList;
|
||||
|
||||
}
|
||||
|
||||
+29
-3
@@ -2,6 +2,7 @@ package com.cf.imes.module.executor.dal.dataobject.goods;
|
||||
|
||||
|
||||
import com.cf.imes.framework.es.core.dal.ESDocument;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.ActualGoodsList;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.RemainBoardList;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -30,21 +31,44 @@ public class OptimizeBoardModelDO extends ESDocument {
|
||||
private List<Long> orderId;
|
||||
|
||||
|
||||
@Schema(description = "大板的实际ID")
|
||||
private String goodsId;
|
||||
@Schema(description = "方案组的配置项ID")
|
||||
private Long planConfigId;
|
||||
|
||||
|
||||
@Schema(description = "方案组的配置项名称")
|
||||
private String planConfigName;
|
||||
|
||||
|
||||
@Schema(description = "是否锁定排单")
|
||||
private Boolean isLock;
|
||||
|
||||
|
||||
@Schema(description = "实际的开料的大板的ID")
|
||||
@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
|
||||
private List<String> goodsId;
|
||||
|
||||
|
||||
@Schema(description = "原板材信息的大板ID")
|
||||
@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
|
||||
private List<String> mixGoodsIds;
|
||||
|
||||
|
||||
@Schema(description = "生产单已优化小板数量")
|
||||
private Long placeBlockNumber;
|
||||
|
||||
|
||||
@Schema(description = "已开料大板数量")
|
||||
private Long cutedBoardNumber;
|
||||
|
||||
|
||||
// 新的数据集需要去除
|
||||
@Schema(description = "排单优化的大板数量")
|
||||
private Long placeBoardNumber;
|
||||
|
||||
|
||||
@Schema(description = "已开料大板数据集")
|
||||
private CutedBoardInfo cutedBoardInfo;
|
||||
@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
|
||||
private List<CutedBoardInfo> cutedBoardInfo;
|
||||
|
||||
|
||||
@Schema(description = "大板原长")
|
||||
@@ -147,6 +171,8 @@ public class OptimizeBoardModelDO extends ESDocument {
|
||||
private List<RemainBoardList> remainBoardList;
|
||||
|
||||
|
||||
@Schema(description = "大板板材列表-实际的开料的大板信息")
|
||||
private List<ActualGoodsList> actualGoodsList;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+19
@@ -43,10 +43,23 @@ public class PlanDO extends BaseDO {
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 板材过滤条件
|
||||
*/
|
||||
private String filter;
|
||||
|
||||
|
||||
/**
|
||||
* 机台 ID
|
||||
*/
|
||||
private Long machineId;
|
||||
|
||||
/**
|
||||
* 方案 ID
|
||||
*/
|
||||
private Long processId;
|
||||
|
||||
|
||||
/**
|
||||
* 计划时间
|
||||
*/
|
||||
@@ -69,4 +82,10 @@ public class PlanDO extends BaseDO {
|
||||
*/
|
||||
private LocalDateTime produceTime;
|
||||
|
||||
|
||||
// /**
|
||||
// * 是否置顶( 0:不置顶,1:置顶 )
|
||||
// */
|
||||
// private Boolean isTopUp;
|
||||
|
||||
}
|
||||
+11
-5
@@ -1,9 +1,7 @@
|
||||
package com.cf.imes.module.executor.dal.dataobject.planitem;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 生产单开料排单明细 DO
|
||||
@@ -25,9 +23,17 @@ public class PlanItemDO {
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 明细 ID
|
||||
* 生产单 ID
|
||||
*/
|
||||
private Long itemId;
|
||||
private Long orderId;
|
||||
/**
|
||||
* 小板 ID
|
||||
*/
|
||||
private Long plateId;
|
||||
/**
|
||||
* 大板 ID
|
||||
*/
|
||||
private Long goodsId;
|
||||
/**
|
||||
* 排单 ID
|
||||
*/
|
||||
|
||||
+4
@@ -169,6 +169,10 @@ public class PlateDO extends BaseDO {
|
||||
* 是否优化
|
||||
*/
|
||||
private Boolean isOptimized;
|
||||
/**
|
||||
* 是否开料,0:未开料,1:开料中,2:已开料
|
||||
*/
|
||||
private Integer isCutted;
|
||||
/**
|
||||
* 排单过滤类型,1 有挖穿造型 2 有挖穿孔 4 有二维刀路 8 可叠
|
||||
*/
|
||||
|
||||
+30
-30
@@ -8,8 +8,11 @@ import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.module.executor.controller.admin.goods.vo.GoodsPageReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderGoodsPlateIds;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.bo.OrderRoomBodyList;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.GoodsReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateInfoVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -82,15 +85,20 @@ public interface GoodsMapper extends BaseMapperX<GoodsDO> {
|
||||
|
||||
|
||||
|
||||
default List<GoodsDO> selectListByGoodsId(String goodsId, Long organId) {
|
||||
default List<GoodsDO> selectListByGoodsId(List<Long> orderIds,List<String> goodsIds, Long organId) {
|
||||
return selectList(new LambdaQueryWrapperX<GoodsDO>()
|
||||
.eq(GoodsDO::getOrganId, organId)
|
||||
.eq(GoodsDO::getDeleted, false)
|
||||
.eq(GoodsDO::getPlanId ,0)
|
||||
.eq(GoodsDO::getGoodsId, goodsId));
|
||||
.in(GoodsDO::getOrderId,orderIds)
|
||||
.in(GoodsDO::getGoodsId, goodsIds)
|
||||
.eq(GoodsDO::getDeleted, false));
|
||||
|
||||
}
|
||||
|
||||
|
||||
List<GoodsDO> selectListByGoodsIdList(@Param("goodsId") List<String> goodsId,@Param("organId") Long organId);
|
||||
|
||||
|
||||
|
||||
// 根据生产单删除
|
||||
default int deleteByOrderId(Long orderId, Long organId) {
|
||||
return delete(new LambdaQueryWrapperX<GoodsDO>()
|
||||
@@ -118,11 +126,11 @@ public interface GoodsMapper extends BaseMapperX<GoodsDO> {
|
||||
|
||||
|
||||
|
||||
default List<GoodsDO> selectPlanGoodsList(List<Long> goodsIds, Long organId) {
|
||||
default List<GoodsDO> selectPlanGoodsList(List<Long> ids, Long organId) {
|
||||
return selectList(new LambdaQueryWrapperX<GoodsDO>()
|
||||
.eq(GoodsDO::getOrganId, organId)
|
||||
.eq(GoodsDO::getDeleted, false)
|
||||
.inIfPresent(GoodsDO::getId,goodsIds));
|
||||
.inIfPresent(GoodsDO::getId,ids));
|
||||
|
||||
}
|
||||
|
||||
@@ -132,8 +140,7 @@ public interface GoodsMapper extends BaseMapperX<GoodsDO> {
|
||||
return selectList(new LambdaQueryWrapperX<GoodsDO>()
|
||||
.eq(GoodsDO::getOrganId, organId)
|
||||
.eq(GoodsDO::getDeleted, false)
|
||||
.eqIfPresent(GoodsDO::getPlanId,planId)
|
||||
.select(GoodsDO::getGoodsId,GoodsDO::getId,GoodsDO::getOrderId));
|
||||
.eqIfPresent(GoodsDO::getPlanId,planId));
|
||||
|
||||
}
|
||||
|
||||
@@ -146,17 +153,6 @@ public interface GoodsMapper extends BaseMapperX<GoodsDO> {
|
||||
|
||||
|
||||
|
||||
|
||||
default int deletePlanGoods(List<Long> orderIds,List<Long> ids, Long organId) {
|
||||
return update(new LambdaUpdateWrapper<GoodsDO>()
|
||||
.set(GoodsDO::getPlanId, 0)
|
||||
.eq(GoodsDO::getOrganId, organId)
|
||||
.in(GoodsDO::getOrderId, orderIds)
|
||||
.in(GoodsDO::getPlanId, ids));
|
||||
}
|
||||
|
||||
|
||||
|
||||
default List<GoodsDO> selectPlanGoodsListByPlanIdList(List<Long> orderIds,List<Long> planIds, Long organId) {
|
||||
return selectList(new LambdaQueryWrapperX<GoodsDO>()
|
||||
.eq(GoodsDO::getOrganId, organId)
|
||||
@@ -204,18 +200,22 @@ public interface GoodsMapper extends BaseMapperX<GoodsDO> {
|
||||
List<Long> selectNoPlanOrders(@Param("orderId") Long orderId, @Param("organId") Long organId);
|
||||
|
||||
|
||||
default List<GoodsDO> selectNoPlanOrdersListByOrderIds(List<Long> orderIds, Long organId) {
|
||||
return selectList(new LambdaQueryWrapperX<GoodsDO>()
|
||||
.eq(GoodsDO::getOrganId, organId)
|
||||
.eq(GoodsDO::getDeleted, false)
|
||||
.in(GoodsDO::getOrderId,orderIds)
|
||||
.eq(GoodsDO::getPlanId,0)
|
||||
.select(GoodsDO::getOrderId));
|
||||
|
||||
}
|
||||
|
||||
List<Long> selectOrderPlanList(@Param("orderIds") List<Long> orderIds,@Param("organId") Long organId);
|
||||
|
||||
List<Long> selectPlanOrderListByOrderIds(@Param("orderIds") List<Long> orderIds,@Param("organId") Long organId);
|
||||
|
||||
List<OrderGoodsPlateIds> selectPlateGoodIds(@Param("orderIds") List<Long> orderIds, @Param("organId") Long organId);
|
||||
|
||||
|
||||
default List<GoodsDO> selectOrderGoodsList(List<Long> orderIds, List<String> goodsIds, Long organId) {
|
||||
return selectList(new LambdaQueryWrapperX<GoodsDO>()
|
||||
.eq(GoodsDO::getOrganId, organId)
|
||||
.eq(GoodsDO::getDeleted, false)
|
||||
// .eq(GoodsDO::getPlanId,0)
|
||||
.in(GoodsDO::getOrderId,orderIds)
|
||||
.in(GoodsDO::getGoodsId,goodsIds)
|
||||
.select(GoodsDO::getId));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+16
-5
@@ -15,10 +15,7 @@ import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderCountPro
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderOverdueRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPageReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.bo.OrderIds;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.OrderGoodsResp;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.OrderPageReqVOCopy;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.OrderRespVOCopy;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlanOrderRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.enums.OrderDeletedEnum;
|
||||
import com.cf.imes.module.executor.enums.OrderStatusEnum;
|
||||
@@ -150,7 +147,7 @@ public interface OrderMapper extends BaseMapperX<OrderDO> {
|
||||
}
|
||||
|
||||
|
||||
List<OrderRespVOCopy> selectOrderListByIds(@Param("orderIds") List<OrderIds> orderIds, @Param("organId") Long organId);
|
||||
List<OrderRespVOCopy> selectOrderListByIds(@Param("orderIds") List<Long> orderIds, @Param("organId") Long organId);
|
||||
|
||||
IPage<OrderGoodsResp> selectOrderIds(@Param("page") IPage page, @Param(Constants.WRAPPER) Wrapper<OrderDO> wrapper);
|
||||
|
||||
@@ -282,4 +279,18 @@ public interface OrderMapper extends BaseMapperX<OrderDO> {
|
||||
|
||||
|
||||
List<PlanOrderRespVO> selectPlanOrderList(@Param("planIds") List<Long> planIds, @Param("organId") Long organId);
|
||||
|
||||
|
||||
IPage<OrderRespVOCopy> selectFilterOrderPagePlate(@Param("page") IPage page, @Param(Constants.WRAPPER) Wrapper<OrderDO> wrapper);
|
||||
|
||||
List<Long> selectFilterOrderPlateList(@Param(Constants.WRAPPER) QueryWrapperX<OrderDO> queryWrapperX);
|
||||
|
||||
List<OrderIds> selectFilterGoodsPlateList(@Param(Constants.WRAPPER) QueryWrapperX<OrderDO> queryWrapperX);
|
||||
|
||||
IPage<OrderGoodsResp> selectFilterGoodsPlatePage(@Param("page") IPage page,@Param(Constants.WRAPPER) QueryWrapperX<OrderDO> queryWrapperX);
|
||||
|
||||
|
||||
Long selectNoPlanOrderPlateCount(@Param(Constants.WRAPPER) Wrapper<OrderDO> wrapper);
|
||||
|
||||
List<PlateResList> selectNoPlanOrderPlateList(@Param(Constants.WRAPPER) Wrapper<OrderDO> wrapper,@Param("pageNo") Integer pageNo,@Param("pageSize") Integer pageSize);
|
||||
}
|
||||
|
||||
+15
@@ -1,9 +1,15 @@
|
||||
package com.cf.imes.module.executor.dal.mysql.orderGroup;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.module.executor.api.plan.vo.OrderGroupRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.bo.OrderIds;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.OrderGoodsResp;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.OrderRespVOCopy;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderGroup.OrderGroupDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -137,4 +143,13 @@ public interface OrderGroupMapper extends BaseMapperX<OrderGroupDO> {
|
||||
.eq(OrderGroupDO::getDeleted, deleted)
|
||||
.eq(OrderGroupDO::getOrganId, organId));
|
||||
}
|
||||
|
||||
IPage<OrderRespVOCopy> selectFilterOrderPagePlate(@Param("page") IPage page, @Param(Constants.WRAPPER) Wrapper<OrderGroupDO> wrapper);
|
||||
|
||||
List<Long> selectFilterOrderPlateList( @Param(Constants.WRAPPER) Wrapper<OrderGroupDO> wrapper);
|
||||
|
||||
IPage<OrderGoodsResp> selectFilterGoodsPagePlate(@Param("page") IPage page, @Param(Constants.WRAPPER) Wrapper<OrderGroupDO> wrapper);
|
||||
|
||||
List<OrderIds> selectFilterGoodsPlateList(@Param(Constants.WRAPPER) Wrapper<OrderGroupDO> wrapper);
|
||||
|
||||
}
|
||||
+19
-6
@@ -5,10 +5,7 @@ import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderStatisticsReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.OrderPlanStatisticsAreaRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.OrderPlanStatisticsCountRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlanPageReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateOptimize;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plan.PlanDO;
|
||||
@@ -36,7 +33,7 @@ public interface PlanMapper extends BaseMapperX<PlanDO> {
|
||||
.eqIfPresent(PlanDO::getId, reqVO.getId())
|
||||
.eqIfPresent(PlanDO::getSort, reqVO.getSort())
|
||||
.eqIfPresent(PlanDO::getType, reqVO.getType())
|
||||
.eqIfPresent(PlanDO::getStatus, reqVO.getStatus())
|
||||
.inIfPresent(PlanDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(PlanDO::getMachineId, reqVO.getMachineId())
|
||||
.betweenIfPresent(PlanDO::getPlanTime, reqVO.getPlanTime())
|
||||
.likeIfPresent(PlanDO::getOrderNos, reqVO.getOrderNos())
|
||||
@@ -58,7 +55,7 @@ public interface PlanMapper extends BaseMapperX<PlanDO> {
|
||||
.eqIfPresent(PlanDO::getId, reqVO.getId())
|
||||
.eqIfPresent(PlanDO::getSort, reqVO.getSort())
|
||||
.eqIfPresent(PlanDO::getType, reqVO.getType())
|
||||
.eqIfPresent(PlanDO::getStatus, reqVO.getStatus())
|
||||
.inIfPresent(PlanDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(PlanDO::getMachineId, reqVO.getMachineId())
|
||||
.betweenIfPresent(PlanDO::getPlanTime, reqVO.getPlanTime())
|
||||
.likeIfPresent(PlanDO::getOrderNos, reqVO.getOrderNos())
|
||||
@@ -118,4 +115,20 @@ public interface PlanMapper extends BaseMapperX<PlanDO> {
|
||||
|
||||
|
||||
|
||||
|
||||
default List<PlanDO> selectPlanListByData(String planData,Long organId) {
|
||||
return selectList( new LambdaQueryWrapperX<PlanDO>()
|
||||
.eq(PlanDO::getOrganId,organId)
|
||||
.eq(PlanDO::getDeleted,false)
|
||||
.eq(PlanDO::getCreateTime,planData));
|
||||
}
|
||||
|
||||
|
||||
default List<PlanDO> selectPlanSortList(List<Integer> status,Long organId) {
|
||||
return selectList( new LambdaQueryWrapperX<PlanDO>()
|
||||
.eq(PlanDO::getOrganId,organId)
|
||||
.eq(PlanDO::getDeleted,false)
|
||||
.in(PlanDO::getStatus,status)
|
||||
.orderByAsc(PlanDO::getSort));
|
||||
}
|
||||
}
|
||||
+39
-1
@@ -1,8 +1,18 @@
|
||||
package com.cf.imes.module.executor.dal.mysql.planitem;
|
||||
package com.cf.imes.module.executor.dal.mysql.planItem;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.OrderPlateIds;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.planitem.PlanItemDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生产单开料排单明细 Mapper
|
||||
@@ -13,4 +23,32 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
public interface PlanItemMapper extends BaseMapperX<PlanItemDO> {
|
||||
|
||||
|
||||
|
||||
IPage<OrderRespVOCopy> selectOrderList(@Param("page") IPage page, @Param(Constants.WRAPPER) Wrapper<OrderDO> wrapper);
|
||||
|
||||
|
||||
|
||||
default List<PlanItemDO> selectPlanPlateList(List<Long> planIds, List<Long> orderIds, Long organId) {
|
||||
return selectList( new LambdaQueryWrapperX<PlanItemDO>()
|
||||
.eq(PlanItemDO::getOrganId, organId)
|
||||
.in(PlanItemDO::getOrderId,orderIds)
|
||||
.in(PlanItemDO::getPlanId,planIds));
|
||||
|
||||
}
|
||||
|
||||
|
||||
List<PlateDetailRespVO> selectPlanPlateDetailList(@Param("planId") Long planId, @Param("organId") Long organId);
|
||||
|
||||
|
||||
List<PlateInfoVO> selectOrderPlanPlateList(@Param("planIds") List<Long> planIds, @Param("organId") Long organId);
|
||||
|
||||
IPage<PlateResList> selectPlateListByPlateIds(@Param("page") IPage<PlateResList> page, @Param(Constants.WRAPPER) Wrapper<PlanItemDO> wrapper);
|
||||
|
||||
IPage<OrderGoodsResp> selectNoPlanGoodsByRoomAndBodyIds(@Param("page") IPage page, @Param(Constants.WRAPPER) Wrapper<PlanItemDO> wrapper);
|
||||
|
||||
IPage<OrderGoodsResp> selectNoPlanGoodsList(@Param("page") IPage page, @Param(Constants.WRAPPER) Wrapper<PlanItemDO> wrapper);
|
||||
|
||||
List<OrderGoodsResp> selectNoOrderGoodsIdList(@Param(Constants.WRAPPER) Wrapper<PlanItemDO> wrapper);
|
||||
|
||||
List<OrderPlateIds> selectPlanIncrementPlate(@Param("noPlanIds") List<Long> noPlanIds,@Param("organId") Long organId);
|
||||
}
|
||||
+35
-1
@@ -1,8 +1,10 @@
|
||||
package com.cf.imes.module.executor.dal.mysql.plate;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.GoodsPlateFilterPageReqVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateGoodDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@@ -47,4 +49,36 @@ public interface PlateGoodMapper extends BaseMapperX<PlateGoodDO> {
|
||||
return selectList(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
default PageResult<PlateGoodDO> selectGoodsPage(GoodsPlateFilterPageReqVO pageReqVO, Long organId) {
|
||||
return selectPage(pageReqVO, new LambdaQueryWrapperX<PlateGoodDO>()
|
||||
.eq(PlateGoodDO::getOrganId,organId)
|
||||
.eq(PlateGoodDO::getDeleted,false)
|
||||
.likeIfPresent(PlateGoodDO::getGoodsId,pageReqVO.getGoodsIds())
|
||||
.likeIfPresent(PlateGoodDO::getGoodsName,pageReqVO.getGoodsName())
|
||||
.eqIfPresent(PlateGoodDO::getThickness, pageReqVO.getThickness())
|
||||
.eqIfPresent(PlateGoodDO::getMaterial, pageReqVO.getMaterial())
|
||||
.eqIfPresent(PlateGoodDO::getColor, pageReqVO.getColor())
|
||||
.eqIfPresent(PlateGoodDO::getTexture,pageReqVO.getTexture())
|
||||
.likeIfPresent(PlateGoodDO::getSpec,pageReqVO.getSpec())
|
||||
.likeIfPresent(PlateGoodDO::getColor,pageReqVO.getFilterColor())
|
||||
.betweenIfPresent(PlateGoodDO::getWidth,new BigDecimal[]{pageReqVO.getWidthMinRang(), pageReqVO.getWidthMaxRang()})
|
||||
.betweenIfPresent(PlateGoodDO::getHeight,new BigDecimal[]{pageReqVO.getLongMinRang(),pageReqVO.getLongMaxRang()})
|
||||
.likeIfPresent(PlateGoodDO::getRemark,pageReqVO.getRemark())
|
||||
.orderByDesc(PlateGoodDO::getId)
|
||||
.select(PlateGoodDO::getGoodsId, PlateGoodDO::getGoodsName, PlateGoodDO::getMaterial, PlateGoodDO::getColor, PlateGoodDO::getTexture,
|
||||
PlateGoodDO::getWidth, PlateGoodDO::getHeight, PlateGoodDO::getThickness, PlateGoodDO::getBrand, PlateGoodDO::getSpec,
|
||||
PlateGoodDO::getRemark,PlateGoodDO::getColorBlack,PlateGoodDO::getOrganId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
default PlateGoodDO selectGoodsByGoodsId(String goodsId, Long organId) {
|
||||
return selectOne(new LambdaQueryWrapper<PlateGoodDO>()
|
||||
.eq(PlateGoodDO::getOrganId,organId)
|
||||
.eq(PlateGoodDO::getDeleted,false)
|
||||
.eq(PlateGoodDO::getGoodsId, goodsId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+37
-27
@@ -4,12 +4,15 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.cf.imes.framework.common.enums.OrderPlateCutStatusEnum;
|
||||
import com.cf.imes.framework.common.enums.OrderPlateTypeEnum;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.PrintOrderPackReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.NotPlanOrderPlateRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateDetailRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlatePage;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsIdVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlatePageReqVO;
|
||||
@@ -19,9 +22,9 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId;
|
||||
|
||||
@@ -72,20 +75,10 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
.orderByDesc(PlateDO::getId));
|
||||
}
|
||||
|
||||
// IPage<PlatePage> selectPlatePage(@Param("page") IPage<PlatePage> page, @Param("orderId")Long organId, @Param("goodsId") String goodsId);
|
||||
|
||||
|
||||
|
||||
IPage<PlateRespVO> selectProductList(@Param("page") IPage<PlateRespVO> page , @Param("orderId")Long orderId, @Param("roomId")Long roomId , @Param("bodyId")Long bodyId,@Param("organId") Long organId);
|
||||
|
||||
|
||||
Set<Long> selectBatchOrderIdsAndGoodsIds(@Param("itemList") List<PlanSaveReqVO.Item> itemList, @Param("organId") Long organId );
|
||||
|
||||
// PlateDetailRespVO selectPlateNumList(PlateDetailReqVO reqVO);
|
||||
|
||||
List<PlateDetialRespVO> selectPlateDetialList(@Param("orderId") Long orderId,@Param("organId") Long organId);
|
||||
|
||||
|
||||
List<PlateGoodsRespVO> selectPlateGoodsList(@Param("orderId") Long orderId, @Param("organId") Long organId, @Param("deleted") Integer deleted); // 明细
|
||||
|
||||
List<PlateGoodsRespVO> selectPlateGoodsListSummary(@Param("orderId") Long orderId, @Param("organId") Long organId, @Param("deleted") Integer deleted); // 汇总
|
||||
@@ -122,8 +115,6 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
List<PlateGoodsIdVO> selectPlateGoodsListByList(@Param("plates") List<Long> goodsIdList, @Param("orderId") Long orderId, @Param("organId") Long organId);
|
||||
|
||||
|
||||
// List<NotPlanOrderPlateRespVO> selectGoodsPage( @Param("orderIds") List<Long> orderIds, @Param("organId") Long organId);
|
||||
|
||||
List<NotPlanOrderPlateRespVO> selectGoodsPage( @Param(Constants.WRAPPER) Wrapper<PlateDO> wrapper);
|
||||
|
||||
|
||||
@@ -131,11 +122,12 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
void deletedById(@Param("plateIds") List<Long> plateIds, @Param("organId") Long organId);
|
||||
|
||||
|
||||
default List<PlateDO> selectPlateNum(Long orderId, Long organId) {
|
||||
default List<PlateDO> selectPlateNum(List<Long> orderId, Long organId) {
|
||||
return selectList(new LambdaQueryWrapperX<PlateDO>()
|
||||
.eq(PlateDO::getOrganId,organId)
|
||||
.eq(PlateDO::getDeleted,false)
|
||||
.eqIfPresent(PlateDO::getOrderId, orderId));
|
||||
.in(PlateDO::getOrderId, orderId)
|
||||
.select(PlateDO::getId));
|
||||
|
||||
|
||||
}
|
||||
@@ -171,18 +163,18 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
|
||||
|
||||
|
||||
default List<PlateDO> selectPlateByPlateNo(List<String> plateNo, Long organId) {
|
||||
default List<PlateDO> selectPlateByPlateNo(List<Long> orderIdList,List<String> plateNo, Long organId) {
|
||||
return selectList(new LambdaQueryWrapperX<PlateDO>()
|
||||
.eq(PlateDO::getOrganId,organId)
|
||||
.eq(PlateDO::getDeleted,false)
|
||||
.inIfPresent(PlateDO::getPlateNo, plateNo)
|
||||
.select(PlateDO::getOrderId));
|
||||
.inIfPresent(PlateDO::getOrderId,orderIdList)
|
||||
.inIfPresent(PlateDO::getPlateNo, plateNo));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
List<PlateDetialRespVO> selectPlateListByGoodsIds(@Param("goodsIdList") List<Long> goodsIdList,@Param("organId") Long organId);
|
||||
List<PlateDetailRespVO> selectPlateListByGoodsIds(@Param("orderIds") List<Long> orderIds,@Param("goodsIdList") List<Long> goodsIdList, @Param("organId") Long organId);
|
||||
|
||||
|
||||
// 批量删除
|
||||
@@ -214,8 +206,10 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
|
||||
void updatePlateOptimized(@Param("orderIdList") List<Long> orderIdList,@Param("ids") List<Long> ids,@Param("organId") Long organId);
|
||||
|
||||
void updatePlateIsOptimized(@Param("orderIdList") List<Long> orderIdList,@Param("ids") List<Long> ids,@Param("plateIds") List<Long> plateIds,@Param("organId") Long organId);
|
||||
|
||||
void updateNoPlateOptimized(@Param("orderIdList") List<Long> orderIdList,@Param("ids") List<Long> ids,@Param("organId") Long organId);
|
||||
|
||||
void updateNoPlateOptimized(@Param("orderIdList") List<Long> orderIdList,@Param("ids") List<Long> ids,@Param("plateIds") List<Long> plateIds,@Param("organId") Long organId);
|
||||
|
||||
|
||||
List<PrintOrderPackReqVO> selectPlanPackList(@Param("ids") List<Long> ids,@Param("organId") Long organId);
|
||||
@@ -237,22 +231,38 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
|
||||
|
||||
|
||||
default List<PlateDO> selectPlateIsOptimized(Long orderId, Long organId) {
|
||||
default List<PlateDO> selectPlateIsOptimized(List<Long> orderId, Long organId) {
|
||||
return selectList(new LambdaQueryWrapperX<PlateDO>()
|
||||
.eq(PlateDO::getOrganId,organId)
|
||||
.eq(PlateDO::getDeleted,false)
|
||||
.eqIfPresent(PlateDO::getOrderId,orderId)
|
||||
.eq(PlateDO::getIsOptimized,true));
|
||||
.inIfPresent(PlateDO::getOrderId,orderId)
|
||||
.eq(PlateDO::getIsOptimized,true)
|
||||
.select(PlateDO::getId,PlateDO::getOrderId));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
default PlateDO selectByPlateNo(Long plateNo, Long organId) {
|
||||
return selectOne(new LambdaQueryWrapperX<PlateDO>()
|
||||
default List<PlateDO> selectPlateIds(List<Long> orderIds, List<Long> ids, Long organId) {
|
||||
return selectList(new LambdaQueryWrapperX<PlateDO>()
|
||||
.eq(PlateDO::getOrganId,organId)
|
||||
.in(PlateDO::getOrderId,orderIds)
|
||||
.in(PlateDO::getGoodsId,ids)
|
||||
.eq(PlateDO::getDeleted,false)
|
||||
.eq(PlateDO::getPlateNo, plateNo));
|
||||
.select(PlateDO::getId));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
default List<PlateDO> selectNoCutPlateByPlateId(List<Long> deleteOrderIds,Long organId) {
|
||||
return selectList(new LambdaQueryWrapperX<PlateDO>()
|
||||
.eq(PlateDO::getOrganId,organId)
|
||||
.in(PlateDO::getOrderId,deleteOrderIds)
|
||||
.eq(PlateDO::getDeleted,false)
|
||||
.in(PlateDO::getIsCutted, Arrays.asList(OrderPlateCutStatusEnum.NOCUTTING.getStatus(),OrderPlateCutStatusEnum.OPENING.getStatus()))
|
||||
.select(PlateDO::getId,PlateDO::getOrderId));
|
||||
|
||||
}
|
||||
|
||||
|
||||
+21
-13
@@ -1,15 +1,12 @@
|
||||
package com.cf.imes.module.executor.service.optimizeplan;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.bo.OrderSource;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.CuttingStatusRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.SavePlanPlateResultReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.AddRemainReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.GetSourceDataReq;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateOptimize;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.OptimizeBoardModelDO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.bo.PlanProcessSchemeList;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.*;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderModelDO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -17,27 +14,31 @@ public interface OptimizePlanService {
|
||||
|
||||
String ORDER_PLATE_MODEL = "imes_order_plate_model";
|
||||
|
||||
String ORDER_REMAIN_PLATE_MODEL = "imes_order_optimize_plate_model";
|
||||
|
||||
String ORDER_OPTIMIZE_PLATE_MODEL = "imes_order_optimize_plate_model";
|
||||
|
||||
String ORDER_PARTS_REMARK_MODEL = "imes_order_parts_remark_model";
|
||||
|
||||
String PLAN_PROCESS_SCHEME_OPTIMIZE_MODEL = "imes_plan_process_scheme_optimize_model";
|
||||
|
||||
|
||||
List<PlateOptimize> getPlateListByPlanId(Long planId);
|
||||
|
||||
Boolean addRemain(AddRemainReqVO vo);
|
||||
|
||||
|
||||
Boolean commit(Long planId, List<Long> goodsNo);
|
||||
Boolean commit(Long planId,String goodsId,Long planConfigId, List<Long> goodsNo);
|
||||
|
||||
|
||||
Boolean endCutting(Long planId,String goodsId,List<Long> goodsNo,Long planConfigId);
|
||||
|
||||
|
||||
void updateCuttingStatus(CuttingStatusRespVO respVO);
|
||||
|
||||
Boolean endCutting(Long planId);
|
||||
|
||||
|
||||
Map<String, Object> getLabelDataSourceValue(GetSourceDataReq req);
|
||||
|
||||
OrderSource getOrderSource(Long orderId, Long planId, Long machineId,List<Long> ids);
|
||||
OrderSource getOrderSource(Long orderId, Long planId, Long machineId);
|
||||
|
||||
OrderSource getOrderSourceByOrderId(Long orderId);
|
||||
|
||||
@@ -46,10 +47,17 @@ public interface OptimizePlanService {
|
||||
|
||||
void saveOptimizationResults(SavePlanPlateResultReqVO req);
|
||||
|
||||
void saveProcessSchemeResults(SaveProcessSchemeReqVO saveProcessSchemeReqVO);
|
||||
|
||||
PlanProcessSchemeList getProcessSchemeConfig(Long processId,Long planId);
|
||||
|
||||
void updateProcessScheme(PlanProcessSchemeReqVO reqVO);
|
||||
|
||||
List<OrderModelDO> getPlateModel(Long orderId);
|
||||
|
||||
List<OptimizeBoardModelDO> buildBoardByOrderIds(Collection<Long> orderIds, String index, Integer size);
|
||||
OrderSource getNoPlanPlateData(NoPlanFilterPlateReqVO reqVO);
|
||||
|
||||
PageResult<OrderRespVOCopy> getOrderPlateDataFilter(FilterDataPageReqVO pageReqVO);
|
||||
|
||||
PageResult<OrderGoodsResp> getGoodsPlateDataFilter(FilterDataPageReqVO pageReqVO);
|
||||
}
|
||||
|
||||
+985
-433
File diff suppressed because it is too large
Load Diff
+21
-4
@@ -35,6 +35,7 @@ import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderModelDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderPlateList;
|
||||
import com.cf.imes.module.executor.dal.dataobject.pack.OrderPackageDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plan.PlanDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.planitem.PlanItemDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateGoodDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.rawgoods.RawGoodsDO;
|
||||
@@ -48,6 +49,7 @@ import com.cf.imes.module.executor.dal.mysql.orderParts.PartsMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.pack.OrderPackageMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.pack.OrderPrepackagedMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plan.PlanMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.planItem.PlanItemMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateGoodMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.rawgoods.RawGoodsMapper;
|
||||
@@ -58,6 +60,7 @@ import com.cf.imes.module.executor.service.customplateno.CustomPlateNoGenerateSe
|
||||
import com.cf.imes.module.executor.service.plan.PlanService;
|
||||
import com.cf.imes.module.executor.util.deviseData.structure.FieldConstants;
|
||||
import com.cf.imes.module.executor.util.deviseData.structure.PlateDetail;
|
||||
import com.cf.imes.module.executor.util.elasticsearch.EsUtils;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.SnowflakeIdWorker3rd;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.api.webcad.ApiDataTypeVo;
|
||||
import org.springframework.aop.framework.AopContext;
|
||||
@@ -132,6 +135,9 @@ public class OrderServiceImpl implements OrderService {
|
||||
@Resource
|
||||
private OrderPrepackagedMapper orderPrepackagedMapper;
|
||||
|
||||
@Resource
|
||||
private PlanItemMapper planItemMapper;
|
||||
|
||||
@Resource
|
||||
private OrderInputProcessor orderInputProcessor;
|
||||
|
||||
@@ -147,6 +153,8 @@ public class OrderServiceImpl implements OrderService {
|
||||
@Resource
|
||||
private CustomPlateNoGenerateService customPlateNoGenerateService;
|
||||
|
||||
@Resource
|
||||
private EsUtils esUtils;
|
||||
|
||||
private static final String SUBMIT_STATE = "1"; // 空订单 原生产系统
|
||||
|
||||
@@ -376,7 +384,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
|
||||
}
|
||||
|
||||
List<PlateDO> plateDOS = plateMapper.selectPlateIsOptimized(orderId, getUserOrganId());
|
||||
List<PlateDO> plateDOS = plateMapper.selectPlateIsOptimized(Collections.singletonList(orderId), getUserOrganId());
|
||||
|
||||
if(!plateDOS.isEmpty()){
|
||||
return;
|
||||
@@ -519,7 +527,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
|
||||
if (plateDetail != null && !plateDetail.isEmpty()){
|
||||
List<OrderModelDO> orderModelDOs = BeanUtils.toBean(plateDetail, OrderModelDO.class);
|
||||
orderInputProcessor.batchSaveModel(orderModelDOs);
|
||||
// orderInputProcessor.batchSaveModel(orderModelDOs);
|
||||
|
||||
// 将生产单板材的造型信息进行压缩并保存
|
||||
OrderModelCompressDO orderModelCompressDO = new OrderModelCompressDO();
|
||||
@@ -1081,7 +1089,15 @@ public class OrderServiceImpl implements OrderService {
|
||||
|
||||
List<Long> goodsIds = plateDOList.stream().map(PlateDO::getGoodsId).distinct().toList();
|
||||
|
||||
plateMapper.updateDeletedPlate(plateIds, getUserOrganId(), orderId);// 删小板
|
||||
// 删除小板的信息 和 排单小板关联表中的小板信息
|
||||
plateMapper.updateDeletedPlate(plateIds, getUserOrganId(), orderId);
|
||||
|
||||
planItemMapper.delete(new LambdaQueryWrapperX<PlanItemDO>()
|
||||
.eq(PlanItemDO::getOrganId, getUserOrganId())
|
||||
.eq(PlanItemDO::getOrderId,orderId)
|
||||
.in(PlanItemDO::getPlateId, plateIds)
|
||||
.in(PlanItemDO::getPlanId, planIds));
|
||||
|
||||
|
||||
// 删除包裹,只需删除,无需还原
|
||||
List<Long> packIds = orderItemMapper.selectPackId(orderId,bodyIds, getUserOrganId()).stream().map(OrderItemDO::getPackageId).distinct().toList();
|
||||
@@ -1123,6 +1139,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
|
||||
|
||||
if (!planIds.isEmpty()) {
|
||||
|
||||
// 判断删除的柜体对应的板材是否和排单板材一样
|
||||
List<GoodsDO> goodsDOS = goodsMapper.selectPlanGoodsListByPlanIdList(null,planIds, getUserOrganId());
|
||||
|
||||
@@ -1131,7 +1148,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
planService.deletePlan(planIds);
|
||||
} else {
|
||||
// 只要有排单,不管删除的柜体的板材数和排单数一样,都要删除排单对应的优化数据(不用这种写法进行删除时,有时会报错,原因目前还没找到)
|
||||
planService.deleteByPlanId(planIds, ORDER_REMAIN_PLATE_MODEL);
|
||||
esUtils.deleteEsDocument("planId",planIds,ORDER_REMAIN_PLATE_MODEL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -426,7 +426,7 @@ public class OrderStatisticsServiceImpl implements OrderStatisticsService {
|
||||
// 查询创建时间段内,数量最多的goods_id前十
|
||||
SearchRequest searchRequest = new SearchRequest.Builder()
|
||||
.size(0)
|
||||
.index(OptimizePlanService.ORDER_REMAIN_PLATE_MODEL)
|
||||
.index(OptimizePlanService.ORDER_OPTIMIZE_PLATE_MODEL)
|
||||
.query(q ->
|
||||
q.bool(b -> b
|
||||
.must(m -> m.range(m1 -> m1.field(ORDER_REMAIN_PLATE_MODEL_CREATE_TIME_FIELDNAME)
|
||||
@@ -457,7 +457,7 @@ public class OrderStatisticsServiceImpl implements OrderStatisticsService {
|
||||
// 查询创建时间段内,数量最多的goods_id前十下的数据,按goods_id和日期分组
|
||||
SearchRequest dateGroupRequest = new SearchRequest.Builder()
|
||||
.size(0)
|
||||
.index(OptimizePlanService.ORDER_REMAIN_PLATE_MODEL)
|
||||
.index(OptimizePlanService.ORDER_OPTIMIZE_PLATE_MODEL)
|
||||
.query(q ->
|
||||
q.bool(b -> b
|
||||
.must(m -> m.range(m1 -> m1.field(ORDER_REMAIN_PLATE_MODEL_CREATE_TIME_FIELDNAME)
|
||||
|
||||
+8
-15
@@ -3,13 +3,11 @@ package com.cf.imes.module.executor.service.plan;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.bo.OrderRoomBodyList;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.NotPlanGoodsReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.NotPlanGoodsRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderModelDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 生产单开料排单 Service 接口
|
||||
@@ -24,7 +22,7 @@ public interface PlanService {
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Map<String,Long> createPlan(@Valid PlanSaveReqVO createReqVO);
|
||||
void createPlan(@Valid PlanSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新生产单开料排单
|
||||
@@ -36,9 +34,9 @@ public interface PlanService {
|
||||
/**
|
||||
* 删除生产单开料排单
|
||||
*
|
||||
* @param ids 编号
|
||||
* @param planIds 编号
|
||||
*/
|
||||
Boolean deletePlan(List<Long> ids);
|
||||
Boolean deletePlan(List<Long> planIds);
|
||||
|
||||
/**
|
||||
* 获得生产单开料排单
|
||||
@@ -56,31 +54,26 @@ public interface PlanService {
|
||||
*/
|
||||
PageResult<PlanRespVO> getPlanPage(PlanPageReqVO pageReqVO);
|
||||
|
||||
List<PlanRespVO> getPlanList();
|
||||
|
||||
PageResult<OrderRespVOCopy> getOrderPage(OrderPageReqVOCopy pageReqVO);
|
||||
|
||||
PageResult<OrderGoodsResp> getOrderGoodsPage(OrderPageReqVOCopy pageReqVO);
|
||||
|
||||
|
||||
Boolean addPlate(AddPlateReq req);
|
||||
|
||||
|
||||
PageResult<PlateResList> getPlateByPlanId(GetPlateByPlanIdVO vo);
|
||||
|
||||
PageResult<OrderRespVO> getOrderByPlanId(PlanOrderPageReqVO pageReqVO);
|
||||
|
||||
PageResult<PlanGoodsVO> getNotPlanGoodsListPageByOrderId( NotPlanGoodsListPageVO pageVO);
|
||||
|
||||
Boolean setSort(List<SortVO> list);
|
||||
Boolean setSort(List<SortVO> sortVos);
|
||||
|
||||
List<PlateResList> getPlateList(List<Long> planIds);
|
||||
|
||||
|
||||
List<OrderRoomBodyList> getOrderRoomBody(List<Long> orderIds);
|
||||
|
||||
List<NotPlanOrderPlateRespVO> getOrderPlateList(OrderPageReqVOCopy pageReqVO);
|
||||
|
||||
List<NotPlanGoodsRespVO> getNotOptimizeGoodsList(NotPlanGoodsReqVO reqVO);
|
||||
List<OrderModelDO> buildPlateByOrderIds(List<Long> orderIds, List<Long> ids, Integer size);
|
||||
|
||||
|
||||
void deleteByPlanId(List<Long> planIds, String index);
|
||||
}
|
||||
+951
-507
File diff suppressed because it is too large
Load Diff
+7
@@ -2,8 +2,10 @@ package com.cf.imes.module.executor.service.plate;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.module.executor.controller.admin.goods.vo.GoodsSaveReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateGoodDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
@@ -54,6 +56,11 @@ public interface PlateService {
|
||||
*/
|
||||
PageResult<PlateDO> getPlatePage(PlatePageReqVO pageReqVO);
|
||||
|
||||
PageResult<PlateGoodDO> getGoodsPlate(GoodsPlateFilterPageReqVO pageReqVO);
|
||||
|
||||
PageResult<PlateResList> getOrderPlatePage(NoPlanPlatePageReqVO reqVO);
|
||||
|
||||
|
||||
/**
|
||||
* 批量导入小板
|
||||
*
|
||||
|
||||
+191
-25
@@ -9,7 +9,10 @@ import co.elastic.clients.elasticsearch.core.search.Hit;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
import com.cf.imes.framework.common.enums.GoodsFilterConditionsEnum;
|
||||
import com.cf.imes.framework.common.enums.OrderPlateTypeEnum;
|
||||
import com.cf.imes.framework.common.enums.PlanStatusEnum;
|
||||
import com.cf.imes.framework.common.enums.PlanTypeEnum;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.exception.util.ServiceExceptionUtil;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
@@ -17,25 +20,33 @@ import com.cf.imes.framework.common.util.Assert.AssertUtils;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.es.core.service.ESDocumentService;
|
||||
import com.cf.imes.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.QueryWrapperX;
|
||||
import com.cf.imes.framework.security.core.LoginUser;
|
||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.cf.imes.module.executor.controller.admin.goods.vo.GoodsSaveReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.PlatePlaceInfo;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.OptimizeBoardModelDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderModelDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plan.PlanDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateGoodDO;
|
||||
import com.cf.imes.module.executor.dal.mysql.goods.GoodsMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.order.OrderMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderBody.OrderBodyMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderItem.OrderItemMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plan.PlanMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateGoodMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper;
|
||||
import com.cf.imes.module.executor.enums.OrderItemType;
|
||||
import com.cf.imes.module.executor.enums.OrderStatusEnum;
|
||||
import com.cf.imes.module.executor.service.plan.PlanService;
|
||||
import com.cf.imes.module.executor.util.elasticsearch.EsUtils;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.SnowflakeIdWorker3rd;
|
||||
import com.cf.imes.module.system.enums.ErrorCodeConstants;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
@@ -47,15 +58,20 @@ import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConstants.*;
|
||||
import static com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConstants.ES_DATA_ERROR;
|
||||
import static com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR;
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.framework.common.util.json.JsonUtils.parseObject;
|
||||
import static com.cf.imes.framework.common.util.json.JsonUtils.toJsonString;
|
||||
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId;
|
||||
import static com.cf.imes.module.executor.service.optimizeplan.OptimizePlanService.ORDER_PLATE_MODEL;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.LIST_CHANGES_ARE_PROHIBITED;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.PLAN_NOT_EXISTS;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.*;
|
||||
/**
|
||||
* 生产单板件 Service 实现类
|
||||
@@ -82,6 +98,11 @@ public class PlateServiceImpl implements PlateService {
|
||||
@Resource
|
||||
private OrderBodyMapper orderBodyMapper;
|
||||
|
||||
@Resource
|
||||
private PlateGoodMapper plateGoodMapper;
|
||||
|
||||
@Resource
|
||||
private OrderMapper orderMapper;
|
||||
|
||||
@Resource
|
||||
private SnowflakeIdWorker3rd idWorker;
|
||||
@@ -95,7 +116,14 @@ public class PlateServiceImpl implements PlateService {
|
||||
@Resource
|
||||
private ESDocumentService esDocumentService;
|
||||
|
||||
String ORDER_REMAIN_PLATE_MODEL = "imes_order_optimize_plate_model";
|
||||
@Resource
|
||||
private EsUtils esUtils;
|
||||
|
||||
private static final String ORDER_REMAIN_PLATE_MODEL = "imes_order_optimize_plate_model";
|
||||
|
||||
private static final String ORDER_PLATE_MODEL = "imes_order_plate_model";
|
||||
|
||||
private static final String FIELD_PLATE_ID = "plateId";
|
||||
|
||||
@Override
|
||||
public Long createPlate(PlateSaveReqVO createReqVO) {
|
||||
@@ -133,25 +161,17 @@ public class PlateServiceImpl implements PlateService {
|
||||
}
|
||||
|
||||
|
||||
if(plateDO.getIsOptimized()) {
|
||||
if(Boolean.TRUE.equals(plateDO.getIsOptimized())) {
|
||||
|
||||
List<OptimizeBoardModelDO> optimizeBoardModelDOS = buildBoardByPlanId(planId, ORDER_REMAIN_PLATE_MODEL, 11);
|
||||
List<OptimizeBoardModelDO> optimizeBoardModelDOS = buildBoardByPlanId(planId, ORDER_REMAIN_PLATE_MODEL);
|
||||
|
||||
if (!optimizeBoardModelDOS.isEmpty()) {
|
||||
|
||||
// todo 目前只解决了非混单的情况
|
||||
// todo 目前只解决了非混单的情况(目前混单的问题应该已经解决,数据正确性问题待验证)
|
||||
OptimizeBoardModelDO optimizeBoardModelDO = optimizeBoardModelDOS.get(0);
|
||||
|
||||
try {
|
||||
|
||||
// ObjectMapper mapper = new ObjectMapper();
|
||||
//
|
||||
// // 解析 JSON 字符串
|
||||
// JsonNode jsonNode = mapper.readTree(optimizeBoardModelDO.getBlockPlaceInfo());
|
||||
|
||||
// List<PlatePlaceInfo> asJsonObject = mapper.convertValue(jsonNode, new TypeReference<>() {});
|
||||
|
||||
|
||||
Long placeBlockNumber = optimizeBoardModelDO.getPlaceBlockNumber() - 1;
|
||||
|
||||
List<PlatePlaceInfo> asJsonObject = parseObject(optimizeBoardModelDO.getBlockPlaceInfo(), new TypeReference<>() {});
|
||||
@@ -188,14 +208,8 @@ public class PlateServiceImpl implements PlateService {
|
||||
orderBodyDO.setPlateNum(orderBodyDO.getPlateNum() - 1);
|
||||
orderBodyMapper.updateById(orderBodyDO);
|
||||
|
||||
|
||||
orderItemMapper.deleteByPlateId(id, plateDO.getOrderId(), plateDO.getOrganId());
|
||||
|
||||
|
||||
// todo 还需考虑下是否需要和包裹关联,预打包优化数据是否需要关联
|
||||
|
||||
|
||||
|
||||
// 删除
|
||||
plateMapper.deleteById(id);
|
||||
}
|
||||
@@ -245,6 +259,88 @@ public class PlateServiceImpl implements PlateService {
|
||||
return plateMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PageResult<PlateGoodDO> getGoodsPlate(GoodsPlateFilterPageReqVO pageReqVO) {
|
||||
|
||||
PlanDO planDO = validatePlanExists(pageReqVO.getPlanId());
|
||||
|
||||
if (planDO.getType().equals(PlanTypeEnum.MIXEDORDERPLAN.getType())) {
|
||||
|
||||
pageReqVO.setColor(null);
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(planDO.getType().equals(PlanTypeEnum.ORDERPLAN.getType()) && pageReqVO.getFilterColor() != null){
|
||||
throw exception(PLAN_GOODS_IS_FILTER_DATA_ERROR);
|
||||
|
||||
}
|
||||
|
||||
return plateGoodMapper.selectGoodsPage(pageReqVO, getUserOrganId());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public PageResult<PlateResList> getOrderPlatePage(NoPlanPlatePageReqVO pageReqVO) {
|
||||
|
||||
// 使用这种方法分页查询速度太慢,所以要自己实现分页
|
||||
// PageDTO<PlateResList> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
|
||||
List<Integer> statusList = new ArrayList<>();
|
||||
statusList.add(OrderStatusEnum.NEW_ORDER.getStatus());
|
||||
statusList.add(OrderStatusEnum.IN_PRODUCTION.getStatus());
|
||||
statusList.add(OrderStatusEnum.SORTED.getStatus());
|
||||
|
||||
Integer pageNo = (pageReqVO.getPageNo() - 1) * pageReqVO.getPageSize();
|
||||
|
||||
QueryWrapperX<OrderDO> queryWrapperX = new QueryWrapperX<>();
|
||||
queryWrapperX
|
||||
.eq("o.organ_id",getUserOrganId())
|
||||
.eq("o.deleted",false)
|
||||
.in("o.status",statusList)
|
||||
.isNull("opi.plan_id")
|
||||
|
||||
.inIfPresent("op.goods_id",pageReqVO.getGoodsIdList())
|
||||
.likeIfPresent("o.id", pageReqVO.getOrderId() != null ? pageReqVO.getOrderId() : null)
|
||||
.likeIfPresent("op.id",pageReqVO.getPlateId())
|
||||
.likeIfPresent("op.name",pageReqVO.getName())
|
||||
.likeIfPresent("op.plate_no",pageReqVO.getPlateNo())
|
||||
.likeIfPresent("op.custom_plate_no",pageReqVO.getCustomPlateNo())
|
||||
.likeIfPresent("og.material",pageReqVO.getMaterial())
|
||||
.likeIfPresent("og.color",pageReqVO.getColor())
|
||||
.eqIfPresent("op.thickness",pageReqVO.getThickness())
|
||||
.betweenIfPresent("op.height", new BigDecimal[]{pageReqVO.getLongMinRang(), pageReqVO.getLongMaxRang()})
|
||||
.betweenIfPresent("op.width", new BigDecimal[]{pageReqVO.getWidthMinRang(), pageReqVO.getWidthMaxRang()})
|
||||
.betweenIfPresent("op.thickness", new BigDecimal[]{pageReqVO.getThicknessMinRang(), pageReqVO.getThicknessMaxRang()})
|
||||
.eqIfPresent("op.texture",pageReqVO.getTexture())
|
||||
.eqIfPresent("op.is_special_shaped",pageReqVO.getIsSpecialShaped())
|
||||
.eqIfPresent("op.is_sculpt",pageReqVO.getIsSculpt())
|
||||
.eqIfPresent("op.is_row_hole",pageReqVO.getIsRowHole())
|
||||
.orderByDesc("o.id");
|
||||
|
||||
Long plateCount = orderMapper.selectNoPlanOrderPlateCount(queryWrapperX);
|
||||
|
||||
List<PlateResList> plateResLists = orderMapper.selectNoPlanOrderPlateList(queryWrapperX,pageNo,pageReqVO.getPageSize());
|
||||
|
||||
List<Long> plateIds = plateResLists.stream().map(PlateResList::getPlateId).toList();
|
||||
|
||||
List<OrderModelDO> orderModelDOS = esUtils.getEsDocument(FIELD_PLATE_ID, plateIds, plateIds.size(), ORDER_PLATE_MODEL, OrderModelDO.class);
|
||||
|
||||
|
||||
PlateModelDetailRespVO.builder()
|
||||
.plateResLists(new PageResult<>(plateResLists,plateCount))
|
||||
.plateModels(orderModelDOS)
|
||||
.build();
|
||||
|
||||
return new PageResult<>(plateResLists,plateCount);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class) // 添加事务,异常则回滚所有导入
|
||||
public PlateImportRespVO importPlatesList(List<PlateSaveReqVO> importPlates, Long orderId) {
|
||||
@@ -305,7 +401,7 @@ public class PlateServiceImpl implements PlateService {
|
||||
@Override
|
||||
public List<BodyPlateDetailVO> getPlateModelByPlateId(List<Long> bodyIds) {
|
||||
List<BodyPlateIdDTO> list = plateMapper.selectJoinList(BodyPlateIdDTO.class, new MPJLambdaWrapperX<PlateDO>()
|
||||
.selectAs(PlateDO::getId, "plateId")
|
||||
.selectAs(PlateDO::getId, FIELD_PLATE_ID)
|
||||
.leftJoin(OrderItemDO.class, OrderItemDO::getPlateId, PlateDO::getId)
|
||||
.eq(OrderItemDO::getOrganId,getUserOrganId())
|
||||
.in(OrderItemDO::getBodyId, bodyIds)
|
||||
@@ -407,7 +503,7 @@ public class PlateServiceImpl implements PlateService {
|
||||
List<FieldValue> fieldValues = plateIds.stream().map(FieldValue::of).toList();
|
||||
SearchRequest.Builder builder = new SearchRequest.Builder();
|
||||
builder.index(index);
|
||||
builder.query(q -> q.terms(b -> b.field("plateId").terms(e->e.value(fieldValues))));
|
||||
builder.query(q -> q.terms(b -> b.field(FIELD_PLATE_ID).terms(e->e.value(fieldValues))));
|
||||
builder.size(plateIds.size());
|
||||
try {
|
||||
SearchResponse<OrderModelDO> search = elasticsearchClient.search(builder.build(), OrderModelDO.class);
|
||||
@@ -424,16 +520,15 @@ public class PlateServiceImpl implements PlateService {
|
||||
|
||||
|
||||
|
||||
private List<OptimizeBoardModelDO> buildBoardByPlanId(Long planId, String index, Integer size) {
|
||||
private List<OptimizeBoardModelDO> buildBoardByPlanId(Long planId, String index) {
|
||||
SearchRequest.Builder builder = new SearchRequest.Builder();
|
||||
builder.index(index);
|
||||
builder.size(size);
|
||||
builder.query(q -> q.term(b -> b.field("planId").value(planId)));
|
||||
try {
|
||||
SearchResponse<OptimizeBoardModelDO> search = elasticsearchClient.search(builder.build(), OptimizeBoardModelDO.class);
|
||||
List<Hit<OptimizeBoardModelDO>> hits = search.hits().hits();
|
||||
if (CollUtil.isNotEmpty(hits)) {
|
||||
return hits.stream().map(Hit::source).collect(Collectors.toList());
|
||||
return hits.stream().map(Hit::source).toList();
|
||||
}
|
||||
return new ArrayList<>();
|
||||
} catch (IOException e) {
|
||||
@@ -442,5 +537,76 @@ public class PlateServiceImpl implements PlateService {
|
||||
}
|
||||
}
|
||||
|
||||
private PlanDO validatePlanExists(Long id) {
|
||||
PlanDO planDO = planMapper.selectById(id);
|
||||
|
||||
AssertUtils.notEmpty(planDO,PLAN_NOT_EXISTS);
|
||||
|
||||
if(planDO.getStatus().equals(PlanStatusEnum.OPENING.getStatus()) || planDO.getStatus().equals(PlanStatusEnum.OPENED.getStatus())){
|
||||
throw exception(LIST_CHANGES_ARE_PROHIBITED);
|
||||
}
|
||||
|
||||
return planDO;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static void goodsFilter(List<String> filters, List<GoodsDO> goodsDOS,GoodsPlateFilterPageReqVO pageReqVO) {
|
||||
|
||||
int goodsNum = goodsDOS.size();
|
||||
|
||||
|
||||
// 查询条件
|
||||
Map<String, Function<GoodsDO, ?>> attributeGetters = new HashMap<>();
|
||||
attributeGetters.put(GoodsFilterConditionsEnum.THICKNESS.getFilterField(), GoodsDO::getThickness);
|
||||
attributeGetters.put(GoodsFilterConditionsEnum.MATERIAL.getFilterField(), GoodsDO::getMaterial);
|
||||
attributeGetters.put(GoodsFilterConditionsEnum.COLOR.getFilterField(), GoodsDO::getColor);
|
||||
attributeGetters.put(GoodsFilterConditionsEnum.TEXTURE.getFilterField(), GoodsDO::getTexture);
|
||||
attributeGetters.put(GoodsFilterConditionsEnum.BRAND.getFilterField(), GoodsDO::getBrand);
|
||||
attributeGetters.put(GoodsFilterConditionsEnum.WIDTH.getFilterField(), GoodsDO::getWidth);
|
||||
attributeGetters.put(GoodsFilterConditionsEnum.HEIGHT.getFilterField(), GoodsDO::getHeight);
|
||||
|
||||
// 赋值
|
||||
Map<String, Consumer<Object>> attributeSetters = new HashMap<>();
|
||||
attributeSetters.put(GoodsFilterConditionsEnum.THICKNESS.getFilterField(), value -> pageReqVO.setThickness((BigDecimal) value));
|
||||
attributeSetters.put(GoodsFilterConditionsEnum.MATERIAL.getFilterField(), value -> pageReqVO.setMaterial((String) value));
|
||||
attributeSetters.put(GoodsFilterConditionsEnum.COLOR.getFilterField(), value -> pageReqVO.setColor((String) value));
|
||||
// attributeSetters.put(GoodsFilterConditionsEnum.TEXTURE.getFilterField(), value -> pageReqVO.setTexture((Boolean) value));
|
||||
// attributeSetters.put(GoodsFilterConditionsEnum.BRAND.getFilterField(), value -> pageReqVO.setBrand((String) value));
|
||||
// attributeSetters.put(GoodsFilterConditionsEnum.WIDTH.getFilterField(), value -> pageReqVO.setWidth((BigDecimal) value));
|
||||
// attributeSetters.put(GoodsFilterConditionsEnum.HEIGHT.getFilterField(), value -> pageReqVO.setHeight((BigDecimal) value));
|
||||
|
||||
for (String filter : filters) {
|
||||
Function<GoodsDO, ?> getter = attributeGetters.get(filter);
|
||||
|
||||
Consumer<Object> setter = attributeSetters.get(filter);
|
||||
|
||||
if (getter == null || setter == null) {
|
||||
throw exception(PLAN_MIXED_DATA_ERROR);
|
||||
}
|
||||
|
||||
// 获取当前属性的第一个值
|
||||
Object attributeValue = goodsDOS.stream()
|
||||
.map(getter)
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
// 根据属性值过滤列表
|
||||
long count = goodsDOS.stream()
|
||||
.filter(good -> attributeValue.equals(getter.apply(good)))
|
||||
.count();
|
||||
|
||||
if (goodsNum != count) {
|
||||
throw exception(PLAN_MIXED_ORDER_ERROR,GoodsFilterConditionsEnum.getValueByKey(filter));
|
||||
}
|
||||
|
||||
// 设置属性值
|
||||
setter.accept(attributeValue);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
package com.cf.imes.module.executor.util;
|
||||
|
||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前用户的组织ID
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
public class OrganIdUtils {
|
||||
|
||||
// public static Long getUserOrganId(){
|
||||
//
|
||||
// return SecurityFrameworkUtils.getLoginUser().getOrganId();
|
||||
//
|
||||
// }
|
||||
}
|
||||
+297
@@ -0,0 +1,297 @@
|
||||
package com.cf.imes.module.executor.util.elasticsearch;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import co.elastic.clients.elasticsearch.ElasticsearchClient;
|
||||
import co.elastic.clients.elasticsearch._types.FieldValue;
|
||||
import co.elastic.clients.elasticsearch.core.DeleteByQueryRequest;
|
||||
import co.elastic.clients.elasticsearch.core.DeleteByQueryResponse;
|
||||
import co.elastic.clients.elasticsearch.core.SearchRequest;
|
||||
import co.elastic.clients.elasticsearch.core.SearchResponse;
|
||||
import co.elastic.clients.elasticsearch.core.search.Hit;
|
||||
import co.elastic.clients.elasticsearch.indices.RefreshRequest;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.es.core.dal.ESDocument;
|
||||
import com.cf.imes.framework.es.core.service.ESDocumentService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConstants.DATA_DATA_ERROR;
|
||||
import static com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConstants.ES_DATA_ERROR;
|
||||
|
||||
/**
|
||||
* @author ES 工具类
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class EsUtils {
|
||||
|
||||
private final ElasticsearchClient elasticsearchClient;
|
||||
|
||||
|
||||
@Resource
|
||||
private ESDocumentService esDocumentService;
|
||||
|
||||
|
||||
public EsUtils(ElasticsearchClient elasticsearchClient) {
|
||||
this.elasticsearchClient = elasticsearchClient;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ES 文档查询
|
||||
* @param filedName 需要查询的文档字段
|
||||
* @param value 需要查询的值
|
||||
* @param index 索引
|
||||
* @param targetClass 索引文档的实体类
|
||||
*/
|
||||
public <T> List<T> getEsDocument(String filedName, Long value, String index, Class<T> targetClass) {
|
||||
|
||||
SearchRequest.Builder builder = new SearchRequest.Builder();
|
||||
builder.index(index);
|
||||
|
||||
builder.query(q->q.bool(b->b.filter(f->f.term(t->t.field(filedName).value(value)))));
|
||||
|
||||
try {
|
||||
SearchResponse<T> search = elasticsearchClient.search(builder.build(), targetClass);
|
||||
List<Hit<T>> hits = search.hits().hits();
|
||||
if (CollUtil.isNotEmpty(hits)) {
|
||||
return hits.stream().map(Hit::source).toList();
|
||||
}
|
||||
return new ArrayList<>();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(DATA_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public <T> List<T> getEsDocument(String filedName, Long value,Integer size, String index, Class<T> targetClass) {
|
||||
|
||||
SearchRequest.Builder builder = new SearchRequest.Builder();
|
||||
builder.index(index);
|
||||
builder.size(size);
|
||||
|
||||
builder.query(q->q.bool(b->b.filter(f->f.term(t->t.field(filedName).value(value)))));
|
||||
|
||||
try {
|
||||
SearchResponse<T> search = elasticsearchClient.search(builder.build(), targetClass);
|
||||
List<Hit<T>> hits = search.hits().hits();
|
||||
if (CollUtil.isNotEmpty(hits)) {
|
||||
return hits.stream().map(Hit::source).toList();
|
||||
}
|
||||
return new ArrayList<>();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(DATA_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ES 文档查询
|
||||
* @param filedName 需要查询的文档字段
|
||||
* @param values 需要查询的值(集合类型)
|
||||
* @param index 索引对象
|
||||
*/
|
||||
public <T> List<T> getEsDocument(String filedName, List<Long> values, String index, Class<T> targetClass) {
|
||||
|
||||
List<FieldValue> fieldValues = values.stream().map(FieldValue::of).toList();
|
||||
SearchRequest.Builder builder = new SearchRequest.Builder();
|
||||
builder.index(index);
|
||||
|
||||
builder.query(q -> q.terms(b -> b.field(filedName).terms(t->t.value(fieldValues))));
|
||||
try {
|
||||
SearchResponse<T> search = elasticsearchClient.search(builder.build(), targetClass);
|
||||
List<Hit<T>> hits = search.hits().hits();
|
||||
if (CollUtil.isNotEmpty(hits)) {
|
||||
return hits.stream().map(Hit::source).toList();
|
||||
}
|
||||
return new ArrayList<>();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(DATA_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public <T> List<T> getEsDocument(String filedName, List<Long> values,Integer size, String index, Class<T> targetClass) {
|
||||
|
||||
List<FieldValue> fieldValues = values.stream().map(FieldValue::of).toList();
|
||||
SearchRequest.Builder builder = new SearchRequest.Builder();
|
||||
builder.index(index);
|
||||
builder.size(size);
|
||||
|
||||
builder.query(q -> q.terms(b -> b.field(filedName).terms(t->t.value(fieldValues))));
|
||||
try {
|
||||
SearchResponse<T> search = elasticsearchClient.search(builder.build(), targetClass);
|
||||
List<Hit<T>> hits = search.hits().hits();
|
||||
if (CollUtil.isNotEmpty(hits)) {
|
||||
return hits.stream().map(Hit::source).toList();
|
||||
}
|
||||
return new ArrayList<>();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(DATA_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public <T> List<T> getEsDocument(String filedName1,String filedName2, Long value1,Long value2, String index, Class<T> targetClass) {
|
||||
|
||||
SearchRequest.Builder builder = new SearchRequest.Builder();
|
||||
builder.index(index);
|
||||
|
||||
|
||||
builder.query(q->q.bool(b->b.filter(f->{
|
||||
f.term(t->t.field(filedName1).value(value1));
|
||||
f.term(t->t.field(filedName2).value(value2));
|
||||
return f;
|
||||
})));
|
||||
|
||||
try {
|
||||
SearchResponse<T> search = elasticsearchClient.search(builder.build(), targetClass);
|
||||
List<Hit<T>> hits = search.hits().hits();
|
||||
if (CollUtil.isNotEmpty(hits)) {
|
||||
return hits.stream().map(Hit::source).toList();
|
||||
}
|
||||
return new ArrayList<>();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(DATA_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public <T> List<T> getEsDocument(String filedName1,String filedName2, Long value1,Long value2,Integer size, String index, Class<T> targetClass) {
|
||||
|
||||
SearchRequest.Builder builder = new SearchRequest.Builder();
|
||||
builder.index(index);
|
||||
builder.size(size);
|
||||
|
||||
builder.query(q->q.bool(b->b.filter(f->{
|
||||
f.term(t->t.field(filedName1).value(value1));
|
||||
f.term(t->t.field(filedName2).value(value2));
|
||||
return f;
|
||||
})));
|
||||
|
||||
try {
|
||||
SearchResponse<T> search = elasticsearchClient.search(builder.build(), targetClass);
|
||||
List<Hit<T>> hits = search.hits().hits();
|
||||
if (CollUtil.isNotEmpty(hits)) {
|
||||
return hits.stream().map(Hit::source).toList();
|
||||
}
|
||||
return new ArrayList<>();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(DATA_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ES 文档删除
|
||||
public void deleteEsDocument(String filedName,Long value, String index) {
|
||||
|
||||
DeleteByQueryRequest.Builder builder = new DeleteByQueryRequest.Builder();
|
||||
builder.index(index);
|
||||
|
||||
builder.query(q -> q.term(b -> b.field(filedName).value(value)));
|
||||
|
||||
try {
|
||||
DeleteByQueryResponse response = elasticsearchClient.deleteByQuery(builder.build());
|
||||
log.info("Deleted {} documents with value {}", response.deleted(), value);
|
||||
} catch (Exception e) {
|
||||
log.error("Error deleting documents with value {}: {}", value, e.getMessage());
|
||||
throw new ServiceException(ES_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteEsDocument(String filedName1,String filedName2, Long value1,Long value2, String index) {
|
||||
|
||||
DeleteByQueryRequest.Builder builder = new DeleteByQueryRequest.Builder();
|
||||
builder.index(index);
|
||||
|
||||
builder.query(q->q.bool(b->b.filter(f->{
|
||||
f.term(t->t.field(filedName1).value(value1));
|
||||
f.term(t->t.field(filedName2).value(value2));
|
||||
return f;
|
||||
})));
|
||||
|
||||
try {
|
||||
elasticsearchClient.deleteByQuery(builder.build());
|
||||
} catch (Exception e) {
|
||||
log.error("ES文档删除失败:", e.getMessage());
|
||||
throw new ServiceException(ES_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void deleteEsDocument(String filedName,List<Long> values, String index) {
|
||||
|
||||
List<FieldValue> fieldValues = values.stream().map(FieldValue::of).toList();
|
||||
DeleteByQueryRequest.Builder builder = new DeleteByQueryRequest.Builder();
|
||||
builder.index(index);
|
||||
|
||||
|
||||
builder.query(q -> q.terms(b -> b.field(filedName).terms(e -> e.value(fieldValues))));
|
||||
|
||||
try {
|
||||
DeleteByQueryResponse response = elasticsearchClient.deleteByQuery(builder.build());
|
||||
log.info("Deleted {} documents with values {}", response.deleted(), values);
|
||||
} catch (Exception e) {
|
||||
log.error("Error deleting documents with values {}: {}", values, e.getMessage());
|
||||
throw new ServiceException(ES_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ES 文档保存
|
||||
*
|
||||
* @param targetClass
|
||||
*/
|
||||
public void saveEsDocument(String index,List<?extends ESDocument> targetClass) {
|
||||
try {
|
||||
|
||||
esDocumentService.bulkCreate(index, targetClass);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(DATA_DATA_ERROR);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ES 文档数据刷新
|
||||
public void refresh( String index) {
|
||||
|
||||
try {
|
||||
// 创建刷新请求
|
||||
RefreshRequest refreshRequest = new RefreshRequest.Builder().index(index).build();
|
||||
|
||||
elasticsearchClient.indices().refresh(refreshRequest);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("ES文档数据刷新失败:"+e.getMessage());
|
||||
throw new ServiceException(ES_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+68
-17
@@ -27,12 +27,15 @@
|
||||
<select id="selectGoodsListByOrderIds"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.GoodsReqVO">
|
||||
|
||||
select
|
||||
select distinct
|
||||
og.*,
|
||||
orp.id as remainId
|
||||
|
||||
from order_goods og
|
||||
left join order_remain_plate orp on og.organ_id = orp.organ_id and og.id = orp.goods_id
|
||||
where og.organ_id = #{organId} and og.deleted = false and og.plan_id = #{planId}
|
||||
left join order_plan_item opi on og.organ_id = opi.organ_id and og.order_id = opi.order_id and og.id = opi.goods_id
|
||||
|
||||
where opi.organ_id = #{organId} and opi.plan_id = #{planId}
|
||||
|
||||
|
||||
</select>
|
||||
@@ -289,25 +292,27 @@
|
||||
parameterType="java.lang.Long">
|
||||
|
||||
|
||||
select distinct
|
||||
og.order_id as orderId,
|
||||
ob.id as bodyId,
|
||||
ob.name as bodyName,
|
||||
ob.room_id as roomId,
|
||||
ob.room_name as roomName
|
||||
from order_goods og
|
||||
left join order_plate op on og.organ_id = op.organ_id and og.order_id = op.order_id and og.id = op.goods_id
|
||||
left join order_item oi on op.organ_id = oi.organ_id and op.order_id = oi.order_id and op.id = oi.plate_id
|
||||
left join order_body ob on oi.organ_id = ob.organ_id and oi.order_id = ob.order_id and oi.body_id = ob.id
|
||||
select distinct ob.order_id as orderId,
|
||||
ob.id as bodyId,
|
||||
ob.name as bodyName,
|
||||
ob.room_id as roomId,
|
||||
ob.room_name as roomName
|
||||
|
||||
where og.organ_id = #{organId}
|
||||
and og.deleted = false
|
||||
and og.plan_id = 0
|
||||
and og.order_id in
|
||||
from order_body ob
|
||||
|
||||
left join order_item oi on ob.organ_id = oi.organ_id and ob.order_id = oi.order_id and ob.id = oi.body_id
|
||||
left join order_plate op on oi.organ_id = op.organ_id and oi.order_id = op.order_id and oi.plate_id = op.id
|
||||
left join order_plan_item opi on op.organ_id = opi.organ_id and op.order_id = opi.order_id and op.id = opi.plate_id
|
||||
|
||||
where ob.organ_id = #{organId}
|
||||
and ob.order_id in
|
||||
<foreach item="orderIds" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderIds}
|
||||
</foreach>
|
||||
|
||||
and ob.deleted = false
|
||||
and op.is_optimized = false
|
||||
and opi.plan_id is null;
|
||||
|
||||
|
||||
</select>
|
||||
@@ -420,7 +425,7 @@
|
||||
and deleted = false
|
||||
and order_id = #{orderId}
|
||||
and goods_id = #{goodsId}
|
||||
and plan_id !=0
|
||||
-- and plan_id !=0
|
||||
limit 1;
|
||||
|
||||
|
||||
@@ -491,4 +496,50 @@
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectListByGoodsIdList" resultType="com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO">
|
||||
|
||||
select distinct goods_id,
|
||||
goods_name,
|
||||
material,
|
||||
color,
|
||||
width,
|
||||
height,
|
||||
thickness,
|
||||
texture,
|
||||
brand,
|
||||
spec
|
||||
from order_goods
|
||||
|
||||
where organ_id = #{organId}
|
||||
and deleted = false
|
||||
and plan_id = 0
|
||||
|
||||
and goods_id in
|
||||
<foreach item="goodsId" collection="goodsId" open="(" separator="," close=")">
|
||||
#{goodsId}
|
||||
</foreach>
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectPlateGoodIds"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.order.vo.order.OrderGoodsPlateIds">
|
||||
|
||||
select distinct
|
||||
og.id as goodsId,
|
||||
og.order_id as orderId,
|
||||
og.goods_id as actualGoodsId,
|
||||
op.id as id
|
||||
from order_goods og
|
||||
left join order_plate op on og.organ_id = op.organ_id and og.order_id = op.order_id and og.deleted = op.deleted and og.id = op.goods_id
|
||||
where og.organ_id = #{organId}
|
||||
and og.deleted = false
|
||||
and og.order_id in
|
||||
<foreach collection="orderIds" item="orderIds" open="(" close=")" separator=",">
|
||||
#{orderIds}
|
||||
</foreach>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
+185
-35
@@ -76,45 +76,30 @@
|
||||
|
||||
|
||||
<select id="selectOrderListByIds"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.OrderRespVOCopy"
|
||||
parameterType="map">
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.OrderRespVOCopy">
|
||||
|
||||
|
||||
select distinct
|
||||
o.id as orderId ,
|
||||
o.custom_order_no as defineId,
|
||||
o.customer as customer,
|
||||
o.address as address,
|
||||
o.order_date as orderDate,
|
||||
o.delivery_date as deliveryDate,
|
||||
o.update_time as updateTime,
|
||||
og.goods_id as goodsId,
|
||||
count(distinct op.id) as num,
|
||||
sum(op.area) as area
|
||||
id as orderId,
|
||||
order_date as orderDate,
|
||||
delivery_date as deliveryDate,
|
||||
customer as customer,
|
||||
address as address,
|
||||
custom_order_no as defineId,
|
||||
status as status,
|
||||
create_time as createTime
|
||||
|
||||
from orders o
|
||||
join order_goods og on o.id = og.order_id and o.organ_id = og.organ_id
|
||||
join order_plate op on o.id = op.order_id and og.id = op.goods_id and o.organ_id = op.organ_id
|
||||
from orders
|
||||
|
||||
where
|
||||
o.id in
|
||||
organ_id = #{organId}
|
||||
and deleted = false
|
||||
and id in
|
||||
<foreach collection="orderIds" item="orderIds" open="(" close=")" separator=",">
|
||||
(#{orderIds.orderId})
|
||||
</foreach>
|
||||
and o.organ_id = #{organId}
|
||||
and op.deleted = false
|
||||
and og.goods_id in
|
||||
|
||||
<foreach collection="orderIds" item="orderIds" open="(" close=")" separator=",">
|
||||
(#{orderIds.goodsId})
|
||||
#{orderIds}
|
||||
</foreach>
|
||||
|
||||
group by o.id,o.custom_order_no, o.customer,o.address,o.order_date,o.delivery_date, o.update_time,o.status,og.goods_id
|
||||
order by o.id
|
||||
|
||||
|
||||
|
||||
|
||||
order by orderId desc
|
||||
|
||||
</select>
|
||||
|
||||
@@ -292,23 +277,24 @@
|
||||
|
||||
select distinct
|
||||
o.id,
|
||||
og.plan_id,
|
||||
opi.plan_id,
|
||||
o.order_date,
|
||||
o.delivery_date,
|
||||
o.custom_order_no,
|
||||
o.customer,
|
||||
o.address,
|
||||
o.phone_number,
|
||||
o.dealer,
|
||||
o.dealer_phone_number,
|
||||
o.salesman,
|
||||
o.splitter,
|
||||
o.remark
|
||||
from orders o
|
||||
|
||||
left join order_goods og on o.organ_id = og.organ_id and o.id = og.order_id
|
||||
left join order_plan_item opi on o.organ_id = opi.organ_id and o.id = opi.order_id
|
||||
|
||||
where og.organ_id = #{organId}
|
||||
and og.deleted = false
|
||||
and og.plan_id in
|
||||
where opi.organ_id = #{organId}
|
||||
and opi.plan_id in
|
||||
<foreach collection="planIds" item="ids" open="(" close=")" separator=",">
|
||||
#{ids}
|
||||
</foreach>
|
||||
@@ -317,4 +303,168 @@
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectFilterOrderPagePlate"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.OrderRespVOCopy">
|
||||
|
||||
select distinct
|
||||
o.id as orderId,
|
||||
o.order_date as orderDate,
|
||||
o.delivery_date as deliveryDate,
|
||||
o.customer as customer,
|
||||
o.address as address,
|
||||
o.custom_order_no as defineId,
|
||||
o.status as status
|
||||
|
||||
from orders o
|
||||
join order_goods og on o.organ_id = og.organ_id and o.id = og.order_id and og.plan_id = 0 and o.deleted = og.deleted
|
||||
join order_plate op on o.organ_id = op.organ_id and o.deleted = op.deleted and o.id = op.order_id and op.is_optimized = false and og.id = op.goods_id
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectFilterGoodsPlateList" resultMap="OrderIdMap">
|
||||
|
||||
|
||||
select distinct
|
||||
|
||||
og.id as id,
|
||||
og.order_id as orderId,
|
||||
og.goods_id as goodsId
|
||||
|
||||
from orders o
|
||||
|
||||
join order_goods og on o.organ_id = og.organ_id and o.id = og.order_id and og.plan_id = 0 and o.deleted = og.deleted
|
||||
|
||||
join order_plate op on o.organ_id = op.organ_id and o.deleted = op.deleted and o.id = op.order_id and op.is_optimized = false and og.id = op.goods_id
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<resultMap id="GoodsMap" type="com.cf.imes.module.executor.controller.admin.plan.vo.OrderGoodsResp">
|
||||
<result property="width" column="width"/>
|
||||
<result property="height" column="height"/>
|
||||
<result property="thickness" column="thickness"/>
|
||||
<result property="goodsName" column="goods_name"/>
|
||||
<result property="material" column="material"/>
|
||||
<result property="color" column="color"/>
|
||||
<result property="texture" column="texture"/>
|
||||
<result property="brand" column="brand"/>
|
||||
<result property="spec" column="spec"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="goodsId" column="goodsId"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectFilterGoodsPlatePage" resultMap="GoodsMap">
|
||||
|
||||
|
||||
select distinct
|
||||
|
||||
og.goods_id as goodsId,
|
||||
og.goods_name,
|
||||
og.color,
|
||||
og.material,
|
||||
og.texture,
|
||||
og.thickness,
|
||||
og.width,
|
||||
og.height,
|
||||
og.brand,
|
||||
og.remark,
|
||||
og.spec
|
||||
|
||||
from orders o
|
||||
|
||||
join order_goods og on o.organ_id = og.organ_id and o.id = og.order_id and og.plan_id = 0 and o.deleted = og.deleted
|
||||
|
||||
join order_plate op on o.organ_id = op.organ_id and o.deleted = op.deleted and o.id = op.order_id and op.is_optimized = false and og.id = op.goods_id
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectFilterOrderPlateList" resultType="java.lang.Long">
|
||||
|
||||
select distinct
|
||||
o.id as orderId
|
||||
|
||||
from orders o
|
||||
join order_goods og on o.organ_id = og.organ_id and o.id = og.order_id and og.plan_id = 0 and o.deleted = og.deleted
|
||||
join order_plate op on o.organ_id = op.organ_id and o.deleted = op.deleted and o.id = op.order_id and op.is_optimized = false and og.id = op.goods_id
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="selectNoPlanOrderPlateCount" resultType="java.lang.Long">
|
||||
|
||||
|
||||
select
|
||||
count(op.id)
|
||||
|
||||
from orders o
|
||||
left join order_plate op on o.organ_id = op.organ_id and o.id = op.order_id
|
||||
left join order_plan_item opi on op.organ_id = opi.organ_id and op.order_id = opi.order_id and op.id = opi.plate_id
|
||||
left join order_goods og on op.organ_id = og.organ_id and op.order_id = og.order_id and op.goods_id = og.id
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="selectNoPlanOrderPlateList"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList">
|
||||
|
||||
|
||||
select distinct
|
||||
o.id as orderId,
|
||||
op.id as plateId,
|
||||
op.plate_no as plateNo,
|
||||
op.goods_id as id,
|
||||
op.custom_plate_no as customPlateNo,
|
||||
og.material as material,
|
||||
og.color as color,
|
||||
og.goods_id as goodsId,
|
||||
op.name as plateName,
|
||||
op.height as height,
|
||||
op.width as width,
|
||||
op.thickness as thickness,
|
||||
op.texture as texture,
|
||||
op.area as area,
|
||||
op.seal_down as sealDown,
|
||||
op.seal_up as sealUp,
|
||||
op.seal_right as sealRight,
|
||||
op.seal_left as sealLeft,
|
||||
op.is_special_shaped as isSpecialShaped,
|
||||
op.is_sculpt as isSculpt,
|
||||
op.is_row_hole as isRowHole,
|
||||
op.remark as remark
|
||||
|
||||
from orders o
|
||||
left join order_plate op on o.organ_id = op.organ_id and o.id = op.order_id
|
||||
left join order_plan_item opi on op.organ_id = opi.organ_id and op.order_id = opi.order_id and op.id = opi.plate_id
|
||||
left join order_goods og on op.organ_id = og.organ_id and op.order_id = og.order_id and op.goods_id = og.id
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
limit #{pageNo},#{pageSize};
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
+74
@@ -27,4 +27,78 @@
|
||||
${field2}
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectFilterOrderPagePlate"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.OrderRespVOCopy">
|
||||
|
||||
|
||||
select distinct og.order_id
|
||||
|
||||
from order_group og
|
||||
|
||||
left join order_item oi on og.organ_id = oi.organ_id and og.order_id = oi.order_id and og.id = oi.group_id
|
||||
|
||||
left join order_plate op on oi.organ_id = op.organ_id and oi.order_id = op.order_id and oi.plate_id = op.id
|
||||
|
||||
left join order_goods ogs on op.organ_id = ogs.organ_id and op.order_id = ogs.order_id and op.goods_id = ogs.id and op.deleted = ogs.deleted
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectFilterOrderPlateList" resultType="java.lang.Long">
|
||||
|
||||
select distinct og.order_id
|
||||
|
||||
from order_group og
|
||||
|
||||
left join order_item oi on og.organ_id = oi.organ_id and og.order_id = oi.order_id and og.id = oi.group_id
|
||||
|
||||
left join order_plate op on oi.organ_id = op.organ_id and oi.order_id = op.order_id and oi.plate_id = op.id
|
||||
|
||||
left join order_goods ogs on op.organ_id = ogs.organ_id and op.order_id = ogs.order_id and op.goods_id = ogs.id and op.deleted = ogs.deleted
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectFilterGoodsPagePlate"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.OrderGoodsResp">
|
||||
|
||||
select distinct ogs.goods_id
|
||||
|
||||
from order_group og
|
||||
|
||||
left join order_item oi on og.organ_id = oi.organ_id and og.order_id = oi.order_id and og.id = oi.group_id
|
||||
|
||||
left join order_plate op on oi.organ_id = op.organ_id and oi.order_id = op.order_id and oi.plate_id = op.id
|
||||
|
||||
left join order_goods ogs on op.organ_id = ogs.organ_id and op.order_id = ogs.order_id and op.goods_id = ogs.id and op.deleted = ogs.deleted
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectFilterGoodsPlateList" resultType="com.cf.imes.module.executor.controller.admin.plan.bo.OrderIds">
|
||||
|
||||
select distinct ogs.goods_id,
|
||||
ogs.order_id
|
||||
|
||||
from order_group og
|
||||
|
||||
left join order_item oi on og.organ_id = oi.organ_id and og.order_id = oi.order_id and og.id = oi.group_id
|
||||
|
||||
left join order_plate op on oi.organ_id = op.organ_id and oi.order_id = op.order_id and oi.plate_id = op.id
|
||||
|
||||
left join order_goods ogs on op.organ_id = ogs.organ_id and op.order_id = ogs.order_id and op.goods_id = ogs.id and op.deleted = ogs.deleted
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
+13
-1
@@ -134,6 +134,12 @@
|
||||
<result property="name" column="name"/>
|
||||
<result property="orderId" column="orderId"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="partsColor" column="partsColor"/>
|
||||
<result property="partsWidth" column="partsWidth"/>
|
||||
<result property="partsLength" column="partsLength"/>
|
||||
<result property="partsThickness" column="partsThickness"/>
|
||||
<result property="category" column="category"/>
|
||||
<result property="subparts" column="subparts"/>
|
||||
|
||||
<collection property="groupId" ofType="java.lang.Long" column="groupId"/>
|
||||
|
||||
@@ -159,7 +165,13 @@
|
||||
op.model as model ,
|
||||
op.name as name,
|
||||
op.order_id as orderId,
|
||||
op.type as type
|
||||
op.type as type,
|
||||
op.color as partsColor,
|
||||
op.width as partsWidth,
|
||||
op.length as partsLength,
|
||||
op.thickness as partsThickness,
|
||||
op.category as category,
|
||||
op.subparts as subparts
|
||||
from order_parts op
|
||||
left join order_item oi on op.organ_id = oi.organ_id and op.order_id = oi.order_id and op.id = oi.parts_id
|
||||
left join order_body ob on oi.organ_id = ob.organ_id and oi.order_id = ob.order_id and oi.body_id = ob.id
|
||||
|
||||
+2
-1
@@ -143,7 +143,8 @@
|
||||
|
||||
UPDATE order_plan
|
||||
|
||||
SET status = #{status}, produce_time = null
|
||||
SET status = #{status},
|
||||
produce_time = null
|
||||
|
||||
WHERE organ_id = #{organId}
|
||||
and deleted = false
|
||||
|
||||
+377
-1
@@ -1,8 +1,384 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.cf.imes.module.executor.dal.mysql.planitem.PlanItemMapper">
|
||||
<mapper namespace="com.cf.imes.module.executor.dal.mysql.planItem.PlanItemMapper">
|
||||
|
||||
|
||||
<resultMap id="OrderPageMap" type="com.cf.imes.module.executor.controller.admin.plan.vo.OrderRespVOCopy">
|
||||
|
||||
<result property="orderId" column="orderId"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="defineId" column="defineId"/>
|
||||
<result property="customer" column="customer"/>
|
||||
<result property="address" column="address"/>
|
||||
<result property="deliveryDate" column="deliveryDate"/>
|
||||
<result property="orderDate" column="orderDate"/>
|
||||
<result property="num" column="num"/>
|
||||
<result property="area" column="area"/>
|
||||
|
||||
|
||||
</resultMap>
|
||||
|
||||
<select id="selectOrderList" resultMap="OrderPageMap">
|
||||
|
||||
|
||||
select distinct
|
||||
o.id as orderId,
|
||||
o.order_date as orderDate,
|
||||
o.delivery_date as deliveryDate,
|
||||
o.customer as customer,
|
||||
o.address as address,
|
||||
o.custom_order_no as defineId,
|
||||
o.status as status
|
||||
|
||||
from order_plan_item opi
|
||||
right join order_plate op on opi.organ_id = op.organ_id and opi.order_id = op.order_id and opi.goods_id = op.goods_id and opi.plate_id = op.id
|
||||
right join orders o on op.organ_id = o.organ_id and op.order_id = o.id
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<resultMap id="GoodsListMap" type="com.cf.imes.module.executor.controller.admin.plan.vo.PlateInfoVO">
|
||||
|
||||
<result property="planId" column="planId"/>
|
||||
<result property="material" column="material"/>
|
||||
<result property="width" column="width"/>
|
||||
<result property="height" column="height"/>
|
||||
<result property="thickness" column="thickness"/>
|
||||
<result property="color" column="color"/>
|
||||
|
||||
|
||||
<collection property="platePages" ofType="com.cf.imes.module.executor.controller.admin.plan.vo.PlatePage" resultMap="PlatePageMap"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
||||
<resultMap id="PlatePageMap" type="com.cf.imes.module.executor.controller.admin.plan.vo.PlatePage">
|
||||
|
||||
<result property="plateId" column="plateId"/>
|
||||
<result property="area" column="plateArea"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectOrderPlanPlateList" resultMap="GoodsListMap" parameterType="java.lang.Long">
|
||||
|
||||
select distinct
|
||||
oi.plan_id as planId,
|
||||
og.width as width,
|
||||
og.height as height,
|
||||
og.material as material,
|
||||
og.thickness as thickness ,
|
||||
og.color as color,
|
||||
|
||||
oi.plate_id as plateId,
|
||||
op.area as plateArea
|
||||
|
||||
from order_plan_item oi
|
||||
left join order_goods og on oi.organ_id = og.organ_id and oi.order_id = og.order_id and oi.goods_id = og.id
|
||||
left join order_plate op on oi.organ_id = op.organ_id and oi.order_id = op.order_id and oi.goods_id = op.goods_id and oi.plate_id = op.id
|
||||
|
||||
where oi.organ_id = #{organId}
|
||||
and oi.plan_id in
|
||||
<foreach collection="planIds" item="planIds" open="(" close=")" separator=",">
|
||||
#{planIds}
|
||||
</foreach>
|
||||
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectPlateListByPlateIds"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList">
|
||||
|
||||
|
||||
select distinct op.id as plateId,
|
||||
op.order_id,
|
||||
op.plate_no ,
|
||||
op.goods_id as id,
|
||||
op.custom_plate_no,
|
||||
op.name as plateName,
|
||||
op.is_special_shaped,
|
||||
op.is_sculpt,
|
||||
op.area,
|
||||
op.seal_left,
|
||||
op.seal_right,
|
||||
op.seal_up,
|
||||
op.seal_down,
|
||||
og.material,
|
||||
og.color,
|
||||
op.width,
|
||||
op.height,
|
||||
op.thickness,
|
||||
op.texture,
|
||||
op.is_row_hole,
|
||||
op.remark,
|
||||
opi.plan_id,
|
||||
oi.room_id,
|
||||
oi.body_id,
|
||||
ob.name as bodyName,
|
||||
ob.room_name as roomName
|
||||
|
||||
from order_plan_item opi
|
||||
left join order_goods og on opi.organ_id = og.organ_id and opi.order_id = og.order_id and opi.goods_id = og.id
|
||||
left join order_plate op on opi.organ_id = op.organ_id and opi.order_id = op.order_id and opi.goods_id = op.goods_id and opi.plate_id = op.id
|
||||
left join order_item oi on opi.organ_id = oi.organ_id and opi.order_id = oi.order_id and opi.plate_id = oi.plate_id
|
||||
left join order_body ob on oi.organ_id = ob.organ_id and oi.order_id = ob.order_id and oi.body_id = ob.id
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<resultMap id="OrderGoodsMap" type="com.cf.imes.module.executor.controller.admin.plan.vo.OrderGoodsResp">
|
||||
|
||||
<result property="goodsName" column="goodsName"/>
|
||||
<result property="material" column="material"/>
|
||||
<result property="color" column="color"/>
|
||||
<result property="texture" column="texture"/>
|
||||
<result property="thickness" column="thickness"/>
|
||||
<result property="brand" column="brand"/>
|
||||
|
||||
<collection property="orderIds" ofType="com.cf.imes.module.executor.controller.admin.plan.bo.OrderIds" resultMap="orderIdsMap"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="orderIdsMap" type="com.cf.imes.module.executor.controller.admin.plan.bo.OrderIds">
|
||||
|
||||
<result property="orderId" column="orderId"/>
|
||||
<result property="goodsId" column="goodsId"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectNoPlanGoodsByRoomAndBodyIds" resultMap="OrderGoodsMap" parameterType="java.lang.Long">
|
||||
|
||||
|
||||
select distinct
|
||||
|
||||
og.color as color,
|
||||
og.goods_name as goodsName,
|
||||
og.material as material,
|
||||
og.texture as texture,
|
||||
og.thickness as thickness,
|
||||
og.brand as brand
|
||||
|
||||
from orders o
|
||||
left join order_goods og on o.organ_id = og.organ_id and o.id = og.order_id
|
||||
left join order_plan_item opi on og.organ_id = opi.organ_id and og.order_id = opi.order_id and og.id = opi.goods_id
|
||||
left join order_plate op on og.organ_id = op.organ_id and og.order_id = op.order_id and og.id = op.goods_id
|
||||
left join order_item oi on op.organ_id = oi.organ_id and op.order_id = oi.order_id and op.id = oi.plate_id
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectNoPlanGoodsList" resultMap="OrderGoodsMap" parameterType="java.lang.Long">
|
||||
|
||||
|
||||
select distinct
|
||||
|
||||
og.color as color,
|
||||
og.goods_name as goodsName,
|
||||
og.material as material,
|
||||
og.texture as texture,
|
||||
og.thickness as thickness,
|
||||
og.brand as brand
|
||||
|
||||
from orders o
|
||||
left join order_goods og on o.organ_id = og.organ_id and o.id = og.order_id
|
||||
left join order_plan_item opi on og.organ_id = opi.organ_id and og.order_id = opi.order_id and og.id = opi.goods_id
|
||||
left join order_plate op on og.organ_id = op.organ_id and og.order_id = op.order_id and og.id = op.goods_id
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectNoOrderGoodsIdList" resultMap="OrderGoodsMap">
|
||||
|
||||
select distinct
|
||||
og.color as color,
|
||||
og.goods_name as goodsName,
|
||||
og.material as material,
|
||||
og.texture as texture,
|
||||
og.thickness as thickness,
|
||||
og.brand as brand,
|
||||
|
||||
og.goods_id as goodsId,
|
||||
og.order_id as orderId
|
||||
|
||||
from orders o
|
||||
left join order_goods og on o.organ_id = og.organ_id and o.id = og.order_id
|
||||
left join order_plan_item opi on og.organ_id = opi.organ_id and og.order_id = opi.order_id and og.id = opi.goods_id
|
||||
left join order_plate op on og.organ_id = op.organ_id and og.order_id = op.order_id and og.id = op.goods_id
|
||||
left join order_item oi on op.organ_id = oi.organ_id and op.order_id = oi.order_id and op.id = oi.plate_id
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
|
||||
</select>
|
||||
<select id="selectPlanIncrementPlate"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plate.vo.OrderPlateIds">
|
||||
|
||||
|
||||
select distinct op.id as plateId,
|
||||
op.order_id asorderId
|
||||
|
||||
from order_plan_item opi
|
||||
left join order_plate op on opi.organ_id = op.organ_id and opi.order_id = op.order_id and opi.plate_id = op.id
|
||||
|
||||
where opi.organ_id = #{organId}
|
||||
and opi.plan_id in
|
||||
<foreach collection="noPlanIds" item="noPlanIds" open="(" close=")" separator=",">
|
||||
#{noPlanIds}
|
||||
</foreach>
|
||||
and op.type = 3
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<resultMap id="PlateDetailMap" type="com.cf.imes.module.executor.controller.admin.plan.vo.PlateDetailRespVO">
|
||||
|
||||
<result property="plateId" column="plateId"/>
|
||||
<result property="orderId" column="orderId"/>
|
||||
<result property="id" column="goodsId"/>
|
||||
<result property="goodsId" column="plateGoodsId"/>
|
||||
<result property="plateNo" column="plateNo"/>
|
||||
<result property="customPlateNo" column="customPlateNo"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="height" column="height"/>
|
||||
<result property="width" column="width"/>
|
||||
<result property="thickness" column="thickness"/>
|
||||
<result property="splitWidth" column="splitWidth"/>
|
||||
<result property="splitHeight" column="splitHeight"/>
|
||||
<result property="splitThickness" column="splitThickness"/>
|
||||
<result property="isSpecialShaped" column="isSpecialShaped"/>
|
||||
<result property="sealLeft" column="sealLeft"/>
|
||||
<result property="sealRight" column="sealRight"/>
|
||||
<result property="sealUp" column="sealUp"/>
|
||||
<result property="sealDown" column="sealDown"/>
|
||||
<result property="area" column="area"/>
|
||||
<result property="texture" column="texture"/>
|
||||
<result property="holeFace" column="holeFace"/>
|
||||
<result property="holeArrange" column="holeArrange"/>
|
||||
<result property="unregularPointCount" column="unregularPointCount"/>
|
||||
<result property="frontHoleCount" column="frontHoleCount"/>
|
||||
<result property="backHoleCount" column="backHoleCount"/>
|
||||
<result property="sideHoleCount" column="sideHoleCount"/>
|
||||
<result property="frontModelCount" column="frontModelCount"/>
|
||||
<result property="backModelCount" column="backModelCount"/>
|
||||
<result property="isDoor" column="isDoor"/>
|
||||
<result property="isArcAcross" column="isArcAcross"/>
|
||||
<result property="moduleTypeId" column="moduleTypeId"/>
|
||||
<result property="isSculpt" column="isSculpt"/>
|
||||
<result property="filterType" column="filterType"/>
|
||||
<result property="offsetX" column="offsetX"/>
|
||||
<result property="offsetY" column="offsetY"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="isCancel" column="isCancel"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="openDoorType" column="openDoorType"/>
|
||||
<result property="hasHole" column="hasHole"/>
|
||||
|
||||
<result property="bodyId" column="bodyId"/>
|
||||
<result property="goodsName" column="goodsName"/>
|
||||
<result property="roomId" column="roomId"/>
|
||||
<result property="bodyName" column="bodyName"/>
|
||||
<result property="roomName" column="roomName"/>
|
||||
<result property="hasHole" column="hasHole"/>
|
||||
|
||||
<collection property="processGroupLists" javaType="java.util.List" ofType="com.cf.imes.module.executor.controller.admin.plan.bo.ProcessGroupList" >
|
||||
|
||||
<result property="groupId" column="groupId"/>
|
||||
<result property="groupName" column="groupName"/>
|
||||
</collection >
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectPlanPlateDetailList" resultMap="PlateDetailMap">
|
||||
|
||||
|
||||
|
||||
select distinct
|
||||
|
||||
oi.body_id as bodyId,
|
||||
oi.group_id as groupId,
|
||||
oi.room_id as roomId,
|
||||
og.name as groupName,
|
||||
ob.name as bodyName,
|
||||
ob.room_name as roomName,
|
||||
ogs.goods_id as plateGoodsId,
|
||||
ogs.goods_name as goodsName,
|
||||
|
||||
op.id as plateId,
|
||||
op.order_id as orderId,
|
||||
op.name as name,
|
||||
op.plate_no as plateNo,
|
||||
op.custom_plate_no as customPlateNo,
|
||||
op.type as type,
|
||||
op.goods_id as goodsId,
|
||||
op.width as width,
|
||||
op.height as height,
|
||||
op.thickness as thickness,
|
||||
op.split_width as splitWidth,
|
||||
op.split_height as splitHeight,
|
||||
op.split_thickness as splitThickness,
|
||||
op.seal_left as sealLeft,
|
||||
op.seal_right as sealRight,
|
||||
op.seal_up as sealUp,
|
||||
op.seal_down as sealDown,
|
||||
op.area as area,
|
||||
op.texture as texture,
|
||||
op.hole_face as holeFace,
|
||||
op.hole_arrange as holeArrange,
|
||||
op.unregular_point_count as unregularPointCount,
|
||||
op.front_hole_count as frontHoleCount,
|
||||
op.back_hole_count as backHoleCount,
|
||||
op.side_hole_count as sideHoleCount,
|
||||
op.front_model_count as frontModelCount,
|
||||
op.back_model_count as backModelCount,
|
||||
op.is_door as isDoor,
|
||||
op.open_door_type as openDoorType,
|
||||
op.offset_x as offsetX,
|
||||
op.offset_y as offsetY,
|
||||
op.is_arc_across as isArcAcross,
|
||||
op.module_type_id as moduleTypeId,
|
||||
op.is_special_shaped as isSpecialShaped,
|
||||
op.is_sculpt as isSculpt,
|
||||
op.is_row_hole as hasHole,
|
||||
op.remark as remark,
|
||||
op.filter_type as filterType,
|
||||
op.is_cancel as isCancel,
|
||||
op.is_row_hole as hasHole
|
||||
|
||||
from order_plan_item opi
|
||||
left join order_plate op on opi.organ_id = op.organ_id and opi.order_id = op.order_id and opi.goods_id = op.goods_id and opi.plate_id = op.id
|
||||
left join order_goods ogs on opi.organ_id = ogs.organ_id and opi.order_id = ogs.order_id and opi.goods_id = ogs.id
|
||||
left join order_item oi on opi.organ_id = oi.organ_id and opi.order_id = oi.order_id and opi.plate_id = oi.plate_id
|
||||
left join order_group og on oi.organ_id = og.organ_id and oi.order_id = og.order_id and oi.group_id = og.id
|
||||
left join order_body ob on oi.organ_id = ob.organ_id and oi.order_id = ob.order_id and oi.body_id = ob.id
|
||||
|
||||
where opi.organ_id = #{organId} and opi.plan_id = #{planId}
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
+59
-155
@@ -18,65 +18,16 @@
|
||||
GROUP BY a.id, c.material, c.color;
|
||||
</select>
|
||||
|
||||
<select id="selectBatchOrderIdsAndGoodsIds" resultType="java.lang.Long">
|
||||
select distinct oi.id from order_plate op
|
||||
join order_item oi on op.id = oi.plate_id and op.order_id = oi.order_id and op.organ_id = oi.organ_id
|
||||
where op.organ_id = #{organId} and op.order_id in
|
||||
<foreach collection="itemList" item="item" open="(" close=")" separator=",">
|
||||
(#{item.orderId})
|
||||
</foreach>
|
||||
and
|
||||
op.goods_id in
|
||||
<foreach collection="itemList" item="item" open="(" close=")" separator=",">
|
||||
(#{item.id})
|
||||
</foreach>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <resultMap id="PlateNumListMap" type="com.cf.imes.module.executor.controller.admin.plate.vo.PlateDetailRespVO">-->
|
||||
|
||||
<!--<!– <result property="bigPlateNum" column="bigPlateNum"/>–>-->
|
||||
<!-- <result property="planStatus" column="planStatus"/>-->
|
||||
<!-- <result property="remainPlateNum" column="remainPlateNum"/>-->
|
||||
<!-- </resultMap>-->
|
||||
<!-- <select id="selectPlateNumList"-->
|
||||
<!-- resultMap="PlateNumListMap"-->
|
||||
<!-- parameterType="com.cf.imes.module.executor.controller.admin.plate.vo.PlateDetailReqVO">-->
|
||||
|
||||
<!---- select count(distinct og.id) as bigPlateNum,-->
|
||||
<!---- op.status as planStatus,-->
|
||||
<!---- orp.count as remainPlateNum-->
|
||||
<!---- from order_goods og-->
|
||||
<!---- left join order_plan op on og.order_id = op.order_nos-->
|
||||
<!---- left join order_remain_plate orp on op.id = orp.plan_id-->
|
||||
<!---- where order_id = #{orderId}-->
|
||||
<!---- group by planStatus,remainPlateNum;-->
|
||||
<!-- select distinct-->
|
||||
<!-- op.status as planStatus,-->
|
||||
<!-- sum(orp.count ) as remainPlateNum-->
|
||||
<!-- from order_plan op-->
|
||||
<!-- join order_plan_item opi on op.id = opi.plan_id-->
|
||||
<!-- join order_item oi on oi.id = opi.item_id-->
|
||||
<!-- join order_remain_plate orp on op.id = orp.plan_id-->
|
||||
<!-- where oi.order_id = #{orderId}-->
|
||||
<!-- group by planStatus;-->
|
||||
|
||||
<!-- </select>-->
|
||||
|
||||
|
||||
|
||||
|
||||
<resultMap id="PlateDetialMap" type="com.cf.imes.module.executor.controller.admin.plan.vo.PlateDetialRespVO">
|
||||
<resultMap id="PlateDetialMap" type="com.cf.imes.module.executor.controller.admin.plan.vo.PlateDetailRespVO">
|
||||
|
||||
<result property="plateId" column="plateId"/>
|
||||
<result property="orderId" column="orderId"/>
|
||||
<result property="id" column="goodsId"/>
|
||||
<result property="goodsId" column="plateGoodsId"/>
|
||||
<result property="plateNo" column="plateNo"/>
|
||||
<result property="customPlateNo" column="customPlateNo"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="height" column="height"/>
|
||||
<result property="width" column="width"/>
|
||||
@@ -126,69 +77,6 @@
|
||||
</collection >
|
||||
</resultMap>
|
||||
|
||||
<select id="selectPlateDetialList"
|
||||
resultMap="PlateDetialMap"
|
||||
resultType="java.lang.Long">
|
||||
|
||||
select distinct
|
||||
oi.group_id as groupId,
|
||||
og.name as groupName,
|
||||
op.id as plateId,
|
||||
op.order_id as orderId,
|
||||
op.name as name,
|
||||
op.plate_no as plateNo,
|
||||
op.type as type,
|
||||
op.goods_id as goodsId,
|
||||
ogs.goods_id as plateGoodsId,
|
||||
op.width as width,
|
||||
op.height as height,
|
||||
op.thickness as thickness,
|
||||
op.split_width as splitWidth,
|
||||
op.split_height as splitHeight,
|
||||
op.split_thickness as splitThickness,
|
||||
op.seal_left as sealLeft,
|
||||
op.seal_right as sealRight,
|
||||
op.seal_up as sealUp,
|
||||
op.seal_down as sealDown,
|
||||
op.area as area,
|
||||
op.texture as texture,
|
||||
op.hole_face as holeFace,
|
||||
op.hole_arrange as holeArrange,
|
||||
op.unregular_point_count as unregularPointCount,
|
||||
op.front_hole_count as frontHoleCount,
|
||||
op.back_hole_count as backHoleCount,
|
||||
op.side_hole_count as sideHoleCount,
|
||||
op.front_model_count as frontModelCount,
|
||||
op.back_model_count as backModelCount,
|
||||
op.is_door as isDoor,
|
||||
op.open_door_type as openDoorType,
|
||||
op.offset_x as offsetX,
|
||||
op.offset_y as offsetY,
|
||||
op.is_arc_across as isArcAcross,
|
||||
op.module_type_id as moduleTypeId,
|
||||
op.is_special_shaped as isSpecialShaped,
|
||||
op.is_sculpt as isSculpt,
|
||||
op.is_row_hole as hasHole,
|
||||
op.remark as remark,
|
||||
op.filter_type as filterType,
|
||||
op.is_cancel as isCancel,
|
||||
ogs.goods_name as goodsName,
|
||||
ob.id as bodyId,
|
||||
ob.room_id as roomId,
|
||||
ob.name as bodyName,
|
||||
ob.room_name as roomName,
|
||||
op.is_row_hole as hasHole
|
||||
|
||||
from order_plate op
|
||||
left join order_goods ogs on op.organ_id = ogs.organ_id and op.order_id = ogs.order_id and op.goods_id = ogs.id
|
||||
left join order_item oi on op.organ_id = oi.organ_id and op.order_id = oi.order_id and op.id = oi.plate_id
|
||||
left join order_group og on oi.organ_id = og.organ_id and oi.order_id = og.order_id and oi.group_id = og.id
|
||||
left join order_body ob on oi.organ_id = ob.organ_id and oi.order_id = ob.order_id and oi.body_id = ob.id
|
||||
|
||||
where op.organ_id = #{organId} and op.deleted = false and op.order_id = #{orderId}
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="selectPlateGoodsList" resultType="com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsRespVO">
|
||||
@@ -357,39 +245,6 @@
|
||||
</select>
|
||||
|
||||
|
||||
<!-- <select id="selectGoodsPage" resultType="com.cf.imes.module.executor.controller.admin.plan.vo.NotPlanOrderPlateRespVO">
|
||||
|
||||
|
||||
|
||||
select distinct c.order_id as orderId,
|
||||
c.id as goodsId,
|
||||
c.width,
|
||||
c.height,
|
||||
c.thickness,
|
||||
c.goods_name,
|
||||
c.material,
|
||||
c.color,
|
||||
count(a.id) as num,
|
||||
sum( a.area) as area
|
||||
|
||||
from order_plate a
|
||||
LEFT JOIN order_item oi on a.id = oi.plate_id and a.order_id = oi.order_id and a.organ_id = oi.organ_id
|
||||
-- LEFT JOIN `orders` b on a.order_id = b.id and a.organ_id = b.organ_id
|
||||
LEFT JOIN order_goods c on a.goods_id = c.id and a.organ_id = c.organ_id
|
||||
left join order_plan_item opi on oi.id = opi.item_id and oi.organ_id = opi.organ_id
|
||||
where
|
||||
c.organ_id = #{organId}
|
||||
and a.is_cancel = 0
|
||||
and opi.item_id is null
|
||||
and c.order_id in
|
||||
<foreach collection="orderIds" item="orderIds" open="(" close=")" separator=",">
|
||||
#{orderIds}
|
||||
</foreach>
|
||||
|
||||
group by c.id,c.order_id ,c.goods_name,c.width,c.height,c.thickness, c.material, c.color;
|
||||
|
||||
</select>-->
|
||||
|
||||
<resultMap id="GoodsPageMap" type="com.cf.imes.module.executor.controller.admin.plan.vo.NotPlanOrderPlateRespVO">
|
||||
|
||||
|
||||
@@ -535,6 +390,7 @@
|
||||
op.order_id as orderId,
|
||||
op.name as name,
|
||||
op.plate_no as plateNo,
|
||||
op.custom_plate_no as customPlateNo,
|
||||
op.type as type,
|
||||
op.goods_id as goodsId,
|
||||
op.width as width,
|
||||
@@ -577,13 +433,18 @@
|
||||
left join order_group og on oi.organ_id = og.organ_id and oi.order_id = og.order_id and oi.group_id = og.id
|
||||
left join order_body ob on oi.organ_id = ob.organ_id and oi.order_id = ob.order_id and oi.body_id = ob.id
|
||||
|
||||
where op.organ_id = #{organId} and op.deleted = false and op.goods_id in
|
||||
where op.organ_id = #{organId}
|
||||
and op.deleted = false
|
||||
|
||||
and op.order_id in
|
||||
<foreach collection="orderIds" item="orderIds" open="(" close=")" separator=",">
|
||||
#{orderIds}
|
||||
</foreach>
|
||||
|
||||
and op.goods_id in
|
||||
<foreach collection="goodsIdList" item="goodsIdList" open="(" close=")" separator=",">
|
||||
#{goodsIdList}
|
||||
</foreach>
|
||||
-- and op.is_optimized = true
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
@@ -601,11 +462,12 @@
|
||||
<select id="selectNoPlanPlateList" resultMap="PlatePageMap">
|
||||
|
||||
select
|
||||
order_id as orderId,
|
||||
id as plateId,
|
||||
area as area
|
||||
op.order_id as orderId,
|
||||
op.id as plateId,
|
||||
op.area as area
|
||||
|
||||
from order_plate
|
||||
from order_plate op
|
||||
left join order_plan_item opi on op.organ_id = opi.organ_id and op.order_id = opi.order_id and op.id = opi.plate_id
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
@@ -637,13 +499,47 @@
|
||||
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<update id="updatePlateIsOptimized" parameterType="java.lang.Long">
|
||||
|
||||
update order_plate
|
||||
|
||||
set is_optimized = true
|
||||
|
||||
where organ_id = #{organId}
|
||||
and deleted = false
|
||||
|
||||
and order_id in
|
||||
<foreach item="orderIdList" collection="orderIdList" open="(" separator="," close=")">
|
||||
#{orderIdList}
|
||||
</foreach>
|
||||
|
||||
and goods_id in
|
||||
<foreach item="ids" collection="ids" open="(" separator="," close=")">
|
||||
#{ids}
|
||||
</foreach>
|
||||
|
||||
and id in
|
||||
<foreach item="plateIds" collection="plateIds" open="(" separator="," close=")">
|
||||
#{plateIds}
|
||||
</foreach>
|
||||
|
||||
and is_optimized = false
|
||||
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<update id="updateNoPlateOptimized">
|
||||
|
||||
update order_plate
|
||||
|
||||
set is_optimized = false
|
||||
|
||||
where organ_id = #{organId}
|
||||
<where> organ_id = #{organId}
|
||||
and deleted = false
|
||||
and order_id in
|
||||
<foreach item="orderIdList" collection="orderIdList" open="(" separator="," close=")">
|
||||
@@ -654,7 +550,15 @@
|
||||
#{ids}
|
||||
</foreach>
|
||||
|
||||
<if test="plateIds != null">
|
||||
and id in
|
||||
<foreach item="plateIds" collection="plateIds" open="(" separator="," close=")">
|
||||
#{plateIds}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
and is_optimized = true
|
||||
</where>
|
||||
|
||||
</update>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user