Commit 94c92f3f authored by liuxinben's avatar liuxinben

1) 导入格口文件添加未定状态;

2)	解析制证数据包按所有的未定状态的格口数据进行解析;
3)	更新邮寄单详情,将格口的未定状态改为1取消邮寄;
parent 9f077394
......@@ -137,6 +137,7 @@ public class LogApi {
* @param uploadDate
* @return resultList
*/
//todo 不需要了
@RequestMapping("selectAnalysisData")
public List<Map<String,Object>> selectAnalysisData(@RequestParam("uploadDate")String uploadDate, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
......@@ -160,46 +161,100 @@ public class LogApi {
}
// /**
// * 解析
// * @param printDate
// * @param fileId
// * @return true
// */
// @RequestMapping("analysis")
// @Transactional(rollbackFor = Exception.class)
// public boolean analysis(@RequestParam("printDate")String printDate,@RequestParam("fileId")String fileId, HttpServletRequest requ) {
// String remoteAddr = requ.getRemoteAddr();
// MDC.put("ip", remoteAddr);
// try {
// logService.changeCardType(printDate, fileId);
// logService.insertAnalysisDate(getCurrentDate2String("yyyyMMddhhmmss"), fileId);
// //查询XML文件信息
// List <Map <String, Object>> resultList=logService.selectFileIdByUploadDate(printDate);
// //查询Excel文件信息
// Map <String, Object> resultMap=logService.selectFileNameDic(fileId);
// //更改解析状态
// logService.changeFileState(fileId);
// //查询身份数据
// List <Map <String, Object>> dataList=logService.selectIdData(fileId);
// //将身份数据插入到邮寄表中
// for (int i=0; i < dataList.size(); i++) {
// logService.insertIdData((String) dataList.get(i).get("GMSFHM"), (String) dataList.get(i).get("SSXQDM"), (String) dataList.get(i).get("YXQQSRQ"), (String) dataList.get(i).get("YXQJZRQ"), (String) dataList.get(i).get("JMSFZSLH"));
// }
// List <Map <String, Object>> result=new ArrayList <>();
// for (int i=0; i < resultList.size(); i++) {
// String fileName=(BigDecimal) (resultList.get(i).get("ID")) + "";
// //查询证件类型计数
// Map <String, Object> countMap=logService.selectCountByCardType((BigDecimal) (resultList.get(i).get("ID")) + "");
// resultMap.put("fileName", fileName);
// resultMap.put("commonCount", countMap.get("PUSUM"));
// resultMap.put("postCount", countMap.get("YOUSUM"));
// result.add(resultMap);
// //生成解析表
// logService.insertIntoAnalysis(fileId, fileName, String.valueOf(countMap.get("PUSUM")), String.valueOf(countMap.get("YOUSUM")));
// }
// }catch (Exception e){
// logger.error("导入时间:" + printDate + "文件名:" + fileId);
// logger.error("Exception 解析异常", e);
// }
// return true;
// }
/**
* 解析
* @param printDate
* @param fileId
* @return true
*/
@RequestMapping("analysis")
@Transactional(rollbackFor = Exception.class)
public boolean analysis(@RequestParam("printDate")String printDate,@RequestParam("fileId")String fileId, HttpServletRequest requ) {
public boolean analysisByPrintDate(@RequestParam("printDate")String printDate, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
try {
logService.changeCardType(printDate, fileId);
logService.insertAnalysisDate(getCurrentDate2String("yyyyMMddhhmmss"), fileId);
//查询XML文件信息
List <Map <String, Object>> resultList=logService.selectFileIdByUploadDate(printDate);
//查询Excel文件信息
Map <String, Object> resultMap=logService.selectFileNameDic(fileId);
//更改解析状态
logService.changeFileState(fileId);
//查询身份数据
List <Map <String, Object>> dataList=logService.selectIdData(fileId);
List <Map <String, Object>> dataList=logService.selectPersonPostUnanalysis(printDate);
//todo 获取所有的已解析的文件id
List <Map <String, Object>> analysusList = new ArrayList<>();
//将身份数据插入到邮寄表中
for (int i=0; i < dataList.size(); i++) {
logService.insertIdData((String) dataList.get(i).get("GMSFHM"), (String) dataList.get(i).get("SSXQDM"), (String) dataList.get(i).get("YXQQSRQ"), (String) dataList.get(i).get("YXQJZRQ"), (String) dataList.get(i).get("JMSFZSLH"));
Map<String,Object> map = new HashMap<>();
map.put("gkId",dataList.get(i).get("GK_ID"));
map.put("xmlId",dataList.get(i).get("XML_ID"));
//将每个xml的不同格口保存
if (!analysusList.contains(map)){
analysusList.add(map);
}
}
for (Map<String,Object> map : analysusList){
String xmlId = map.get("xmlId").toString();
String gkId = map.get("gkId").toString();
//查询不同每个xml在每个格口文件内的邮寄证数量
String postCount = logService.selectPostCountByXmlidAndGkid(xmlId,gkId);
int commonCount = 0;
// map.put("postCount",postCount);
for (Map<String,Object> map1 : resultList){
if (map1.get("ID").equals(xmlId)){
commonCount = Integer.parseInt(map1.get("RECORD_NUMBER").toString())-Integer.parseInt(postCount);
// map.put("commonCount",commonCount);
}
}
List <Map <String, Object>> result=new ArrayList <>();
for (int i=0; i < resultList.size(); i++) {
String fileName=(BigDecimal) (resultList.get(i).get("ID")) + "";
//查询证件类型计数
Map <String, Object> countMap=logService.selectCountByCardType((BigDecimal) (resultList.get(i).get("ID")) + "");
resultMap.put("fileName", fileName);
resultMap.put("commonCount", countMap.get("PUSUM"));
resultMap.put("postCount", countMap.get("YOUSUM"));
result.add(resultMap);
//生成解析表
logService.insertIntoAnalysis(fileId, fileName, String.valueOf(countMap.get("PUSUM")), String.valueOf(countMap.get("YOUSUM")));
//更新格口文件解析状态
logService.updateGKState(gkId);
//生成解析日志
logService.insertIntoAnalysis(gkId, xmlId, postCount, String.valueOf(commonCount));
}
}catch (Exception e){
logger.error("导入时间:" + printDate + "文件名:" + fileId);
logger.error("导入时间:" + printDate);
logger.error("Exception 解析异常", e);
}
return true;
......
......@@ -177,8 +177,6 @@ public interface LogMapper {
@Select("select sum(pu) pusum,sum(you) yousum from (select decode(CARD_TYPE_ID,0,l,0) pu,decode(CARD_TYPE_ID,9,l,0) you from (select count(CARD_TYPE_ID) as l,CARD_TYPE_ID from PREPRO_PERSON where file_id =#{fileId} group by CARD_TYPE_ID))\n ")
public Map<String,Object> selectCountByCardType(@Param("fileId")String fileId);
//查询身份数据
@Select("select DISTINCT PREPRO_PERSON.JMSFZSLH, PREPRO_PERSON.GMSFHM,PREPRO_PERSON.YXQQSRQ,PREPRO_PERSON.YXQJZRQ,PREPRO_PERSON.SSXQDM \n" +
"FROM PREPRO_PERSON LEFT JOIN PERSON_POST \n" +
......@@ -186,11 +184,17 @@ public interface LogMapper {
"WHERE PERSON_POST.FILE_ID=#{fileId}")
public List<Map<String,Object>> selectIdData(@Param("fileId")String fileId);
@Select("select DISTINCT PERSON_POST.FILE_ID AS GK_ID,PREPRO_PERSON.FILE_ID AS XML_ID, PREPRO_PERSON.JMSFZSLH, PREPRO_PERSON.GMSFHM,PREPRO_PERSON.YXQQSRQ,PREPRO_PERSON.YXQJZRQ,PREPRO_PERSON.SSXQDM \n" +
"FROM PREPRO_PERSON " +
"LEFT JOIN PERSON_POST ON PERSON_POST.FIRST_WHITE = PREPRO_PERSON.JMSFZSLH \n" +
"LEFT JOIN FILES ON FILES.ID = PREPRO_PERSON.FILE_ID \n" +
"WHERE PERSON_POST.STATE1=3")
public List<Map<String, Object>> selectPersonPostUnanalysis(String uploadDate);
//身份数据插入person_post
@Update("UPDATE PERSON_POST SET ID_CARD=#{cardId},ACCEPT_THE_MATTER=#{issuing},BEGIN_USEFUL_LIFE=#{beginDate},VALID_PERIOD_END=#{endDate} where PERSON_POST.FIRST_WHITE=#{firstWhite}")
@Update("UPDATE PERSON_POST SET ID_CARD=#{cardId},ACCEPT_THE_MATTER=#{issuing},BEGIN_USEFUL_LIFE=#{beginDate},VALID_PERIOD_END=#{endDate},STATE1=0 where PERSON_POST.FIRST_WHITE=#{firstWhite}")
public boolean insertIdData(@Param("cardId")String cardId,@Param("issuing") String issuing,@Param("beginDate")String beginDate,@Param("endDate")String endDate,@Param("firstWhite")String firstWhite );
/**
* 解析时更改Excel文件状态
* @param fileId
......@@ -210,4 +214,12 @@ public interface LogMapper {
@Update("update FILE_NAME_DIC set STATE =NULL WHERE FILE_ID =#{fileId} ")
public boolean updateNullFileState(@Param("fileId") String fileId);
@Select("SELECT COUNT(*) FROM PERSON_POST LEFT JOIN PREPRO_PERSON ON PERSON_POST.FIRST_WHITE = PREPRO_PERSON.JMSFZSLH " +
"WHERE PERSON_POST.FILE_ID = #{gkId} AND PREPRO_PERSON.FILE_ID = #{xmlId}")
public String selectPostCountByXmlidAndGkid(@Param("xmlId")String xmlId,@Param("gkId") String gkId);
@Update("UPDATE FILE_NAME_DIC SET STATE = 1 WHERE FILE_ID =#{gkId} ")
public boolean updateGKState(String gkId);
}
......@@ -15,9 +15,9 @@ import java.util.Map;
@Mapper
public interface PersonPostMapper {
@Insert("insert into PERSON_POST " +
"( WAYBILL_NUMBER,BACK_WAYBILL_NUMBER,ORDER_NUMBER,CREATE_DATE,OPENID,WC_PLAY_ORDER_NUMBER,PLAY_STATE,ORDER_STATE,APPLICANT_NAME,SENDER_NAME,SENDER_PHONE,SENDER_ADDRESS,RECIPIENT_NAME,RECIPIENT_PHONE,RECIPIENT_ADDRESS,ORDER_BLANK_NUMBER,GET_TO_PROVINCE,GET_TO_CITY,GET_TO_COUNTY,BUSINESS_TYPE,LATTICE_MOUTH_INFORMATION,NATURE_OF_THE_INTERNAL,NATURE_OF_THE_INFORMATION,FIRST_WHITE,FILE_ID) " +
"( WAYBILL_NUMBER,BACK_WAYBILL_NUMBER,ORDER_NUMBER,CREATE_DATE,OPENID,WC_PLAY_ORDER_NUMBER,PLAY_STATE,ORDER_STATE,APPLICANT_NAME,SENDER_NAME,SENDER_PHONE,SENDER_ADDRESS,RECIPIENT_NAME,RECIPIENT_PHONE,RECIPIENT_ADDRESS,ORDER_BLANK_NUMBER,GET_TO_PROVINCE,GET_TO_CITY,GET_TO_COUNTY,BUSINESS_TYPE,LATTICE_MOUTH_INFORMATION,NATURE_OF_THE_INTERNAL,NATURE_OF_THE_INFORMATION,FIRST_WHITE,FILE_ID,STATE1) " +
"values " +
"(#{waybillNumber},#{backWaybillNumber},#{orderNumber},#{createDate},#{openid},#{wcPlayOrderNumber},#{playState},#{orderState},#{applicantName},#{senderName},#{senderPhone},#{senderAddress},#{recipientName},#{recipientPhone},#{recipientAddress},#{orderBlankNumber},#{getToProvince},#{getToCity},#{getToCounty},#{businessType},#{latticeMouthInformation},#{natureOfTheInternal},#{natureOfTheInformation},#{firstWhite},#{fileId})")
"(#{waybillNumber},#{backWaybillNumber},#{orderNumber},#{createDate},#{openid},#{wcPlayOrderNumber},#{playState},#{orderState},#{applicantName},#{senderName},#{senderPhone},#{senderAddress},#{recipientName},#{recipientPhone},#{recipientAddress},#{orderBlankNumber},#{getToProvince},#{getToCity},#{getToCounty},#{businessType},#{latticeMouthInformation},#{natureOfTheInternal},#{natureOfTheInformation},#{firstWhite},#{fileId},3)")
@Options(useGeneratedKeys=true, keyProperty="id", keyColumn="id")
public boolean savePersonPost(PersonPostEntity personPostEntity);
......@@ -61,7 +61,7 @@ public interface PersonPostMapper {
public List<Map<String,Object>> selectNote(@Param("id")int id);
@Update("UPDATE PERSON_POST SET NOTE = #{note} where ID = #{id}")
@Update("UPDATE PERSON_POST SET NOTE = #{note},STATE1 = 2 where ID = #{id}")
public boolean addNote(@Param("id")String id,@Param("note")String note);
@Select("<script> " +
......
......@@ -47,8 +47,14 @@ public interface LogService {
public List<Map<String,Object>> selectIdData(@Param("fileId")String fileId);
public List<Map<String,Object>> selectPersonPostUnanalysis(@Param("uploadDate")String uploadDate);
public boolean insertIdData(String cardId, String issuing,String beginDate,String endDate,String firstWhite );
public boolean updateNullIdDate(String fileId );
public boolean updateGKState(String gkId);
public String selectPostCountByXmlidAndGkid(String xmlId,String gkId);
}
......@@ -145,6 +145,11 @@ public class LogServiceImpl implements LogService {
return resultList;
}
@Override
public List<Map<String, Object>> selectPersonPostUnanalysis(String uploadDate) {
return logMapper.selectPersonPostUnanalysis(uploadDate);
}
@Override
public boolean insertIdData(String cardId, String issuing, String beginDate, String endDate,String firstWhite) {
logMapper.insertIdData(cardId,issuing,beginDate,endDate,firstWhite);
......@@ -158,4 +163,14 @@ public class LogServiceImpl implements LogService {
logMapper.updateNullIdFileState(fileId);
return true;
}
@Override
public boolean updateGKState(String gkId) {
return logMapper.updateGKState(gkId);
}
@Override
public String selectPostCountByXmlidAndGkid(String xmlId, String gkId) {
return logMapper.selectPostCountByXmlidAndGkid(xmlId, gkId);
}
}
......@@ -911,12 +911,23 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
success(response.data)
})
},
analyseToUpdateIfPostCard:function(fileid,uploadDate,success) {
// analyseToUpdateIfPostCard:function(fileid,uploadDate,success) {
// $http({
// method: 'GET',
// url: "../LogApi/analysis"+urlTimeStamp(),
// params:{
// fileId:fileid,
// printDate:uploadDate
// }
// }).then(function successCallback(response) {
// success(response.data)
// })
// },
analyseToUpdateIfPostCard:function(uploadDate,success) {
$http({
method: 'GET',
url: "../LogApi/analysis"+urlTimeStamp(),
params:{
fileId:fileid,
printDate:uploadDate
}
}).then(function successCallback(response) {
......
......@@ -67,16 +67,16 @@
<span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
</div>
</td>
<td>格口导入日期:</td>
<td>
<div class="input-group date" >
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
<input type="text" class="form-control pull-right" ng-model="gridDate" id="dateGrid" readonly/>
<span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
</div>
</td>
<!--<td>格口导入日期:</td>-->
<!--<td>-->
<!--<div class="input-group date" >-->
<!--<div class="input-group-addon">-->
<!--<i class="fa fa-calendar"></i>-->
<!--</div>-->
<!--<input type="text" class="form-control pull-right" ng-model="gridDate" id="dateGrid" readonly/>-->
<!--<span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>-->
<!--</div>-->
<!--</td>-->
<td style="text-align: left;">
<button class="btn btn-primary" ng-click="getXmlPackage()">查询</button>
</td>
......@@ -104,7 +104,8 @@
<td>{{item.commonCount}}</td>
<td>{{item.postCount}}</td>
<td>
<button class="btn btn-primary" ng-click="analysis(item.date,item.packageCount)">解析</button>
<!--<button class="btn btn-primary" ng-click="analysis(item.date,item.packageCount)">解析</button>-->
<button class="btn btn-primary" ng-click="analysis(item.date)">解析</button>
<button class="btn btn-danger" ng-click="deleteDataById(item.date,item.packageCount)">删除</button>
<button class="btn btn-primary" ng-click="check(item.date)">检查</button>
<!--<button class="btn btn-info" ng-click="analysisMachineAcceptList(item)">解析机器受理包</button>-->
......
......@@ -69,48 +69,58 @@ angular.module('AvatarCheck.xmlAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm.p
$scope.$watch('paginationConf.currentPage +paginationConf.itemsPerPage', $scope.getXmlPackagePage);
var getData = $scope.getXmlPackage;
$scope.analysis = function (uploadDate,packageCount) {
ngDialog.open({
template: 'dialogs/analysisDialog.html' + urlTimeStamp(),
width: 977,
cache: false,
controller: ['$scope','HttpService', function ($scope,HttpService) {
$scope.wrongMsg = -1;
$scope.upDate =uploadDate;
$scope.upCount=packageCount;
HttpService.analyseData($("#dateGrid").val(), function (data) {
$scope.resultData = data;
console.log($scope.resultData)
})
$scope.analyseToUpdateIfPost=function(fileid){
console.log(uploadDate)
HttpService.analyseToUpdateIfPostCard(fileid,uploadDate,function(data){
if(data){
$scope.wrongMsg = "解析完成"
// $scope.closeThisDialog();
// MessageService.showAlert("解析完成")
getData();
}else{
$scope.wrongMsg = "解析失败,请联系管理员!"
}
})
}
$scope.UpdateIdcard=function(fileid){
HttpService.analyseToUpdateIdcard(fileid,function(data){
// $scope.analysis = function (uploadDate,packageCount) {
// ngDialog.open({
// template: 'dialogs/analysisDialog.html' + urlTimeStamp(),
// width: 977,
// cache: false,
// controller: ['$scope','HttpService', function ($scope,HttpService) {
// $scope.wrongMsg = -1;
// $scope.upDate =uploadDate;
// $scope.upCount=packageCount;
// HttpService.analyseData($("#dateGrid").val(), function (data) {
// $scope.resultData = data;
// console.log($scope.resultData)
// })
// $scope.analyseToUpdateIfPost=function(fileid){
// console.log(uploadDate)
// HttpService.analyseToUpdateIfPostCard(fileid,uploadDate,function(data){
// if(data){
// $scope.wrongMsg = "解析完成"
// // $scope.closeThisDialog();
// // MessageService.showAlert("解析完成")
// getData();
// }else{
// $scope.wrongMsg = "解析失败,请联系管理员!"
// }
// })
// }
// $scope.UpdateIdcard=function(fileid){
// HttpService.analyseToUpdateIdcard(fileid,function(data){
// if(data){
// $scope.wrongMsg = "清除标记成功"
// getData();
// }else{
// $scope.wrongMsg = "清除标记失败"
// }
// })
// }
//
// }]
// });
//
// }
$scope.analysis = function (uploadDate) {
HttpService.analyseToUpdateIfPostCard(uploadDate,function(data){
if(data){
$scope.wrongMsg = "清除标记成功"
MessageService.showAlert("解析完成")
getData();
}else{
$scope.wrongMsg = "清除标记失败"
MessageService.showAlert("解析失败,请联系管理员!")
}
})
}
}]
});
}
$scope.check = function (uploadDate) {
ngDialog.open({
template: 'dialogs/checkDialog.html' + urlTimeStamp(),
......
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