Browse Source

销售线索文件上传

yangzian 3 years ago
parent
commit
6e663dce81

+ 4 - 4
ruixuan-salesLeads/src/main/java/com.ruixuan.salesLeads/listener/ImportExcelListener.java

@@ -81,13 +81,13 @@ public class ImportExcelListener extends AnalysisEventListener<Map<Integer, Stri
                     ObjectMap.put("NearlyThirtyDays",vlue);
                     ObjectMap.put("NearlyThirtyDays",vlue);
                 }
                 }
 
 
-                if ((keyStr).contains("gmv")){
-                    ObjectMap.put("gmvMonth",keyStr.substring(0,keyStr.indexOf("gmv")));
+                if ((keyStr).contains("gmv") || (keyStr).contains("GMV")){
+                    ObjectMap.put("gmvMonth",keyStr.substring(0,keyStr.length()-3));
                     ObjectMap.put("gmv",vlue);
                     ObjectMap.put("gmv",vlue);
                 }
                 }
 
 
-                if (keyStr.contains("mtd")){
-                    ObjectMap.put("mtdDate",keyStr.substring(0,keyStr.indexOf("mtd")));
+                if (keyStr.contains("mtd") || keyStr.contains("MTD")){
+                    ObjectMap.put("mtdDate",keyStr.substring(0,keyStr.length()-3));
                     ObjectMap.put("mtd",vlue);
                     ObjectMap.put("mtd",vlue);
                 }
                 }
 
 

+ 7 - 0
ruixuan-salesLeads/src/main/java/com.ruixuan.salesLeads/mapper/SaleQuotaInfoMapper.java

@@ -22,4 +22,11 @@ public interface SaleQuotaInfoMapper {
      * @param saleQuotaList
      * @param saleQuotaList
      */
      */
     void replaceSaleQuotaInfoBatch(@Param(value = "saleQuotaList") List<SaleQuotaInfoPojo> saleQuotaList);
     void replaceSaleQuotaInfoBatch(@Param(value = "saleQuotaList") List<SaleQuotaInfoPojo> saleQuotaList);
+
+    /**
+     * 根据卖家id查看最新额度
+     * @param sellerId
+     * @return
+     */
+    SaleQuotaInfoPojo getSaleQuotaInfoBySellerId(@Param(value = "sellerId")Long sellerId);
 }
 }

+ 14 - 0
ruixuan-salesLeads/src/main/java/com.ruixuan.salesLeads/pojo/SaleClueInfoPojo.java

@@ -101,6 +101,20 @@ public class SaleClueInfoPojo {
     private SaleClueRecordInfoPojo recordTask;
     private SaleClueRecordInfoPojo recordTask;
 
 
 
 
+    @ApiModelProperty("'近30天'")
+    private String nearlyThirtyDays;
+
+    @ApiModelProperty("gmv月份")
+    private Long gmvMonth;
+
+    @ApiModelProperty("gmv")
+    private String gmv;
+
+    @ApiModelProperty("mtd日期")
+    private Long mtdDate;
+
+    @ApiModelProperty("mtd")
+    private String mtd;
 
 
 
 
 
 

+ 12 - 0
ruixuan-salesLeads/src/main/java/com.ruixuan.salesLeads/service/impl/SaleClueInfoServiceImpl.java

@@ -227,6 +227,18 @@ public class SaleClueInfoServiceImpl implements ISaleClueInfoService {
         saleList.forEach(clue ->{
         saleList.forEach(clue ->{
             clue.setFirstRecord(saleClueRecordInfoMapper.getSaleClueRecordNumber(clue.getSellerId(),1));
             clue.setFirstRecord(saleClueRecordInfoMapper.getSaleClueRecordNumber(clue.getSellerId(),1));
             clue.setSecondRecord(saleClueRecordInfoMapper.getSaleClueRecordNumber(clue.getSellerId(),2));
             clue.setSecondRecord(saleClueRecordInfoMapper.getSaleClueRecordNumber(clue.getSellerId(),2));
+
+            //近30天 gmv mtd
+            SaleQuotaInfoPojo quotaInfoPojo = saleQuotaInfoMapper.getSaleQuotaInfoBySellerId(clue.getSellerId());
+            if (StringUtils.isNotNull(quotaInfoPojo)){
+                clue.setNearlyThirtyDays(quotaInfoPojo.getNearlyThirtyDays());
+                clue.setGmvMonth(quotaInfoPojo.getGmvMonth());
+                clue.setGmv(quotaInfoPojo.getGmv());
+                clue.setMtdDate(quotaInfoPojo.getMtdDate());
+                clue.setMtd(quotaInfoPojo.getMtd());
+            }
+
+
         });
         });
         return ResultResponse.successMsg("查询成功。",new TableDataInfo(saleList,new Long(new PageInfo(saleList).getTotal()).intValue()));
         return ResultResponse.successMsg("查询成功。",new TableDataInfo(saleList,new Long(new PageInfo(saleList).getTotal()).intValue()));
     }
     }

+ 4 - 4
ruixuan-salesLeads/src/main/java/com.ruixuan.salesLeads/utils/CsvImportUtil.java

@@ -107,13 +107,13 @@ public class CsvImportUtil {
                         objectMap.put("NearlyThirtyDays",vlue);
                         objectMap.put("NearlyThirtyDays",vlue);
                     }
                     }
 
 
-                    if ((keyStr).contains("gmv")){
-                        objectMap.put("gmvMonth",keyStr.substring(0,keyStr.indexOf("gmv")));
+                    if ((keyStr).contains("gmv") || keyStr.contains("GMV")){
+                        objectMap.put("gmvMonth",keyStr.substring(0,keyStr.length()-3));
                         objectMap.put("gmv",vlue);
                         objectMap.put("gmv",vlue);
                     }
                     }
 
 
-                    if (keyStr.contains("mtd")){
-                        objectMap.put("mtdDate",keyStr.substring(0,keyStr.indexOf("mtd")));
+                    if (keyStr.contains("mtd") || keyStr.contains("MTD")){
+                        objectMap.put("mtdDate",keyStr.substring(0,keyStr.length()-3));
                         objectMap.put("mtd",vlue);
                         objectMap.put("mtd",vlue);
                     }
                     }
                 }
                 }

+ 20 - 0
ruixuan-salesLeads/src/main/resources/mapper/salesLeads/SaleQuotaInfoMapper.xml

@@ -36,5 +36,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</insert>
 	</insert>
 
 
 
 
+	<!-- 根据卖家id查看最新额度 -->
+	<select id="getSaleQuotaInfoBySellerId" resultType="com.ruixuan.salesLeads.pojo.SaleQuotaInfoPojo">
+		SELECT
+			q.id,
+			q.nearly_thirty_days,
+			q.gmv_month,
+			q.gmv,
+			q.mtd_date,
+			q.mtd,
+			q.create_time
+		FROM
+			sale_quota_info q
+		WHERE
+			q.seller_id = #{sellerId}
+		ORDER BY
+			q.create_time DESC
+			LIMIT 1
+	</select>
+
+
 
 
 </mapper> 
 </mapper>