mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
bug解决
This commit is contained in:
+5
-2
@@ -8,6 +8,9 @@ import lombok.Data;
|
||||
@Data
|
||||
public class OptimizePlateDetialRespVO {
|
||||
|
||||
@Schema(description = "大板ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long boardId;
|
||||
|
||||
@Schema(description = "大板名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String plateName;
|
||||
|
||||
@@ -17,8 +20,8 @@ public class OptimizePlateDetialRespVO {
|
||||
@Schema(description = "颜色", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String color;
|
||||
|
||||
@Schema(description = "纹路类型,0 正纹 1 可翻转 2 反纹", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Integer texture;
|
||||
@Schema(description = "是否有纹路", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Boolean hasTexture;
|
||||
|
||||
@Schema(description = "厚度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Double thickness;
|
||||
|
||||
+3
@@ -169,9 +169,12 @@ public class PlateDetialRespVO {
|
||||
@Schema(description = "加工组名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String processGroupName;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "开门类型,0 无 1 左 2 右 3 上 4 下", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
private Integer openDoorType;
|
||||
|
||||
|
||||
@Schema(description = "是否有孔", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
private Boolean hasHole;
|
||||
|
||||
|
||||
+7
@@ -40,6 +40,13 @@ public class OrderModelDO extends ESDocument {
|
||||
@Schema(description = "小板类型")
|
||||
private String boardType;
|
||||
|
||||
|
||||
@Schema(description = "开料长")
|
||||
private BigDecimal splitLength;
|
||||
@Schema(description = "开料宽")
|
||||
private BigDecimal splitWidth;
|
||||
|
||||
|
||||
@Schema(description = "偏移量X")
|
||||
private BigDecimal offsetX;
|
||||
@Schema(description = "偏移量Y")
|
||||
|
||||
+4
@@ -6,6 +6,7 @@ import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderModuleRe
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPlatesDetailRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateDetailReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateDetailRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderModuleExtra.OrderModuleExtraDO;
|
||||
@@ -31,4 +32,7 @@ public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {
|
||||
|
||||
|
||||
List<PlateRespVO> selectPlateList(PlateDetailReqVO reqVO);
|
||||
|
||||
|
||||
PlateDetailRespVO selectPlateNumList(@Param("orderId") Long orderId);
|
||||
}
|
||||
+1
-1
@@ -71,7 +71,7 @@ public interface PlanMapper extends BaseMapperX<PlanDO> {
|
||||
|
||||
default PlanDO selectByOrderId(Long orderId) {
|
||||
return selectOne(new MPJLambdaWrapperX<PlanDO>()
|
||||
.eqIfPresent(PlanDO::getOrderNos, orderId));
|
||||
.like(PlanDO::getOrderNos, orderId));
|
||||
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -90,7 +90,7 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
|
||||
Set<Long> selectBatchOrderIdsAndGoodsIds(@Param("itemList") List<PlanSaveReqVO.Item> itemList);
|
||||
|
||||
PlateDetailRespVO selectPlateNumList(PlateDetailReqVO reqVO);
|
||||
// PlateDetailRespVO selectPlateNumList(PlateDetailReqVO reqVO);
|
||||
|
||||
List<PlateDetialRespVO> selectPlateDetialList(@Param("orderId") Long orderId);
|
||||
|
||||
|
||||
+3
-1
@@ -1,6 +1,8 @@
|
||||
package com.cf.imes.module.executor.service.optimizeplan;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.lang.Snowflake;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import co.elastic.clients.elasticsearch.ElasticsearchClient;
|
||||
import co.elastic.clients.elasticsearch._types.FieldValue;
|
||||
@@ -90,7 +92,7 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
@Resource
|
||||
private ElasticsearchClient elasticsearchClient;
|
||||
|
||||
//public static final String ORDER_PLATE_MODEL = "imes_order_plate_model";
|
||||
private Snowflake snowflake = IdUtil.getSnowflake();
|
||||
|
||||
@Resource
|
||||
private MachineApi machineApi;
|
||||
|
||||
+9
-2
@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import cn.smallbun.screw.core.util.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
||||
import com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConstants;
|
||||
import com.cf.imes.framework.common.exception.util.ServiceExceptionUtil;
|
||||
import com.cf.imes.framework.mybatis.core.generator.SnowFlakeGenerator;
|
||||
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.*;
|
||||
@@ -37,11 +39,13 @@ import com.cf.imes.module.executor.util.fileConversion.admin.api.webcad.ApiTypeR
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.ExcelTypeRealize;
|
||||
import com.cf.imes.module.system.api.application.ApplicationApi;
|
||||
import com.cf.imes.module.system.api.user.AdminUserApi;
|
||||
import com.cf.imes.module.system.enums.ErrorCodeConstants;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
@@ -277,6 +281,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long importApiData(String orderNo) {
|
||||
// 获取token
|
||||
Long organId = SecurityFrameworkUtils.getLoginUser().getOrganId();
|
||||
@@ -399,11 +404,13 @@ public class OrderServiceImpl implements OrderService {
|
||||
goodsDO = (List<GoodsDO>) map.get("goodsDO");
|
||||
List<PlateGoodDO> plateGoodDOS = (List<PlateGoodDO>) map.get("plateGoodDOLists");
|
||||
validateCustomOrderNoExists(order.get(0).getCustomOrderNo());
|
||||
|
||||
orderInputProcessor.batchInsert(rawGoodsDO, bodyDO, groupDO, partsDO, plateDO, null, itemDO, order.get(0),goodsDO,plateGoodDOS);
|
||||
List<OrderModelDO> orderModelDOs = BeanUtils.toBean(plateDetail, OrderModelDO.class);
|
||||
orderModelDOs.forEach(orderModelDO -> orderModelDO.setOrderId(order.get(0).getId()));
|
||||
|
||||
orderInputProcessor.batchSaveModel(orderModelDOs);
|
||||
orderInputProcessor.batchInsert(rawGoodsDO, bodyDO, groupDO, partsDO, plateDO, null, itemDO, order.get(0),goodsDO,plateGoodDOS);
|
||||
// System.out.println("plateDO = " + plateDO+ " BeanUtils.toBean(plateDetail, OrderModelDO.class) = " + orderModelDOs);
|
||||
|
||||
return order.get(0).getId();
|
||||
// return null;
|
||||
}
|
||||
|
||||
+1
-1
@@ -270,7 +270,7 @@ public class PlanServiceImpl implements PlanService {
|
||||
.eqIfPresent("op.is_door", pageReqVO.getIsDoor())
|
||||
.betweenIfPresent("op.height", new BigDecimal[]{pageReqVO.getLongMinRang(), pageReqVO.getLongMaxRang()})
|
||||
.betweenIfPresent("op.width", new BigDecimal[]{pageReqVO.getWidthMinRang(), pageReqVO.getWidthMaxRang()})
|
||||
.groupBy("a.id","og.id")
|
||||
.groupBy("a.id","og.id","og.goods_name","og.color","og.material","op.goods_id")
|
||||
.orderByDesc("a.create_time");
|
||||
List<Integer> filterTypes = new ArrayList<>();
|
||||
if (Objects.nonNull(pageReqVO.getHoleThrough()) && pageReqVO.getHoleThrough()) {
|
||||
|
||||
+4
-2
@@ -112,7 +112,8 @@ public class PlateServiceImpl implements PlateService {
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
|
||||
// 查询生产单下的大板,余料板,排单状态的信息
|
||||
PlateDetailRespVO plateDetailRespVO = plateMapper.selectPlateNumList(reqVO);
|
||||
PlateDetailRespVO plateDetailRespVO = orderItemMapper.selectPlateNumList(reqVO.getOrderId());
|
||||
// PlateDetailRespVO plateDetailRespVO = plateMapper.selectPlateNumList(reqVO);
|
||||
plateDetailRespVO.setCompanyId(loginUser.getId());
|
||||
|
||||
// PlateRespVO plateRespVO = BeanUtil.toBean(plateDetailRespVO, PlateRespVO.class);
|
||||
@@ -207,7 +208,7 @@ public class PlateServiceImpl implements PlateService {
|
||||
.in(OrderItemDO::getBodyId, bodyIds)
|
||||
.select(OrderItemDO::getBodyId)
|
||||
);
|
||||
Set<Long> plateIds = list.stream().map(BodyPlateIdDTO::getPlateId).collect(Collectors.toSet());
|
||||
List<Long> plateIds = list.stream().map(BodyPlateIdDTO::getPlateId).collect(Collectors.toList());
|
||||
List<OrderModelDO> orderModelDOS = buildRespByPlateIds(plateIds, ORDER_PLATE_MODEL);
|
||||
Map<Long, List<OrderModelDO>> map = orderModelDOS.stream().collect(Collectors.groupingBy(e -> {
|
||||
return list.stream().filter(f -> Objects.equals(f.getPlateId(), e.getPlateId())).map(BodyPlateIdDTO::getBodyId).findAny().orElse(null);
|
||||
@@ -241,6 +242,7 @@ public class PlateServiceImpl implements PlateService {
|
||||
SearchRequest.Builder builder = new SearchRequest.Builder();
|
||||
builder.index(index);
|
||||
builder.query(q -> q.terms(b -> b.field("plateId").terms(e->e.value(fieldValues))));
|
||||
builder.size(plateIds.size());
|
||||
try {
|
||||
SearchResponse<OrderModelDO> search = elasticsearchClient.search(builder.build(), OrderModelDO.class);
|
||||
List<Hit<OrderModelDO>> hits = search.hits().hits();
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
og.goods_name, og.color, og.material, op.goods_id, count(op.id) as num, sum(op.area) as area
|
||||
from `order` a
|
||||
inner join order_plate op on a.id = op.order_id and op.is_cancel = 0
|
||||
inner join order_goods og on op.goods_id = og.goods_id
|
||||
inner join order_goods og on op.goods_id = og.id
|
||||
left join order_item oi on a.id = oi.order_id
|
||||
left join order_plan_item opi on oi.id = opi.item_id
|
||||
${ew.customSqlSegment}
|
||||
|
||||
+30
@@ -99,4 +99,34 @@
|
||||
</where>
|
||||
|
||||
</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"
|
||||
resultType="java.lang.Long">
|
||||
|
||||
select distinct
|
||||
count(distinct og.id) as bigPlateNum,
|
||||
op.status as planStatus,
|
||||
sum(orp.count )as remainPlateNum
|
||||
from order_item oi
|
||||
join order_plan_item opi on oi.id = opi.item_id
|
||||
join order_plan op on opi.plan_id = op.id
|
||||
left join order_remain_plate orp on orp.plan_id = op.id
|
||||
join order_goods og on oi.order_id = og.order_id
|
||||
where oi.order_id = #{orderId}
|
||||
group by planStatus;
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
+38
-22
@@ -89,26 +89,35 @@
|
||||
|
||||
|
||||
|
||||
<resultMap id="PlateNumListMap" type="com.cf.imes.module.executor.controller.admin.plate.vo.PlateDetailRespVO">
|
||||
<!-- <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">
|
||||
<!--<!– <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 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>
|
||||
<!-- </select>-->
|
||||
|
||||
|
||||
|
||||
@@ -177,7 +186,8 @@
|
||||
|
||||
<result property="boardNum" column="boardNum"/>
|
||||
<result property="plateNum" column="plateNum"/>
|
||||
<result property="texture" column="texture"/>
|
||||
<result property="hasTexture" column="hasTexture"/>
|
||||
<result property="boardId" column="boardId"/>
|
||||
<result property="plateName" column="plateName"/>
|
||||
<result property="material" column="material"/>
|
||||
<result property="color" column="color"/>
|
||||
@@ -192,7 +202,10 @@
|
||||
|
||||
select count(distinct og.id) as boardNum,
|
||||
count(distinct op.id) as plateNum,
|
||||
op.texture as texture,
|
||||
(case
|
||||
when p.texture ='' then false
|
||||
else true end ) as hasTexture,
|
||||
og.id as boardId,
|
||||
og.goods_name as plateName,
|
||||
og.material as material,
|
||||
og.color as color,
|
||||
@@ -204,7 +217,7 @@
|
||||
left join plate p on og.goods_id = p.id
|
||||
left join order_remain_plate orp on op.id = orp.plan_id
|
||||
where og.order_id = #{orderId}
|
||||
group by plateName,material,color,thickness,spec,remainPlateNum,texture;
|
||||
group by boardId,plateName,material,color,thickness,spec,remainPlateNum,hasTexture;
|
||||
|
||||
</select>
|
||||
|
||||
@@ -215,7 +228,10 @@
|
||||
|
||||
select count(distinct og.id) as boardNum,
|
||||
count(distinct op.id) as plateNum,
|
||||
op.texture as texture,
|
||||
(case
|
||||
when p.texture ='' then false
|
||||
else true end ) as hasTexture,
|
||||
og.id as boardId,
|
||||
og.goods_name as plateName,
|
||||
og.material as material,
|
||||
og.color as color,
|
||||
@@ -232,7 +248,7 @@
|
||||
#{orderIds}
|
||||
</foreach>
|
||||
|
||||
group by plateName,material,color,thickness,spec,remainPlateNum,texture;
|
||||
group by boardId,plateName,material,color,thickness,spec,remainPlateNum,hasTexture;
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user