debug:单价ID未清空

This commit is contained in:
磷叶 2025-02-24 10:15:31 +08:00
parent 55cb5e1ae8
commit 13e108460f
5 changed files with 37 additions and 6 deletions

View File

@ -525,6 +525,11 @@ public class ReportServiceImpl implements ReportService
if (diff.getUpdateCount() > 0) { if (diff.getUpdateCount() > 0) {
int update = reportProdService.batchUpdate(diff.getUpdateList()); int update = reportProdService.batchUpdate(diff.getUpdateList());
ServiceUtil.assertion(update != diff.getUpdateCount(), "修改报表产量明细失败"); ServiceUtil.assertion(update != diff.getUpdateCount(), "修改报表产量明细失败");
if (update > 0) {
// 重置priceId null 的数据
List<Long> prodIds = diff.getUpdateList().stream().filter(item -> item.getPriceId() == null).map(ReportProd::getId).collect(Collectors.toList());
reportProdService.resetPriceId(prodIds);
}
result += update; result += update;
} }
if (diff.getDelCount() > 0) { if (diff.getDelCount() > 0) {

View File

@ -1,13 +1,12 @@
package com.ruoyi.yh.reportProd.mapper; package com.ruoyi.yh.reportProd.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.yh.reportProd.domain.ReportProd; import com.ruoyi.yh.reportProd.domain.ReportProd;
import com.ruoyi.yh.reportProd.domain.ReportProdQuery; import com.ruoyi.yh.reportProd.domain.ReportProdQuery;
import com.ruoyi.yh.reportProd.domain.ReportProdVO; import com.ruoyi.yh.reportProd.domain.ReportProdVO;
import com.ruoyi.yh.reportProd.domain.dto.ReportProdNewPriceDTO; import com.ruoyi.yh.reportProd.domain.dto.ReportProdNewPriceDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 报表产量Mapper接口 * 报表产量Mapper接口
@ -94,4 +93,9 @@ public interface ReportProdMapper
* 刷新匹配的工序 * 刷新匹配的工序
*/ */
int refreshPriceMatch(@Param("list") List<ReportProd> list); int refreshPriceMatch(@Param("list") List<ReportProd> list);
/**
* 重置单价ID
*/
int resetPriceId(@Param("ids") List<Long> ids);
} }

View File

@ -613,4 +613,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and brp.price_id is null and brp.price_id is null
and br.status in ('1', '4') and br.status in ('1', '4')
</update> </update>
<update id="resetPriceId">
update bst_report_prod brp
set brp.price_id = null
where id in
<foreach item="item" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</update>
</mapper> </mapper>

View File

@ -1,12 +1,12 @@
package com.ruoyi.yh.reportProd.service; package com.ruoyi.yh.reportProd.service;
import java.util.List;
import com.ruoyi.yh.reportProd.domain.ReportProd; import com.ruoyi.yh.reportProd.domain.ReportProd;
import com.ruoyi.yh.reportProd.domain.ReportProdQuery; import com.ruoyi.yh.reportProd.domain.ReportProdQuery;
import com.ruoyi.yh.reportProd.domain.ReportProdVO; import com.ruoyi.yh.reportProd.domain.ReportProdVO;
import com.ruoyi.yh.reportProd.domain.dto.ReportProdNewPriceDTO; import com.ruoyi.yh.reportProd.domain.dto.ReportProdNewPriceDTO;
import java.util.List;
/** /**
* 报表产量Service接口 * 报表产量Service接口
* *
@ -105,4 +105,9 @@ public interface ReportProdService
* @return * @return
*/ */
int refreshPriceMatch(List<Long> ids); int refreshPriceMatch(List<Long> ids);
/**
* 重置单价ID
*/
int resetPriceId(List<Long> ids);
} }

View File

@ -238,6 +238,14 @@ public class ReportProdServiceImpl implements ReportProdService
return result == null ? 0 : result; return result == null ? 0 : result;
} }
@Override
public int resetPriceId(List<Long> ids) {
if (CollectionUtils.isEmptyElement(ids)) {
return 0;
}
return reportProdMapper.resetPriceId(ids);
}
private List<ReportProdVO> selectByIds(List<Long> ids) { private List<ReportProdVO> selectByIds(List<Long> ids) {
if (CollectionUtils.isEmptyElement(ids)) { if (CollectionUtils.isEmptyElement(ids)) {
return Collections.emptyList(); return Collections.emptyList();