|
@ -14,6 +14,8 @@ import com.ruoyi.erp.domain.ErpMaterial; |
|
|
import com.ruoyi.erp.domain.ErpMaterialVo; |
|
|
import com.ruoyi.erp.domain.ErpMaterialVo; |
|
|
import com.ruoyi.erp.domain.vo.ErpMaterialPurchaseHistoryVo; |
|
|
import com.ruoyi.erp.domain.vo.ErpMaterialPurchaseHistoryVo; |
|
|
import com.ruoyi.erp.domain.vo.ErpMaterialSalesHistoryVo; |
|
|
import com.ruoyi.erp.domain.vo.ErpMaterialSalesHistoryVo; |
|
|
|
|
|
import com.ruoyi.erp.mapper.ErpBomMapper; |
|
|
|
|
|
import com.ruoyi.erp.mapper.ErpDevelopModifyorderDetailMapper; |
|
|
import com.ruoyi.erp.mapper.ErpMaterialMapper; |
|
|
import com.ruoyi.erp.mapper.ErpMaterialMapper; |
|
|
import com.ruoyi.erp.service.IErpMaterialService; |
|
|
import com.ruoyi.erp.service.IErpMaterialService; |
|
|
import com.ruoyi.process.general.service.IProcessService; |
|
|
import com.ruoyi.process.general.service.IProcessService; |
|
@ -23,12 +25,10 @@ import com.ruoyi.purchase.domain.PurchaseOrderChild; |
|
|
import com.ruoyi.purchase.mapper.PurchaseOrderChildMapper; |
|
|
import com.ruoyi.purchase.mapper.PurchaseOrderChildMapper; |
|
|
import com.ruoyi.purchase.mapper.PurchaseOrderMapper; |
|
|
import com.ruoyi.purchase.mapper.PurchaseOrderMapper; |
|
|
import com.ruoyi.purchase.mapper.PurchasePlanChildMapper; |
|
|
import com.ruoyi.purchase.mapper.PurchasePlanChildMapper; |
|
|
|
|
|
import com.ruoyi.sales.mapper.SalesEstimateDetailMapper; |
|
|
import com.ruoyi.system.domain.*; |
|
|
import com.ruoyi.system.domain.*; |
|
|
import com.ruoyi.system.domain.Vo.ExportCustomerQuoteChildVo; |
|
|
import com.ruoyi.system.domain.Vo.ExportCustomerQuoteChildVo; |
|
|
import com.ruoyi.system.mapper.OutsourceMaterialMapper; |
|
|
import com.ruoyi.system.mapper.*; |
|
|
import com.ruoyi.system.mapper.SysSalesOrderChildMapper; |
|
|
|
|
|
import com.ruoyi.system.mapper.SysSalesOrderMapper; |
|
|
|
|
|
import com.ruoyi.system.mapper.SysUserMapper; |
|
|
|
|
|
import com.ruoyi.system.service.*; |
|
|
import com.ruoyi.system.service.*; |
|
|
import com.ruoyi.warehouse.domain.WarehouseInventoryInquiry; |
|
|
import com.ruoyi.warehouse.domain.WarehouseInventoryInquiry; |
|
|
import com.ruoyi.warehouse.mapper.WarehouseInventoryInquiryMapper; |
|
|
import com.ruoyi.warehouse.mapper.WarehouseInventoryInquiryMapper; |
|
@ -58,6 +58,14 @@ public class ErpMaterialServiceImpl implements IErpMaterialService |
|
|
{ |
|
|
{ |
|
|
@Autowired |
|
|
@Autowired |
|
|
private ErpMaterialMapper erpMaterialMapper; |
|
|
private ErpMaterialMapper erpMaterialMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ErpBomMapper erpBomMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ErpDevelopModifyorderDetailMapper developModifyorderDetailMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private WarehouseInventoryInquiryMapper inventoryInquiryMapper; |
|
|
private WarehouseInventoryInquiryMapper inventoryInquiryMapper; |
|
|
|
|
|
|
|
@ -106,6 +114,13 @@ public class ErpMaterialServiceImpl implements IErpMaterialService |
|
|
@Autowired |
|
|
@Autowired |
|
|
private OutsourceMaterialMapper outsourceMaterialMapper; |
|
|
private OutsourceMaterialMapper outsourceMaterialMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private SysCustomerQuoteChildMapper customerQuoteChildMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private SalesEstimateDetailMapper estimateDetailMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final static String RMB = "1"; //RMB
|
|
|
private final static String RMB = "1"; //RMB
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -473,6 +488,37 @@ public class ErpMaterialServiceImpl implements IErpMaterialService |
|
|
|
|
|
|
|
|
ErpMaterialVo erpMaterialVo = erpMaterialMapper.selectErpMaterialById(erpMaterial.getId()); |
|
|
ErpMaterialVo erpMaterialVo = erpMaterialMapper.selectErpMaterialById(erpMaterial.getId()); |
|
|
|
|
|
|
|
|
|
|
|
//作废前判断该物料是否被其他模块引用
|
|
|
|
|
|
//是否被bom引用
|
|
|
|
|
|
int countBom = erpBomMapper.checkMaterialIsReferencedByBom(erpMaterialVo.getMaterialNo()); |
|
|
|
|
|
if(countBom>0){ |
|
|
|
|
|
throw new BusinessException("该物料信息被bom引用,无法作废!"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//是否被销售订单引用
|
|
|
|
|
|
int countSalesOrderChild = sysSalesOrderChildMapper.checkMaterialIsReferencedBySalesOrderChild(erpMaterialVo.getMaterialNo()); |
|
|
|
|
|
if(countSalesOrderChild>0){ |
|
|
|
|
|
throw new BusinessException("该物料信息被销售订单引用,无法作废!"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//是否被客户报价引用
|
|
|
|
|
|
int countCustomerQuoteChild = customerQuoteChildMapper.checkMaterialIsReferencedByCustomerQuoteChild(erpMaterialVo.getMaterialNo()); |
|
|
|
|
|
if(countCustomerQuoteChild>0){ |
|
|
|
|
|
throw new BusinessException("该物料信息被客户报价引用,无法作废!"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//是否被销售估价引用
|
|
|
|
|
|
int countEstimateDetail = estimateDetailMapper.checkMaterialIsReferencedByEstimateDetail(erpMaterialVo.getMaterialNo()); |
|
|
|
|
|
if(countEstimateDetail>0){ |
|
|
|
|
|
throw new BusinessException("该物料信息被销售估价引用,无法作废!"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//是否被开发修改单引用
|
|
|
|
|
|
int countDevelopModifyorderDetail = developModifyorderDetailMapper.checkMaterialIsReferencedByDevelopModifyorderDetail(erpMaterialVo.getMaterialNo()); |
|
|
|
|
|
if(countDevelopModifyorderDetail>0){ |
|
|
|
|
|
throw new BusinessException("该物料信息被开发修改单引用,无法作废!"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
SysUser sysUser = ShiroUtils.getSysUser(); |
|
|
SysUser sysUser = ShiroUtils.getSysUser(); |
|
|
List<SysPost> sysPostsList = sysPostService.selectPostsByUserId(sysUser.getUserId()); |
|
|
List<SysPost> sysPostsList = sysPostService.selectPostsByUserId(sysUser.getUserId()); |
|
|
String operPeople = sysUser.getDept().getDeptName() + "/" + sysPostsList.get(0).getPostName()+"/" + sysUser.getUserName(); |
|
|
String operPeople = sysUser.getDept().getDeptName() + "/" + sysPostsList.get(0).getPostName()+"/" + sysUser.getUserName(); |
|
|