Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
王晓迪 2 months ago
parent
commit
9c73a62d8e
  1. 6
      ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpBomMapper.java
  2. 5
      ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpDevelopModifyorderDetailMapper.java
  3. 79
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java
  4. 5
      ruoyi-admin/src/main/java/com/ruoyi/sales/mapper/SalesEstimateDetailMapper.java
  5. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseEmpRequisiteOrderChildMapper.java
  6. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseRequisitioningOrderChildMapper.java
  7. 4
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteChildMapper.java
  8. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesOrderChildMapper.java
  9. 7
      ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml
  10. 4
      ruoyi-admin/src/main/resources/mapper/erp/ErpDevelopModifyorderDetailMapper.xml
  11. 9
      ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml
  12. 4
      ruoyi-admin/src/main/resources/mapper/sales/SalesEstimateDetailMapper.xml
  13. 4
      ruoyi-admin/src/main/resources/mapper/system/BaseEmpRequisiteOrderChildMapper.xml
  14. 6
      ruoyi-admin/src/main/resources/mapper/system/BaseRequisitioningOrderChildMapper.xml
  15. 6
      ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteChildMapper.xml
  16. 4
      ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml

6
ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpBomMapper.java

@ -153,4 +153,10 @@ public interface ErpBomMapper
* @return bom集合
*/
public List<ErpBomVo> selectErpBomListByBomNos(String[] bomNos);
/**
* 检查bom是否引用了物料
* */
int checkMaterialIsReferencedByBom(String materialNo);
}

5
ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpDevelopModifyorderDetailMapper.java

@ -84,4 +84,9 @@ public interface ErpDevelopModifyorderDetailMapper
* 根据bomId和开发修改单查询开发修改单详情物料信息
* */
ErpDevelopModifyorderDetail selectModifyorderDetailByCodeAndId(ErpDevelopModifyorderDetail modifyorderDetail);
/**
* 检查开发修改单子表是否引用了物料
* */
int checkMaterialIsReferencedByDevelopModifyorderDetail(String materialNo);
}

79
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java

@ -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);
}

5
ruoyi-admin/src/main/java/com/ruoyi/sales/mapper/SalesEstimateDetailMapper.java

@ -90,4 +90,9 @@ public interface SalesEstimateDetailMapper
* @return
*/
List<SalesEstimateDetail> selectEstimateDetailListByCode(String salesEstimateCode);
/**
* 检查销售估价子表是否引用了物料
* */
int checkMaterialIsReferencedByEstimateDetail(String materialNo);
}

5
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseEmpRequisiteOrderChildMapper.java

@ -85,4 +85,9 @@ public interface BaseEmpRequisiteOrderChildMapper
* @return 结果
*/
public int restoreBaseEmpRequisiteOrderChildById(Long requisitioningChildId);
/**
* 检查领料单子表是否引用了物料
* */
int checkMaterialIsReferencedByRequisiteOrderChild(String materialNo);
}

5
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseRequisitioningOrderChildMapper.java

@ -114,4 +114,9 @@ public interface BaseRequisitioningOrderChildMapper
*/
public int updateBaseRequisitioningOrderChildByRequisitioningCode(String delFlag,String requisitioningCode);
/**
* 检查请购单子表是否引用了物料
* */
int checkMaterialIsReferencedByRequisitioningOrderChild(String materialNo);
}

4
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteChildMapper.java

@ -20,4 +20,8 @@ public interface SysCustomerQuoteChildMapper {
/*删除ids中的quoteId的所有子项*/
int deleteSysCustomerQuoteChildByQuoteIds(String[] ids);
/**
* 检查客户报价子表是否引用了物料
* */
int checkMaterialIsReferencedByCustomerQuoteChild(String materialNo);
}

5
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesOrderChildMapper.java

@ -52,4 +52,9 @@ public interface SysSalesOrderChildMapper {
* 根据物料号查询销售订单子表
* */
List<SysSalesOrderChild> selectOrderChildListByMaterialNo(String materialNo);
/**
* 检查销售订单子表是否引用了物料
* */
int checkMaterialIsReferencedBySalesOrderChild(String materialNo);
}

7
ruoyi-admin/src/main/resources/mapper/erp/ErpBomMapper.xml

@ -594,4 +594,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{bomNo}
</foreach>
</select>
<select id="checkMaterialIsReferencedByBom" parameterType="String" resultType="integer">
select count(1) from erp_bom where material_no = #{materialNo}
</select>
</mapper>

4
ruoyi-admin/src/main/resources/mapper/erp/ErpDevelopModifyorderDetailMapper.xml

@ -53,6 +53,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and bom_id = #{bomId}
</select>
<select id="checkMaterialIsReferencedByDevelopModifyorderDetail" parameterType="String" resultType="Integer">
select count(1) from erp_develop_modifyorder_detail where material_no = #{materialNo}
</select>
<insert id="insertErpDevelopModifyorderDetail" parameterType="ErpDevelopModifyorderDetail" useGeneratedKeys="true" keyProperty="developOrderDetailId">
insert into erp_develop_modifyorder_detail
<trim prefix="(" suffix=")" suffixOverrides=",">

