Commit ab033610 authored by liboyang's avatar liboyang

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

parents 7b26fed1 7d51e93d
...@@ -256,15 +256,14 @@ public class DeliveredApi { ...@@ -256,15 +256,14 @@ public class DeliveredApi {
* @param startDate 登记时间 * @param startDate 登记时间
* @return 返回值 * @return 返回值
*/ */
@RequestMapping("queryDeliveredFailedByRegisterDate")
// @RequiresPermissions("userInfo.add")//权限管理; // @RequiresPermissions("userInfo.add")//权限管理;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public List<Map<String, Object>> queryDeliveredFailedByRegisterDate(@RequestParam("startDate") String startDate,@RequestParam("endDate") String endDate, HttpServletRequest requ) { public List<Map<String, Object>> queryDeliveredFailedByRegisterDate(@RequestParam("startDate") String startDate,@RequestParam("endDate") String endDate,@RequestParam("cardId") String cardId, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr(); String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr); MDC.put("ip", remoteAddr);
List<Map<String, Object>> mapList = new ArrayList<>(); List<Map<String, Object>> mapList = new ArrayList<>();
try { try {
mapList = deliveredService.selectDeliveredFailedByRegisterDate(replaceDate(startDate),replaceDate(endDate)); mapList = deliveredService.selectDeliveredFailedByRegisterDate(replaceDate(startDate),replaceDate(endDate),cardId);
} catch (Exception e) { } catch (Exception e) {
logger.error("登记妥投失败信息时间:" + startDate+"---------"+endDate); logger.error("登记妥投失败信息时间:" + startDate+"---------"+endDate);
logger.error("Exception 查询登记妥投失败信息异常", e); logger.error("Exception 查询登记妥投失败信息异常", e);
......
...@@ -52,6 +52,7 @@ public class ReceiptApi { ...@@ -52,6 +52,7 @@ public class ReceiptApi {
return null; return null;
}else { }else {
Map <String, Object> map=new HashMap <>(); Map <String, Object> map=new HashMap <>();
//查询是否是快证
if(receiptService.selectSpecialCardByAcceptNo(id, replaceDate(beginDate), replaceDate(expireDate)) == 1){ if(receiptService.selectSpecialCardByAcceptNo(id, replaceDate(beginDate), replaceDate(expireDate)) == 1){
//查询这个受理号是否生成了交接单 //查询这个受理号是否生成了交接单
List <Map <String, Object>> mapList=receiptService.selectCountById(id, replaceDate(beginDate), replaceDate(expireDate)); List <Map <String, Object>> mapList=receiptService.selectCountById(id, replaceDate(beginDate), replaceDate(expireDate));
...@@ -61,7 +62,7 @@ public class ReceiptApi { ...@@ -61,7 +62,7 @@ public class ReceiptApi {
//查询特证交接单所需数据 //查询特证交接单所需数据
Map <String, Object> resultDate=receiptService.selectReceiptListDate(id, replaceDate(beginDate), replaceDate(expireDate)); Map <String, Object> resultDate=receiptService.selectReceiptListDate(id, replaceDate(beginDate), replaceDate(expireDate));
ReceiptListEntity receiptListEntity=new ReceiptListEntity(); ReceiptListEntity receiptListEntity=new ReceiptListEntity();
//邮寄证的单位代码设为人口大队的
Long card_type=Long.valueOf((BigDecimal) resultDate.get("CARD_TYPE") + ""); Long card_type=Long.valueOf((BigDecimal) resultDate.get("CARD_TYPE") + "");
receiptListEntity.setCardTypeId(card_type); receiptListEntity.setCardTypeId(card_type);
if(card_type == 9){ if(card_type == 9){
...@@ -126,7 +127,6 @@ public class ReceiptApi { ...@@ -126,7 +127,6 @@ public class ReceiptApi {
String groupNo=receiptService.selectGroupNoById(id, replaceDate(beginDate), replaceDate(expireDate)); String groupNo=receiptService.selectGroupNoById(id, replaceDate(beginDate), replaceDate(expireDate));
//查询详单所需数据 //查询详单所需数据
List <Map <String, Object>> receiptListDate=receiptService.selectReceiptListDate2(groupNo); List <Map <String, Object>> receiptListDate=receiptService.selectReceiptListDate2(groupNo);
for (int i=0; i < receiptListDate.size(); i++) { for (int i=0; i < receiptListDate.size(); i++) {
ReceiptListEntity receiptListEntity=new ReceiptListEntity(); ReceiptListEntity receiptListEntity=new ReceiptListEntity();
...@@ -167,20 +167,17 @@ public class ReceiptApi { ...@@ -167,20 +167,17 @@ public class ReceiptApi {
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));
int receiptId=Integer.parseInt((BigDecimal) detailedData.get("ID") + "");
if(receiptCount == 0){ 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); 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);
......
...@@ -38,7 +38,7 @@ public interface DataAuditingMapper { ...@@ -38,7 +38,7 @@ public interface DataAuditingMapper {
"CARD_TYPE_DIC.CARD_TYPE_ID,1-(sum(DATA_AUDITING.VALID_COUNT)/(sum(DATA_AUDITING.VALID_COUNT)+sum(DATA_AUDITING.inVALID_COUNT))) Failure_rate from DATA_AUDITING \n" + "CARD_TYPE_DIC.CARD_TYPE_ID,1-(sum(DATA_AUDITING.VALID_COUNT)/(sum(DATA_AUDITING.VALID_COUNT)+sum(DATA_AUDITING.inVALID_COUNT))) Failure_rate from DATA_AUDITING \n" +
"left join TASK on TASK.TASK_ID = DATA_AUDITING.TASK_ID\n" + "left join TASK on TASK.TASK_ID = DATA_AUDITING.TASK_ID\n" +
"left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = TASK.CARD_TYPE " + "left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = TASK.CARD_TYPE " +
"left join PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK on subStr(DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO,0,9) = DATA_AUDITING.POLICE_SUBSTATION\n" + "left join PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK on DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO = DATA_AUDITING.POLICE_SUBSTATION\n" +
"where 1=1 " + "where 1=1 " +
" <if test = 'policeName != null' >" + " <if test = 'policeName != null' >" +
" and DIC_UPLOAD_UNIT_T.UNIT_NAME like ${policeName}"+ " and DIC_UPLOAD_UNIT_T.UNIT_NAME like ${policeName}"+
......
...@@ -25,7 +25,7 @@ public interface DeliveredInfoMapper { ...@@ -25,7 +25,7 @@ public interface DeliveredInfoMapper {
"select to_char(PRINT_DATE,'yyyyMMdd') PRINT_DATE ,count(PERSON_POST.WAYBILL_NUMBER) post_Count,\n" + "select to_char(PRINT_DATE,'yyyyMMdd') PRINT_DATE ,count(PERSON_POST.WAYBILL_NUMBER) post_Count,\n" +
"sum(decode(DELIVERED_INFO.deal_state,1,1,0)) DELIVERED_count,\n" + "sum(decode(DELIVERED_INFO.deal_state,1,1,0)) DELIVERED_count,\n" +
"sum(decode(DELIVERED_INFO.deal_state,0,1,0)) DELIVERED_FAILED_count,\n" + "sum(decode(DELIVERED_INFO.deal_state,0,1,0)) DELIVERED_FAILED_count,\n" +
"'0' REPORT_TYPE \n" + "'0' REPORT_TYPE,0 CANCEL_COUNT \n" +
"from PERSON_POST \n" + "from PERSON_POST \n" +
"left join DELIVERED_INFO on PERSON_POST.WAYBILL_NUMBER = DELIVERED_INFO.WAYBILL_NUMBER\n" + "left join DELIVERED_INFO on PERSON_POST.WAYBILL_NUMBER = DELIVERED_INFO.WAYBILL_NUMBER\n" +
"where 1=1\n" + "where 1=1\n" +
...@@ -36,7 +36,7 @@ public interface DeliveredInfoMapper { ...@@ -36,7 +36,7 @@ public interface DeliveredInfoMapper {
"select RECEIPT_DATE PRINT_DATE ,\n" + "select RECEIPT_DATE PRINT_DATE ,\n" +
"count(GREEN_PACKAGE_INFORMATION.WAYBILL_NUMBER) post_Count, sum(decode(DELIVERED_INFO.deal_state,1,1,0)) DELIVERED_count, \n" + "count(GREEN_PACKAGE_INFORMATION.WAYBILL_NUMBER) post_Count, sum(decode(DELIVERED_INFO.deal_state,1,1,0)) DELIVERED_count, \n" +
"sum(decode(DELIVERED_INFO.deal_state,0,1,0)) DELIVERED_FAILED_count, \n" + "sum(decode(DELIVERED_INFO.deal_state,0,1,0)) DELIVERED_FAILED_count, \n" +
"'1' REPORT_TYPE \n" + "'1' REPORT_TYPE,0 CANCEL_COUNT \n" +
"from GREEN_PACKAGE_INFORMATION \n" + "from GREEN_PACKAGE_INFORMATION \n" +
"left join DELIVERED_INFO on GREEN_PACKAGE_INFORMATION.WAYBILL_NUMBER = DELIVERED_INFO.WAYBILL_NUMBER \n" + "left join DELIVERED_INFO on GREEN_PACKAGE_INFORMATION.WAYBILL_NUMBER = DELIVERED_INFO.WAYBILL_NUMBER \n" +
"where 1=1 and RECEIPT_DATE BETWEEN #{startDate} and #{endDate} group by RECEIPT_DATE" + "where 1=1 and RECEIPT_DATE BETWEEN #{startDate} and #{endDate} group by RECEIPT_DATE" +
...@@ -45,7 +45,7 @@ public interface DeliveredInfoMapper { ...@@ -45,7 +45,7 @@ public interface DeliveredInfoMapper {
"select to_char(PRINT_DATE,'yyyyMMdd') PRINT_DATE ,count(PERSON_POST.WAYBILL_NUMBER) post_Count,\n" + "select to_char(PRINT_DATE,'yyyyMMdd') PRINT_DATE ,count(PERSON_POST.WAYBILL_NUMBER) post_Count,\n" +
"sum(decode(DELIVERED_INFO.deal_state,1,1,0)) DELIVERED_count,\n" + "sum(decode(DELIVERED_INFO.deal_state,1,1,0)) DELIVERED_count,\n" +
"sum(decode(DELIVERED_INFO.deal_state,0,1,0)) DELIVERED_FAILED_count, \n" + "sum(decode(DELIVERED_INFO.deal_state,0,1,0)) DELIVERED_FAILED_count, \n" +
"'0' REPORT_TYPE \n" + "'0' REPORT_TYPE, 0 CANCEL_COUNT \n" +
"from PERSON_POST \n" + "from PERSON_POST \n" +
"left join DELIVERED_INFO on PERSON_POST.WAYBILL_NUMBER = DELIVERED_INFO.WAYBILL_NUMBER\n" + "left join DELIVERED_INFO on PERSON_POST.WAYBILL_NUMBER = DELIVERED_INFO.WAYBILL_NUMBER\n" +
"where 1=1\n" + "where 1=1\n" +
...@@ -55,7 +55,7 @@ public interface DeliveredInfoMapper { ...@@ -55,7 +55,7 @@ public interface DeliveredInfoMapper {
"select RECEIPT_DATE PRINT_DATE ,\n" + "select RECEIPT_DATE PRINT_DATE ,\n" +
"count(GREEN_PACKAGE_INFORMATION.WAYBILL_NUMBER) post_Count, sum(decode(DELIVERED_INFO.deal_state,1,1,0)) DELIVERED_count, \n" + "count(GREEN_PACKAGE_INFORMATION.WAYBILL_NUMBER) post_Count, sum(decode(DELIVERED_INFO.deal_state,1,1,0)) DELIVERED_count, \n" +
"sum(decode(DELIVERED_INFO.deal_state,0,1,0)) DELIVERED_FAILED_count, \n" + "sum(decode(DELIVERED_INFO.deal_state,0,1,0)) DELIVERED_FAILED_count, \n" +
"'1' REPORT_TYPE \n" + "'1' REPORT_TYPE, 0 CANCEL_COUNT \n" +
"from GREEN_PACKAGE_INFORMATION \n" + "from GREEN_PACKAGE_INFORMATION \n" +
"left join DELIVERED_INFO on GREEN_PACKAGE_INFORMATION.WAYBILL_NUMBER = DELIVERED_INFO.WAYBILL_NUMBER \n" + "left join DELIVERED_INFO on GREEN_PACKAGE_INFORMATION.WAYBILL_NUMBER = DELIVERED_INFO.WAYBILL_NUMBER \n" +
"where 1=1 and RECEIPT_DATE BETWEEN #{startDate} and #{endDate} group by RECEIPT_DATE" + "where 1=1 and RECEIPT_DATE BETWEEN #{startDate} and #{endDate} group by RECEIPT_DATE" +
...@@ -63,6 +63,11 @@ public interface DeliveredInfoMapper { ...@@ -63,6 +63,11 @@ public interface DeliveredInfoMapper {
"</script>") "</script>")
public List<Map<String, Object>> selectReport(@Param("startDate") String startDate, @Param("endDate") String endDate,@Param("reportType")int reportType); public List<Map<String, Object>> selectReport(@Param("startDate") String startDate, @Param("endDate") String endDate,@Param("reportType")int reportType);
@Select("SELECT PRINT_DATE,COUNT(PERSON_POST.STATE1) CANCEL_COUNT " +
"FROM (SELECT to_char(PRINT_DATE,'yyyyMMdd') PRINT_DATE,STATE1 FROM PERSON_POST WHERE PERSON_POST.STATE1 = 1 ) PERSON_POST \n" +
"WHERE PERSON_POST.STATE1 = 1 GROUP BY PRINT_DATE")
public List<Map<String,Object>> selectCancelCount(@Param("startDate")String startDate,@Param("endDate") String endDate);
@Select("select FILE_NAME,IMPORT_DATE,IMPORT_NAME,DELIVERED_INFO.FILE_ID,sum(decode(DELIVERED_INFO.DEAL_STATE,1,1,0)) delive,\n" + @Select("select FILE_NAME,IMPORT_DATE,IMPORT_NAME,DELIVERED_INFO.FILE_ID,sum(decode(DELIVERED_INFO.DEAL_STATE,1,1,0)) delive,\n" +
"sum(decode(DELIVERED_INFO.DEAL_STATE,0,1,0)) undelice \n" + "sum(decode(DELIVERED_INFO.DEAL_STATE,0,1,0)) undelice \n" +
"from DELIVERED_IMPORT_DIC \n" + "from DELIVERED_IMPORT_DIC \n" +
...@@ -71,10 +76,19 @@ public interface DeliveredInfoMapper { ...@@ -71,10 +76,19 @@ public interface DeliveredInfoMapper {
"group by FILE_NAME,IMPORT_DATE,IMPORT_NAME,DELIVERED_INFO.FILE_ID order by to_char(import_date,'yyyy-mm-dd')") "group by FILE_NAME,IMPORT_DATE,IMPORT_NAME,DELIVERED_INFO.FILE_ID order by to_char(import_date,'yyyy-mm-dd')")
public List<Map<String,Object>> selectDeliveredByImportDate(@Param("date") String date); public List<Map<String,Object>> selectDeliveredByImportDate(@Param("date") String date);
@Select("select DELIVERED_FAILED_INFO.*,DELIVERED_FAILED_REASON.REASON from DELIVERED_FAILED_INFO\n" + @Select("<script>" +
"select DELIVERED_FAILED_INFO.*,DELIVERED_FAILED_REASON.REASON " +
"from DELIVERED_FAILED_INFO\n" +
"left join DELIVERED_FAILED_REASON on DELIVERED_FAILED_REASON.ID = DELIVERED_FAILED_INFO.BACK_REASON\n" + "left join DELIVERED_FAILED_REASON on DELIVERED_FAILED_REASON.ID = DELIVERED_FAILED_INFO.BACK_REASON\n" +
"where to_char(back_date,'yyyyMMdd') between #{startDate} and #{endDate}") "where 1=1 " +
public List<Map<String,Object>> selectDeliveredFailedByRegisterDate(@Param("startDate")String startDate,@Param("endDate")String endDate); " <if test='startDate!=null'> "+
" AND to_char(back_date,'yyyyMMdd') between #{startDate} and #{endDate}" +
" </if>"+
" <if test='cardId!=null'> "+
" AND DELIVERED_FAILED_INFO.CARD_ID = #{cardId} " +
" </if>"+
"</script>")
public List<Map<String,Object>> selectDeliveredFailedByRegisterDate(@Param("startDate")String startDate,@Param("endDate")String endDate,@Param("cardId")String cardId);
@Delete("delete from DELIVERED_INFO where FILE_ID = #{fileId}") @Delete("delete from DELIVERED_INFO where FILE_ID = #{fileId}")
public boolean deleteDeliveredByFileId(@Param("fileId") long fileId); public boolean deleteDeliveredByFileId(@Param("fileId") long fileId);
...@@ -99,7 +113,8 @@ public interface DeliveredInfoMapper { ...@@ -99,7 +113,8 @@ public interface DeliveredInfoMapper {
"where RECEIPT_DATE in (${date})") "where RECEIPT_DATE in (${date})")
public List<Map<String,Object>> selectDeliverData(@Param("date")String date); public List<Map<String,Object>> selectDeliverData(@Param("date")String date);
@Select("select * from DETAIL_RECEIPT_LIST left join PERSON_POST on PERSON_POST.ID_CARD = DETAIL_RECEIPT_LIST.CARD_ID where PERSON_POST.BACK_WAYBILL_NUMBER = #{waybillNumber} and DETAIL_RECEIPT_LIST.CARD_ID = #{cardId} ") @Select("select * from DETAIL_RECEIPT_LIST left join PERSON_POST on PERSON_POST.ID_CARD = DETAIL_RECEIPT_LIST.CARD_ID " +
"where PERSON_POST.BACK_WAYBILL_NUMBER = #{waybillNumber} and DETAIL_RECEIPT_LIST.CARD_ID = #{cardId} ")
public List<Map<String, Object>> selectDeliverDataByWaybillNumber(@Param("waybillNumber")String waybillNumber,@Param("cardId")String cardId); public List<Map<String, Object>> selectDeliverDataByWaybillNumber(@Param("waybillNumber")String waybillNumber,@Param("cardId")String cardId);
@Select("select DELIVERED_FAILED_INFO.*,DELIVERED_FAILED_REASON.REASON from DELIVERED_FAILED_INFO\n" + @Select("select DELIVERED_FAILED_INFO.*,DELIVERED_FAILED_REASON.REASON from DELIVERED_FAILED_INFO\n" +
...@@ -114,5 +129,4 @@ public interface DeliveredInfoMapper { ...@@ -114,5 +129,4 @@ public interface DeliveredInfoMapper {
"left join DELIVERED_FAILED_REASON on DELIVERED_FAILED_REASON.ID = DELIVERED_FAILED_INFO.BACK_REASON\n" + "left join DELIVERED_FAILED_REASON on DELIVERED_FAILED_REASON.ID = DELIVERED_FAILED_INFO.BACK_REASON\n" +
"where to_char(RECEIVE_DATE,'yyyyMMdd') between #{startDate} and #{endDate}") "where to_char(RECEIVE_DATE,'yyyyMMdd') between #{startDate} and #{endDate}")
public List<Map<String, Object>> selectDeliveredFailedByReceiveDate(@Param("startDate")String startDate,@Param("endDate")String endDate); public List<Map<String, Object>> selectDeliveredFailedByReceiveDate(@Param("startDate")String startDate,@Param("endDate")String endDate);
} }
...@@ -44,10 +44,10 @@ public interface FileNameDicMapper { ...@@ -44,10 +44,10 @@ public interface FileNameDicMapper {
"<if test='analysisState != -1 ' >" + "<if test='analysisState != -1 ' >" +
" and STATE =#{analysisState}" + " and STATE =#{analysisState}" +
"</if>" + "</if>" +
"<if test='uploadDate !=\"\" ' >" + "<if test='uploadDate !=null ' >" +
" and substr(UPLOAD_DATE,0,8) =#{uploadDate}" + " and substr(UPLOAD_DATE,0,8) =#{uploadDate}" +
"</if>" + "</if>" +
"<if test='fileName != \"\" ' >" + "<if test='fileName != null ' >" +
" and FILE_NAME =#{fileName}" + " and FILE_NAME =#{fileName}" +
"</if>" + "</if>" +
" </where>" + " </where>" +
...@@ -67,10 +67,10 @@ public interface FileNameDicMapper { ...@@ -67,10 +67,10 @@ public interface FileNameDicMapper {
"<if test='analysisState != -1 ' >" + "<if test='analysisState != -1 ' >" +
" and STATE =#{analysisState}" + " and STATE =#{analysisState}" +
"</if>" + "</if>" +
"<if test='uploadDate !=\"\"' >" + "<if test='uploadDate !=null' >" +
" and substr(UPLOAD_DATE,0,8) = #{uploadDate}" + " and substr(UPLOAD_DATE,0,8) = #{uploadDate}" +
"</if>" + "</if>" +
"<if test='fileName != \"\" ' >" + "<if test='fileName != null ' >" +
" and FILE_NAME = #{fileName}" + " and FILE_NAME = #{fileName}" +
"</if> </where> </script>") "</if> </where> </script>")
public List<FileNameDicEntity> queryFileNameDicCount(@Param("uploadDate") String uploadDate, @Param("fileName") String fileName, @Param("analysisState") long analysisState); public List<FileNameDicEntity> queryFileNameDicCount(@Param("uploadDate") String uploadDate, @Param("fileName") String fileName, @Param("analysisState") long analysisState);
......
...@@ -12,7 +12,8 @@ public interface InfoManagementMapper { ...@@ -12,7 +12,8 @@ public interface InfoManagementMapper {
"SELECT * FROM " + "SELECT * FROM " +
" ( " + " ( " +
"SELECT A.*, ROWNUM RN " + "SELECT A.*, ROWNUM RN " +
"FROM (select * from new_files \n" + "FROM (select new_files.*,PREPRO_PERSON.CARD_TYPE_ID " +
"from new_files left join PREPRO_PERSON ON new_files.ID = PREPRO_PERSON.NEW_FILE_ID \n" +
"where 1=1\n" + "where 1=1\n" +
"<if test='beginFileName != \"\" '>" + "<if test='beginFileName != \"\" '>" +
"and (id between #{beginFileName} and #{endFileName} )\n" + "and (id between #{beginFileName} and #{endFileName} )\n" +
......
...@@ -31,7 +31,7 @@ public interface PersonPostMapper { ...@@ -31,7 +31,7 @@ public interface PersonPostMapper {
@Select("<script> " + @Select("<script> " +
"SELECT * FROM " + "SELECT DISTINCT * FROM " +
"( " + "( " +
"SELECT A.*, ROWNUM RN " + "SELECT A.*, ROWNUM RN " +
" from (SELECT DISTINCT PERSON_POST.*" + " from (SELECT DISTINCT PERSON_POST.*" +
......
...@@ -12,16 +12,15 @@ import java.util.Map; ...@@ -12,16 +12,15 @@ import java.util.Map;
public interface ReceiptMapper { public interface ReceiptMapper {
//根据身份证号查询特证交接单信息 //根据身份证号查询特证交接单信息
@Select("select prod_group_t.group_no,prod_card_t.accept_no,subStr(prod_card_t.UPLOAD_NO,0,9) as GAJG_DM,\n" + @Select("select prod_group_t.group_no,prod_card_t.accept_no,prod_card_t.UPLOAD_NO as GAJG_DM,\n" +
"count(prod_card_t.accept_no) valid_count,DIC_UPLOAD_UNIT_T.UNIT_NAME GAJG_MC, task.CARD_TYPE,task.OLD_CARD_TYPE \n" + "count(prod_card_t.accept_no) valid_count,DIC_UPLOAD_UNIT_T.UNIT_NAME GAJG_MC, task.CARD_TYPE,task.OLD_CARD_TYPE \n" +
"from PRODYD_DBA.prod_card_t@PRODYD_LINK \n" + "from PRODYD_DBA.prod_card_t@PRODYD_LINK \n" +
"left join PRODYD_DBA.prod_group_t@PRODYD_LINK on subStr(prod_card_t.accept_no,0,8)= prod_group_t.group_no \n" +
"left join SPECIAL_CARD on SPECIAL_CARD.ACCEPT_NO = prod_card_t.accept_no\n" + "left join SPECIAL_CARD on SPECIAL_CARD.ACCEPT_NO = prod_card_t.accept_no\n" +
"left join GROUP_NO on GROUP_NO.GROUP_NO = SPECIAL_CARD.GROUP_NO \n" +
"left join task on task.task_id =SPECIAL_CARD.task_id \n" + "left join task on task.task_id =SPECIAL_CARD.task_id \n" +
"left join PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK on subStr(prod_card_t.UPLOAD_NO,0,9)= subStr(DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO,0,9) \n" + "left join PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK on subStr(prod_card_t.UPLOAD_NO,0,9)= subStr(DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO,0,9) \n" +
"where prod_card_t.id_no=#{id} and prod_card_t.BEGIN_DATE= #{beginDate} and prod_card_t.EXPIRE_DATE = #{expireDate} \n" + "where prod_card_t.id_no=#{id} and prod_card_t.BEGIN_DATE= #{beginDate} and prod_card_t.EXPIRE_DATE = #{expireDate} \n" +
"group by prod_group_t.group_no, prod_card_t.accept_no, subStr(prod_card_t.UPLOAD_NO,0,9), DIC_UPLOAD_UNIT_T.UNIT_NAME, task.CARD_TYPE, \n" + "group by GROUP_NO.GROUP_NO, prod_card_t.accept_no, DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO, DIC_UPLOAD_UNIT_T.UNIT_NAME, task.CARD_TYPE, task.OLD_CARD_TYPE ")
"task.OLD_CARD_TYPE ")
public Map<String,Object> selectReceiptListDate(@Param("id")String id,@Param("beginDate")String beginDate,@Param("expireDate")String expireDate); public Map<String,Object> selectReceiptListDate(@Param("id")String id,@Param("beginDate")String beginDate,@Param("expireDate")String expireDate);
//根据身份证号查组号 //根据身份证号查组号
...@@ -29,16 +28,14 @@ public interface ReceiptMapper { ...@@ -29,16 +28,14 @@ public interface ReceiptMapper {
public List<Map<String,Object>> selectGroupNoById(@Param("id")String id,@Param("beginDate")String beginDate,@Param("expireDate")String expireDate); public List<Map<String,Object>> selectGroupNoById(@Param("id")String id,@Param("beginDate")String beginDate,@Param("expireDate")String expireDate);
//根据组号查询普通证交接单信息 //根据组号查询普通证交接单信息
@Select("select prod_group_t.group_no,prod_card_t.accept_no,subStr(prod_card_t.UPLOAD_NO,0,9) as GAJG_DM,\n" + @Select("selectsubStr(prod_card_t.accept_no,0,8) group_no,prod_card_t.accept_no,DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO as GAJG_DM,\n" +
"count(prod_card_t.accept_no) valid_count,DIC_UPLOAD_UNIT_T.UNIT_NAME GAJG_MC, task.CARD_TYPE,task.OLD_CARD_TYPE,prod_card_t.id_no,prod_card_t.sex_no,prod_card_t.upload_no \n" + "count(prod_card_t.accept_no) valid_count,DIC_UPLOAD_UNIT_T.UNIT_NAME GAJG_MC, task.CARD_TYPE,task.OLD_CARD_TYPE,prod_card_t.id_no,prod_card_t.sex_no,prod_card_t.upload_no \n" +
"from PRODYD_DBA.prod_card_t@PRODYD_LINK \n" + "from PRODYD_DBA.prod_card_t@PRODYD_LINK \n" +
"left join PRODYD_DBA.prod_group_t@PRODYD_LINK on subStr(prod_card_t.accept_no,0,8)= prod_group_t.group_no \n" + "left join group_no on group_no.group_no =subStr(prod_card_t.accept_no,0,8)\n" +
"left join group_no on group_no.group_no = prod_group_t.group_no \n" +
"left join task on task.task_id =group_no.task_id \n" + "left join task on task.task_id =group_no.task_id \n" +
"left join PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK on subStr(prod_card_t.UPLOAD_NO,0,9)= subStr(DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO,0,9) \n" + "left join PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK on subStr(prod_card_t.UPLOAD_NO,0,9)= subStr(DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO,0,9) \n" +
"where substr(prod_card_t.accept_no,0,8) =#{groupNo} and prod_card_t.accept_no not in (select accept_no from SPECIAL_CARD ) \n" + "where substr(prod_card_t.accept_no,0,8) =substr(#{groupNo},0,8) and prod_card_t.accept_no not in (select accept_no from SPECIAL_CARD where accept_no like #{groupNo} ) \n" +
"group by prod_group_t.group_no, prod_card_t.accept_no, subStr(prod_card_t.UPLOAD_NO,0,9), DIC_UPLOAD_UNIT_T.UNIT_NAME, task.CARD_TYPE, \n" + "group by prod_card_t.accept_no,DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO, DIC_UPLOAD_UNIT_T.UNIT_NAME, task.CARD_TYPE,task.OLD_CARD_TYPE,prod_card_t.id_no,prod_card_t.sex_no,prod_card_t.upload_no")
"task.OLD_CARD_TYPE,prod_card_t.id_no,prod_card_t.sex_no,prod_card_t.upload_no ")
public List<Map<String,Object>> selectReceiptListDate2(String groupNo); public List<Map<String,Object>> selectReceiptListDate2(String groupNo);
//查询这个组号是否已经生成交接单 //查询这个组号是否已经生成交接单
...@@ -74,15 +71,9 @@ public interface ReceiptMapper { ...@@ -74,15 +71,9 @@ public interface ReceiptMapper {
public long saveReceiptList(ReceiptListEntity receiptListEntity); public long saveReceiptList(ReceiptListEntity receiptListEntity);
//根据身份证号查询交接单详单信息 //根据身份证号查询交接单详单信息
@Select("select prod_card_t.upload_no," + @Select("select prod_card_t.upload_no, PROD_CARD_T.ACCEPT_NO, prod_card_t.name," +
"PROD_CARD_T.ACCEPT_NO," + "prod_card_t.SEX_NO, prod_card_t.id_no, DIC_UPLOAD_UNIT_T.UNIT_NAME GAJG_MC,"+
"prod_card_t.name," + "PROD_CARD_T.SIGN_GOVT,DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO GAJG_DM,receipt_list.ID\n" +
"prod_card_t.SEX_NO,"+
"prod_card_t.id_no," +
"DIC_UPLOAD_UNIT_T.UNIT_NAME GAJG_MC,"+
"PROD_CARD_T.SIGN_GOVT,"+
"subStr(prod_card_t.UPLOAD_NO,0,9) AS GAJG_DM," +
"receipt_list.ID\n" +
"from PRODYD_DBA.prod_card_t@PRODYD_LINK\n" + "from PRODYD_DBA.prod_card_t@PRODYD_LINK\n" +
"left join PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK on subStr(DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO,0,9) = subStr(prod_card_t.UPLOAD_NO,0,9) "+ "left join PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK on subStr(DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO,0,9) = subStr(prod_card_t.UPLOAD_NO,0,9) "+
"left join receipt_list on receipt_list.QR_CODE = subStr(prod_card_t.accept_no,0,8) \n" + "left join receipt_list on receipt_list.QR_CODE = subStr(prod_card_t.accept_no,0,8) \n" +
...@@ -92,7 +83,7 @@ public interface ReceiptMapper { ...@@ -92,7 +83,7 @@ public interface ReceiptMapper {
//根据身份证号查询交接单详单信息 //根据身份证号查询交接单详单信息
@Select("select prod_card_t.upload_no,PROD_CARD_T.ACCEPT_NO," + @Select("select prod_card_t.upload_no,PROD_CARD_T.ACCEPT_NO," +
"prod_card_t.name,prod_card_t.SEX_NO,prod_card_t.id_no," + "prod_card_t.name,prod_card_t.SEX_NO,prod_card_t.id_no," +
"DIC_UPLOAD_UNIT_T.UNIT_NAME GAJG_MC,PROD_CARD_T.SIGN_GOVT,subStr(prod_card_t.UPLOAD_NO,0,9) AS GAJG_DM," + "DIC_UPLOAD_UNIT_T.UNIT_NAME GAJG_MC,PROD_CARD_T.SIGN_GOVT,DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO AS GAJG_DM," +
"receipt_list.ID\n" + "receipt_list.ID\n" +
"from PRODYD_DBA.prod_card_t@PRODYD_LINK \n" + "from PRODYD_DBA.prod_card_t@PRODYD_LINK \n" +
"left join PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK on subStr(DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO,0,9) = subStr(prod_card_t.UPLOAD_NO,0,9) "+ "left join PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK on subStr(DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO,0,9) = subStr(prod_card_t.UPLOAD_NO,0,9) "+
...@@ -156,7 +147,12 @@ public interface ReceiptMapper { ...@@ -156,7 +147,12 @@ public interface ReceiptMapper {
public boolean updateReceiptDateByReceiptId(@Param("receiptId") String receiptId); public boolean updateReceiptDateByReceiptId(@Param("receiptId") String receiptId);
//根据输入id查询交接单是否生成 //根据输入id查询交接单是否生成
@Select("select id,CHECK_NAME ,DIC_UPLOAD_UNIT_T.UNIT_NAME GAJG_MC from receipt_list left join PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK on subStr(DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO,0,9) = receipt_list.POLICE_CODE where QR_CODE=(select accept_no from PRODYD_DBA.prod_card_t@prodYD_LINK where id_no=#{id} and BEGIN_DATE= #{beginDate} and EXPIRE_DATE = #{expireDate} and receipt_date is null ) ") @Select("select id,CHECK_NAME ,DIC_UPLOAD_UNIT_T.UNIT_NAME GAJG_MC " +
"from receipt_list " +
"left join PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK on DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO = receipt_list.POLICE_CODE " +
"where QR_CODE=(select accept_no " +
"from PRODYD_DBA.prod_card_t@prodYD_LINK " +
"where id_no=#{id} and BEGIN_DATE= #{beginDate} and EXPIRE_DATE = #{expireDate} and receipt_date is null ) ")
public List<Map<String,Object>> selectCountById(@Param("id") String id,@Param("beginDate") String beginDate,@Param("expireDate") String expireDate); public List<Map<String,Object>> selectCountById(@Param("id") String id,@Param("beginDate") String beginDate,@Param("expireDate") String expireDate);
//根据输入id查询是否生成详单 //根据输入id查询是否生成详单
...@@ -192,7 +188,7 @@ public interface ReceiptMapper { ...@@ -192,7 +188,7 @@ public interface ReceiptMapper {
"prod_trace_t.CHECK_DATE as checkDate,\n" + "prod_trace_t.CHECK_DATE as checkDate,\n" +
"prod_trace_t.ELECTRIC_WRITE_DATE as electricDate\n" + "prod_trace_t.ELECTRIC_WRITE_DATE as electricDate\n" +
"from PRODYD_DBA.prod_trace_t@PRODYD_LINK " + "from PRODYD_DBA.prod_trace_t@PRODYD_LINK " +
"WHERE ACCEPT_NO=#{groupNo}") "WHERE ACCEPT_NO=substr(#{acceptNo},0,10)")
public Map<String,Object> selectTimes(@Param("groupNo") String groupNo); public Map<String,Object> selectTimes(@Param("groupNo") String groupNo);
@Select("<script>" + @Select("<script>" +
...@@ -289,7 +285,7 @@ public interface ReceiptMapper { ...@@ -289,7 +285,7 @@ public interface ReceiptMapper {
"where DETAIL_RECEIPT_LIST.CARD_ID = #{id}") "where DETAIL_RECEIPT_LIST.CARD_ID = #{id}")
public List<Map<String, Object>> selectQrCodeByCardID(@Param("id") String id, @Param("beginDate")String beginDate, @Param("expireDate")String expireDate); public List<Map<String, Object>> selectQrCodeByCardID(@Param("id") String id, @Param("beginDate")String beginDate, @Param("expireDate")String expireDate);
@Select("select DIC_UPLOAD_UNIT_T.UNIT_NAME GAJG_MC from PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK " +
@Select("select DIC_UPLOAD_UNIT_T.UNIT_NAME GAJG_MC from PRODYD_DBA.DIC_UPLOAD_UNIT_T@PRODYD_LINK where subStr(DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO,0,9) = #{policeCode} ") "where DIC_UPLOAD_UNIT_T.UPLOAD_UNIT_NO = #{policeCode} ")
public List<Map<String, Object>> selectPoliceName(@Param("policeCode") String policeCode); public List<Map<String, Object>> selectPoliceName(@Param("policeCode") String policeCode);
} }
...@@ -18,7 +18,7 @@ public interface DeliveredService { ...@@ -18,7 +18,7 @@ public interface DeliveredService {
public boolean saveDeliveredFailedInfoList(List<DeliveredFailedInfoEntity> deliveredFailedInfoEntities); public boolean saveDeliveredFailedInfoList(List<DeliveredFailedInfoEntity> deliveredFailedInfoEntities);
public List<Map<String,Object>> selectDeliveredReport(String startDate,String endDate, int reportType); public List<Map<String,Object>> selectDeliveredReport(String startDate,String endDate, int reportType);
public List<Map<String,Object>> selectDeliveredByImportDate(String date); public List<Map<String,Object>> selectDeliveredByImportDate(String date);
public List<Map<String,Object>> selectDeliveredFailedByRegisterDate(String startDate,String endDate); public List<Map<String,Object>> selectDeliveredFailedByRegisterDate(String startDate,String endDate,String cardId);
public boolean deleteDeliveredByFileId(long filedID); public boolean deleteDeliveredByFileId(long filedID);
public boolean deleteDeliveredFailedById(long id); public boolean deleteDeliveredFailedById(long id);
public List<DeliveredFailedReasonEntity> selectDeliveredFailedType(); public List<DeliveredFailedReasonEntity> selectDeliveredFailedType();
......
...@@ -13,6 +13,8 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -13,6 +13,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -58,7 +60,30 @@ public class DeliveredServiceImpl implements DeliveredService { ...@@ -58,7 +60,30 @@ public class DeliveredServiceImpl implements DeliveredService {
@Override @Override
public List<Map<String, Object>> selectDeliveredReport(String startDate, String endDate, int reportType) { public List<Map<String, Object>> selectDeliveredReport(String startDate, String endDate, int reportType) {
List<Map<String, Object>> mapList = deliveredInfoMapper.selectReport(startDate, endDate, reportType); List<Map<String, Object>> mapList = deliveredInfoMapper.selectReport(startDate, endDate, reportType);
return mapList; List<Map<String, Object>> mapList1 = deliveredInfoMapper.selectCancelCount(startDate, endDate);
List<Map<String, Object>> mapList2 = new ArrayList<>();
for (int i = 0; i < mapList.size(); i++ ){
Map<String, Object> map = new HashMap<>();
map.put("PRINT_DATE",mapList.get(i).get("PRINT_DATE"));
map.put("POST_COUNT",mapList.get(i).get("POST_COUNT"));
map.put("DELIVERED_COUNT",mapList.get(i).get("DELIVERED_COUNT"));
map.put("DELIVERED_FAILED_COUNT",mapList.get(i).get("DELIVERED_FAILED_COUNT"));
map.put("REPORT_TYPE",mapList.get(i).get("REPORT_TYPE"));
if (mapList.get(i).get("REPORT_TYPE").equals("0")){
for (int j = 0; j < mapList1.size(); j++){
if (mapList.get(i).get("PRINT_DATE").equals(mapList1.get(j).get("PRINT_DATE"))){
map.put("CANCEL_COUNT",mapList1.get(j).get("CANCEL_COUNT"));
break;
}else {
map.put("CANCEL_COUNT",mapList.get(i).get("CANCEL_COUNT"));
}
}
}else {
map.put("CANCEL_COUNT",mapList.get(i).get("CANCEL_COUNT"));
}
mapList2.add(map);
}
return mapList2;
} }
@Override @Override
...@@ -67,8 +92,8 @@ public class DeliveredServiceImpl implements DeliveredService { ...@@ -67,8 +92,8 @@ public class DeliveredServiceImpl implements DeliveredService {
} }
@Override @Override
public List<Map<String, Object>> selectDeliveredFailedByRegisterDate(String startDate,String endDate) { public List<Map<String, Object>> selectDeliveredFailedByRegisterDate(String startDate,String endDate,String cardId) {
return deliveredInfoMapper.selectDeliveredFailedByRegisterDate(startDate, endDate); return deliveredInfoMapper.selectDeliveredFailedByRegisterDate(replace(startDate), replace(endDate), replace(cardId));
} }
@Override @Override
...@@ -114,4 +139,12 @@ public class DeliveredServiceImpl implements DeliveredService { ...@@ -114,4 +139,12 @@ public class DeliveredServiceImpl implements DeliveredService {
public List<Map<String, Object>> selectDeliveredFailedByReceiveDate(String startDate, String endDate) { public List<Map<String, Object>> selectDeliveredFailedByReceiveDate(String startDate, String endDate) {
return deliveredInfoMapper.selectDeliveredFailedByReceiveDate(startDate, endDate); return deliveredInfoMapper.selectDeliveredFailedByReceiveDate(startDate, endDate);
} }
private String replace(String str) {
if("".equals(str)){
return null;
} else {
return str;
}
}
} }
...@@ -205,10 +205,9 @@ public class ReceiptServiceImpl implements ReceiptService { ...@@ -205,10 +205,9 @@ public class ReceiptServiceImpl implements ReceiptService {
public List<Map<String, Object>> selectReceiptListDate2(String groupNo) { public List<Map<String, Object>> selectReceiptListDate2(String groupNo) {
List<Map<String, Object>> mapList = new ArrayList<>(); List<Map<String, Object>> mapList = new ArrayList<>();
if (groupNo ==null){ if (groupNo ==null){
}else { }else {
groupNo=groupNo+'%';
mapList= receiptMapper.selectReceiptListDate2(groupNo); mapList= receiptMapper.selectReceiptListDate2(groupNo);
} }
return mapList; return mapList;
} }
......
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