Commit 2a19af74 authored by wuzhilong's avatar wuzhilong

GAT数据导出

parent 53c1411c
......@@ -771,12 +771,12 @@ public class ReceiptApi {
* @return
*/
@RequestMapping("queryPoliceDataByDownLoadDate")
public List<Map<String, Object>> queryPoliceDataByDownLoadDate(@RequestParam("startDate") String startDate,@RequestParam("endDate") String endDate, HttpServletRequest requ) {
public List<Map<String, Object>> queryPoliceDataByDownLoadDate(@RequestParam("startDate") String startDate,@RequestParam("endDate") String endDate,@RequestParam("gat") String gat, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List <Map <String, Object>> policeData = new ArrayList <>();
try {
policeData = receiptService.selectPoliceDataByDownLoadDate(replaceDate(startDate), replaceDate(endDate));
policeData = receiptService.selectPoliceDataByDownLoadDate(replaceDate(startDate), replaceDate(endDate),gat);
}catch (Exception e) {
logger.error("开始时间:" + startDate + "结束时间:" + endDate);
logger.error("Exception 查询公安网数据(历史)异常", e);
......
......@@ -22,7 +22,8 @@ public interface DetailReceiptListMapper {
*/
@Select("select DETAIL_RECEIPT_LIST.id,DETAIL_RECEIPT_LIST.ACCEPT_NO,DETAIL_RECEIPT_LIST.SIGN_GOVT,DETAIL_RECEIPT_LIST.NAME,DETAIL_RECEIPT_LIST.UPLOAD_NO,\n" +
"DETAIL_RECEIPT_LIST.sex,DETAIL_RECEIPT_LIST.CARD_ID,DETAIL_RECEIPT_LIST.POLICE_CODE,DIC_UPLOAD_UNIT_T.UNIT_NAME POLICE_NAME,to_char(RECEIPT_LIST.CHECK_DATE,'yyyyMMdd') CHECK_DATE,\n" +
"RECEIPT_LIST.CHECK_NAME,RECEIPT_LIST.CARD_TYPE_ID,RECEIPT_LIST.OLD_CARD_TYPE_ID,PERSON_POST.WAYBILL_NUMBER,DETAIL_RECEIPT_LIST.note,RECEIPT_LIST.QR_CODE,DETAIL_RECEIPT_LIST.APPLY_PHONE \n" +
"RECEIPT_LIST.CHECK_NAME,RECEIPT_LIST.CARD_TYPE_ID,RECEIPT_LIST.OLD_CARD_TYPE_ID,PERSON_POST.WAYBILL_NUMBER,DETAIL_RECEIPT_LIST.note,RECEIPT_LIST.QR_CODE,DETAIL_RECEIPT_LIST.APPLY_PHONE," +
"DETAIL_RECEIPT_LIST.ADDRESS,DETAIL_RECEIPT_LIST.GAT_ID \n" +
"from DETAIL_RECEIPT_LIST \n" +
"left join RECEIPT_LIST on DETAIL_RECEIPT_LIST.RECEIPT_ID = RECEIPT_LIST.ID\n" +
"left join PERSON_POST on PERSON_POST.FIRST_WHITE = DETAIL_RECEIPT_LIST.UPLOAD_NO\n" +
......
......@@ -331,14 +331,17 @@ public interface ReceiptMapper {
"where DOWNLOAD_DATE is null and to_char(receipt_date,'yyyyMMdd') BETWEEN #{startDate} and #{endDate} order by receipt_date")
public List<Map<String, Object>> selectPoliceData(@Param("startDate") String startDate,@Param("endDate") String endDate);
@Select("select RECEIPT_LIST.id,QR_CODE,to_char(DOWNLOAD_DATE,'yyyyMMddHH24') receipt_date ,\n" +
@Select("<script> select RECEIPT_LIST.id,QR_CODE,to_char(DOWNLOAD_DATE,'yyyyMMddHH24') receipt_date ,\n" +
"POLICE_CODE,FINISH_COUNT,RECEIPT_LIST.CARD_TYPE_ID,DIC_UPLOAD_UNIT_T.UNIT_NAME GAJG_MC,CARD_TYPE_DIC.CARD_TYPE\n" +
"from RECEIPT_LIST \n" +
"left join PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK on DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO = RECEIPT_LIST.POLICE_CODE\n" +
"left join CARD_TYPE_DIC on RECEIPT_LIST.CARD_TYPE_ID = CARD_TYPE_DIC.CARD_TYPE_ID\n" +
"where to_char(DOWNLOAD_DATE,'yyyyMMdd') BETWEEN #{startDate} and #{endDate}" +
" order by receipt_date")
public List<Map<String, Object>> selectPoliceDataByDownLoadDate(@Param("startDate") String startDate,@Param("endDate") String endDate);
"where to_char(DOWNLOAD_DATE,'yyyyMMdd') BETWEEN #{startDate} and #{endDate} " +
"<if test = 'gat !=\"\"'> " +
"AND RECEIPT_LIST.CARD_TYPE_ID in (5,7) " +
" </if>" +
" order by receipt_date </script> ")
public List<Map<String, Object>> selectPoliceDataByDownLoadDate(@Param("startDate") String startDate,@Param("endDate") String endDate,@Param("gat") String gat);
@Select("<script> select * from DETAIL_RECEIPT_LIST " +
"where to_char(SUBMIT_DATE,'yyyyMMdd') between #{startDate} and #{endDate} " +
......@@ -402,6 +405,20 @@ public interface ReceiptMapper {
"and cardT.ACCEPT_NO like #{groupNo}")
public boolean createDetailReceiptList(@Param("receiptId")String receiptId,@Param("groupNo")String groupNo,@Param("policeCode")String policeCode);
//生成交接单详单——港澳台
@Insert("INSERT INTO DETAIL_RECEIPT_LIST(UPLOAD_NO,accept_no,name,POLICE_CODE,card_id,SIGN_GOVT,RECEIPT_ID,SEX,APPLY_PHONE,GAT_ID,ADDRESS)\n" +
"select cardT.UPLOAD_NO,cardT.ACCEPT_NO,cardT.NAME,#{policeCode},cardT.ID_NO,cardT.SIGN_GOVT,#{receiptId},cardT.SEX_NO,applyInfo.APPLY_PHONE," +
"cardT.CARD_NO,cardT.ADDR1||cardT.ADDR2||cardT.ADDR3\n" +
"from PRODYD_DBA.prod_card_t@PRODYD_LINK cardT " +
"LEFT JOIN PRODYD_DBA.PROD_APPLY_INFO_T@PRODYD_LINK applyInfo \n" +
"ON applyInfo.ACCEPT_NO = cardT.ACCEPT_NO\n" +
"where cardT.ACCEPT_NO not in \n" +
"(select ACCEPT_NO from SPECIAL_CARD \n" +
"where GROUP_NO like #{groupNo} " +
" AND SPECIAL_TYPE<> 1 ) \n" +
"and cardT.ACCEPT_NO like #{groupNo}")
public boolean createDetailReceiptList_GAT(@Param("receiptId")String receiptId,@Param("groupNo")String groupNo,@Param("policeCode")String policeCode);
//查询历史交接单详单是否存在
@Select("select detail_receipt_list.UPLOAD_NO,detail_receipt_list.ACCEPT_NO,detail_receipt_list.NAME,\n" +
"detail_receipt_list.POLICE_CODE,detail_receipt_list.CARD_ID ,detail_receipt_list.NOTE,\n" +
......
......@@ -90,7 +90,7 @@ public interface ReceiptService {
public List<Map<String,Object>> selectPoliceData(String startDate,String endDate);
public List<Map<String,Object>> selectPoliceDataByDownLoadDate(String startDate,String endDate);
public List<Map<String,Object>> selectPoliceDataByDownLoadDate(String startDate,String endDate,String gat);
public List<Map<String,Object>> selectQrCodeByCardID(String id,String beginDate,String expireDate);
......
......@@ -329,8 +329,8 @@ public class ReceiptServiceImpl implements ReceiptService {
}
@Override
public List<Map<String, Object>> selectPoliceDataByDownLoadDate(String startDate, String endDate) {
List<Map<String, Object>> list = receiptMapper.selectPoliceDataByDownLoadDate(startDate, endDate);
public List<Map<String, Object>> selectPoliceDataByDownLoadDate(String startDate, String endDate,String gat) {
List<Map<String, Object>> list = receiptMapper.selectPoliceDataByDownLoadDate(startDate, endDate,gat);
Map<String, Object> dateMap= new LinkedHashMap<>();
for (Map<String, Object> map :list){
if (dateMap.containsKey(map.get("RECEIPT_DATE")+"")){
......@@ -511,7 +511,12 @@ public class ReceiptServiceImpl implements ReceiptService {
};
@Override
public boolean createDetailReceiptList(String receiptId,String groupNo,String policeCode) {
receiptMapper.createDetailReceiptList(receiptId,groupNo,policeCode);
if (groupNo.substring(0,1).equals("E")){
receiptMapper.createDetailReceiptList(receiptId,groupNo,policeCode);
}else {
receiptMapper.createDetailReceiptList_GAT(receiptId,groupNo,policeCode);
}
return true;
}
private String createGroupNoMiss(List<String> c, List<String> nsList) {
......
......@@ -48,6 +48,8 @@ public class ExportExcel {
sheet.setColumnWidth(13, 30 * 110);
sheet.setColumnWidth(14, 30 * 110);
sheet.setColumnWidth(15, 30 * 110);
sheet.setColumnWidth(16, 40 * 110);
sheet.setColumnWidth(17, 80 * 110);
//第三步创建行row:添加表头0行
HSSFRow row = sheet.createRow(0);
HSSFCellStyle style = wb.createCellStyle();//样式
......@@ -89,6 +91,10 @@ public class ExportExcel {
cell.setCellValue("备注");
cell = row.createCell(15); //设定值
cell.setCellValue("联系方式");
cell = row.createCell(16); //设定值
cell.setCellValue("通行证号码");
cell = row.createCell(17); //设定值
cell.setCellValue("住址");
for (int i =0;i<mapList.size();i++){
row = sheet.createRow(i + 1);
......@@ -124,6 +130,10 @@ public class ExportExcel {
cell.setCellValue("null".equals(mapList.get(i).get("NOTE")+"")?"":mapList.get(i).get("NOTE")+"");
cell = row.createCell(15); //设定值
cell.setCellValue("null".equals(mapList.get(i).get("APPLY_PHONE")+"")?"":mapList.get(i).get("APPLY_PHONE")+"");
cell = row.createCell(16); //设定值
cell.setCellValue("null".equals(mapList.get(i).get("GAT_ID")+"")?"":mapList.get(i).get("GAT_ID")+"");
cell = row.createCell(17); //设定值
cell.setCellValue("null".equals(mapList.get(i).get("ADDRESS")+"")?"":mapList.get(i).get("ADDRESS")+"");
}
HSSFSheet sheet1 = wb.createSheet("公安网信息交接表");
......
......@@ -1123,14 +1123,14 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
success(response.data)
})
},
getHistoryGongan:function(startDate,endDate,success){
console.log(startDate,endDate);
getHistoryGongan:function(startDate,endDate,str,success){
$http({
method: 'GET',
url: "../ReceiptApi/queryPoliceDataByDownLoadDate"+urlTimeStamp(),
params:{
startDate:startDate,
endDate:endDate
endDate:endDate,
gat:str
}
}).then(function successCallback(response) {
success(response.data)
......
......@@ -7,12 +7,15 @@
<div class="box-header" style="border-bottom: 1px solid #e0e0e0;">
<strong>公安网反馈信息</strong>
<div class="box-tools pull-right" >
<span>交接日期:</span>
<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="choseDate" id="datepicker2" readonly/>
<button type="button" class="btn btn-primary pull-right" style="height: 30px;line-height: 17px;margin-left: 10px;" ng-click="searchHistory()">查询历史</button>
<button type="button" class="btn btn-primary pull-right" style="height: 30px;line-height: 17px;" ng-click="doSearchGongan()">查询</button>
<button type="button" class="btn btn-primary pull-right" style="height: 30px;line-height: 17px;margin-left: 5px;" ng-click="searchHistory('')">查询历史</button>
<button type="button" class="btn btn-primary pull-right" style="height: 30px;line-height: 17px;margin-left: 5px;" ng-click="doSearchGongan()">查询</button>
<button type="button" class="btn btn-success pull-right" style="height: 30px;line-height: 17px;margin-left: 5px;" ng-click="searchHistory('gat')">查询港澳台历史</button>
</div>
<!-- /.box-tools -->
</div>
......
......@@ -53,7 +53,6 @@ angular.module('AvatarCheck.downloadGongan', ['ngRoute', 'AvatarCheck.http'])
listStr += json.list[i]
}
}
console.log($rootScope.loginData.name)
var url = '../exportExcel/printExcelData?name='+$rootScope.loginData.name+"&isHistory="+$scope.isHistory+"&list="+listStr;
var a = document.createElement("a");
document.body.appendChild(a);
......@@ -113,18 +112,17 @@ angular.module('AvatarCheck.downloadGongan', ['ngRoute', 'AvatarCheck.http'])
$scope.gonganData[i].isActive=false;
}
}
console.log($scope.gonganData,"点击查询公安网反馈");
})
};
if($rootScope.loginData.login==true){
$scope.doSearchGongan();
}
$scope.searchHistory = function () {
$scope.searchHistory = function (str) {
$scope.isHistory = 1;
var startDate=$('#datepicker1').val();
var endDate=$('#datepicker2').val();
HttpService.getHistoryGongan(startDate,endDate,function(data){
HttpService.getHistoryGongan(startDate,endDate, str,function(data){
$scope.gonganHistoryData=data;
for(var i=0;i<$scope.gonganHistoryData.length;i++){
if(i==$scope.currentTab){
......@@ -133,16 +131,16 @@ angular.module('AvatarCheck.downloadGongan', ['ngRoute', 'AvatarCheck.http'])
$scope.gonganHistoryData[i].isActive=false;
}
}
console.log($scope.gonganHistoryData);
})
}
$scope.checkAllPolice = function ($event,date) {
console.log(date)
var checkAllPolice = $event.target;
var checkbox =document.getElementsByName("checkPolice"+date);
console.log(checkbox.length);
for(var i=0;i<checkbox.length;i++){
if(checkAllPolice.checked) {
checkbox[i].checked = true;
......
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