9
ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml

@ -155,6 +155,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectAllErpMaterialList" resultMap="ErpMaterialResult">
<include refid="selectErpMaterialVo"/>
where use_status = 1 and audit_status = 1
</select>
<select id="selectAllErpMaterialListWithBom" resultMap="ErpMaterialResult">
@ -166,6 +167,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join erp_bom eb on em.material_no = eb.material_no
<where>
<if test="materialNo != null and materialNo != ''"> and em.material_no like concat(#{materialNo}, '%')</if>
<if test="auditStatus != null and auditStatus != ''"> and em.audit_status = #{auditStatus}</if>
<if test="useStatus != null and useStatus != ''"> and em.use_status = #{useStatus}</if>
</where>
</select>
@ -182,13 +185,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where parent_id = (select id from sys_category where code = 'materialType') )
)cate on erp.material_type = cate.code
where cate.parent_id in (select id from sys_category where code in ('cp','bcp'))
and erp.del_flag = '0' and erp.audit_status = '1'
and erp.audit_status = '1' and erp.use_status = '1'
</select>
<select id="selectAllErpMaterialListByMaterialVo" parameterType="ErpMaterial" resultMap="ErpMaterialResult">
<include refid="selectErpMaterialVo"/>
<where>
<if test="materialNo != null and materialNo != ''"> and material_no like concat(#{materialNo}, '%')</if>
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
<if test="useStatus != null and useStatus != ''"> and use_status = #{useStatus}</if>
</where>
</select>
@ -350,7 +355,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where parent_id = (select id from sys_category where code = 'materialType') )
)cate on erp.material_type = cate.code
where cate.parent_id in (select id from sys_category where code in ('cp','bcp'))
and erp.del_flag = '0' and erp.audit_status = '1'
and erp.audit_status = '1' and erp.use_status = '1'
and material_no like concat(#{prefix}, '%') escape '\\'
</select>

4
ruoyi-admin/src/main/resources/mapper/sales/SalesEstimateDetailMapper.xml

@ -64,6 +64,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where sales_estimate_code = #{salesEstimateCode}
</select>
<select id="checkMaterialIsReferencedByEstimateDetail" parameterType="String" resultType="Integer">
select count(1) from sales_estimate_detail where material_no = #{materialNo}
</select>
<insert id="insertSalesEstimateDetail" parameterType="SalesEstimateDetail" useGeneratedKeys="true" keyProperty="estimateDetailId">
insert into sales_estimate_detail
<trim prefix="(" suffix=")" suffixOverrides=",">

4
ruoyi-admin/src/main/resources/mapper/system/BaseEmpRequisiteOrderChildMapper.xml

@ -71,6 +71,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where quote_id = #{quoteId}
</select>
<select id="checkMaterialIsReferencedByRequisiteOrderChild" parameterType="String" resultType="Integer">
select count(1) from base_emp_requisite_order_child where material_code = #{materialCode}
</select>
<insert id="insertBaseEmpRequisiteOrderChild" parameterType="BaseEmpRequisiteOrderChild" useGeneratedKeys="true" keyProperty="requisitioningChildId">
insert into base_emp_requisite_order_child
<trim prefix="(" suffix=")" suffixOverrides=",">

6
ruoyi-admin/src/main/resources/mapper/system/BaseRequisitioningOrderChildMapper.xml

@ -76,6 +76,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectBaseRequisitioningOrderChildVo"/>
where requisitioning_code = #{requisitioningCode}
</select>
<select id="checkMaterialIsReferencedByRequisitioningOrderChild" parameterType="String" resultType="Integer">
select count(1) from base_requisitioning_order_child where material_code = #{materialCode}
</select>
<insert id="insertBaseRequisitioningOrderChild" parameterType="BaseRequisitioningOrderChild" useGeneratedKeys="true" keyProperty="requisitioningChildId">
insert into base_requisitioning_order_child
<trim prefix="(" suffix=")" suffixOverrides=",">

6
ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteChildMapper.xml

@ -59,6 +59,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectSysCustomerQuoteChildVo"/>
where quoteId = #{quoteId}
</select>
<select id="checkMaterialIsReferencedByCustomerQuoteChild" parameterType="String" resultType="integer">
select count(1) from sys_customer_quotechild where materialCode = #{materialCode}
</select>
<insert id="insertSysCustomerQuoteChild" parameterType="SysCustomerQuoteChild" useGeneratedKeys="true" keyProperty="id">
insert into sys_customer_quotechild
<trim prefix="(" suffix=")" suffixOverrides=",">

4
ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml

@ -120,6 +120,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where a.materialCode = #{materialCode}
</select>
<select id="checkMaterialIsReferencedBySalesOrderChild" parameterType="String" resultType="integer">
select count(1) from sys_sales_order_child where materialCode = #{materialCode}
</select>
<insert id="insertSysSalesOrderChild" parameterType="SysSalesOrderChild" useGeneratedKeys="true" keyProperty="id">
insert into sys_sales_order_child

Loading…
Cancel
Save