fix(biz): 修复采购入库单功能的多个问题
This commit is contained in:
parent
56749b305b
commit
0e13702fdb
@ -1,13 +1,16 @@
|
||||
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.purorderitem;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.purorderitem.vo.PurOrderItemPageReqVO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.purorder.PurOrderDO;
|
||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.purorderitem.PurOrderItemDO;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -39,4 +42,15 @@ public interface PurOrderItemMapper extends BaseMapperX<PurOrderItemDO> {
|
||||
return selectList(PurOrderItemDO::getPurId, purId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据采购订单ID物理删除明细
|
||||
* 使用 @Delete 注解直接写 SQL, bypass 逻辑删除和多租户插件
|
||||
*
|
||||
* @param purId 采购订单ID
|
||||
* @return 删除的记录数
|
||||
*/
|
||||
@Delete("DELETE FROM tsc_pur_order_item WHERE pur_id = #{purId}")
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
int physicalDeleteByPurId(@Param("purId") Integer purId);
|
||||
|
||||
}
|
||||
|
||||
@ -79,6 +79,7 @@ public class PurOrderServiceImpl implements PurOrderService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deletePurOrder(Integer id) {
|
||||
// 校验存在
|
||||
PurOrderDO purOrderDO = purOrderMapper.selectById(id);
|
||||
@ -90,6 +91,7 @@ public class PurOrderServiceImpl implements PurOrderService {
|
||||
}
|
||||
// 删除
|
||||
purOrderMapper.deleteById(id);
|
||||
deletePurOrderItemByPurId(id);
|
||||
}
|
||||
|
||||
private void validatePurOrderExists(Integer id) {
|
||||
@ -141,7 +143,7 @@ public class PurOrderServiceImpl implements PurOrderService {
|
||||
}
|
||||
|
||||
private void deletePurOrderItemByPurId(Integer purId) {
|
||||
purOrderItemMapper.delete(PurOrderItemDO::getPurId, purId);
|
||||
purOrderItemMapper.physicalDeleteByPurId(purId);
|
||||
}
|
||||
|
||||
|
||||
@ -159,7 +161,5 @@ public class PurOrderServiceImpl implements PurOrderService {
|
||||
purOrderDO.setPurStatus(approveResult);
|
||||
purOrderMapper.updateById(purOrderDO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -82,11 +82,10 @@
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 采购单信息 -->
|
||||
<ContentWrap style="height: calc(50vh - 150px);">
|
||||
<div style="font-weight: bold; margin-bottom: 8px;">采购单信息</div>
|
||||
<div style="display: flex; gap: 16px; height: calc(100% - 32px);">
|
||||
<!-- 主表 -->
|
||||
<div style="flex: 1;">
|
||||
<ContentWrap class="!p-10px">
|
||||
<div style="display: flex; flex-direction: column; height: calc(50vh - 180px);">
|
||||
<div style="flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden;">
|
||||
<div style="font-weight: bold; margin-bottom: 8px;">采购单信息</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="list"
|
||||
@ -95,6 +94,8 @@
|
||||
highlight-current-row
|
||||
@row-click="handleRowClick"
|
||||
@selection-change="handleSelectionChange"
|
||||
border
|
||||
style="flex: 1;"
|
||||
max-height="100%"
|
||||
>
|
||||
<el-table-column type="selection" width="50px" align="center" />
|
||||
@ -151,13 +152,14 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
style="margin-top: 8px;"
|
||||
/>
|
||||
<div style="display: flex; justify-content: flex-end; margin-top: 1px; flex-shrink: 0;">
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentWrap>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user