Browse Source

1.BOM资料禁用问题

chenw 7 years ago
parent
commit
93c2696c61

+ 1 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java

@@ -26,6 +26,7 @@ public enum BizExceptionCode implements BaseExceptionCode {
     BIZ_UNAUDITED(79304,"只能反审核已审核的单据"),
     BIZ_DELETE(79305,"只能删除未审核的单据"),
     BIZ_RELDELETE(79305,"存在关联单据,不允许删除"),
+    BIZ_RELCLOSE(79305,"存在关联单据,不允许禁用"),
     BIZ_RELDELETE_UPDATE(79306,"存在关联单据,不允许更新编号"),
     BIZ_RELDELETE_UPDATEPROD(79307,"存在关联单据,不允许更新"),
     BIZ_RELDELETE_DELETEPROD(79308,"存在关联单据,不允许删除"),

+ 1 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BomServiceImpl.java

@@ -187,7 +187,7 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
             Long prodId = getMapper().selectByPrimaryKey(id).getBo_motherid();
             int count = getMapper().getCountFromMake(prodId);
             if (count > 0){
-                throw new BizException(BizExceptionCode.BIZ_RELDELETE);
+                throw new BizException(BizExceptionCode.BIZ_RELCLOSE);
             }
 
             Bom bom = new Bom();

+ 1 - 1
applications/document/document-server/src/main/resources/mapper/BomMapper.xml

@@ -273,7 +273,7 @@
     </where>
     ORDER BY BO_ID DESC
   </select>
-    <select id="getCountFromMake" parameterType="java.lang.Long">
+    <select id="getCountFromMake" parameterType="java.lang.Long" resultType="int">
         SELECT COUNT(*) FROM MAKE WHERE MA_PRODID = #{id}
     </select>
 </mapper>