mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-13 13:22:07 +08:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
+1
-1
@@ -23,7 +23,7 @@ public class OrderProcessApiImpl implements OrderProcessApi{
|
||||
@Override
|
||||
public CommonResult<Boolean> getOrderProcessByProcessGroupId(Long id) {
|
||||
List<OrderProcessDO> plateDOS = orderProcessService.getOrderProcessByProcessGroupId(id);
|
||||
if (plateDOS == null) {
|
||||
if (plateDOS.size() == 0) {
|
||||
return success(false);
|
||||
}
|
||||
return success(true);
|
||||
|
||||
+4
@@ -67,4 +67,8 @@ public class OrderPlatesDetailReqVO {
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "颜色", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")
|
||||
@ExcelProperty("颜色")
|
||||
private String color;
|
||||
|
||||
}
|
||||
|
||||
+3
@@ -24,6 +24,9 @@ public class OrderPlatesDetailRespVO {
|
||||
@Schema(description = "配件名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String partName;
|
||||
|
||||
@Schema(description = "配件单位", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "柜体中的配件数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Double plateNum;
|
||||
}
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ public interface OrderPartsMapper extends BaseMapperX<OrderPartsDO> {
|
||||
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);
|
||||
|
||||
|
||||
+1
-1
@@ -106,7 +106,7 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
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);
|
||||
|
||||
|
||||
+2
@@ -325,8 +325,10 @@ 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<Long> partsList = orderPartsMapper.selectPartsIdListByBodyId(bodyId, SecurityFrameworkUtils.getLoginUser().getOrganId());
|
||||
System.out.println(" partsList " + partsList);
|
||||
orderPartsMapper.updateDeletedById(partsList, OrderDeletedEnum.DELETED.getStatus(), SecurityFrameworkUtils.getLoginUser().getOrganId());
|
||||
});
|
||||
}
|
||||
|
||||
+2
-2
@@ -444,8 +444,8 @@ public class PlanServiceImpl implements PlanService {
|
||||
.betweenIfPresent("a.width", new BigDecimal[]{vo.getWidthMinRang(), vo.getWidthMaxRang()})
|
||||
.betweenIfPresent("a.height", new BigDecimal[]{vo.getLongMinRang(), vo.getLongMaxRang()})
|
||||
.inIfPresent("a.filter_type", filterTypes)
|
||||
.betweenIfPresent("f.delivery_date", new Date[]{vo.getBeginDate(), vo.getEndDate()});
|
||||
|
||||
.betweenIfPresent("f.delivery_date", new Date[]{vo.getBeginDate(), vo.getEndDate()})
|
||||
.orderByDesc("a.name");
|
||||
PageDTO<PlateResList> page = new PageDTO<>(vo.getPageNo(), vo.getPageSize());
|
||||
IPage<PlateResList> pageResult = plateMapper.selectPlateByPlanId(page, queryWrapperX);
|
||||
Set<Long> bodyIds = pageResult.getRecords().stream().map(PlateResList::getBodyId).collect(Collectors.toSet());
|
||||
|
||||
+10
-7
@@ -3,6 +3,7 @@ package com.cf.imes.module.executor.util.fileConversion.admin.api.webcad;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import com.cf.imes.module.executor.enums.ErrorCodeConstants;
|
||||
import com.cf.imes.module.system.api.application.ApplicationApi;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
@@ -46,12 +47,13 @@ public class ApiDataAchieve {
|
||||
}
|
||||
|
||||
// 获取板件生产数据信息
|
||||
@Async
|
||||
// @Async
|
||||
public Future<JSONObject> getApiPlateProData(String token, String orderNo) {
|
||||
JSONObject jsonPlatesData = new JSONObject();
|
||||
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);
|
||||
}
|
||||
@@ -59,7 +61,7 @@ public class ApiDataAchieve {
|
||||
}
|
||||
|
||||
// 获取配件信息 分页获取
|
||||
@Async
|
||||
// @Async
|
||||
public Future<JSONObject> getApiPartsMessage(String token, String orderNo) {
|
||||
JSONObject jsonParts = new JSONObject();
|
||||
jsonParts.put("curr_page", 1);
|
||||
@@ -79,7 +81,7 @@ public class ApiDataAchieve {
|
||||
}
|
||||
|
||||
// 柜体信息转换
|
||||
@Async
|
||||
// @Async
|
||||
public Future<JSONObject> getApiBodyMessage(String token, String orderNo) {
|
||||
JSONObject jsonBody = new JSONObject();
|
||||
jsonBody.put("curr_page", 1);
|
||||
@@ -99,7 +101,7 @@ public class ApiDataAchieve {
|
||||
}
|
||||
|
||||
// 商品信息转换
|
||||
@Async
|
||||
// @Async
|
||||
public Future<JSONObject> getApiGoodsMessage(String token, String orderNo) {
|
||||
JSONObject jsonGoods = new JSONObject();
|
||||
jsonGoods.put("curr_page", 1);
|
||||
@@ -119,7 +121,7 @@ public class ApiDataAchieve {
|
||||
}
|
||||
|
||||
// 板材明细信息转换
|
||||
@Async
|
||||
// @Async
|
||||
public Future<JSONObject> getApiPlateDetailMessage(String token, String orderNo) {
|
||||
JSONObject jsonPlates = new JSONObject();
|
||||
jsonPlates.put("curr_page", 1);
|
||||
@@ -139,7 +141,7 @@ public class ApiDataAchieve {
|
||||
}
|
||||
|
||||
// 加工组信息转换
|
||||
@Async
|
||||
// @Async
|
||||
public Future<JSONObject> getApiGroupMessage(String token, String orderNo) {
|
||||
JSONObject jsonModule = new JSONObject();
|
||||
jsonModule.put("order_no", orderNo);
|
||||
@@ -156,7 +158,8 @@ public class ApiDataAchieve {
|
||||
jsonBlocks.put("order_no", orderNo);
|
||||
JSONObject blocks = apiDataProduction.getApiBlocksMessage(token, jsonBlocks);
|
||||
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();
|
||||
for (int i = 1; i <= blocks.getJSONObject("value").getInteger("PageCount"); i++) {
|
||||
|
||||
+9
-7
@@ -149,7 +149,10 @@ public class ApiTypeRealize {
|
||||
groupLists.forEach((k, v) -> {
|
||||
v.forEach(v1 -> {
|
||||
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()
|
||||
.id((Long) identifierGenerator.nextId(null))
|
||||
.orderId(items.get(v1).getOrderId())
|
||||
@@ -158,14 +161,14 @@ public class ApiTypeRealize {
|
||||
.bodyId(items.get(v1).getBodyId())
|
||||
.planId(items.get(v1).getPlanId())
|
||||
.packageId(items.get(v1).getPackageId())
|
||||
.groupId(items.get(v1).getGroupId())
|
||||
.groupId(orderGroupDO.get(k).getId())
|
||||
.partsId(items.get(v1).getPartsId())
|
||||
.plateId(items.get(v1).getPlateId())
|
||||
.num(items.get(v1).getNum())
|
||||
.build();
|
||||
items.put(orderGroupDO.get(k).getId(), item); //再复查
|
||||
}
|
||||
items.get(v1).setGroupId(orderGroupDO.get(k).getId());
|
||||
|
||||
if (items.get(v1).getPlateId() != null)
|
||||
groupNum++;
|
||||
}
|
||||
@@ -174,7 +177,7 @@ public class ApiTypeRealize {
|
||||
groupNum = 0;
|
||||
});
|
||||
|
||||
System.out.println(" item " + items);
|
||||
System.err.println(" item " + items);
|
||||
return items;
|
||||
}
|
||||
|
||||
@@ -543,7 +546,7 @@ public class ApiTypeRealize {
|
||||
.isSculpt(plate.getBoolean("IsModel"))
|
||||
.isSpecialShaped(plate.getBoolean("UnRegular"))
|
||||
.isCancel(false)
|
||||
.remark("无")
|
||||
.remark(plate.getString("RemarkJson"))
|
||||
.build();
|
||||
|
||||
// item 明细
|
||||
@@ -569,8 +572,7 @@ public class ApiTypeRealize {
|
||||
.setDrillsRemark(plate.getString("DrillsRemark"))
|
||||
.setInfoRemark(plate.getString("InfoRemark"))
|
||||
.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) {
|
||||
JSONObject jsonObject = plateMap.get(plate.getLong("BlockNo"));
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
<mapper namespace="com.cf.imes.module.executor.dal.mysql.order.OrderMapper">
|
||||
|
||||
<select id="selectOrderPage" resultType="com.cf.imes.module.executor.controller.admin.plan.vo.OrderRespVOCopy">
|
||||
select a.id as orderId, a.order_date, a.delivery_date, a.customer, a.address, a.custom_order_no as defineId,
|
||||
select distinct a.id as orderId, a.order_date, a.delivery_date, a.customer, a.address, a.custom_order_no as defineId,
|
||||
count(op.id) as num, sum(op.area) as area
|
||||
from `orders` a
|
||||
left join order_item oi on a.id = oi.order_id and a.organ_id = oi.organ_id
|
||||
|
||||
+4
-4
@@ -6,7 +6,7 @@
|
||||
<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,
|
||||
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
|
||||
RIGHT JOIN `order_plate` p ON i.plate_id = p.id
|
||||
LEFT JOIN `order_goods` g ON g.id = p.goods_id
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
<select id="selectPartsByOrderId"
|
||||
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
|
||||
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}
|
||||
@@ -171,13 +171,13 @@
|
||||
from order_item oi
|
||||
left join order_package op on oi.order_id = op.order_id and oi.organ_id = op.organ_id
|
||||
|
||||
where oi.parts_id = '' and oi.organ_id = #{organId}
|
||||
where oi.parts_id = 0 and oi.organ_id = #{organId}
|
||||
and oi.order_id in
|
||||
|
||||
<foreach item="orderIds" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderIds}
|
||||
</foreach>
|
||||
group by oi.order_id,oi.plate_id,op.id,op.package_no;
|
||||
group by oi.order_id,oi.plate_id,op.id,op.package_no,op.status;
|
||||
|
||||
|
||||
|
||||
|
||||
+5
-2
@@ -4,7 +4,7 @@
|
||||
|
||||
<select id="selectProductList"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRespVO">
|
||||
SELECT a.id, a.goods_id, a.name, a.material, a.type, a.model, a.spec, a.brand, a.factory,
|
||||
SELECT distinct a.id, a.goods_id, a.name, a.material, a.type, a.model, a.spec, a.brand, a.factory,
|
||||
a.unit, a.price, a.is_composite, a.remark, b.num
|
||||
FROM order_parts a
|
||||
LEFT JOIN order_item b ON a.id = b.parts_id and a.organ_id = b.organ_id
|
||||
@@ -68,7 +68,10 @@
|
||||
<update id="updateDeletedById">
|
||||
UPDATE order_parts
|
||||
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>
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -90,7 +90,7 @@
|
||||
|
||||
|
||||
<select id="getOptimizePlanParam" resultMap="optimizeMap">
|
||||
select op.id as plan_id, op.plan_no, op.type as op_type, op.status as op_status, op.machine_id, op.plan_time, op.produce_time, op.remark as op_remark, op.operator,
|
||||
select distinct op.id as plan_id, op.plan_no, op.type as op_type, op.status as op_status, op.machine_id, op.plan_time, op.produce_time, op.remark as op_remark, op.operator,
|
||||
oi.order_id, opl.id as plateId, opl.order_id opl_order_id, opl.name opl_name, opl.plate_no, opl.type as opl_type, opl.goods_id as opl_goods_id, opl.width opl_width,
|
||||
opl.height opl_height, opl.thickness as opl_thickness, opl.split_width, opl.split_height, opl.split_thickness, opl.seal_left, opl.seal_right,
|
||||
opl.seal_up, opl.seal_down, opl.area, opl.texture, opl.hole_face, opl.hole_arrange, opl.unregular_point_count, opl.front_hole_count,
|
||||
@@ -111,7 +111,7 @@
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.PlateOptimize"
|
||||
parameterType="java.lang.Long">
|
||||
|
||||
select a.id, a.goods_name, a.material, a.color, a.width, a.height, a.thickness, count(b.id) as plateNum, d.*
|
||||
select distinct a.id, a.goods_name, a.material, a.color, a.width, a.height, a.thickness, count(b.id) as plateNum, d.*
|
||||
from order_goods a
|
||||
left join order_plate b on a.id = b.goods_id and a.organ_id = b.organ_id
|
||||
left join order_item c on c.order_id = b.order_id and c.organ_id = b.organ_id
|
||||
|
||||
+15
-10
@@ -5,7 +5,7 @@
|
||||
|
||||
<select id="selectPlatePage" resultType="com.cf.imes.module.executor.controller.admin.plan.vo.PlatePage">
|
||||
|
||||
select a.id as plateId, a.name, a.width, a.height, a.thickness, a.area,
|
||||
select distinct a.id as plateId, a.name, a.width, a.height, a.thickness, a.area,
|
||||
b.custom_order_no, b.customer, b.address, b.remark, b.id as orderId,
|
||||
c.goods_name, c.material, c.color, a.goods_id,oi.num,a.is_special_shaped as specialShaped,a.is_sculpt as profiling
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
<select id="selectPlateByPlanId"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList">
|
||||
select a.order_id, a.plate_no , a.name as plateName,a.is_special_shaped,a.is_sculpt,a.area,a.seal_left,a.seal_right,a.seal_up,a.seal_down, e.material, e.color, a.width, a.height, a.thickness, b.room_id, b.body_id
|
||||
select distinct a.order_id, a.plate_no , a.name as plateName,a.is_special_shaped,a.is_sculpt,a.area,a.seal_left,a.seal_right,a.seal_up,a.seal_down, e.material, e.color, a.width, a.height, a.thickness, b.room_id, b.body_id
|
||||
from order_plate a
|
||||
LEFT JOIN order_item b ON a.id = b.plate_id AND a.order_id = b.order_id and a.organ_id = b.organ_id
|
||||
LEFT JOIN order_goods e ON e.id = a.goods_id AND e.order_id = a.order_id and e.organ_id = a.organ_id
|
||||
@@ -40,7 +40,7 @@
|
||||
</select>
|
||||
<select id="selectPlateList"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.PlateParam">
|
||||
select a.id, a.plate_no, a.height length, a.width, a.texture, a.hole_arrange, a.hole_face, if ( (count(a.unregular_point_count) = 0), 1, 0) as isRect
|
||||
select distinct a.id, a.plate_no, a.height length, a.width, a.texture, a.hole_arrange, a.hole_face, if ( (count(a.unregular_point_count) = 0), 1, 0) as isRect
|
||||
from order_plate a
|
||||
left join order_item b on a.id = b.plate_id
|
||||
where b.plan_id = #{planId}
|
||||
@@ -63,7 +63,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectBatchOrderIdsAndGoodsIds" resultType="java.lang.Long">
|
||||
select oi.id from order_plate op
|
||||
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=",">
|
||||
@@ -181,7 +181,8 @@
|
||||
|
||||
<select id="selectPlateGoodsList" resultType="com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsRespVO">
|
||||
|
||||
select op.id,
|
||||
select distinct
|
||||
op.id,
|
||||
op.name,
|
||||
op.goods_id,
|
||||
ogs.goods_name,
|
||||
@@ -242,7 +243,7 @@
|
||||
|
||||
<select id="selectPlateGoodsListSummary" resultType="com.cf.imes.module.executor.controller.admin.plate.vo.PlateGoodsRespVO">
|
||||
|
||||
select
|
||||
select distinct
|
||||
op.name,
|
||||
op.open_door_type,
|
||||
op.height,
|
||||
@@ -270,7 +271,11 @@
|
||||
<update id="updateDeletedById">
|
||||
UPDATE order_plate
|
||||
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>
|
||||
<select id="countPlateByOrderId" resultType="java.lang.Integer">
|
||||
SELECT count(*) FROM order_plate
|
||||
@@ -289,15 +294,15 @@
|
||||
parameterType="java.lang.Long">
|
||||
|
||||
|
||||
select a.order_id, a.plate_no , a.name as plateName,a.is_special_shaped,a.is_sculpt,a.area,a.seal_left,a.seal_right,a.seal_up,a.seal_down, e.material, e.color, a.width, a.height, a.thickness, b.room_id, b.body_id
|
||||
select distinct a.order_id, a.plate_no , a.name as plateName,a.is_special_shaped,a.is_sculpt,a.area,a.seal_left,a.seal_right,a.seal_up,a.seal_down, e.material, e.color, a.width, a.height, a.thickness, b.room_id, b.body_id
|
||||
from order_plan_item p
|
||||
left join order_item b on p.item_id = b.id and b.organ_id = p.organ_id
|
||||
left join order_plate a on b.plate_id = a.id and b.order_id = a.order_id and b.organ_id = a.organ_id
|
||||
left join order_goods e on a.goods_id = e.id and a.order_id = e.order_id and a.organ_id = e.organ_id
|
||||
|
||||
where p.plan_id = #{planId} and p.organ_id = #{organId} ;
|
||||
|
||||
where p.plan_id = #{planId} and p.organ_id = #{organId}
|
||||
|
||||
order by a.order_id,plateName;
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
+4
-4
@@ -91,7 +91,7 @@ public class PackController {
|
||||
|
||||
|
||||
@GetMapping("/queryPackageDetails")
|
||||
@Operation(summary = "查看包裹对应的板材信息")
|
||||
@Operation(summary = "查询包裹的详细信息")
|
||||
@PreAuthorize("@ss.hasPermission('manage:query:query')")
|
||||
public CommonResult<PageResult<PackageDetailsRespVO>> queryPackageDetails(@Valid PackDetailsReqVO reqVO){
|
||||
|
||||
@@ -232,11 +232,11 @@ public class PackController {
|
||||
@PutMapping("/unpacking")
|
||||
@Operation(summary = "拆包-更改包裹为未封包")
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack:unpacking')")
|
||||
public CommonResult<Boolean> unpacking(@Valid @RequestBody PackingReqVO reqVO) {
|
||||
public CommonResult<OrderPackRespVO> unpacking(@Valid @RequestBody PackingReqVO reqVO) {
|
||||
|
||||
packService.unpacking(reqVO.getPackageId());
|
||||
OrderPackRespVO unpacking = packService.unpacking(reqVO.getPackageId());
|
||||
|
||||
return success(true);
|
||||
return success(unpacking);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+4
-2
@@ -11,8 +11,6 @@ import lombok.ToString;
|
||||
public class DeleteOtherPartsReqVO {
|
||||
|
||||
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "包裹Id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long packageId;
|
||||
@@ -21,6 +19,10 @@ public class DeleteOtherPartsReqVO {
|
||||
private Long partsId;
|
||||
|
||||
|
||||
@Schema(description = "是否是其他类型的配件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Boolean isOtherParts;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
+12
-1
@@ -36,7 +36,7 @@ public interface OrderPackageMapper extends BaseMapperX<OrderPackageDO> {
|
||||
|
||||
|
||||
|
||||
List<PackRespVO> selectPackPage(/*@Param("page") IPage page,*/@Param("collect") List<Long> collect);
|
||||
List<PackRespVO> selectPackPage(@Param("collect") List<Long> collect);
|
||||
|
||||
|
||||
IPage<PlateDetailsRespVO> selectMissingBoard( @Param("page") IPage page, @Param("orderNo") Long orderNo, @Param("organId") Long organId);
|
||||
@@ -61,4 +61,15 @@ public interface OrderPackageMapper extends BaseMapperX<OrderPackageDO> {
|
||||
.eq(OrderPackageDO::getOrganId,organId)
|
||||
.eqIfPresent(OrderPackageDO::getOrderId, orderId));
|
||||
}
|
||||
|
||||
|
||||
default List<OrderPackageDO> selectPackList(Long packageId,Long organId) {
|
||||
return selectList(new LambdaQueryWrapperX<OrderPackageDO>()
|
||||
.eq(OrderPackageDO::getOrganId,organId)
|
||||
.eqIfPresent(OrderPackageDO::getId, packageId));
|
||||
}
|
||||
|
||||
void updatePackStatus(Long packageId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
+9
-2
@@ -18,7 +18,9 @@ import com.cf.imes.module.manage.dal.dataobject.query.OrderPackageDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Mapper
|
||||
public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {
|
||||
@@ -41,14 +43,13 @@ public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {
|
||||
|
||||
|
||||
|
||||
void deleteOrderPack(@Param("reqVO") PackReqVO reqVO);
|
||||
void deleteOrderPack(@Param("packId") Long packId);
|
||||
|
||||
|
||||
|
||||
void deleteOtherParts(@Param("partsId") Long partsId);
|
||||
|
||||
|
||||
void deleteParts(@Param("reqVO") PackReqVO reqVO);
|
||||
|
||||
|
||||
void insertPackId(@Param("plateIdList") List<Long> plateIdList, @Param("packId") Long packId);
|
||||
@@ -84,4 +85,10 @@ public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {
|
||||
.eq(OrderItemDO::getOrganId, organId)
|
||||
.eqIfPresent(OrderItemDO::getPackageId, packId));
|
||||
}
|
||||
|
||||
|
||||
void deleteParts(@Param("packageId") Long packageId, @Param("partsIds") List<Long> partsIds);
|
||||
|
||||
void updateParts(@Param("partsId") Long partsId,@Param("packageId") Long packageId);
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ public interface OrderPartsMapper extends BaseMapperX<OrderPartsNDO> {
|
||||
List<OrderPartsRespVO> selectOrderParts(@Param("orderNo")Long orderNo,@Param("packageNo") Long packageNo);
|
||||
|
||||
|
||||
void deleteOrderParts(@Param("packageId") Long packageId);
|
||||
void deleteOrderParts(@Param("partsIds") List<Long> partsIds);
|
||||
|
||||
|
||||
default OrderPartsNDO selectOneParts(String otherPartsName,Long organId) {
|
||||
|
||||
+41
-16
@@ -215,11 +215,13 @@ public class PackServiceImpl implements PackService {
|
||||
|
||||
|
||||
// 生产明细表新增的配件ID
|
||||
orderItemMapper.insertParts(reqVO.getAddPartsList(),reqVO.getPackId(),reqVO.getOrderNo());
|
||||
|
||||
if(!reqVO.getAddPartsList().isEmpty()) {
|
||||
orderItemMapper.insertParts(reqVO.getAddPartsList(), reqVO.getPackId(), reqVO.getOrderNo());
|
||||
}
|
||||
// 生产明细表删除的配件ID
|
||||
orderItemMapper.deletePartsList(reqVO.getDeletePartsList(),reqVO.getPackId(),reqVO.getOrderNo());
|
||||
|
||||
if(!reqVO.getDeletePartsList().isEmpty()) {
|
||||
orderItemMapper.deletePartsList(reqVO.getDeletePartsList(), reqVO.getPackId(), reqVO.getOrderNo());
|
||||
}
|
||||
orderPackageDO.setStatus(OrderPackageStatusEnum.PACKAGED.getStatus());
|
||||
|
||||
orderPackageMapper.updateById(orderPackageDO);
|
||||
@@ -231,11 +233,12 @@ public class PackServiceImpl implements PackService {
|
||||
|
||||
// 拆包
|
||||
@Override
|
||||
public void unpacking(Long packageID) {
|
||||
public OrderPackRespVO unpacking(Long packageID) {
|
||||
|
||||
OrderPackageDO packageDO = orderPackageMapper.selectById(packageID);
|
||||
packageDO.setStatus((OrderPackageStatusEnum.UNPACKED.getStatus()));
|
||||
orderPackageMapper.updateById(packageDO);
|
||||
return typeConversion(packageDO);
|
||||
|
||||
|
||||
}
|
||||
@@ -329,8 +332,9 @@ public class PackServiceImpl implements PackService {
|
||||
orderPackageDO.setRemark(packageVO.getRemark());
|
||||
orderPackageMapper.insert(orderPackageDO);
|
||||
// 生产单明细表新增包裹 ID
|
||||
orderItemMapper.insertPackId(packageVO.getAddPlateIdList(), orderPackageDO.getId());
|
||||
|
||||
if(packageVO.getAddPlateIdList()!=null) {
|
||||
orderItemMapper.insertPackId(packageVO.getAddPlateIdList(), orderPackageDO.getId());
|
||||
}
|
||||
return typeConversion(orderPackageDO);
|
||||
}
|
||||
|
||||
@@ -363,11 +367,14 @@ public class PackServiceImpl implements PackService {
|
||||
|
||||
|
||||
// 生产明细表新增包裹ID
|
||||
orderItemMapper.insertPackId(packageVO.getAddPlateIdList(), packageVO.getPackId());
|
||||
if(!packageVO.getAddPlateIdList().isEmpty()) {
|
||||
orderItemMapper.insertPackId(packageVO.getAddPlateIdList(), packageVO.getPackId());
|
||||
}
|
||||
|
||||
// 移除生产明细表中板件对应的包裹ID
|
||||
orderItemMapper.deletePackId(packageVO.getDeletePlateIdList(), packageVO.getPackId());
|
||||
|
||||
if(!packageVO.getDeletePlateIdList().isEmpty()) {
|
||||
orderItemMapper.deletePackId(packageVO.getDeletePlateIdList(), packageVO.getPackId());
|
||||
}
|
||||
orderPackageDO.setStatus(OrderPackageStatusEnum.PACKAGED.getStatus());
|
||||
|
||||
orderPackageMapper.updateById(orderPackageDO);
|
||||
@@ -414,13 +421,23 @@ public class PackServiceImpl implements PackService {
|
||||
// 判断包裹的类型是否为其他类型,如果是,则删除其包裹信息
|
||||
if (reqVO.getIsOther() == true) {
|
||||
|
||||
orderPartsMapper.deleteOrderParts(reqVO.getPackageId());
|
||||
List<Long> partsIds = orderItemMapper.selectPackList(reqVO.getPackageId(), getUserOrganId())
|
||||
.stream().map(m -> m.getPartsId())
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
orderPartsMapper.deleteOrderParts(partsIds);
|
||||
|
||||
orderPackageMapper.updateParts(reqVO.getPackageId(), reqVO.getPackageNo());
|
||||
orderItemMapper.deleteParts(reqVO);
|
||||
|
||||
|
||||
orderItemMapper.deleteParts(reqVO.getPackageId(),partsIds);
|
||||
return;
|
||||
}
|
||||
|
||||
orderItemMapper.deleteOrderPack(reqVO);
|
||||
orderPackageMapper.updateParts(reqVO.getPackageId(),reqVO.getPackageNo());
|
||||
|
||||
orderItemMapper.deleteOrderPack(reqVO.getPackageId());
|
||||
|
||||
}
|
||||
|
||||
@@ -438,6 +455,8 @@ public class PackServiceImpl implements PackService {
|
||||
|
||||
// 配件表新增数据
|
||||
OrderPartsNDO orderParts = BeanUtils.toBean(reqVO, OrderPartsNDO.class);
|
||||
// 因为是外部配件,所以配件类型的名称固定为 “ 外部配件”
|
||||
orderParts.setType("外部配件");
|
||||
orderPartsMapper.insert(orderParts);
|
||||
|
||||
|
||||
@@ -485,6 +504,8 @@ public class PackServiceImpl implements PackService {
|
||||
|
||||
// 配件表新增数据
|
||||
OrderPartsNDO orderParts = BeanUtils.toBean(reqVO, OrderPartsNDO.class);
|
||||
// 因为是外部配件,所以配件类型的名称固定为 “ 外部配件”
|
||||
orderParts.setType("外部配件");
|
||||
orderPartsMapper.insert(orderParts);
|
||||
|
||||
// 在生产单明细表中添加数据(生产单号,配件ID,包裹ID,部件数量(目前一直为1))
|
||||
@@ -512,10 +533,14 @@ public class PackServiceImpl implements PackService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteOtherParts(DeleteOtherPartsReqVO reqVO) {
|
||||
|
||||
// 更新配件表中配件为逻辑删除
|
||||
orderPartsMapper.updateParts(reqVO.getPartsId());
|
||||
|
||||
orderItemMapper.deleteOtherParts(reqVO.getPartsId());
|
||||
if(reqVO.getIsOtherParts()) {
|
||||
// 更新配件表中配件为逻辑删除
|
||||
orderPartsMapper.updateParts(reqVO.getPartsId());
|
||||
orderItemMapper.deleteOtherParts(reqVO.getPartsId());
|
||||
}
|
||||
|
||||
orderItemMapper.updateParts(reqVO.getPartsId(),reqVO.getPackageId());
|
||||
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -14,7 +14,7 @@
|
||||
resultMap="PackMap">
|
||||
|
||||
|
||||
select
|
||||
select DISTINCT
|
||||
count(DISTINCT oi.package_id ) as numberOfPackages,
|
||||
count(DISTINCT oi.plate_id) as packagedBoard
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
parameterType="java.lang.Long"
|
||||
resultMap="PlateDetailsMap">
|
||||
|
||||
select
|
||||
select DISTINCT
|
||||
ob.room_name as roomName,
|
||||
ob.name as bodyName,
|
||||
op.id as palteId,
|
||||
@@ -84,7 +84,7 @@
|
||||
oi.organ_id = #{organId}
|
||||
and
|
||||
op.id not in (
|
||||
select oi2.plate_id
|
||||
select DISTINCT oi2.plate_id
|
||||
from order_item oi2
|
||||
where oi2.order_id = #{orderNo} and oi2.package_id <> '');
|
||||
|
||||
|
||||
+4
-3
@@ -31,7 +31,7 @@
|
||||
parameterType="com.cf.imes.module.manage.controller.admin.patching.vo.PatchingPlatePageReqVO">
|
||||
|
||||
|
||||
select
|
||||
select DISTINCT
|
||||
o.id as orderId,
|
||||
ob.name as cabinetName,
|
||||
op.id as plateNo,
|
||||
@@ -93,7 +93,7 @@
|
||||
<select id="selectPlate"
|
||||
resultMap="PlateDetailMap">
|
||||
|
||||
select
|
||||
select DISTINCT
|
||||
op.*,
|
||||
oi.room_id as roomId,
|
||||
oi.body_id as bodyId,
|
||||
@@ -138,7 +138,8 @@
|
||||
parameterType="java.lang.Long">
|
||||
|
||||
|
||||
select op.*,
|
||||
select DISTINCT
|
||||
op.*,
|
||||
oi.room_id as roomId,
|
||||
oi.body_id as bodyId,
|
||||
ob.room_name as roomName,
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
parameterType="com.cf.imes.module.manage.controller.admin.patching.vo.PatchingPlatePageReqVO">
|
||||
|
||||
select
|
||||
|
||||
DISTINCT
|
||||
p.goods_id,
|
||||
o.id as orderId,
|
||||
o.custom_order_no as customOrderId,
|
||||
|
||||
+38
-33
@@ -83,7 +83,7 @@
|
||||
resultMap="PlateMap"
|
||||
parameterType="com.cf.imes.module.manage.controller.admin.query.vo.productionStatus.PlatePageVO">
|
||||
|
||||
select
|
||||
select DISTINCT
|
||||
op.id as palteId,
|
||||
op.name as plateName,
|
||||
p.material as plateMaterial,
|
||||
@@ -171,7 +171,7 @@
|
||||
parameterType="java.lang.Long"
|
||||
resultMap="PlateDetailsMap">
|
||||
|
||||
select
|
||||
select DISTINCT
|
||||
op.plate_no as plateId,
|
||||
op.height as plateHeight,
|
||||
op.width as plateWidth,
|
||||
@@ -192,12 +192,13 @@
|
||||
|
||||
|
||||
|
||||
<update id="deleteOrderPack">
|
||||
<update id="deleteOrderPack" parameterType="java.lang.Long">
|
||||
|
||||
UPDATE order_item oi
|
||||
JOIN order_package opn ON oi.package_id = opn.id
|
||||
SET oi.package_id = 0, opn.deleted = true
|
||||
WHERE opn.id = #{reqVO.packageId} AND opn.package_no = #{reqVO.packageNo};
|
||||
UPDATE order_item
|
||||
|
||||
SET package_id = 0
|
||||
|
||||
WHERE package_id = #{packId} ;
|
||||
|
||||
</update>
|
||||
|
||||
@@ -208,25 +209,22 @@
|
||||
parameterType="java.lang.Long">
|
||||
|
||||
DELETE FROM order_item
|
||||
WHERE id IN (
|
||||
SELECT id FROM (
|
||||
SELECT oi.id
|
||||
FROM order_item oi
|
||||
WHERE oi.parts_id = #{partsId}
|
||||
) AS subquery
|
||||
);
|
||||
WHERE parts_id = #{partsId}
|
||||
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
<delete id="deleteParts">
|
||||
<delete id="deleteParts" parameterType="java.lang.Long">
|
||||
|
||||
delete from order_item
|
||||
where package_id = #{reqVO.packageId}
|
||||
and order_id in
|
||||
(select order_id from order_package where id = #{reqVO.packageId} and package_no = #{reqVO.packageNo} );
|
||||
where package_id = #{packageId}
|
||||
and parts_id in
|
||||
|
||||
<foreach item="partsIds" collection="partsIds" open="(" separator="," close=")">
|
||||
#{partsIds}
|
||||
</foreach>
|
||||
|
||||
</delete>
|
||||
|
||||
@@ -309,13 +307,20 @@
|
||||
|
||||
|
||||
|
||||
<update id="updateParts">
|
||||
|
||||
update order_item set package_id = 0 where parts_id =#{partsId} and package_id = #{packageId};
|
||||
|
||||
</update>
|
||||
|
||||
|
||||
<select id="selectBodyName" resultType="java.lang.String" parameterType="java.lang.Long">
|
||||
|
||||
|
||||
select ob.room_name
|
||||
from order_item oi
|
||||
join order_body ob on oi.body_id = ob.id
|
||||
where oi.plate_id = #{plateId};
|
||||
-- select ob.room_name
|
||||
-- from order_item oi
|
||||
-- join order_body ob on oi.body_id = ob.id
|
||||
-- where oi.plate_id = #{plateId};
|
||||
|
||||
</select>
|
||||
|
||||
@@ -331,17 +336,17 @@
|
||||
<select id="selectOrderPlateDetails"
|
||||
parameterType="java.lang.Long">
|
||||
|
||||
select
|
||||
|
||||
count(case
|
||||
when oi.package_id !=0 and oi.parts_id = 0 then oi.plate_id end )as plateProcessedNum,
|
||||
|
||||
count(
|
||||
case
|
||||
when oi.plate_id !=0 then oi.plate_id end
|
||||
)as plateNum
|
||||
from order_item oi
|
||||
where oi.order_id = #{orderId};
|
||||
-- select
|
||||
--
|
||||
-- count(case
|
||||
-- when oi.package_id !=0 and oi.parts_id = 0 then oi.plate_id end )as plateProcessedNum,
|
||||
--
|
||||
-- count(
|
||||
-- case
|
||||
-- when oi.plate_id !=0 then oi.plate_id end
|
||||
-- )as plateNum
|
||||
-- from order_item oi
|
||||
-- where oi.order_id = #{orderId};
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
+15
-7
@@ -60,11 +60,15 @@
|
||||
parameterType="java.lang.Long"
|
||||
resultMap="PartsListMap">
|
||||
|
||||
select
|
||||
id as partsId,name,model,spec,count(name) as num,unit,brand,factory,remark
|
||||
from order_parts where order_id = #{orderId} and organ_id = #{organId}
|
||||
group by partsId,name,model,spec,unit,brand,factory,remark;
|
||||
|
||||
select distinct
|
||||
op.id as partsId,op.name,op.model,op.spec,count(op.name) as num,op.unit,op.brand,op.factory,op.remark
|
||||
from order_parts op
|
||||
join order_item oi on op.id = oi.parts_id and op.organ_id = oi.organ_id
|
||||
|
||||
where op.order_id = #{orderId} and oi.package_id = 0
|
||||
|
||||
group by partsId,op.name,op.model,op.spec,op.unit,op.brand,op.factory,op.remark;
|
||||
|
||||
</select>
|
||||
|
||||
@@ -77,7 +81,7 @@
|
||||
resultMap="PartsListMap">
|
||||
|
||||
|
||||
select
|
||||
select distinct
|
||||
op.id as partsId,
|
||||
op.name as name,
|
||||
op.model as model ,
|
||||
@@ -103,8 +107,12 @@
|
||||
<update id="deleteOrderParts"
|
||||
parameterType="java.lang.Long">
|
||||
|
||||
update order_parts op set op.deleted = true where op.id in (
|
||||
select oi.parts_id from order_item oi where package_id =#{packageId});
|
||||
|
||||
update order_parts op set op.deleted = true where op.id in
|
||||
|
||||
<foreach item="id" collection="partsIds" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
|
||||
</update>
|
||||
|
||||
Reference in New Issue
Block a user