Преглед изворни кода

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

钱惠东 пре 5 дана
родитељ
комит
4db1c69a0f
27 измењених фајлова са 508 додато и 109 уклоњено
  1. 9 0
      RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/domain/TcFollow.java
  2. 4 1
      RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/domain/TcFollowForList.java
  3. 3 0
      RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/domain/TcProject.java
  4. 8 2
      RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/domain/TqContractLift.java
  5. 6 2
      RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/domain/TqContractLiftHistory.java
  6. 5 1
      RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/domain/bo/contract/TqContractLift4OrderNoBo.java
  7. 5 1
      RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/domain/bo/contract/TqContractLiftBo.java
  8. 5 1
      RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/domain/vo/contract/TqContractLiftExportVo.java
  9. 1 1
      RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/mapper/TcFollowMapper.java
  10. 1 1
      RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/service/ITbCurrencyService.java
  11. 10 1
      RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/service/impl/TbCurrencyServiceImpl.java
  12. 48 9
      RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/service/impl/TcFollowServiceImpl.java
  13. 24 0
      RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/service/impl/TcProjectServiceImpl.java
  14. 2 0
      RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/service/impl/TqContractLiftServiceImpl.java
  15. 18 0
      RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/service/impl/TqContractServiceImpl.java
  16. 29 23
      RuoYi-Vue-fast-master/src/main/resources/mybatis/business/TcAccountMapper.xml
  17. 176 1
      RuoYi-Vue-fast-master/src/main/resources/mybatis/business/TcFollowMapper.xml
  18. 11 6
      RuoYi-Vue-fast-master/src/main/resources/mybatis/business/TcProjectEquipmentMapper.xml
  19. 53 36
      RuoYi-Vue-fast-master/src/main/resources/mybatis/business/TcProjectMapper.xml
  20. 9 3
      RuoYi-Vue-fast-master/src/main/resources/mybatis/business/contract/TqContractLiftHistoryMapper.xml
  21. 17 4
      RuoYi-Vue-fast-master/src/main/resources/mybatis/business/contract/TqContractLiftMapper.xml
  22. 1 1
      ruoyi-ui-vue2/src/views/board/agentAddProject/index.vue
  23. 18 3
      ruoyi-ui-vue2/src/views/board/agentProjectStatistics/index.vue
  24. 4 0
      ruoyi-ui-vue2/src/views/contract/edit.vue
  25. 6 2
      ruoyi-ui-vue2/src/views/contract/index.vue
  26. 25 4
      ruoyi-ui-vue2/src/views/contract/lift/index.vue
  27. 10 6
      ruoyi-ui-vue2/src/views/crmManagement/follow/follow.vue

+ 9 - 0
RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/domain/TcFollow.java

@@ -99,4 +99,13 @@ public class TcFollow extends BaseEntity
     
     @TableField(exist = false)
     private List<Long> countries;
+
+    //现需要排除的IDlist
+    @TableField(exist = false)
+    private List<Long> excludeFollowIdList;
+    @TableField(exist = false)
+    private List<String> businessNoList;
+    //++++++++++查询子数据的时候用到 start
+    @TableField(exist = false)
+    private Boolean isGroupBy = true;
 }

+ 4 - 1
RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/domain/TcFollowForList.java

@@ -6,6 +6,8 @@ import com.ruoyi.framework.web.domain.BaseEntity;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import java.util.Date;
+import java.util.List;
+
 import lombok.Data;
 import org.springframework.data.annotation.Transient;
 
@@ -99,6 +101,7 @@ public class TcFollowForList extends BaseEntity
 
     /** 数据权限字符 */
     private String permissionChar;
-    
+
+    private List<TcFollowForList> children;
 
 }

+ 3 - 0
RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/domain/TcProject.java

@@ -435,4 +435,7 @@ public class TcProject extends BaseEntity {
     // 关联线索
     private String leads;
     private String countryAbbr;
+
+    //当前币种汇率
+    private BigDecimal exchangeRate;
 }

+ 8 - 2
RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/domain/TqContractLift.java

@@ -173,10 +173,16 @@ public class TqContractLift extends BaseEntity
     @Excel(name = "已收金额",i18nCode = "lift.receivedAmount", sort= 39)
     private BigDecimal receivedAmount;
 
-    /** 款比例 */
-    @Excel(name = "收款比例",i18nCode = "lift.paymentRatio", sort= 40,dictType = "payment_ratio")
+    /** 款比例 */
+//    @Excel(name = "付款比例",i18nCode = "lift.paymentRatio", sort= 40,dictType = "payment_ratio")
     private String paymentRatio;
 
+
+    /** 收款比例 */
+    @Excel(name = "收款比例",i18nCode = "lift.paymentRatio", sort= 40)
+    private String collectionRatio;
+
+
     /** 应收余额 */
     @Excel(name = "应收余额",i18nCode = "lift.accountsReceivableBalance", sort= 41)
     private BigDecimal accountsReceivableBalance;

+ 6 - 2
RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/domain/TqContractLiftHistory.java

@@ -210,10 +210,14 @@ public class TqContractLiftHistory extends BaseEntity
     @Excel(name = "已收金额")
     private BigDecimal receivedAmount;
 
-    /** 款比例 */
-    @Excel(name = "款比例")
+    /** 款比例 */
+    @Excel(name = "款比例")
     private String paymentRatio;
 
+    /** 收款比例 46*/
+    @Excel(name = "收款比例")
+    private String collectionRatio;
+
     /** 应收余额 */
     @Excel(name = "应收余额")
     private BigDecimal accountsReceivableBalance;

+ 5 - 1
RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/domain/bo/contract/TqContractLift4OrderNoBo.java

@@ -214,9 +214,13 @@ public class TqContractLift4OrderNoBo extends BaseEntity
     @Excel(name = "已收金额")
     private BigDecimal receivedAmount;
 
+    /** 付款比例 */
+    @Excel(name = "付款比例")
+    private List<Long> paymentRatio;
+
     /** 收款比例 */
     @Excel(name = "收款比例")
-    private List<Long> paymentRatio;
+    private String collectionRatio;
 
     /** 应收余额 */
     @Excel(name = "应收余额")

+ 5 - 1
RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/domain/bo/contract/TqContractLiftBo.java

@@ -210,9 +210,13 @@ public class TqContractLiftBo extends BaseEntity
     @Excel(name = "已收金额")
     private BigDecimal receivedAmount;
 
+    /** 付款比例 */
+    @Excel(name = "付款比例")
+    private List<Long> paymentRatio;
+
     /** 收款比例 */
     @Excel(name = "收款比例")
-    private List<Long> paymentRatio;
+    private String collectionRatio;
 
     /** 应收余额 */
     @Excel(name = "应收余额")

+ 5 - 1
RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/domain/vo/contract/TqContractLiftExportVo.java

@@ -233,9 +233,13 @@ public class TqContractLiftExportVo
     @Excel(name = "已收金额",i18nCode = "lift.receivedAmount", sort= 45)
     private String receivedAmountExport;
 
+    /** 付款比例 46*/
+    @Excel(name = "付款比例",i18nCode = "lift.paymentRatio", sort= 46,dictType = "contract_payment_ratio")
+    private String paymentRatio;
+
     /** 收款比例 46*/
     @Excel(name = "收款比例",i18nCode = "lift.paymentRatio", sort= 46,dictType = "contract_payment_ratio")
-    private String paymentRatio;
+    private String collectionRatio;
 
     /** 应收余额 47*/
 //    @Excel(name = "应收余额",i18nCode = "lift.accountsReceivableBalance", sort= 47)

+ 1 - 1
RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/mapper/TcFollowMapper.java

@@ -30,7 +30,7 @@ public interface TcFollowMapper
      * @return 【跟进管理】集合
      */
     public List<TcFollowForList> selectTcFollowList(TcFollow tcFollow);
