Commit e9839286 authored by wuzhilong's avatar wuzhilong

制证量统计图

parent c668099a
package com.yxproject.start.api;
import com.yxproject.start.service.CartogramService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author ad
*/
@RestController
@RequestMapping("Cartogram")
public class CartogramApi {
@Autowired
private CartogramService cartogramService;
/**
* 查询制证统计图数据
* @param json 查询条件
*/
@PostMapping("findCardDetailedList")
public Map<String,Object> findNanufacturingQuantity(@RequestBody String json) {
List<Integer> list_pz = new ArrayList<>();
List<Integer> list_jr = new ArrayList<>();
List<Integer> list_yj = new ArrayList<>();
List<Integer> list_fz = new ArrayList<>();
Map map;
List<Map<String,Integer>> str;
Map strMap = new HashMap <String, Object>();
for (int i=0;i<12;i++){
list_pz.add(0);
list_jr.add(0);
list_yj.add(0);
list_fz.add(0);
}
String date=json.toString();
str=cartogramService.findNanufacturingQuantity(date);
for (int i=0; i < str.size(); i++) {
map=str.get(i);
if(map.get("CODE").toString().equals("0")){
list_pz.set(Integer.parseInt(map.get("DD").toString()) - 1, Integer.parseInt(map.get("NUM").toString()));
}
if(map.get("CODE").toString().equals("5")){
list_jr.set(Integer.parseInt(map.get("DD").toString()) - 1, Integer.parseInt(map.get("NUM").toString()));
}
if(map.get("CODE").toString().equals("7")){
list_yj.set(Integer.parseInt(map.get("DD").toString()) - 1, Integer.parseInt(map.get("NUM").toString()));
}
if(map.get("CODE").toString().equals("99")){
list_fz.set(Integer.parseInt(map.get("DD").toString()) - 1, Integer.parseInt(map.get("NUM").toString()));
}
}
strMap.put("pz", list_pz);
strMap.put("ga", list_jr);
strMap.put("tw", list_yj);
strMap.put("fz", list_fz);
strMap.put("date",date);
return strMap;
}
}
package com.yxproject.start.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
@Mapper
public interface CartogramMapper {
/**
*制证量统计图
*/
@Select("select task.CARD_TYPE code,dic.CARD_TYPE,to_char(task.ISSUED_DATE,'MM') dd,sum(gro.VALID_COUNT) num\n" +
" from TASK task \n" +
" LEFT join GROUP_NO gro\n" +
" on task.TASK_ID=gro.TASK_ID\n" +
" LEFT join CARD_TYPE_DIC dic \n" +
" on task.CARD_TYPE=dic.CARD_TYPE_ID\n" +
" where to_char(task.ISSUED_DATE,'yyyy')=#{date} \n" +
" group by task.CARD_TYPE,dic.CARD_TYPE,to_char(task.ISSUED_DATE,'MM')\n" +
" union all\n" +
" select 99 as code,'废证',to_char(fa.SUBMIT_DATE,'MM') dd ,count(ACCEPT_NO) num\n" +
" from FAILED_CARD fa\n" +
" WHERE to_char(fa.SUBMIT_DATE,'yyyy')=#{date} \n" +
" group by to_char(fa.SUBMIT_DATE,'MM')")
public List<Map<String,Integer>> findNanufacturingQuantity(@Param("date") String date);
}
package com.yxproject.start.service;
import java.util.List;
import java.util.Map;
public interface CartogramService {
public List<Map<String,Integer>> findNanufacturingQuantity(String date);
}
package com.yxproject.start.service.impl;
import com.yxproject.start.mapper.CartogramMapper;
import com.yxproject.start.service.CartogramService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service
public class CartogramServiceImpl implements CartogramService {
@Autowired
private CartogramMapper cartogramMapper;
@Override
public List<Map<String,Integer>> findNanufacturingQuantity(String date) {
List<Map<String,Integer>> list=cartogramMapper.findNanufacturingQuantity(date);
return list;
}
}
......@@ -1711,9 +1711,11 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
success(response.data)
})
},
loadCertificationDiagram: function (success, failed) {
$http({method: 'GET',
url: "../Cartogram/findCardDetailedList"+urlTimeStamp()
loadCertificationDiagram: function (date,success, failed) {
console.log(date);
$http({method: 'post',
url: "../Cartogram/findCardDetailedList"+urlTimeStamp(),
data:date
}).then(function (resp) {
return success(resp.data);
},
......
This diff is collapsed.
<section class="content row">
<div class="col-md-12" style="margin-top:20px;">
<div class="box ">
<div class="box-header">
<strong>制证统计</strong>
<div class="pull-right">
<select class="form-control select2">
<option value="2019">2019年</option>
</select>
</div>
</div>
<div class="box box-primary">
<div class="box ">
<div class="box-header">
<strong>制证统计</strong>
<div class="pull-right col-md-2" >
<input class="form-control col-md-1"
style="width: 70px;height: 20px;"
ng-model="year"
ng-change="changeYear()">
<span class="col-md-1"></span>
</div>
</div>
<div class="box box-primary">
<div style="text-align: center;">
<!--通过率统计图-->
<div class="row" >
<div class="col-md-12">
<div class="yx-div-header"></div>
<div id="diagram_item_ratio_certification" style="height:500px;"></div>
</div>
<div style="text-align: center;">
<!--通过率统计图-->
<div class="row" >
<div class="col-md-12">
<div class="yx-div-header"></div>
<div id="diagram_item_ratio_certification" style="height:500px;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
\ No newline at end of file
......@@ -14,11 +14,13 @@ angular.module('AvatarCheck.blank', ['ngRoute', 'AvatarCheck.http', 'tm.paginati
if($rootScope.loginData.login==false){
$location.path("/login")
}
$scope.loadCertificationDiagram = function(){
$scope.loadCertificationDiagram = function(date){
HttpService.loadCertificationDiagram(
date,
function (data) {
console.log("统计图:",data)
var myChart = echarts.init(document.getElementById('diagram_item_ratio_certification'));
console.log("统计图:",data)
myChart.setOption(buildDiagramDataCheckItemRatioProv('制证生产', data));
},
......@@ -27,6 +29,10 @@ angular.module('AvatarCheck.blank', ['ngRoute', 'AvatarCheck.http', 'tm.paginati
}
)
};
$scope.loadCertificationDiagram();
$scope.year=new Date().getFullYear();
$scope.loadCertificationDiagram($scope.year);
$scope.changeYear=function () {
$scope.loadCertificationDiagram($scope.year);
}
});
\ No newline at end of file
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