Commit b933e36e authored by dahai's avatar dahai

修改查询生成交接单数据

parent b5dd5406
......@@ -211,6 +211,25 @@ public class DeliveredApi {
return mapList;
}
/**
* 库房确认接收妥投失败证件
* @param json 妥投失败证件号
* @return
*/
@RequestMapping("acceptDeliveredFailed")
// @RequiresPermissions("userInfo.add")//权限管理;
public boolean acceptDeliveredFailed(@RequestBody String json) {
JSONObject jsonObject = JSONObject.fromObject(json);
JSONArray jsonArray = (JSONArray) jsonObject.get("cardIdList");
List<String> list = (List<String>) jsonArray;
for (String cardId:list){
//todo 确认接收妥投失败证件
}
return true;
}
/**
* 删除导入妥投信息
......
......@@ -68,7 +68,7 @@ public class ExportExcelApi {
String startDate = jsonObject.get("startDate").toString();
String endDate = jsonObject.get("endDate").toString();
String type = jsonObject.get("type").toString();
Map<String, Object> map = receiptService.selectReceiptList(jsonArray, replaceDate(startDate),replaceDate(endDate), Long.valueOf(type));
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");
......@@ -113,7 +113,7 @@ public class ExportExcelApi {
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "").replace(" ","").replace(":","");
return str.replace("-", "").replace(" ", "").replace(":", "");
}
......
......@@ -46,92 +46,92 @@ public class ExportXMLApi {
*/
@RequestMapping("printXmlData")
// @RequiresPermissions("userInfo.add")//权限管理;
public byte[] printXmlData(@RequestParam("uploadNo") String uploadNo, @RequestParam("IDCard")String IDCard,@RequestParam("oldFile") String oldFile, @RequestParam("newFile")String newFile, @RequestParam("SSXQDM")String SSXQDM, @RequestParam("cardType")String cardType, @RequestParam("state")String state, @RequestParam("uploadDate")String uploadDate, @RequestParam("downloadState")String downloadState,HttpServletResponse response) {
public byte[] printXmlData(@RequestParam("uploadNo") String uploadNo, @RequestParam("IDCard") String IDCard, @RequestParam("oldFile") String oldFile, @RequestParam("newFile") String newFile, @RequestParam("SSXQDM") String SSXQDM, @RequestParam("cardType") String cardType, @RequestParam("state") String state, @RequestParam("uploadDate") String uploadDate, @RequestParam("downloadState") String downloadState, HttpServletResponse response) {
//使用Servlet实现文件下载的时候,避免浏览器自动打开文件
List<PreproPersonEntity> preproPersonEntities = preproPersonService.selectAllPreproPerson(uploadNo, IDCard, oldFile, newFile, SSXQDM, cardType, state, replaceDate(uploadDate),downloadState);
List<PreproPersonEntity> preproPersonEntities = preproPersonService.selectAllPreproPerson(uploadNo, IDCard, oldFile, newFile, SSXQDM, cardType, state, replaceDate(uploadDate), downloadState);
// List<PreproPersonEntity> preproPersonEntities = preproPersonService.selectAllPreproPerson(uploadNo, IDCard, oldFile, newFile, SSXQDM, cardType, state, replaceDate(uploadDate));
if (preproPersonEntities.size()>0){
if (preproPersonEntities.size() > 0) {
//将制证详情详细划分
Map<Long,Object> map = new LinkedHashMap<>();
for (PreproPersonEntity preproPersonEntity:preproPersonEntities){
if (map!=null&&map.containsKey(preproPersonEntity.getCardTypeId())){
List<PreproPersonEntity> preproPersonEntityList = (List<PreproPersonEntity>)map.get(preproPersonEntity.getCardTypeId());
Map<Long, Object> map = new LinkedHashMap<>();
for (PreproPersonEntity preproPersonEntity : preproPersonEntities) {
if (map != null && map.containsKey(preproPersonEntity.getCardTypeId())) {
List<PreproPersonEntity> preproPersonEntityList = (List<PreproPersonEntity>) map.get(preproPersonEntity.getCardTypeId());
preproPersonEntityList.add(preproPersonEntity);
map.put(preproPersonEntity.getCardTypeId(),preproPersonEntityList);
}else {
List<PreproPersonEntity> preproPersonEntityList =new ArrayList<>();
map.put(preproPersonEntity.getCardTypeId(), preproPersonEntityList);
} else {
List<PreproPersonEntity> preproPersonEntityList = new ArrayList<>();
preproPersonEntityList.add(preproPersonEntity);
map.put(preproPersonEntity.getCardTypeId(),preproPersonEntityList);
map.put(preproPersonEntity.getCardTypeId(), preproPersonEntityList);
}
}
List<List<Map<Long,Object>>> lists = new ArrayList<>();
for (Long cardTypeId :map.keySet()){
List<List<Map<Long, Object>>> lists = new ArrayList<>();
for (Long cardTypeId : map.keySet()) {
//区分邮寄证和大批证件类型
//大批证
if (cardTypeId==0){
if (cardTypeId == 0) {
List list = new ArrayList();
List<PreproPersonEntity> preproPersonEntityList =(List<PreproPersonEntity>)map.get(cardTypeId);
Map<Long,Object> mapFileId = new LinkedHashMap<>();
for (PreproPersonEntity preproPersonEntity:preproPersonEntityList){
if (mapFileId!=null&&mapFileId.containsKey(preproPersonEntity.getFileId())){
List<PreproPersonEntity> preproPersonEntityListFileId = (List<PreproPersonEntity>)mapFileId.get(preproPersonEntity.getFileId());
List<PreproPersonEntity> preproPersonEntityList = (List<PreproPersonEntity>) map.get(cardTypeId);
Map<Long, Object> mapFileId = new LinkedHashMap<>();
for (PreproPersonEntity preproPersonEntity : preproPersonEntityList) {
if (mapFileId != null && mapFileId.containsKey(preproPersonEntity.getFileId())) {
List<PreproPersonEntity> preproPersonEntityListFileId = (List<PreproPersonEntity>) mapFileId.get(preproPersonEntity.getFileId());
preproPersonEntityListFileId.add(preproPersonEntity);
mapFileId.put(preproPersonEntity.getFileId(),preproPersonEntityListFileId);
}else {
List<PreproPersonEntity> preproPersonEntityListFileId =new ArrayList<>();
mapFileId.put(preproPersonEntity.getFileId(), preproPersonEntityListFileId);
} else {
List<PreproPersonEntity> preproPersonEntityListFileId = new ArrayList<>();
preproPersonEntityListFileId.add(preproPersonEntity);
mapFileId.put(preproPersonEntity.getFileId(),preproPersonEntityListFileId);
mapFileId.put(preproPersonEntity.getFileId(), preproPersonEntityListFileId);
}
}
list.add(mapFileId);
lists.add(list);
}else {
} else {
//邮寄证
List list = new ArrayList();
List<PreproPersonEntity> preproPersonEntityList =(List<PreproPersonEntity>)map.get(cardTypeId);
Map<Long,Object> mapFileId = new LinkedHashMap<>();
mapFileId.put((long)1,preproPersonEntityList);
List<PreproPersonEntity> preproPersonEntityList = (List<PreproPersonEntity>) map.get(cardTypeId);
Map<Long, Object> mapFileId = new LinkedHashMap<>();
mapFileId.put((long) 1, preproPersonEntityList);
list.add(mapFileId);
lists.add(list);
}
}
List<String> documentList = new ArrayList<>();
//执行生成XML文件方法
for(List<Map<Long,Object>> mapList :lists){
for (Map<Long,Object> objectMap :mapList){
for (Long fileId :objectMap.keySet()){
List<PreproPersonEntity> preproPersonEntityList =(List<PreproPersonEntity>)objectMap.get(fileId);
int i =0;
for (List<Map<Long, Object>> mapList : lists) {
for (Map<Long, Object> objectMap : mapList) {
for (Long fileId : objectMap.keySet()) {
List<PreproPersonEntity> preproPersonEntityList = (List<PreproPersonEntity>) objectMap.get(fileId);
int i = 0;
List<List> listList = new ArrayList<>();
List list = new ArrayList();
for (int a= 0;a<preproPersonEntityList.size();a++){
for (int a = 0; a < preproPersonEntityList.size(); a++) {
PreproPersonEntity preproPersonEntity = preproPersonEntityList.get(a);
list.add(preproPersonEntity);
i++;
if (i<80){
if (i < 80) {
}else {
} else {
listList.add(list);
list = new ArrayList();
i=0;
i = 0;
}
if (list.size()>0&&a==preproPersonEntityList.size()-1){
if (list.size() > 0 && a == preproPersonEntityList.size() - 1) {
listList.add(list);
}
}
for (List list1 :listList) {
List<PreproPersonEntity> preproPersonEntityList1 = (List<PreproPersonEntity>)list1;
for (List list1 : listList) {
List<PreproPersonEntity> preproPersonEntityList1 = (List<PreproPersonEntity>) list1;
List<FilesEntity> filesEntities = filesService.selectFilesEntityById(preproPersonEntityList1.get(0).getFileId().toString());
FilesEntity filesEntity = new FilesEntity();
if(preproPersonEntityList1.get(0).getCardTypeId()==9){
if (preproPersonEntityList1.get(0).getCardTypeId() == 9) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
filesEntity.setVersionCode("3.00");
filesEntity.setCreateTime(simpleDateFormat.format(new Date()));
filesEntity.setDwmc("北京市公安局人口管理总队证件管理大队");
filesEntity.setDwdm("110001580800");
}else {
filesEntity =filesEntities.get(0);
} else {
filesEntity = filesEntities.get(0);
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
......@@ -150,7 +150,7 @@ public class ExportXMLApi {
// -----制证包数据打包下载
String zipName = "myfile.zip";
response.setContentType("APPLICATION/OCTET-STREAM");
response.setHeader("Content-Disposition","attachment; filename="+zipName);
response.setHeader("Content-Disposition", "attachment; filename=" + zipName);
ZipOutputStream out = null;
try {
out = new ZipOutputStream(response.getOutputStream());
......@@ -158,13 +158,13 @@ public class ExportXMLApi {
e.printStackTrace();
}
try {
for(String document :documentList){
for (String document : documentList) {
ZipUtils.doCompress(document, out);
response.flushBuffer();
}
} catch (Exception e) {
e.printStackTrace();
}finally{
} finally {
try {
out.close();
} catch (IOException e) {
......@@ -183,7 +183,7 @@ public class ExportXMLApi {
*
* @throws IOException 可能出现文件写入不成功
*/
private String createToMakePackageXML(List<PreproPersonEntity> preproPersonEntities , FilesEntity filesEntity, String url) throws IOException {
private String createToMakePackageXML(List<PreproPersonEntity> preproPersonEntities, FilesEntity filesEntity, String url) throws IOException {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyyMMddhhmmss");
Document document = DocumentHelper.createDocument();
......@@ -198,7 +198,7 @@ public class ExportXMLApi {
Element DWMC = PACKAGEHEAD.addElement("DWMC");
DWMC.setText(filesEntity.getDwmc());
Element JLS = PACKAGEHEAD.addElement("JLS");
JLS.setText(preproPersonEntities.size()+"");
JLS.setText(preproPersonEntities.size() + "");
Element SCSJ = PACKAGEHEAD.addElement("SCSJ");
SCSJ.setText(simpleDateFormat2.format(new Date()));
NewFilesEntity newFilesEntity = new NewFilesEntity();
......@@ -206,19 +206,19 @@ public class ExportXMLApi {
newFilesEntity.setDwdm(filesEntity.getDwdm());
newFilesEntity.setDwmc(filesEntity.getDwmc());
newFilesEntity.setVersionCode(filesEntity.getVersionCode());
newFilesEntity.setRecordNumber((long)preproPersonEntities.size());
newFilesEntity.setRecordNumber((long) preproPersonEntities.size());
long l = newFilesService.saveNewFiles(newFilesEntity);
String files_seq =autoGenericCode(newFilesEntity.getId()+"",4) ;
newFilesEntity.setNewFileName("ZAGL_ZZJH_"+filesEntity.getDwdm()+simpleDateFormat.format(new Date())+preproPersonEntities.get(0).getCardTypeId()+files_seq);
String files_seq = autoGenericCode(newFilesEntity.getId() + "", 4);
newFilesEntity.setNewFileName("ZAGL_ZZJH_" + filesEntity.getDwdm() + simpleDateFormat.format(new Date()) + preproPersonEntities.get(0).getCardTypeId() + files_seq);
newFilesService.updateNewFileName(newFilesEntity);
Element SJBBH=PACKAGEHEAD.addElement("SJBBH");
SJBBH.setText(filesEntity.getDwdm()+simpleDateFormat.format(new Date())+preproPersonEntities.get(0).getCardTypeId()+files_seq);
int NO=1;
long cardType =0;
Element SJBBH = PACKAGEHEAD.addElement("SJBBH");
SJBBH.setText(filesEntity.getDwdm() + simpleDateFormat.format(new Date()) + preproPersonEntities.get(0).getCardTypeId() + files_seq);
int NO = 1;
long cardType = 0;
for (PreproPersonEntity preproPersonEntity : preproPersonEntities) {
Element RECORD = DATA.addElement("RECORD");
RECORD.addAttribute("no", NO+"");
RECORD.addAttribute("no", NO + "");
RECORD.addAttribute("sid", preproPersonEntity.getSid());
Element JMSFZSLH = RECORD.addElement("JMSFZSLH");
JMSFZSLH.setText(preproPersonEntity.getJmsfzslh());
......@@ -272,7 +272,7 @@ public class ExportXMLApi {
}
preproPersonService.updatePreproPerson_NewFileName(preproPersonEntities);
try {
FileOutputStream fos = new FileOutputStream("D:\\XML\\"+"ZAGL_ZZJH_"+filesEntity.getDwdm() + simpleDateFormat.format(new Date())+cardType+files_seq+ ".xml");
FileOutputStream fos = new FileOutputStream("D:\\XML\\" + "ZAGL_ZZJH_" + filesEntity.getDwdm() + simpleDateFormat.format(new Date()) + cardType + files_seq + ".xml");
OutputStreamWriter osw = new OutputStreamWriter(fos, "UTF-8");
OutputFormat of = new OutputFormat();
of.setEncoding("UTF-8");
......@@ -286,11 +286,12 @@ public class ExportXMLApi {
e.printStackTrace();
}
System.out.println("XML文件生成成功..." + new Date());
return "D:\\XML\\" +"ZAGL_ZZJH_"+filesEntity.getDwdm()+ simpleDateFormat.format(new Date())+cardType+files_seq+ ".xml";
return "D:\\XML\\" + "ZAGL_ZZJH_" + filesEntity.getDwdm() + simpleDateFormat.format(new Date()) + cardType + files_seq + ".xml";
}
/**
* 字符串去除空格
*
* @param str 原始字符串
* @return 返回新的字符串
*/
......@@ -306,10 +307,12 @@ public class ExportXMLApi {
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "").replace(" ","").replace(":","");
return str.replace("-", "").replace(" ", "").replace(":", "");
}
/**
* 不够位数的在前面补0,保留code的长度位数字
*
* @param code
* @return
*/
......
......@@ -85,7 +85,7 @@ public class FailedCardApi {
idMap = failedCardService.selectCountIdByCardId(jsonObject.getString("cardId"));
}
int initiator = 5;
failedCardService.insertFailedCard(jsonObject.getString("failedCardReasonId"), idMap.get("ACCEPT_NO").toString(), idMap.get("TASK_ID").toString(), String.valueOf(initiator), jsonObject.getString("note"),idMap.get("WORK_GROUP").toString());
failedCardService.insertFailedCard(jsonObject.getString("failedCardReasonId"), idMap.get("ACCEPT_NO").toString(), idMap.get("TASK_ID").toString(), String.valueOf(initiator), jsonObject.getString("note"), idMap.get("WORK_GROUP").toString());
}
return true;
}
......@@ -96,7 +96,6 @@ public class FailedCardApi {
* @param jsonStr
* @return
*/
//TODO 多张余证可以生成一张任务单 判断是否是同一个countyCode
@RequestMapping("insertRemaining")
@Transactional(rollbackFor = Exception.class)
public Boolean insertRemaining(@RequestBody String jsonStr) {
......@@ -115,10 +114,10 @@ public class FailedCardApi {
taskEntity.setCardType(cardType);
taskEntity.setTaskStateId((long) 1);
taskEntity.setSubmitName(name);
if ("null".equals(resultMap.get("WORK_GROUP")+"")){
if ("null".equals(resultMap.get("WORK_GROUP") + "")) {
}else {
taskEntity.setWorkGroup(Long.valueOf(resultMap.get("WORK_GROUP")+""));
} else {
taskEntity.setWorkGroup(Long.valueOf(resultMap.get("WORK_GROUP") + ""));
}
/*特证数+1*/
failedCardService.specialCardAdd(acceptNo);
......
......@@ -229,7 +229,7 @@ public interface ReceiptMapper {
@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" +
@Select("select RECEIPT_LIST.POLICE_CODE,sum(RECEIPT_LIST.FINISH_COUNT) FINISH_COUNT,GAJG_DM.GAJG_MC from RECEIPT_LIST \n" +
"left join GAJG_DM on GAJG_DM.GAJG_DM = RECEIPT_LIST.POLICE_CODE\n" +
"where CHECK_NAME = #{name} and to_char(CHECK_DATE,'yyyyMMdd') BETWEEN #{startDate} and #{endDate} \n" +
"group by RECEIPT_LIST.POLICE_CODE, GAJG_DM.GAJG_MC")
......
......@@ -184,5 +184,6 @@
<script src="views/tagPrint/tagPrint.js"></script>
<script src="views/addTag/addTag.js"></script>
<script src="views/autoCheck/autoCheck.js"></script>
<script src="views/materialManagement/materialManagement.js"></script>
</body>
</html>
\ No newline at end of file
......@@ -24,6 +24,7 @@ angular.module('AvatarCheck', [
'AvatarCheck.analysisLog',
'AvatarCheck.packageLog',
'AvatarCheck.tagPrint',
'AvatarCheck.materialManagement',
'tm.pagination',
'AvatarCheck.addTag',
'AvatarCheck.autoCheck'
......@@ -155,6 +156,9 @@ angular.module('AvatarCheck', [
if($location.path()=="/autoCheck"){
$rootScope.tab = '/autoCheck';
}
if($location.path()=="/materialManagement"){
$rootScope.tab = '/materialManagement';
}
......
<div class="content row">
<div class="col-md-12" style="margin-top:20px;">
<div class="row">
<!-- /.col -->
<div class="col-md-12">
<div class="box box-primary" >
<div class="box-header">
<strong ng-if="state==2">膜打印数据报表</strong>
<strong ng-if="state==3">耗材管理</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>
<!-- /.box-tools -->
</div>
<!-- /.box-header -->
<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 ng-if="2">打印日期</th>
<th ng-if="3">预定位日期</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>
<!-- /.table -->
</div>
<!-- /.table -->
</div>
</div>
<!-- /.mail-box-messages -->
</div>
<!-- /.box-body -->
</div>
<!-- /. box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</div>
</div>
'use strict';
angular.module('AvatarCheck.materialManagement', ['ngRoute', 'AvatarCheck.http'])
.config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/materialManagement', {
templateUrl: 'views/materialManagement/materialManagement.html' + urlTimeStamp(),
controller: 'materialManagementCtrl',
cache: false
});
}])
.controller('materialManagementCtrl', function ($scope, $rootScope, $timeout, HttpService, ngDialog, MessageService, $filter) {
$scope.state = 3;
//Date picker
$('#datepicker1').datetimepicker({
minView: "month", //选择日期后,不会再跳转去选择时分秒
language: 'zh-CN',
format: 'yyyy-mm-dd',
todayBtn: 1,
autoclose: 1
});
$('#datepicker2').datetimepicker({
minView: "month", //选择日期后,不会再跳转去选择时分秒
language: 'zh-CN',
format: 'yyyy-mm-dd',
todayBtn: 1,
autoclose: 1
});
$scope.choseDate1 = $filter("date")(new Date(), "yyyy-MM-dd");
$scope.choseDate2 = $filter("date")(new Date(), "yyyy-MM-dd");
$scope.searchReport = function () {
var date1=$('#datepicker1').val();
var date2=$('#datepicker2').val();
if(date1==''){
date1= $filter("date")(new Date(), "yyyy-MM-dd");
}
if(date2==''){
date2= $filter("date")(new Date(), "yyyy-MM-dd");
}
HttpService.getReport(date1,date2,function(data){
$scope.reportData=data;
})
}
$scope.searchReport();
});
\ 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