Browse Source

代码修改

LAPTOP-KB9HII50\70708 2 years ago
parent
commit
5fc38bae7c

+ 3 - 3
svr/svr-quota/src/main/java/com/yihu/jw/quota/controller/JobController.java

@ -34,7 +34,7 @@ public class JobController extends BaseController {
    @Transactional
    public boolean firstExecuteQuota(
            @ApiParam(name = "id", value = "指标ID", required = true)
            @RequestParam(value = "id", required = true) Integer id) {
            @RequestParam(value = "id", required = true) Long id) {
        try {
            jobService.executeJob(id, "1", null, null);
            return true;
@ -52,7 +52,7 @@ public class JobController extends BaseController {
    @RequestMapping(value = ServiceApi.TJ.TjQuotaExecute, method = RequestMethod.POST)
    public boolean executeQuota(
            @ApiParam(name = "id", value = "指标ID", required = true)
            @RequestParam(value = "id", required = true) Integer id,
            @RequestParam(value = "id", required = true) Long id,
            @ApiParam(name = "startDate", value = "起始日期")
            @RequestParam(value = "startDate", required = false) String startDate,
            @ApiParam(name = "endDate", value = "截止日期")
@ -71,7 +71,7 @@ public class JobController extends BaseController {
    @RequestMapping(value = ServiceApi.TJ.TjQuotaRemove, method = RequestMethod.POST)
    public boolean removeQuota(
            @ApiParam(name = "id", value = "指标ID", required = true)
            @RequestParam(value = "id", required = true) Integer id) {
            @RequestParam(value = "id", required = true) Long id) {
        try {
            jobService.removeJob(id);
            return true;

+ 2 - 2
svr/svr-quota/src/main/java/com/yihu/jw/quota/controller/QuotaController.java

@ -65,7 +65,7 @@ public class QuotaController extends BaseController {
    @RequestMapping(value = ServiceApi.TJ.TjGetQuotaResult, method = RequestMethod.GET)
    public MixEnvelop getQuotaResult(
            @ApiParam(name = "id", value = "指标任务ID", required = true)
            @RequestParam(value = "id" , required = true) int id,
            @RequestParam(value = "id" , required = true) Long id,
            @ApiParam(name = "filters", value = "检索条件", defaultValue = "")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "pageNo", value = "页码", defaultValue = "0")
@ -113,7 +113,7 @@ public class QuotaController extends BaseController {
    @RequestMapping(value = ServiceApi.TJ.GetQuotaTotalCount, method = RequestMethod.GET)
    public MixEnvelop getQuotaTotalCount(
            @ApiParam(name = "id", value = "指标任务ID", required = true)
            @RequestParam(value = "id" , required = true) int id,
            @RequestParam(value = "id" , required = true) Long id,
            @ApiParam(name = "filters", value = "检索条件", defaultValue = "")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "dimension", value = "需要统计不同维度字段多个维度用;隔开", defaultValue = "quotaDate")

+ 4 - 4
svr/svr-quota/src/main/java/com/yihu/jw/quota/controller/QuotaReportController.java

@ -330,7 +330,7 @@ public class QuotaReportController extends BaseController {
            for (String quotaId : quotaIds) {
                Map<String, Object> dataMap = new LinkedHashMap<>();
                TjQuota tjQuota = quotaService.findOne(Integer.valueOf(quotaId));
                TjQuota tjQuota = quotaService.findOne(Long.valueOf(quotaId));
                if (tjQuota != null) {
                    List<Map<String, Object>> resultListMap = baseStatistsService.getSimpleQuotaReport(tjQuota.getCode(), filter, dimension,true, top);
                    if (resultListMap != null && resultListMap.size() > 0) {
@ -594,7 +594,7 @@ public class QuotaReportController extends BaseController {
    @RequestMapping(value = ServiceApi.TJ.GetQuotaGroupBy, method = RequestMethod.GET)
    public MixEnvelop getQuotaGroupBy(
            @ApiParam(name = "id", value = "指标任务ID", required = true)
            @RequestParam(value = "id", required = true) int id,
            @RequestParam(value = "id", required = true) Long id,
            @ApiParam(name = "filters", value = "检索条件", defaultValue = "")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "dimension", value = "维度字段", defaultValue = "quotaDate")
@ -663,7 +663,7 @@ public class QuotaReportController extends BaseController {
            Map<String, String> xAxisMap = new HashMap<>();
            for (String quotaId : quotaIds) {
                Map<String, Object> dataMap = new HashMap<>();
                TjQuota tjQuota = quotaService.findOne(Integer.valueOf(quotaId));
                TjQuota tjQuota = quotaService.findOne(Long.valueOf(quotaId));
                if (null != tjQuota) {
                    String dictSql = getQuotaDimensionDictSql(tjQuota.getCode(), dimension);
                    Map<String, String> dimensionDicMap = new HashMap<>();
@ -878,7 +878,7 @@ public class QuotaReportController extends BaseController {
            for (String quotaId : quotaIds) {
                Map<String, Object> dataMap = new LinkedHashMap<>();
                TjQuota tjQuota = quotaService.findOne(Integer.valueOf(quotaId));
                TjQuota tjQuota = quotaService.findOne(Long.valueOf(quotaId));
                if (tjQuota != null) {
                    List<Map<String, Object>> resultListMap = baseStatistsService.getSimpleQuotaReport(tjQuota.getCode(), filter, dimension,true, top);
                    if (resultListMap != null && resultListMap.size() > 0) {

+ 1 - 1
svr/svr-quota/src/main/java/com/yihu/jw/quota/dao/jpa/TjQuotaDao.java

@ -7,7 +7,7 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
 * Created by chenweida on 2017/6/1.
 */
public interface TjQuotaDao extends JpaRepository<TjQuota, Integer>, JpaSpecificationExecutor<TjQuota> {
public interface TjQuotaDao extends JpaRepository<TjQuota, Long>, JpaSpecificationExecutor<TjQuota> {
    TjQuota findByCode(String code);
}

+ 3 - 3
svr/svr-quota/src/main/java/com/yihu/jw/quota/etl/Contant.java

@ -217,9 +217,9 @@ public class Contant {
    public static class save_status {
        public static final String success = "1";
        public static final String fail = "0";
        public static final String executing = "2";
        public static final Integer success = 1;
        public static final Integer fail = 0;
        public static final Integer executing = 2;
    }

+ 1 - 1
svr/svr-quota/src/main/java/com/yihu/jw/quota/job/EsQuotaJob.java

@ -169,7 +169,7 @@ public class EsQuotaJob implements Job {
     */
    public void quota(TjQuotaLog tjQuotaLog,QuotaVo quotaVo) {
        String time = "时间:" + startTime + "到"+ endTime +" , ";
        String status = "";
        Integer status = 0;
        String content = "";
        try {
            //抽取数据

+ 2 - 2
svr/svr-quota/src/main/java/com/yihu/jw/quota/service/job/JobService.java

@ -36,7 +36,7 @@ public class JobService {
     * @param endDate     抽取数据截止日期。初始执行时无NULL;立即执行时需要传值;周期执行时也为NULL,如果是基础指标周期执行,后续默认赋值昨天截止。
     * @throws Exception
     */
    public void executeJob(Integer id, String executeFlag, String startDate, String endDate) throws Exception {
    public void executeJob(Long id, String executeFlag, String startDate, String endDate) throws Exception {
        TjQuota tjQuota = quotaDao.getOne(id);
        if (tjQuota != null) {
            QuotaVo quotaVo = new QuotaVo();
@ -81,7 +81,7 @@ public class JobService {
     * @param id 指标ID
     * @throws Exception
     */
    public void removeJob(Integer id) throws Exception {
    public void removeJob(Long id) throws Exception {
        TjQuota tjQuota = quotaDao.getOne(id);
        if (tjQuota != null) {
            QuotaVo quotaVo = new QuotaVo();

+ 4 - 4
svr/svr-quota/src/main/java/com/yihu/jw/quota/service/quota/QuotaService.java

@ -21,7 +21,7 @@ public class QuotaService {
    @Autowired
    private EsResultExtract esResultExtract;
    public TjQuota findOne(int id){
    public TjQuota findOne(Long id){
        return quotaDao.getOne(id);
    }
@ -29,7 +29,7 @@ public class QuotaService {
        return quotaDao.findByCode(code);
    }
    public List<Map<String, Object>> queryResultPage(Integer id,String filters ,int pageNo,int pageSize) throws Exception {
    public List<Map<String, Object>> queryResultPage(Long id,String filters ,int pageNo,int pageSize) throws Exception {
        TjQuota tjQuota= quotaDao.getOne(id);
        return  esResultExtract.queryResultPage(tjQuota, filters, pageNo, pageSize);
    }
@ -39,7 +39,7 @@ public class QuotaService {
        return  esResultExtract.queryResultPage(tjQuota, filters, pageNo, pageSize);
    }
    public long getQuotaTotalCount(Integer id,String filters) throws Exception {
    public long getQuotaTotalCount(Long id,String filters) throws Exception {
        TjQuota tjQuota= quotaDao.getOne(id);
        long count = esResultExtract.getQuotaTotalCount(tjQuota,filters);
        return count;
@ -57,7 +57,7 @@ public class QuotaService {
    //多维度数据的总和 返回数据结果集
    //返回结果 :key为共同维度的组合值,value为数据结果集
    public Map<String,Map<String, Object>> getQuotaResult(Integer id, String filters,String dimension) throws Exception {
    public Map<String,Map<String, Object>> getQuotaResult(Long id, String filters,String dimension) throws Exception {
        String[] dimensions = null;
        if(StringUtils.isNotEmpty(dimension)){