|
|
|
@@ -5,10 +5,7 @@ import com.iformall.domain.po.WxChartDataEntity; |
|
|
|
import com.iformall.domain.po.WxMall; |
|
|
|
import com.iformall.enums.EnumCarCmd; |
|
|
|
import com.iformall.enums.EnumChartType; |
|
|
|
import com.iformall.mapper.WxCUserCarMapper; |
|
|
|
import com.iformall.mapper.WxCarCmdLogMapper; |
|
|
|
import com.iformall.mapper.WxChartDataMapper; |
|
|
|
import com.iformall.mapper.WxMallMapper; |
|
|
|
import com.iformall.mapper.*; |
|
|
|
import com.iformall.utils.DateUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
@@ -42,19 +39,22 @@ public class ChartDataSchedule { |
|
|
|
@Autowired |
|
|
|
WxChartDataMapper wxChartDataMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxCouponOrderMapper wxCouponOrderMapper; |
|
|
|
|
|
|
|
/** |
|
|
|
* 车相关数据 每天9点执行 |
|
|
|
* 每天1点执行 |
|
|
|
*/ |
|
|
|
@Scheduled(cron = "0 0 1 * * ?") |
|
|
|
|
|
|
|
public void createCarData() { |
|
|
|
createCarPayFeeCountData(); |
|
|
|
public void createData() { |
|
|
|
createCarData(); |
|
|
|
createSaleData(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 出场车辆、缴费车辆、缴费金额、新增会员、新增停车会员、已绑车辆 |
|
|
|
*/ |
|
|
|
public void createCarPayFeeCountData() { |
|
|
|
public void createCarData() { |
|
|
|
HashMap<String, Object> params = new HashMap<>(); |
|
|
|
params.put("cmdType", EnumCarCmd.CAR_ETCP_CALLBACK_PARK_OUT.getCode()); |
|
|
|
Date createtime = new Date(); |
|
|
|
@@ -79,6 +79,31 @@ public class ChartDataSchedule { |
|
|
|
carNewMemberData(createtime, date, tenantId); |
|
|
|
logger.info("已绑车辆>>>>>>>>>>>>>>>>>>>>>>>>>>"); |
|
|
|
carBindData(params, createtime, date, tenantId); |
|
|
|
logger.info("销售数据-金额>>>>>>>>>>>>>>>>>>>>>>>"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 销售总交易额 |
|
|
|
*/ |
|
|
|
public void createSaleData() { |
|
|
|
HashMap<String, Object> params = new HashMap<>(); |
|
|
|
Date createtime = new Date(); |
|
|
|
String yesterday = DateUtils.getTimeBefore(1, createtime); |
|
|
|
String today = DateUtils.getSystemTime("yyyy-MM-dd"); |
|
|
|
|
|
|
|
Date startdate = DateUtils.stringToDate(yesterday); |
|
|
|
Date enddate = DateUtils.stringToDate(today); |
|
|
|
|
|
|
|
List<WxMall> wxMalls = wxMallMapper.findList(null); |
|
|
|
for (WxMall wxMall : wxMalls) { |
|
|
|
String tenantId = wxMall.getTenantId(); |
|
|
|
params.put("tenantId", tenantId); |
|
|
|
logger.info("销售总交易额>>>>>>>>>>>>>>>>>>>>>>>>>>"); |
|
|
|
Integer price = wxCouponOrderMapper.queryPriceTotal(tenantId, startdate, enddate); |
|
|
|
addChartData(tenantId, price.toString(), EnumChartType.SALE_COUPON_PRICE.getCode(), enddate, createtime); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|