shiyunteng
2 天以前 b0ba33dce8487581d2bb3c49f886d158724dc44e
fix:产品列表接口
7个文件已修改
56 ■■■■ 已修改文件
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ProductController.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ProductMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ProductService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractInvoiceServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ProductServiceImpl.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/resources/mapper/ProductMapper.xml 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/resources/template/ymj/ymjgypmmht.docx 补丁 | 查看 | 原始文档 | blame | 历史
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/ProductController.java
@@ -79,10 +79,7 @@
    @PreAuthorize("@pms.hasPermission('business_product_view')" )
    @Inner(value = false)
    public R getProductList(@ParameterObject Product product) {
        LambdaQueryWrapper<Product> wrapper = Wrappers.lambdaQuery();
        wrapper.like(StrUtil.isNotEmpty(product.getProductName()),Product::getProductName,product.getProductName());
        wrapper.last("limit 20");
        return R.ok(productService.listByScope(wrapper));
        return R.ok(productService.getProductList(product));
    }
    /**
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/mapper/ProductMapper.java
@@ -1,11 +1,16 @@
package com.by4cloud.platformx.business.mapper;
import com.by4cloud.platformx.common.data.datascope.DataScope;
import com.by4cloud.platformx.common.data.datascope.PlatformxBaseMapper;
import com.by4cloud.platformx.business.entity.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface ProductMapper extends PlatformxBaseMapper<Product> {
    List<Product> getProductListByScope(@Param("product") Product product, DataScope comp_id);
}
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/ProductService.java
@@ -10,4 +10,6 @@
public interface ProductService extends IIService<Product> {
    List<Tree<Long>> treeList(Long parentId, String productName);
    List<Product> getProductList(Product product);
}
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractInvoiceServiceImpl.java
@@ -524,6 +524,8 @@
                            contractInvoice.setInvoiceStatus("2");
                            contractInvoice.setRedReversal("1");
                            baseMapper.updateById(contractInvoice);
                            //推送BIP
                            pushBipInvoice(contractInvoice);
                        }
                    }
                });
@@ -611,6 +613,7 @@
                            //确认即开
                            invoice.setInvoiceNo(model.getString("redInvoiceNo"));
                            invoice.setRedReversal("1");
                            //推送BIP
                            pushBipInvoice(invoice);
                        }
                    }
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ProductServiceImpl.java
@@ -51,7 +51,12 @@
        return TreeUtil.build(collect, parent);
    }
    @NotNull
    @Override
    public List<Product> getProductList(Product product) {
        return baseMapper.getProductListByScope(product,DataScope.of("comp_id"));
    }
    @NotNull
    private Function<Product, TreeNode<Long>> getNodeFunction() {
        return product -> {
            TreeNode<Long> node = new TreeNode<>();
@@ -60,7 +65,7 @@
            node.setParentId(product.getParentId());
            //node.setWeight(product.getParentId());
            // 扩展属性
            Map<String, Object> extra = new HashMap<>();
//            Map<String, Object> extra = new HashMap<>();
//            extra.put("picPath", category.getPicPath());
//            extra.put("Type", category.getType());
//            extra.put("isShow", category.getIsShow());
@@ -68,7 +73,7 @@
//            extra.put("status", category.getStatus());
            // 适配 vue3
            Map<String, Object> meta = new HashMap<>();
//            Map<String, Object> meta = new HashMap<>();
           /* meta.put("title", product.getProductName());
            meta.put("icon", product.getPrice());*/
platformx-business-finance-biz/src/main/resources/mapper/ProductMapper.xml
@@ -5,11 +5,9 @@
  <resultMap id="productMap" type="com.by4cloud.platformx.business.entity.Product">
        <id property="id" column="id"/>
        <result property="categoryId" column="category_id"/>
        <result property="productName" column="product_name"/>
        <result property="erpCode" column="erp_code"/>
        <result property="mainCode" column="main_code"/>
        <result property="price" column="price"/>
        <result property="taxRate" column="tax_rate"/>
        <result property="compId" column="comp_id"/>
        <result property="createBy" column="create_by"/>
@@ -18,4 +16,32 @@
        <result property="updateTime" column="update_time"/>
        <result property="delFlag" column="del_flag"/>
  </resultMap>
    <select id="getProductListByScope" resultType="com.by4cloud.platformx.business.entity.Product">
        SELECT
            t.id,
            t.product_name,
            t.main_code,
            t.erp_code,
            t.product_type,
            t.tax_rate,
            t.tax_class,
            t.tax_code,
            t.parent_id,
            t.create_by,
            t.update_by,
            t.create_time,
            t.update_time,
            t.del_flag,
            t.comp_id
        FROM
            product t
        WHERE
            del_flag = '0'
        <if test="product.productName !=null and product.productName !=''">
            and t.product_name LIKE CONCAT('%', #{product.productName}, '%')
        </if>
          AND (
            NOT EXISTS ( SELECT 1 FROM product t1 WHERE t1.parent_id = t.id ))
            limit 30
    </select>
</mapper>
platformx-business-finance-biz/src/main/resources/template/ymj/ymjgypmmht.docx
Binary files differ