新购接口优化

This commit is contained in:
sxu 2024-11-07 16:17:32 +08:00
parent 75f8e59e86
commit a503514fc5
3 changed files with 17 additions and 0 deletions

View File

@ -88,6 +88,8 @@ public interface PurchaseCheckDetailsMapper {
*/
int deletePurchaseCheckDetailsById(Long id);
int deletePurchaseCheckDetailsByParentIds(Long[] ids);
/**
* 批量删除新购验收任务详细
*

View File

@ -31,6 +31,7 @@ import com.bonus.material.purchase.domain.PurchaseCheckInfo;
import com.bonus.material.purchase.service.IPurchaseCheckInfoService;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.DefaultTransactionDefinition;
import org.springframework.util.CollectionUtils;
@ -330,7 +331,9 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
* @return 结果
*/
@Override
@Transactional
public int deletePurchaseCheckInfoByIds(Long[] ids) {
purchaseCheckDetailsMapper.deletePurchaseCheckDetailsByParentIds(ids);
return purchaseCheckInfoMapper.deletePurchaseCheckInfoByIds(ids);
}

View File

@ -201,6 +201,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
delete from purchase_check_details where id = #{id}
</delete>
<delete id="deletePurchaseCheckDetailsByParentIds" parameterType="Long">
delete from purchase_check_details where task_id in (
select task_id
from purchase_check_info
where
id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
)
</delete>
<delete id="deletePurchaseCheckDetailsByIds" parameterType="String">
delete from purchase_check_details where id in
<foreach item="id" collection="array" open="(" separator="," close=")">