opt:增加子卷重量校验
This commit is contained in:
@@ -73,42 +73,42 @@
|
|||||||
MAX(create_time) DESC
|
MAX(create_time) DESC
|
||||||
</select>
|
</select>
|
||||||
<select id="queryContainerNameBySaleOrder" resultType="org.nl.b_lms.pdm.subpackagerelation.dto.PdmBiSubpackagerelationDto">
|
<select id="queryContainerNameBySaleOrder" resultType="org.nl.b_lms.pdm.subpackagerelation.dto.PdmBiSubpackagerelationDto">
|
||||||
SELECT a.*,
|
SELECT
|
||||||
a.workorder_id,
|
a.workorder_id,
|
||||||
a.package_box_sn,
|
a.package_box_sn,
|
||||||
a.quanlity_in_box,
|
a.quanlity_in_box,
|
||||||
a.box_weight,
|
a.box_weight,
|
||||||
a.sale_order_name,
|
a.sale_order_name,
|
||||||
a.customer_name,
|
a.customer_name,
|
||||||
a.customer_description,
|
a.customer_description,
|
||||||
a.container_name,
|
a.container_name,
|
||||||
a.status,
|
a.status,
|
||||||
a.box_type,
|
a.box_type,
|
||||||
a.sap_pcsn,
|
a.sap_pcsn,
|
||||||
a.box_group,
|
a.box_group,
|
||||||
b.point_status,
|
(CASE
|
||||||
b.point_code,
|
WHEN c.paper_tube_or_FRP = '1' THEN c.paper_tube_description
|
||||||
b.ivt_status,
|
WHEN c.paper_tube_or_FRP = '2' THEN c.FRP_description END) AS paper_tube_description,
|
||||||
b.is_used,
|
c.weight,
|
||||||
(CASE
|
c.paper_weight,
|
||||||
WHEN c.paper_tube_or_FRP = '1' THEN c.paper_tube_description
|
b.point_status,
|
||||||
WHEN c.paper_tube_or_FRP = '2' THEN c.FRP_description END) AS paper_tube_description,
|
b.point_code,
|
||||||
c.weight,
|
b.ivt_status,
|
||||||
c.paper_weight
|
b.is_used
|
||||||
FROM `pdm_bi_subpackagerelation` a
|
FROM `pdm_bi_subpackagerelation` a
|
||||||
LEFT JOIN bst_ivt_packageinfoivt b ON a.container_name = b.container_name
|
LEFT JOIN bst_ivt_packageinfoivt b ON a.container_name = b.container_name
|
||||||
LEFT JOIN pdm_bi_slittingproductionplan c ON a.container_name = c.container_name
|
LEFT JOIN pdm_bi_slittingproductionplan c ON a.container_name = c.container_name
|
||||||
WHERE b.point_status = '3'
|
WHERE b.point_status = '3'
|
||||||
AND b.ivt_status = '3'
|
AND b.ivt_status = '3'
|
||||||
AND b.is_used = '1'
|
AND b.is_used = '1'
|
||||||
AND c.is_delete = '0'
|
AND c.is_delete = '0'
|
||||||
<if test="sale_order_name != null and sale_order_name != ''">
|
<if test="sale_order_name != null and sale_order_name != ''">
|
||||||
AND a.sale_order_name = #{sale_order_name}
|
AND a.sale_order_name = #{sale_order_name}
|
||||||
</if>
|
</if>
|
||||||
<if test="container_name != null and container_name != ''">
|
<if test="container_name != null and container_name != ''">
|
||||||
AND a.container_name = #{container_name}
|
AND a.container_name = #{container_name}
|
||||||
</if>
|
</if>
|
||||||
ORDER BY box_group
|
ORDER BY box_group
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -220,6 +220,8 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
|||||||
// int containerLength = getMaxNum(null, r.getPaper_tube_description());
|
// int containerLength = getMaxNum(null, r.getPaper_tube_description());
|
||||||
// r.setUn_plan_product_property3(Integer.toString(containerLength));
|
// r.setUn_plan_product_property3(Integer.toString(containerLength));
|
||||||
if (whereJson.get("type").toString().equals(PackageInfoIvtEnum.REQUEST_SOURCE.code("PC"))) {
|
if (whereJson.get("type").toString().equals(PackageInfoIvtEnum.REQUEST_SOURCE.code("PC"))) {
|
||||||
|
// r.setWeight(r.getWeight() != null ? r.getPaper_weight() : "0");
|
||||||
|
// r.setPaper_weight(r.getPaper_weight() != null ? r.getPaper_weight() : "0");
|
||||||
if (r.getBox_group() != null) {
|
if (r.getBox_group() != null) {
|
||||||
r.setQuanlity_in_box(BigDecimal.valueOf(countByGroup.getOrDefault(r.getBox_group(), null)));
|
r.setQuanlity_in_box(BigDecimal.valueOf(countByGroup.getOrDefault(r.getBox_group(), null)));
|
||||||
} else {
|
} else {
|
||||||
@@ -324,7 +326,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
|||||||
if (totalWeight.compareTo(new BigDecimal(0)) == 0) {
|
if (totalWeight.compareTo(new BigDecimal(0)) == 0) {
|
||||||
throw new BadRequestException("分切计划的子卷重量不能为0");
|
throw new BadRequestException("分切计划的子卷重量不能为0");
|
||||||
}
|
}
|
||||||
outBox(workIdList, containerNameList, deviceCode, maxBoxGroup,whereJson,totalWeight);
|
// outBox(workIdList, containerNameList, deviceCode, maxBoxGroup,whereJson,totalWeight);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BadRequestException(e.getMessage());
|
throw new BadRequestException(e.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user