Commit 537285e5 authored by dahai's avatar dahai

添加异地证数据核验报表

parent eb776136
......@@ -34,8 +34,8 @@ public class ReportApi {
* @return
*/
@RequestMapping("queryDataAuditingReport")
public List<Map<String, Object>> queryDataAuditingReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate) {
List<Map<String, Object>> mapList = dataAuditingService.selectDataAuditingReport(replaceDate(startDate), replaceDate(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),policeName,policeCode);
return mapList;
}
......@@ -90,8 +90,9 @@ public class ReportApi {
@RequestMapping("queryQualityCheckReport")
public List<Map<String, Object>> queryQualityCheckReport(@RequestParam(value = "startDate") String startDate,@RequestParam(value = "endDate") String endDate) {
//todo
List<Map<String, Object>> mapList = dataAuditingService.selectDataAuditingReport(startDate, endDate);
return mapList;
// List<Map<String, Object>> mapList = dataAuditingService.selectDataAuditingReport(startDate, endDate);
// return mapList;
return null;
}
/**
......
......@@ -257,17 +257,7 @@ public class TaskListApi {
}
List<Map<String, Object>> objects = taskListService.selectGroupAtACCU(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 + "");
boolean b = taskListService.saveTask(objects, name, 0 + "",groupNo);
}
}
......
package com.yxproject.start.entity;
import javax.persistence.*;
import java.sql.Time;
import java.util.Date;
import java.util.Objects;
/**
* @auther zhangyusheng
* 2019/4/11 11:54
* 2019/5/14 13:36
*/
@Entity
@Table(name = "DATA_AUDITING", schema = "YINGXIN", catalog = "")
public class DataAuditingEntity {
private Long id;
private long id;
private String policeSubstation;
private Long count;
private Time submitDate;
private Long validCount;
private Date submitDate;
private Long invalidCount;
private Long taskId;
@Id
@Column(name = "ID")
public Long getId() {
public long getId() {
return id;
}
public void setId(Long id) {
public void setId(long id) {
this.id = id;
}
......@@ -37,38 +39,60 @@ public class DataAuditingEntity {
}
@Basic
@Column(name = "COUNT")
public Long getCount() {
return count;
@Column(name = "VALID_COUNT")
public Long getValidCount() {
return validCount;
}
public void setCount(Long count) {
this.count = count;
public void setValidCount(Long validCount) {
this.validCount = validCount;
}
@Basic
@Column(name = "SUBMIT_DATE")
public Time getSubmitDate() {
public Date getSubmitDate() {
return submitDate;
}
public void setSubmitDate(Time submitDate) {
public void setSubmitDate(Date 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
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DataAuditingEntity that = (DataAuditingEntity) o;
return Objects.equals(id, that.id) &&
return id == that.id &&
Objects.equals(policeSubstation, that.policeSubstation) &&
Objects.equals(count, that.count) &&
Objects.equals(submitDate, that.submitDate);
Objects.equals(validCount, that.validCount) &&
Objects.equals(submitDate, that.submitDate) &&
Objects.equals(taskId, that.taskId) &&
Objects.equals(invalidCount, that.invalidCount);
}
@Override
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;
@Mapper
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")
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" +
"where ACCEPT_NO not in (select ACCEPT_NO from ACC_ERROR_INFO_T@ACCUYD_LINK) and substr(ACCEPT_NO,0,8) in (#{groupNo})\n" +
"group by substr(UPLOAD_NO,0,9)")
@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" +
" from ACC_CARD_T@ACCUYD_LINK\n" +
" 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);
@Select("select DATA_AUDITING.POLICE_SUBSTATION,sum(count),GAJG_DM.GAJG_MC from DATA_AUDITING \n" +
"left join GAJG_DM on GAJG_DM.GAJG_DM = DATA_AUDITING.POLICE_SUBSTATION \n" +
"where to_char(SUBMIT_DATE,'yyyyMMdd') BETWEEN #{startDate} and #{endDate}\n" +
"group by DATA_AUDITING.POLICE_SUBSTATION,GAJG_DM.GAJG_MC")
public List<Map<String,Object>> selectDataAuditingReport(@Param("startDate")String startDate,@Param("endDate")String endDate);
@Select("<script>" +
"select nvl(GAJG_DM.GAJG_MC,'000000000') GAJG_MC,DATA_AUDITING.POLICE_SUBSTATION,sum(DATA_AUDITING.VALID_COUNT) VALID_COUNT,\n" +
"sum(DATA_AUDITING.INVALID_COUNT) inVALID_COUNT,to_char(DATA_AUDITING.SUBMIT_DATE,'yyyyMMdd') SUBMIT_DATE,CARD_TYPE_DIC.CARD_TYPE,\n" +
"CARD_TYPE_DIC.CARD_TYPE_ID from DATA_AUDITING \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 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;
public interface DataAuditingService {
public boolean saveDataAuditingList(List<DataAuditingEntity> dataAuditingEntityList);
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 {
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);
......
......@@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
......@@ -34,7 +35,20 @@ public class DataAuditingServiceImpl implements DataAuditingService {
return dataAuditingMapper.selectDataAuditingEntity(groupNo);
}
@Override
public List<Map<String, Object>> selectDataAuditingReport(String startDate,String endDate) {
return dataAuditingMapper.selectDataAuditingReport(startDate,endDate);
public List<Map<String, Object>> selectDataAuditingReport(String startDate,String endDate,String policeName,String policeCode) {
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;
import com.yxproject.start.entity.*;
import com.yxproject.start.entity.TaskList.TaskListEntity;
import com.yxproject.start.mapper.DataAuditingMapper;
import com.yxproject.start.mapper.GroupNoMapper;
import com.yxproject.start.mapper.SpecialCardMapper;
import com.yxproject.start.mapper.TaskListMapper;
......@@ -27,6 +28,8 @@ public class TaskListServiceImpl implements TaskListService {
private SpecialCardMapper specialCardMapper;
@Autowired
private FailedCardService failedCardService;
@Autowired
private DataAuditingMapper dataAuditingMapper;
@Override
......@@ -593,7 +596,7 @@ public class TaskListServiceImpl implements TaskListService {
*/
@Override
@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){
Map<String, Object> stringObjectMap = list.get(0);
TaskEntity taskEntity = new TaskEntity();
......@@ -612,6 +615,16 @@ public class TaskListServiceImpl implements TaskListService {
groupNoEntity.setTaskId(taskEntity.getTaskId());
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;
......@@ -953,7 +966,6 @@ public class TaskListServiceImpl implements TaskListService {
@Override
public List<Map<String, Object>> getPrintOutCount() {
return taskListMapper.getPrintOutCount();
}
......@@ -969,7 +981,6 @@ public class TaskListServiceImpl implements TaskListService {
@Override
public List<Map<String, Object>> selectRemainderCardInfo(String date, String 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