Commit 1430fc7a authored by 耿迪迪's avatar 耿迪迪

首页

parent 0cdc8dca
package com.zehong.web.controller.index;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.system.service.index.ITIndexStatisticService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 首页统计
*/
@RestController
@RequestMapping("/index/statistic")
public class TIndexStatistic {
@Autowired
private ITIndexStatisticService itIndexStatisticService;
@GetMapping("/info")
public AjaxResult statistic(){
return AjaxResult.success(itIndexStatisticService.indexStatistics());
}
}
package com.zehong.web.controller.track;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -15,8 +15,8 @@ import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TProductLogistics;
import com.zehong.system.service.ITProductLogisticsService;
import com.zehong.system.domain.track.TProductLogistics;
import com.zehong.system.service.track.ITProductLogisticsService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
......
package com.zehong.system.domain;
package com.zehong.system.domain.track;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
......
package com.zehong.system.mapper.index;
import java.util.Map;
/**
* 首页统计
*/
public interface TIndexStatisticsMapper {
/**
* 首页统计
* @return List
*/
Map<String,Integer> indexStatistics();
}
package com.zehong.system.mapper;
package com.zehong.system.mapper.track;
import java.util.List;
import com.zehong.system.domain.TProductLogistics;
import com.zehong.system.domain.track.TProductLogistics;
/**
* 出货物流Mapper接口
......
package com.zehong.system.service.impl.index;
import com.zehong.system.mapper.index.TIndexStatisticsMapper;
import com.zehong.system.service.index.ITIndexStatisticService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Map;
/**
* 首页统计
*/
@Service
public class ITIndexStatisticServiceImpl implements ITIndexStatisticService{
@Resource
private TIndexStatisticsMapper indexStatisticsMapper;
/**
* 首页统计
* @return List
*/
@Override
public Map<String,Integer> indexStatistics(){
return indexStatisticsMapper.indexStatistics();
}
}
package com.zehong.system.service.impl;
package com.zehong.system.service.impl.track;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TProductLogisticsMapper;
import com.zehong.system.domain.TProductLogistics;
import com.zehong.system.service.ITProductLogisticsService;
import com.zehong.system.mapper.track.TProductLogisticsMapper;
import com.zehong.system.domain.track.TProductLogistics;
import com.zehong.system.service.track.ITProductLogisticsService;
/**
* 出货物流Service业务层处理
......
package com.zehong.system.service.index;
import java.util.Map;
/**
* 首页统计
*/
public interface ITIndexStatisticService {
/**
* 首页统计
* @return List
*/
Map<String,Integer> indexStatistics();
}
package com.zehong.system.service;
package com.zehong.system.service.track;
import java.util.List;
import com.zehong.system.domain.TProductLogistics;
import com.zehong.system.domain.track.TProductLogistics;
/**
* 出货物流Service接口
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.index.TIndexStatisticsMapper">
<select id="indexStatistics" resultType="Map">
select
(select count(pro.id) from t_product_project pro)as proNum,
(select count(draw.id) from t_product_drawing draw where draw.is_del = '0')as drawNum,
(select count(store.id) from t_product_store store where store.is_del = '0')as storeNum,
(select count(mark.id) from t_product_mark mark where mark.is_del = '0')as markNum,
(select count(plan.id) from t_product_plan plan where plan.is_del = '0')as planNum,
(select count(exe.id) from t_product_inspect exe where exe.is_del = '0')as exeNum,
(select count(device.id) from t_product_device device)as deviceNum,
(select count(logistics.id) from t_product_logistics logistics)as logisticsNum
</select>
</mapper>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TProductLogisticsMapper">
<mapper namespace="com.zehong.system.mapper.track.TProductLogisticsMapper">
<resultMap type="TProductLogistics" id="TProductLogisticsResult">
<result property="id" column="id" />
......
import request from '@/utils/request'
// 首页统计数据
export function getStatistic() {
return request({
url: '/index/statistic/info',
method: 'get'
})
}
This diff is collapsed.
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