Kaynağa Gözat

Merge remote-tracking branch 'origin/dev' into dev

caozj 1 yıl önce
ebeveyn
işleme
2f68dd5f50

+ 1 - 0
hx-account/src/main/java/com/fjhx/account/service/account/impl/AccountRunningWaterServiceImpl.java

@@ -370,6 +370,7 @@ public class AccountRunningWaterServiceImpl extends ServiceImpl<AccountRunningWa
     @Override
     public void taxRefund(AccountRunningWaterDto dto) {
         dto.setStatus("10");
+        dto.setType("40");//退税
         add(dto);
         List<TaxRefundDetails> taxRefundDetailsList = dto.getTaxRefundDetailsList();
         taxRefundDetailsList.forEach(item -> item.setAccountRunningWaterId(dto.getId()));

+ 44 - 40
hx-account/src/main/resources/mapper/account/AccountRunningWaterMapper.xml

@@ -3,46 +3,50 @@
 <mapper namespace="com.fjhx.account.mapper.account.AccountRunningWaterMapper">
     <!--这段代码正常是不需要跨库查询的。但是一开始封装包的时候分装的不合理,pom里面包是不能互相引用的。account包继承sale包会出现依赖冲突,目前不好改动,只能跨库查询-->
     <select id="getPage" resultType="com.fjhx.account.entity.account.vo.AccountRunningWaterVo">
-        SELECT arw.*,
-               (SELECT IF
-                           (t1.type = 20, GROUP_CONCAT(c.`code`), GROUP_CONCAT(t4.`code`)) contractCodes
-                FROM account_payment t1
-                         LEFT JOIN account_request_funds t2 ON t1.business_id = t2.id
-                         LEFT JOIN account_request_funds_detail t3 ON t2.id = t3.account_request_funds_id
-                         LEFT JOIN `bytesailing_sale`.contract t4 ON t3.contract_id = t4.id
-                    --采购付款来源
-                         LEFT JOIN bytesailing_purchase.pay pa ON t1.business_id = pa.id
-                         LEFT JOIN bytesailing_purchase.pay_detail pad
-        ON pad.pay_id = pa.id
-            LEFT JOIN bytesailing_purchase.purchase p ON pad.purchase_id = p.id
-            LEFT JOIN bytesailing_sale.contract c ON p.data_resource_id = c.id
-        WHERE
-            t1.id = arw.business_id
-            ) AS contractCodes
-            , (
-        SELECT
-            IF
-            ( t1.type = 20, GROUP_CONCAT( c.id ), GROUP_CONCAT( t4.id ) ) contractIds
-        FROM
-            account_payment t1
-            LEFT JOIN account_request_funds t2
-        ON t1.business_id = t2.id
-            LEFT JOIN account_request_funds_detail t3 ON t2.id = t3.account_request_funds_id
-            LEFT JOIN `bytesailing_sale`.contract t4 ON t3.contract_id = t4.id
-            --采购付款来源
-            LEFT JOIN bytesailing_purchase.pay pa ON t1.business_id = pa.id
-            LEFT JOIN bytesailing_purchase.pay_detail pad ON pad.pay_id = pa.id
-            LEFT JOIN bytesailing_purchase.purchase p ON pad.purchase_id = p.id
-            LEFT JOIN bytesailing_sale.contract c ON p.data_resource_id = c.id
-        WHERE
-            t1.id = arw.business_id
-            ) AS contractIds
-            , am.alias accountManagementName
-            , am.corporation_id
-        FROM
-            account_running_water arw
-            LEFT JOIN account_management am
-        ON arw.account_management_id = am.id
+        SELECT arw.*
+             , if(arw.type = 40, (select GROUP_CONCAT(c.`code`)
+                                  from tax_refund_details trd
+                                           left join bytesailing_sale.contract c on c.id = trd.contract_id
+                                  where trd.account_running_water_id = arw.id),
+                  (SELECT IF
+                              (t1.type = 20, GROUP_CONCAT(c.`code`), GROUP_CONCAT(t4.`code`)) contractCodes
+                   FROM account_payment t1
+                            LEFT JOIN account_request_funds t2 ON t1.business_id = t2.id
+                            LEFT JOIN account_request_funds_detail t3 ON t2.id = t3.account_request_funds_id
+                            LEFT JOIN `bytesailing_sale`.contract t4 ON t3.contract_id = t4.id
+                       --采购付款来源
+                            LEFT JOIN bytesailing_purchase.pay pa ON t1.business_id = pa.id
+                            LEFT JOIN bytesailing_purchase.pay_detail pad
+                      ON pad.pay_id = pa.id
+                      LEFT JOIN bytesailing_purchase.purchase p ON pad.purchase_id = p.id
+                      LEFT JOIN bytesailing_sale.contract c ON p.data_resource_id = c.id
+                      WHERE
+                      t1.id = arw.business_id ) )AS contractCodes
+
+             , if(arw.type = 40, (select GROUP_CONCAT(trd.contract_id)
+                                  from tax_refund_details trd
+                                  where trd.account_running_water_id = arw.id), (SELECT IF
+                                                                                            (t1.type = 20,
+                                                                                             GROUP_CONCAT(c.id),
+                                                                                             GROUP_CONCAT(t4.id)) contractIds
+                                                                                 FROM account_payment t1
+                                                                                          LEFT JOIN account_request_funds t2
+                                                                                                    ON t1.business_id = t2.id
+                                                                                          LEFT JOIN account_request_funds_detail t3 ON t2.id = t3.account_request_funds_id
+                                                                                          LEFT JOIN `bytesailing_sale`.contract t4
+                                                                                                    ON t3.contract_id = t4.id
+                                                                                     --采购付款来源
+                                                                                          LEFT JOIN bytesailing_purchase.pay pa ON t1.business_id = pa.id
+                                                                                          LEFT JOIN bytesailing_purchase.pay_detail pad ON pad.pay_id = pa.id
+                      LEFT JOIN bytesailing_purchase.purchase p ON pad.purchase_id = p.id
+                      LEFT JOIN bytesailing_sale.contract c ON p.data_resource_id = c.id
+                      WHERE
+                      t1.id = arw.business_id )) AS contractIds
+             , am.alias                             accountManagementName
+             , am.corporation_id
+        FROM account_running_water arw
+                 LEFT JOIN account_management am
+                           ON arw.account_management_id = am.id
             ${ew.customSqlSegment}
     </select>
     <select id="getDetail" resultType="com.fjhx.account.entity.account.vo.AccountRunningWaterVo">

+ 5 - 0
hx-customer/src/main/java/com/fjhx/customer/entity/customer/vo/CustomerFollowRecordsVo.java

@@ -39,4 +39,9 @@ public class CustomerFollowRecordsVo extends CustomerFollowRecords {
      * 跟进类型
      */
     private String type;
+
+    /**
+     * 跟进人名称
+     */
+    private String followUpUserName;
 }

+ 3 - 0
hx-customer/src/main/java/com/fjhx/customer/mapper/customer/CustomerMapper.java

@@ -53,6 +53,9 @@ public interface CustomerMapper extends BaseMapper<Customer> {
      */
     void customerAllocation(CustomerDto dto);
 
+    /**
+     * 跟进记录获取
+     */
     List<CustomerFollowRecordsVo> getFollowUp(@Param("id") Long id, @Param("tenantId") String tenantId);
 
 }

+ 5 - 0
hx-customer/src/main/java/com/fjhx/customer/service/customer/impl/CustomerFollowRecordsServiceImpl.java

@@ -21,6 +21,7 @@ import com.fjhx.file.utils.ObsFileUtil;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.ruoyi.system.utils.UserUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -62,6 +63,10 @@ public class CustomerFollowRecordsServiceImpl extends ServiceImpl<CustomerFollow
                 record.setFileList(obsFiles);
             }
         }
