Commit 2d6f7fff authored by dahai's avatar dahai

添加膜打印查询任务单 添加卸载数量

parent 6bfb214c
......@@ -321,6 +321,7 @@ public class AdminApi {
/**
* 添加角色
*
* @param jsonStr
* @param resp
* @return
......
......@@ -22,11 +22,12 @@ public class CardDetailedListApi {
/**
* 按条件查询身份证详单
*
* @param jsonStr
* @return
*/
@RequestMapping("findCardDetailedList")
public List<CardDetailedListEntity> findCardDetailedList(String jsonStr){
public List<CardDetailedListEntity> findCardDetailedList(String jsonStr) {
JSONObject jsonObject = JSONObject.fromObject(jsonStr);
String applicantName = jsonObject.getString("applicantName");
String orderNumber = jsonObject.getString("orderNumber");
......
......@@ -2,6 +2,7 @@ package com.yxproject.start.api;
import java.io.*;
import java.net.URLEncoder;
import com.yxproject.start.service.DetailReceiptListService;
import com.yxproject.start.service.ReceiptService;
import com.yxproject.start.utils.ExportExcel;
......@@ -27,11 +28,12 @@ public class ExportExcelApi {
private DetailReceiptListService detailReceiptListService;
@Autowired
private ReceiptService receiptService;
/**
* 导出公安网数据
*/
@RequestMapping("printExcelData")
public byte[] printExcelData(@RequestParam("date") String date, HttpServletResponse response){
public byte[] printExcelData(@RequestParam("date") String date, HttpServletResponse response) {
List<Map<String, Object>> mapList = detailReceiptListService.selectPostDetails(replaceDate(date));
response.setContentType("application/x-download");
response.setCharacterEncoding("UTF-8");
......@@ -39,7 +41,7 @@ public class ExportExcelApi {
// //使用Servlet实现文件下载的时候,避免浏览器自动打开文件
String fout = null;
fout = ExportExcel.exportExcelDate(mapList);
String outFile = dateTime+"公安网信息表" ;
String outFile = dateTime + "公安网信息表";
try {
FileInputStream fis = new FileInputStream(new File(fout));
byte[] b = new byte[fis.available()];
......@@ -59,19 +61,19 @@ public class ExportExcelApi {
* 导出交接单
*/
@RequestMapping("printReceiptExcelData")
public byte[] printReceiptExcelData(@RequestBody String list, HttpServletResponse response, HttpServletRequest request){
public byte[] printReceiptExcelData(@RequestBody String list, HttpServletResponse response, HttpServletRequest request) {
JSONObject jsonObject = JSONObject.fromObject(list);
JSONArray jsonArray = JSONArray.fromObject(jsonObject.get("list"));
String date = jsonObject.get("date").toString();
String type = jsonObject.get("type").toString();
List<Map<String, Object>> mapList = receiptService.selectReceiptList(jsonArray,replaceDate(date),Long.valueOf(type));
List<Map<String, Object>> mapList = receiptService.selectReceiptList(jsonArray, replaceDate(date), Long.valueOf(type));
response.setContentType("application/x-download");
response.setCharacterEncoding("UTF-8");
String dateTime = DateFormatUtils.format(new Date(), "yyyy_MM_dd");
// //使用Servlet实现文件下载的时候,避免浏览器自动打开文件
String fout = null;
fout = ExportExcel.exportReceiptExcelDate(mapList);
String outFile = dateTime+"" ;
String outFile = dateTime + "";
//
// String agent = request.getHeader("User-Agent").toUpperCase(); //获得浏览器信息并转换为大写
// if (agent.indexOf("MSIE") > 0 || (agent.indexOf("GECKO")>0 && agent.indexOf("RV:11")>0)) { //IE浏览器和Edge浏览器
......@@ -135,7 +137,7 @@ public class ExportExcelApi {
fis.close();
response.setCharacterEncoding("utf-8");
response.setContentType("application/octet-stream");
response.addHeader("Content-Disposition", "attachment;" + new String(outFile.getBytes(),"iso-8859-1") +".xls");
response.addHeader("Content-Disposition", "attachment;" + new String(outFile.getBytes(), "iso-8859-1") + ".xls");
return b;
} catch (FileNotFoundException e) {
e.printStackTrace();
......@@ -150,15 +152,12 @@ public class ExportExcelApi {
* 查询公安网数据
*/
@RequestMapping("selectExcelData")
public List<Map<String,Object>> selectExcelData(@RequestParam("date")String date){
public List<Map<String, Object>> selectExcelData(@RequestParam("date") String date) {
List<Map<String, Object>> mapList = detailReceiptListService.selectPostDetails(replaceDate(date));
return mapList;
}
/**
* 去除字符串中中线
*
......@@ -170,6 +169,4 @@ public class ExportExcelApi {
}
}
......@@ -28,34 +28,36 @@ public class FailedCardApi {
@Autowired
private FailedCardService failedCardService;
@Autowired
private TaskListService taskListService;
private TaskListService taskListService;
/**
* 查询所有废证类型
*
* @return
*/
@RequestMapping("selectFailedCardDic")
public List<FailedCardReasonDicEntity> selectFailedCardDic(){
List<FailedCardReasonDicEntity> resultList= failedCardService.selectFailedCardDic();
public List<FailedCardReasonDicEntity> selectFailedCardDic() {
List<FailedCardReasonDicEntity> resultList = failedCardService.selectFailedCardDic();
return resultList;
}
/**
* 根据身份证号或受理号查询身份信息及组号
*
* @param jsonStr
* @return
*/
@RequestMapping("selectInfoByCardId")
public List<Map<String,Object>> selectInfoByCardId(@RequestBody String jsonStr){
public List<Map<String, Object>> selectInfoByCardId(@RequestBody String jsonStr) {
JSONArray jsonarray = JSONArray.fromObject(jsonStr);
List<Map<String,Object>> resultList=new ArrayList<>();
for (Object o:jsonarray) {
Map<String,Object> resultMap =failedCardService.selectInfoByCardId(o.toString());
if (resultMap==null){
List<Map<String, Object>> resultList = new ArrayList<>();
for (Object o : jsonarray) {
Map<String, Object> resultMap = failedCardService.selectInfoByCardId(o.toString());
if (resultMap == null) {
resultMap = new LinkedHashMap<>();
resultMap.put("ID_NO",o.toString());
resultMap.put("NAME","查无此人");
resultMap.put("SEX_NO","-1");
resultMap.put("ID_NO", o.toString());
resultMap.put("NAME", "查无此人");
resultMap.put("SEX_NO", "-1");
}
resultList.add(resultMap);
}
......@@ -64,22 +66,23 @@ public class FailedCardApi {
/**
* 添加废证
*
* @param jsonStr
* @return
*/
@RequestMapping("insertFailedCard")
@Transactional(rollbackFor = Exception.class)
public Boolean insertFailedCard(@RequestBody String jsonStr){
public Boolean insertFailedCard(@RequestBody String jsonStr) {
JSONArray jsonarray = JSONArray.fromObject(jsonStr);
for (Object o : jsonarray) {
JSONObject jsonObject = (JSONObject) o;
String result = failedCardService.selectSpecialCard(((JSONObject) o).getString("cardId"));
Map<String,Object> idMap ;
String result = failedCardService.selectSpecialCard(((JSONObject) o).getString("cardId"));
Map<String, Object> idMap;
//判断是否是特殊证件
if (result != null &&result!="") {
idMap = failedCardService.selectDataById(jsonObject.getString("cardId"));
if (result != null && result != "") {
idMap = failedCardService.selectDataById(jsonObject.getString("cardId"));
} else {
idMap = failedCardService.selectCountIdByCardId(jsonObject.getString("cardId"));
idMap = failedCardService.selectCountIdByCardId(jsonObject.getString("cardId"));
}
int initiator = Integer.parseInt(jsonObject.getString("initiator")) - 1;
failedCardService.insertFailedCard(jsonObject.getString("failedCardReasonId"), idMap.get("ACCEPT_NO").toString(), idMap.get("TASK_ID").toString(), String.valueOf(initiator), jsonObject.getString("note"));
......@@ -87,74 +90,66 @@ public class FailedCardApi {
return true;
}
// /**
// * 查询所有废证类型
// * @return
// */
// @RequestMapping("selectRemainingCardDic")
// public List<String> selectRemainingCardDic(){
// List<String> resultList= failedCardService.selectFailedCardDic();
// return resultList;
// }
/**
* 生成余证(每个余证生成一个任务单)
*
* @param jsonStr
* @return
*/
//TODO 多张余证可以生成一张任务单 判断是否是同一个countyCode
@RequestMapping("insertRemaining")
@Transactional(rollbackFor = Exception.class)
public Boolean insertRemaining(@RequestBody String jsonStr){
public Boolean insertRemaining(@RequestBody String jsonStr) {
JSONObject jsonObject = JSONObject.fromObject(jsonStr);
JSONArray jsonarray = JSONArray.fromObject(jsonObject.get("list"));
String name =jsonObject.get("name").toString();
String name = jsonObject.get("name").toString();
TaskEntity taskEntity = new TaskEntity();
for (int i=0;i<jsonarray.size();i++) {
for (int i = 0; i < jsonarray.size(); i++) {
/*查询生成任务单需要的数据*/
Map<String,Object> resultMap= failedCardService.selectTaskListDate((String) jsonarray.get(i));
String countyCode = resultMap.get("COUNTY_CODE").toString();
Long cardType = Long.valueOf((BigDecimal) resultMap.get("CARD_TYPE")+"");
String acceptNo = (String) resultMap.get("ACCEPT_NO");
taskEntity.setCountyCode(countyCode);
taskEntity.setCardType(cardType);
taskEntity.setTaskStateId((long) 1);
taskEntity.setSubmitName(name);
/*特证数+1*/
failedCardService.specialCardAdd(acceptNo);
/*生成新任务单*/
taskListService.saveTask(taskEntity);
/*特证表添加特证*/
SpecialCardEntity specialCardEntity = new SpecialCardEntity() ;
specialCardEntity.setAcceptNo(acceptNo);
specialCardEntity.setInitiator(name);
specialCardEntity.setTaskId(taskEntity.getTaskId());
specialCardEntity.setGroupNo(acceptNo.substring(0,8));
failedCardService.addSpecialCard(specialCardEntity);
}
/*查询生成任务单需要的数据*/
Map<String, Object> resultMap = failedCardService.selectTaskListDate((String) jsonarray.get(i));
String countyCode = resultMap.get("COUNTY_CODE").toString();
Long cardType = Long.valueOf((BigDecimal) resultMap.get("CARD_TYPE") + "");
String acceptNo = (String) resultMap.get("ACCEPT_NO");
taskEntity.setCountyCode(countyCode);
taskEntity.setCardType(cardType);
taskEntity.setTaskStateId((long) 1);
taskEntity.setSubmitName(name);
/*特证数+1*/
failedCardService.specialCardAdd(acceptNo);
/*生成新任务单*/
taskListService.saveTask(taskEntity);
/*特证表添加特证*/
SpecialCardEntity specialCardEntity = new SpecialCardEntity();
specialCardEntity.setAcceptNo(acceptNo);
specialCardEntity.setInitiator(name);
specialCardEntity.setTaskId(taskEntity.getTaskId());
specialCardEntity.setGroupNo(acceptNo.substring(0, 8));
failedCardService.addSpecialCard(specialCardEntity);
}
return true;
}
/**
* 查询所有证件类型
*
* @return List
*/
@RequestMapping("selectCardType")
public List<String> selectCardType(){
List<String> result= failedCardService.selectCardType();
public List<String> selectCardType() {
List<String> result = failedCardService.selectCardType();
return result;
}
/**
* 生成历史回迁证
*
* @param jsonStr
* @return
*/
@RequestMapping("insertBackCard")
@Transactional(rollbackFor = Exception.class)
public boolean insertBackCard(@RequestBody String jsonStr){
public boolean insertBackCard(@RequestBody String jsonStr) {
try {
JSONArray jsonarray = JSONArray.fromObject(jsonStr);
TaskEntity taskEntity = new TaskEntity();
......
......@@ -8,7 +8,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......
......@@ -124,11 +124,6 @@ public class ReceiptApi {
} else {
//已生成交接单
}
// //查询有几个特证
// int specialCardCount = receiptService.selectSpecialCard(receiptListDate.get(i).get("GROUP_NO").toString());
// //减去特证个数
// int finishCount = receiptService.selectCount(receiptListDate.get(i).get("GROUP_NO").toString()) - specialCardCount;
// receiptService.updateFinishCount(receiptListDate.get(i).get("GROUP_NO").toString(), finishCount);
}
}
return true;
......
......@@ -13,14 +13,13 @@ import java.util.List;
import java.util.Map;
/**
*搜索框查询
* 搜索框查询
*/
@RestController
@RequestMapping("specialCardInfo")
public class SelectApi {
/**
* 根据 组号8、受理号10、身份证号18、任务单号11查询
*
*/
@Autowired
private SelectSerialNumberService selectSerialNumberService;
......@@ -28,8 +27,8 @@ public class SelectApi {
private GroupNoService groupNoService;
@RequestMapping(value = "selectByCard")
public Map<String,Object> selectByCard(@RequestParam("id") String id){
Map<String,Object> resultMap = new HashMap<>();
public Map<String, Object> selectByCard(@RequestParam("id") String id) {
Map<String, Object> resultMap = new HashMap<>();
if (id.length() == 11) {
List<Map<String, Object>> workOrderData = selectSerialNumberService.selectByWorkOrderFromYX(id);
List<Map<String, Object>> ACCdata = new ArrayList<>();
......@@ -48,9 +47,9 @@ public class SelectApi {
//查询是否是特证,如果是,返回新的任务单信息
List<Map<String, Object>> workOrderData = selectSerialNumberService.selectByAcceptNoOrCardIdFromTaskList2(id);
if (workOrderData.size()!=0){
if (workOrderData.size() != 0) {
resultMap.put("workOrderData", workOrderData);
}else {
} else {
List<Map<String, Object>> workOrderData2 = selectSerialNumberService.selectByAcceptNoOrCardIdFromTaskList(id);
resultMap.put("workOrderData", workOrderData2);
}
......
......@@ -89,6 +89,7 @@ public class TaskListApi {
* taskId 任务单ID
* name 下发人姓名
* process 下发人所在工序
*
* @return
*/
@RequestMapping("updateState")
......@@ -99,7 +100,7 @@ public class TaskListApi {
String process = jsonObject.get("process").toString();
String name = jsonObject.get("name").toString();
List<String> list = (List<String>) jsonArray;
return taskListService.updateState(failedList,list, process, name);
return taskListService.updateState(failedList, list, process, name);
}
/**
......@@ -109,6 +110,7 @@ public class TaskListApi {
* name 打印转出人姓名
* process 打印转出人所在工序
* printer 打印机编号
*
* @return
*/
@RequestMapping("updateState2")
......@@ -120,14 +122,15 @@ public class TaskListApi {
String name = jsonObject.get("name").toString();
String printer = jsonObject.get("printer").toString();
List<String> list = (List<String>) jsonArray;
return taskListService.updateState2(failedList,list, process, name,Long.valueOf(printer));
return taskListService.updateState2(failedList, list, process, name, Long.valueOf(printer));
}
/**
* 查询任务单详情
* (受理库)
*(创建)
* (创建)
*
* @param process 工序
* @param date 查询时间
* @param resp
......@@ -143,6 +146,7 @@ public class TaskListApi {
/**
* 查询组号列表详情
* 受理库
*
* @param date 查询时间
* @param typeCode 制证类型
* @param countyCode 区县代码
......@@ -159,7 +163,8 @@ public class TaskListApi {
/**
* 查询任务单详情
* (辅助库)
*(下发、数据核验、膜打印)
* (下发、数据核验、膜打印)
*
* @param process 工序
* @param resp
* @return
......@@ -173,7 +178,8 @@ public class TaskListApi {
/**
* 查询任务单详情
* (辅助库)
*(预订位、平压)
* (预订位、平压)
*
* @param process 工序
* @param resp
* @return
......@@ -187,7 +193,8 @@ public class TaskListApi {
/**
* 查询任务单详情
* (辅助库、制证库)
*(电写入、分拣)
* (电写入、分拣)
*
* @param process 工序
* @param resp
* @return
......@@ -199,18 +206,18 @@ public class TaskListApi {
}
/**
* 查询任务单详情(历史)
* (辅助库)
*(创建、下发、数据核验、预订位、平压、冲切)
* (创建、下发、数据核验、预订位、平压、冲切)
*
* @param process 工序
* @param resp
* @return
*/
@RequestMapping("queryHistoryTaskAtAuxiliary")
public List<Object> queryHistoryTaskAtAuxiliary(@RequestParam("process") String process,@RequestParam("date") String date, HttpServletResponse resp) {
List<Object> objects = taskListService.selectHistoryTaskAtAuxiliary(Long.valueOf(process) ,replaceDate(date));
public List<Object> queryHistoryTaskAtAuxiliary(@RequestParam("process") String process, @RequestParam("date") String date, HttpServletResponse resp) {
List<Object> objects = taskListService.selectHistoryTaskAtAuxiliary(Long.valueOf(process), replaceDate(date));
return objects;
}
......@@ -218,7 +225,8 @@ public class TaskListApi {
/**
* 查询任务单详情(历史)
* (辅助库)
*(分拣)
* (分拣)
*
* @param resp
* @return
*/
......@@ -241,7 +249,7 @@ public class TaskListApi {
*/
@RequestMapping("createTask")
@Transactional
public Map<String,Object> queryByCountyAtACCU(@RequestBody String str, HttpServletResponse resp) {
public Map<String, Object> queryByCountyAtACCU(@RequestBody String str, HttpServletResponse resp) {
System.out.println(str);
JSONObject jsonObject = JSONObject.fromObject(str);
String date = jsonObject.getString("date");
......@@ -249,12 +257,12 @@ public class TaskListApi {
JSONArray jsonCounty = jsonObject.getJSONArray("countyList");
JSONArray jsonGroup = jsonObject.getJSONArray("groupList");
List<Map<String, Object>> countyList = (List<Map<String, Object>>) jsonCounty;
if (countyList.size()>0){
if (countyList.size() > 0) {
//正常生成区县任务单
for (Map<String, Object> map : countyList) {
String typeCode = map.get("typeCode").toString();
String countyCode = map.get("countyCode").toString();
List<Map<String,Object>> objects = taskListService.selectGroupAtACCU(replaceDate(date), typeCode, countyCode);
List<Map<String, Object>> objects = taskListService.selectGroupAtACCU(replaceDate(date), typeCode, countyCode);
boolean b = taskListService.saveTask(objects, name, 0 + "");
}
}
......@@ -265,16 +273,16 @@ public class TaskListApi {
String groupNo = "";
for (int i = 0; i < groupList.size(); i++) {
if (i != groupList.size() - 1) {
groupNo = ""+groupNo + groupList.get(i) + ",";
groupNo = "" + groupNo + groupList.get(i) + ",";
} else {
groupNo = ""+groupNo + groupList.get(i) + "";
groupNo = "" + groupNo + groupList.get(i) + "";
}
}
List<Map<String,Object>> objects = taskListService.selectGroupAtACCU(groupNo);
List<Map<String, Object>> objects = taskListService.selectGroupAtACCU(groupNo);
boolean b = taskListService.saveTask(objects, name, 0 + "");
}
Map<String,Object> map = new LinkedHashMap<>();
map.put("msg","成功生成任务单");
Map<String, Object> map = new LinkedHashMap<>();
map.put("msg", "成功生成任务单");
return map;
}
......@@ -291,7 +299,7 @@ public class TaskListApi {
*/
@RequestMapping("createFastTask")
@Transactional
public Map<String,Object> createFastTask(@RequestBody String object, HttpServletResponse resp) {
public Map<String, Object> createFastTask(@RequestBody String object, HttpServletResponse resp) {
//todo 添加没有解析进去受理库情况
JSONObject jsonObject = JSONObject.fromObject(object);
String acceptNo = jsonObject.getString("acceptNo");
......@@ -302,7 +310,7 @@ public class TaskListApi {
countyCode = "000000";
}
//查询快证是否存在受理库
List<Map<String,Object>> objects = taskListService.selectFastCardAtACCU(acceptNo.substring(0, 8));
List<Map<String, Object>> objects = taskListService.selectFastCardAtACCU(acceptNo.substring(0, 8));
//存在受理库
if (objects.size() == 1) {
taskListService.saveFastTask(objects, name, acceptNo, Long.valueOf(cardType));
......@@ -342,8 +350,8 @@ public class TaskListApi {
}
}
}
Map<String,Object> map = new LinkedHashMap<>();
map.put("msg","成功添加快证任务单");
Map<String, Object> map = new LinkedHashMap<>();
map.put("msg", "成功添加快证任务单");
return map;
}
......@@ -357,14 +365,14 @@ public class TaskListApi {
*/
@RequestMapping("addBackCard")
@Transactional
public Map<String,Object> addBackCard(@RequestBody String object, HttpServletResponse resp) {
public Map<String, Object> addBackCard(@RequestBody String object, HttpServletResponse resp) {
JSONObject jsonObject = JSONObject.fromObject(object);
String acceptNo = jsonObject.getString("acceptNo");
String taskId = jsonObject.getString("taskId");
String name = jsonObject.getString("name");
List<Map<String,Object>> objects = preproPersonService.selectUploadNoByAcceptNo(acceptNo);
if (objects.size()>0){
for (Map<String,Object> map :objects){
List<Map<String, Object>> objects = preproPersonService.selectUploadNoByAcceptNo(acceptNo);
if (objects.size() > 0) {
for (Map<String, Object> map : objects) {
PreproPersonEntity preproPersonEntity = new PreproPersonEntity();
preproPersonEntity.setJmsfzslh(map.get("UPLOAD_NO").toString());
preproPersonEntity.setIsValid(0);
......@@ -387,8 +395,8 @@ public class TaskListApi {
specialCardEntity.setTaskId(Long.valueOf(taskId));
specialCardService.saveSpecialCard(specialCardEntity);
}
Map<String,Object> map = new LinkedHashMap<>();
map.put("msg","成功添加退证");
Map<String, Object> map = new LinkedHashMap<>();
map.put("msg", "成功添加退证");
return map;
}
......@@ -504,8 +512,6 @@ public class TaskListApi {
// }
/**
* 去除字符串中中线
*
......@@ -517,10 +523,4 @@ public class TaskListApi {
}
}
......@@ -430,6 +430,36 @@ public interface TaskListMapper {
"nvl(fc.faileCount,0),substr(prod_card_t.upload_no,0,9),GAJG_DM.GAJG_MC,nvl(DECODE(RECEIPT_LIST.STATE,1,RECEIPT_LIST.FINISH_COUNT,0),0) order by group_no.GROUP_NO")
public List<Map<String,Object>> selectByCountyAtAuxiliary_common2(@Param("process") long process,@Param("process2") long process2);
/**
* 任务单查询
* 辅助库、制证库 大批证
* @param process 工序
* @return
*/
@Select("select DISTINCT nvl(DECODE(RECEIPT_LIST.STATE,1,RECEIPT_LIST.FINISH_COUNT,0),0) finish_COUNT,count(substr(prod_card_t.upload_no,0,9)) police_Count,substr(prod_card_t.upload_no,0,9)police_code ,GAJG_DM.GAJG_MC,\n" +
"sum(decode(prod_trace_t.DOWNLOAD_NO,null,0,1)) DOWNLOAD_count,\n" +
"task.submit_date, task.task_id,CARD_TYPE_DIC.CARD_TYPE,\n" +
"CARD_TYPE_DIC.CARD_TYPE_ID,COUNTY_DIC.COUNTY_CODE,\n" +
"COUNTY_DIC.COUNTYNAME, group_no.VALID_COUNT,group_no.INVALID_COUNT,\n" +
"group_no.SPECIAL_CARD_COUNT,group_no.GROUP_NO, nvl(fc.faileCount,0) faileCount\n" +
"from group_no left join task on group_no.task_id= task.TASK_ID\n" +
"left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = task.CARD_TYPE\n" +
"left join COUNTY_DIC on COUNTY_DIC.COUNTY_CODE = task.COUNTY_CODE\n" +
"left join (select accept_no, nvl(count(*),0) faileCount from FAILED_CARD where FAILED_CARD.state <=#{process2} and FAILED_CARD.state != FAILED_CARD.INITIATOR and accept_no not in (select accept_no from special_card ) \n" +
"group by accept_no ) fc on substr(fc.accept_no,0,8) = group_no.group_no \n" +
"left join prod_trace_t@PROD_LINK on SUBSTR(prod_trace_t.ACCEPT_NO,0,8) = group_no.GROUP_NO\n" +
"left join prod_card_t@PROD_LINK on prod_trace_t.ACCEPT_NO =prod_card_t.ACCEPT_NO\n" +
"left join GAJG_DM on GAJG_DM.GAJG_DM = substr(prod_card_t.upload_no,0,9)\n" +
" left join RECEIPT_LIST on RECEIPT_LIST.QR_CODE = group_no.GROUP_NO " +
"where task.TASK_STATE_ID = #{process}\n" +
"and prod_trace_t.ACCEPT_NO NOT IN (select SPECIAL_CARD.ACCEPT_NO from SPECIAL_CARD) group by task.submit_date, task.task_id, CARD_TYPE_DIC.CARD_TYPE, CARD_TYPE_DIC.CARD_TYPE_ID, COUNTY_DIC.COUNTY_CODE,\n" +
"COUNTY_DIC.COUNTYNAME, group_no.VALID_COUNT, group_no.INVALID_COUNT, group_no.SPECIAL_CARD_COUNT, group_no.GROUP_NO, \n" +
"nvl(fc.faileCount,0),substr(prod_card_t.upload_no,0,9),GAJG_DM.GAJG_MC,nvl(DECODE(RECEIPT_LIST.STATE,1,RECEIPT_LIST.FINISH_COUNT,0),0) order by group_no.GROUP_NO")
public List<Map<String,Object>> selectByCountyAtAuxiliary_common3(@Param("process") long process,@Param("process2") long process2);
/**
* 任务单查询
* 辅助库 快证
......@@ -618,6 +648,32 @@ public interface TaskListMapper {
"order by SPECIAL_CARD.ACCEPT_NO")
public List<Map<String,Object>> selectByCountyAtAuxiliary_fast3(@Param("process") long process,@Param("process2") long process2);
/**
* 任务单查询
* 辅助库、制证库 快证 电写入
* @param process 工序
* @return
*/
@Select("select DISTINCT 0 finish_COUNT, count(substr(prod_card_t.upload_no,0,9)) police_Count,\n" +
"substr(prod_card_t.upload_no,0,9) police_code ,GAJG_DM.GAJG_MC,\n" +
"sum(decode(prod_trace_t.DOWNLOAD_NO,null,0,1)) DOWNLOAD_count,task.submit_date, \n" +
"SPECIAL_CARD.task_id,'快证' CARD_TYPE,'1' CARD_TYPE_ID,COUNTY_DIC.COUNTY_CODE, \n" +
"COUNTY_DIC.COUNTYNAME, 1 VALID_COUNT, 0 INVALID_COUNT,0 SPECIAL_CARD_COUNT, \n" +
"SPECIAL_CARD.ACCEPT_NO group_No, nvl(fc.faileCount,0) faileCount \n" +
"from SPECIAL_CARD left join task on SPECIAL_CARD.task_id= task.TASK_ID \n" +
"left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = task.CARD_TYPE \n" +
"left join COUNTY_DIC on COUNTY_DIC.COUNTY_CODE = task.COUNTY_CODE \n" +
"left join prod_trace_t@PROD_LINK on prod_trace_t.ACCEPT_NO = SPECIAL_CARD.ACCEPT_NO \n" +
"left join (select task_id,nvl(count(*),0) faileCount from FAILED_CARD \n" +
"where FAILED_CARD.state <=#{process2} and FAILED_CARD.state != FAILED_CARD.INITIATOR \n" +
"group by task_id ) fc on fc.TASK_ID = task.TASK_ID \n" +
"left join prod_card_t@PROD_LINK on prod_trace_t.ACCEPT_NO =prod_card_t.ACCEPT_NO \n" +
"left join GAJG_DM on GAJG_DM.GAJG_DM = substr(prod_card_t.upload_no,0,9) \n" +
"where SPECIAL_CARD.SPECIAL_TYPE =2 and task.TASK_STATE_ID =#{process} \n" +
"group by task.submit_date, SPECIAL_CARD.task_id, '快证', '1', COUNTY_DIC.COUNTY_CODE, COUNTY_DIC.COUNTYNAME, 1, 0, 0, SPECIAL_CARD.ACCEPT_NO, nvl(fc.faileCount,0),substr(prod_card_t.upload_no,0,9),GAJG_DM.GAJG_MC,0 \n" +
"order by SPECIAL_CARD.ACCEPT_NO")
public List<Map<String,Object>> selectByCountyAtAuxiliary_fast4(@Param("process") long process,@Param("process2") long process2);
/**
......@@ -909,7 +965,36 @@ public interface TaskListMapper {
/**
* 任务单查询
* 辅助库、制证库 余证
* 辅助库、制证库 余证 膜打印
* @param process 工序
* @return
*/
@Select("select DISTINCT 0 finish_COUNT, count(substr(prod_card_t.upload_no,0,9)) police_Count,\n" +
"substr(prod_card_t.upload_no,0,9) police_code ,GAJG_DM.GAJG_MC,\n" +
"sum(decode(prod_trace_t.DOWNLOAD_NO,null,0,1)) DOWNLOAD_count,task.submit_date, \n" +
"SPECIAL_CARD.task_id,'余证' CARD_TYPE,'99' CARD_TYPE_ID,COUNTY_DIC.COUNTY_CODE, \n" +
"COUNTY_DIC.COUNTYNAME, 1 VALID_COUNT, 0 INVALID_COUNT,0 SPECIAL_CARD_COUNT, \n" +
"SPECIAL_CARD.ACCEPT_NO group_No, nvl(fc.faileCount,0) faileCount \n" +
"from SPECIAL_CARD left join task on SPECIAL_CARD.task_id= task.TASK_ID \n" +
"left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = task.CARD_TYPE \n" +
"left join COUNTY_DIC on COUNTY_DIC.COUNTY_CODE = task.COUNTY_CODE \n" +
"left join prod_trace_t@PROD_LINK on prod_trace_t.ACCEPT_NO = SPECIAL_CARD.ACCEPT_NO \n" +
"left join (select task_id,nvl(count(*),0) faileCount from FAILED_CARD \n" +
"where FAILED_CARD.state <=#{process2} and FAILED_CARD.state != FAILED_CARD.INITIATOR \n" +
"group by task_id ) fc on fc.TASK_ID = task.TASK_ID \n" +
"left join prod_card_t@PROD_LINK on prod_trace_t.ACCEPT_NO =prod_card_t.ACCEPT_NO \n" +
"left join GAJG_DM on GAJG_DM.GAJG_DM = substr(prod_card_t.upload_no,0,9) \n" +
"where SPECIAL_CARD.SPECIAL_TYPE =1 and task.TASK_STATE_ID =#{process} \n" +
"group by task.submit_date, SPECIAL_CARD.task_id, '余证', '99', COUNTY_DIC.COUNTY_CODE, COUNTY_DIC.COUNTYNAME, 1, 0, 0, SPECIAL_CARD.ACCEPT_NO, nvl(fc.faileCount,0),substr(prod_card_t.upload_no,0,9),GAJG_DM.GAJG_MC,0 \n" +
"order by SPECIAL_CARD.ACCEPT_NO")
public List<Map<String,Object>> selectByCountyAtAuxiliary_remaind4(@Param("process") long process,@Param("process2") long process2);
/**
* 任务单查询
* 辅助库、制证库 废证
* @param process 工序
* @return
*/
......@@ -931,6 +1016,30 @@ public interface TaskListMapper {
public List<Map<String,Object>> selectByCountyAtAuxiliary_failed2(@Param("process") long process);
/**
* 任务单查询
* 辅助库、制证库 废证 膜打印
* @param process 工序
* @return
*/
@Select("select DISTINCT 0 finish_COUNT, count(substr(prod_card_t.upload_no,0,9)) police_Count,\n" +
"substr(prod_card_t.upload_no,0,9) police_code ,GAJG_DM.GAJG_MC,sum(decode(prod_trace_t.DOWNLOAD_NO,null,0,1)) DOWNLOAD_count,\n" +
"task.submit_date,FAILED_CARD.failed_card_id task_id,'废证' CARD_TYPE,'100' CARD_TYPE_ID,COUNTY_DIC.COUNTY_CODE,\n" +
"COUNTY_DIC.COUNTYNAME, 1 VALID_COUNT, 0 INVALID_COUNT,0 SPECIAL_CARD_COUNT,\n" +
"FAILED_CARD.ACCEPT_NO group_No, 0 faileCount\n" +
"from FAILED_CARD left join task on FAILED_CARD.task_id= task.TASK_ID\n" +
"left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = task.CARD_TYPE\n" +
"left join COUNTY_DIC on COUNTY_DIC.COUNTY_CODE = task.COUNTY_CODE\n" +
"left join prod_trace_t@PROD_LINK on prod_trace_t.ACCEPT_NO = FAILED_CARD.ACCEPT_NO\n" +
"left join prod_card_t@PROD_LINK on prod_trace_t.ACCEPT_NO =prod_card_t.ACCEPT_NO\n" +
"left join GAJG_DM on GAJG_DM.GAJG_DM = substr(prod_card_t.upload_no,0,9)\n" +
"where FAILED_CARD.STATE =#{process} and FAILED_CARD.STATE!=FAILED_CARD.INITIATOR \n" +
"group by 0, substr(prod_card_t.upload_no,0,9), GAJG_DM.GAJG_MC, task.submit_date, FAILED_CARD.failed_card_id, \n" +
"'废证', '100', COUNTY_DIC.COUNTY_CODE, COUNTY_DIC.COUNTYNAME, 1, 0, 0, FAILED_CARD.ACCEPT_NO, 0\n" +
"order by FAILED_CARD.ACCEPT_NO")
public List<Map<String,Object>> selectByCountyAtAuxiliary_failed3(@Param("process") long process);
/**
*按时间、区、派出所查询受理库数据
......
......@@ -258,26 +258,34 @@ public class TaskListServiceImpl implements TaskListService {
@Override
@Transactional(rollbackFor = Exception.class)
public List<Object> selectByCountyAtAuxiliary(long process) {
//查询普通组号列表 在辅助库中
List<Map<String, Object>> mapList_common = taskListMapper.selectByCountyAtAuxiliary_common(process,process-2);
//查询快证组号列表 在辅助库中
List<Map<String, Object>> mapList_fast = taskListMapper.selectByCountyAtAuxiliary_fast(process,process-2);
//查询余证组号列表 在辅助库中
List<Map<String, Object>> mapList_remaind = taskListMapper.selectByCountyAtAuxiliary_remaind(process,process-2);
//查询废证组号列表 在辅助库中
List<Map<String, Object>> mapList_failed = new ArrayList<>();
if (process==0){
}else {
mapList_failed = taskListMapper.selectByCountyAtAuxiliary_failed_mu();
}
List list = new ArrayList();
list = formateMap(mapList_common);
list.addAll(formateMap(mapList_fast));
list.addAll(formateMap(mapList_remaind));
if (mapList_failed.size()>0){
list.addAll(formateMap(mapList_failed));
if(process==0){
//查询下发状态下的任务单
//查询普通组号列表 在辅助库中
List<Map<String, Object>> mapList_common = taskListMapper.selectByCountyAtAuxiliary_common(process,process-2);
//查询快证组号列表 在辅助库中
List<Map<String, Object>> mapList_fast = taskListMapper.selectByCountyAtAuxiliary_fast(process,process-2);
//查询余证组号列表 在辅助库中
List<Map<String, Object>> mapList_remaind = taskListMapper.selectByCountyAtAuxiliary_remaind(process,process-2);
list = formateMap(mapList_common);
list.addAll(formateMap(mapList_fast));
list.addAll(formateMap(mapList_remaind));
}else {
//查询膜打印状态下的任务单详情
//查询普通组号列表 在辅助库、制证库中
List<Map<String, Object>> mapList_common = taskListMapper.selectByCountyAtAuxiliary_common3(process,process-1);
//查询快证组号列表 在辅助库、制证库中
List<Map<String, Object>> mapList_fast = taskListMapper.selectByCountyAtAuxiliary_fast4(process,process-1);
//查询余证组号列表 在辅助库、制证库中
List<Map<String, Object>> mapList_remaind = taskListMapper.selectByCountyAtAuxiliary_remaind4(process,process-1);
//查询余证组号列表 在辅助库、制证库中
List<Map<String, Object>> mapList_failed = taskListMapper.selectByCountyAtAuxiliary_failed3(process-1);
list = formateMap5(mapList_common);
list.addAll(formateMap5(mapList_fast));
list.addAll(formateMap5(mapList_remaind));
list.addAll(formateMap5(mapList_failed));
}
return list;
}
......@@ -329,6 +337,7 @@ public class TaskListServiceImpl implements TaskListService {
@Transactional(rollbackFor = Exception.class)
public List selectByCountyAtAuxiliary3(long process) {
List<Map<String, Object>> list = new ArrayList<>();
//电写入
if (process==4){
//查询普通组号列表 在辅助库、制证库中
List<Map<String, Object>> mapList_common = taskListMapper.selectByCountyAtAuxiliary_common2(process,process-1);
......@@ -345,6 +354,7 @@ public class TaskListServiceImpl implements TaskListService {
list.addAll(formateMap2(mapList_failed));
}else {
//分拣任务单
//查询普通组号列表 在辅助库、制证库中
List<Map<String, Object>> mapList_common = taskListMapper.selectByCountyAtAuxiliary_common2(process,process-1);
//查询快证组号列表 在辅助库、制证库中
......@@ -961,6 +971,114 @@ public class TaskListServiceImpl implements TaskListService {
return typeList;
}
private List<Map<String, Object>> formateMap5(List<Map<String, Object>> maplist) {
Map<String, Object> typeMap = new LinkedHashMap<>();
for (Map o : maplist) {
// 组合JSON
if (typeMap != null & typeMap.containsKey(o.get("CARD_TYPE") + "")) {
List<Map<String, Object>> mapList = (List<Map<String, Object>>) typeMap.get(o.get("CARD_TYPE"));
mapList.add(o);
typeMap.put(o.get("CARD_TYPE") + "", mapList);
} else {
List<Map<String, Object>> mapList = new ArrayList<>();
mapList.add(o);
typeMap.put(o.get("CARD_TYPE") + "", mapList);
}
}
//将已按制证分好的Map 再次细化分为任务单Map
for (String type : typeMap.keySet()) {
List<Map<String, Object>> mapList = (List<Map<String, Object>>) typeMap.get(type);
Map<String, Object> typemap = new LinkedHashMap<>();
for (Map<String, Object> o : mapList) {
if (typemap != null && typemap.containsKey(o.get("TASK_ID") + "")) {
List<Map<String, Object>> maplist_county = (List<Map<String, Object>>) typemap.get(o.get("TASK_ID") + "");
maplist_county.add(o);
typemap.put(o.get("TASK_ID") + "", maplist_county);
} else {
List<Map<String, Object>> maplist_county = new ArrayList<>();
maplist_county.add(o);
typemap.put(o.get("TASK_ID") + "", maplist_county);
}
}
typeMap.put(type, typemap);
}
List<Map<String, Object>> typeList = new ArrayList<>();
for (String type : typeMap.keySet()) {
Map<String, Object> mapType = new LinkedHashMap<>();
int typeSum = 0;
String typeName = null;
List<Map<String, Object>> countyList = new ArrayList<>();
Map<String, List<Map<String, Object>>> mapList = (Map<String, List<Map<String, Object>>>) typeMap.get(type);
for (String taskId : mapList.keySet()) {
Map<String, Object> countyMapGroup = new LinkedHashMap<>();
int validCount = 0;
int invalidCount = 0;
int specialCount = 0;
int DOWNLOAD_COUNT = 0;
int faileCount = 0;
int recheckCount = 0;
String countyName = null;
String countyCode = null;
Object submitDate = null;
List<Map<String, Object>> countyMapList = mapList.get(taskId);
for (Map<String, Object> countyMap : countyMapList) {
submitDate = countyMap.get("SUBMIT_DATE");
countyCode = countyMap.get("COUNTY_CODE") + "";
countyName = countyMap.get("COUNTYNAME") + "";
typeName = countyMap.get("CARD_TYPE_ID") + "";
typeSum += Integer.valueOf(countyMap.get("VALID_COUNT") + "");
typeSum -= Integer.valueOf(countyMap.get("SPECIAL_CARD_COUNT") + "");
validCount += Integer.valueOf(countyMap.get("VALID_COUNT") + "");
invalidCount += Integer.valueOf(countyMap.get("INVALID_COUNT") + "");
specialCount += Integer.valueOf(countyMap.get("SPECIAL_CARD_COUNT") + "");
faileCount += Integer.valueOf(countyMap.get("FAILECOUNT") + "");
DOWNLOAD_COUNT += Integer.valueOf(countyMap.get("DOWNLOAD_COUNT") + "");
recheckCount += Integer.valueOf(countyMap.get("FINISH_COUNT") + "");
}
if (countyMapList.size() == 1) {
countyMapGroup.put("groupNum", countyMapList.get(0).get("GROUP_NO"));
} else {
List<Integer> c = new ArrayList<>();
List<Integer> nsList = new ArrayList<>();
for (int i = 0; i < countyMapList.size(); i++) {
/**
* 判断组号中时候含有历史回迁组
*/
if ((((countyMapList.get(i)).get("GROUP_NO")) + "").contains("L")) {
if ((((countyMapList.get(i)).get("GROUP_NO")) + "").length() == 8) {
nsList.add(Integer.parseInt((((countyMapList.get(i)).get("GROUP_NO")) + "").substring(1, (((countyMapList.get(i)).get("GROUP_NO")) + "").length())));
}
} else {
if ((((countyMapList.get(i)).get("GROUP_NO")) + "").length() == 8) {
nsList.add(Integer.parseInt((((countyMapList.get(i)).get("GROUP_NO")) + "")));
}
}
}
countyMapGroup.put("groupNum", createGroupNo(c, nsList));
}
countyMapGroup.put("faileCount", faileCount);
countyMapGroup.put("specialCount", specialCount);
countyMapGroup.put("countyCode", countyCode);
countyMapGroup.put("taskId", taskId);
countyMapGroup.put("groupList", countyMapList);
countyMapGroup.put("saveDate", submitDate);
countyMapGroup.put("countyName", countyName);
countyMapGroup.put("downloadCount", DOWNLOAD_COUNT);
countyMapGroup.put("countyValidCount", validCount);
countyMapGroup.put("countyInvalidCount", invalidCount);
countyMapGroup.put("recheckCount", recheckCount);
countyList.add(countyMapGroup);
}
mapType.put("typeCode", typeName);
mapType.put("typeSum", typeSum);
mapType.put("typeName", type);
mapType.put("countyList", countyList);
typeList.add(mapType);
}
return typeList;
}
private List<Map<String, Object>> formateMap3(List<Map<String, Object>> maplist) {
Map<String, Object> typeMap = new LinkedHashMap<>();
for (Map o : 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