Commit 792429f3 authored by liuxinben's avatar liuxinben

大批证交接单生成时过滤未被匹配的邮寄证

parent 56700dd6
...@@ -3,7 +3,9 @@ package com.yxproject.start.api; ...@@ -3,7 +3,9 @@ package com.yxproject.start.api;
import com.yxproject.start.entity.DetailReceiptListEntity; import com.yxproject.start.entity.DetailReceiptListEntity;
import com.yxproject.start.entity.ReceiptListEntity; import com.yxproject.start.entity.ReceiptListEntity;
import com.yxproject.start.service.ReceiptService; import com.yxproject.start.service.ReceiptService;
import net.sf.json.JSON;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.apache.log4j.MDC; import org.apache.log4j.MDC;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -317,6 +319,7 @@ public class ReceiptApi { ...@@ -317,6 +319,7 @@ public class ReceiptApi {
} else { } else {
//-------------------普证 个人邮寄 港澳证 台湾证 ------------------- //-------------------普证 个人邮寄 港澳证 台湾证 -------------------
acceptNo=acceptNo.substring(0,acceptNo.length()-2); acceptNo=acceptNo.substring(0,acceptNo.length()-2);
//todo 校验大批证中是否存在邮寄证
receiptListEntity.setQrCode(acceptNo);//封签编号 receiptListEntity.setQrCode(acceptNo);//封签编号
receiptListEntity.setCardTypeId(Long.valueOf(cardType));//制证类型 receiptListEntity.setCardTypeId(Long.valueOf(cardType));//制证类型
if ("null".equals(oldCardType)){ if ("null".equals(oldCardType)){
...@@ -340,6 +343,22 @@ public class ReceiptApi { ...@@ -340,6 +343,22 @@ public class ReceiptApi {
List<Map<String,Object>> list=receiptService.findReceiptListCount( acceptNo+"%"); List<Map<String,Object>> list=receiptService.findReceiptListCount( acceptNo+"%");
receiptListEntity.setFinishCount((long) list.size());//证件数量 receiptListEntity.setFinishCount((long) list.size());//证件数量
} }
if (cardType.equals("0")){
List<Map<String, Object>> list = receiptService.selectYJZ(acceptNo + "%");
if (list.size()>0){
map.put("show", false);
map.put("state", 3);
map.put("msg", "该大批证组中混入了邮寄证!混入的人员信息为:"+ JSONObject.fromObject(list).toString());
//生成交接单
receiptListEntity.setFinishCount(receiptListEntity.getFinishCount()-list.size());
long S=receiptService.createReceiptList(receiptListEntity);
//生成交接详单
//上传受理号、受理号、姓名、派出所代码、身份证号、受理单位、交接单ID、性别
receiptId=receiptListEntity.getId()+"";
String policeCode=receiptListEntity.getPoliceCode();
}
}else {
//生成交接单 //生成交接单
long S=receiptService.createReceiptList(receiptListEntity); long S=receiptService.createReceiptList(receiptListEntity);
//生成交接详单 //生成交接详单
...@@ -347,6 +366,7 @@ public class ReceiptApi { ...@@ -347,6 +366,7 @@ public class ReceiptApi {
receiptId=receiptListEntity.getId()+""; receiptId=receiptListEntity.getId()+"";
String policeCode=receiptListEntity.getPoliceCode(); String policeCode=receiptListEntity.getPoliceCode();
receiptService.createDetailReceiptList( receiptId, acceptNo+"%", policeCode); receiptService.createDetailReceiptList( receiptId, acceptNo+"%", policeCode);
}
map.put("show", true); map.put("show", true);
map.put("state", 1); map.put("state", 1);
map.put("id", receiptId); map.put("id", receiptId);
......
...@@ -389,6 +389,18 @@ public interface ReceiptMapper { ...@@ -389,6 +389,18 @@ public interface ReceiptMapper {
"and cardT.ACCEPT_NO like #{groupNo}") "and cardT.ACCEPT_NO like #{groupNo}")
public List<Map<String,Object>> findReceiptListCount(@Param("groupNo")String groupNo); public List<Map<String,Object>> findReceiptListCount(@Param("groupNo")String groupNo);
//查询交接单详单 组内数量
@Select("select cardT.ID_NO,cardT.NAME,cardT.ACCEPT_NO\n" +
"from PRODYD_DBA.prod_card_t@PRODYD_LINK cardT\n" +
"left join PERSON_POST on PERSON_POST.ID_CARD = cardT.ID_NO\n" +
"where cardT.ACCEPT_NO not in\n" +
"(select ACCEPT_NO from SPECIAL_CARD \n" +
"where GROUP_NO like #{groupNo} \n" +
" AND SPECIAL_TYPE<> 1 )\n" +
"and cardT.ACCEPT_NO like #{groupNo}\n" +
"and PERSON_POST.state = 9")
public List<Map<String, Object>> selectYJZ(@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" + @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" + "select UPLOAD_NO,ACCEPT_NO,NAME,#{policeCode},ID_NO,SIGN_GOVT,#{receiptId},SEX_NO\n" +
......
...@@ -100,6 +100,7 @@ public interface ReceiptService { ...@@ -100,6 +100,7 @@ public interface ReceiptService {
public List<Map<String,Object>> findReceiptListCount(String groupNo); public List<Map<String,Object>> findReceiptListCount(String groupNo);
public List<Map<String, Object>> selectYJZ(String groupNo);
public boolean createDetailReceiptList(String receiptId,String groupNo,String policeCode); public boolean createDetailReceiptList(String receiptId,String groupNo,String policeCode);
......
...@@ -508,7 +508,14 @@ public class ReceiptServiceImpl implements ReceiptService { ...@@ -508,7 +508,14 @@ public class ReceiptServiceImpl implements ReceiptService {
public List<Map<String,Object>> findReceiptListCount(String groupNo){ public List<Map<String,Object>> findReceiptListCount(String groupNo){
List<Map<String,Object>> list= receiptMapper.findReceiptListCount(groupNo); List<Map<String,Object>> list= receiptMapper.findReceiptListCount(groupNo);
return list; return list;
}; }
@Override
public List<Map<String, Object>> selectYJZ(String groupNo) {
return receiptMapper.selectYJZ(groupNo);
}
;
@Override @Override
public boolean createDetailReceiptList(String receiptId,String groupNo,String policeCode) { public boolean createDetailReceiptList(String receiptId,String groupNo,String policeCode) {
receiptMapper.createDetailReceiptList(receiptId,groupNo,policeCode); receiptMapper.createDetailReceiptList(receiptId,groupNo,policeCode);
......
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