修改优化
This commit is contained in:
@@ -46,6 +46,9 @@ public interface PrcPriceSetDetailMapper
|
|||||||
/** Copy version effective time, expire time and status onto catalog detail rows. */
|
/** Copy version effective time, expire time and status onto catalog detail rows. */
|
||||||
public int syncEffectByPriceType(@Param("priceType") String priceType);
|
public int syncEffectByPriceType(@Param("priceType") String priceType);
|
||||||
|
|
||||||
|
/** Copy SALES version effect fields onto package detail rows. */
|
||||||
|
public int syncEffectByPriceSetId(@Param("priceSetId") Long priceSetId);
|
||||||
|
|
||||||
public int insertFixedDetailsFromLibrary(
|
public int insertFixedDetailsFromLibrary(
|
||||||
@Param("psvId") Long psvId,
|
@Param("psvId") Long psvId,
|
||||||
@Param("asOf") Date asOf,
|
@Param("asOf") Date asOf,
|
||||||
|
|||||||
@@ -40,4 +40,7 @@ public interface PrcPriceSetProductMapper
|
|||||||
|
|
||||||
/** Copy version effective_time and status onto catalog product rows. */
|
/** Copy version effective_time and status onto catalog product rows. */
|
||||||
public int syncEffectByPriceType(@Param("priceType") String priceType);
|
public int syncEffectByPriceType(@Param("priceType") String priceType);
|
||||||
|
|
||||||
|
/** Copy SALES version effect fields onto package product rows. */
|
||||||
|
public int syncEffectByPriceSetId(@Param("priceSetId") Long priceSetId);
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -3990,6 +3990,12 @@ public class PrcPriceSetServiceImpl implements IPrcPriceSetService
|
|||||||
versionMapper.updatePrcPriceSetVersion(v);
|
versionMapper.updatePrcPriceSetVersion(v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Keep package product/detail effect fields aligned with version
|
||||||
|
if (priceSetId != null)
|
||||||
|
{
|
||||||
|
setProductMapper.syncEffectByPriceSetId(priceSetId);
|
||||||
|
detailMapper.syncEffectByPriceSetId(priceSetId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -581,6 +581,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
)
|
)
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="syncEffectByPriceSetId">
|
||||||
|
update prc_price_set_detail d
|
||||||
|
inner join prc_price_set_version v on v.psv_id = d.psv_id
|
||||||
|
set d.effective_date = v.effective_time,
|
||||||
|
d.expire_date = v.expire_time,
|
||||||
|
d.status = v.status,
|
||||||
|
d.update_time = sysdate()
|
||||||
|
where v.price_set_id = #{priceSetId}
|
||||||
|
and v.price_type = 'SALES'
|
||||||
|
and d.price_type = 'SALES'
|
||||||
|
and (
|
||||||
|
not (d.status <=> v.status)
|
||||||
|
or not (d.effective_date <=> v.effective_time)
|
||||||
|
or not (d.expire_date <=> v.expire_time)
|
||||||
|
)
|
||||||
|
</update>
|
||||||
|
|
||||||
<update id="updatePriceTypeByPsvId">
|
<update id="updatePriceTypeByPsvId">
|
||||||
update prc_price_set_detail
|
update prc_price_set_detail
|
||||||
set price_type = #{priceType}, update_time = sysdate()
|
set price_type = #{priceType}, update_time = sysdate()
|
||||||
|
|||||||
@@ -222,4 +222,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
)
|
)
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="syncEffectByPriceSetId">
|
||||||
|
update prc_price_set_product p
|
||||||
|
inner join prc_price_set_version v on v.psv_id = p.psv_id
|
||||||
|
set p.effective_time = v.effective_time,
|
||||||
|
p.expire_time = v.expire_time,
|
||||||
|
p.status = v.status,
|
||||||
|
p.update_time = sysdate()
|
||||||
|
where v.price_set_id = #{priceSetId}
|
||||||
|
and v.price_type = 'SALES'
|
||||||
|
and p.price_type = 'SALES'
|
||||||
|
and (
|
||||||
|
not (p.status <=> v.status)
|
||||||
|
or not (p.effective_time <=> v.effective_time)
|
||||||
|
or not (p.expire_time <=> v.expire_time)
|
||||||
|
)
|
||||||
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user