| | |
| | | @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)); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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); |
| | | } |
| | |
| | | public interface ProductService extends IIService<Product> { |
| | | |
| | | List<Tree<Long>> treeList(Long parentId, String productName); |
| | | |
| | | List<Product> getProductList(Product product); |
| | | } |
| | |
| | | contractInvoice.setInvoiceStatus("2"); |
| | | contractInvoice.setRedReversal("1"); |
| | | baseMapper.updateById(contractInvoice); |
| | | //推送BIP |
| | | pushBipInvoice(contractInvoice); |
| | | } |
| | | } |
| | | }); |
| | |
| | | //确认即开 |
| | | invoice.setInvoiceNo(model.getString("redInvoiceNo")); |
| | | invoice.setRedReversal("1"); |
| | | //推送BIP |
| | | pushBipInvoice(invoice); |
| | | } |
| | | } |
| | |
| | | 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<>(); |
| | |
| | | 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()); |
| | |
| | | // 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());*/ |
| | | |
| | |
| | | |
| | | <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"/> |
| | |
| | | <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> |