-
+    public List<TcFollowForList> selectTcFollowListMore(TcFollow tcFollow);
     /**
      * 新增【跟进管理】
      * 

+ 1 - 1
RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/service/ITbCurrencyService.java

@@ -25,7 +25,7 @@ public interface ITbCurrencyService extends IService<TbCurrency> {
 
 
     List<TbCurrency> getUsableCurrencyRate();
-
+    List<TbCurrency> getUsableCurrencyRate(String currencyName);
     boolean add(CurrencySaveReq tbCurrency);
 
     boolean edit(CurrencySaveReq tbCurrency);

+ 10 - 1
RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/service/impl/TbCurrencyServiceImpl.java

@@ -84,7 +84,16 @@ public class TbCurrencyServiceImpl extends ServiceImpl<TbCurrencyMapper, TbCurre
             .eq(TbCurrency::getDelFlag, DelFlagEnum.NORMAL.getValue())
         );
     }
-
+    @Override
+    public List<TbCurrency> getUsableCurrencyRate(String currencyName) {
+        return this.list(Wrappers.<TbCurrency>lambdaQuery()
+                .eq(TbCurrency::getCurrencyName, currencyName)
+                .le(TbCurrency::getEffectiveDate, DateUtils.getNowDate())
+                .ge(TbCurrency::getExpirationDate, DateUtils.getNowDate())
+                .eq(TbCurrency::getDelFlag, DelFlagEnum.NORMAL.getValue())
+                .orderByDesc(TbCurrency::getCurrencyId)
+        );
+    }
     @Override
     public CurrencyRes getInfo(Long currencyId) {
         TbCurrency currency = getById(currencyId);

+ 48 - 9
RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/service/impl/TcFollowServiceImpl.java

@@ -1,21 +1,21 @@
 package com.ruoyi.project.business.service.impl;
 
 import java.text.SimpleDateFormat;
-import java.util.Arrays;
-import java.util.List;
+import java.util.*;
 
+import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.URLUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.ruoyi.common.enums.FileBuzType;
 import com.ruoyi.common.enums.SerialNumberPrefix;
-import com.ruoyi.common.utils.DateUtils;
-import com.ruoyi.common.utils.LocalUtils;
-import com.ruoyi.common.utils.SecurityUtils;
-import com.ruoyi.common.utils.SpecialCharacterEscaper;
+import com.ruoyi.common.utils.*;
 import com.ruoyi.framework.redis.RedisCache;
 import com.ruoyi.project.business.domain.TbFile;
 import com.ruoyi.project.business.domain.TcLead;
+import com.ruoyi.project.business.domain.bo.quotation.QuotationQueryBO;
+import com.ruoyi.project.business.domain.flow.Flow;
+import com.ruoyi.project.business.domain.vo.quotation.QuotationVO;
 import com.ruoyi.project.business.mapper.TcLeadMapper;
 import com.ruoyi.project.business.service.*;
 import org.apache.commons.lang3.StringUtils;
@@ -26,10 +26,10 @@ import com.ruoyi.project.business.domain.TcFollow;
 import com.ruoyi.project.business.domain.TcFollowForList;
 
 import javax.annotation.Resource;
-import java.util.Date;
-import java.util.Optional;
 import java.util.stream.Collectors;
 
+import static com.ruoyi.project.business.enums.AuditFlowEnum.BARGAIN;
+import static com.ruoyi.project.business.enums.AuditFlowEnum.QUOTATION;
 import static com.ruoyi.project.business.enums.lead.LeadStatusEnum.*;
 
 /**
@@ -113,9 +113,48 @@ public class TcFollowServiceImpl implements ITcFollowService
         if(SecurityUtils.hasRoleAgentSales()){
             tcFollow.setLoginUserId(loginUserId);
         }
+        tcFollow.setIsGroupBy(true);
         // SQL 中的 case when 可以使用 mybatis if 标签代替
-        List<TcFollowForList> follows = tcFollowMapper.selectTcFollowList(tcFollow);
+        //List<TcFollowForList> follows = tcFollowMapper.selectTcFollowList(tcFollow);
+        List<TcFollowForList> follows = tcFollowMapper.selectTcFollowListMore(tcFollow);
         LocalUtils.setLocalAreaAndCountryNameBatch(follows, TcFollowForList::getAreaId, TcFollowForList::getCountryId, TcFollowForList::setAreaName, TcFollowForList::setCountryName);
+
+        // 查询子项(一下新增)
+        List<String> businessNoList = follows.stream().map(TcFollowForList::getBusinessNo)
+                .collect(Collectors.toList());
+        List<Long> followIdList = follows.stream().map(TcFollowForList::getFollowId)
+                .collect(Collectors.toList());
+
+        if (CollUtil.isNotEmpty(businessNoList)) {
+            TcFollow tcFollowChild = new TcFollow();
+            tcFollowChild.setBusinessNoList(businessNoList);
+            tcFollowChild.setExcludeFollowIdList(followIdList);
+            tcFollowChild.setIsGroupBy(false);
+            tcFollowChild.setPermissionChar(SecurityUtils.getPermissionCharIns());
+            // 代理商销售经理的场合
+            // 代理商销售经理的场合
+            if(SecurityUtils.hasRoleAgentSales()){
+                tcFollowChild.setLoginUserId(loginUserId);
+            }
+            // List<TcFollowForList> childrenList = tcFollowMapper.selectTcFollowList(tcFollowChild);
+            List<TcFollowForList> childrenList = tcFollowMapper.selectTcFollowListMore(tcFollowChild);
+
+            LocalUtils.setLocalAreaAndCountryNameBatch(childrenList, TcFollowForList::getAreaId, TcFollowForList::getCountryId, TcFollowForList::setAreaName, TcFollowForList::setCountryName);
+
+            if (CollUtil.isNotEmpty(childrenList)) {
+
+                if (CollUtil.isNotEmpty(childrenList)) {
+                    Map<String, List<TcFollowForList>> childrenMap = childrenList.stream()
+                            .collect(Collectors.groupingBy(TcFollowForList::getBusinessNo));
+                    for (TcFollowForList item : follows) {
+
+                        item.setChildren(childrenMap.getOrDefault(item.getBusinessNo(),
+                                Collections.emptyList()));
+                    }
+                }
+            }
+        }
+
         return follows;
     }
 

+ 24 - 0
RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/service/impl/TcProjectServiceImpl.java

@@ -163,6 +163,8 @@ public class TcProjectServiceImpl extends ServiceImpl<TcProjectMapper, TcProject
     @Resource
     private ITbCountryService tbCountryService;
 
+    @Resource
+    private  ITbCurrencyService tbCurrencyService;
     /**
      * 查询项目管理
      *
@@ -541,6 +543,17 @@ public class TcProjectServiceImpl extends ServiceImpl<TcProjectMapper, TcProject
         tcProject.setCreateBy(SecurityUtils.getUserId().toString());
         tcProject.setCreateTime(now);
         tcProject.setUpdateTime(now);
+        //20240913新增币种汇率新增
+        //首先获取当前可以的币种
+        List<TbCurrency> currencyList = tbCurrencyService.getUsableCurrencyRate(tcProject.getCurrencyId());
+        if(ObjectUtils.isNotEmpty(currencyList)){
+            //当前币种存在可用汇率 直接取第一个
+            tcProject.setExchangeRate(currencyList.get(0).getExchangeRate());
+        }else {
+            //若没有找到当前汇率直接按1处理
+            tcProject.setExchangeRate(new BigDecimal(1));
+        }
+
         int result = tcProjectMapper.insertTcProject(tcProject);
         //        if (tcProject.getLeadId() != null) {
         //            tcLeadService.convertProject(tcProject.getLeadId(), tcProject.getProjectId());
@@ -643,6 +656,17 @@ public class TcProjectServiceImpl extends ServiceImpl<TcProjectMapper, TcProject
         }
         tcProject.setUpdateBy(SecurityUtils.getUserId().toString());
         tcProject.setUpdateTime(DateUtils.getNowDate());
+
+        //首先获取当前可以的币种
+        List<TbCurrency> currencyList = tbCurrencyService.getUsableCurrencyRate(tcProject.getCurrencyId());
+        if(ObjectUtils.isNotEmpty(currencyList)){
+            //当前币种存在可用汇率 直接取第一个
+            tcProject.setExchangeRate(currencyList.get(0).getExchangeRate());
+        }else {
+            //若没有找到当前汇率直接按1处理
+            tcProject.setExchangeRate(new BigDecimal(1));
+        }
+
         // 不考虑非空全部修改
         int result = tcProjectMapper.updateTcProjectAll(tcProject);
         if (flag) {

+ 2 - 0
RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/service/impl/TqContractLiftServiceImpl.java

@@ -38,6 +38,7 @@ import org.springframework.web.bind.annotation.PathVariable;
 
 import javax.annotation.Resource;
 
+import static com.ruoyi.project.business.service.impl.TqContractServiceImpl.countCollectionRatio;
 import static com.ruoyi.project.business.service.impl.TqContractServiceImpl.formatBigDecimal;
 
 /**
@@ -179,6 +180,7 @@ public class TqContractLiftServiceImpl implements ITqContractLiftService
             if(signingDateListIdAndRateMap.containsKey(Long.parseLong(item.getCurrencyId()))){
                 item.setRate4SigningContracts(signingDateListIdAndRateMap.get(Long.parseLong(item.getCurrencyId())));
             }
+            item.setCollectionRatio(countCollectionRatio(item.getReceivedAmount(),item.getAccountsReceivableBalance()));
         });
         return tqContractLiftMapper.updateTqContractLiftBatch(tqContractLiftList);
     }

+ 18 - 0
RuoYi-Vue-fast-master/src/main/java/com/ruoyi/project/business/service/impl/TqContractServiceImpl.java

@@ -52,6 +52,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.File;
 import java.io.IOException;
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.text.DecimalFormat;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -317,6 +318,11 @@ public class TqContractServiceImpl implements ITqContractService
         return tqContractMapper.updateTqContract(tqContractDto);
     }
 
+     /**
+      * @Author Chenj
+      * @Description 将导出的价格格式化  货币开头    三位一逗且保留两位小数
+      * @Date 15:56 2024/9/14
+      **/
     public static String formatBigDecimal(BigDecimal value,String unit) {
         if(value != null){
             DecimalFormat decimalFormat = new DecimalFormat("#,###.00");
@@ -399,6 +405,7 @@ public class TqContractServiceImpl implements ITqContractService
             item.setContractNoVersionNo(tqContractDto.getContractNo()+"-"+tqContractDto.getVersion());
             item.setPermissionChar(SecurityUtils.getPermissionCharIns());
             item.setType(tqContractDto.getType());
+            item.setCollectionRatio(countCollectionRatio(item.getReceivedAmount(),item.getAccountsReceivableBalance()));
             //将签单币种汇率赋值
             if(scheduleListIdAndRateMap.containsKey(Long.parseLong(item.getCurrencyId()))){
                 item.setRate4ProductionScheduling(scheduleListIdAndRateMap.get(Long.parseLong(item.getCurrencyId())));
@@ -415,6 +422,17 @@ public class TqContractServiceImpl implements ITqContractService
         return tqContractLiftList;
     }
 
+    public static String countCollectionRatio(BigDecimal a,BigDecimal b) {
+        //只有两个金额都在才做计算
+        if(a == null || b== null){
+            return null;
+        }
+        // 计算百分比
+        BigDecimal percentage = a.divide(b, 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100"));
+        // 保留两位小数并格式化为字符串
+        String formattedPercentage = percentage.setScale(2, RoundingMode.HALF_UP).toPlainString() + "%";
+        return formattedPercentage;
+    }
 
 
     /**

+ 29 - 23
RuoYi-Vue-fast-master/src/main/resources/mybatis/business/TcAccountMapper.xml

@@ -660,32 +660,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     LEFT JOIN (
                         select project_id,
                         SUM(IFNULL(equipment_quantity,0)) as deviceTotal,
-                        SUM(IFNULL(equipment_quantity,0) * IFNULL(amount,0)) as priceTotal
+                        SUM(IFNULL(equipment_quantity,0) * IFNULL(amount,0) / IFNULL(exchange_rate,1)) as priceTotal
                         from(
                         SELECT
                         main.project_id,
                         main.quotation_no,
-                        ts.elevator_number AS equipment_quantity,
-                        case
+                        SUM(ts.elevator_number) AS equipment_quantity,
+                        SUM( case
                         WHEN main.quotation_status &lt; 6 THEN	 0
                         ELSE IFNULL( ts.final_price, ts.price )
-                        END AS amount
+                        END )AS amount,
+                        main.exchange_rate
                         FROM
                         (
-                        SELECT DISTINCT
-                        quo.id,
-                        project.project_id,
-                        quo.quotation_no,
-                        quo.quotation_status
-                        FROM
-                        tq_quotation quo
-                        LEFT JOIN tc_project project ON quo.project_id = project.project_id
-                        AND project.del_flag = '0'
-                        WHERE
-                        quo.del_flag = '0'
-                        ORDER BY
-                        FIELD( quo.quotation_status, '9' ) DESC,
-                        id DESC
+                            select * from (
+                            SELECT DISTINCT
+                            quo.id,
+                            project.project_id,
+                            quo.quotation_no,
+                            quo.quotation_status,
+                            project.exchange_rate
+                            FROM
+                            tq_quotation quo
+                            LEFT JOIN tc_project project ON quo.project_id = project.project_id
+                            AND project.del_flag = '0'
+                            WHERE
+                            quo.del_flag = '0'
+                            ORDER BY
+                            FIELD( quo.quotation_status, '9' ) DESC,
+                            id DESC
+                            ) temp group by quotation_no
                         ) main
                         LEFT JOIN tq_specification ts ON ts.quotation_id = main.id
                         AND ts.del_flag = '0'
@@ -693,13 +697,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                         main.quotation_no
                         union
                         SELECT
-                        project_id,
+                        eq.project_id,
                         '' AS quotation_no,
-                        equipment_quantity,
-                        amount
+                        eq.equipment_quantity,
+                        eq.amount,
+                        project.exchange_rate
                         FROM
-                        tc_project_equipment
-                        where  del_flag = '0'
+                        tc_project_equipment eq
+                        LEFT JOIN tc_project project ON eq.project_id = project.project_id
+                        where  eq.del_flag = '0'
                         ) main
                         GROUP BY main.project_id
                     ) AS child ON child.project_id = tp1.project_id

+ 176 - 1
RuoYi-Vue-fast-master/src/main/resources/mybatis/business/TcFollowMapper.xml

@@ -177,8 +177,62 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             ON sub1.permission_char = sub2.premession_char
     </sql>
 
+    <sql id="test">
+      select * from (
+        SELECT DISTINCT
+        follow_id,
+        business_id,
+        follow_type
+        FROM
+        tc_follow
+        where
+        del_flag = '0'
+        ORDER BY id DESC
+        ) temp
+        Group by business_id,follow_type
+    </sql>
+
+    <sql id="test2">
+        SELECT MAX( t1.follow_id ) AS follow_id
+        FROM
+        tc_follow  t1
+        inner join (SELECT p.premession_char FROM (SELECT @premessionStr:= #{permissionChar} p) param ,
+        getpremessionview_chars p
+        ) permission on permission.premession_char = t1.permission_char
+        <where>
+            <if test="loginUserId != null  and loginUserId != ''">
+                and (t1.permission_char &lt;&gt; #{permissionChar} or t1.create_by = #{loginUserId})
+            </if>
+            <if test="followTypeArray != null  and followTypeArray.length != 0">
+                and t1.follow_type in
+                <foreach item="type" collection="followTypeArray" open="(" separator="," close=")">
+                    #{type}
+                </foreach>
+            </if>
+            <if test="followNo != null  and followNo != ''"> and t1.follow_no like CONCAT('%', #{followNo},'%')  escape '/' </if>
+            <if test="beginTime != null and beginTime != ''">
+                and date_format(t1.follow_time,'%Y%m%d') &gt;= date_format(#{beginTime},'%Y%m%d')
+            </if>
+            <if test="endTime != null and endTime != ''">
+                and date_format(t1.follow_time,'%Y%m%d') &lt;= date_format(#{endTime},'%Y%m%d')
+            </if>
+            <if test="followPerson != null  and followPerson != ''"> and t1.follow_person like CONCAT('%', #{followPerson},'%')  escape '/'</if>
+            <if test="followWayArray != null  and followWayArray.length > 0">
+                and t1.follow_way in
+                <foreach item="way" collection="followWayArray" open="(" separator="," close=")">
+                    #{way}
+                </foreach>
+            </if>
+            <if test="contactPerson != null  and contactPerson != ''"> and t1.contact_person like CONCAT('%', #{contactPerson},'%')  escape '/'</if>
+            <if test="contact != null  and contact != ''"> and t1.contact = #{contact}</if>
+            <if test="followDesc != null  and followDesc != ''"> and t1.follow_desc like CONCAT('%', #{followDesc},'%')  escape '/' </if>
+
+        </where>
+        GROUP BY business_id,follow_type
+    </sql>
     <select id="selectTcFollowList" parameterType="com.ruoyi.project.business.domain.TcFollow" resultMap="TcFollowResultForList">
         <include refid="selectTcFollowVo2"/>
+
         <where>
             <if test="followIds != null and followIds.size() > 0">
                 and sub1.follow_id in
@@ -228,7 +282,128 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         ORDER BY  sub1.follow_id DESC
     </select>
-    
+
+
+    <select id="selectTcFollowListMore" parameterType="com.ruoyi.project.business.domain.TcFollow" resultMap="TcFollowResultForList">
+        <include refid="selectTcFollowVo2"/>
+        <if test="isGroupBy">
+        INNER JOIN (
+          <include refid="test2"/>
+        ) ids on ids.follow_id = sub1.follow_id
+        </if>
+        <where>
+            <if test="followIds != null and followIds.size() > 0">
+                and sub1.follow_id in
+                <foreach item="followId" collection="followIds" open="(" separator="," close=")">
+                    #{followId}
+                </foreach>
+            </if>
+
+            <if test="loginUserId != null  and loginUserId != ''">
+                and (sub1.permission_char &lt;&gt; #{permissionChar} or sub1.create_by = #{loginUserId})
+            </if>
+
+            <if test="followTypeArray != null  and followTypeArray.length != 0">
+                and sub1.follow_type in
+                <foreach item="type" collection="followTypeArray" open="(" separator="," close=")">
+                    #{type}
+                </foreach>
+            </if>
+            <if test="followNo != null  and followNo != ''"> and sub1.follow_no like CONCAT('%', #{followNo},'%')  escape '/' </if>
+            <if test="beginTime != null and beginTime != ''">
+                and date_format(sub1.follow_time,'%Y%m%d') &gt;= date_format(#{beginTime},'%Y%m%d')
+            </if>
+            <if test="endTime != null and endTime != ''">
+                and date_format(sub1.follow_time,'%Y%m%d') &lt;= date_format(#{endTime},'%Y%m%d')
+            </if>
+            <!--           <if test="beginTime != null  and beginTime != ''"> and sub1.follow_time BETWEEN #{beginTime} AND #{endTime}</if>-->
+            <if test="businessId != null "> and sub1.business_id = #{businessId}</if>
+            <if test="businessNo != null "> and sub1.business_no like CONCAT('%', #{businessNo},'%')  escape '/' </if>
+            <if test="followPerson != null  and followPerson != ''"> and sub1.follow_person like CONCAT('%', #{followPerson},'%')  escape '/'</if>
+            <if test="followWayArray != null  and followWayArray.length > 0">
+                and sub1.follow_way in
+                <foreach item="way" collection="followWayArray" open="(" separator="," close=")">
+                    #{way}
+                </foreach>
+            </if>
+            <if test="contactPerson != null  and contactPerson != ''"> and sub1.contact_person like CONCAT('%', #{contactPerson},'%')  escape '/'</if>
+            <if test="contact != null  and contact != ''"> and sub1.contact = #{contact}</if>
+            <if test="followDesc != null  and followDesc != ''"> and sub1.follow_desc like CONCAT('%', #{followDesc},'%')  escape '/' </if>
+            <if test="follower != null  and follower != ''"> and sub1.follower like CONCAT('%', #{follower},'%')  escape '/' </if>
+
+            <if test="countries != null and countries.size() > 0">
+                and sub1.country_id in
+                <foreach item="countryId" collection="countries" open="(" separator="," close=")">
+                    #{countryId}
+                </foreach>
+            </if>
+
+            <if test="excludeFollowIdList != null and excludeFollowIdList.size() > 0">
+                and sub1.follow_id not in
+                <foreach item="item" collection="excludeFollowIdList" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="businessNoList != null and businessNoList.size() > 0">
+                and sub1.business_no in
+                <foreach item="item" collection="businessNoList" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+        ORDER BY  sub1.follow_id DESC
+    </select>
+
+    <!--<trim prefix="HAVING" prefixOverrides="AND">-->
+        <!--<if test="isGroupBy">-->
+            <!--AND sub1.follow_id in (-->
+            <!--SELECT MAX( t1.follow_id ) AS follow_id-->
+            <!--FROM-->
+            <!--tc_follow  t1-->
+            <!--inner join (SELECT p.premession_char FROM (SELECT @premessionStr:= #{permissionChar} p) param ,-->
+            <!--getpremessionview_chars p-->
+            <!--) permission on permission.premession_char = t1.permission_char-->
+            <!--<where>-->
+                <!--<if test="loginUserId != null  and loginUserId != ''">-->
+                    <!--and (t1.permission_char &lt;&gt; #{permissionChar} or t1.create_by = #{loginUserId})-->
+                <!--</if>-->
+                <!--<if test="followTypeArray != null  and followTypeArray.length != 0">-->
+                    <!--and t1.follow_type in-->
+                    <!--<foreach item="type" collection="followTypeArray" open="(" separator="," close=")">-->
+                        <!--#{type}-->
+                    <!--</foreach>-->
+                <!--</if>-->
+                <!--<if test="followNo != null  and followNo != ''"> and t1.follow_no like CONCAT('%', #{followNo},'%')  escape '/' </if>-->
+                <!--<if test="beginTime != null and beginTime != ''">-->
+                    <!--and date_format(t1.follow_time,'%Y%m%d') &gt;= date_format(#{beginTime},'%Y%m%d')-->
+                <!--</if>-->
+                <!--<if test="endTime != null and endTime != ''">-->
+                    <!--and date_format(t1.follow_time,'%Y%m%d') &lt;= date_format(#{endTime},'%Y%m%d')-->
+                <!--</if>-->
+                <!--<if test="businessNo != null "> and t1.business_no like CONCAT('%', #{businessNo},'%')  escape '/' </if>-->
+                <!--<if test="followPerson != null  and followPerson != ''"> and t1.follow_person like CONCAT('%', #{followPerson},'%')  escape '/'</if>-->
+                <!--<if test="followWayArray != null  and followWayArray.length > 0">-->
+                    <!--and t1.follow_way in-->
+                    <!--<foreach item="way" collection="followWayArray" open="(" separator="," close=")">-->
+                        <!--#{way}-->
+                    <!--</foreach>-->
+                <!--</if>-->
+                <!--<if test="contactPerson != null  and contactPerson != ''"> and t1.contact_person like CONCAT('%', #{contactPerson},'%')  escape '/'</if>-->
+                <!--<if test="contact != null  and contact != ''"> and t1.contact = #{contact}</if>-->
+                <!--<if test="followDesc != null  and followDesc != ''"> and t1.follow_desc like CONCAT('%', #{followDesc},'%')  escape '/' </if>-->
+                <!--<if test="follower != null  and follower != ''"> and t1.follower like CONCAT('%', #{follower},'%')  escape '/' </if>-->
+
+                <!--<if test="countries != null and countries.size() > 0">-->
+                    <!--and t1.country_id in-->
+                    <!--<foreach item="countryId" collection="countries" open="(" separator="," close=")">-->
+                        <!--#{countryId}-->
+                    <!--</foreach>-->
+                <!--</if>-->
+            <!--</where>-->
+            <!--GROUP BY business_id,follow_type)-->
+        <!--</if>-->
+    <!--</trim>-->
+
     <select id="selectTcFollowByFollowId" parameterType="java.lang.Long" resultMap="TcFollowResult">
         select t.*, u.nick_name as follower from
         (

+ 11 - 6
RuoYi-Vue-fast-master/src/main/resources/mybatis/business/TcProjectEquipmentMapper.xml

@@ -176,16 +176,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         main.quotation_no,
         main.version,
         main.origin,
-        ts.elevator_number AS equipment_quantity,
+        SUM(ts.elevator_number) AS equipment_quantity,
         elv.elevator_type AS equipment_type,
         elv.elevator_model,
-        case
+        SUM( case
         WHEN main.quotation_status &lt; 6 THEN	 0
         ELSE IFNULL( ts.final_price, ts.price )
-        END AS amount,
+        END
+        ) AS amount,
         ts.specification AS standard
         FROM
         (
+        select * from (
         SELECT DISTINCT
         quo.id,
         project.project_id,
@@ -204,6 +206,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ORDER BY
         FIELD( quo.quotation_status, '9' ) DESC,
         id DESC
+        ) temp group by quotation_no
         ) main
         LEFT JOIN tq_specification ts ON ts.quotation_id = main.id
         AND ts.del_flag = '0'
@@ -262,14 +265,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
             SELECT
             main.quotation_no,
-            ts.elevator_number AS equipment_quantity,
-            case
+            SUM(ts.elevator_number) AS equipment_quantity,
+            SUM( case
             WHEN main.quotation_status &lt; 6 THEN	 0
             ELSE IFNULL( ts.final_price, ts.price )
             END
-             AS amount
+            ) AS amount
             FROM
             (
+            select * from (
             SELECT DISTINCT
             quo.id,
             quo.quotation_no,
@@ -285,6 +289,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             ORDER BY
             FIELD( quo.quotation_status, '9' ) DESC,
             id DESC
+            ) temp group by quotation_no
             ) main
             LEFT JOIN tq_specification ts ON ts.quotation_id = main.id
             AND ts.del_flag = '0'

+ 53 - 36
RuoYi-Vue-fast-master/src/main/resources/mybatis/business/TcProjectMapper.xml

@@ -76,6 +76,8 @@
         <result property="competitor" column="competitor"/>
         <result property="reasonType" column="reason_type"/>
         <result property="reasonTypeName" column="reasonTypeName"/>
+        <result property="exchangeRate" column="exchange_rate"/>
+
     </resultMap>
 
     <resultMap type="TcProjectForRelated" id="TcProjectResultForRelated"  extends="TcProjectResult">
@@ -204,27 +206,30 @@
                         SELECT
                             main.project_id,
                             main.quotation_no,
-                            ts.elevator_number AS equipment_quantity,
-                            case
+                            SUM(ts.elevator_number) AS equipment_quantity,
+                            SUM( case
                             WHEN main.quotation_status &lt; 6 THEN	 0
                             ELSE IFNULL( ts.final_price, ts.price )
-                            END AS amount
+                            END
+                            ) AS amount
                         FROM
                             (
-                            SELECT DISTINCT
-                                quo.id,
-                                project.project_id,
-                                quo.quotation_no,
-                                quo.quotation_status
-                            FROM
-                                tq_quotation quo
-                                LEFT JOIN tc_project project ON quo.project_id = project.project_id
-                                AND project.del_flag = '0'
-                            WHERE
-                                quo.del_flag = '0'
-                            ORDER BY
-                                FIELD( quo.quotation_status, '9' ) DESC,
-                                id DESC
+                                select * from (
+                                  SELECT DISTINCT
+                                    quo.id,
+                                    project.project_id,
+                                    quo.quotation_no,
+                                    quo.quotation_status
+                                FROM
+                                    tq_quotation quo
+                                    LEFT JOIN tc_project project ON quo.project_id = project.project_id
+                                    AND project.del_flag = '0'
+                                WHERE
+                                    quo.del_flag = '0'
+                                ORDER BY
+                                    FIELD( quo.quotation_status, '9' ) DESC,
+                                    id DESC
+                                 ) temp group by quotation_no
                             ) main
                             LEFT JOIN tq_specification ts ON ts.quotation_id = main.id
                             AND ts.del_flag = '0'
@@ -650,14 +655,16 @@
                         SELECT
                             main.project_id,
                             main.quotation_no,
-                            ts.elevator_number AS equipment_quantity,
-                            case
+                            SUM(ts.elevator_number) AS equipment_quantity,
+                            SUM( case
                             WHEN main.quotation_status &lt; 6 THEN	 0
                             ELSE IFNULL( ts.final_price, ts.price )
-                            END AS amount
+                            END
+                            ) AS amount
                         FROM
                             (
-                            SELECT DISTINCT
+                                select * from (
+                                SELECT DISTINCT
                                 quo.id,
                                 project.project_id,
                                 quo.quotation_no,
@@ -671,6 +678,7 @@
                             ORDER BY
                                 FIELD( quo.quotation_status, '9' ) DESC,
                                 id DESC
+                                ) temp group by quotation_no
                             ) main
                             LEFT JOIN tq_specification ts ON ts.quotation_id = main.id
                             AND ts.del_flag = '0'
@@ -836,6 +844,7 @@
             <if test="equipmentType != null">equipment_type,</if>
             <if test="amount != null">amount,</if>
             <if test="expectedInstallStartDate != null">expected_install_start_date,</if>
+            <if test="exchangeRate != null">exchange_rate,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="projectNo != null">#{projectNo},</if>
@@ -884,6 +893,7 @@
             <if test="equipmentType != null">#{equipmentType},</if>
             <if test="amount != null">#{amount},</if>
             <if test="expectedInstallStartDate != null">#{expectedInstallStartDate},</if>
+            <if test="exchangeRate != null">#{exchangeRate},</if>
         </trim>
     </insert>
 
@@ -936,6 +946,7 @@
                 competitor = #{competitor},
             </if>
             <if test="reasonType != null">reason_type = #{reasonType},</if>
+            <if test="exchangeRate != null">exchange_rate= #{exchangeRate},</if>
         </trim>
         where project_id = #{projectId}
     </update>
@@ -1084,7 +1095,7 @@
                    IF(p.owner_agent = 0, 'common.head', a.agent_name)  as ownerAgentName,
                    su2.dept_id,
                    total.deviceTotal,
-                   IF(ISNULL(tc.exchange_rate),total.priceTotal,(total.priceTotal / tc.exchange_rate ))as priceTotal,
+                   total.priceTotal,
                    a.discount_flag as discount_flag,
                    a.discount   as agent_discount_rate,
                    c.discount   as country_discount_rate,
@@ -1108,11 +1119,11 @@
                     END as lostDeviceTotal,
                     CASE p.progress
                     WHEN '100%' THEN
-                        IF(ISNULL(tc.exchange_rate),total.priceTotal,(total.priceTotal / tc.exchange_rate ))
+                            total.priceTotal
                     END as completePriceTotal,
                     CASE p.progress
                     WHEN '0% ' THEN
-                         IF(ISNULL(tc.exchange_rate),total.priceTotal,(total.priceTotal / tc.exchange_rate ))
+                            total.priceTotal
                     END as lostPriceTotal
             from tc_project p
                      left join tb_area tba on p.area_id = tba.area_id
@@ -1131,23 +1142,27 @@
                      left join (
                         select project_id,
                                SUM(IFNULL(equipment_quantity,0)) as deviceTotal,
-                               SUM(IFNULL(equipment_quantity,0) * IFNULL(amount,0)) as priceTotal
+                               SUM(IFNULL(equipment_quantity,0) * IFNULL(amount,0)  / IFNULL(exchange_rate,1)) as priceTotal
                         from(
                             SELECT
                                 main.project_id,
                                 main.quotation_no,
-                                ts.elevator_number AS equipment_quantity,
-                                case
+                                SUM(ts.elevator_number) AS equipment_quantity,
+                                SUM( case
                                 WHEN main.quotation_status &lt; 6 THEN	 0
                                 ELSE IFNULL( ts.final_price, ts.price )
-                                END AS amount
+                                END
+                                ) AS amount,
+                                main.exchange_rate
                             FROM
                             (
+                                select * from (
                                 SELECT DISTINCT
                                 quo.id,
                                 project.project_id,
                                 quo.quotation_no,
-                                quo.quotation_status
+                                quo.quotation_status,
+                                project.exchange_rate
                                 FROM
                                 tq_quotation quo
                                 LEFT JOIN tc_project project ON quo.project_id = project.project_id
@@ -1157,6 +1172,7 @@
                                 ORDER BY
                                 FIELD( quo.quotation_status, '9' ) DESC,
                                 id DESC
+                                ) temp group by quotation_no
                             ) main
                             LEFT JOIN tq_specification ts ON ts.quotation_id = main.id
                             AND ts.del_flag = '0'
@@ -1164,17 +1180,18 @@
                                 main.quotation_no
                             union
                             SELECT
-                                project_id,
-                                '' AS quotation_no,
-                                equipment_quantity,
-                                amount
+                            eq.project_id,
+                            '' AS quotation_no,
+                            eq.equipment_quantity,
+                            eq.amount,
+                            project.exchange_rate
                             FROM
-                            tc_project_equipment
-                            where  del_flag = '0'
+                            tc_project_equipment eq
+                            LEFT JOIN tc_project project ON eq.project_id = project.project_id
+                            where  eq.del_flag = '0'
                             ) main
                         GROUP BY main.project_id
                      ) total on total.project_id = p.project_id
-                     left join tb_currency as tc on p.currency_id = tc.currency_id and tc.del_flag = '0'
                      inner join (SELECT p.premession_char
                                  FROM (SELECT @premessionStr := #{permissionChar} p) param,
                                       getpremessionview_chars p) permission

+ 9 - 3
RuoYi-Vue-fast-master/src/main/resources/mybatis/business/contract/TqContractLiftHistoryMapper.xml

@@ -79,10 +79,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="version"    column="version"    />
         <result property="otherCost"    column="other_cost"    />
         <result property="liftAmount"    column="lift_amount"    />
+        <result property="collectionRatio"    column="collection_ratio"    />
     </resultMap>
 
     <sql id="selectTqContractLiftHistoryVo">
-        select id, contract_no, contract_name, area_id, country_id, city, salesman, end_customers, trade_terms, agent_id, payment_method, currency_id, amount_of_money, signing_date, del_flag, create_time, create_by, update_time, update_by, remark, permission_char, production_order_no, contract_no_version_no, sales_model, contract_amendment_date, product_category, elevator_model, specification, count, unit_price, quotation_discount, expected_production_schedule_date, hope_to_schedule_production_date, actual_production_schedule_date, production_schedule_date, reason_for_project_cancellation_and_sus, reason_for_delayed_overdue_shipment, reason_for_non_scheduling, hope_for_delivery_date, actual_delivery_date, port, production_order_status, review_discount, review_shipping_costs, review_commission, commission_payment_date, payout_date, receiving_bank, received_amount, payment_ratio, accounts_receivable_balance, plan_adjustment_date, actual_inland_freight_cost, actual_ocean_freight, invoice_date, customs_declaration_month, subsequent_collection_of_shipping_fees, collection_date, plan_inland_freight_cost, plan_ocean_freight, project_status, rate_4_production_scheduling, rate_4_shipment, rate_4_signing_contracts, elevator_code, origin, elevator_type, quotation_no_version, project_name, quoter, additional_cost, version,other_cost,lift_amount from tq_contract_lift_history
+        select id,collection_ratio, contract_no, contract_name, area_id, country_id, city, salesman, end_customers, trade_terms, agent_id, payment_method, currency_id, amount_of_money, signing_date, del_flag, create_time, create_by, update_time, update_by, remark, permission_char, production_order_no, contract_no_version_no, sales_model, contract_amendment_date, product_category, elevator_model, specification, count, unit_price, quotation_discount, expected_production_schedule_date, hope_to_schedule_production_date, actual_production_schedule_date, production_schedule_date, reason_for_project_cancellation_and_sus, reason_for_delayed_overdue_shipment, reason_for_non_scheduling, hope_for_delivery_date, actual_delivery_date, port, production_order_status, review_discount, review_shipping_costs, review_commission, commission_payment_date, payout_date, receiving_bank, received_amount, payment_ratio, accounts_receivable_balance, plan_adjustment_date, actual_inland_freight_cost, actual_ocean_freight, invoice_date, customs_declaration_month, subsequent_collection_of_shipping_fees, collection_date, plan_inland_freight_cost, plan_ocean_freight, project_status, rate_4_production_scheduling, rate_4_shipment, rate_4_signing_contracts, elevator_code, origin, elevator_type, quotation_no_version, project_name, quoter, additional_cost, version,other_cost,lift_amount from tq_contract_lift_history
     </sql>
 
     <select id="selectTqContractLiftHistoryList" parameterType="TqContractLiftHistory" resultMap="TqContractLiftHistoryResult">
@@ -154,6 +155,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="additionalCost != null "> and additional_cost = #{additionalCost}</if>
             <if test="version != null "> and version = #{version}</if>
             <if test="otherCost != null "> and l.other_cost = #{otherCost}</if>
+            <if test="collectionRatio != null "> and l.collection_ratio = #{collectionRatio}</if>
         </where>
     </select>
     
@@ -241,6 +243,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="version != null">version,</if>
             <if test="otherCost != null">other_cost,</if>
             <if test="liftAmount != null">lift_amount,</if>
+            <if test="collectionRatio != null">collection_ratio,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="contractNo != null">#{contractNo},</if>
@@ -316,6 +319,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="version != null">#{version},</if>
             <if test="otherCost != null">#{otherCost},</if>
             <if test="liftAmount != null">#{liftAmount},</if>
+            <if test="collectionRatio != null">#{collectionRatio},</if>
          </trim>
     </insert>
 
@@ -333,7 +337,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         actual_ocean_freight, invoice_date, customs_declaration_month, subsequent_collection_of_shipping_fees, collection_date,
         plan_inland_freight_cost, plan_ocean_freight, project_status, rate_4_production_scheduling,
         rate_4_shipment,  rate_4_signing_contracts,elevator_code,
-        origin,elevator_type,quotation_no_version,project_name,quoter,additional_cost,version,other_cost,lift_amount
+        origin,elevator_type,quotation_no_version,project_name,quoter,additional_cost,version,other_cost,lift_amount,
+        collection_ratio
         )
         values
         <foreach collection="list" item="item"  separator=",">
@@ -354,7 +359,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{item.rate4ProductionScheduling},#{item.rate4Shipment},
             #{item.rate4SigningContracts},#{item.elevatorCode},
             #{item.origin},#{item.elevatorType},#{item.quotationNoVersion},#{item.projectName},#{item.quoter},#{item.additionalCost},#{item.version},#{item.otherCost},
-            #{item.liftAmount}
+            #{item.liftAmount},#{item.collectionRatio}
             )
         </foreach>
     </insert>
@@ -435,6 +440,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="version != null">version = #{version},</if>
             <if test="otherCost != null">other_cost = #{otherCost},</if>
             <if test="liftAmount != null">lift_amount = #{liftAmount},</if>
+            <if test="collectionRatio != null">collection_ratio = #{collectionRatio},</if>
         </trim>
         where id = #{id}
     </update>

+ 17 - 4
RuoYi-Vue-fast-master/src/main/resources/mybatis/business/contract/TqContractLiftMapper.xml

@@ -79,6 +79,7 @@
         <result property="otherCost"    column="other_cost"    />
         <result property="liftAmount"    column="lift_amount"    />
         <result property="type"    column="type"    />
+        <result property="collectionRatio"    column="collection_ratio"    />
     </resultMap>
 
     <resultMap type="com.ruoyi.project.business.domain.vo.contract.TqContractLiftVo" id="TqContractLiftVoResult" extends="TqContractLiftResult">
@@ -238,7 +239,13 @@
                 </foreach>
             </if>
             <if test="port != null  and port != ''"> and l.port = #{port}</if>
-            <if test="productionOrderStatus != null  and productionOrderStatus != ''"> and l.production_order_status = #{productionOrderStatus}</if>
+
+            <if test="productionOrderStatus != null  and productionOrderStatus.size() > 0 ">
+             and l.production_order_status in
+                <foreach collection="productionOrderStatus"  item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
             <if test="reviewDiscount != null  and reviewDiscount != ''"> and l.review_discount = #{reviewDiscount}</if>
             <if test="reviewShippingCosts != null "> and l.review_shipping_costs = #{reviewShippingCosts}</if>
             <if test="reviewCommission != null "> and l.review_commission = #{reviewCommission}</if>
@@ -300,6 +307,8 @@
             <if test="otherCost != null "> and l.other_cost = #{otherCost}</if>
 
             <if test="endCustomersName != null "> and account.account_name like  concat('%', #{endCustomersName}, '%')</if>
+            <if test="collectionRatio != null "> and l.collection_ratio like  concat('%', #{collectionRatio}, '%')</if>
+
 
         </where>
         order by id desc
@@ -396,6 +405,7 @@
             <if test="otherCost != null">other_cost,</if>
 
             <if test="liftAmount != null">lift_amount,</if>
+            <if test="collectionRatio != null">collection_ratio,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="contractNo != null">#{contractNo},</if>
@@ -470,6 +480,7 @@
             <if test="additionalCost != null">#{additionalCost},</if>
             <if test="otherCost != null">#{otherCost},</if>
             <if test="liftAmount != null">#{liftAmount},</if>
+            <if test="collectionRatio != null">#{collectionRatio},</if>
         </trim>
     </insert>
 
@@ -487,7 +498,7 @@
         actual_ocean_freight, invoice_date, customs_declaration_month, subsequent_collection_of_shipping_fees, collection_date,
         plan_inland_freight_cost, plan_ocean_freight, project_status, rate_4_production_scheduling,
         rate_4_shipment,rate_4_signing_contracts, elevator_code,
-        origin,elevator_type,quotation_no_version,project_name,quoter,additional_cost,other_cost,lift_amount,type
+        origin,elevator_type,quotation_no_version,project_name,quoter,additional_cost,other_cost,lift_amount,type,collection_ratio
         )
         values
         <foreach collection="list" item="item"  separator=",">
@@ -508,7 +519,7 @@
             #{item.rate4ProductionScheduling},#{item.rate4Shipment},
             #{item.rate4SigningContracts},#{item.elevatorCode},
             #{item.origin},#{item.elevatorType},#{item.quotationNoVersion},#{item.projectName},#{item.quoter},#{item.additionalCost},#{item.otherCost},
-            #{item.liftAmount},#{item.type}
+            #{item.liftAmount},#{item.type},#{item.collectionRatio}
             )
         </foreach>
     </insert>
@@ -589,7 +600,8 @@
             additional_cost=#{item.additionalCost},
             other_cost=#{item.otherCost},
             lift_amount=#{item.liftAmount},
-            type = #{item.type}
+            type = #{item.type},
+            collection_ratio = #{item.collectionRatio}
             where id = #{item.id}
         </foreach>
     </insert>
@@ -671,6 +683,7 @@
             <if test="otherCost != null">other_cost = #{otherCost},</if>
             <if test="liftAmount != null">lift_amount = #{liftAmount},</if>
             <if test="type != null">type = #{type},</if>
+            <if test="collectionRatio != null">collection_ratio = #{collectionRatio},</if>
         </trim>
         where id = #{id}
     </update>

+ 1 - 1
ruoyi-ui-vue2/src/views/board/agentAddProject/index.vue

@@ -55,7 +55,7 @@
         <Column :label="$t('agentAddProject.priceWeek')"prop="priceWeek" align="right">
           <template #default="{ row }">
             <!--每三位一个逗号-->
-            <span>{{ row.priceWeek ? toDecimal2(numFormat(row.priceWeek)) : '-' }}</span>
+            <span>{{ row.priceWeek ? "RMB¥"+toDecimal2(numFormat(row.priceWeek)) : '-' }}</span>
           </template>
         </Column>
         <!--合计项目数量-->

+ 18 - 3
ruoyi-ui-vue2/src/views/board/agentProjectStatistics/index.vue

@@ -56,19 +56,34 @@
         <!--成单项目台数-->
         <Column :label="$t('agentProjectStatistics.completeProjectEquipmentQty')" prop="completeProjectEquipmentQty"  />
         <!--成单项目金额-->
-        <Column :label="$t('agentProjectStatistics.completeProjectPrice')" prop="completeProjectPrice" align="right"/>
+        <Column :label="$t('agentProjectStatistics.completeProjectPrice')" prop="completeProjectPrice" align="right">
+          <template #default="{ row }">
+            <!--每三位一个逗号-->
+            <span>{{ row.completeProjectPrice ? "RMB¥"+toDecimal2(numFormat(row.completeProjectPrice)) : '-' }}</span>
+          </template>
+        </Column>
         <!--丢单项目数量-->
         <Column :label="$t('agentProjectStatistics.lostProjectQty')" prop="lostProjectQty" />
         <!--丢单项目台数-->
         <Column :label="$t('agentProjectStatistics.lostProjectEquipmentQty')" prop="lostProjectEquipmentQty"  />
         <!--丢单项目金额-->
-        <Column :label="$t('agentProjectStatistics.lostProjectPrice')" prop="lostProjectPrice" align="right"/>
+        <Column :label="$t('agentProjectStatistics.lostProjectPrice')" prop="lostProjectPrice" align="right">
+          <template #default="{ row }">
+            <!--每三位一个逗号-->
+            <span>{{ row.lostProjectPrice ? "RMB¥"+toDecimal2(numFormat(row.lostProjectPrice)) : '-' }}</span>
+          </template>
+        </Column>
         <!--合计项目数量-->
         <Column :label="$t('agentProjectStatistics.sumProjectQty')" prop="sumProjectQty"  />
         <!--合计项目台数-->
         <Column :label="$t('agentProjectStatistics.sumProjectEquipmentQty')" prop="sumProjectEquipmentQty"  />
         <!--合计项目金额-->
-        <Column :label="$t('agentProjectStatistics.sumProjectPrice')" prop="sumProjectPrice" align="right" />
+        <Column :label="$t('agentProjectStatistics.sumProjectPrice')" prop="sumProjectPrice" align="right" >
+          <template #default="{ row }">
+            <!--每三位一个逗号-->
+            <span>{{ row.sumProjectPrice ? "RMB¥"+toDecimal2(numFormat(row.sumProjectPrice)) : '-' }}</span>
+          </template>
+        </Column>
         <!--成单率-->
         <Column :label="$t('agentProjectStatistics.completionRate') + '%'" prop="completionRate"  />
         <!--丢单率-->

+ 4 - 0
ruoyi-ui-vue2/src/views/contract/edit.vue

@@ -1823,4 +1823,8 @@ export default {
   line-height: 10px;
 }
 
+.el-table {
+  border-top: none;
+}
+
 </style>

+ 6 - 2
ruoyi-ui-vue2/src/views/contract/index.vue

@@ -39,6 +39,9 @@
         <Column :label="$t('contract.paymentMethod')" :searchParams="queryParams" :showSearch="true" prop="paymentMethod" searchType="select"  selectMore
                 :searchDict="dict.type.contract_payment_method"/>
 
+        <!--付款比例46-->
+        <Column :label="$t('contract.paymentRatio')" :searchParams="queryParams" :showSearch="true" prop="paymentRatio"
+                searchType="select" :searchDict="dict.type.contract_payment_ratio" />
         <!--销售模式-->
         <Column :label="$t('contract.salesModel')" :searchDict="dict.type.contract_sales_model" :showSearch="true" prop="salesModel" selectProp="origins"
                 searchType="select" selectMore :searchParams="queryParams"/>
@@ -98,7 +101,7 @@
         <Column :label="$t('common.operate')" :min-width="180" :showSearch="true" fixed="right" searchType="operate" :searchParams="queryParams">
               <template #default="{ row }">
                 <MoreBtn :handle-command="handleCommand" :row="row" :btns="[
-                  { label: $t('common.edit'), command: 'edit', icon: 'el-icon-edit', permi: 'contract:edit' ,showAble: hasPermission(row) && row.approveStatus !== '0' && row.approveStatus !== '2'},
+                  { label: $t('common.edit'), command: 'edit', icon: 'el-icon-edit', permi: 'contract:edit' ,showAble: hasPermission(row) && row.approveStatus === '1' && row.approveStatus === '3'},
                   { label: $t('contract.approve'), command: 'approve', icon: 'el-icon-edit', permi: 'contract:approve' ,showAble: hasPermissionApprove(row) && row.approveStatus === '0' && main.isAuditor(row.flow) },
                   { label: $t('contract.amendment'), command: 'amendment', icon: 'el-icon-refresh', permi: 'contract:amendment',showAble:row.typeAuthority !== 'toVoid' && hasPermission(row) && row.approveStatus === '2'},
                   // { label: $t('contract.delete'), command: 'delete', icon: 'el-icon-delete', permi: 'contract:delete', showAble:hasPermission(row) && row.approveStatus === '0' },
@@ -207,7 +210,7 @@ export default {
   name: "Contract",
   inject: ["main"],
   components: {TextBox, ColorDictTag, CardTable, DialogPage, MoreBtn, Column},
-  dicts: [ 'currency_type','contract_payment_method','audit_status','agent_type', 'agent_level', 'contract_approval_status','contract_sales_model','contract_trade_terms'],
+  dicts: [ 'contract_payment_ratio','currency_type','contract_payment_method','audit_status','agent_type', 'agent_level', 'contract_approval_status','contract_sales_model','contract_trade_terms'],
   computed: {
     tcAgentHistory() {
       return tcAgentHistory
@@ -379,6 +382,7 @@ export default {
     },
     /** 重置按钮操作 todo:待补充*/
     resetQuery() {
+      this.$set(this.queryParams, 'paymentRatio', null)
       this.$set(this.queryParams, 'contractNo', null)
       this.$set(this.queryParams, 'contractName', null)
       this.$set(this.queryParams, 'salesman', null)

+ 25 - 4
ruoyi-ui-vue2/src/views/contract/lift/index.vue

@@ -181,6 +181,10 @@
         <!--收款比例46-->
         <Column :label="$t('contract.paymentRatio')" :searchParams="queryParams" :showSearch="true" prop="paymentRatio"
                 searchType="select" :searchDict="dict.type.contract_payment_ratio" v-if="checkPermi(['user:contract:lift:paymentRatio'])"/>
+
+        <!--收款比例46-->
+        <Column label="收款比例" :searchParams="queryParams" :showSearch="true" prop="collectionRatio"  v-if="checkPermi(['user:contract:lift:collectionRatio'])"/>
+
         <!--应收余额47-->
         <Column :label="$t('lift.accountsReceivableBalance')" :searchParams="queryParams" prop="accountsReceivableBalance" v-if="checkPermi(['user:contract:lift:accountsReceivableBalance'])">
           <template #default="{ row }">
@@ -214,16 +218,24 @@
           </template>
         </Column>
 
-        <!--附加费用52-->
+        <!--其他费用52-->
+        <Column :label="$t('lift.otherFees')" :searchParams="queryParams"  prop="otherCost"  v-if="checkPermi(['user:contract:lift:otherCost'])">
+          <template #default="{ row }">
+            <span>{{ row.unit + toDecimal2(numFormat(row.otherCost)) }}</span>
+          </template>
+        </Column>
+
+        <!--附加费用53-->
         <Column :label="$t('lift.additionalCost')" :searchParams="queryParams" prop="additionalCost"  v-if="checkPermi(['user:contract:lift:additionalCost'])">
           <template #default="{ row }">
             <span>{{ row.unit + toDecimal2(numFormat(row.additionalCost)) }}</span>
           </template>
         </Column>
-        <!--其他费用53-->
-        <Column :label="$t('lift.otherFees')" :searchParams="queryParams"  prop="otherCost"  v-if="checkPermi(['user:contract:lift:otherCost'])">
+
+        <!--总价  权限-->
+        <Column label="总价" :searchParams="queryParams" prop="liftAmount"  >
           <template #default="{ row }">
-            <span>{{ row.unit + toDecimal2(numFormat(row.otherCost)) }}</span>
+            <span>{{ row.unit + toDecimal2(numFormat(row.liftAmount)) }}</span>
           </template>
         </Column>
 
@@ -428,6 +440,7 @@
           <!--收款比例46  可修改-->
           <Column  :label="$t('contract.paymentRatio')"  prop="paymentRatio" searchType="select" :searchDict="dict.type.contract_payment_ratio"  v-if="checkPermi(['user:contract:lift:paymentRatioEdit'])"/>
 
+          <Column label="收款比例" prop="collectionRatio"  v-if="checkPermi(['user:contract:lift:collectionRatio'])"/>
           <!--应收余额47 可修改-->
           <Column  :label="$t('lift.accountsReceivableBalance')"  prop="accountsReceivableBalance" v-if="checkPermi(['user:contract:lift:accountsReceivableBalanceEdit'])">
             <template v-slot="scope">
@@ -474,6 +487,12 @@
             </template>
           </Column>
 
+          <!--总价  权限-->
+          <Column label="总价"  prop="liftAmount"  >
+            <template #default="{ row }">
+              <span>{{ toDecimal2(numFormat(row.liftAmount)) }}</span>
+            </template>
+          </Column>
 
           <!--计划调整日期54 可修改-->
           <DatePickSelectColumn  :label="$t('lift.planAdjustmentDate')"  prop="planAdjustmentDate" v-if="checkPermi(['user:contract:lift:planAdjustmentDateEdit'])" width="250" sortable="custom"></DatePickSelectColumn>
@@ -867,6 +886,8 @@ export default {
 
     /** 重置按钮操作 todo:待补充*/
     resetQuery() {
+      collectionRatio
+      this.$set(this.queryParams, 'collectionRatio', null)
       this.$set(this.queryParams, 'contractNo', null)
       this.$set(this.queryParams, 'contractCustomer', null)
       this.$set(this.queryParams, 'versionNo', null)

+ 10 - 6
ruoyi-ui-vue2/src/views/crmManagement/follow/follow.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="app-container">
     <card-table :modalData="followList"  labelWidth="120px" :searchParams="queryParams" @pagination="getList" @selection-change="handleSelectionChange" :loading="loading"
-                :tableSearch="true" @columnSearch="handleQuery" @resetList="resetQuery" @sortChange="sortChange" show-no show-selection
+                :tableSearch="true" @columnSearch="handleQuery" @resetList="resetQuery" @sortChange="sortChange" show-no show-selection :children="children" :row-key="rowKey"
     >
       <template #operations="{ selections }">
         <el-row :gutter="10" class="mb8">
@@ -37,6 +37,13 @@
             <span @click="handleView(row)" class="link-type">{{ row.followNo }}</span>
           </template>
         </Column> -->
+
+        <Column :label="$t('follow.followRelated')" align="center" prop="businessNo" :min-width="200" :searchParams="queryParams" :showSearch="true" searchType="input" sortable="custom">
+          <template #default="{ row }">
+            <span class="link-type" @click="handleDetailView(row)">{{ row.businessNo }}</span>
+          </template>
+        </Column>
+
         <Column :label="$t('follow.followTime')" align="center" prop="followTimeFormat" :min-width="300"  :searchParams="queryParams" :showSearch="true" searchType="dateRange" sortable="custom">
           <template #default="{ row }">
             <span>{{ row.followTimeFormat}}</span>
@@ -48,11 +55,6 @@
             <span>{{ formatDict(row.followType,'crm_follow_type') }}</span>
           </template>
         </Column>
-        <Column :label="$t('follow.followRelated')" align="center" prop="businessNo" :min-width="200" :searchParams="queryParams" :showSearch="true" searchType="input" sortable="custom">
-          <template #default="{ row }">
-            <span class="link-type" @click="handleDetailView(row)">{{ row.businessNo }}</span>
-          </template>
-        </Column>
         <Column :label="$t('follow.follower')" prop="follower" :min-width="150" show-overflow-tooltip :showSearch="true" :searchParams="queryParams"/>
         <!--<Column :label="$t('follow.country')" prop="countryName" :min-width="150" show-overflow-tooltip :searchParams="queryParams"/>-->
         <!--国家-->
@@ -198,6 +200,8 @@ import { listFollow, deleteFollow, exportFollow, getCountryList } from '@/api/bu
         },
 
         curCountryOps: [],
+        rowKey: "followId",
+        children: "children",
       };
     },
     created() {