Browse Source

[首页统计][修改][添加首页统计项]

release_toaliyun_real
luozukai 7 years ago
parent
commit
56ab9c9a61
8 changed files with 91 additions and 12 deletions
  1. +10
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/WxChartDataController.java
  2. +1
    -0
      mallinkService/src/main/java/com/iformall/enums/EnumChart.java
  3. +6
    -3
      mallinkService/src/main/java/com/iformall/mapper/WxMsgConfigMapper.java
  4. +48
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java
  5. +0
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java
  6. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxMsgCallbackServiceImpl.java
  7. +22
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeServiceImpl.java
  8. +3
    -1
      mallinkService/src/main/resources/mapper/WxMsgConfigMapper.xml

+ 10
- 1
mallinkAdmin/src/main/java/com/iformall/controller/WxChartDataController.java View File

@@ -27,7 +27,16 @@ public class WxChartDataController extends BaseController {
@Autowired
private WxChartDataService wxChartDataService;

@ApiOperation("queryData")
@ApiOperation("chart=53首页数据:" +
"todayNewUserCount今日新增会员 weekNewUserCount近一周新增会员," +
"todayActiveUserCount今日活跃会员 weekActiveUserCount近一周活跃会员," +
"userTotalCount会员总数,growUserCount自然增长 importUserCount导入," +
"rentRate出租率 rentCount已租 notRentCount未出租," +
"notSignContract待签约合同个数 signContract已签约合同," +
"onlineActivity上架营销活动 todayReceive今日领取," +
"todayUserCount今日客流 growRate较昨日上涨," +
"todayCarCount今日车流 downRate较昨日下跌 carParkStatus车场状态," +
"msgLeave短信剩余 msgHasUse短信已使用")
@GetMapping("/queryData")
@ApiImplicitParams({
@ApiImplicitParam(name = "chart", value = "chart", dataType = "String", paramType = "query", required = true),


+ 1
- 0
mallinkService/src/main/java/com/iformall/enums/EnumChart.java View File

@@ -60,6 +60,7 @@ public enum EnumChart {
INDEX_BILL_RECE_RATE(50, "费用收缴数据"),
INDEX_COUPON_SCENE(51, "场景发券"),
INDEX_SALE_DATA(52, "营销数据"),
INDEX_DATA(53, "首页数据"),
;

public static EnumChart getEnum(Integer code) {


+ 6
- 3
mallinkService/src/main/java/com/iformall/mapper/WxMsgConfigMapper.java View File

@@ -7,10 +7,13 @@ import com.iformall.domain.po.WxMsgConfig;
public interface WxMsgConfigMapper extends CommonMapper<WxMsgConfig, String> {

List<WxMsgConfig> findList(WxMsgConfig wxMsgConfig);


/**
* 减剩余条数
* @param wxMsgConfig
*/
void updateRemains(WxMsgConfig wxMsgConfig);
}

+ 48
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java View File

@@ -303,6 +303,10 @@ public class WxChartServiceImpl implements WxChartDataService {
return getSaleDataHistory(tenantId, startdate, enddate);
}

//首页营销数据
if (chart.equals(EnumChart.INDEX_DATA.getCode())) {
return getIndexData(tenantId, startdate, enddate);
}


return new ResultData(ErrorCode.REPORT_TYPE_UNKNOWN);
@@ -2477,4 +2481,48 @@ public class WxChartServiceImpl implements WxChartDataService {

return new ResultData(datamap);
}

/**
* 首页数据
* @param tenantId
* @return
*/
private ResultData getIndexData(String tenantId, String startdate,String enddate) {
Date startDate = DateUtils.getDateFromString(startdate,"yyyy-MM-dd HH:mm:ss").getTime();
Date endDate = DateUtils.getDateFromString(enddate,"yyyy-MM-dd HH:mm:ss").getTime();

HashMap<String, Object> datamap = new HashMap<>();

datamap.put("todayNewUserCount",0);
datamap.put("weekNewUserCount",0);

datamap.put("todayActiveUserCount",0);
datamap.put("weekActiveUserCount",0);

datamap.put("userTotalCount",0);
datamap.put("growUserCount",0);
datamap.put("importUserCount",0);

datamap.put("rentRate","10%");
datamap.put("rentCount",0);
datamap.put("notRentCount",0);

datamap.put("notSignContract",0);
datamap.put("signContract",0);

datamap.put("onlineActivity",0);
datamap.put("todayReceive",0);

datamap.put("todayUserCount",0);
datamap.put("growRate","10%");

datamap.put("todayCarCount",0);
datamap.put("downRate","10%");
datamap.put("carParkStatus","正常");

datamap.put("msgLeave",0);
datamap.put("msgHasUse",123);

return new ResultData(datamap);
}
}

+ 0
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java View File

@@ -863,8 +863,6 @@ public class WxFlowServiceImpl implements WxFlowService {

//给发起人发送驳回消息
Map<String,String> msgReplaceMap = new HashedMap();
WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode();
wxMsgValidationcode.setTenantId(tenantId);
msgReplaceMap.put("contract",(String)getVariableByKey(variables,"contractNumber"));
msgReplaceMap.put("page",Constant.adminPage);
WxMsgRecord wxMsgRecord = new WxMsgRecord();


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxMsgCallbackServiceImpl.java View File

@@ -75,7 +75,7 @@ public class WxMsgCallbackServiceImpl implements WxMsgCallbackService {
List<WxMsgCallback> wxMsgCallbacks = JSONArray.parseArray(param.get("item"), WxMsgCallback.class);
wxMsgConfig = list.get(0);
wxMsgConfig.setRemains(wxMsgConfig.getRemains() - wxMsgCallbacks.size());
wxMsgConfigMapper.updateByPrimaryKeySelective(wxMsgConfig);
//wxMsgConfigMapper.updateByPrimaryKeySelective(wxMsgConfig);
final IdWorker idWorker = IdWorker.get();
for (WxMsgCallback wxMsgCallback : wxMsgCallbacks) {
WxMsgCallback callback=wxMsgCallbackMapper.queryCallbackByBatchNoAndPhone(wxMsgCallback);


+ 22
- 4
mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeServiceImpl.java View File

@@ -8,12 +8,13 @@ import com.iformall.common.IdWorker;
import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.domain.po.*;
import com.iformall.enums.EnumMsgModel;
import com.iformall.enums.EnumMsgSendStatus;
import com.iformall.enums.EnumVerifyCode;
import com.iformall.domain.po.msg.WxMsgRecord;
import com.iformall.enums.*;
import com.iformall.mapper.*;
import com.iformall.mq.MqBaseProducer;
import com.iformall.service.WxMsgValidationcodeService;
import com.iformall.utils.*;
import org.apache.commons.collections.map.HashedMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -48,6 +49,9 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic
@Autowired
WxMsgCallbackMapper wxMsgCallbackMapper;

@Autowired
MqBaseProducer mqBaseProducer;

@Override
public PageInfo<WxMsgValidationcode> listAsPage(WxMsgValidationcode record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMsgValidationcodeMapper.findList(record));
@@ -107,7 +111,6 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic
wxMsgValidationcodeModel = wxMsgValidationcodeModelMapper.findList(wxMsgValidationcodeModel).get(0);
wxMsgValidationcode.setSignature(wxMsgValidationcodeModel.getSignature());


String secret = wxMsgConfig.getSecret();
String bid = wxMsgConfig.getBid();
String publickey = wxMsgConfig.getPublickey();
@@ -121,6 +124,21 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic
wxMsgValidationcode.setMsg(msg);
String notifyUrl = wxMsgConfig.getNotifyurl();
Integer modelId = wxMsgValidationcodeModel.getModelId();


//给发起人发送驳回消息
// Map<String,String> msgReplaceMap = new HashedMap();
// msgReplaceMap.put("contract",(String)getVariableByKey(variables,"contractNumber"));
// msgReplaceMap.put("page",Constant.adminPage);
// WxMsgRecord wxMsgRecord = new WxMsgRecord();
// wxMsgRecord.setMsgType(EnumMsgRecordType.SMS.getCode());
// wxMsgRecord.setModelType(EnumMsgModel.VALIDATION_CODE.getCode());
// wxMsgRecord.setReceiver(wxMsgValidationcode.getPhone());
// wxMsgRecord.setTenantId(wxMsgConfig.getTenantId());
// wxMsgRecord.setDynamicContentMap(msgReplaceMap);
// mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode());


String result = WiwideUtil.sendMsg(secret, bid, publickey, phone, signature, msg, notifyUrl, EnumVerifyCode.YES.getCode().toString(), modelId);
JSONObject jsonObjectResult = JSONObject.parseObject(result);
String ret = jsonObjectResult.get("ret").toString();


+ 3
- 1
mallinkService/src/main/resources/mapper/WxMsgConfigMapper.xml View File

@@ -113,7 +113,9 @@
<include refid="dynamicWhereConditions" />
</select>
<update id="updateRemains" parameterType="com.iformall.domain.po.WxMsgConfig">
update wx_msg_config set remains = if(remains - #{remains} &lt; 0,0,remains - #{remains}) where `tenant_id` = #{tenantId}
</update>


Loading…
Cancel
Save