|
|
|
@@ -15,7 +15,9 @@ import com.iformall.service.MarkingDataReportService; |
|
|
|
import com.iformall.service.WxChartDataService; |
|
|
|
import com.iformall.service.WxCouponService; |
|
|
|
import com.iformall.utils.DateUtils; |
|
|
|
import org.apache.commons.collections.CollectionUtils; |
|
|
|
import org.apache.commons.collections.map.HashedMap; |
|
|
|
import org.apache.commons.collections.map.LinkedMap; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
@@ -321,16 +323,29 @@ public class WxChartServiceImpl implements WxChartDataService { |
|
|
|
private ResultData getRentRateHistory(String tenantId,Map<String, String> paramsMap) { |
|
|
|
Integer dateType = Integer.parseInt(paramsMap.get("dateType")); |
|
|
|
|
|
|
|
Map<String, Object> datamap = new LinkedHashMap<>(); |
|
|
|
datamap.put("2018/10","10%"); |
|
|
|
datamap.put("2018/11","20%"); |
|
|
|
datamap.put("2018/12","10%"); |
|
|
|
datamap.put("2019/01","10%"); |
|
|
|
datamap.put("2019/02","30%"); |
|
|
|
datamap.put("2019/03","40%"); |
|
|
|
datamap.put("2019/04","10%"); |
|
|
|
datamap.put("2019/05","20%"); |
|
|
|
return new ResultData(datamap); |
|
|
|
Map<String, Object> queryMap = new HashMap<>(); |
|
|
|
queryMap.put("tenantId",tenantId); |
|
|
|
queryMap.put("dateType",dateType); |
|
|
|
List<Map<String,Object>> mapList = wxShopMapper.rentRateHistory(queryMap); |
|
|
|
if(CollectionUtils.isNotEmpty(mapList)){ |
|
|
|
String startTime = (String)mapList.get(0).get("xTime"); |
|
|
|
String endTime = (String)mapList.get(mapList.size()-1).get("xTime"); |
|
|
|
List<String> days = DateUtils.getTjTimeList(startTime, endTime, 1==dateType.intValue()?"0":"1"); |
|
|
|
Map<String,String> map = getMap(days); |
|
|
|
for (Map<String,Object> m : mapList) { |
|
|
|
map.put((String)m.get("xTime"),m.get("rate")+"%"); |
|
|
|
} |
|
|
|
return new ResultData(map); |
|
|
|
} |
|
|
|
return new ResultData(new LinkedHashMap<>()); |
|
|
|
} |
|
|
|
|
|
|
|
public Map<String,String> getMap(List<String> days){ |
|
|
|
Map<String,String> map = new LinkedMap(); |
|
|
|
for (String d:days) { |
|
|
|
map.put(d.replace("-", "/"),"0%"); |
|
|
|
} |
|
|
|
return map; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|