Commit 537285e5 authored by dahai's avatar dahai

添加异地证数据核验报表

parent eb776136
...@@ -34,8 +34,8 @@ public class ReportApi { ...@@ -34,8 +34,8 @@ public class ReportApi {
* @return * @return
*/ */
@RequestMapping("queryDataAuditingReport") @RequestMapping("queryDataAuditingReport")
public List<Map<String, Object>> queryDataAuditingReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate) { public List<Map<String, Object>> queryDataAuditingReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate,@RequestParam(value = "policeName") String policeName,@RequestParam(value = "policeCode") String policeCode) {
List<Map<String, Object>> mapList = dataAuditingService.selectDataAuditingReport(replaceDate(startDate), replaceDate(endDate)); List<Map<String, Object>> mapList = dataAuditingService.selectDataAuditingReport(replaceDate(startDate), replaceDate(endDate),policeName,policeCode);
return mapList; return mapList;
} }
...@@ -90,8 +90,9 @@ public class ReportApi { ...@@ -90,8 +90,9 @@ public class ReportApi {
@RequestMapping("queryQualityCheckReport") @RequestMapping("queryQualityCheckReport")
public List<Map<String, Object>> queryQualityCheckReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate) { public List<Map<String, Object>> queryQualityCheckReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate) {
//todo //todo
List<Map<String, Object>> mapList = dataAuditingService.selectDataAuditingReport(startDate, endDate); // List<Map<String, Object>> mapList = dataAuditingService.selectDataAuditingReport(startDate, endDate);
return mapList; // return mapList;
return null;
} }
/** /**
......
...@@ -257,17 +257,7 @@ public class TaskListApi { ...@@ -257,17 +257,7 @@ public class TaskListApi {
} }
List<Map<String, Object>> objects = taskListService.selectGroupAtACCU(groupNo); List<Map<String, Object>> objects = taskListService.selectGroupAtACCU(groupNo);
// 查询数据核验报表信息 并保存数据核验报表 boolean b = taskListService.saveTask(objects, name, 0 + "",groupNo);
List<Map<String, Object>> mapList = dataAuditingService.selectDataAuditingList(groupNo);
List<DataAuditingEntity> dataAuditingEntities = new ArrayList<>();
for (Map<String, Object> map : mapList){
DataAuditingEntity dataAuditingEntity = new DataAuditingEntity();
dataAuditingEntity.setCount(Long.valueOf(map.get("COUNT")+""));
dataAuditingEntity.setPoliceSubstation(map.get("POLICE_SUBSTATION")+"");
dataAuditingEntities.add(dataAuditingEntity);
}
dataAuditingService.saveDataAuditingList(dataAuditingEntities);
boolean b = taskListService.saveTask(objects, name, 0 + "");
} }
} }
......
package com.yxproject.start.entity; package com.yxproject.start.entity;
import javax.persistence.*; import javax.persistence.*;
import java.sql.Time; import java.util.Date;
import java.util.Objects; import java.util.Objects;
/** /**
* @auther zhangyusheng * @auther zhangyusheng
* 2019/4/11 11:54 * 2019/5/14 13:36
*/ */
@Entity @Entity
@Table(name = "DATA_AUDITING", schema = "YINGXIN", catalog = "") @Table(name = "DATA_AUDITING", schema = "YINGXIN", catalog = "")
public class DataAuditingEntity { public class DataAuditingEntity {
private Long id; private long id;
private String policeSubstation; private String policeSubstation;
private Long count; private Long validCount;
private Time submitDate; private Date submitDate;
private Long invalidCount;
private Long taskId;
@Id @Id
@Column(name = "ID") @Column(name = "ID")
public Long getId() { public long getId() {
return id; return id;
} }
public void setId(Long id) { public void setId(long id) {
this.id = id; this.id = id;
} }
...@@ -37,38 +39,60 @@ public class DataAuditingEntity { ...@@ -37,38 +39,60 @@ public class DataAuditingEntity {
} }
@Basic @Basic
@Column(name = "COUNT") @Column(name = "VALID_COUNT")
public Long getCount() { public Long getValidCount() {
return count; return validCount;
} }
public void setCount(Long count) { public void setValidCount(Long validCount) {
this.count = count; this.validCount = validCount;
} }
@Basic @Basic
@Column(name = "SUBMIT_DATE") @Column(name = "SUBMIT_DATE")
public Time getSubmitDate() { public Date getSubmitDate() {
return submitDate; return submitDate;
} }
public void setSubmitDate(Time submitDate) { public void setSubmitDate(Date submitDate) {
this.submitDate = submitDate; this.submitDate = submitDate;
} }
@Basic
@Column(name = "INVALID_COUNT")
public Long getInvalidCount() {
return invalidCount;
}
public void setInvalidCount(Long invalidCount) {
this.invalidCount = invalidCount;
}
@Basic
@Column(name = "TASK_ID")
public Long getTaskId() {
return taskId;
}
public void setTaskId(Long taskId) {
this.taskId = taskId;
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
DataAuditingEntity that = (DataAuditingEntity) o; DataAuditingEntity that = (DataAuditingEntity) o;
return Objects.equals(id, that.id) && return id == that.id &&
Objects.equals(policeSubstation, that.policeSubstation) && Objects.equals(policeSubstation, that.policeSubstation) &&
Objects.equals(count, that.count) && Objects.equals(validCount, that.validCount) &&
Objects.equals(submitDate, that.submitDate); Objects.equals(submitDate, that.submitDate) &&
Objects.equals(taskId, that.taskId) &&
Objects.equals(invalidCount, that.invalidCount);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(id, policeSubstation, count, submitDate); return Objects.hash(id, policeSubstation, validCount, submitDate, invalidCount,taskId);
} }
} }
...@@ -13,19 +13,42 @@ import java.util.Map; ...@@ -13,19 +13,42 @@ import java.util.Map;
@Mapper @Mapper
public interface DataAuditingMapper { public interface DataAuditingMapper {
@Insert("insert into Data_Auditing (POLICE_SUBSTATION,count,submit_date) values (#{policeSubstation},#{count},sysdate) ") @Insert("insert into Data_Auditing (POLICE_SUBSTATION,VALID_COUNT,inVALID_COUNT,submit_date) values (#{policeSubstation},#{validCount},#{invalidCount},sysdate) ")
@Options(useGeneratedKeys=true, keyProperty="id", keyColumn="ID") @Options(useGeneratedKeys=true, keyProperty="id", keyColumn="ID")
public boolean saveDataAuditingEntity(DataAuditingEntity dataAuditingEntity); public boolean saveDataAuditingEntity(DataAuditingEntity dataAuditingEntity);
@Select("select substr(UPLOAD_NO,0,9) POLICE_SUBSTATION ,count(UPLOAD_NO) count from ACC_CARD_T@ACCUYD_LINK \n" + @Select("select a.POLICE_SUBSTATION,a.VALID_COUNT,B.INVALID_COUNT from (select substr(UPLOAD_NO,0,9) POLICE_SUBSTATION ,count(UPLOAD_NO) VALID_COUNT \n" +
"where ACCEPT_NO not in (select ACCEPT_NO from ACC_ERROR_INFO_T@ACCUYD_LINK) and substr(ACCEPT_NO,0,8) in (#{groupNo})\n" + " from ACC_CARD_T@ACCUYD_LINK\n" +
"group by substr(UPLOAD_NO,0,9)") " where ACCEPT_NO not in (\n" +
" select ACCEPT_NO from ACC_ERROR_INFO_T@ACCUYD_LINK)\n" +
" and substr(ACCEPT_NO,0,8) in (#{groupNo})\n" +
" group by substr(UPLOAD_NO,0,9)) a \n" +
"left join (select substr(UPLOAD_NO,0,9) POLICE_SUBSTATION ,count(UPLOAD_NO) INVALID_COUNT \n" +
"from ACC_CARD_T@ACCUYD_LINK\n" +
"where ACCEPT_NO in (\n" +
" select ACCEPT_NO from ACC_ERROR_INFO_T@ACCUYD_LINK)\n" +
" and substr(ACCEPT_NO,0,8) in (#{groupNo})\n" +
" group by substr(UPLOAD_NO,0,9)) b on a.POLICE_SUBSTATION = b.POLICE_SUBSTATION ")
public List<Map<String,Object>> selectDataAuditingEntity(@Param("groupNo")String groupNo); public List<Map<String,Object>> selectDataAuditingEntity(@Param("groupNo")String groupNo);
@Select("select DATA_AUDITING.POLICE_SUBSTATION,sum(count),GAJG_DM.GAJG_MC from DATA_AUDITING \n" + @Select("<script>" +
"left join GAJG_DM on GAJG_DM.GAJG_DM = DATA_AUDITING.POLICE_SUBSTATION \n" + "select nvl(GAJG_DM.GAJG_MC,'000000000') GAJG_MC,DATA_AUDITING.POLICE_SUBSTATION,sum(DATA_AUDITING.VALID_COUNT) VALID_COUNT,\n" +
"where to_char(SUBMIT_DATE,'yyyyMMdd') BETWEEN #{startDate} and #{endDate}\n" + "sum(DATA_AUDITING.INVALID_COUNT) inVALID_COUNT,to_char(DATA_AUDITING.SUBMIT_DATE,'yyyyMMdd') SUBMIT_DATE,CARD_TYPE_DIC.CARD_TYPE,\n" +
"group by DATA_AUDITING.POLICE_SUBSTATION,GAJG_DM.GAJG_MC") "CARD_TYPE_DIC.CARD_TYPE_ID from DATA_AUDITING \n" +
public List<Map<String,Object>> selectDataAuditingReport(@Param("startDate")String startDate,@Param("endDate")String endDate); "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 GAJG_DM on GAJG_DM.GAJG_DM = DATA_AUDITING.POLICE_SUBSTATION\n" +
"where 1=1 " +
" <if test = 'policeName != null' >" +
" and GAJG_DM.GAJG_MC like ${policeName}"+
"</if>\n" +
" <if test = 'policeCode != null' >" +
" and DATA_AUDITING.POLICE_SUBSTATION like ${policeCode}"+
"</if> " +
" and to_char(DATA_AUDITING.SUBMIT_DATE,'yyyyMMdd') BETWEEN ${startDate} and ${endDate} \n" +
"group by nvl(GAJG_DM.GAJG_MC,'000000000'),DATA_AUDITING.POLICE_SUBSTATION, to_char(DATA_AUDITING.SUBMIT_DATE,'yyyyMMdd'), CARD_TYPE_DIC.CARD_TYPE, CARD_TYPE_DIC.CARD_TYPE_ID\n" +
"order by DATA_AUDITING.POLICE_SUBSTATION" +
"</script>")
public List<Map<String,Object>> selectDataAuditingReport(@Param("startDate")String startDate,@Param("endDate")String endDate,@Param("policeName")String policeName,@Param("policeCode")String policeCode);
} }
...@@ -13,5 +13,5 @@ import java.util.Map; ...@@ -13,5 +13,5 @@ import java.util.Map;
public interface DataAuditingService { public interface DataAuditingService {
public boolean saveDataAuditingList(List<DataAuditingEntity> dataAuditingEntityList); public boolean saveDataAuditingList(List<DataAuditingEntity> dataAuditingEntityList);
public List<Map<String,Object>> selectDataAuditingList(String groupNo); public List<Map<String,Object>> selectDataAuditingList(String groupNo);
public List<Map<String,Object>> selectDataAuditingReport(String startDate,String endDate); public List<Map<String,Object>> selectDataAuditingReport(String startDate,String endDate,String policeName,String policeCode);
} }
...@@ -43,7 +43,7 @@ public interface TaskListService { ...@@ -43,7 +43,7 @@ public interface TaskListService {
public boolean saveTask(TaskEntity taskEntity); public boolean saveTask(TaskEntity taskEntity);
public boolean saveTask(List<Map<String,Object>> list,String submitName,String process); public boolean saveTask(List<Map<String,Object>> list,String submitName,String process,String groupNo);
public List<Map<String,Object>> selectFastCardAtACCU(String groupNo); public List<Map<String,Object>> selectFastCardAtACCU(String groupNo);
......
...@@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -34,7 +35,20 @@ public class DataAuditingServiceImpl implements DataAuditingService { ...@@ -34,7 +35,20 @@ public class DataAuditingServiceImpl implements DataAuditingService {
return dataAuditingMapper.selectDataAuditingEntity(groupNo); return dataAuditingMapper.selectDataAuditingEntity(groupNo);
} }
@Override @Override
public List<Map<String, Object>> selectDataAuditingReport(String startDate,String endDate) { public List<Map<String, Object>> selectDataAuditingReport(String startDate,String endDate,String policeName,String policeCode) {
return dataAuditingMapper.selectDataAuditingReport(startDate,endDate); List<Map<String, Object>> maps = dataAuditingMapper.selectDataAuditingReport("'" + startDate + "'", "'" + endDate + "'", "'" + policeName + "%'", "'" + policeCode + "%'");
Map<String,Object> sumMap = new LinkedHashMap<>();
int validCount =0;
int invalidCount =0;
for (Map<String, Object> map :maps) {
validCount+=Integer.valueOf(map.get("VALID_COUNT").toString());
invalidCount+=Integer.valueOf(map.get("INVALID_COUNT").toString());
}
sumMap.put("VALID_COUNT",validCount);
sumMap.put("INVALID_COUNT",invalidCount);
sumMap.put("GAJG_MC","北京制证中心");
sumMap.put("POLICE_SUBSTATION","合计");
maps.add(sumMap);
return maps;
} }
} }
...@@ -2,6 +2,7 @@ package com.yxproject.start.service.impl; ...@@ -2,6 +2,7 @@ package com.yxproject.start.service.impl;
import com.yxproject.start.entity.*; import com.yxproject.start.entity.*;
import com.yxproject.start.entity.TaskList.TaskListEntity; import com.yxproject.start.entity.TaskList.TaskListEntity;
import com.yxproject.start.mapper.DataAuditingMapper;
import com.yxproject.start.mapper.GroupNoMapper; import com.yxproject.start.mapper.GroupNoMapper;
import com.yxproject.start.mapper.SpecialCardMapper; import com.yxproject.start.mapper.SpecialCardMapper;
import com.yxproject.start.mapper.TaskListMapper; import com.yxproject.start.mapper.TaskListMapper;
...@@ -27,6 +28,8 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -27,6 +28,8 @@ public class TaskListServiceImpl implements TaskListService {
private SpecialCardMapper specialCardMapper; private SpecialCardMapper specialCardMapper;
@Autowired @Autowired
private FailedCardService failedCardService; private FailedCardService failedCardService;
@Autowired
private DataAuditingMapper dataAuditingMapper;
@Override @Override
...@@ -593,7 +596,7 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -593,7 +596,7 @@ public class TaskListServiceImpl implements TaskListService {
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean saveTask(List<Map<String, Object>> list, String submitName, String process) { public boolean saveTask(List<Map<String,Object>> list,String submitName,String process,String groupNo) {
if (list.size()>0){ if (list.size()>0){
Map<String, Object> stringObjectMap = list.get(0); Map<String, Object> stringObjectMap = list.get(0);
TaskEntity taskEntity = new TaskEntity(); TaskEntity taskEntity = new TaskEntity();
...@@ -612,6 +615,16 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -612,6 +615,16 @@ public class TaskListServiceImpl implements TaskListService {
groupNoEntity.setTaskId(taskEntity.getTaskId()); groupNoEntity.setTaskId(taskEntity.getTaskId());
groupNoMapper.saveGroupNo(groupNoEntity); groupNoMapper.saveGroupNo(groupNoEntity);
} }
// 查询数据核验报表信息 并保存数据核验报表
List<Map<String, Object>> mapList = dataAuditingMapper.selectDataAuditingEntity(groupNo);
for (Map<String, Object> map : mapList){
DataAuditingEntity dataAuditingEntity = new DataAuditingEntity();
dataAuditingEntity.setValidCount(Long.valueOf(map.get("INVALID_COUNT")+""));
dataAuditingEntity.setValidCount(Long.valueOf(map.get("VALID_COUNT")+""));
dataAuditingEntity.setPoliceSubstation(map.get("POLICE_SUBSTATION")+"");
dataAuditingEntity.setTaskId(taskEntity.getTaskId());
dataAuditingMapper.saveDataAuditingEntity(dataAuditingEntity);
}
} }
return true; return true;
...@@ -953,7 +966,6 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -953,7 +966,6 @@ public class TaskListServiceImpl implements TaskListService {
@Override @Override
public List<Map<String, Object>> getPrintOutCount() { public List<Map<String, Object>> getPrintOutCount() {
return taskListMapper.getPrintOutCount(); return taskListMapper.getPrintOutCount();
} }
...@@ -969,7 +981,6 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -969,7 +981,6 @@ public class TaskListServiceImpl implements TaskListService {
@Override @Override
public List<Map<String, Object>> selectRemainderCardInfo(String date, String name) { public List<Map<String, Object>> selectRemainderCardInfo(String date, String name) {
return taskListMapper.selectRemainderCardInfo(date,name); return taskListMapper.selectRemainderCardInfo(date,name);
} }
......
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