|
|
@ -14,6 +14,8 @@ import com.ruoyi.erp.domain.ErpMaterial; |
|
|
|
import com.ruoyi.erp.domain.ErpMaterialVo; |
|
|
|
import com.ruoyi.erp.domain.vo.ErpMaterialPurchaseHistoryVo; |
|
|
|
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.service.IErpMaterialService; |
|
|
|
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.PurchaseOrderMapper; |
|
|
|
import com.ruoyi.purchase.mapper.PurchasePlanChildMapper; |
|
|
|
import com.ruoyi.sales.mapper.SalesEstimateDetailMapper; |
|
|
|
import com.ruoyi.system.domain.*; |
|
|
|
import com.ruoyi.system.domain.Vo.ExportCustomerQuoteChildVo; |
|
|
|
import com.ruoyi.system.mapper.OutsourceMaterialMapper; |
|
|
|
import com.ruoyi.system.mapper.SysSalesOrderChildMapper; |
|
|
|
import com.ruoyi.system.mapper.SysSalesOrderMapper; |
|
|
|
import com.ruoyi.system.mapper.SysUserMapper; |
|
|
|
import com.ruoyi.system.mapper.*; |
|
|
|
import com.ruoyi.system.service.*; |
|
|
|
import com.ruoyi.warehouse.domain.WarehouseInventoryInquiry; |
|
|
|
import com.ruoyi.warehouse.mapper.WarehouseInventoryInquiryMapper; |
|
|
@ -58,6 +58,14 @@ public class ErpMaterialServiceImpl implements IErpMaterialService |
|
|
|
{ |
|
|
|
@Autowired |
|
|
|
private ErpMaterialMapper erpMaterialMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ErpBomMapper erpBomMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ErpDevelopModifyorderDetailMapper developModifyorderDetailMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WarehouseInventoryInquiryMapper inventoryInquiryMapper; |
|
|
|
|
|
|
@ -106,6 +114,19 @@ public class ErpMaterialServiceImpl implements IErpMaterialService |
|
|
|
@Autowired |
|
|
|
private OutsourceMaterialMapper outsourceMaterialMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private SysCustomerQuoteChildMapper customerQuoteChildMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private SalesEstimateDetailMapper estimateDetailMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private BaseRequisitioningOrderChildMapper requisitioningOrderChildMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private BaseEmpRequisiteOrderChildMapper requisiteOrderChildMapper; |
|
|
|
|
|
|
|
|
|
|
|
private final static String RMB = "1"; //RMB
|
|
|
|
|
|
|
|
/** |
|
|
@ -217,6 +238,8 @@ public class ErpMaterialServiceImpl implements IErpMaterialService |
|
|
|
@Override |
|
|
|
public List<ErpMaterialVo> selectAllErpMaterialListWithBom(ErpMaterial erpMaterial) { |
|
|
|
|
|
|
|
erpMaterial.setUseStatus("1"); |
|
|
|
erpMaterial.setAuditStatus("1"); |
|
|
|
List<ErpMaterialVo> erpMaterialVos = erpMaterialMapper.selectAllErpMaterialListWithBom(erpMaterial); |
|
|
|
return erpMaterialVos; |
|
|
|
} |
|
|
@ -471,6 +494,50 @@ public class ErpMaterialServiceImpl implements IErpMaterialService |
|
|
|
|
|
|
|
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("该物料信息被开发修改单引用,无法作废!"); |
|
|
|
} |
|
|
|
|
|
|
|
//是否被员工请购单引用
|
|
|
|
int countRequisitioningOrderChild = requisitioningOrderChildMapper.checkMaterialIsReferencedByRequisitioningOrderChild(erpMaterialVo.getMaterialNo()); |
|
|
|
if(countRequisitioningOrderChild>0){ |
|
|
|
throw new BusinessException("该物料信息被请购单引用,无法作废!"); |
|
|
|
} |
|
|
|
|
|
|
|
//是否被员工领料单引用
|
|
|
|
int countRequisiteOrderChild = requisiteOrderChildMapper.checkMaterialIsReferencedByRequisiteOrderChild(erpMaterialVo.getMaterialNo()); |
|
|
|
if(countRequisiteOrderChild>0){ |
|
|
|
throw new BusinessException("该物料信息被员工领料单引用,无法作废!"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
SysUser sysUser = ShiroUtils.getSysUser(); |
|
|
|
List<SysPost> sysPostsList = sysPostService.selectPostsByUserId(sysUser.getUserId()); |
|
|
|
String operPeople = sysUser.getDept().getDeptName() + "/" + sysPostsList.get(0).getPostName()+"/" + sysUser.getUserName(); |
|
|
@ -609,6 +676,10 @@ public class ErpMaterialServiceImpl implements IErpMaterialService |
|
|
|
* */ |
|
|
|
@Override |
|
|
|
public List<ErpMaterialVo> selectAllErpMaterialListByMaterialVo(ErpMaterialVo erpMaterialVo) { |
|
|
|
// 审核状态-审核通过
|
|
|
|
erpMaterialVo.setAuditStatus("1"); |
|
|
|
// 使用状态-是
|
|
|
|
erpMaterialVo.setUseStatus("1"); |
|
|
|
return erpMaterialMapper.selectAllErpMaterialListByMaterialVo(erpMaterialVo); |
|
|
|
} |
|
|
|
|
|
|
|