1 files added
8 files modified
| | |
| | | String getProjectDistinguish(); |
| | | |
| | | BigDecimal getContractPrice(); |
| | | |
| | | String getProjectTypeName(); |
| | | } |
| | |
| | | */ |
| | | @Query(value = "SELECT project_distinguish AS projectDistinguish, COALESCE(sum(contract_price), 0) AS contractPrice FROM project WHERE plan_start_date LIKE concat(?1,'%') GROUP BY project_distinguish", nativeQuery = true) |
| | | List<ProjectSummary> findSubgroupTurnoverByTargetYear(String targetYear); |
| | | |
| | | /** |
| | | * 根据项目区分、目标年份查询类型营业额 |
| | | * @param projectDistinguish |
| | | * @param targetYear |
| | | * @return |
| | | */ |
| | | @Query(value = "SELECT pt.name AS projectTypeName, COALESCE(sum(p.contract_price), 0) AS contractPrice FROM project p LEFT JOIN project_type pt ON p.project_type_id = pt.id WHERE p.project_distinguish = ?1 AND p.plan_start_date LIKE concat(?2,'%') GROUP BY p.project_type_id", nativeQuery = true) |
| | | List<ProjectSummary> findTypeContractPriceByProjectDistinguishAndTargetYear(String projectDistinguish, String targetYear); |
| | | } |
| | |
| | | public ResponseEntity<Object> queryProjectWorkingHours(ProjectQueryCriteria criteria){ |
| | | return new ResponseEntity<>(projectService.queryProjectWorkingHours(criteria),HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping(value = "/typeContractPrice") |
| | | @Log("查询项目类型合同额") |
| | | @ApiOperation("查询项目类型合同额") |
| | | @PreAuthorize("@el.check('project:list')") |
| | | public ResponseEntity<Object> queryTypeContractPrice(ProjectQueryCriteria criteria){ |
| | | return new ResponseEntity<>(projectService.queryTypeContractPrice(criteria),HttpStatus.OK); |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | Map<String, Object> queryProjectWorkingHours(ProjectQueryCriteria criteria); |
| | | |
| | | /** |
| | | * 查询项目类型合同额 |
| | | * @param criteria |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryTypeContractPrice(ProjectQueryCriteria criteria); |
| | | } |
| | |
| | | import me.zhengjie.modules.project.domain.*; |
| | | import me.zhengjie.modules.project.repository.*; |
| | | import me.zhengjie.modules.project.service.ProjectCostService; |
| | | import me.zhengjie.modules.project.service.dto.ProjectTypeQueryCriteria; |
| | | import me.zhengjie.modules.system.domain.DictDetail; |
| | | import me.zhengjie.modules.system.domain.SysGoalSetting; |
| | | import me.zhengjie.modules.system.repository.SysGoalSettingRepository; |
| | |
| | | returnMap.put("incompleteHours", incompleteHours); |
| | | return returnMap; |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryTypeContractPrice(ProjectQueryCriteria criteria){ |
| | | // 根据项目区分、目标年份查询类型营业额 |
| | | List<ProjectSummary> projectSummaryList = projectRepository.findTypeContractPriceByProjectDistinguishAndTargetYear(criteria.getProjectDistinguish(), criteria.getTargetYear()); |
| | | // 返回列表 |
| | | List<Map<String, Object>> returnList = new ArrayList<>(); |
| | | // 循环类型营业额 |
| | | for (int i = 0; i < projectSummaryList.size(); i ++) { |
| | | // 返回集合 |
| | | Map<String, Object> returnMap = new HashMap<>(); |
| | | returnMap.put("name", projectSummaryList.get(i).getProjectTypeName()); |
| | | returnMap.put("value", projectSummaryList.get(i).getContractPrice()); |
| | | // 返回列表 |
| | | returnList.add(returnMap); |
| | | } |
| | | return returnList; |
| | | } |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | export default { getAll, add, edit, del, editAdmit, editDisavow, getPartake, getRelevant, getSubgroupTurnover, getSubgroupWorkingHours, getProjectWorkingHours } |
| | | export function getTypeContractPrice(params) { |
| | | return request({ |
| | | url: 'api/project/typeContractPrice', |
| | | method: 'get', |
| | | params |
| | | }) |
| | | } |
| | | |
| | | export default { getAll, add, edit, del, editAdmit, editDisavow, getPartake, getRelevant, getSubgroupTurnover, getSubgroupWorkingHours, getProjectWorkingHours, getTypeContractPrice } |
| | |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '工时对比', |
| | | name: '工时数', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| New file |
| | |
| | | <template> |
| | | <div :class="className" :style="{ height: height, width: width }" /> |
| | | </template> |
| | | |
| | | <script> |
| | | import echarts from 'echarts' |
| | | require('echarts/theme/macarons') // echarts theme |
| | | import { debounce } from '@/utils' |
| | | import crudProject from '@/api/project/project' |
| | | |
| | | export default { |
| | | props: { |
| | | className: { |
| | | type: String, |
| | | default: 'chart' |
| | | }, |
| | | width: { |
| | | type: String, |
| | | default: '100%' |
| | | }, |
| | | height: { |
| | | type: String, |
| | | default: '400px' |
| | | }, |
| | | projectDistinguish: { |
| | | type: String, |
| | | default: null |
| | | }, |
| | | targetYear: { |
| | | type: String, |
| | | default: null |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | chart: null |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.initChart() |
| | | this.__resizeHandler = debounce(() => { |
| | | if (this.chart) { |
| | | this.chart.resize() |
| | | } |
| | | }, 100) |
| | | window.addEventListener('resize', this.__resizeHandler) |
| | | }, |
| | | beforeDestroy() { |
| | | if (!this.chart) { |
| | | return |
| | | } |
| | | window.removeEventListener('resize', this.__resizeHandler) |
| | | this.chart.dispose() |
| | | this.chart = null |
| | | }, |
| | | methods: { |
| | | initChart() { |
| | | this.chart = echarts.init(this.$el, 'macarons') |
| | | |
| | | crudProject.getTypeContractPrice({ projectDistinguish: this.projectDistinguish, targetYear: this.targetYear }).then(res => { |
| | | // 绘制图表 |
| | | this.chart.setOption({ |
| | | title: { |
| | | text: '项目类型营业额对比', |
| | | subtext: '', |
| | | left: 'left' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '营业额', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: res, |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | </style> |
| | |
| | | <div class="wrapper-div"> |
| | | <el-select v-model="pwhProjectId" placeholder="目标项目" @change="pwhProjectIdChange"> |
| | | <el-option |
| | | v-for="item in inProgressProject" |
| | | v-for="item in projectList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | |
| | | </el-row> |
| | | <el-row :gutter="32"> |
| | | <el-col :xs="24" :sm="24" :lg="12"> |
| | | <div class="chart-wrapper" /> |
| | | <div class="chart-wrapper"> |
| | | <div class="wrapper-div"> |
| | | <div style="height: 32px;" /> |
| | | </div> |
| | | <type-contract-price :key="tcpwhRandom" :project-distinguish="tcpwhParameterProjectDistinguish" :target-year="tcpwhParameterTargetYear" /> |
| | | </div> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :lg="12"> |
| | | <div class="chart-wrapper" /> |
| | | <div class="chart-wrapper"> |
| | | <div class="wrapper-div"> |
| | | <div style="height: 32px;"> |
| | | <el-select v-model="tcpwhProjectDistinguish" placeholder="项目区分" @change="tcpwhProjectDistinguishOrTargetYearChange"> |
| | | <el-option |
| | | v-for="item in projectDistinguishList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <el-date-picker v-model="tcpwhTargetYear" type="year" clearable placeholder="目标年度" style="width: 185px;" @change="tcpwhProjectDistinguishOrTargetYearChange" /> |
| | | </div> |
| | | </div> |
| | | <type-contract-price :key="tcpwhRandom" :project-distinguish="tcpwhParameterProjectDistinguish" :target-year="tcpwhParameterTargetYear" /> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | |
| | | <script> |
| | | import constant from '../../utils/constant' |
| | | import crudProject from '@/api/project/project' |
| | | import { getDictMap } from '@/api/system/dictDetail' |
| | | import SubgroupTurnover from './chart/subgroupTurnover.vue' |
| | | import SubgroupWorkingHours from './chart/subgroupWorkingHours.vue' |
| | | import ProjectWorkingHours from './chart/projectWorkingHours.vue' |
| | | import TypeContractPrice from './chart/typeContractPrice.vue' |
| | | |
| | | export default { |
| | | name: 'ProjectChart', |
| | | components: { SubgroupTurnover, SubgroupWorkingHours, ProjectWorkingHours }, |
| | | components: { SubgroupTurnover, SubgroupWorkingHours, ProjectWorkingHours, TypeContractPrice }, |
| | | data() { |
| | | return { |
| | | // 进行中项目 |
| | | inProgressProject: [], |
| | | // 项目列表 |
| | | projectList: [], |
| | | // 项目区分列表 |
| | | projectDistinguishList: [], |
| | | // 分组营业额:目标年度 |
| | | stTargetYear: new Date(), |
| | | // 分组营业额:随机数 |
| | |
| | | // 项目工时:随机数 |
| | | pwhRandom: 0, |
| | | // 项目工时:传参 |
| | | pwhParameter: null |
| | | pwhParameter: null, |
| | | // 类型合同额、分组工时:项目区分 |
| | | tcpwhProjectDistinguish: null, |
| | | // 类型合同额、分组工时:目标年度 |
| | | tcpwhTargetYear: new Date(), |
| | | // 类型合同额、分组工时:随机数 |
| | | tcpwhRandom: 0, |
| | | // 类型合同额、分组工时:传参 |
| | | tcpwhParameterProjectDistinguish: null, |
| | | tcpwhParameterTargetYear: new Date().getFullYear().toString() |
| | | } |
| | | }, |
| | | created() { |
| | | // 获取进行中项目 |
| | | this.getInProgressProject() |
| | | // 获取项目 |
| | | this.getProject() |
| | | // 获取字典 |
| | | this.getDictDetail() |
| | | }, |
| | | methods: { |
| | | // 获取进行中项目 |
| | | getInProgressProject() { |
| | | // 获取项目 |
| | | getProject() { |
| | | crudProject.getAll({ projectStatus: constant.PROJECT_STATUS_UNDER_WAY }).then(res => { |
| | | // 进行中项目 |
| | | this.inProgressProject = res |
| | | // 项目列表 |
| | | this.projectList = res |
| | | // 项目工时:目标项目 |
| | | this.pwhProjectId = res[0].id |
| | | // 项目工时:传参 |
| | | this.pwhParameter = res[0].id.toString() |
| | | // 项目工时:随机数 |
| | | this.pwhRandom = Math.random() |
| | | }) |
| | | }, |
| | | // 获取字典 |
| | | getDictDetail() { |
| | | getDictMap(constant.PROJECT_DISTINGUISH).then(res => { |
| | | // 项目区分列表 |
| | | this.projectDistinguishList = res[constant.PROJECT_DISTINGUISH] |
| | | // 类型合同额、分组工时:目标年度 |
| | | this.tcpwhProjectDistinguish = res[constant.PROJECT_DISTINGUISH][0].value |
| | | // 类型合同额、分组工时:传参 |
| | | this.tcpwhParameterProjectDistinguish = res[constant.PROJECT_DISTINGUISH][0].value.toString() |
| | | // 类型合同额、分组工时:随机数 |
| | | this.tcpwhRandom = Math.random() |
| | | }) |
| | | }, |
| | | // 分组营业额:目标年度变更 |
| | |
| | | this.pwhParameter = this.pwhProjectId.toString() |
| | | // 项目工时:随机数 |
| | | this.pwhRandom = Math.random() |
| | | }, |
| | | // 类型合同额、分组工时:项目区分/目标年度变更 |
| | | tcpwhProjectDistinguishOrTargetYearChange() { |
| | | // 类型合同额、分组工时:传参 |
| | | this.tcpwhParameterProjectDistinguish = this.tcpwhProjectDistinguish.toString() |
| | | this.tcpwhParameterTargetYear = this.tcpwhTargetYear.getFullYear().toString() |
| | | // 类型合同额、分组工时:随机数 |
| | | this.tcpwhRandom = Math.random() |
| | | } |
| | | } |
| | | } |