fix: 呼叫套轴计数

This commit is contained in:
2025-03-31 18:41:31 +08:00
parent 370716346a
commit 706384b824
5 changed files with 31 additions and 10 deletions

View File

@@ -129,4 +129,6 @@ public interface IPdmBiSlittingproductionplanService extends IService<PdmBiSlitt
* @return /
*/
List<PdmBiSlittingproductionplan> getByQzzNoByNoStatus(String qzzno);
int getCountXN(String area, String location);
}

View File

@@ -17,4 +17,6 @@ public interface PdmBiSlittingproductionplanMapper extends BaseMapper<PdmBiSlitt
List<SlitterPlanDistinctDto> getAllHalfPlan(List<String> qzzs);
List<PdmBiSlittingproductionplan> getCurrentPlanInfos(SlitterPlanDistinctDto dto);
int getCountXN(String area, String location);
}

View File

@@ -151,4 +151,14 @@
AND (p.parent_container_name = #{parent_container_name} OR restruct_container_name = #{parent_container_name})
AND p.split_group <![CDATA[ <> ]]> #{split_group}
</select>
<select id="getCountXN" resultType="java.lang.Integer">
SELECT COUNT(*)
FROM pdm_bi_slittingproductionplan p
LEFT JOIN st_ivt_cutpointivt c ON c.ext_code = p.resource_name
WHERE p.description = '虚拟卷'
AND c.product_area = 'A4'
AND p.`status` <![CDATA[ < ]]> '03'
AND p.is_delete = '0'
AND DATE(p.call_time) >= DATE_SUB(CURDATE(), INTERVAL 1 DAY)
</select>
</mapper>

View File

@@ -184,4 +184,9 @@ public class PdmBiSlittingproductionplanServiceImpl extends ServiceImpl<PdmBiSli
.eq(PdmBiSlittingproductionplan::getIs_delete, "0");
return pdmBiSlittingproductionplanMapper.selectList(lam);
}
@Override
public int getCountXN(String area, String location) {
return pdmBiSlittingproductionplanMapper.getCountXN(area, location);
}
}

View File

@@ -255,16 +255,6 @@ public class PaperTubeServiceImpl implements PaperTubeService {
String location = param.getString("location");
String qzz_size = param.getString("qzz_size");
Integer number = param.getInteger("qqz_num");
// 判断还有没有位置(没有就不给创建)
List<Deliverycachepointivt> canUsePoint = deliverycachepointivtService.list(new LambdaQueryWrapper<Deliverycachepointivt>()
.eq(Deliverycachepointivt::getProduct_area, area)
.eq(Deliverycachepointivt::getPoint_location, location)
.eq(Deliverycachepointivt::getIs_used, "1")
.eq(Deliverycachepointivt::getPoint_status, "01")
.like(Deliverycachepointivt::getCan_size, qzz_size));
if (canUsePoint.size() < number) {
throw new BadRequestException("该半区该尺寸类型的位置剩余【" + canUsePoint.size() + "】个");
}
String qzz_generation = param.getString("qzz_generation");
StIvtCutpointivt xnDevice = cutpointivtService.getOne(new LambdaQueryWrapper<StIvtCutpointivt>()
.eq(StIvtCutpointivt::getPoint_location, location)
@@ -277,6 +267,18 @@ public class PaperTubeServiceImpl implements PaperTubeService {
}
// mes的设备号
String deviceCode = xnDevice.getExt_code();
// 判断还有没有位置(没有就不给创建)
List<Deliverycachepointivt> canUsePoint = deliverycachepointivtService.list(new LambdaQueryWrapper<Deliverycachepointivt>()
.eq(Deliverycachepointivt::getProduct_area, area)
.eq(Deliverycachepointivt::getPoint_location, location)
.eq(Deliverycachepointivt::getIs_used, "1")
.eq(Deliverycachepointivt::getPoint_status, "01")
.like(Deliverycachepointivt::getCan_size, qzz_size));
// 获取当前区域、位置的分切计划
int planCount = pdmBiSlittingproductionplanService.getCountXN(area, location);
if (canUsePoint.size() < (number + planCount)) {
throw new BadRequestException("该半区该尺寸类型的位置剩余【" + canUsePoint.size() + "】个");
}
// 当前轴需要的管芯名称 ...
String upLeftSizeK = param.getString("up_left_size_k");
String upRightSizeK = param.getString("up_right_size_k");