Merge remote-tracking branch 'origin/main'

This commit is contained in:
liuzhaotian
2024-06-22 09:52:09 +08:00
11 changed files with 42 additions and 21 deletions
@@ -23,7 +23,7 @@ public class OrderProcessApiImpl implements OrderProcessApi{
@Override @Override
public CommonResult<Boolean> getOrderProcessByProcessGroupId(Long id) { public CommonResult<Boolean> getOrderProcessByProcessGroupId(Long id) {
List<OrderProcessDO> plateDOS = orderProcessService.getOrderProcessByProcessGroupId(id); List<OrderProcessDO> plateDOS = orderProcessService.getOrderProcessByProcessGroupId(id);
if (plateDOS == null) { if (plateDOS.size() == 0) {
return success(false); return success(false);
} }
return success(true); return success(true);
@@ -67,4 +67,8 @@ public class OrderPlatesDetailReqVO {
@ExcelProperty("备注") @ExcelProperty("备注")
private String remark; private String remark;
@Schema(description = "颜色", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")
@ExcelProperty("颜色")
private String color;
} }
@@ -24,6 +24,9 @@ public class OrderPlatesDetailRespVO {
@Schema(description = "配件名称", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "配件名称", requiredMode = Schema.RequiredMode.REQUIRED)
private String partName; private String partName;
@Schema(description = "配件单位", requiredMode = Schema.RequiredMode.REQUIRED)
private String unit;
@Schema(description = "柜体中的配件数量", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "柜体中的配件数量", requiredMode = Schema.RequiredMode.REQUIRED)
private Double plateNum; private Double plateNum;
} }
@@ -84,7 +84,7 @@ public interface OrderPartsMapper extends BaseMapperX<OrderPartsDO> {
return update(wrapper); return update(wrapper);
} }
void updateDeletedById(@Param("bodyId") List<Long> bodyIds, @Param("deleted") Integer deleted, @Param("organId") Long organId); void updateDeletedById(@Param("partsIds") List<Long> partsIds, @Param("deleted") Integer deleted, @Param("organId") Long organId);
List<PrintOrderPartsRespVO> selectPartList( @Param("orderIds") List<Long> orderIds,@Param("organId") Long organId); List<PrintOrderPartsRespVO> selectPartList( @Param("orderIds") List<Long> orderIds,@Param("organId") Long organId);
@@ -106,7 +106,7 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
return update(wrapper); return update(wrapper);
} }
void updateDeletedById(@Param("bodyIds") List<Long> bodyId, @Param("deleted") Integer deleted, @Param("organId") Long organId); void updateDeletedById(@Param("plateIds") List<Long> plateIds, @Param("deleted") Integer deleted, @Param("organId") Long organId);
int countPlateByOrderId(@Param("orderId") Long orderId, @Param("organId") Long organId, @Param("deleted") Integer deleted); int countPlateByOrderId(@Param("orderId") Long orderId, @Param("organId") Long organId, @Param("deleted") Integer deleted);
@@ -325,8 +325,10 @@ public class OrderServiceImpl implements OrderService {
// 先查再改 // 先查再改
List<Long> plateDOList = plateMapper.selectPlateIdListByBodyId(bodyId, SecurityFrameworkUtils.getLoginUser().getOrganId()); List<Long> plateDOList = plateMapper.selectPlateIdListByBodyId(bodyId, SecurityFrameworkUtils.getLoginUser().getOrganId());
System.out.println(" plateDOList " + plateDOList);
plateMapper.updateDeletedById(plateDOList, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId()); plateMapper.updateDeletedById(plateDOList, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
List<Long> partsList = orderPartsMapper.selectPartsIdListByBodyId(bodyId, 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()); orderPartsMapper.updateDeletedById(partsList, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
}); });
} }
@@ -3,6 +3,7 @@ package com.cf.imes.module.executor.util.fileConversion.admin.api.webcad;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cf.imes.module.executor.enums.ErrorCodeConstants;
import com.cf.imes.module.system.api.application.ApplicationApi; import com.cf.imes.module.system.api.application.ApplicationApi;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
@@ -46,12 +47,13 @@ public class ApiDataAchieve {
} }
// 获取板件生产数据信息 // 获取板件生产数据信息
@Async // @Async
public Future<JSONObject> getApiPlateProData(String token, String orderNo) { public Future<JSONObject> getApiPlateProData(String token, String orderNo) {
JSONObject jsonPlatesData = new JSONObject(); JSONObject jsonPlatesData = new JSONObject();
jsonPlatesData.put("order_no", orderNo);//生产单号需要传入赋值 jsonPlatesData.put("order_no", orderNo);//生产单号需要传入赋值
jsonPlatesData.put("format", "json"); jsonPlatesData.put("format", "json");
JSONObject dataPlates = apiDataProduction.getApiOrderMessage(token, jsonPlatesData); JSONObject dataPlates = apiDataProduction.getApiOrderMessage(token, jsonPlatesData);
System.out.println(" dataPlates " + dataPlates);
if (!dataPlates.getString("err_code").equals("0")) { if (!dataPlates.getString("err_code").equals("0")) {
throw exception(PLATE_PLAN_DATA_ERROR); throw exception(PLATE_PLAN_DATA_ERROR);
} }
@@ -59,7 +61,7 @@ public class ApiDataAchieve {
} }
// 获取配件信息 分页获取 // 获取配件信息 分页获取
@Async // @Async
public Future<JSONObject> getApiPartsMessage(String token, String orderNo) { public Future<JSONObject> getApiPartsMessage(String token, String orderNo) {
JSONObject jsonParts = new JSONObject(); JSONObject jsonParts = new JSONObject();
jsonParts.put("curr_page", 1); jsonParts.put("curr_page", 1);
@@ -79,7 +81,7 @@ public class ApiDataAchieve {
} }
// 柜体信息转换 // 柜体信息转换
@Async // @Async
public Future<JSONObject> getApiBodyMessage(String token, String orderNo) { public Future<JSONObject> getApiBodyMessage(String token, String orderNo) {
JSONObject jsonBody = new JSONObject(); JSONObject jsonBody = new JSONObject();
jsonBody.put("curr_page", 1); jsonBody.put("curr_page", 1);
@@ -99,7 +101,7 @@ public class ApiDataAchieve {
} }
// 商品信息转换 // 商品信息转换
@Async // @Async
public Future<JSONObject> getApiGoodsMessage(String token, String orderNo) { public Future<JSONObject> getApiGoodsMessage(String token, String orderNo) {
JSONObject jsonGoods = new JSONObject(); JSONObject jsonGoods = new JSONObject();
jsonGoods.put("curr_page", 1); jsonGoods.put("curr_page", 1);
@@ -119,7 +121,7 @@ public class ApiDataAchieve {
} }
// 板材明细信息转换 // 板材明细信息转换
@Async // @Async
public Future<JSONObject> getApiPlateDetailMessage(String token, String orderNo) { public Future<JSONObject> getApiPlateDetailMessage(String token, String orderNo) {
JSONObject jsonPlates = new JSONObject(); JSONObject jsonPlates = new JSONObject();
jsonPlates.put("curr_page", 1); jsonPlates.put("curr_page", 1);
@@ -139,7 +141,7 @@ public class ApiDataAchieve {
} }
// 加工组信息转换 // 加工组信息转换
@Async // @Async
public Future<JSONObject> getApiGroupMessage(String token, String orderNo) { public Future<JSONObject> getApiGroupMessage(String token, String orderNo) {
JSONObject jsonModule = new JSONObject(); JSONObject jsonModule = new JSONObject();
jsonModule.put("order_no", orderNo); jsonModule.put("order_no", orderNo);
@@ -156,7 +158,8 @@ public class ApiDataAchieve {
jsonBlocks.put("order_no", orderNo); jsonBlocks.put("order_no", orderNo);
JSONObject blocks = apiDataProduction.getApiBlocksMessage(token, jsonBlocks); JSONObject blocks = apiDataProduction.getApiBlocksMessage(token, jsonBlocks);
if (!blocks.getString("err_code").equals("0")) { if (!blocks.getString("err_code").equals("0")) {
throw exception(PLATE_DATA_ERROR); throw new IllegalArgumentException(String.valueOf(ErrorCodeConstants.PLATE_DATA_ERROR));
// throw exception(PLATE_DATA_ERROR);
} }
JSONObject block = new JSONObject(); JSONObject block = new JSONObject();
for (int i = 1; i <= blocks.getJSONObject("value").getInteger("PageCount"); i++) { for (int i = 1; i <= blocks.getJSONObject("value").getInteger("PageCount"); i++) {
@@ -149,7 +149,10 @@ public class ApiTypeRealize {
groupLists.forEach((k, v) -> { groupLists.forEach((k, v) -> {
v.forEach(v1 -> { v.forEach(v1 -> {
if (items.get(v1) != null) { if (items.get(v1) != null) {
if (items.get(v1).getGroupId() != null){ // 已存在值
if (items.containsKey(v1) && (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() OrderItemDO item = OrderItemDO.builder()
.id((Long) identifierGenerator.nextId(null)) .id((Long) identifierGenerator.nextId(null))
.orderId(items.get(v1).getOrderId()) .orderId(items.get(v1).getOrderId())
@@ -158,14 +161,14 @@ public class ApiTypeRealize {
.bodyId(items.get(v1).getBodyId()) .bodyId(items.get(v1).getBodyId())
.planId(items.get(v1).getPlanId()) .planId(items.get(v1).getPlanId())
.packageId(items.get(v1).getPackageId()) .packageId(items.get(v1).getPackageId())
.groupId(items.get(v1).getGroupId()) .groupId(orderGroupDO.get(k).getId())
.partsId(items.get(v1).getPartsId()) .partsId(items.get(v1).getPartsId())
.plateId(items.get(v1).getPlateId()) .plateId(items.get(v1).getPlateId())
.num(items.get(v1).getNum()) .num(items.get(v1).getNum())
.build(); .build();
items.put(orderGroupDO.get(k).getId(), item); //再复查 items.put(orderGroupDO.get(k).getId(), item); //再复查
} }
items.get(v1).setGroupId(orderGroupDO.get(k).getId());
if (items.get(v1).getPlateId() != null) if (items.get(v1).getPlateId() != null)
groupNum++; groupNum++;
} }
@@ -174,7 +177,7 @@ public class ApiTypeRealize {
groupNum = 0; groupNum = 0;
}); });
System.out.println(" item " + items); System.err.println(" item " + items);
return items; return items;
} }
@@ -543,7 +546,7 @@ public class ApiTypeRealize {
.isSculpt(plate.getBoolean("IsModel")) .isSculpt(plate.getBoolean("IsModel"))
.isSpecialShaped(plate.getBoolean("UnRegular")) .isSpecialShaped(plate.getBoolean("UnRegular"))
.isCancel(false) .isCancel(false)
.remark("") .remark(plate.getString("RemarkJson"))
.build(); .build();
// item 明细 // item 明细
@@ -569,8 +572,7 @@ public class ApiTypeRealize {
.setDrillsRemark(plate.getString("DrillsRemark")) .setDrillsRemark(plate.getString("DrillsRemark"))
.setInfoRemark(plate.getString("InfoRemark")) .setInfoRemark(plate.getString("InfoRemark"))
.setRemarkJsonDei(plate.getString("RemarkJson")); .setRemarkJsonDei(plate.getString("RemarkJson"));
plateInfo.setRemark(plateDetail.get(plate.getLong("BlockNo")).getRemark() != null ?
plateDetail.get(plate.getLong("BlockNo")).getRemark().toString() : "");
} }
if (plateMap.get(plate.getLong("BlockNo")) != null) { if (plateMap.get(plate.getLong("BlockNo")) != null) {
JSONObject jsonObject = plateMap.get(plate.getLong("BlockNo")); JSONObject jsonObject = plateMap.get(plate.getLong("BlockNo"));
@@ -6,7 +6,7 @@
<select id="selectPlatesDetailByOrderId" resultType="com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO"> <select id="selectPlatesDetailByOrderId" resultType="com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO">
SELECT DISTINCT i.order_id, p.id, p.plate_no, g.material, p.name, p.area, p.seal_left, p.seal_down, SELECT DISTINCT i.order_id, p.id, p.plate_no, g.material, p.name, p.area, p.seal_left, p.seal_down,
p.seal_right, p.seal_up, p.texture, p.is_special_shaped, p.is_sculpt, p.unregular_point_count, p.front_hole_count, p.seal_right, p.seal_up, p.texture, p.is_special_shaped, p.is_sculpt, p.unregular_point_count, p.front_hole_count,
p.back_hole_count, p.side_hole_count,p.width,p.height,p.thickness p.back_hole_count, p.side_hole_count,p.width,p.height,p.thickness,p.remark,g.color
FROM order_item i FROM order_item i
RIGHT JOIN `order_plate` p ON i.plate_id = p.id RIGHT JOIN `order_plate` p ON i.plate_id = p.id
LEFT JOIN `order_goods` g ON g.id = p.goods_id LEFT JOIN `order_goods` g ON g.id = p.goods_id
@@ -45,7 +45,7 @@
<select id="selectPartsByOrderId" <select id="selectPartsByOrderId"
resultType="com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPlatesDetailRespVO"> resultType="com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPlatesDetailRespVO">
SELECT DISTINCT i.order_id, i.room_id, i.body_id, i.parts_id, p.`name` as part_name, i.num as plate_num SELECT DISTINCT i.order_id, i.room_id, i.body_id, i.parts_id, p.`name` as part_name, i.num as plate_num, p.unit
FROM `order_item` i FROM `order_item` i
RIGHT JOIN `order_parts` p ON i.parts_id = p.id RIGHT JOIN `order_parts` p ON i.parts_id = p.id
WHERE i.order_id = #{orderId} AND i.organ_id = #{organId} AND p.deleted = #{deleted} WHERE i.order_id = #{orderId} AND i.organ_id = #{organId} AND p.deleted = #{deleted}
@@ -68,7 +68,10 @@
<update id="updateDeletedById"> <update id="updateDeletedById">
UPDATE order_parts UPDATE order_parts
SET deleted = #{deleted} SET deleted = #{deleted}
WHERE id IN #{bodyIds} AND organ_id = #{organId} WHERE id IN
<foreach collection="partsIds" item="partsId" open="(" separator="," close=")">
#{partsId}
</foreach>AND organ_id = #{organId}
</update> </update>
@@ -271,7 +271,11 @@
<update id="updateDeletedById"> <update id="updateDeletedById">
UPDATE order_plate UPDATE order_plate
SET deleted = #{deleted} SET deleted = #{deleted}
WHERE id IN #{bodyIds} AND organ_id = #{organId} WHERE id IN
<foreach collection="plateIds" item="plateId" open="(" separator="," close=")">
#{plateId}
</foreach>
AND organ_id = #{organId}
</update> </update>
<select id="countPlateByOrderId" resultType="java.lang.Integer"> <select id="countPlateByOrderId" resultType="java.lang.Integer">
SELECT count(*) FROM order_plate SELECT count(*) FROM order_plate