Commit 7c87b287 authored by dahai's avatar dahai

Merge remote-tracking branch 'origin/dev' into dev

parents d637c9f4 da894326
...@@ -81,8 +81,6 @@ public class FailedCardApi { ...@@ -81,8 +81,6 @@ public class FailedCardApi {
return resultList; return resultList;
} }
/** /**
* 生成余证(每个余证生成一个任务单) * 生成余证(每个余证生成一个任务单)
* @param jsonStr * @param jsonStr
...@@ -140,36 +138,40 @@ public class FailedCardApi { ...@@ -140,36 +138,40 @@ public class FailedCardApi {
@RequestMapping("insertBackCard") @RequestMapping("insertBackCard")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean insertBackCard(@RequestBody String jsonStr){ public boolean insertBackCard(@RequestBody String jsonStr){
JSONArray jsonarray = JSONArray.fromObject(jsonStr); try {
TaskEntity taskEntity = new TaskEntity(); JSONArray jsonarray = JSONArray.fromObject(jsonStr);
String str2 = null; TaskEntity taskEntity = new TaskEntity();
for (int i = 0; i < jsonarray.size(); i++) { String str2 = null;
JSONObject jsonObject = (JSONObject) jsonarray.get(i); for (int i = 0; i < jsonarray.size(); i++) {
String str = jsonObject.getString("idCard"); JSONObject jsonObject = (JSONObject) jsonarray.get(i);
if (i != jsonarray.size() - 1) { String str = jsonObject.getString("idCard");
str2 += "'" + str + "',"; if (i != jsonarray.size() - 1) {
} else { str2 += "'" + str + "',";
str2 += "'" + str + "'"; } else {
str2 += "'" + str + "'";
}
} }
} //查询制证库,拿到组号列表
//查询制证库,拿到组号列表 List<String> groupList = failedCardService.selectGroupNo(str2);
List<String> groupList = failedCardService.selectGroupNo(str2);
//生成任务单
for (int i = 0; i < groupList.size(); i++) {
JSONObject jsonObject = (JSONObject) jsonarray.get(i);
//查询生成任务单需要的数据
Map<String, Object> dataMap = failedCardService.selectTaskListById(jsonObject.getString("idCard"));
//TODO 会报空指针异常
String countyCode = dataMap.get("COUNTY_CODE").toString();
Long cardType = (Long) dataMap.get("CARD_TYPE_ID");
taskEntity.setCountyCode(countyCode);
taskEntity.setCardType(cardType);
taskEntity.setTaskStateId((long) 1);
//生成任务单 //生成任务单
taskListService.saveTask(taskEntity); for (int i = 0; i < groupList.size(); i++) {
//生成新组号列表 JSONObject jsonObject = (JSONObject) jsonarray.get(i);
Map<String,Object> groupDataMap= failedCardService.selectGroupDate(groupList.get(i)); //查询生成任务单需要的数据
failedCardService.insertGroupNo(String.valueOf(groupDataMap.get("GROUP_NO")),String.valueOf(groupDataMap.get("TASK_ID")),(Long) groupDataMap.get("VALID_COUNT"),(Long)groupDataMap.get("INVALID_COUNT")); Map<String, Object> dataMap = failedCardService.selectTaskListById(jsonObject.getString("idCard"));
//TODO 会报空指针异常
String countyCode = dataMap.get("COUNTY_CODE").toString();
Long cardType = (Long) dataMap.get("CARD_TYPE_ID");
taskEntity.setCountyCode(countyCode);
taskEntity.setCardType(cardType);
taskEntity.setTaskStateId((long) 1);
//生成任务单
taskListService.saveTask(taskEntity);
//生成新组号列表
Map<String, Object> groupDataMap = failedCardService.selectGroupDate(groupList.get(i));
failedCardService.insertGroupNo(String.valueOf(groupDataMap.get("GROUP_NO")), String.valueOf(groupDataMap.get("TASK_ID")), (Long) groupDataMap.get("VALID_COUNT"), (Long) groupDataMap.get("INVALID_COUNT"));
}
} catch (NullPointerException e) {
return false;
} }
return true; return true;
} }
......
...@@ -114,14 +114,17 @@ public class LogApi { ...@@ -114,14 +114,17 @@ public class LogApi {
/** /**
* 删除制证包及其数据 * 删除制证包及其数据
* @param fileId * @param uploadTime
* @return true * @return true
*/ */
@RequestMapping("deleteFiles") @RequestMapping("deleteFiles")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean deleteFiles(@RequestParam("fileId")String fileId){ public boolean deleteFiles(@RequestParam("uploadTime")String uploadTime){
logService.deleteFilesData(fileId); List<String> idList =logService.selectId(uploadTime);
logService.deleteFile(fileId); for (int i=0;i<idList.size();i++){
logService.deleteFilesData(idList.get(i));
logService.deleteFile(idList.get(i));
}
return true; return true;
} }
......
...@@ -136,11 +136,14 @@ public interface LogMapper { ...@@ -136,11 +136,14 @@ public interface LogMapper {
@Delete("delete from PREPRO_PERSON where file_id = #{fileId}") @Select("select id from files where TO_CHAR(UPLOAD_DATE,'yyyy-mm-dd hh24:mi:ss') = #{uploadTime}")
public boolean deleteFilesData(@Param("fileId")String fileId); public List<String> selectId(@Param("uploadTime")String uploadTime);
@Delete("delete from files where id=#{fileId}") @Delete("delete from PREPRO_PERSON where PREPRO_PERSON.sid = #{id}")
public boolean deleteFile(@Param("fileId")String fileId); public boolean deleteFilesData(@Param("uploadTime")String id);
@Delete("delete from files where id=#{id}")
public boolean deleteFile(@Param("uploadTime")String id);
......
...@@ -25,7 +25,9 @@ public interface LogService { ...@@ -25,7 +25,9 @@ public interface LogService {
public boolean insertAnalysisDate(String printDate,String latticeMouthInformation); public boolean insertAnalysisDate(String printDate,String latticeMouthInformation);
public boolean deleteFilesData(@Param("fileId")String fileId); public boolean deleteFilesData(@Param("id")String id);
public boolean deleteFile(@Param("fileId")String fileId); public boolean deleteFile(@Param("id")String id);
public List<String> selectId(@Param("uploadTime")String uploadTime);
} }
...@@ -63,14 +63,20 @@ public class LogServiceImpl implements LogService { ...@@ -63,14 +63,20 @@ public class LogServiceImpl implements LogService {
} }
@Override @Override
public boolean deleteFilesData(String fileId) { public boolean deleteFilesData(String id) {
logMapper.deleteFilesData(fileId); logMapper.deleteFilesData(id);
return true; return true;
} }
@Override @Override
public boolean deleteFile(String fileId) { public boolean deleteFile(String id) {
logMapper.deleteFile(fileId); logMapper.deleteFile(id);
return true; return true;
} }
@Override
public List<String> selectId(String uploadTime) {
List<String> id= logMapper.selectId(uploadTime);
return id;
}
} }
...@@ -662,13 +662,13 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule']) ...@@ -662,13 +662,13 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
success(response.data) success(response.data)
}) })
}, },
analyseData:function(id,success){ analyseData:function(date,success){
console.log(id) console.log(date)
$http({ $http({
method: 'GET', method: 'GET',
url: "../LogApi/selectAnalysisData"+urlTimeStamp(), url: "../LogApi/selectAnalysisData"+urlTimeStamp(),
params:{ params:{
filesId:id uploadDate:date
} }
}).then(function successCallback(response) { }).then(function successCallback(response) {
success(response.data) success(response.data)
...@@ -796,13 +796,13 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule']) ...@@ -796,13 +796,13 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
success(response.data) success(response.data)
}) })
}, },
deleteProdDataByFileId:function(id,success){ deleteProdDataByFileId:function(uploadDate,success){
console.log(id) console.log(uploadDate)
$http({ $http({
method: 'GET', method: 'GET',
url: "../LogApi/deleteFiles"+urlTimeStamp(), url: "../LogApi/deleteFiles"+urlTimeStamp(),
params:{ params:{
fileId:id uploadTime:uploadDate
} }
}).then(function successCallback(response) { }).then(function successCallback(response) {
success(response.data) success(response.data)
......
...@@ -88,8 +88,8 @@ ...@@ -88,8 +88,8 @@
<td>{{item.commonCount}}</td> <td>{{item.commonCount}}</td>
<td>{{item.postCount}}</td> <td>{{item.postCount}}</td>
<td> <td>
<button class="btn btn-primary" ng-click="analysis(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.uploadDate,item.packageCount,item.fileId)">删除</button> <button class="btn btn-danger" ng-click="deleteDataById(item.date,item.packageCount)">删除</button>
</td> </td>
</tr> </tr>
</tbody> </tbody>
......
...@@ -32,7 +32,7 @@ angular.module('AvatarCheck.xmlAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm.p ...@@ -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({ ngDialog.open({
template: 'dialogs/analysisDialog.html' + urlTimeStamp(), template: 'dialogs/analysisDialog.html' + urlTimeStamp(),
width: 876, width: 876,
...@@ -40,7 +40,7 @@ angular.module('AvatarCheck.xmlAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm.p ...@@ -40,7 +40,7 @@ angular.module('AvatarCheck.xmlAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm.p
controller: ['$scope','HttpService', function ($scope,HttpService) { controller: ['$scope','HttpService', function ($scope,HttpService) {
$scope.upDate =uploadDate; $scope.upDate =uploadDate;
$scope.upCount=packageCount; $scope.upCount=packageCount;
HttpService.analyseData(id, function (data) { HttpService.analyseData(uploadDate, function (data) {
$scope.resultData = data; $scope.resultData = data;
console.log($scope.resultData) console.log($scope.resultData)
}) })
...@@ -87,7 +87,7 @@ angular.module('AvatarCheck.xmlAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm.p ...@@ -87,7 +87,7 @@ angular.module('AvatarCheck.xmlAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm.p
var reGet = $scope.getXmlPackage; var reGet = $scope.getXmlPackage;
$scope.deleteDataById = function(uploadDate,packageCount,id){ $scope.deleteDataById = function(uploadDate,packageCount){
ngDialog.open({ ngDialog.open({
template: 'dialogs/confirm.html' + urlTimeStamp(), template: 'dialogs/confirm.html' + urlTimeStamp(),
width: 600, width: 600,
...@@ -97,7 +97,7 @@ angular.module('AvatarCheck.xmlAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm.p ...@@ -97,7 +97,7 @@ angular.module('AvatarCheck.xmlAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm.p
$scope.total = packageCount; $scope.total = packageCount;
$scope.importDate =uploadDate; $scope.importDate =uploadDate;
$scope.confirmDelete = function () { $scope.confirmDelete = function () {
HttpService.deleteProdDataByFileId(id, function (data) { HttpService.deleteProdDataByFileId(uploadDate, function (data) {
MessageService.showAlert(data.msg); MessageService.showAlert(data.msg);
$scope.closeThisDialog(); $scope.closeThisDialog();
reGet(); 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