Commit 3e6b5362 authored by wuzhilong's avatar wuzhilong

格口文件邮件号检查

parent ba51a8b9
......@@ -77,6 +77,8 @@ public class ReadExcelApi {
// 将普通属性存入map中,之后调用
Map<String, String> map = new HashMap<String, String>();
List<FileItem> list = null;
int post=0;
int backPost=0;
try {
//将当前上下文初始化给 CommonsMutipartResolver (多部分解析器)
CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver(
......@@ -157,6 +159,9 @@ public class ReadExcelApi {
entityList.add(personPostEntity);
}
personPostService.savePersonPost(entityList);
//查询导入新格口文件邮件号是否使用过
post= personPostService.findWaybillNumber(fileNameDicEntity.getFileId()+"");
backPost= personPostService.findBackWaybillNumber(fileNameDicEntity.getFileId()+"");
} catch (Exception e) {
e.printStackTrace();
logger.error("上传文件名" + filename + "起始时间" + startDate + "截止时间" + endDate);
......@@ -185,8 +190,11 @@ public class ReadExcelApi {
map.put("msg","导入个人邮寄信息表异常");
return map;
}
map.put("result","true");
map.put("msg","上传成功");
if (post+backPost>0){
map.put("msg","邮寄订单导入成功,邮件号异常正向邮件号重复 "+post+" 条,反向邮件号重复 "+backPost+"条");
}else {
map.put("msg","上传成功!");
}
return map;
}
......
......@@ -293,7 +293,6 @@ public class ReceiptApi {
if(resultProd.size()>0){//通过交接单id判断是否以生成交接单
String receiptId=resultProd.get(0).get("RECEIPT_ID")+"";//交接单id
String acceptNo=resultProd.get(0).get("ACCEPT_NO")+"";//受理号
String groupNo=acceptNo.substring(0,acceptNo.length()-2);
//-------------------未生成交接单-------------------
if ("null".equals(receiptId)){
String cardType=resultProd.get(0).get("CARD_TYPE")+"";//任务单制证类型
......@@ -307,18 +306,18 @@ public class ReceiptApi {
//保存交接单
//-------------------特征-------------------
// todo ,重做退回没加判断
if (specialType=="2"){//受理类型(1余证2快证3退证)
if ("2".equals(specialType)){//受理类型(1余证2快证3退证)
receiptListEntity.setQrCode(acceptNo);//条形码(受理组号或受理号)
receiptListEntity.setPoliceCode("110000000000");//公安机关代码
receiptListEntity.setFinishCount((long)1);//复核数量
receiptListEntity.setCardTypeId((long)0);//制证类型
receiptListEntity.setOldCardTypeId((long)2);// 原制证类型
receiptListEntity.setOldCardTypeId((long)0);// 原制证类型
receiptListEntity.setFjdm("110000");//分局代码
receiptListEntity.setCheckName(name);//复核姓名
} else {
//-------------------普证 个人邮寄 港澳证 台湾证 -------------------
receiptListEntity.setQrCode(groupNo+"00");//封签编号
receiptListEntity.setFinishCount(Long.valueOf(validCount));//证件数量
acceptNo=acceptNo.substring(0,acceptNo.length()-2);
receiptListEntity.setQrCode(acceptNo);//封签编号
receiptListEntity.setCardTypeId(Long.valueOf(cardType));//制证类型
if ("null".equals(oldCardType)){
......@@ -338,15 +337,16 @@ public class ReceiptApi {
default:
receiptListEntity.setFjdm(fjdm);
}
List<Map<String,Object>> list=receiptService.findReceiptListCount( acceptNo+"%");
receiptListEntity.setFinishCount((long) list.size());//证件数量
}
//生成交接单
long S=receiptService.createReceiptList(receiptListEntity);
//生成交接详单
//上传受理号、受理号、姓名、派出所代码、身份证号、受理单位、交接单ID、性别
receiptId=receiptListEntity.getId()+"";
String policeCode=receiptListEntity.getPoliceCode();
receiptService.createDetailReceiptList( receiptId, groupNo+"%", policeCode);
receiptService.createDetailReceiptList( receiptId, acceptNo+"%", policeCode);
map.put("show", true);
map.put("state", 1);
map.put("id", receiptId);
......
......@@ -48,7 +48,7 @@ public interface DetailReceiptListMapper {
"POLICE_CODE,FINISH_COUNT,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 decode(RECEIPT_LIST.Old_CARD_TYPE_ID,null,RECEIPT_LIST.CARD_TYPE_ID,RECEIPT_LIST.Old_CARD_TYPE_ID) = CARD_TYPE_DIC.CARD_TYPE_ID\n" +
"left join CARD_TYPE_DIC on RECEIPT_LIST.CARD_TYPE_ID = CARD_TYPE_DIC.CARD_TYPE_ID\n" +
"where RECEIPT_LIST.id in (${str}) order by receipt_date")
public List<Map<String, Object>> selectPoliceDataById(@Param("str") String str);
......
......@@ -185,4 +185,18 @@ public interface PersonPostMapper {
"on dataa.DWDM=datab.DWDM")
public List<Map<String,Object>> downloadUploadInfo(@Param("strDate")String strDate, @Param("endDate")String endDate);
@Select("select count(*) from PERSON_POST\n" +
" where FILE_ID <>#{fileID}\n" +
" and WAYBILL_NUMBER in \n" +
" (select WAYBILL_NUMBER from PERSON_POST\n" +
" where FILE_ID=#{fileID})")
public int findWaybillNumber( @Param("fileID") String fileID);
@Select("select count(*) from PERSON_POST\n" +
" where FILE_ID <>#{fileID}\n" +
" and BACK_WAYBILL_NUMBER in \n" +
" (select BACK_WAYBILL_NUMBER from PERSON_POST\n" +
" where FILE_ID=#{fileID})")
public int findBackWaybillNumber( @Param("fileID") String fileID);
}
......@@ -251,10 +251,10 @@ public interface ReceiptMapper {
public Map<String,Object> selectTimes(@Param("groupNo") String groupNo);
@Select("<script>" +
"select RECEIPT_LIST.id,RECEIPT_LIST.QR_CODE,RECEIPT_LIST.RECEIPT_DATE,RECEIPT_LIST.POLICE_CODE,decode(RECEIPT_LIST.Old_CARD_TYPE_ID,null,RECEIPT_LIST.CARD_TYPE_ID,RECEIPT_LIST.Old_CARD_TYPE_ID) CARD_TYPE_ID,\n" +
"select RECEIPT_LIST.id,RECEIPT_LIST.QR_CODE,RECEIPT_LIST.RECEIPT_DATE,RECEIPT_LIST.POLICE_CODE,RECEIPT_LIST.CARD_TYPE_ID CARD_TYPE_ID,\n" +
"RECEIPT_LIST.FINISH_COUNT,DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO GAJG_DM,DIC_UPLOAD_UNIT_T.UNIT_NAME GAJG_MC,RECEIPT_LIST.CHECK_DATE,RECEIPT_LIST.CHECK_NAME\n" +
",CARD_TYPE_DIC.CARD_TYPE,COUNTY_DIC.COUNTY_CODE ,COUNTY_DIC.COUNTYNAME,RECEIPT_LIST.state,RECEIPT_LIST.IS_PRINT from RECEIPT_LIST \n" +
"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 CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = RECEIPT_LIST.CARD_TYPE_ID \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 COUNTY_DIC on substr(RECEIPT_LIST.POLICE_CODE,0,6) = COUNTY_DIC.COUNTY_CODE" +
" where CHECK_DATE is not null and RECEIPT_LIST.IS_PRINT = 0 " +
......@@ -268,10 +268,10 @@ public interface ReceiptMapper {
@Select("select RECEIPT_LIST.id,RECEIPT_LIST.QR_CODE,RECEIPT_LIST.RECEIPT_DATE,RECEIPT_LIST.POLICE_CODE,decode(RECEIPT_LIST.Old_CARD_TYPE_ID,null,RECEIPT_LIST.CARD_TYPE_ID,RECEIPT_LIST.Old_CARD_TYPE_ID) CARD_TYPE_ID,\n" +
@Select("select RECEIPT_LIST.id,RECEIPT_LIST.QR_CODE,RECEIPT_LIST.RECEIPT_DATE,RECEIPT_LIST.POLICE_CODE,RECEIPT_LIST.CARD_TYPE_ID CARD_TYPE_ID,\n" +
"RECEIPT_LIST.FINISH_COUNT,DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO GAJG_DM,DIC_UPLOAD_UNIT_T.UNIT_NAME GAJG_MC,RECEIPT_LIST.CHECK_DATE,RECEIPT_LIST.CHECK_NAME\n" +
",CARD_TYPE_DIC.CARD_TYPE,COUNTY_DIC.COUNTY_CODE ,COUNTY_DIC.COUNTYNAME,RECEIPT_LIST.state,RECEIPT_LIST.IS_PRINT from RECEIPT_LIST \n" +
"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 CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = RECEIPT_LIST.CARD_TYPE_ID \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 COUNTY_DIC on RECEIPT_LIST.FJDM = COUNTY_DIC.COUNTY_CODE" +
" where to_char(RECEIPT_DATE,'yyyyMMddhhmmss') BETWEEN ${startDate} and ${endDate} order by RECEIPT_LIST.id ")
......@@ -280,10 +280,10 @@ public interface ReceiptMapper {
//修改表链接
@Select("<script>" +
"select RECEIPT_LIST.id,RECEIPT_LIST.QR_CODE,to_char(RECEIPT_LIST.RECEIPT_DATE,'yyyy-MM-dd') RECEIPT_DATE,RECEIPT_LIST.POLICE_CODE,decode(RECEIPT_LIST.Old_CARD_TYPE_ID,null,RECEIPT_LIST.CARD_TYPE_ID,RECEIPT_LIST.Old_CARD_TYPE_ID) CARD_TYPE_ID,\n" +
"select RECEIPT_LIST.id,RECEIPT_LIST.QR_CODE,to_char(RECEIPT_LIST.RECEIPT_DATE,'yyyy-MM-dd') RECEIPT_DATE,RECEIPT_LIST.POLICE_CODE,RECEIPT_LIST.CARD_TYPE_ID CARD_TYPE_ID,\n" +
"RECEIPT_LIST.FINISH_COUNT,DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO GAJG_DM,DIC_UPLOAD_UNIT_T.UNIT_NAME GAJG_MC,to_char(CHECK_DATE,'yyyyMMdd') CHECK_DATE,RECEIPT_LIST.CHECK_NAME\n" +
",CARD_TYPE_DIC.CARD_TYPE,CARD_TYPE_DIC.CARD_TYPE,RECEIPT_LIST.fjdm COUNTY_CODE ,POLICE_DIC.police_name COUNTYNAME from RECEIPT_LIST \n" +
"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 CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID =RECEIPT_LIST.CARD_TYPE_ID \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 POLICE_DIC on RECEIPT_LIST.fjdm= POLICE_DIC.POLICE_CODE " +
" where RECEIPT_LIST.id in (${string}) order by RECEIPT_LIST.id " +
......@@ -370,6 +370,17 @@ public interface ReceiptMapper {
"and prod_card_t.ACCEPT_NO not like 'L%' \n" +
"ORDER BY prod_card_t.ACCEPT_NO DESC ")
public List<Map<String,Object>> selectProdAcceptNo(@Param("id") String id,@Param("beginDate") String beginDate,@Param("expireDate") String expireDate);
//查询交接单详单 组内数量
@Select("select UPLOAD_NO,ACCEPT_NO,NAME,ID_NO,SIGN_GOVT,SEX_NO\n" +
"from PROD_DBA.prod_card_t@PROD_LINK cardT \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 List<Map<String,Object>> findReceiptListCount(@Param("groupNo")String groupNo);
//生成交接单详单
@Insert("INSERT INTO DETAIL_RECEIPT_LIST(UPLOAD_NO,accept_no,name,POLICE_CODE,card_id,SIGN_GOVT,RECEIPT_ID,SEX)\n" +
"select UPLOAD_NO,ACCEPT_NO,NAME,#{policeCode},ID_NO,SIGN_GOVT,#{receiptId},SEX_NO\n" +
......
......@@ -57,4 +57,7 @@ public interface PersonPostService {
public List<Map<String, Object>> downloadUploadInfo(HttpServletRequest request,HttpServletResponse response,String startDate,String endDate);
public int findWaybillNumber( @Param("fileID") String fileID);
public int findBackWaybillNumber( @Param("fileID") String fileID);
}
......@@ -96,6 +96,9 @@ public interface ReceiptService {
public List<Map<String,Object>> selectProdAcceptNo(String id,String beginDate,String expireDate);
public List<Map<String,Object>> findReceiptListCount(String groupNo);
public boolean createDetailReceiptList(String receiptId,String groupNo,String policeCode);
......
......@@ -167,6 +167,16 @@ public class PersonPostServiceImpl implements PersonPostService {
List<Map<String, Object>> list = personPostMapper.downloadUploadInfo(strDate,endDate);
return list;
}
@Override
public int findWaybillNumber(String fileID){
int mum = personPostMapper.findWaybillNumber(fileID);
return mum;
}
@Override
public int findBackWaybillNumber(String fileID){
int mum = personPostMapper.findBackWaybillNumber(fileID);
return mum;
}
// /**
// * 查询个人邮寄信息
// * @param fileName 文件名
......
......@@ -486,6 +486,11 @@ public class ReceiptServiceImpl implements ReceiptService {
return receiptMapper.selectProdAcceptNo(id,beginDate,expireDate);
}
@Override
public List<Map<String,Object>> findReceiptListCount(String groupNo){
List<Map<String,Object>> list= receiptMapper.findReceiptListCount(groupNo);
return list;
};
@Override
public boolean createDetailReceiptList(String receiptId,String groupNo,String policeCode) {
receiptMapper.createDetailReceiptList(receiptId,groupNo,policeCode);
return true;
......
......@@ -98,7 +98,7 @@ angular.module('AvatarCheck.excelAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm
if(data.result=="true"){
$scope.closeThisDialog();
getData();
MessageService.showAlert("上传成功")
MessageService.showAlert(data.msg);
}else{
$scope.msgText =data.msg;
}
......
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