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 ssh://192.168.1.205:9922/cf_devdept2/cf_imes_server
This commit is contained in:
+11
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.*;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.product.OrderBodyRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.product.OrderRoomBodyRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRespVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||
import com.cf.imes.module.executor.util.ExcelWriterUtil;
|
||||
@@ -152,6 +153,16 @@ public class OrderController {
|
||||
return success(orderBodyMap);
|
||||
}
|
||||
|
||||
@GetMapping("/get-room-and-body")
|
||||
@Operation(summary = "获取柜体和房间信息")
|
||||
@Parameter(name = "planId", description = "排单ID", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('production:manager-list:detail')")
|
||||
public CommonResult<List<OrderRoomBodyRespVO>> getRoomAndBody(@RequestParam("planId") Long planId) {
|
||||
List<OrderRoomBodyRespVO> orderBodyMap = orderService.getRoomAndBody(planId);
|
||||
return success(orderBodyMap);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/get-module")
|
||||
@Operation(summary = "生产单详情-数量信息")
|
||||
@Parameter(name = "orderId", description = "生产单编号", example = "1024")
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.cf.imes.module.executor.controller.admin.order.vo.product;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 生产单房间和柜体信息")
|
||||
@Data
|
||||
public class OrderRoomBodyRespVO {
|
||||
|
||||
|
||||
@Schema(description = "柜体ID")
|
||||
private Long bodyId;
|
||||
|
||||
@Schema(description = "柜体名称")
|
||||
private String bodyName;
|
||||
|
||||
@Schema(description = "房间ID")
|
||||
private Long roomId;
|
||||
|
||||
@Schema(description = "房间名称")
|
||||
private String roomName;
|
||||
|
||||
|
||||
}
|
||||
+10
@@ -5,6 +5,7 @@ import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.bo.OrderSource;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.SavePlanPlateResultReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateSaveReqVO;
|
||||
import com.cf.imes.module.executor.service.optimizeplan.OptimizePlanService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -19,6 +20,8 @@ import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* @author there
|
||||
*/
|
||||
@@ -61,6 +64,13 @@ public class OptimizePlanController {
|
||||
return CommonResult.success(optimizePlanService.commit(planId));
|
||||
}
|
||||
|
||||
@GetMapping("/endCutting")
|
||||
@Operation(summary = "结束开料")
|
||||
@PreAuthorize("@ss.hasPermission('executor:optimize-plate:create')")
|
||||
public CommonResult<Boolean> endCutting(@RequestParam @Valid @NotNull(message = "排单id不能空") Long planId) {
|
||||
return success(optimizePlanService.endCutting(planId));
|
||||
}
|
||||
|
||||
@GetMapping("/getOptimizeParam")
|
||||
@Operation(summary = "获取优化算法参数")
|
||||
@PreAuthorize("@ss.hasPermission('executor:optimize-plate:create')")
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class GoodsReqVO {
|
||||
private String color;
|
||||
|
||||
@Schema(description = "纹路")
|
||||
private Integer texture;
|
||||
private Boolean texture;
|
||||
|
||||
@Schema(description = "宽度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private BigDecimal width;
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ public class OrderGoodsResp {
|
||||
private Long num;
|
||||
|
||||
|
||||
@Schema(description = "订单对应的板件的信息")
|
||||
@Schema(description = "生产单信息")
|
||||
private List<OrderRespVOCopy> orderList;
|
||||
|
||||
|
||||
|
||||
+8
@@ -122,4 +122,12 @@ public class PlateController {
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/insertPlate")
|
||||
@Operation(summary = "优化生产创建板材")
|
||||
@PreAuthorize("@ss.hasPermission('executor:plate:create')")
|
||||
public CommonResult<List<Long>> createNewPlate(@Valid @RequestBody OptimizationSavePlateReqVO reqVO) {
|
||||
return success(plateService.createNewPlate(reqVO));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plate.vo;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Schema(description = "管理后台 - 优化生产时新增的小板信息")
|
||||
public class OptimizationSavePlateReqVO {
|
||||
|
||||
|
||||
@Schema(description = "柜体号")
|
||||
private Long bodyId;
|
||||
|
||||
|
||||
@Schema(description = "柜体名称")
|
||||
private String bodyName;
|
||||
|
||||
|
||||
@Schema(description = "房间号")
|
||||
private Long roomId;
|
||||
|
||||
|
||||
@Schema(description = "房间名称")
|
||||
private String roomName;
|
||||
|
||||
|
||||
@Schema(description = "排单ID")
|
||||
private Long planId;
|
||||
|
||||
@Schema(description = "生产单号")
|
||||
private Long orderId;
|
||||
|
||||
|
||||
@Schema(description = "板名称")
|
||||
private String name;
|
||||
|
||||
|
||||
@Schema(description = "板类型,0 层板 1 立板 2 背板")
|
||||
private Integer type;
|
||||
|
||||
|
||||
@Schema(description = "商品ID")
|
||||
private Long goodsId;
|
||||
|
||||
@Schema(description = "纹路类型,0 正纹 1 可翻转 2 反纹")
|
||||
private Integer texture;
|
||||
|
||||
|
||||
@Schema(description = "宽度")
|
||||
private BigDecimal width;
|
||||
|
||||
|
||||
@Schema(description = "高度")
|
||||
private BigDecimal height;
|
||||
|
||||
|
||||
@Schema(description = "左封边厚度")
|
||||
private BigDecimal sealLeft;
|
||||
|
||||
|
||||
@Schema(description = "右封边厚度")
|
||||
private BigDecimal sealRight;
|
||||
|
||||
|
||||
@Schema(description = "上封边厚度")
|
||||
private BigDecimal sealUp;
|
||||
|
||||
|
||||
@Schema(description = "下封边厚度")
|
||||
private BigDecimal sealDown;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "倍数")
|
||||
private Integer multiple ;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "备注1")
|
||||
private String remake1;
|
||||
|
||||
|
||||
@Schema(description = "备注2")
|
||||
private String remake2;
|
||||
|
||||
}
|
||||
+18
-1
@@ -3,10 +3,14 @@ package com.cf.imes.module.executor.dal.mysql.goods;
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.GoodsReqVO;
|
||||
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.dal.dataobject.goods.GoodsDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderGroup.OrderGroupDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@@ -72,4 +76,17 @@ public interface GoodsMapper extends BaseMapperX<GoodsDO> {
|
||||
// 删板材,批量
|
||||
void updateDeletedById(@Param("ids") List<Long> ids, @Param("deleted") Integer deleted, @Param("organId") Long organId);
|
||||
|
||||
}
|
||||
|
||||
IPage<OrderGoodsResp> selectGoods(@Param("page") IPage page,@Param("goodsIds") List<Long> goodsIds,@Param("organId") Long organId);
|
||||
|
||||
|
||||
|
||||
|
||||
default GoodsDO selectId(Long orderId, Long goodsId, Long organId) {
|
||||
return selectOne(new LambdaQueryWrapperX<GoodsDO>()
|
||||
.eq(GoodsDO::getOrganId, organId)
|
||||
.eq(GoodsDO::getOrderId, orderId)
|
||||
.eq(GoodsDO::getGoodsId,goodsId)
|
||||
.eq(GoodsDO::getDeleted, 0));
|
||||
}
|
||||
}
|
||||
+3
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
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.framework.mybatis.core.query.QueryWrapperX;
|
||||
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.OrderRespVOCopy;
|
||||
@@ -126,4 +127,6 @@ public interface OrderMapper extends BaseMapperX<OrderDO> {
|
||||
|
||||
|
||||
List<OrderRespVOCopy> selectOrderListByIds(@Param("orderIds") List<OrderIds> orderIds, @Param("organId")Long organId);
|
||||
|
||||
List<Long> selectOrderIds(@Param(Constants.WRAPPER) Wrapper<OrderDO> wrapper);
|
||||
}
|
||||
|
||||
+3
@@ -5,6 +5,7 @@ import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderModuleRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.product.OrderBodyRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.product.OrderRoomBodyRespVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@@ -61,6 +62,8 @@ public interface OrderBodyMapper extends BaseMapperX<OrderBodyDO> {
|
||||
.eq(OrderBodyDO::getOrganId, organId));
|
||||
}
|
||||
|
||||
|
||||
List<OrderRoomBodyRespVO> selectRoomAndBody(@Param("orderIds") List<Long> orderIds, @Param("organId") Long organId);
|
||||
// 生产单柜体记录数量
|
||||
default int selectCountByOrderId(Long orderId, Long organId, Integer deleted) {
|
||||
return Math.toIntExact(selectCount(new LambdaUpdateWrapper<OrderBodyDO>()
|
||||
|
||||
+1
-1
@@ -130,7 +130,7 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
IPage<OrderGoodsResp> selectGoodsList(@Param("page") IPage<OrderGoodsResp> page,@Param("pageReqVO") OrderPageReqVOCopy pageReqVO,@Param("organId") Long organId);
|
||||
|
||||
|
||||
List<OrderIds> selectOrderIds(@Param("pageReqVO") OrderPageReqVOCopy pageReqVO,@Param("organId") Long organId);
|
||||
List<OrderIds> selectOrderIds(@Param("orderIds") List<Long> orderIds,@Param("organId") Long organId);
|
||||
|
||||
|
||||
|
||||
|
||||
+3
@@ -21,6 +21,8 @@ public interface OptimizePlanService {
|
||||
|
||||
Boolean commit(Long planId);
|
||||
|
||||
Boolean endCutting(Long planId);
|
||||
|
||||
OptimizeParamResVO getOptimizeParam(Long planId);
|
||||
|
||||
OptimizeParamRespVO getOptimizePlanParam(Long planId);
|
||||
@@ -37,4 +39,5 @@ public interface OptimizePlanService {
|
||||
void saveOptimizationResults(SavePlanPlateResultReqVO req);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+14
@@ -196,6 +196,20 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean endCutting(Long planId) {
|
||||
PlanDO planDO = planMapper.selectById(planId);
|
||||
if (Objects.isNull(planDO)) {
|
||||
throw exception(PLAN_NOT_EXISTS);
|
||||
}
|
||||
planMapper.updateById(PlanDO.builder()
|
||||
.id(planId)
|
||||
.status(PlanStatusEnum.OPENEDMATERIAL.getStatus())
|
||||
.build());
|
||||
return Boolean.TRUE;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public OptimizeParamResVO getOptimizeParam(Long planId) {
|
||||
//小板列表
|
||||
|
||||
+7
@@ -5,6 +5,7 @@ import javax.validation.*;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.*;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.product.OrderBodyRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.product.OrderRoomBodyRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRespVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
@@ -76,6 +77,10 @@ public interface OrderService {
|
||||
*/
|
||||
List<OrderBodyRespVO> getOrderBody(Long orderId);
|
||||
|
||||
|
||||
List<OrderRoomBodyRespVO> getRoomAndBody(Long planId);
|
||||
|
||||
|
||||
/**
|
||||
* @param orderId: 生产单Id
|
||||
* @return Map<String, List<?>>
|
||||
@@ -161,4 +166,6 @@ public interface OrderService {
|
||||
* 自定义单号是否存在
|
||||
*/
|
||||
Boolean customOrderNoIsExists(String customOrderNo);
|
||||
|
||||
|
||||
}
|
||||
+19
@@ -1,6 +1,7 @@
|
||||
package com.cf.imes.module.executor.service.order;
|
||||
|
||||
import cn.smallbun.screw.core.util.CollectionUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
||||
import com.cf.imes.framework.mybatis.core.generator.SnowFlakeGenerator;
|
||||
@@ -8,6 +9,7 @@ import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.*;
|
||||
import com.cf.imes.framework.datapermission.core.util.DataPermissionUtils;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.product.OrderBodyRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.product.OrderRoomBodyRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRemark;
|
||||
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsIdVO;
|
||||
@@ -18,6 +20,7 @@ import com.cf.imes.module.executor.dal.dataobject.orderGroup.OrderGroupDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO;
|
||||
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.dataobject.rawgoods.RawGoodsDO;
|
||||
@@ -26,6 +29,7 @@ import com.cf.imes.module.executor.dal.mysql.orderBody.OrderBodyMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderGroup.OrderGroupMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderItem.OrderItemMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderParts.OrderPartsMapper;
|
||||
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.dal.mysql.process.OrderProcessMapper;
|
||||
@@ -66,6 +70,7 @@ import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.*;
|
||||
|
||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
@@ -95,6 +100,9 @@ public class OrderServiceImpl implements OrderService {
|
||||
@Resource
|
||||
private PlateMapper plateMapper;
|
||||
|
||||
@Resource
|
||||
private PlanMapper planMapper;
|
||||
|
||||
@Resource
|
||||
private PlateGoodMapper plateGoodMapper;
|
||||
|
||||
@@ -268,6 +276,17 @@ public class OrderServiceImpl implements OrderService {
|
||||
return orderBodyRespVOList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderRoomBodyRespVO> getRoomAndBody(Long planId) {
|
||||
|
||||
PlanDO planDO = planMapper.selectById(planId);
|
||||
|
||||
List<Long> orderIds = JSON.parseArray(planDO.getOrderNos()).toJavaList(Long.class);
|
||||
|
||||
return orderBodyMapper.selectRoomAndBody(orderIds,getUserOrganId());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<?>> getModule(Long orderId) {
|
||||
// 判断生产单是否删除 (包含判断存在)
|
||||
|
||||
+3
-1
@@ -56,6 +56,8 @@ public interface PlanService {
|
||||
|
||||
PageResult<OrderRespVOCopy> getOrderPage(OrderPageReqVOCopy pageReqVO);
|
||||
|
||||
PageResult<OrderGoodsResp> getOrderGoodsPage(OrderPageReqVOCopy pageReqVO);
|
||||
|
||||
List<PlatePage> getNotPlanPlateListPage(PlateReqPageVO pageVO);
|
||||
|
||||
Boolean addPlate(AddPlateReq req);
|
||||
@@ -72,6 +74,6 @@ public interface PlanService {
|
||||
|
||||
List<PlateResList> getPlateList(List<Long> planIds);
|
||||
|
||||
PageResult<OrderGoodsResp> getOrderGoodsPage(OrderPageReqVOCopy pageReqVO);
|
||||
|
||||
|
||||
}
|
||||
+73
-46
@@ -376,13 +376,85 @@ public class PlanServiceImpl implements PlanService {
|
||||
// 处理后的 filteredRecords 将不包含过滤后的数据为空的 record
|
||||
orderRespVOCopies.setRecords(filteredRecords);
|
||||
|
||||
orderRespVOCopies.setTotal(orderRespVOCopies.getRecords().size());
|
||||
// orderRespVOCopies.setTotal(orderRespVOCopies.getRecords().size());
|
||||
|
||||
|
||||
return new PageResult<>(orderRespVOCopies.getRecords(), orderRespVOCopies.getTotal());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public PageResult<OrderGoodsResp> getOrderGoodsPage(OrderPageReqVOCopy pageReqVO) {
|
||||
|
||||
|
||||
PageDTO<OrderRespVOCopy> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
|
||||
QueryWrapperX<OrderDO> queryWrapperX = new QueryWrapperX<>();
|
||||
queryWrapperX
|
||||
.eq("a.organ_id",getUserOrganId())
|
||||
.eq("a.status",OrderStatusEnum.NO_SORT.getStatus())
|
||||
.eq("a.deleted",false)
|
||||
.likeIfPresent("a.id", pageReqVO.getOrderId() != null ? pageReqVO.getOrderId().toString() : null)
|
||||
// .isNull("opi.item_id")
|
||||
.eqIfPresent("a.customer", pageReqVO.getConsignee())
|
||||
.eqIfPresent("a.custom_order_no", pageReqVO.getDefaultId())
|
||||
.eqIfPresent("a.address", pageReqVO.getConsigneeAddress())
|
||||
.betweenIfPresent("a.create_time", pageReqVO.getCreateTime())
|
||||
.eqIfPresent("op.is_special_shaped", pageReqVO.getRectangle() != null ? false: null)
|
||||
.eqIfPresent("op.is_special_shaped", pageReqVO.getSpecialShaped())
|
||||
.eqIfPresent("op.is_sculpt", pageReqVO.getSculpt())
|
||||
.eqIfPresent("op.is_door", pageReqVO.getIsDoor())
|
||||
.betweenIfPresent("op.height", new BigDecimal[]{pageReqVO.getLongMinRang(), pageReqVO.getLongMaxRang()})
|
||||
.betweenIfPresent("op.width", new BigDecimal[]{pageReqVO.getWidthMinRang(), pageReqVO.getWidthMaxRang()});
|
||||
List<Integer> filterTypes = new ArrayList<>();
|
||||
if (Objects.nonNull(pageReqVO.getHoleThrough()) && pageReqVO.getHoleThrough()) {
|
||||
filterTypes.add(PlanFilterTypeEnum.DIGGINGTHROUGHTHESHAPE.getType());
|
||||
}
|
||||
if (Objects.nonNull(pageReqVO.getBurrow()) && pageReqVO.getBurrow()) {
|
||||
filterTypes.add(PlanFilterTypeEnum.THEREAREPERFORATEDHOLES.getType());
|
||||
}
|
||||
if (Objects.nonNull(pageReqVO.getTwoDimensionalToolPath()) && pageReqVO.getTwoDimensionalToolPath()) {
|
||||
filterTypes.add(PlanFilterTypeEnum.TWODIMENSIONALCUTTINGPATH.getType());
|
||||
}
|
||||
|
||||
queryWrapperX.inIfPresent("op.filter_type", filterTypes);
|
||||
|
||||
|
||||
List<Long> orderIds = orderMapper.selectOrderIds(queryWrapperX);
|
||||
|
||||
|
||||
List<OrderIds> orderIdsList = plateMapper.selectOrderIds(orderIds,getUserOrganId());
|
||||
|
||||
|
||||
List<Long> goodsList = orderIdsList.stream().map(OrderIds::getGoodsId).distinct().toList();
|
||||
|
||||
|
||||
IPage<OrderGoodsResp> orderGoodsResps = goodsMapper.selectGoods(page,goodsList, getUserOrganId());
|
||||
|
||||
|
||||
List<OrderRespVOCopy> orderRespVOCopies = orderMapper.selectOrderListByIds(orderIdsList, getUserOrganId());
|
||||
|
||||
|
||||
for (OrderGoodsResp record : orderGoodsResps.getRecords()) {
|
||||
record.setOrderIds(orderIdsList.stream().filter(e -> Objects.equals(e.getGoodsId(), record.getGoodsId())).collect(Collectors.toList()));
|
||||
record.setOrderList(orderRespVOCopies.stream().filter(e -> Objects.equals(e.getGoodsId(), record.getGoodsId())).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
|
||||
return new PageResult<>(orderGoodsResps.getRecords(), orderGoodsResps.getTotal());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<PlatePage> getNotPlanPlateListPage(PlateReqPageVO pageVO) {
|
||||
|
||||
@@ -543,49 +615,4 @@ public class PlanServiceImpl implements PlanService {
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public PageResult<OrderGoodsResp> getOrderGoodsPage(OrderPageReqVOCopy pageReqVO) {
|
||||
|
||||
|
||||
PageDTO<OrderGoodsResp> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
|
||||
|
||||
List<Integer> filterTypes = new ArrayList<>();
|
||||
if (Objects.nonNull(pageReqVO.getHoleThrough()) && pageReqVO.getHoleThrough()) {
|
||||
filterTypes.add(PlanFilterTypeEnum.DIGGINGTHROUGHTHESHAPE.getType());
|
||||
}
|
||||
if (Objects.nonNull(pageReqVO.getBurrow()) && pageReqVO.getBurrow()) {
|
||||
filterTypes.add(PlanFilterTypeEnum.THEREAREPERFORATEDHOLES.getType());
|
||||
}
|
||||
if (Objects.nonNull(pageReqVO.getTwoDimensionalToolPath()) && pageReqVO.getTwoDimensionalToolPath()) {
|
||||
filterTypes.add(PlanFilterTypeEnum.TWODIMENSIONALCUTTINGPATH.getType());
|
||||
}
|
||||
|
||||
|
||||
|
||||
IPage<OrderGoodsResp> orderGoodsRespIPage = plateMapper.selectGoodsList(page,pageReqVO,getUserOrganId());
|
||||
|
||||
|
||||
if (CollectionUtil.isEmpty(orderGoodsRespIPage.getRecords())) {
|
||||
return new PageResult<>();
|
||||
}
|
||||
|
||||
|
||||
List<OrderIds> orderIds = plateMapper.selectOrderIds(pageReqVO,getUserOrganId());
|
||||
|
||||
|
||||
|
||||
List<OrderRespVOCopy> orderRespVOCopies = orderMapper.selectOrderListByIds(orderIds, getUserOrganId());
|
||||
|
||||
|
||||
for (OrderGoodsResp record : orderGoodsRespIPage.getRecords()) {
|
||||
record.setOrderIds(orderIds.stream().filter(e -> Objects.equals(e.getGoodsId(), record.getGoodsId())).collect(Collectors.toList()));
|
||||
record.setOrderList(orderRespVOCopies.stream().filter(e -> Objects.equals(e.getGoodsId(), record.getGoodsId())).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
|
||||
return new PageResult<>(orderGoodsRespIPage.getRecords(), orderGoodsRespIPage.getTotal());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+2
@@ -92,4 +92,6 @@ public interface PlateService {
|
||||
|
||||
List<BodyPlateDetailVO> getPlateModelByPlateId(List<Long> bodyIds);
|
||||
|
||||
List<Long> createNewPlate(OptimizationSavePlateReqVO reqVO);
|
||||
|
||||
}
|
||||
+74
@@ -21,10 +21,15 @@ 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.dal.dataobject.orderItem.OrderItemDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderModelDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.planitem.PlanItemDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.processStepItem.OrderProcessStepItemDO;
|
||||
import com.cf.imes.module.executor.dal.mysql.goods.GoodsMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderItem.OrderItemMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.planitem.PlanItemMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.processStepItem.ProcessStepItemMapper;
|
||||
import com.cf.imes.module.executor.enums.OrderItemType;
|
||||
import com.cf.imes.module.executor.util.RandomUtils;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.SnowflakeIdWorker3rd;
|
||||
import com.cf.imes.module.system.enums.ErrorCodeConstants;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
@@ -73,6 +78,15 @@ public class PlateServiceImpl implements PlateService {
|
||||
@Resource
|
||||
private OrderItemMapper orderItemMapper;
|
||||
|
||||
@Resource
|
||||
private GoodsMapper goodsMapper;
|
||||
|
||||
@Resource
|
||||
private PlanItemMapper planItemMapper;
|
||||
|
||||
@Resource
|
||||
private SnowflakeIdWorker3rd idWorker;
|
||||
|
||||
@Resource
|
||||
private ElasticsearchClient elasticsearchClient;
|
||||
|
||||
@@ -236,9 +250,69 @@ public class PlateServiceImpl implements PlateService {
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<Long> createNewPlate(OptimizationSavePlateReqVO reqVO) {
|
||||
|
||||
List<PlateDO> plateDOS = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < reqVO.getMultiple(); i++) {
|
||||
|
||||
// 生成板编号
|
||||
long plateNo = idWorker.nextId();
|
||||
long obtainingTime = SnowflakeIdWorker3rd.obtainingTime();
|
||||
|
||||
PlateDO plateDO = BeanUtils.toBean(reqVO, PlateDO.class);
|
||||
|
||||
plateDO.setRemark(reqVO.getRemake1() +","+ reqVO.getRemake2());
|
||||
|
||||
Long goodsId = goodsMapper.selectId(reqVO.getOrderId(), reqVO.getGoodsId(), getUserOrganId()).getId();
|
||||
|
||||
plateDO.setGoodsId(goodsId);
|
||||
|
||||
plateDO.setPlateNo((obtainingTime) + Long.toString(plateNo).substring(2));
|
||||
|
||||
plateDO.setArea(reqVO.getWidth().multiply(reqVO.getHeight()).movePointLeft(4).stripTrailingZeros());
|
||||
|
||||
plateDOS.add(plateDO);
|
||||
}
|
||||
|
||||
plateMapper.insertBatch(plateDOS);
|
||||
|
||||
List<OrderItemDO> orderItemDOS = new ArrayList<>();
|
||||
|
||||
plateDOS.forEach(plateDO -> {
|
||||
// 生产单明细表新增数据
|
||||
OrderItemDO orderItemDO = OrderItemDO.builder()
|
||||
.orderId(reqVO.getOrderId())
|
||||
.type(OrderItemType.BOARD.getCode())
|
||||
.roomId(reqVO.getRoomId())
|
||||
.bodyId(reqVO.getBodyId())
|
||||
.plateId(plateDO.getId())
|
||||
.build();
|
||||
orderItemDOS.add(orderItemDO);
|
||||
}
|
||||
);
|
||||
|
||||
orderItemMapper.insertBatch(orderItemDOS);
|
||||
|
||||
|
||||
List<PlanItemDO> planItemDOS = new ArrayList<>();
|
||||
|
||||
orderItemDOS.forEach(orderItemDO ->{
|
||||
|
||||
PlanItemDO planItemDO = PlanItemDO.builder()
|
||||
.planId(reqVO.getPlanId())
|
||||
.itemId(orderItemDO.getId())
|
||||
.build();
|
||||
planItemDOS.add(planItemDO);
|
||||
});
|
||||
|
||||
// 排单明细表新增数据
|
||||
planItemMapper.insertBatch(planItemDOS);
|
||||
|
||||
return plateDOS.stream().map(PlateDO::getId).toList();
|
||||
}
|
||||
|
||||
|
||||
private List<OrderModelDO> buildRespByPlateIds(Collection<Long> plateIds, String index) {
|
||||
|
||||
+42
@@ -52,4 +52,46 @@
|
||||
</foreach>
|
||||
AND organ_id = #{organId}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<select id="selectGoods" resultType="com.cf.imes.module.executor.controller.admin.plan.vo.OrderGoodsResp" parameterType="map">
|
||||
|
||||
|
||||
select distinct
|
||||
c.goods_id as goodsId,
|
||||
c.width as width,
|
||||
c.height as height,
|
||||
c.thickness as thickness,
|
||||
c.goods_name as goodsName,
|
||||
c.material as material,
|
||||
c.color as color
|
||||
|
||||
from order_goods c
|
||||
|
||||
where
|
||||
c.organ_id = 1
|
||||
and c.goods_id in
|
||||
<foreach item="goodsIds" collection="goodsIds" open="(" separator="," close=")">
|
||||
#{goodsIds}
|
||||
</foreach>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
+17
-2
@@ -14,6 +14,21 @@
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectOrderIds" resultType="java.lang.Long">
|
||||
|
||||
|
||||
select distinct a.id
|
||||
|
||||
from `orders` a
|
||||
left join order_item oi on a.id = oi.order_id and a.organ_id = oi.organ_id
|
||||
inner join order_plate op on oi.plate_id = op.id and oi.organ_id = op.organ_id
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<!-- inner join order_goods og on op.goods_id = og.id and op.organ_id = og.organ_id
|
||||
left join order_plan_item opi on oi.id = opi.item_id and oi.organ_id = opi.organ_id
|
||||
-->
|
||||
@@ -57,7 +72,8 @@
|
||||
(#{orderIds.goodsId})
|
||||
</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;
|
||||
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
|
||||
|
||||
|
||||
|
||||
@@ -67,5 +83,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
+26
@@ -30,4 +30,30 @@
|
||||
FROM `order_body` b
|
||||
WHERE b.order_id = #{orderId} and b.organ_id = #{organId}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="selectRoomAndBody"
|
||||
parameterType="java.lang.Long"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.order.vo.product.OrderRoomBodyRespVO">
|
||||
|
||||
|
||||
select id as bodyId,
|
||||
name as bodyName,
|
||||
room_id as roomId,
|
||||
room_name as roomName
|
||||
|
||||
from order_body
|
||||
|
||||
where organ_id = #{organId}
|
||||
|
||||
and order_id in
|
||||
|
||||
<foreach item="orderIds" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderIds}
|
||||
</foreach>
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
+7
-79
@@ -402,51 +402,13 @@
|
||||
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>
|
||||
where
|
||||
c.organ_id = #{organId}
|
||||
and a.is_cancel = 0
|
||||
and b.status = 2
|
||||
and a.deleted = false
|
||||
and opi.item_id is null
|
||||
|
||||
<if test="pageReqVO.orderId !=null">
|
||||
and a.order_id like concat('%', #{pageReqVO.orderId},'%')
|
||||
</if>
|
||||
<if test="pageReqVO.defaultId !=null">
|
||||
and b.custom_order_no = #{pageReqVO.defaultId}
|
||||
</if>
|
||||
<if test="pageReqVO.consignee !=null">
|
||||
and b.customer = #{pageReqVO.consignee}
|
||||
</if>
|
||||
<if test="pageReqVO.consigneeAddress !=null">
|
||||
and b.address = #{pageReqVO.consigneeAddress}
|
||||
</if>
|
||||
<if test="pageReqVO.createTime[0] !=null and pageReqVO.createTime[1] !=null ">
|
||||
and b.create_time between #{pageReqVO.createTime[0]} and #{pageReqVO.createTime[1]}
|
||||
</if>
|
||||
<if test="pageReqVO.rectangle !=null and pageReqVO.rectangle= true">
|
||||
and a.is_special_shaped = false
|
||||
</if>
|
||||
<if test="pageReqVO.specialShaped !=null ">
|
||||
and a.is_special_shaped = #{pageReqVO.specialShaped}
|
||||
</if>
|
||||
<if test="pageReqVO.sculpt !=null ">
|
||||
and a.is_sculpt = #{pageReqVO.sculpt}
|
||||
</if>
|
||||
<if test="pageReqVO.isDoor !=null ">
|
||||
and a.is_door = #{pageReqVO.isDoor}
|
||||
</if>
|
||||
<if test="pageReqVO.longMinRang !=null and pageReqVO.longMaxRang !=null">
|
||||
and a.height between #{pageReqVO.longMinRang} and #{pageReqVO.longMaxRang}
|
||||
</if>
|
||||
<if test="pageReqVO.widthMinRang !=null and pageReqVO.widthMaxRang !=null">
|
||||
and a.width between #{pageReqVO.widthMinRang} and #{pageReqVO.widthMaxRang}
|
||||
</if>
|
||||
<if test="pageReqVO.holeThrough !=null or pageReqVO.burrow !=null or pageReqVO.twoDimensionalToolPath !=null">
|
||||
and a.filter_type in (pageReqVO.holeThrough,pageReqVO.burrow,pageReqVO.twoDimensionalToolPath)
|
||||
</if>
|
||||
|
||||
</where>
|
||||
group by c.goods_id,c.id,b.id ,c.goods_name,c.width,c.height,c.thickness, c.material, c.color;
|
||||
|
||||
|
||||
@@ -464,50 +426,16 @@
|
||||
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>
|
||||
where
|
||||
c.organ_id = #{organId}
|
||||
and a.is_cancel = 0
|
||||
and b.status = 2
|
||||
and a.deleted = false
|
||||
and opi.item_id is null
|
||||
|
||||
<if test="pageReqVO.orderId !=null">
|
||||
and a.order_id like concat('%', #{pageReqVO.orderId},'%')
|
||||
</if>
|
||||
<if test="pageReqVO.defaultId !=null">
|
||||
and b.custom_order_no = #{pageReqVO.defaultId}
|
||||
</if>
|
||||
<if test="pageReqVO.consignee !=null">
|
||||
and b.customer = #{pageReqVO.consignee}
|
||||
</if>
|
||||
<if test="pageReqVO.consigneeAddress !=null">
|
||||
and b.address = #{pageReqVO.consigneeAddress}
|
||||
</if>
|
||||
<if test="pageReqVO.createTime[0] !=null and pageReqVO.createTime[1] !=null ">
|
||||
and b.create_time between #{pageReqVO.createTime[0]} and #{pageReqVO.createTime[1]}
|
||||
</if>
|
||||
<if test="pageReqVO.rectangle !=null and pageReqVO.rectangle= true">
|
||||
and a.is_special_shaped = false
|
||||
</if>
|
||||
<if test="pageReqVO.specialShaped !=null ">
|
||||
and a.is_special_shaped = #{pageReqVO.specialShaped}
|
||||
</if>
|
||||
<if test="pageReqVO.sculpt !=null ">
|
||||
and a.is_sculpt = #{pageReqVO.sculpt}
|
||||
</if>
|
||||
<if test="pageReqVO.isDoor !=null ">
|
||||
and a.is_door = #{pageReqVO.isDoor}
|
||||
</if>
|
||||
<if test="pageReqVO.longMinRang !=null and pageReqVO.longMaxRang !=null">
|
||||
and a.height between #{pageReqVO.longMinRang} and #{pageReqVO.longMaxRang}
|
||||
</if>
|
||||
<if test="pageReqVO.widthMinRang !=null and pageReqVO.widthMaxRang !=null">
|
||||
and a.width between #{pageReqVO.widthMinRang} and #{pageReqVO.widthMaxRang}
|
||||
</if>
|
||||
<if test="pageReqVO.holeThrough !=null or pageReqVO.burrow !=null or pageReqVO.twoDimensionalToolPath !=null">
|
||||
and a.filter_type in (pageReqVO.holeThrough,pageReqVO.burrow,pageReqVO.twoDimensionalToolPath)
|
||||
</if>
|
||||
|
||||
</where>
|
||||
and c.order_id in
|
||||
<foreach collection="orderIds" item="orderIds" open="(" close=")" separator=",">
|
||||
#{orderIds}
|
||||
</foreach>
|
||||
order by a.order_id
|
||||
</select>
|
||||
</mapper>
|
||||
+1
-2
@@ -22,8 +22,7 @@
|
||||
from order_package op
|
||||
join order_item oi on op.id = oi.package_id and op.organ_id = oi.organ_id
|
||||
where
|
||||
op.status <> 0
|
||||
and oi.package_id != 0
|
||||
oi.package_id != 0
|
||||
and op.organ_id = #{organId}
|
||||
and op.order_id in
|
||||
<foreach item="id" collection="orderIds" open="(" separator="," close=")">
|
||||
|
||||
Reference in New Issue
Block a user