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:
+1
-1
@@ -55,7 +55,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode RAW_GOODS_NOT_EXISTS = new ErrorCode(1_002_029_005, "生产单中未用到此板材");
|
||||
ErrorCode ORDER_STATUS_ERROR = new ErrorCode(1_002_029_006, "生产单不允许删除");
|
||||
ErrorCode APP_TOKEN_ERROR = new ErrorCode(1_002_029_007, "token获取失败");
|
||||
ErrorCode PLATE_PLAN_DATA_ERROR = new ErrorCode(1_002_029_008, "板材生产数据获取错误或此单为空单");
|
||||
ErrorCode PLATE_PLAN_DATA_ERROR = new ErrorCode(1_002_029_008, "板材生产数据获取错误或此单不存在");
|
||||
ErrorCode PARTS_DATA_ERROR = new ErrorCode(1_002_029_009, "配件数据获取错误");
|
||||
ErrorCode BODY_DATA_ERROR = new ErrorCode(1_002_029_010, "柜体数据获取错误");
|
||||
ErrorCode GOODS_DATA_ERROR = new ErrorCode(1_002_029_011, "商品信息获取错误");
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plate.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 生产单表 order Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PlateGoodsIdVO {
|
||||
|
||||
@Schema(description = "板件 ID", example = "32523")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "生产单号", example = "11087")
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "商品 ID", example = "14195")
|
||||
private Long goodsId;
|
||||
|
||||
@Schema(description = "是否删除", example = "1")
|
||||
private Integer deleted;
|
||||
}
|
||||
+13
-1
@@ -60,4 +60,16 @@ public interface GoodsMapper extends BaseMapperX<GoodsDO> {
|
||||
wrapper.eq(GoodsDO::getDeleted, 1);
|
||||
return update(wrapper);
|
||||
}
|
||||
}
|
||||
|
||||
// 通过orderId查找板材
|
||||
default List<GoodsDO> selectGoodsByOrderId(Long orderId, Long organId) {
|
||||
return selectList(new LambdaQueryWrapperX<GoodsDO>()
|
||||
.eq(GoodsDO::getOrderId, orderId)
|
||||
.eq(GoodsDO::getDeleted, 0)
|
||||
.eq(GoodsDO::getOrganId, organId));
|
||||
}
|
||||
|
||||
// 删板材,批量
|
||||
void updateDeletedById(@Param("ids") List<Long> ids, @Param("deleted") Integer deleted, @Param("organId") Long organId);
|
||||
|
||||
}
|
||||
+1
-2
@@ -29,10 +29,9 @@ public interface OrderMapper extends BaseMapperX<OrderDO> {
|
||||
default PageResult<OrderDO> selectPage(OrderPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<OrderDO>()
|
||||
.eqIfPresent(OrderDO::getParentNo, reqVO.getParentNo())
|
||||
.likeIfPresent(OrderDO::getId, String.valueOf(reqVO.getId()) != null ? "" : String.valueOf(reqVO.getId()))
|
||||
.likeIfPresent(OrderDO::getId, reqVO.getId() == null ? null : String.valueOf(reqVO.getId()))
|
||||
.betweenIfPresent(OrderDO::getDeliveryDate, reqVO.getDeliveryDate())
|
||||
.betweenIfPresent(OrderDO::getOrderDate, reqVO.getOrderDate())
|
||||
.eqIfPresent(OrderDO::getId, reqVO.getId())
|
||||
.eqIfPresent(OrderDO::getOrderType, reqVO.getOrderType())
|
||||
.eqIfPresent(OrderDO::getOrderSort, reqVO.getOrderSort())
|
||||
.eqIfPresent(OrderDO::getDataType, reqVO.getDataType())
|
||||
|
||||
+3
@@ -117,4 +117,7 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
List<Long> selectPlateIdListByBodyId(@Param("bodyId") Long bodyId, @Param("organId") Long organId);
|
||||
|
||||
List<PlateResList> selectPlateListByPlanId(@Param("planId") Long planId, @Param("organId") Long organId);
|
||||
|
||||
// 根据需要删除的小板id查找具体信息
|
||||
List<PlateGoodsIdVO> selectPlateGoodsListByList(@Param("plates") List<Long> goodsIdList, @Param("orderId") Long orderId, @Param("organId") Long organId);
|
||||
}
|
||||
+18
-3
@@ -11,6 +11,7 @@ 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.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;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO;
|
||||
@@ -65,6 +66,7 @@ import java.time.format.DateTimeParseException;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
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.module.executor.enums.ErrorCodeConstants.*;
|
||||
@@ -227,6 +229,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
|
||||
@Override
|
||||
public PageResult<OrderDO> getOrderPage(OrderPageReqVO pageReqVO) {
|
||||
System.out.println("pageReqVO " + pageReqVO);
|
||||
return orderMapper.selectPage(pageReqVO.setOrganId(SecurityFrameworkUtils.getLoginUser().getOrganId()));
|
||||
}
|
||||
|
||||
@@ -325,10 +328,23 @@ public class OrderServiceImpl implements OrderService {
|
||||
|
||||
// 先查再改
|
||||
List<Long> plateDOList = plateMapper.selectPlateIdListByBodyId(bodyId, SecurityFrameworkUtils.getLoginUser().getOrganId());
|
||||
System.out.println(" plateDOList " + plateDOList);
|
||||
// 删除小板
|
||||
plateMapper.updateDeletedById(plateDOList, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
|
||||
// 删除大板
|
||||
List<PlateGoodsIdVO> goodsIdList = plateMapper.selectPlateGoodsListByList(plateDOList, orderId, SecurityFrameworkUtils.getLoginUser().getOrganId());
|
||||
Map<Long,List<PlateGoodsIdVO>> goodsIdMap = goodsIdList.stream().collect(Collectors.groupingBy(PlateGoodsIdVO::getGoodsId));
|
||||
List<Long> goodsIdDeleted = new ArrayList<>();
|
||||
goodsIdMap.forEach((k,v)->{
|
||||
for(int i=0;i<v.size();i++){
|
||||
if (v.get(i).getDeleted() == OrderDeletedEnum.NOT_DELETED.getStatus()){
|
||||
break;
|
||||
}
|
||||
}
|
||||
goodsIdDeleted.add(k);
|
||||
});
|
||||
goodsMapper.updateDeletedById(goodsIdDeleted, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
|
||||
|
||||
List<Long> partsList = orderPartsMapper.selectPartsIdListByBodyId(bodyId, SecurityFrameworkUtils.getLoginUser().getOrganId());
|
||||
System.out.println(" partsList " + partsList);
|
||||
orderPartsMapper.updateDeletedById(partsList, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
|
||||
});
|
||||
}
|
||||
@@ -401,7 +417,6 @@ public class OrderServiceImpl implements OrderService {
|
||||
.setId(plateGoods)
|
||||
.setGoodsId(String.valueOf(goodsId));
|
||||
// 判断是否存在raw_goods_id
|
||||
System.out.println("goodsDO.getGoodsId() " + goodsDO.getGoodsId());
|
||||
if (goodsDO.getGoodsId() != null) {
|
||||
plateGoodDO.setGoodsId(goodsDO.getGoodsId());
|
||||
}else {
|
||||
|
||||
+25
-5
@@ -4,11 +4,13 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
||||
import com.cf.imes.framework.common.enums.ProcessProcessingTypeEnum;
|
||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderGroup.OrderGroupDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.processStep.ProcessStepDO;
|
||||
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.order.OrderMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderBody.OrderBodyMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderGroup.OrderGroupMapper;
|
||||
@@ -79,6 +81,9 @@ public class OrderProcessServiceImpl implements OrderProcessService {
|
||||
@Resource
|
||||
private PlateMapper plateMapper;
|
||||
|
||||
@Resource
|
||||
private GoodsMapper goodsMapper;
|
||||
|
||||
private static Integer INDEX = 0;
|
||||
|
||||
@Override
|
||||
@@ -116,15 +121,14 @@ public class OrderProcessServiceImpl implements OrderProcessService {
|
||||
ProcessStepDO processStepDO = BeanUtils.toBean(processRespDTO, ProcessStepDO.class).setId(processStepDOId).setOrderId(createReqVO.getOrderId())
|
||||
.setStatus(false).setProcessinfoId(processRespDTO.getId()).setOrderProcessId(orderProcess.getId()).setFinishTime(null).setSort(INDEX++);// 计划日期没有填写
|
||||
processStepDOS.add(processStepDO);
|
||||
|
||||
// 生产单中是否存在加工组,若存在加工组,需要逐条加工组信息写入到生产单工序步骤表
|
||||
|
||||
if (processRespDTO.getType() == ProcessTypeEnum.TYPE_SEVEN.getStatus()) {
|
||||
|
||||
List<OrderGroupDO> orderGroupDOS = orderGroupMapper.getOrderGroupByOrderId(createReqVO.getOrderId(), SecurityFrameworkUtils.getLoginUser().getOrganId());
|
||||
if (orderGroupDOS.size() != 0) { // 有加工组
|
||||
for (int i = 0; i < orderGroupDOS.size(); i++) {
|
||||
OrderProcessStepItemDO orderProcessStepItemDO = OrderProcessStepItemDO.builder()
|
||||
.name(orderGroupDOS.get(i).getName())
|
||||
.name(orderGroupDOS.get(i).getName()) // 加工组的名称
|
||||
.processStepId(processStepDOId)
|
||||
.orderProcessId(orderProcessId)
|
||||
.status(false)
|
||||
@@ -135,7 +139,23 @@ public class OrderProcessServiceImpl implements OrderProcessService {
|
||||
orderProcessStepItemDOS.add(orderProcessStepItemDO);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
} else if (processRespDTO.getType() == ProcessTypeEnum.TYPE_EIGHT.getStatus()) { // 若工序类型为板材
|
||||
List<GoodsDO> goodsDOS = goodsMapper.selectGoodsByOrderId(createReqVO.getOrderId(), SecurityFrameworkUtils.getLoginUser().getOrganId());
|
||||
if (goodsDOS.size() != 0) { // 有板材
|
||||
for (int i = 0; i < goodsDOS.size(); i++) {
|
||||
OrderProcessStepItemDO orderProcessStepItemDO = OrderProcessStepItemDO.builder()
|
||||
.name(goodsDOS.get(i).getGoodsName()) // 板块的名称
|
||||
.processStepId(processStepDOId)
|
||||
.orderProcessId(orderProcessId)
|
||||
.status(false)
|
||||
.groupName(processListReqDTO.getName())
|
||||
.bodyId(goodsDOS.get(i).getId())
|
||||
.groupId(0L)
|
||||
.build();
|
||||
orderProcessStepItemDOS.add(orderProcessStepItemDO);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
List<OrderBodyDO> orderBodyDOS = orderBodyMapper.getOrderBodyByOrderId(createReqVO.getOrderId(), SecurityFrameworkUtils.getLoginUser().getOrganId());
|
||||
for (int i = 0; i < orderBodyDOS.size(); i++) {
|
||||
OrderProcessStepItemDO orderProcessStepItemDO = OrderProcessStepItemDO.builder()
|
||||
@@ -194,7 +214,7 @@ public class OrderProcessServiceImpl implements OrderProcessService {
|
||||
|
||||
@Override
|
||||
public OrderProcessDO getOrderProcess(Long orderId) {
|
||||
return orderProcessMapper.selectOne("order_id", orderId ,"organ_id",getUserOrganId());
|
||||
return orderProcessMapper.selectOne("order_id", orderId, "organ_id", getUserOrganId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
-1
@@ -53,7 +53,6 @@ public class ApiDataAchieve {
|
||||
jsonPlatesData.put("order_no", orderNo);//生产单号需要传入赋值
|
||||
jsonPlatesData.put("format", "json");
|
||||
JSONObject dataPlates = apiDataProduction.getApiOrderMessage(token, jsonPlatesData);
|
||||
System.out.println(" dataPlates " + dataPlates);
|
||||
if (!dataPlates.getString("err_code").equals("0")) {
|
||||
throw exception(PLATE_PLAN_DATA_ERROR);
|
||||
}
|
||||
|
||||
+67
-25
@@ -46,6 +46,8 @@ public class ApiTypeRealize {
|
||||
|
||||
private Integer num = 0;
|
||||
|
||||
private Integer specialShapedNum = 0;
|
||||
|
||||
private Integer groupNum = 0;
|
||||
|
||||
private final static Integer X = 0;
|
||||
@@ -77,23 +79,21 @@ public class ApiTypeRealize {
|
||||
OrderDO orderDO = orderInfoChange(dataPlates, orderId, orderNo);
|
||||
List<OrderDO> order = new ArrayList<>();
|
||||
order.add(orderDO);
|
||||
|
||||
// 商品信息数据 信息以全
|
||||
Map<String, Map<Long, ?>> goodsInfoChange = rawGoodsInfoChange(dataGoods, orderId, dataBlocks);
|
||||
// System.out.println(" goodsInfoChange " + goodsInfoChange);
|
||||
List<GoodsDO> goodsDO = (List<GoodsDO>) goodsInfoChange.get("goodsDOS").values().stream()
|
||||
.collect(Collectors.toList());
|
||||
List<GoodsDO> goodsDO = (List<GoodsDO>) goodsInfoChange.get("goodsDOS").values().stream().collect(Collectors.toList());
|
||||
map.put("goodsDO", goodsDO);
|
||||
List<RawGoodsDO> rawGoodsDO = (List<RawGoodsDO>) goodsInfoChange.get("rawGoodsDOS").values().stream()
|
||||
.collect(Collectors.toList());
|
||||
List<RawGoodsDO> rawGoodsDO = (List<RawGoodsDO>) goodsInfoChange.get("rawGoodsDOS").values().stream().collect(Collectors.toList());
|
||||
map.put("rawGoodsDO", rawGoodsDO);
|
||||
|
||||
// 柜体信息 少异形数量、板材数量
|
||||
Map<Long, OrderBodyDO> bodyInfoChange = bodyInfoChange(dataBody, orderId);
|
||||
// System.out.println(" bodyInfoChange " + bodyInfoChange);
|
||||
|
||||
// 加工组 少异形数量、板材数量
|
||||
Map<String, Map<Long, ?>> group =
|
||||
groupInfoChange(dataModule, orderId, bodyInfoChange);
|
||||
Map<Long, OrderGroupDO> orderGroupDO = (Map<Long, OrderGroupDO>) group.get("orderGroup");
|
||||
map.put("groupDO", orderGroupDO.values().stream().collect(Collectors.toList()));
|
||||
Map<Long, List<Long>> groupLists = (Map<Long, List<Long>>) group.get("lists"); // 加工组中包含的板件、配件id
|
||||
// 配件
|
||||
Map<String, Map<Long, ?>> partsDO = partsInfoChange(dataParts, orderId,
|
||||
@@ -120,6 +120,7 @@ public class ApiTypeRealize {
|
||||
Map<Long, OrderBodyDO> bodyItemsPlates = (Map<Long, OrderBodyDO>) platesDO.get("bodyInfos");
|
||||
platesItems = orderPartsChange(orderGroupDO, groupLists, platesItems);// item补充
|
||||
itemsList.addAll(platesItems.values());
|
||||
map.put("groupDO", groupAddUnregularNum(itemsList, orderPlatesDO, orderGroupDO).values().stream().collect(Collectors.toList()));
|
||||
// System.out.println("生产单数据 " + orderDO+ " 商品信息1 " + goodsDO + " 商品信息2 "
|
||||
// + rawGoodsDO + " 板材信息 " + new ArrayList<>(orderPlatesDO.values())
|
||||
// + " 配件信息 " + new ArrayList<>(orderPartsDO.values())
|
||||
@@ -128,7 +129,6 @@ public class ApiTypeRealize {
|
||||
// + " 配件Item " + partsItems + " 板材Item " + platesItems);
|
||||
map.put("orderDO", order);
|
||||
map.put("itemDO", itemsList);
|
||||
// System.out.println(" bodyItemsPlates " + bodyItemsPlates);
|
||||
map.put("bodyDO", bodyItemsPlates.values().stream().collect(Collectors.toList()));
|
||||
return map;
|
||||
}
|
||||
@@ -136,21 +136,22 @@ public class ApiTypeRealize {
|
||||
|
||||
/**
|
||||
* bodyInfoChange: BoxId body 暂时未用
|
||||
* @param orderGroupDO: ModuleID group
|
||||
* @param groupLists: ModuleID 板材、配件id
|
||||
* @param items: ItemID item
|
||||
*
|
||||
* @param orderGroupDO: ModuleID group
|
||||
* @param groupLists: ModuleID 板材、配件id
|
||||
* @param items: ItemID item
|
||||
* @return Map<Integer, OrderItemDO>
|
||||
* @author Administrator
|
||||
* @date 2024/5/8
|
||||
*/
|
||||
public Map<Long, OrderItemDO> orderPartsChange(Map<Long, OrderGroupDO> orderGroupDO,
|
||||
Map<Long, List<Long>> groupLists, Map<Long, OrderItemDO> items) {
|
||||
Map<Long, List<Long>> groupLists, Map<Long, OrderItemDO> items) {
|
||||
|
||||
groupLists.forEach((k, v) -> {
|
||||
v.forEach(v1 -> {
|
||||
if (items.get(v1) != null) {
|
||||
|
||||
if (items.containsKey(v1) && (items.get(v1).getGroupId() == null || items.get(v1).getGroupId() == 0)) {
|
||||
if (items.get(v1).getGroupId() == null || items.get(v1).getGroupId() == 0) {
|
||||
items.get(v1).setGroupId(orderGroupDO.get(k).getId());
|
||||
} else { // 如果groupId已存在值(即不为null),则创建一个新的OrderItemDO对象
|
||||
OrderItemDO item = OrderItemDO.builder()
|
||||
@@ -166,7 +167,7 @@ public class ApiTypeRealize {
|
||||
.plateId(items.get(v1).getPlateId())
|
||||
.num(items.get(v1).getNum())
|
||||
.build();
|
||||
items.put(orderGroupDO.get(k).getId(), item); //再复查
|
||||
items.put(item.getId(), item); //再复查
|
||||
}
|
||||
|
||||
if (items.get(v1).getPlateId() != null)
|
||||
@@ -177,10 +178,41 @@ public class ApiTypeRealize {
|
||||
groupNum = 0;
|
||||
});
|
||||
|
||||
System.err.println(" item " + items);
|
||||
return items;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加工组异形板赋值
|
||||
*/
|
||||
public Map<Long, OrderGroupDO> groupAddUnregularNum(List<OrderItemDO> itemsList, Map<Long, PlateDO> orderPlatesDO, Map<Long, OrderGroupDO> orderGroupDO) {
|
||||
|
||||
Map<Long, List<OrderItemDO>> groupPlate = itemsList.stream().collect(Collectors.groupingBy(OrderItemDO::getGroupId));
|
||||
List<PlateDO> orderItemDOList = orderPlatesDO.values().stream().collect(Collectors.toList());
|
||||
Map<Long, PlateDO> plateDOMap = orderItemDOList.stream().collect(Collectors.toMap(PlateDO::getId, plate -> plate));
|
||||
List<OrderGroupDO> orderGroupDOList = orderGroupDO.values().stream().collect(Collectors.toList());
|
||||
Map<Long, OrderGroupDO> orderGroupDOMap = orderGroupDOList.stream().collect(Collectors.toMap(OrderGroupDO::getId, v -> v));
|
||||
|
||||
System.out.println("groupPlate " + groupPlate + " plateDOMap " + plateDOMap + " orderGroupDOMap " + orderGroupDOMap);
|
||||
|
||||
groupPlate.forEach((k, v) -> { // k 加工组id
|
||||
|
||||
v.forEach(item -> {
|
||||
if (plateDOMap.get(item.getPlateId()) != null) {
|
||||
if (plateDOMap.get(item.getPlateId()).getIsSpecialShaped()) { // 异形相加
|
||||
specialShapedNum++;
|
||||
System.out.println(k + " 对应 " + specialShapedNum);
|
||||
}
|
||||
}
|
||||
});
|
||||
if (orderGroupDOMap.get(k) != null) {// m 加工组
|
||||
orderGroupDOMap.get(k).setUnregularNum(specialShapedNum);
|
||||
}
|
||||
;
|
||||
specialShapedNum = 0;
|
||||
});
|
||||
return orderGroupDO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加工组 信息转换
|
||||
*/
|
||||
@@ -293,7 +325,7 @@ public class ApiTypeRealize {
|
||||
* @author Administrator
|
||||
* @date 2024/4/30
|
||||
*/
|
||||
public Map<String, Map<Long, ?>> rawGoodsInfoChange(JSONObject dataRawGoods, Long orderId , JSONObject dataBlocks) {
|
||||
public Map<String, Map<Long, ?>> rawGoodsInfoChange(JSONObject dataRawGoods, Long orderId, JSONObject dataBlocks) {
|
||||
Map<String, Map<Long, ?>> map = new HashMap<>();
|
||||
Map<Long, RawGoodsDO> rawGoodsDOS = new HashMap<>();
|
||||
Map<Long, GoodsDO> goodsDOS = new HashMap<>();
|
||||
@@ -380,7 +412,6 @@ public class ApiTypeRealize {
|
||||
|
||||
}
|
||||
}
|
||||
// System.out.println(" bodyInfos " + bodyInfos);
|
||||
return bodyInfos;
|
||||
}
|
||||
|
||||
@@ -410,7 +441,7 @@ public class ApiTypeRealize {
|
||||
Map<String, Map<Long, ?>> map = new HashMap<>();
|
||||
Map<Long, OrderPartsDO> partsInfos = new HashMap<>();
|
||||
Map<Long, OrderItemDO> partsItem = new HashMap<>();
|
||||
Map<Long, OrderPartsRemark> remarks =new HashMap<>();
|
||||
Map<Long, OrderPartsRemark> remarks = new HashMap<>();
|
||||
|
||||
if (value != null && !value.isEmpty()) {
|
||||
JSONArray partsLists = value.getJSONArray("List");
|
||||
@@ -435,7 +466,7 @@ public class ApiTypeRealize {
|
||||
.isComposite(parts.getBoolean("IsComposite"))
|
||||
.remark(parts.getString("Remark"))
|
||||
.build();
|
||||
remarks.put(parts.getLong("ItemID"),partsRemarkChange(parts, orderId, partsId));
|
||||
remarks.put(parts.getLong("ItemID"), partsRemarkChange(parts, orderId, partsId));
|
||||
partsInfos.put(parts.getLong("ItemID"), partsInfo);
|
||||
|
||||
// item 明细
|
||||
@@ -480,8 +511,8 @@ public class ApiTypeRealize {
|
||||
* 板材信息转换 写表 Integer指板材的ItemID板id 加一个板材自定义编号
|
||||
*/
|
||||
private Map<String, Map<Long, ?>> platesInfoChange(JSONObject value, JSONObject dataPlates, Long orderId,
|
||||
Map<Long, GoodsDO> goodsDOMap, Map<Long, OrderBodyDO> bodyInfos,
|
||||
JSONObject dataBlocks) {
|
||||
Map<Long, GoodsDO> goodsDOMap, Map<Long, OrderBodyDO> bodyInfos,
|
||||
JSONObject dataBlocks) {
|
||||
// 板材 写ES
|
||||
Map<Long, PlateDetail> plateDetail = platesDetailChange(value);
|
||||
|
||||
@@ -509,7 +540,7 @@ public class ApiTypeRealize {
|
||||
.orderId(orderId)
|
||||
.name(plate.getString("BoardName"))
|
||||
// .plateNo(plate.getString("CustBlockNo"))
|
||||
.plateNo((obtainingTime)+ Long.toString(plateNo).substring(2))
|
||||
.plateNo((obtainingTime) + Long.toString(plateNo).substring(2))
|
||||
.type(type)
|
||||
|
||||
.goodsId(goodsDOMap.get(plate.getLong("GoodsID")) != null
|
||||
@@ -591,23 +622,34 @@ public class ApiTypeRealize {
|
||||
}
|
||||
|
||||
List<OrderItemDO> platesList = platesItem.values().stream().collect(Collectors.toList());
|
||||
List<PlateDO> plateDOList = platesInfos.values().stream().collect(Collectors.toList());
|
||||
|
||||
Map<Long, List<OrderItemDO>> platesDetail = platesList.stream()
|
||||
.collect(Collectors.groupingBy(OrderItemDO::getBodyId));
|
||||
.collect(Collectors.groupingBy(OrderItemDO::getBodyId)); // 根据柜体分组
|
||||
|
||||
Map<Long, PlateDO> plateDOMap = plateDOList.stream()
|
||||
.collect(Collectors.toMap(PlateDO::getId, plate -> plate)); // 板件id为key
|
||||
|
||||
// 遍历platesDetail
|
||||
|
||||
platesDetail.forEach((k, v) -> {
|
||||
Integer specialShapedNum = 0;
|
||||
|
||||
v.forEach(item -> {
|
||||
num++;
|
||||
|
||||
if (plateDOMap.get(item.getPlateId()).getIsSpecialShaped()) { // 异形相加
|
||||
specialShapedNum++;
|
||||
}
|
||||
});
|
||||
bodyInfos.forEach((n, m) -> {
|
||||
if (k == m.getId()) {
|
||||
m.setPlateNum(num);
|
||||
m.setUnregularNum(specialShapedNum);
|
||||
}
|
||||
});
|
||||
num = 0;
|
||||
specialShapedNum = 0;
|
||||
});
|
||||
// System.err.println(bodyInfos);
|
||||
map.put("platesInfos", platesInfos);
|
||||
map.put("platesItems", platesItem);
|
||||
map.put("plateDetail", plateDetail);
|
||||
|
||||
+5
-2
@@ -166,7 +166,7 @@ public class ExcelTypeRealize {
|
||||
Long groupId = (Long) snowFlakeGenerator.nextId(null);
|
||||
// 板数量
|
||||
final Double[] plateCountByCombination = {0.0};
|
||||
OrderGroupDO orderGroupDO = OrderGroupDO.builder().id(groupId).orderId(orderId).orderId(organId).bodyId(bodyId)
|
||||
OrderGroupDO orderGroupDO = OrderGroupDO.builder().id(groupId).orderId(orderId).organId(organId).bodyId(bodyId)
|
||||
.groupTypeId(groupTypeId).groupTypeName(synthesis).name(combinationName).width(0.0).height(0.0)
|
||||
.depth(0.0).multiNum(0).plateNum(0).unregularNum(0).filename("无").remark("无").build();
|
||||
|
||||
@@ -232,7 +232,9 @@ public class ExcelTypeRealize {
|
||||
|
||||
});
|
||||
orderGroupDO.setPlateNum(plateCountByCombination[0].intValue());
|
||||
orderGroupDOS.add(orderGroupDO);
|
||||
if (orderGroupDO.getName() != null && orderGroupDO.getName().trim().isEmpty()) {
|
||||
orderGroupDOS.add(orderGroupDO);
|
||||
}
|
||||
});
|
||||
});
|
||||
orderBodyDO.setPlateNum(Integer.valueOf(plateCountByCabinetName[0].intValue()));
|
||||
@@ -251,6 +253,7 @@ public class ExcelTypeRealize {
|
||||
map.put("orderModuleExtraDOS", orderModuleExtraDOS);
|
||||
map.put("orderModelDOS", orderModelDOS);
|
||||
map.put("orderPartsRemarks", orderPartsRemarks);
|
||||
System.out.println(" orderGroupDOS " + orderGroupDOS);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
+10
@@ -41,4 +41,14 @@
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<update id="updateDeletedById">
|
||||
UPDATE order_goods
|
||||
SET deleted = #{deleted}
|
||||
WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>AND organ_id = #{organId}
|
||||
</update>
|
||||
</mapper>
|
||||
+12
@@ -311,4 +311,16 @@
|
||||
SELECT plate_id FROM order_item
|
||||
WHERE body_id = #{bodyId} AND organ_id = #{organId}
|
||||
</select>
|
||||
|
||||
<select id="selectPlateGoodsListByList" resultType="com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsIdVO">
|
||||
SELECT order_id, id, goods_id, deleted
|
||||
FROM order_plate op
|
||||
WHERE op.organ_id = #{organId} AND op.order_id = #{orderId} AND op.id in
|
||||
|
||||
<foreach collection="plates" item="plate" open="(" close=")" separator=",">
|
||||
|
||||
#{plate}
|
||||
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user