wxf преди 2 години
родител
ревизия
9f29b55996

+ 0 - 1
hx-common/src/main/java/com/fjhx/common/entity/contract/po/ContractTemplate.java

@@ -45,7 +45,6 @@ public class ContractTemplate extends BasePo {
     @NotBlank(message = "联系人电话不能为空")
     private String contactNumber;
 
-
     /**
      * 模板内容
      */

+ 7 - 0
hx-common/src/main/java/com/fjhx/common/entity/contract/vo/ContractTemplateVo.java

@@ -19,4 +19,11 @@ public class ContractTemplateVo extends ContractTemplate {
      */
     private String corporationName;
 
+    /**
+     * 客户电话
+     */
+    private String corporationNumber;
+
+
+
 }

+ 1 - 1
hx-common/src/main/resources/mapper/contract/ContractTemplateMapper.xml

@@ -7,7 +7,7 @@
                ct.corporation_id,
                ct.contact_name,
                ct.contact_number,
-               ct.corporation_number,
+               c.corporation_number ,
                c.name corporation_name
         from contract_template ct
                  left join corporation c on c.id = ct.corporation_id

+ 41 - 0
hx-customer/src/main/java/com/fjhx/customer/entity/customer/dto/CustomerSelectDto.java

@@ -43,5 +43,46 @@ public class CustomerSelectDto extends BaseSelectDto {
      */
     private Integer statisticsType;
 
+    /**
+     * 国家表id
+     */
+    private Long countryId;
+
+    /**
+     * 省份ID
+     */
+    private Long provinceId;
+
+    /**
+     * 省份名称
+     */
+    private String provinceName;
+
+    /**
+     * 城市id
+     */
+    private Long cityId;
+
+    /**
+     * 城市名称
+     */
+    private String cityName;
+
+
+    /**
+     * 客户代码
+     */
+    private String customerCode;
+
+    /**
+     * 客户名称
+     */
+    private String name;
+
+    /**
+     * 客户标签
+     */
+    private String tag;
+
 
 }

+ 41 - 7
hx-customer/src/main/java/com/fjhx/customer/service/customer/impl/CustomerServiceImpl.java

@@ -31,10 +31,12 @@ import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import com.ruoyi.system.utils.UserUtil;
+import org.apache.poi.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -70,8 +72,30 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
     public Page<CustomerVo> getPage(CustomerSelectDto dto) {
 //        LambdaQueryWrapper<Customer> wrapper = Wrappers.<Customer>lambdaQuery();
         IWrapper<CustomerVo> wrapper = IWrapper.getWrapper();
+        //客户来源查询
         wrapper.eq("c", Customer::getSource, dto.getSource());
+        //客户类型查询
         wrapper.eq(Customer::getStatus, dto.getStatus());
+        //国家ID查询
+        wrapper.eq(Customer::getCountryId, dto.getCountryId());
+        //省份ID查询
+        wrapper.eq(Customer::getProvinceId,dto.getProvinceId());
+        //城市ID查询
+        wrapper.eq(Customer::getCityId,dto.getCityId());
+        //客户代码
+        wrapper.like(Customer::getCustomerCode,dto.getCustomerCode());
+        //客户名称
+        wrapper.like(Customer::getName,dto.getName());
+
+        //业务员查询
+        wrapper.eq(Customer::getUserId,dto.getName());
+
+        //客户标签查询(多个标签用逗号隔开)
+        if(StringUtils.isNotEmpty(dto.getTag())){
+            List<String> tagList = Arrays.asList(dto.getTag().split(","));
+            tagList.forEach(tag->wrapper.like(Customer::getTag,tag));
+        }
+
         //客户状态(0:公海客户  1:私海客户)(业务员ID为null为公海客户,业务员ID不为null为私海客户)
         if (ObjectUtil.isNotEmpty(dto.getType())) {
             //私海客户查询
@@ -81,10 +105,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
                 wrapper.and(wrapper1 -> wrapper1.isNull("c.user_id").or().eq(Customer::getUserId, ""));
             }
         }
-        if (ObjectUtil.isNotEmpty(dto.getKeyword())) {
-            //查询客户名称或者客户编码
-            wrapper.and(wrapper1 -> wrapper1.like(Customer::getName, dto.getKeyword()).or().eq(Customer::getCode, dto.getKeyword()));
-        }
+
 
         //置顶条件
         List<Long> customerIds = customerTopService.listObject(CustomerTop::getCustomerId, q -> q.eq(CustomerTop::getUserId,
@@ -198,9 +219,22 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
         IWrapper<CustomerVo> wrapper = IWrapper.getWrapper();
         wrapper.eq("c", Customer::getSource, dto.getSource());
         wrapper.eq("c", Customer::getStatus, dto.getStatus());
-        if (ObjectUtil.isNotEmpty(dto.getKeyword())) {
-            //查询客户名称或者客户编码
-            wrapper.and(wrapper1 -> wrapper1.like(Customer::getName, dto.getKeyword()).or().eq(Customer::getCode, dto.getKeyword()));
+        //国家ID查询
+        wrapper.eq(Customer::getCountryId, dto.getCountryId());
+        //省份ID查询
+        wrapper.eq(Customer::getProvinceId,dto.getProvinceId());
+        //城市ID查询
+        wrapper.eq(Customer::getCityId,dto.getCityId());
+        //客户代码
+        wrapper.like(Customer::getCustomerCode,dto.getCustomerCode());
+        //客户名称
+        wrapper.like(Customer::getName,dto.getName());
+        //业务员查询
+        wrapper.eq(Customer::getUserId,dto.getName());
+        //客户标签查询(多个标签用逗号隔开)
+        if(StringUtils.isNotEmpty(dto.getTag())){
+            List<String> tagList = Arrays.asList(dto.getTag().split(","));
+            tagList.forEach(tag->wrapper.like(Customer::getTag,tag));
         }
         //添加权限(自己看自己)
         wrapper.eq(Customer::getUserId, SecurityUtils.getUserId());

+ 22 - 0
hx-item/src/main/java/com/fjhx/item/entity/product/dto/ProductInfoSelectDto.java

@@ -69,4 +69,26 @@ public class ProductInfoSelectDto extends BaseSelectDto {
      * 客户id
      */
     private Long customerId;
+
+    /**
+     * 产品名称
+     */
+    private String name;
+
+    /**
+     * 产品名称
+     */
+    private String englishName;
+
+
+    /**
+     * 自定义编码
+     */
+    private String customCode;
+
+    /**
+     * 条码编号
+     */
+    private String barCode;
+
 }

+ 9 - 5
hx-item/src/main/java/com/fjhx/item/service/product/impl/ProductInfoServiceImpl.java

@@ -83,11 +83,15 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
         wrapper.eq("pi", ProductInfo::getType, dto.getType());
         wrapper.eq("pi", ProductInfo::getDefinition, dto.getDefinition());
         wrapper.eq("pi", ProductInfo::getProductClassifyId, dto.getProductClassifyId());
-        wrapper.keyword(dto,
-                new SqlField("pi", ProductInfo::getName),
-                new SqlField("pi", ProductInfo::getCode),
-                new SqlField("pi", ProductInfo::getCustomCode)
-        );
+        wrapper.like("pi",ProductInfo::getName,dto.getName());
+        wrapper.like("pi",ProductInfo::getCustomCode,dto.getCustomCode());
+        wrapper.like("pi",ProductInfo::getBarCode,dto.getBarCode());
+        wrapper.like("json_unquote(standard_json->'$.englishName')",dto.getEnglishName());
+//        wrapper.keyword(dto,
+//                new SqlField("pi", ProductInfo::getName),
+//                new SqlField("pi", ProductInfo::getCode),
+//                new SqlField("pi", ProductInfo::getCustomCode)
+//        );
         //计算并根据生命周期过滤
         wrapper.eq("IF(DATEDIFF(now(),pi.create_time)> json_unquote( victoriatourist_json -> '$.growUpDay' ),3,IF( DATEDIFF(now(),pi.create_time)> json_unquote( victoriatourist_json -> '$.newProductsDay' ), 2, 1 ))", dto.getLifeCycle());
         wrapper.eq("json_unquote( victoriatourist_json -> '$.combination' )", dto.getCombination());