Commit 98c19367 authored by ad's avatar ad

Merge branch 'dev' of…

Merge branch 'dev' of http://121.22.111.250:8000/YX_IDENT_auxiliary/YX_IDENT_beijing_auxiliary into dev
parents 25c973f4 0fbd73c6
......@@ -246,8 +246,7 @@ public class DeliveredApi {
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "");
return str.replace("-", "").replace(" ","").replace(":","");
}
}
......@@ -62,36 +62,37 @@ public class ExportExcelApi {
* 导出交接单
*/
@RequestMapping("printReceiptExcelData")
public byte[] printReceiptExcelData(@RequestBody String list, HttpServletResponse response) {
public Map<String, Object> printReceiptExcelData(@RequestBody String list, HttpServletResponse response) {
JSONObject jsonObject = JSONObject.fromObject(list);
JSONArray jsonArray = JSONArray.fromObject(jsonObject.get("list"));
String startDate = jsonObject.get("startDate").toString();
String endDate = jsonObject.get("endDate").toString();
String type = jsonObject.get("type").toString();
List<Map<String, Object>> mapList = receiptService.selectReceiptList(jsonArray, replaceDate(startDate),replaceDate(endDate), Long.valueOf(type));
response.setContentType("application/x-download");
response.setCharacterEncoding("UTF-8");
String dateTime = DateFormatUtils.format(new Date(), "yyyy_MM_dd");
// //使用Servlet实现文件下载的时候,避免浏览器自动打开文件
String fout = null;
fout = ExportExcel.exportReceiptExcelDate(mapList);
String outFile = dateTime + "";
try {
FileInputStream fis = new FileInputStream(new File(fout));
byte[] b = new byte[fis.available()];
fis.read(b);
fis.close();
response.setCharacterEncoding("utf-8");
response.setContentType("application/octet-stream");
response.addHeader("Content-Disposition", "attachment;" + new String(outFile.getBytes(), "iso-8859-1") + ".xls");
return b;
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
Map<String, Object> map = receiptService.selectReceiptList(jsonArray, replaceDate(startDate),replaceDate(endDate), Long.valueOf(type));
// response.setContentType("application/x-download");
// response.setCharacterEncoding("UTF-8");
// String dateTime = DateFormatUtils.format(new Date(), "yyyy_MM_dd");
//// //使用Servlet实现文件下载的时候,避免浏览器自动打开文件
// String fout = null;
// fout = ExportExcel.exportReceiptExcelDate(mapList);
// String outFile = dateTime + "";
//
// try {
// FileInputStream fis = new FileInputStream(new File(fout));
// byte[] b = new byte[fis.available()];
// fis.read(b);
// fis.close();
// response.setCharacterEncoding("utf-8");
// response.setContentType("application/octet-stream");
// response.addHeader("Content-Disposition", "attachment;" + new String(outFile.getBytes(), "iso-8859-1") + ".xls");
// return b;
// } catch (FileNotFoundException e) {
// e.printStackTrace();
// } catch (IOException e) {
// e.printStackTrace();
// }
// return null;
return map;
}
......@@ -112,7 +113,7 @@ public class ExportExcelApi {
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "");
return str.replace("-", "").replace(" ","").replace(":","");
}
......
......@@ -306,9 +306,8 @@ public class ExportXMLApi {
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "");
return str.replace("-", "").replace(" ","").replace(":","");
}
/**
* 不够位数的在前面补0,保留code的长度位数字
* @param code
......
......@@ -69,12 +69,13 @@ public class InfoManagementApi {
}
/**
* 去除字符串中线
* 去除字符串中中线
*
* @param str
* @return
*/
private String replaceDate(String str){
return str.replace("-","");
private String replaceDate(String str) {
return str.replace("-", "").replace(" ","").replace(":","");
}
}
......@@ -159,11 +159,11 @@ public class LogApi {
/**
* 去除字符串中中线
*
* @param str
* @return
*/
private String replaceDate(String str){
return str.replace("-","").replace(":","").replace(" ","");
private String replaceDate(String str) {
return str.replace("-", "").replace(" ","").replace(":","");
}
}
......@@ -113,12 +113,12 @@ public class MaterialManagementApi {
/**
* 去除字符串中中线
*
* @param str
* @return
*/
private String replaceDate(String str){
return str.replace("-","").replace(" ","");
private String replaceDate(String str) {
return str.replace("-", "").replace(" ","").replace(":","");
}
}
......@@ -195,11 +195,12 @@ public class PersonPostApi {
/**
* 去除字符串中中线
*
* @param str
* @return
*/
private String replaceDate(String str){
return str.replace("-","");
private String replaceDate(String str) {
return str.replace("-", "").replace(" ","").replace(":","");
}
/**
......
......@@ -203,18 +203,14 @@ public class ReadXmlApi {
return yxjsonResponse.toJSONString();
}
private String replaceDate(String str){
return str.replace("-","");
}
/**
* 字符串去除空格
* @param str 原始字符串
* @return 返回新的字符串
* 去除字符串中中线
*
* @param str
* @return
*/
private String replaceNullString(String str) {
if (str == ""){
return null;
} else return str;
private String replaceDate(String str) {
return str.replace("-", "").replace(" ","").replace(":","");
}
}
......@@ -351,8 +351,6 @@ public class ReceiptApi {
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "");
return str.replace("-", "").replace(" ","").replace(":","");
}
}
......@@ -101,9 +101,8 @@ public class ReportApi {
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "");
return str.replace("-", "").replace(" ","").replace(":","");
}
}
......@@ -425,8 +425,7 @@ public class TaskListApi {
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "");
return str.replace("-", "").replace(" ","").replace(":","");
}
}
......@@ -87,7 +87,7 @@ public class queryPreproPerson {
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "");
return str.replace("-", "").replace(" ","").replace(":","");
}
......
......@@ -186,7 +186,7 @@ public interface ReceiptMapper {
"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,'yyyyMMddhhmmss') BETWEEN ${startDate} and ${endDate} ")
" where to_char(CHECK_DATE,'yyyyMMddhhmmss') BETWEEN ${startDate} and ${endDate} and receipt_date is null ")
public List<Map<String,Object>> selectReceiptDateByCheckDate(@Param("startDate") String startDate,@Param("endDate") String endDate);
......@@ -208,7 +208,7 @@ public interface ReceiptMapper {
"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,'yyyyMMddhhmmss') BETWEEN ${startDate} and ${endDate} and RECEIPT_LIST.POLICE_CODE in (${string}) and CARD_TYPE_DIC.CARD_TYPE_ID=${type} ")
" where to_char(CHECK_DATE,'yyyyMMddhhmmss') BETWEEN ${startDate} and ${endDate} and RECEIPT_LIST.POLICE_CODE in (${string}) and CARD_TYPE_DIC.CARD_TYPE_ID=${type} and receipt_date is null ")
public List<Map<String,Object>> selectReceiptDate(@Param("startDate") String startDate,@Param("endDate") String endDate,@Param("string") String string,@Param("type") long type);
@Select("select DETAIL_RECEIPT_LIST.* , GAJG_DM.GAJG_MC from DETAIL_RECEIPT_LIST LEFT JOIN GAJG_DM ON GAJG_DM.GAJG_DM =DETAIL_RECEIPT_LIST.POLICE_CODE where ACCEPT_NO=#{acceptNo} or card_id=#{acceptNo}")
......@@ -226,7 +226,7 @@ public interface ReceiptMapper {
* @param type 制证类型
* @return
*/
@Update("update RECEIPT_LIST set IS_PRINT = 1,RECEIPT_DATE = sysdate where to_char(CHECK_DATE,'yyyyMMddhhmmss') BETWEEN ${startDate} and ${endDate} and RECEIPT_LIST.POLICE_CODE in (${string}) and CARD_TYPE_ID=${type}")
@Update("update RECEIPT_LIST set IS_PRINT = 1,RECEIPT_DATE = sysdate where to_char(CHECK_DATE,'yyyyMMddhhmmss') BETWEEN ${startDate} and ${endDate} and RECEIPT_LIST.POLICE_CODE in (${string}) and CARD_TYPE_ID=${type} and receipt_date is null")
public boolean updateReceiptDate(@Param("startDate") String startDate,@Param("endDate") String endDate,@Param("string") String string,@Param("type") long type);
@Select("select RECEIPT_LIST.POLICE_CODE,sum(RECEIPT_LIST.FINISH_COUNT),GAJG_DM.GAJG_MC from RECEIPT_LIST \n" +
......
......@@ -64,7 +64,7 @@ public interface ReceiptService {
public boolean updateDetail(String accept,String note);
public List<Map<String,Object>> selectReceiptList(List<String> stringList,String startDate,String endDate,long typeCode);
public Map<String, Object> selectReceiptList(List<String> stringList,String startDate,String endDate,long typeCode);
public Map<String,Object>selectDetailedData2(String id,String beginDate,String expireDate);
......
......@@ -4,9 +4,12 @@ import com.yxproject.start.entity.DetailReceiptListEntity;
import com.yxproject.start.entity.ReceiptListEntity;
import com.yxproject.start.mapper.ReceiptMapper;
import com.yxproject.start.service.ReceiptService;
import org.apache.xmlbeans.impl.jam.mutable.MPackage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.persistence.criteria.CriteriaBuilder;
import java.text.SimpleDateFormat;
import java.util.*;
@Service
......@@ -162,7 +165,7 @@ public class ReceiptServiceImpl implements ReceiptService {
}
@Override
public List<Map<String, Object>> selectReceiptList(List<String> stringList, String startDate,String endDate, long typeCode) {
public Map<String, Object> selectReceiptList(List<String> stringList, String startDate,String endDate, long typeCode) {
String str ="";
for (int i =0;i<stringList.size();i++){
if (i==stringList.size()-1){
......@@ -171,9 +174,27 @@ public class ReceiptServiceImpl implements ReceiptService {
str+="'"+stringList.get(i)+"',";
}
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
//更改交接单已打印状态
List<Map<String, Object>> mapList = receiptMapper.selectReceiptDate(startDate, endDate, str, typeCode);
Map<String,Object> map = new HashMap<>();
if ("null".equals(mapList.get(0).get("RECEIPT_DATE")+"")){
map.put("date",simpleDateFormat.format(new Date()));
}else {
map.put("date",mapList.get(0).get("RECEIPT_DATE"));
}
int total =0;
for (Map<String,Object> map2:mapList){
total+= Integer.valueOf(map2.get("FINISH_COUNT").toString());
}
map.put("list",mapList);
map.put("total",total);
boolean b = receiptMapper.updateReceiptDate(startDate,endDate, str, typeCode);
return receiptMapper.selectReceiptDate(startDate,endDate,str,typeCode);
// return receiptMapper.selectReceiptDate(startDate,endDate,str,typeCode);
return map;
}
@Override
......
......@@ -939,15 +939,28 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
success(response.data)
})
},
// printReceitpData:function(data,success) {
// var body = JSON.stringify(data);
// $http({
// method: 'POST',
// url: "../exportExcel/printReceiptExcelData",
// data: body,
// headers: {'Content-Type': 'application/json'},
// transformRequest: angular.identity,
// responseType:'arraybuffer'
// }).then(function successCallback(response) {
// success(response.data)
// })
// },
printReceitpData:function(data,success) {
var body = JSON.stringify(data);
$http({
method: 'POST',
url: "../exportExcel/printReceiptExcelData",
data: body,
headers: {'Content-Type': 'application/json'},
transformRequest: angular.identity,
responseType:'arraybuffer'
headers: {'Content-Type': 'application/json'}
// transformRequest: angular.identity,
// responseType:'arraybuffer'
}).then(function successCallback(response) {
success(response.data)
})
......
......@@ -135,12 +135,13 @@ angular.module('AvatarCheck.receitp', ['ngRoute', 'AvatarCheck.http'])
}
console.log(json)
HttpService.printReceitpData(json,function (data) {
var blob = new Blob([data], {type: "application/vnd.ms-excel"});
var a = document.createElement("a");
document.body.appendChild(a);
a.href = URL.createObjectURL(blob);
// a.download = fileName;
a.click();
console.log(data)
// var blob = new Blob([data], {type: "application/vnd.ms-excel"});
// var a = document.createElement("a");
// document.body.appendChild(a);
// a.href = URL.createObjectURL(blob);
// // a.download = fileName;
// a.click();
})
}
......
......@@ -3,11 +3,12 @@
<div class="row">
<!-- /.col -->
<div class="col-md-12">
<div class="box box-primary">
<div class="box box-primary" >
<div class="box-header">
<strong>膜打印数据报表</strong>
<strong ng-if="state==2">膜打印数据报表</strong>
<strong ng-if="state==3">工作组数据报表</strong>
<div class="box-tools pull-right">
<input type="text" style="height: 30px;margin-right: 10px;border-radius: 4px;background-color: #eee;cursor: not-allowed;border: 1px solid #ccc;" ng-model="choseDate1" id="datepicker1" readonly/> ——
<span>查询日期:</span><input type="text" style="height: 30px;margin-right: 10px;border-radius: 4px;background-color: #eee;cursor: not-allowed;border: 1px solid #ccc;" ng-model="choseDate1" id="datepicker1" readonly/> <span></span>
<input type="text" style="height: 30px;margin-right: 10px;border-radius: 4px;background-color: #eee;cursor: not-allowed;border: 1px solid #ccc;" ng-model="choseDate2" id="datepicker2" readonly/>
<button type="button" class="btn btn-primary pull-right" style="height: 30px;line-height: 17px;margin-left: 10px;" ng-click="searchReport()">查询</button>
</div>
......@@ -26,7 +27,8 @@
<table class="table table-hover postTable">
<thead>
<tr>
<th>打印日期</th>
<th ng-if="2">打印日期</th>
<th ng-if="3">预定位日期</th>
<th>大批证</th>
<th>邮寄证</th>
<th>军人证</th>
......@@ -48,21 +50,66 @@
<!-- /.table -->
</div>
<!-- /.table -->
<div class="box-footer" ng-if="receitpData.length>0">
<div class="pull-right" style="margin-left: 10px;">
<button class="btn btn-primary" ng-click="printReceitp(type.typeCode)">打印交接单</button>
<button class="btn btn-primary" ng-click="downloadGAinfo()">下载公安网反馈信息</button>
</div>
</div>
</div>
</div>
<div ng-if="receitpData.length==0">
<h4>暂无数据</h4>
</div>
<!-- /.mail-box-messages -->
</div>
<!-- /.box-body -->
</div>
<!--<div class="box box-primary" >-->
<!--<div class="box-header">-->
<!--<strong>工作组数据报表</strong>-->
<!--<div class="box-tools pull-right">-->
<!--<span>查询日期:</span><input type="text" style="height: 30px;margin-right: 10px;border-radius: 4px;background-color: #eee;cursor: not-allowed;border: 1px solid #ccc;" ng-model="choseDate1" id="datepicker1" readonly/> <span>至</span>-->
<!--<input type="text" style="height: 30px;margin-right: 10px;border-radius: 4px;background-color: #eee;cursor: not-allowed;border: 1px solid #ccc;" ng-model="choseDate2" id="datepicker2" readonly/>-->
<!--<button type="button" class="btn btn-primary pull-right" style="height: 30px;line-height: 17px;margin-left: 10px;" ng-click="searchReport()">查询</button>-->
<!--</div>-->
<!--&lt;!&ndash; /.box-tools &ndash;&gt;-->
<!--</div>-->
<!--&lt;!&ndash; /.box-header &ndash;&gt;-->
<!--<div class="box-body">-->
<!--<div ng-if="reportData.length==1">-->
<!--<h4>暂无数据</h4>-->
<!--</div>-->
<!--<div ng-if="reportData.length>1">-->
<!--<div class="table-responsive mailbox-messages" >-->
<!--<div class="mailbox-messages">-->
<!--<table class="table table-hover postTable">-->
<!--<thead>-->
<!--<tr>-->
<!--<th>打印日期</th>-->
<!--<th>大批证</th>-->
<!--<th>邮寄证</th>-->
<!--<th>军人证</th>-->
<!--<th>快证</th>-->
<!--<th>废证</th>-->
<!--</tr>-->
<!--</thead>-->
<!--<tbody ng-repeat="item in reportData">-->
<!--<tr style="background-color: #eee">-->
<!--<td>{{item.date}}</td>-->
<!--<td style="color: #3c8dbc">{{item.pu}}</td>-->
<!--<td>{{item.you}}</td>-->
<!--<td>{{item.jun}}</td>-->
<!--<td>{{item.kuai}}</td>-->
<!--<td>{{item.fei}}</td>-->
<!--</tr>-->
<!--</tbody>-->
<!--</table>-->
<!--&lt;!&ndash; /.table &ndash;&gt;-->
<!--</div>-->
<!--&lt;!&ndash; /.table &ndash;&gt;-->
<!--</div>-->
<!--</div>-->
<!--&lt;!&ndash; /.mail-box-messages &ndash;&gt;-->
<!--</div>-->
<!--&lt;!&ndash; /.box-body &ndash;&gt;-->
<!--</div>-->
<!-- /. box -->
</div>
<!-- /.col -->
......
......@@ -10,7 +10,7 @@ angular.module('AvatarCheck.report', ['ngRoute', 'AvatarCheck.http'])
}])
.controller('reportCtrl', function ($scope, $rootScope, $timeout, HttpService, ngDialog, MessageService, $filter) {
$scope.state = 3;
//Date picker
$('#datepicker1').datetimepicker({
minView: "month", //选择日期后,不会再跳转去选择时分秒
......@@ -26,30 +26,9 @@ angular.module('AvatarCheck.report', ['ngRoute', 'AvatarCheck.http'])
todayBtn: 1,
autoclose: 1
});
$scope.choseDate1 = $filter("date")(new Date(), "yyyy-MM-dd");
$scope.choseDate2 = $filter("date")(new Date(), "yyyy-MM-dd");
// $scope.downloadGAinfo = function(){
// var date = $("#datepicker1").val();
// var url = "../exportExcel/printExcelData?date="+date;
// var a = document.createElement("a");
// document.body.appendChild(a);
// a.href = encodeURI(url);
// a.click();
// }
//
// $scope.currentTab = 0;
// $scope.func = function (index) {
// for (var idx in $scope.cycleSheetData) {
// if (index == idx) {
// $scope.cycleSheetData[idx].isActive = true;
// } else {
// $scope.cycleSheetData[idx].isActive = false;
// }
// }
// $scope.currentTab = index;
// }
$scope.searchReport = function () {
var date1=$('#datepicker1').val();
......@@ -61,46 +40,10 @@ angular.module('AvatarCheck.report', ['ngRoute', 'AvatarCheck.http'])
date2= $filter("date")(new Date(), "yyyy-MM-dd");
}
HttpService.getReport(date1,date2,function(data){
console.log(data,"------------------------")
$scope.reportData=data;
})
}
$scope.searchReport();
// $scope.checkAll = function ($event){
// var checkAll = $event.target;
// var checkbox =$("input[type=checkbox]");
// for (var i=0;i<checkbox.length;i++){
// if(checkAll.checked) {
// checkbox[i].checked = true;
// }else {
// checkbox[i].checked = false;
// }
// }
// }
//
// $scope.printReceitp = function(typeCode) {
// var date = $('#datepicker1').val();
// var json={
// type:typeCode,
// date:date,
// list:[]
// }
// var checks = $(".checkAllPolice:checked")
// for (var i=0;i<checks.length;i++){
// for(var j=0;j<JSON.parse(checks[i].value).length;j++){
// json.list.push(JSON.parse(checks[i].value)[j].POLICE_CODE)
// }
// }
// console.log(json)
// HttpService.printReceitpData(json,function (data) {
// var blob = new Blob([data], {type: "application/vnd.ms-excel"});
// var a = document.createElement("a");
// document.body.appendChild(a);
// a.href = URL.createObjectURL(blob);
// // a.download = fileName;
// a.click();
// })
// }
});
\ No newline at end of file
......@@ -79,7 +79,7 @@
<tr ng-repeat="item in policeList">
<td>{{item.GROUP_NO}}</td>
<td>{{item.GAJG_MC}}</td>
<td>{{item.VALID_COUNT-item.SPECIAL_CARD_COUNT}}</td>
<td>{{item.VALID_COUNT-item.SPECIAL_CARD_COUNT-item.FAILECOUNT}}</td>
<td>{{item.E_WRITER_COUNT}}</td>
<td>{{item.CHECK_COUNT}}</td>
<td>{{item.SPECIAL_CARD_COUNT}}</td>
......
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