Commit acf4aac2 authored by Administrator's avatar Administrator

补充修改

parent 660514b6
...@@ -48,169 +48,173 @@ public class ReceiptApi { ...@@ -48,169 +48,173 @@ public class ReceiptApi {
if ("长期".equals(expireDate)){ if ("长期".equals(expireDate)){
expireDate="00000000"; expireDate="00000000";
} }
Map<String,Object> map = new HashMap<>(); if(name.equals(null)|| beginDate.equals(null)|| id.equals(null)|| expireDate.equals(null)){
if (receiptService.selectSpecialCardByAcceptNo(id,replaceDate(beginDate),replaceDate(expireDate)) == 1) { return null;
//查询这个受理号是否生成了交接单 }else {
List<Map<String, Object>> mapList = receiptService.selectCountById(id,replaceDate(beginDate),replaceDate(expireDate)); Map <String, Object> map=new HashMap <>();
//判断是否生成了交接单 if(receiptService.selectSpecialCardByAcceptNo(id, replaceDate(beginDate), replaceDate(expireDate)) == 1){
if (mapList.size() == 0) { //查询这个受理号是否生成了交接单
try { List <Map <String, Object>> mapList=receiptService.selectCountById(id, replaceDate(beginDate), replaceDate(expireDate));
//查询特证交接单所需数据 //判断是否生成了交接单
Map<String, Object> resultDate = receiptService.selectReceiptListDate(id,replaceDate(beginDate),replaceDate(expireDate)); if(mapList.size() == 0){
ReceiptListEntity receiptListEntity = new ReceiptListEntity(); try {
//查询特证交接单所需数据
Long card_type = Long.valueOf((BigDecimal) resultDate.get("CARD_TYPE") + ""); Map <String, Object> resultDate=receiptService.selectReceiptListDate(id, replaceDate(beginDate), replaceDate(expireDate));
receiptListEntity.setCardTypeId(card_type); ReceiptListEntity receiptListEntity=new ReceiptListEntity();
if (card_type==9){
receiptListEntity.setPoliceCode("110001580800"); Long card_type=Long.valueOf((BigDecimal) resultDate.get("CARD_TYPE") + "");
}else { receiptListEntity.setCardTypeId(card_type);
receiptListEntity.setPoliceCode(resultDate.get("GAJG_DM").toString()); if(card_type == 9){
receiptListEntity.setPoliceCode("110001580800");
} else {
receiptListEntity.setPoliceCode(resultDate.get("GAJG_DM").toString());
}
if("null".equals(resultDate.get("OLD_CARD_TYPE") + "")){
} else {
receiptListEntity.setOldCardTypeId(Long.valueOf(resultDate.get("OLD_CARD_TYPE") + ""));
}
receiptListEntity.setFinishCount(Long.valueOf(resultDate.get("VALID_COUNT").toString()));
receiptListEntity.setQrCode(resultDate.get("ACCEPT_NO").toString());
map.put("qrCode", resultDate.get("ACCEPT_NO").toString());
receiptListEntity.setState((long) 0);
receiptListEntity.setCheckName(name);
//生成特证交接单
long S=receiptService.createReceiptList(receiptListEntity);
//查询特证详单所需数据
Map <String, Object> detailedData=receiptService.selectDetailedData2(id, replaceDate(beginDate), replaceDate(expireDate));
String uploadNo=(String) detailedData.get("UPLOAD_NO");
String acceptNo2=(String) detailedData.get("ACCEPT_NO");
String name2=(String) detailedData.get("NAME");
String sex=(String) detailedData.get("SEX_NO");
String signGovt=(String) detailedData.get("SIGN_GOVT");
String gajg_dm=(String) detailedData.get("GAJG_DM");
Long receiptId=receiptListEntity.getId();
//生成特证详单
receiptService.createDetailedList(uploadNo, acceptNo2, name2, id, gajg_dm, receiptId, sex, signGovt);
map.put("show", true);
map.put("state", 1);
map.put("count", 1);
map.put("policeName", receiptService.selectPoliceName(gajg_dm));
map.put("msg", "生成交接单");
map.put("id", S);
} catch (Exception e) {
logger.error("证件ID:" + id + "生成人姓名:" + name + "起始有效期:" + beginDate + "截止有效期" + expireDate);
logger.error("Exception 生成交接单异常", e);
} }
if ("null".equals(resultDate.get("OLD_CARD_TYPE") + "")) { return map;
} else { } else {
receiptListEntity.setOldCardTypeId(Long.valueOf(resultDate.get("OLD_CARD_TYPE") + "")); try {
//已经生成特证交接单,不做操作。
map.put("show", false);
map.put("state", 2);
map.put("msg", "已生成交接单");
List <Map <String, Object>> list=receiptService.selectQrCodeByCardID(id, beginDate, expireDate);
map.put("qrCode", (list.size() > 0 ? list.get(0).get("QR_CODE") : null));
map.put("id", mapList.get(0).get("ID"));
map.put("checkName", mapList.get(0).get("CHECK_NAME"));
map.put("count", 1);
map.put("policeName", mapList.get(0).get("GAJG_MC"));
} catch (Exception e) {
logger.error("证件ID:" + id + "生成人姓名:" + name + "起始有效期:" + beginDate + "截止有效期" + expireDate);
logger.error("Exception 已经生成特证交接单", e);
} }
receiptListEntity.setFinishCount(Long.valueOf(resultDate.get("VALID_COUNT").toString())); return map;
receiptListEntity.setQrCode(resultDate.get("ACCEPT_NO").toString());
map.put("qrCode",resultDate.get("ACCEPT_NO").toString());
receiptListEntity.setState((long) 0);
receiptListEntity.setCheckName(name);
//生成特证交接单
long S = receiptService.createReceiptList(receiptListEntity);
//查询特证详单所需数据
Map<String, Object> detailedData = receiptService.selectDetailedData2(id,replaceDate(beginDate),replaceDate(expireDate));
String uploadNo = (String) detailedData.get("UPLOAD_NO");
String acceptNo2 = (String) detailedData.get("ACCEPT_NO");
String name2 = (String) detailedData.get("NAME");
String sex = (String) detailedData.get("SEX_NO");
String signGovt = (String) detailedData.get("SIGN_GOVT");
String gajg_dm = (String) detailedData.get("GAJG_DM");
Long receiptId = receiptListEntity.getId();
//生成特证详单
receiptService.createDetailedList(uploadNo, acceptNo2, name2, id, gajg_dm, receiptId, sex, signGovt);
map.put("show",true);
map.put("state",1);
map.put("count",1);
map.put("policeName",receiptService.selectPoliceName(gajg_dm));
map.put("msg","生成交接单");
map.put("id",S);
}catch (Exception e){
logger.error("证件ID:" + id + "生成人姓名:" + name + "起始有效期:" + beginDate + "截止有效期" + expireDate);
logger.error("Exception 生成交接单异常", e);
} }
return map;
} else { } else {
try { try {
//已经生成特证交接单,不做操作。 //根据身份证号查组号
map.put("show",false); String groupNo=receiptService.selectGroupNoById(id, replaceDate(beginDate), replaceDate(expireDate));
map.put("state",2); //查询详单所需数据
map.put("msg","已生成交接单"); List <Map <String, Object>> receiptListDate=receiptService.selectReceiptListDate2(groupNo);
List<Map<String, Object>> list = receiptService.selectQrCodeByCardID( id, beginDate, expireDate);
map.put("qrCode",(list.size()>0?list.get(0).get("QR_CODE"):null)); for (int i=0; i < receiptListDate.size(); i++) {
map.put("id",mapList.get(0).get("ID"));
map.put("checkName",mapList.get(0).get("CHECK_NAME")); ReceiptListEntity receiptListEntity=new ReceiptListEntity();
map.put("count",1); Long card_type=Long.valueOf((BigDecimal) receiptListDate.get(i).get("CARD_TYPE") + "");
map.put("policeName",mapList.get(0).get("GAJG_MC")); receiptListEntity.setCardTypeId(card_type);
}catch (Exception e){ if(card_type == 9){
logger.error("证件ID:" + id + "生成人姓名:" + name + "起始有效期:" + beginDate + "截止有效期" + expireDate); receiptListEntity.setPoliceCode("110001580800");
logger.error("Exception 已经生成特证交接单", e); } else {
} receiptListEntity.setPoliceCode(receiptListDate.get(i).get("GAJG_DM").toString());
return map; }
} if("null".equals(receiptListDate.get(i).get("OLD_CARD_TYPE") + "")){
} else {
try {
//根据身份证号查组号
String groupNo = receiptService.selectGroupNoById(id,replaceDate(beginDate),replaceDate(expireDate));
//查询详单所需数据
List<Map<String, Object>> receiptListDate = receiptService.selectReceiptListDate2(groupNo);
for (int i = 0; i < receiptListDate.size(); i++) {
ReceiptListEntity receiptListEntity = new ReceiptListEntity();
Long card_type = Long.valueOf((BigDecimal) receiptListDate.get(i).get("CARD_TYPE") + "");
receiptListEntity.setCardTypeId(card_type);
if (card_type==9){
receiptListEntity.setPoliceCode("110001580800");
}else {
receiptListEntity.setPoliceCode(receiptListDate.get(i).get("GAJG_DM").toString());
}
if ("null".equals(receiptListDate.get(i).get("OLD_CARD_TYPE") + "")) {
} else { } else {
receiptListEntity.setOldCardTypeId(Long.valueOf(receiptListDate.get(i).get("OLD_CARD_TYPE") + "")); receiptListEntity.setOldCardTypeId(Long.valueOf(receiptListDate.get(i).get("OLD_CARD_TYPE") + ""));
} }
receiptListEntity.setFinishCount((long) receiptListDate.size()); receiptListEntity.setFinishCount((long) receiptListDate.size());
receiptListEntity.setQrCode(receiptListDate.get(i).get("GROUP_NO").toString()); receiptListEntity.setQrCode(receiptListDate.get(i).get("GROUP_NO").toString());
map.put("qrCode",receiptListDate.get(i).get("GROUP_NO").toString()); map.put("qrCode", receiptListDate.get(i).get("GROUP_NO").toString());
// 状态0未复核 // 状态0未复核
receiptListEntity.setState((long) 0); receiptListEntity.setState((long) 0);
receiptListEntity.setCheckName(name); receiptListEntity.setCheckName(name);
//查询这个组号是否生成了交接单 //查询这个组号是否生成了交接单
List<Map<String, Object>> mapList = receiptService.selectByGroupNo(receiptListDate.get(i).get("GROUP_NO").toString()); List <Map <String, Object>> mapList=receiptService.selectByGroupNo(receiptListDate.get(i).get("GROUP_NO").toString());
//没有生成交接单 //没有生成交接单
if (mapList.size() == 0) { if(mapList.size() == 0){
try { try {
//生成交接单 //生成交接单
long receiptList = receiptService.createReceiptList(receiptListEntity); long receiptList=receiptService.createReceiptList(receiptListEntity);
for (int n = 0; n < receiptListDate.size(); n++) { for (int n=0; n < receiptListDate.size(); n++) {
//查询这个受理号是否生成了详单 //查询这个受理号是否生成了详单
int receiptCount = receiptService.selectReceiptByAcceptNo(receiptListDate.get(n).get("ACCEPT_NO").toString()); int receiptCount=receiptService.selectReceiptByAcceptNo(receiptListDate.get(n).get("ACCEPT_NO").toString());
//没有生成交接单详单 //没有生成交接单详单
Map<String, Object> detailedData = receiptService.selectDetailedData(receiptListDate.get(n).get("ACCEPT_NO").toString()); Map <String, Object> detailedData=receiptService.selectDetailedData(receiptListDate.get(n).get("ACCEPT_NO").toString());
String uploadNo = (String) detailedData.get("UPLOAD_NO"); String uploadNo=(String) detailedData.get("UPLOAD_NO");
String acceptNo2 = (String) detailedData.get("ACCEPT_NO"); String acceptNo2=(String) detailedData.get("ACCEPT_NO");
String name2 = (String) detailedData.get("NAME"); String name2=(String) detailedData.get("NAME");
String sex = (String) detailedData.get("SEX_NO"); String sex=(String) detailedData.get("SEX_NO");
String signGovt = (String) detailedData.get("SIGN_GOVT"); String signGovt=(String) detailedData.get("SIGN_GOVT");
String gajg_dm = (String) detailedData.get("GAJG_DM"); String gajg_dm=(String) detailedData.get("GAJG_DM");
map.put("policeName",receiptService.selectPoliceName(gajg_dm)); map.put("policeName", receiptService.selectPoliceName(gajg_dm));
if (receiptCount == 0) { if(receiptCount == 0){
int receiptId = Integer.parseInt((BigDecimal) detailedData.get("ID") + ""); int receiptId=Integer.parseInt((BigDecimal) detailedData.get("ID") + "");
//生成详单 //生成详单
receiptService.createDetailedList(uploadNo, acceptNo2, name2, receiptListDate.get(n).get("ID_NO").toString(), gajg_dm, receiptId, sex, signGovt); receiptService.createDetailedList(uploadNo, acceptNo2, name2, receiptListDate.get(n).get("ID_NO").toString(), gajg_dm, receiptId, sex, signGovt);
} else { } else {
//不做操作 //不做操作
} }
} }
map.put("show",true); map.put("show", true);
map.put("state",1); map.put("state", 1);
map.put("count",receiptListDate.size()); map.put("count", receiptListDate.size());
map.put("id",receiptList); map.put("id", receiptList);
}catch (Exception e){ } catch (Exception e) {
logger.error("证件ID:" + id + "生成人姓名:" + name + "起始有效期:" + beginDate + "截止有效期" + expireDate); logger.error("证件ID:" + id + "生成人姓名:" + name + "起始有效期:" + beginDate + "截止有效期" + expireDate);
logger.error("Exception 生成交接单异常", e); logger.error("Exception 生成交接单异常", e);
} }
return map; return map;
} else { } else {
try { try {
//已生成交接单 //已生成交接单
map.put("show",false); map.put("show", false);
map.put("msg","已生成交接单"); map.put("msg", "已生成交接单");
map.put("state",2); map.put("state", 2);
map.put("id",mapList.get(0).get("ID")); map.put("id", mapList.get(0).get("ID"));
List<Map<String, Object>> list = receiptService.selectQrCodeByCardID(id, beginDate, expireDate); List <Map <String, Object>> list=receiptService.selectQrCodeByCardID(id, beginDate, expireDate);
map.put("qrCode",(list.size()>0?list.get(0).get("QR_CODE"):null)); map.put("qrCode", (list.size() > 0 ? list.get(0).get("QR_CODE") : null));
map.put("count",receiptListDate.size()); map.put("count", receiptListDate.size());
map.put("checkName",mapList.get(0).get("CHECK_NAME")); map.put("checkName", mapList.get(0).get("CHECK_NAME"));
map.put("policeName",mapList.get(0).get("GAJG_MC")); map.put("policeName", mapList.get(0).get("GAJG_MC"));
}catch (Exception e){ } catch (Exception e) {
logger.error("证件ID:" + id + "生成人姓名:" + name + "起始有效期:" + beginDate + "截止有效期" + expireDate); logger.error("证件ID:" + id + "生成人姓名:" + name + "起始有效期:" + beginDate + "截止有效期" + expireDate);
logger.error("Exception 已经生成特证交接单", e); logger.error("Exception 已经生成特证交接单", e);
}
return map;
} }
return map;
} }
map.put("show", false);
map.put("state", 3);
map.put("msg", "未查询出对应的信息");
} catch (Exception e) {
logger.error("证件ID:" + id + "生成人姓名:" + name + "起始有效期:" + beginDate + "截止有效期" + expireDate);
logger.error("Exception 生成特证交接单异常", e);
} }
map.put("show",false); return map;
map.put("state",3);
map.put("msg","未查询出对应的信息");
}catch (Exception e){
logger.error("证件ID:" + id + "生成人姓名:" + name + "起始有效期:" + beginDate + "截止有效期" + expireDate);
logger.error("Exception 生成特证交接单异常", e);
} }
return map;
} }
} }
......
...@@ -200,8 +200,8 @@ public interface ReceiptMapper { ...@@ -200,8 +200,8 @@ public interface ReceiptMapper {
"left join GAJG_DM on GAJG_DM.GAJG_DM = RECEIPT_LIST.POLICE_CODE\n" + "left join GAJG_DM on GAJG_DM.GAJG_DM = RECEIPT_LIST.POLICE_CODE\n" +
"left join COUNTY_DIC on substr(RECEIPT_LIST.POLICE_CODE,0,6) = COUNTY_DIC.COUNTY_CODE" + "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 " + " where CHECK_DATE is not null and RECEIPT_LIST.IS_PRINT = 0 " +
"<if test ='startDate != \"\"'> " + "<if test ='startDate != null'> " +
"and to_char(CHECK_DATE,'yyyyMMddhhmmss') BETWEEN ${startDate} and ${endDate} " + "and to_char(CHECK_DATE,'yyyyMMddhhmmss') BETWEEN #{startDate} and #{endDate} " +
"</if>" + "</if>" +
" ORDER BY RECEIPT_LIST.POLICE_CODE" + " ORDER BY RECEIPT_LIST.POLICE_CODE" +
"</script> " + "</script> " +
......
...@@ -150,7 +150,7 @@ public class ReceiptServiceImpl implements ReceiptService { ...@@ -150,7 +150,7 @@ public class ReceiptServiceImpl implements ReceiptService {
@Override @Override
public List<Map<String, Object>> selectReceiptDateByCheckDate(String stratDate,String endDate) { public List<Map<String, Object>> selectReceiptDateByCheckDate(String stratDate,String endDate) {
List<Map<String, Object>> mapList = receiptMapper.selectReceiptDateByCheckDate((stratDate), (endDate)); List<Map<String, Object>> mapList = receiptMapper.selectReceiptDateByCheckDate(stratDate, endDate);
List<Map<String, Object>> mapList1 = formateMap(mapList); List<Map<String, Object>> mapList1 = formateMap(mapList);
return mapList1; return mapList1;
} }
......
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