Browse Source

个人物料库增加限制

chenw 7 years ago
parent
commit
4ee04529e5

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

@@ -32,6 +32,7 @@ public enum BizExceptionCode implements BaseExceptionCode {
     BIZ_RELDELETE_UPDATEPROD(79307,"存在关联单据,不允许更新"),
     BIZ_RELDELETE_DELETEPROD(79308,"存在关联单据,不允许删除"),
     BIZ_PRODWHCODE_REPEAT(79309, "明细仓库重复"),
+    BIZ_PRODUCT_UPLOAD(79319, "只能将已上传状态的产品加入我的产品"),
     BIZ_UNENDPRODUCT(79310,"系统还未结账,不能反结账"),
     BIZ_RELUPDATE_CODEANDNAME(79311,"存在关联单据,不允许更新编号,名称"),
     BIZ_RELUPDATE_AMOUNT(79312,"存在关联单据,不允许更新期初应收,期初预收,期初日期"),

+ 9 - 0
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Product.java

@@ -33,6 +33,15 @@ public class Product extends CommonBaseEntity implements Serializable {
     private String pr_text3;
     private String pr_text4;
     private String pr_remark;
+    private String b2bStatus;
+
+    public String getB2bStatus() {
+        return b2bStatus;
+    }
+
+    public void setB2bStatus(String b2bStatus) {
+        this.b2bStatus = b2bStatus;
+    }
 
     public String getPr_remark() {
         return pr_remark;

+ 4 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/ProductServiceImpl.java

@@ -842,6 +842,10 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
      */
     @Override
     public void createProdSaler(ProductSalerDTO productSalerDTO){
+        String status = getMapper().selectByPrimaryKey(productSalerDTO.getProdId()).getB2bStatus();
+        if (!"已上传".equals(status)){
+            throw new BizException(BizExceptionCode.BIZ_PRODUCT_UPLOAD);
+        }
         Long enUU = companyApi.getCompanyById(BaseContextHolder.getCompanyId()).getData().getUu();
         Long userUU = accountApi.getAccountById(BaseContextHolder.getUserId()).getData().getUu();
         ProductSalerUploadDTO productSalerUploadDTO = new ProductSalerUploadDTO(productSalerDTO.getProdId(), productSalerDTO.getProdCode(), userUU, enUU);

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

@@ -32,6 +32,7 @@
         <result column="pr_text4" property="pr_text4" jdbcType="VARCHAR"/>
         <result column="pr_text5" property="pr_text5" jdbcType="VARCHAR"/>
         <result column="pr_remark" property="pr_remark" jdbcType="VARCHAR"/>
+        <result column="b2bStatus" property="b2bStatus" jdbcType="VARCHAR"/>
     </resultMap>
     <resultMap id="ProductDTOResultMapper" type="com.usoftchina.saas.document.dto.ProductDTO">
         <id column="pr_id" property="id" jdbcType="INTEGER"/>