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;
|
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.purorderitem;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
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.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.purorder.PurOrderDO;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.purorderitem.PurOrderItemDO;
|
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.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -39,4 +42,15 @@ public interface PurOrderItemMapper extends BaseMapperX<PurOrderItemDO> {
|
|||||||
return selectList(PurOrderItemDO::getPurId, purId);
|
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
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deletePurOrder(Integer id) {
|
public void deletePurOrder(Integer id) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
PurOrderDO purOrderDO = purOrderMapper.selectById(id);
|
PurOrderDO purOrderDO = purOrderMapper.selectById(id);
|
||||||
@ -90,6 +91,7 @@ public class PurOrderServiceImpl implements PurOrderService {
|
|||||||
}
|
}
|
||||||
// 删除
|
// 删除
|
||||||
purOrderMapper.deleteById(id);
|
purOrderMapper.deleteById(id);
|
||||||
|
deletePurOrderItemByPurId(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validatePurOrderExists(Integer id) {
|
private void validatePurOrderExists(Integer id) {
|
||||||
@ -141,7 +143,7 @@ public class PurOrderServiceImpl implements PurOrderService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void deletePurOrderItemByPurId(Integer purId) {
|
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);
|
purOrderDO.setPurStatus(approveResult);
|
||||||
purOrderMapper.updateById(purOrderDO);
|
purOrderMapper.updateById(purOrderDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,11 +82,10 @@
|
|||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
|
||||||
<!-- 采购单信息 -->
|
<!-- 采购单信息 -->
|
||||||
<ContentWrap style="height: calc(50vh - 150px);">
|
<ContentWrap class="!p-10px">
|
||||||
<div style="font-weight: bold; margin-bottom: 8px;">采购单信息</div>
|
<div style="display: flex; flex-direction: column; height: calc(50vh - 180px);">
|
||||||
<div style="display: flex; gap: 16px; height: calc(100% - 32px);">
|
<div style="flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden;">
|
||||||
<!-- 主表 -->
|
<div style="font-weight: bold; margin-bottom: 8px;">采购单信息</div>
|
||||||
<div style="flex: 1;">
|
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
:data="list"
|
:data="list"
|
||||||
@ -95,6 +94,8 @@
|
|||||||
highlight-current-row
|
highlight-current-row
|
||||||
@row-click="handleRowClick"
|
@row-click="handleRowClick"
|
||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
|
border
|
||||||
|
style="flex: 1;"
|
||||||
max-height="100%"
|
max-height="100%"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="50px" align="center" />
|
<el-table-column type="selection" width="50px" align="center" />
|
||||||
@ -151,13 +152,14 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<Pagination
|
<div style="display: flex; justify-content: flex-end; margin-top: 1px; flex-shrink: 0;">
|
||||||
:total="total"
|
<Pagination
|
||||||
v-model:page="queryParams.pageNo"
|
:total="total"
|
||||||
v-model:limit="queryParams.pageSize"
|
v-model:page="queryParams.pageNo"
|
||||||
@pagination="getList"
|
v-model:limit="queryParams.pageSize"
|
||||||
style="margin-top: 8px;"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user