Commit 9375b80f authored by 刘帅's avatar 刘帅

1.入库单修改时提交没有保存供应商问题修复

2.批量删除故障项目增加报修单使用校验
parent 90181202
......@@ -2,14 +2,12 @@ package com.maintain.business.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.extra.pinyin.PinyinUtil;
import com.maintain.business.domain.ErpMaintainMalfunction;
import com.maintain.business.domain.ErpMalfunctionProject;
import com.maintain.business.domain.ErpProjectType;
import com.maintain.business.domain.*;
import com.maintain.business.domain.bo.ErpMalfunctionProjectBo;
import com.maintain.business.domain.vo.ErpMalfunctionProjectVo;
import com.maintain.business.mapper.ErpMaintainMalfunctionMapper;
import com.maintain.business.mapper.ErpMalfunctionProjectMapper;
import com.maintain.business.mapper.ErpProjectTypeMapper;
import com.maintain.business.domain.vo.ErpRepairFormProjectVo;
import com.maintain.business.mapper.*;
import com.maintain.common.exception.ServiceException;
import com.maintain.common.pinyin.PinyinUtils;
import com.maintain.common.utils.StringUtils;
import com.maintain.common.core.page.TableDataInfo;
......@@ -21,14 +19,13 @@ import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.maintain.business.domain.bo.ErpMaintainProjectBo;
import com.maintain.business.domain.vo.ErpMaintainProjectVo;
import com.maintain.business.domain.ErpMaintainProject;
import com.maintain.business.mapper.ErpMaintainProjectMapper;
import com.maintain.business.service.IErpMaintainProjectService;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import java.util.Set;
import java.util.stream.Collectors;
/**
......@@ -45,6 +42,7 @@ public class ErpMaintainProjectServiceImpl implements IErpMaintainProjectService
private final ErpProjectTypeMapper projectTypeMapper;
private final ErpMalfunctionProjectMapper malfunctionProjectMapper;
private final ErpMaintainMalfunctionMapper maintainMalfunctionMapper;
private final ErpRepairFormProjectMapper repairFormProjectMapper;
/**
......@@ -176,11 +174,18 @@ public class ErpMaintainProjectServiceImpl implements IErpMaintainProjectService
/**
* 批量删除维修项目
*/
@Transactional
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
List<ErpRepairFormProjectVo> projectVos = repairFormProjectMapper.selectVoList(new LambdaQueryWrapper<ErpRepairFormProject>().in(ErpRepairFormProject::getMaintainId, ids));
if (!projectVos.isEmpty()) {
Set<String> collect = projectVos.stream().map(ErpRepairFormProjectVo::getProjectName).collect(Collectors.toSet());
throw new ServiceException("删除失败,维修项目 "+collect+" 已被使用!");
}
}
maintainMalfunctionMapper.delete(new LambdaQueryWrapper<ErpMaintainMalfunction>().in(ErpMaintainMalfunction::getMaintainId, ids));
return baseMapper.deleteBatchIds(ids) > 0;
}
}
......@@ -247,6 +247,7 @@ public class ErpMaterialPutawayServiceImpl implements IErpMaterialPutawayService
List<ErpMaterialInventoryRecord> inventoryRecordList = collect.stream().map(item -> {
ErpMaterialInventoryRecord record = new ErpMaterialInventoryRecord();
record.setInfoId(item.getId());
record.setVendorId(item.getVendorId());
record.setMaterialId(item.getMaterialId());
record.setWarehouseId(warehouseVo.getId());
record.setDeptId(warehouseVo.getDeptId());
......
......@@ -264,17 +264,17 @@
<el-table-column label="质保期(月)" align="center" prop="materialWarrantyPeriod" width="80"/>
<el-table-column label="参考价" align="center" prop="referencePrice" width="80"/>
<el-table-column label="销售价" align="center" prop="sellingPrice" width="80"/>
<el-table-column label="入库数量" align="center" prop="putawayNumber" width="120px">
<el-table-column label="入库数量" align="center" prop="putawayNumber" width="140px">
<template slot-scope="scope">
<el-input-number v-model="scope.row.putawayNumber" @change="putawayChange" controls-position="right" size="mini" :min="0.01" :precision="2" style="width: 100%" placeholder="数量"/>
</template>
</el-table-column>
<el-table-column label="入库单价" align="center" prop="putawayPrice" width="120px">
<el-table-column label="入库单价" align="center" prop="putawayPrice" width="150px">
<template slot-scope="scope">
<el-input-number v-model="scope.row.putawayPrice" @change="putawayChange" controls-position="right" size="mini" :min="0.01" :precision="2" style="width: 100%" placeholder="单价"/>
</template>
</el-table-column>
<el-table-column label="入库金额" align="center" prop="putawayMoney" width="120px">
<el-table-column label="入库金额" align="center" prop="putawayMoney" width="150px">
<template slot-scope="scope">
<el-input-number v-model="scope.row.putawayMoney" disabled controls-position="right" size="mini" :precision="2" style="width: 100%" placeholder="金额"/>
</template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment