Pārlūkot izejas kodu

增加关键字查询和商机签约跳转

wucl 2 gadi atpakaļ
vecāks
revīzija
e7c248440b

+ 2 - 2
biz-base/src/main/java/com/dayou/controller/BusinessOpportunityController.java

@@ -48,8 +48,8 @@ public class BusinessOpportunityController extends BaseController {
     */
     @DataPermission(teamData = true,postChild = false,ignoreDepartment = {MANAGER_OFFICE})
     @GetMapping("")
-    public RestResponse<Page<BusinessOpportunityVO>> page(BusinessOpportunityVO businessOpportunity, Page page){
-        Page<BusinessOpportunityVO> pages=businessOpportunityService.selectPage(page,businessOpportunity);
+    public RestResponse<Page<BusinessOpportunityVO>> page(BusinessOpportunityVO businessOpportunity, Page page,String keyword){
+        Page<BusinessOpportunityVO> pages=businessOpportunityService.selectPage(page,businessOpportunity,keyword);
         return RestResponse.data(pages);
     }
 

+ 2 - 2
biz-base/src/main/java/com/dayou/controller/CustomerController.java

@@ -53,8 +53,8 @@ public class CustomerController extends BaseController {
     */
     @DataPermission(teamData = true,postChild = false,ignoreDepartment = {MANAGER_OFFICE})
     @GetMapping("")
-    public RestResponse<Page<CustomerDTO>> page(CustomerDTO customer, Page page){
-        Page<CustomerDTO> pages=customerService.selectPage(page,customer);
+    public RestResponse<Page<CustomerDTO>> page(CustomerDTO customer, Page page,String keyword){
+        Page<CustomerDTO> pages=customerService.selectPage(page,customer,keyword);
         return RestResponse.data(pages);
     }
 

+ 1 - 1
biz-base/src/main/resources/application-local.yml

@@ -3,7 +3,7 @@ server:
 
 spring:
   datasource:
-    url: jdbc:mysql://localhost:3306/item-management?autoReconnect=true&useUnicode=true&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
+    url: jdbc:mysql://localhost:3306/prod_test?autoReconnect=true&useUnicode=true&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
     username: root
     password: 914851221
     initialSize: 10 #初始化连接数D

+ 1 - 1
dao/src/main/java/com/dayou/mapper/BusinessOpportunityMapper.java

@@ -16,5 +16,5 @@ import org.apache.ibatis.annotations.Param;
  */
 public interface BusinessOpportunityMapper extends CustomBaseMapper<BusinessOpportunity> {
 
-    Page<BusinessOpportunityVO> getPage(Page page, @Param("dto") BusinessOpportunityVO businessOpportunity);
+    Page<BusinessOpportunityVO> getPage(Page page, @Param("dto") BusinessOpportunityVO businessOpportunity,@Param("keyword") String keyword);
 }

+ 1 - 1
dao/src/main/java/com/dayou/mapper/CustomerMapper.java

@@ -18,7 +18,7 @@ import java.util.List;
  */
 public interface CustomerMapper extends CustomBaseMapper<Customer> {
 
-    Page<CustomerDTO> getPage(Page page, @Param("customer") CustomerDTO customer);
+    Page<CustomerDTO> getPage(Page page, @Param("customer") CustomerDTO customer,@Param("keyword") String keyword);
 
     List<CustomerDTO> getList( @Param("customer") CustomerDTO customer);
 }

+ 6 - 0
dao/src/main/resources/mapper/BusinessOpportunityMapper.xml

@@ -38,6 +38,12 @@
         select <include refid="Base_Column_List"/> ,c.name as customerName,u.name as userName
         from business_opportunity left join customer c on business_opportunity.customer_id = c.id left join user u on u.id = business_opportunity.user_id
         where c.deleted =0 and business_opportunity.deleted = 0
+        <if test="keyword!=null and keyword!='' ">
+            and(
+            c.name like concat ('%',#{keyword},'%')
+            or u.name like concat('%',#{keyword},'%')
+            )
+        </if>
         <if test="dto!=null and dto.customerName!=null and dto.customerName!=''">
             and c.name like concat('%',#{dto.customerName},'%')
         </if>

+ 10 - 0
dao/src/main/resources/mapper/CustomerMapper.xml

@@ -36,6 +36,16 @@
             from customer c left join user u on c.user_id = u.id
         <where>
             and c.deleted = 0 and u.deleted = 0
+            <if test="keyword!=null and keyword!='' ">
+                and(
+                c.name like concat ('%',#{keyword},'%')
+                or c.department like concat('%',#{keyword},'%')
+                or c.position like concat('%',#{keyword},'%')
+                or c.section like concat('%',#{keyword},'%')
+                   or JSON_EXTRACT(c.city,'$[1]') = (select id from districts where ext_name =#{keyword})
+                or JSON_EXTRACT(c.city,'$[2]') = (select id from districts where ext_name =#{keyword})
+                )
+            </if>
             <if test="customer!=null and customer.name!=null and customer.name!='' ">
                 and c.name like concat ('%',#{customer.name},'%')
             </if>

+ 2 - 2
dao/src/main/resources/mapper/ItemMapper.xml

@@ -37,7 +37,7 @@
         i.created,
         i.modified,
         i.business_no, i.oa_no, i.name,i.cate, i.business_source,i.belong_to,i.client_unit,
-        i.client_name, i.mobile, u.name as client_manager, i.skiller, i.sign_date, i.payment_method, i.amount, i.state,i.department_id,i.contract_url,i.user_id,i.customer_id
+        c.name as client_name, i.mobile, u.name as client_manager, i.skiller, i.sign_date, i.payment_method, i.amount, i.state,i.department_id,i.contract_url,i.user_id,i.customer_id
     </sql>
 
     <sql id="Common_query_item">
@@ -95,7 +95,7 @@
         ) AS itemStatus
         FROM
         item i left join department d on i.department_id = d.id  left join dict_data dd1 on i.cate = dd1.id
-        left join dict_data dd2 on i.business_source = dd2.id left join user u on u.id = i.user_id
+        left join dict_data dd2 on i.business_source = dd2.id left join user u on u.id = i.user_id left join customer c on c.id = i.customer_id
         where i.deleted = 0 and dd1.deleted =0 and dd2.deleted = 0
     </sql>
 

+ 1 - 1
dao/src/main/resources/mapper/PaymentCollectionMapper.xml

@@ -73,7 +73,7 @@
                     i.amount -(
                     ifnull(( SELECT sum( amount ) FROM payment_collection WHERE item_id = i.id AND deleted = 0 ), 0 ))) AS NotPayedAmount
         FROM
-            item i
+            item i left join user u on u.id = i.user_id
         WHERE
             i.deleted =0
         <if test="dto!=null and dto.itemName!=null and dto.itemName!=''">

+ 1 - 1
service/src/main/java/com/dayou/service/IBusinessOpportunityService.java

@@ -17,7 +17,7 @@ import org.springframework.web.multipart.MultipartFile;
  */
 public interface IBusinessOpportunityService extends IService<BusinessOpportunity> {
 
-        Page<BusinessOpportunityVO> selectPage(Page page, BusinessOpportunityVO businessOpportunity);
+        Page<BusinessOpportunityVO> selectPage(Page page, BusinessOpportunityVO businessOpportunity,String keyword);
 
         BusinessOpportunity detail(Long id);
 

+ 1 - 1
service/src/main/java/com/dayou/service/ICustomerService.java

@@ -19,7 +19,7 @@ import java.util.List;
  */
 public interface ICustomerService extends IService<Customer> {
 
-        Page<CustomerDTO> selectPage(Page page,CustomerDTO customer);
+        Page<CustomerDTO> selectPage(Page page,CustomerDTO customer,String keyword);
 
         CustomerDTO detail(Long id);
 

+ 2 - 2
service/src/main/java/com/dayou/service/impl/BusinessOpportunityServiceImpl.java

@@ -45,8 +45,8 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
 
     @Override
     @SuppressWarnings("unchecked")
-    public Page<BusinessOpportunityVO> selectPage(Page page, BusinessOpportunityVO businessOpportunity){
-        Page<BusinessOpportunityVO> result = businessOpportunityMapper.getPage(page,businessOpportunity);
+    public Page<BusinessOpportunityVO> selectPage(Page page, BusinessOpportunityVO businessOpportunity,String keyword){
+        Page<BusinessOpportunityVO> result = businessOpportunityMapper.getPage(page,businessOpportunity,keyword);
         return result;
     }
 

+ 2 - 2
service/src/main/java/com/dayou/service/impl/CustomerServiceImpl.java

@@ -76,8 +76,8 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
 
     @Override
     @SuppressWarnings("unchecked")
-    public Page<CustomerDTO> selectPage(Page page,CustomerDTO customer){
-        Page<CustomerDTO> result = customerMapper.getPage(page,customer);
+    public Page<CustomerDTO> selectPage(Page page,CustomerDTO customer,String keyword){
+        Page<CustomerDTO> result = customerMapper.getPage(page,customer,keyword);
         //Page result = this.page(page, new QueryWrapper<Customer>(customer).in(CollectionUtils.isNotEmpty(customer.getUserIds()),Customer::getUserId,customer.getUserIds()));
         List<CustomerDTO> xRecords = new ArrayList<>();
         List<CustomerDTO> records = result.getRecords();