Commit f7e90a37 authored by suichenguang's avatar suichenguang

Merge branch 'dev' of…

Merge branch 'dev' of http://121.22.111.250:8000/YX_IDENT_auxiliary/YX_IDENT_beijing_auxiliary into dev
parents ca2cd1be fb79032f
......@@ -3,8 +3,11 @@ package com.yxproject.start.api;
import com.yxproject.start.service.DetailReceiptListService;
import com.yxproject.start.service.ReceiptService;
import com.yxproject.start.utils.ExportExcel;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.lang.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
......@@ -14,6 +17,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -52,6 +56,39 @@ public class ExportExcelApi {
}
return null;
}
/**
* 导出交接单
*/
@RequestMapping("printReceiptExcelData")
public byte[] printReceiptExcelData(@RequestBody String list, HttpServletResponse response){
JSONObject jsonObject = JSONObject.fromObject(list);
JSONArray jsonArray = JSONArray.fromObject(jsonObject);
// List<Map<String, Object>> mapList = receiptService.;
List<Map<String, Object>> mapList = new ArrayList<>();
response.setContentType("application/x-download");
response.setCharacterEncoding("UTF-8");
String dateTime = DateFormatUtils.format(new Date(), "yyyy-MM-dd");
// //使用Servlet实现文件下载的时候,避免浏览器自动打开文件
String fout = null;
fout = ExportExcel.exportExcelDate(mapList);
String outFile = dateTime+"交接单" ;
try {
FileInputStream fis = new FileInputStream(new File(fout));
byte[] b = new byte[fis.available()];
fis.read(b);
fis.close();
response.addHeader("Content-Disposition", "attachment;filename=" + outFile + ".xls");
return b;
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
/**
* 查询公安网数据
*/
......
......@@ -128,10 +128,10 @@ public interface ReceiptMapper {
"WHERE subStr(ACCEPT_NO,0,8) = #{groupNo} or ACCEPT_NO=#{groupNo}")
public Map<String,Object> selectTimes(@Param("groupNo") String groupNo);
@Select("select RECEIPT_LIST.id,RECEIPT_LIST.QR_CODE,RECEIPT_LIST.RECEIPT_DATE,RECEIPT_LIST.POLICE_CODE,c1.CARD_TYPE_ID,\n" +
"c2.CARD_TYPE_ID CARD_TYPE2,RECEIPT_LIST.FINISH_COUNT,GAJG_DM.GAJG_DM,GAJG_DM.GAJG_MC,RECEIPT_LIST.CHECK_DATE,RECEIPT_LIST.CHECK_NAME\n" +
",COUNTY_DIC.COUNTY_CODE ,COUNTY_DIC.COUNTYNAME from RECEIPT_LIST left join CARD_TYPE_DIC c1 on c1.CARD_TYPE_ID = RECEIPT_LIST.CARD_TYPE_ID\n" +
"left join CARD_TYPE_DIC c2 on c2.CARD_TYPE_ID = RECEIPT_LIST.CARD_TYPE_ID\n" +
@Select("select RECEIPT_LIST.id,RECEIPT_LIST.QR_CODE,RECEIPT_LIST.RECEIPT_DATE,RECEIPT_LIST.POLICE_CODE,decode(RECEIPT_LIST.Old_CARD_TYPE_ID,null,RECEIPT_LIST.CARD_TYPE_ID,RECEIPT_LIST.Old_CARD_TYPE_ID) CARD_TYPE_ID,\n" +
"RECEIPT_LIST.FINISH_COUNT,GAJG_DM.GAJG_DM,GAJG_DM.GAJG_MC,RECEIPT_LIST.CHECK_DATE,RECEIPT_LIST.CHECK_NAME\n" +
",CARD_TYPE_DIC.CARD_TYPE,COUNTY_DIC.COUNTY_CODE ,COUNTY_DIC.COUNTYNAME from RECEIPT_LIST \n" +
"left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = decode(RECEIPT_LIST.Old_CARD_TYPE_ID,null,RECEIPT_LIST.CARD_TYPE_ID,RECEIPT_LIST.Old_CARD_TYPE_ID)\n" +
"left join GAJG_DM on GAJG_DM.GAJG_DM = RECEIPT_LIST.POLICE_CODE\n" +
"left join COUNTY_DIC on substr(RECEIPT_LIST.POLICE_CODE,0,6) = COUNTY_DIC.COUNTY_CODE" +
" where to_char(CHECK_DATE,'yyyyMMdd') = #{date}")
......
......@@ -153,84 +153,125 @@ public class ReceiptServiceImpl implements ReceiptService {
return mapList1;
}
private List<Map<String,Object>> formateMap(List<Map<String, Object>> mapList){
Map<String,Object> objectMap = new LinkedHashMap<>();
for (Map<String,Object> map :mapList){
if (objectMap!=null&&objectMap.containsKey(map.get("COUNTY_CODE")+"")){
List<Map<String,Object>> maps = (List<Map<String,Object>>) objectMap.get(map.get("COUNTY_CODE")+"");
maps.add(map);
objectMap.put(map.get("COUNTY_CODE")+"",maps);
}else {
List<Map<String,Object>> maps = new ArrayList<>();
maps.add(map);
objectMap.put(map.get("COUNTY_CODE")+"",maps);
private List<Map<String, Object>> formateMap(List<Map<String, Object>> maplist) {
Map<String, Object> typeMap = new LinkedHashMap<>();
for (Map o : maplist) {
// 组合JSON
if (typeMap != null & typeMap.containsKey(o.get("CARD_TYPE") + "")) {
List<Map<String, Object>> mapList = (List<Map<String, Object>>) typeMap.get(o.get("CARD_TYPE"));
mapList.add(o);
typeMap.put(o.get("CARD_TYPE") + "", mapList);
} else {
List<Map<String, Object>> mapList = new ArrayList<>();
mapList.add(o);
typeMap.put(o.get("CARD_TYPE") + "", mapList);
}
}
List<Map<String,Object>> countyMapList = new ArrayList<>();
for (String countyCode:objectMap.keySet()){
Map<String,Object> countyMap = new LinkedHashMap<>();
String countyName =null;
List<Map<String,Object>> policeMapList = new ArrayList<>();
List<Map<String,Object>> maps = (List<Map<String,Object>>) objectMap.get(countyCode);
Map<String,Object> policeMap = new LinkedHashMap<>();
for (Map<String,Object> map :maps){
countyName = map.get("COUNTYNAME")+"";
if (policeMap != null&&policeMap.containsKey(map.get("POLICE_CODE")+"")){
List<Map<String,Object>> policeMapList2= (List<Map<String,Object>>) policeMap.get(map.get("POLICE_CODE")+"");
policeMapList2.add(map);
policeMap.put(map.get("POLICE_CODE")+"",policeMapList2);
}else {
List<Map<String,Object>> policeMapList2= new ArrayList<>();
policeMapList2.add(map);
policeMap.put(map.get("POLICE_CODE")+"",policeMapList2);
//将已按制证分好的Map 再次细化分为任务单Map
for (String type : typeMap.keySet()) {
List<Map<String, Object>> mapList = (List<Map<String, Object>>) typeMap.get(type);
Map<String, Object> typemap = new LinkedHashMap<>();
for (Map<String, Object> o : mapList) {
if (typemap != null && typemap.containsKey(o.get("POLICE_CODE") + "")) {
List<Map<String, Object>> maplist_county = (List<Map<String, Object>>) typemap.get(o.get("POLICE_CODE") + "");
maplist_county.add(o);
typemap.put(o.get("POLICE_CODE") + "", maplist_county);
} else {
List<Map<String, Object>> maplist_county = new ArrayList<>();
maplist_county.add(o);
typemap.put(o.get("POLICE_CODE") + "", maplist_county);
}
}
for (String policeCode : policeMap.keySet()){
List<Map<String,Object>> policeList= (List<Map<String,Object>>) policeMap.get(policeCode);
Map<String,Object> policemap = new LinkedHashMap<>();
String GAJG_MC = null;
String CHECK_DATE =null;
String CHECK_NAME =null;
int youSum =0;
int puSum =0;
for (Map<String,Object> map :policeList){
GAJG_MC =map.get("GAJG_MC")+"";
CHECK_DATE =map.get("CHECK_DATE")+"";
CHECK_NAME =map.get("CHECK_NAME")+"";
if ("null".equals(map.get("CARD_TYPE2"))){
if ("9".equals(map.get("CARD_TYPE_ID")+"")){
youSum+=Integer.parseInt(map.get("FINISH_COUNT")+"");
}else {
puSum+=Integer.parseInt(map.get("FINISH_COUNT")+"");
}
}else {
if ("9".equals(map.get("CARD_TYPE2")+"")){
youSum+=Integer.parseInt(map.get("FINISH_COUNT")+"");
}else {
puSum+=Integer.parseInt(map.get("FINISH_COUNT")+"");
typeMap.put(type, typemap);
}
List<Map<String, Object>> typeList = new ArrayList<>();
for (String type : typeMap.keySet()) {
Map<String, Object> mapType = new LinkedHashMap<>();
int typeSum = 0;
String typeName = null;
List<Map<String, Object>> countyList = new ArrayList<>();
Map<String, List<Map<String, Object>>> mapList = (Map<String, List<Map<String, Object>>>) typeMap.get(type);
for (String taskId : mapList.keySet()) {
Map<String, Object> countyMapGroup = new LinkedHashMap<>();
int validCount = 0;
String countyName = null;
String countyCode = null;
List<Map<String, Object>> countyMapList = mapList.get(taskId);
for (Map<String, Object> countyMap : countyMapList) {
countyCode = countyMap.get("COUNTY_CODE") + "";
countyName = countyMap.get("COUNTYNAME") + "";
typeName = countyMap.get("CARD_TYPE_ID") + "";
typeSum += Integer.valueOf(countyMap.get("FINISH_COUNT") + "");
validCount += Integer.valueOf(countyMap.get("FINISH_COUNT") + "");
}
if (countyMapList.size() == 1) {
countyMapGroup.put("groupNum", countyMapList.get(0).get("QR_CODE"));
} else {
List<Integer> c = new ArrayList<>();
List<Integer> nsList = new ArrayList<>();
for (int i = 0; i < countyMapList.size(); i++) {
/**
* 判断组号中时候含有历史回迁组
*/
if ((((countyMapList.get(i)).get("QR_CODE")) + "").contains("L")) {
if ((((countyMapList.get(i)).get("QR_CODE")) + "").length() == 8) {
nsList.add(Integer.parseInt((((countyMapList.get(i)).get("QR_CODE")) + "").substring(1, (((countyMapList.get(i)).get("QR_CODE")) + "").length())));
}
} else {
if ((((countyMapList.get(i)).get("QR_CODE")) + "").length() == 8) {
nsList.add(Integer.parseInt((((countyMapList.get(i)).get("QR_CODE")) + "")));
}
}
}
countyMapGroup.put("groupNum", createGroupNo(c, nsList));
}
policemap.put("youSum",youSum);
policemap.put("puSum",puSum);
policemap.put("checkName",CHECK_NAME);
policemap.put("checkDate",CHECK_DATE);
policemap.put("policeName",GAJG_MC);
policemap.put("policeCode",policeCode);
policeMapList.add(policemap);
countyMapGroup.put("countyCode", countyCode);
countyMapGroup.put("taskId", taskId);
countyMapGroup.put("groupList", countyMapList);
countyMapGroup.put("countyName", countyName);
countyMapGroup.put("countyValidCount", validCount);
countyList.add(countyMapGroup);
}
countyMap.put("policeList",policeMapList);
countyMap.put("countyName",countyName);
countyMap.put("countyCode",countyCode);
countyMapList.add(countyMap);
mapType.put("typeCode", typeName);
mapType.put("typeSum", typeSum);
mapType.put("typeName", type);
mapType.put("countyList", countyList);
typeList.add(mapType);
}
return typeList;
}
return countyMapList;
private String createGroupNo(List<Integer> c, List<Integer> nsList) {
try {
String groupNo = "";
c.add(nsList.get(0));
for (int i = 0; i < nsList.size() - 1; ++i) {
if (nsList.get(i) + 1 == nsList.get(i + 1)) {
c.add(nsList.get(i + 1));
} else {
if (c.size() >= 1) {
if (c.size() == 1) {
groupNo += c.get(0) + ",";
} else {
groupNo += c.get(0) + "-" + c.get(c.size() - 1) + ",";
}
}
c.clear();
c.add(nsList.get(i + 1));
}
}
if (c.size() >= 1) {
if (c.size() == 1) {
groupNo += c.get(0) + ",";
} else {
groupNo += c.get(0) + "-" + c.get(c.size() - 1) + ",";
}
}
return groupNo;
} catch (Exception e) {
}
return "";
}
}
......@@ -662,13 +662,13 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
success(response.data)
})
},
analyseData:function(id,success){
console.log(id)
analyseData:function(date,success){
console.log(date)
$http({
method: 'GET',
url: "../LogApi/selectAnalysisData"+urlTimeStamp(),
params:{
filesId:id
uploadDate:date
}
}).then(function successCallback(response) {
success(response.data)
......@@ -796,13 +796,13 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
success(response.data)
})
},
deleteProdDataByFileId:function(id,success){
console.log(id)
deleteProdDataByFileId:function(uploadDate,success){
console.log(uploadDate)
$http({
method: 'GET',
url: "../LogApi/deleteFiles"+urlTimeStamp(),
params:{
fileId:id
uploadDate:uploadDate
}
}).then(function successCallback(response) {
success(response.data)
......
......@@ -11,7 +11,7 @@
<div class="box-primary">
<form ng-submit="createInputs()" style="padding-left: 15px;">
<span style="font-size:20px;">废证数量:</span>
<input style="margin-top:20px;height: 30px;" type="text" ng-model="failedCount">
<input style="margin-top:20px;height: 30px;" type="number" ng-model="failedCount">
<input type="submit" class="btn btn-primary" value="确定">
<span style="font-size:14px;color: red;" ng-if="errMsglb">{{errMsglb}}</span>
</form>
......
......@@ -12,8 +12,12 @@ angular.module('AvatarCheck.addFailed', ['ngRoute', 'AvatarCheck.http'])
.controller('addFailedCtrl', function ($scope, $rootScope, $timeout, HttpService, ngDialog, MessageService, $filter) {
$scope.createInputs = function(){
var count = $scope.failedCount;
if(count>10){
count=10;
}
$scope.arr = [];
for (var i=0;i<$scope.failedCount;i++){
for (var i=0;i<count;i++){
$scope.arr.push(i);
}
}
......
......@@ -14,7 +14,7 @@
<div class="box-primary">
<form ng-submit="createInputs()" style="padding-left: 15px;">
<span style="font-size:20px;">余证数量:</span>
<input style="margin-top:20px;height: 30px;" type="text" ng-model="restCount">
<input style="margin-top:20px;height: 30px;" type="number" ng-model="restCount">
<input type="submit" class="btn btn-primary" value="确定">
<span style="font-size:14px;color: red;" ng-if="errMsglb">{{errMsglb}}</span>
</form>
......
......@@ -12,8 +12,12 @@ angular.module('AvatarCheck.addRest', ['ngRoute', 'AvatarCheck.http'])
.controller('addRestCtrl', function ($scope, $rootScope, $timeout, HttpService, ngDialog, MessageService, $filter) {
$scope.createInputs = function(){
var count = $scope.restCount;
if(count>10){
count=10;
}
$scope.arr = [];
for (var i=0;i<$scope.restCount;i++){
for (var i=0;i<count;i++){
$scope.arr.push(i);
}
}
......
......@@ -11,7 +11,7 @@
<div class="box-primary">
<form ng-submit="createInputs()" style="padding-left: 15px;">
<span style="font-size:20px;">证件数量:</span>
<input style="margin-top:20px;height: 30px;" type="text" ng-model="tagCount">
<input style="margin-top:20px;height: 30px;" type="number" ng-model="tagCount">
<input type="submit" class="btn btn-primary" value="确定">
<span style="font-size:14px;color: red;" ng-if="errMsglb">{{errMsglb}}</span>
</form>
......
......@@ -12,8 +12,12 @@ angular.module('AvatarCheck.addTag', ['ngRoute', 'AvatarCheck.http'])
.controller('addTagCtrl', function ($scope, $rootScope, $timeout, HttpService, ngDialog, MessageService, $filter) {
$scope.createInputs = function(){
var count = $scope.tagCount;
if(count>10){
count=10;
}
$scope.arr = [];
for (var i=0;i<$scope.tagCount;i++){
for (var i=0;i<count;i++){
$scope.arr.push(i);
}
}
......
......@@ -43,7 +43,7 @@
<td></td>
</tr>
<tr ng-repeat="police in item.policeList">
<td><input type="checkbox" class="checkPolice{{item.countyCode}}"></td>
<td></td>
<td>{{$index+1}}</td>
<td>{{police.policeCode}}</td>
<td>{{police.policeName}}</td>
......
......@@ -55,16 +55,16 @@ angular.module('AvatarCheck.receitp', ['ngRoute', 'AvatarCheck.http'])
}
}
$scope.checkAllPolice = function($event,countyCode) {
var checkAllPolice = $event.target;
var checkPolice =$(".checkPolice"+countyCode);
for (var i=0;i<checkPolice.length;i++){
if(checkAllPolice.checked) {
checkPolice[i].checked = true;
}else {
checkPolice[i].checked = false;
}
}
}
// $scope.checkAllPolice = function($event,countyCode) {
// var checkAllPolice = $event.target;
// var checkPolice =$(".checkPolice"+countyCode);
// for (var i=0;i<checkPolice.length;i++){
// if(checkAllPolice.checked) {
// checkPolice[i].checked = true;
// }else {
// checkPolice[i].checked = false;
// }
// }
// }
});
\ No newline at end of file
......@@ -336,16 +336,16 @@ angular.module('AvatarCheck.task', ['ngRoute', 'AvatarCheck.http'])
$scope.goes = function(){
var checks = $(".checkOneBox:checked");
var arr = [];
var failedArr=[];
for (var i=0;i<checks.length;i++){
if(checks[i].value.length<11){
failedArr.push(checks[i].value)
}else{
arr.push(checks[i].value)
if(checks.length>0){
var arr = [];
var failedArr=[];
for (var i=0;i<checks.length;i++){
if(checks[i].value.length<11){
failedArr.push(checks[i].value)
}else{
arr.push(checks[i].value)
}
}
}
if(arr.length>0){
var json={
process:$rootScope.loginData.roleList[0].process,
name:$rootScope.loginData.name,
......
......@@ -82,14 +82,14 @@
<tbody>
<tr ng-repeat="item in xmlPackageData">
<td>{{$index+1}}</td>
<td>{{item.uploadDate | date:'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{item.date}}</td>
<td>{{item.packageCount}}</td>
<td>{{item.cardCount}}</td>
<td>{{item.commonCardCount}}</td>
<td>{{item.postCardCount}}</td>
<td>{{item.dateCount}}</td>
<td>{{item.commonCount}}</td>
<td>{{item.postCount}}</td>
<td>
<button class="btn btn-primary" ng-click="analysis(item.uploadDate,item.packageCount,item.fileId)">解析</button>
<button class="btn btn-danger" ng-click="deleteDataById(item.uploadDate,item.packageCount,item.fileId)">删除</button>
<button class="btn btn-primary" ng-click="analysis(item.date,item.packageCount)">解析</button>
<button class="btn btn-danger" ng-click="deleteDataById(item.date,item.packageCount)">删除</button>
</td>
</tr>
</tbody>
......
......@@ -32,7 +32,7 @@ angular.module('AvatarCheck.xmlAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm.p
$scope.analysis = function (uploadDate,packageCount,id) {
$scope.analysis = function (uploadDate,packageCount) {
ngDialog.open({
template: 'dialogs/analysisDialog.html' + urlTimeStamp(),
width: 876,
......@@ -40,7 +40,7 @@ angular.module('AvatarCheck.xmlAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm.p
controller: ['$scope','HttpService', function ($scope,HttpService) {
$scope.upDate =uploadDate;
$scope.upCount=packageCount;
HttpService.analyseData(id, function (data) {
HttpService.analyseData(uploadDate, function (data) {
$scope.resultData = data;
console.log($scope.resultData)
})
......@@ -73,15 +73,12 @@ angular.module('AvatarCheck.xmlAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm.p
perPageOptions: [10, 20, 30, 40, 50]
};
$scope.getXmlPackage = function(){
HttpService.selectXmlPackageCount($("#datepicker").val(),function(data){
$scope.paginationConf.totalItems = data.respData.string;
console.log($scope.paginationConf.totalItems,"$scope.paginationConf.totalItems")
})
if($scope.paginationConf.currentPage==0){
$scope.paginationConf.currentPage=1;
}
HttpService.selectXmlPackage($("#datepicker").val(),$scope.paginationConf.currentPage,$scope.paginationConf.itemsPerPage,function(data){
$scope.xmlPackageData = data.respData;
$scope.paginationConf.totalItems=data.respData.count;
$scope.xmlPackageData = data.respData.mapList;
console.log($scope.xmlPackageData,"$scope.xmlPackageData")
})
}
......@@ -90,7 +87,7 @@ angular.module('AvatarCheck.xmlAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm.p
var reGet = $scope.getXmlPackage;
$scope.deleteDataById = function(uploadDate,packageCount,id){
$scope.deleteDataById = function(uploadDate,packageCount){
ngDialog.open({
template: 'dialogs/confirm.html' + urlTimeStamp(),
width: 600,
......@@ -100,7 +97,7 @@ angular.module('AvatarCheck.xmlAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm.p
$scope.total = packageCount;
$scope.importDate =uploadDate;
$scope.confirmDelete = function () {
HttpService.deleteProdDataByFileId(id, function (data) {
HttpService.deleteProdDataByFileId(uploadDate, function (data) {
MessageService.showAlert(data.msg);
$scope.closeThisDialog();
reGet();
......
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