Commit 46662f37 by 墨竹

feat:统计修改

parent fc471a56
package com.gic.haoban.manage.service.util;
package com.gic.haoban.manage.api.util;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
......@@ -7,6 +7,7 @@ import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.ctrip.framework.apollo.Config;
import com.ctrip.framework.apollo.ConfigService;
import com.gic.haoban.manage.api.constants.StatisticsApolloKeyConstant;
import com.gic.haoban.manage.api.dto.statistics.StatisticsDTO;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
......
......@@ -3,7 +3,7 @@ package com.gic.haoban.manage.service.service.out.impl;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.statistics.StatisticsDTO;
import com.gic.haoban.manage.api.service.statistics.DataStatisticsApiService;
import com.gic.haoban.manage.service.util.DataHttpUtil;
import com.gic.haoban.manage.api.util.DataHttpUtil;
import org.springframework.stereotype.Service;
/**
......
......@@ -11,16 +11,9 @@
http://www.springframework.org/schema/tx/spring-tx.xsd">
<context:annotation-config />
<!--<context:component-scan base-package="com.gic.cloud" />-->
<!--<context:property-placeholder location="classpath*:jdbc-haoban.properties" ignore-unresolvable="true" />-->
<!--<bean id="propertyConfigurer"-->
<!--class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">-->
<!--<property name="ignoreUnresolvablePlaceholders" value="true"/>-->
<!--<property name="location" value="classpath:jdbc-haoban.properties" />-->
<!--</bean>-->
<import resource="classpath*:applicationContext-db-only.xml"/>
<!--<import resource="classpath*:applicationContext-db-only-with-emoji.xml"/>-->
<bean class="com.gic.haoban.common.init.HaobanSqlSessionFactoryBean" id="sqlSessionFactory">
<property name="dataSource" ref="dataSource" />
<property name="typeAliasesPackage" value="com.gic.haoban.**.entity,com.gic.haoban.*.entity" />
......
......@@ -2,16 +2,21 @@ package com.gic.haoban.manage.web.controller.hm;
import cn.hutool.core.convert.Convert;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.common.utils.AuthWebRequestUtil;
import com.gic.haoban.manage.api.constants.StatisticsApolloKeyConstant;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeListDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.api.dto.statistics.StatisticsDTO;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
import com.gic.haoban.manage.api.util.DataHttpUtil;
import com.gic.haoban.manage.web.dto.HmOverviewDTO;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -20,7 +25,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 活码(TabHaobanHmQrcode)表控制层
......@@ -111,5 +118,29 @@ public class HmQrcodeController {
this.hmQrcodeApiService.delById(hmId);
return RestResponse.successResult();
}
/**
* 数据统计
* @param hmId
* @param type
* @return
*/
@RequestMapping(value = "detail-data-statistics", method = RequestMethod.DELETE)
public RestResponse detailDataStatistics(Long hmId,Integer type) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
Map<String,Object> map = new HashMap<>();
map.put("hmId",hmId);
map.put("enterpriseId",loginUser.getEnterpriseId());
StatisticsDTO statisticsDTO = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_overview, map);
HmOverviewDTO hmOverviewDTO = JSON.parseObject(JSON.toJSONString(statisticsDTO.getOne()),HmOverviewDTO.class);
if (type == 1) {
//天
} else if (type == 2) {
//月
}
return RestResponse.successResult();
}
}
package com.gic.haoban.manage.web.dto;
import java.io.Serializable;
public class HmOverviewDTO implements Serializable {
private static final long serialVersionUID = 5759533702716003239L;
private Long hmId;
private String enterpriseId;
private Integer addNumT;
private Integer addNum;
public Long getHmId() {
return hmId;
}
public void setHmId(Long hmId) {
this.hmId = hmId;
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public Integer getAddNumT() {
return addNumT;
}
public void setAddNumT(Integer addNumT) {
this.addNumT = addNumT;
}
public Integer getAddNum() {
return addNum;
}
public void setAddNum(Integer addNum) {
this.addNum = addNum;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment