Commit acf4aac2 authored by Administrator's avatar Administrator

补充修改

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