+
+        //赋值跟进人名称
+        UserUtil.assignmentNickName(records, CustomerFollowRecordsVo::getCreateUser, CustomerFollowRecordsVo::setFollowUpUserName);
+
         //赋值客户名称
         customerService.attributeAssign(records, CustomerFollowRecordsVo::getCustomerId, (item, customer) -> {
             item.setCustomerName(customer.getName());

+ 2 - 0
hx-customer/src/main/java/com/fjhx/customer/service/customer/impl/CustomerServiceImpl.java

@@ -152,6 +152,8 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
 //                    .last("limit 3")
 //            );
 //            record.setCustomerFollowRecordsList(customerFollowRecordsList);
+            //赋值跟进人名称
+            UserUtil.assignmentNickName(followUp, CustomerFollowRecordsVo::getCreateUser, CustomerFollowRecordsVo::setFollowUpUserName);
             record.setCustomerFollowRecordsList(followUp);
 
             //赋值客户状态字典值

+ 9 - 6
hx-customer/src/main/resources/mapper/customer/CustomerFollowRecordsMapper.xml

@@ -8,7 +8,8 @@
                       create_time `date`,
                       NULL AS     contractCode,
                       10   AS     type,
-                      NULL AS     remark
+                      NULL AS     content,
+                      create_user
                FROM bytesailing_sale.sale_quotation sq
                WHERE sq.buy_corporation_id = #{id}
                  and sq.tenant_id = #{tenantId}
@@ -19,18 +20,20 @@
                       create_time `date`,
                       CODE AS     contractCode,
                       20   AS     type,
-                      NULL AS     remark
+                      NULL AS     content,
+                      create_user
                FROM bytesailing_sale.contract c
                WHERE c.buy_corporation_id = #{id}
                  and c.tenant_id = #{tenantId}
                  and c.del_flag = 0)
               UNION
               (SELECT id,
-                      NULL    AS amount,
+                      NULL AS amount,
                       `date`,
-                      NULL    AS contractCode,
-                      30      AS type,
-                      content AS remark
+                      NULL AS contractCode,
+                      30   AS type,
+                      content,
+                      create_user
                FROM customer_follow_records cfr
                WHERE cfr.customer_id = #{id})) t1
             ${ew.customSqlSegment}

+ 9 - 6
hx-customer/src/main/resources/mapper/customer/CustomerMapper.xml

@@ -77,7 +77,8 @@
                       create_time `date`,
                       NULL AS     contractCode,
                       10   AS     type,
-                      NULL AS     remark
+                      NULL AS     content,
+                      create_user
                FROM bytesailing_sale.sale_quotation sq
                WHERE sq.buy_corporation_id = #{id}
                  and sq.tenant_id = #{tenantId}
@@ -88,18 +89,20 @@
                       create_time `date`,
                       CODE AS     contractCode,
                       20   AS     type,
-                      NULL AS     remark
+                      NULL AS     content,
+                      create_user
                FROM bytesailing_sale.contract c
                WHERE c.buy_corporation_id = #{id}
                  and c.tenant_id = #{tenantId}
                  and c.del_flag = 0)
               UNION
               (SELECT id,
-                      NULL    AS amount,
+                      NULL AS amount,
                       `date`,
-                      NULL    AS contractCode,
-                      30      AS type,
-                      content AS remark
+                      NULL AS contractCode,
+                      30   AS type,
+                      content,
+                      create_user
                FROM customer_follow_records cfr
                WHERE cfr.customer_id = #{id})) t1
         ORDER BY t1.date DESC LIMIT 3