Commit ad8e73a8 authored by suichenguang's avatar suichenguang

搜索框

parent 900180b0
package com.yxproject.start.api;
import com.yxproject.start.service.SelectSerialNumberService;
import com.yxproject.start.utils.YXJSONResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
......@@ -26,50 +25,29 @@ public class SelectApi {
private SelectSerialNumberService selectSerialNumberService;
@RequestMapping(value = "selectByCard")
public String selectByCard(@RequestParam("id") String id){
// resp.setCharacterEncoding("UTF-8");
List<Map<String, Object>> resultList = new ArrayList<>();
/*任务单*/
Map<String,Object> taskListMap = new HashMap<>();
/*受理库*/
Map<String,Object> acceptMap = new HashMap<>();
/*制证库*/
Map<String,Object> accreditationMap = new HashMap<>();
public Map<String, Object> selectByCard(@RequestParam("id") String id){
Map<String,Object> resultMap = new HashMap<>();
if (id.length() ==10){
Map<String,Object> workOrderData = selectSerialNumberService.selectByWorkOrderFromYX(id);
taskListMap.put("workOrderData", workOrderData);
resultList.add(taskListMap);
resultList.add(acceptMap);
resultList.add(accreditationMap);
List<String> workOrderData = selectSerialNumberService.selectByWorkOrderFromYX(id);
resultMap.put("workOrderData", workOrderData);
}else if (id.length() ==8){
List<String> workOrderData = selectSerialNumberService.selectByGroupNo(id);
resultMap.put("workOrderData", workOrderData);
Map<String,Object> workOrderData = selectSerialNumberService.selectByGroupNo(id);
taskListMap.put("workOrderData", workOrderData);
resultList.add(taskListMap);
resultList.add(acceptMap);
resultList.add(accreditationMap);
} else if (id.length() == 11 || id.length() == 18) {
}else if (id.length()==11||id.length()==18){
Map<String,Object> workOrderData =selectSerialNumberService.selectByAcceptNoOrCardIdFromTaskList(id);
Map<String,Object> ACCdata = selectSerialNumberService.selectByAcceptNoOrCardIdFromACC(id);
Map<String,Object> PRODData = selectSerialNumberService.selectByAcceptNoOrCardIdFromPROD(id);
taskListMap.put("workOrderDate", workOrderData);
taskListMap.put("ACCdata", ACCdata);
taskListMap.put("PRODData", PRODData);
resultList.add(taskListMap);
resultList.add(acceptMap);
resultList.add(accreditationMap);
}else {
return "数据错误";
}
YXJSONResponse yxjsonResponse = new YXJSONResponse();
// resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(resultList);
return yxjsonResponse.toJSONString();
List<String> workOrderData = selectSerialNumberService.selectByAcceptNoOrCardIdFromTaskList(id);
List<String> ACCdata = selectSerialNumberService.selectByAcceptNoOrCardIdFromACC(id);
List<String> PRODData = selectSerialNumberService.selectByAcceptNoOrCardIdFromPROD(id);
resultMap.put("workOrderDate", workOrderData);
resultMap.put("ACCdata", ACCdata);
resultMap.put("PRODData", PRODData);
} else {
return null;
}
return resultMap;
}
}
......@@ -83,8 +83,6 @@ public class TaskListApi {
return true;
}
/**
* 查询任务单详情
* (受理库)
......@@ -99,7 +97,4 @@ public class TaskListApi {
return yxjsonResponse.toJSONString();
}
}
......@@ -5,6 +5,7 @@ package com.yxproject.start.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
@Mapper
......@@ -15,7 +16,7 @@ public interface SelectSerialNumberMapper {
" LEFT JOIN COUNTY_DIC ON TASK.COUNTY_CODE =COUNTY_DIC.COUNTY_CODE\n" +
" LEFT JOIN CARD_TYPE_DIC ON TASK.CARD_TYPE = CARD_TYPE_DIC.CARD_TYPE_ID\n" +
" WHERE TASK_ID =#{id}")
public Map<String,Object> selectByWorkOrder(String id);
public List<String> selectByWorkOrder(String id);
@Select("select GROUP_NO.TASK_ID,COUNTY_DIC.COUNTYNAME,CARD_TYPE_DIC.CARD_TYPE,TASK.ISSUED_DATE,TASK.DOWNLOAD_DATE,TASK.PRINT_OUT_DATE,TASK.POSITION_DATE,TASK.SORT_OUT_DATE,TASK.QUALITY_TEST_DATE,TASK.OUT_STORAGE_DATE\n" +
"from TASK\n" +
......@@ -23,7 +24,7 @@ public interface SelectSerialNumberMapper {
"LEFT JOIN CARD_TYPE_DIC ON TASK.CARD_TYPE = CARD_TYPE_DIC.CARD_TYPE_ID\n" +
"LEFT JOIN GROUP_NO ON TASK.TASK_ID=GROUP_NO.TASK_ID\n" +
"WHERE GROUP_NO =#{id}")
public Map<String,Object> selectByGroupNo(String id);
public List<String> selectByGroupNo(String id);
@Select("select GROUP_NO.TASK_ID,COUNTY_DIC.COUNTYNAME,CARD_TYPE_DIC.CARD_TYPE,TASK.ISSUED_DATE,TASK.DOWNLOAD_DATE,TASK.PRINT_OUT_DATE,TASK.POSITION_DATE,TASK.SORT_OUT_DATE,TASK.QUALITY_TEST_DATE,TASK.OUT_STORAGE_DATE\n" +
"from TASK\n" +
......@@ -33,7 +34,7 @@ public interface SelectSerialNumberMapper {
"LEFT JOIN PROD_DBA.PROD_CARD_T ON subStr(PROD_CARD_T.ACCEPT_NO ,0,8)=GROUP_NO.GROUP_NO \n" +
"LEFT JOIN PREPRO_PERSON ON PREPRO_PERSON.GMSFHM = PROD_DBA.PROD_CARD_T.ID_NO\n" +
"WHERE PREPRO_PERSON.GMSFHM =#{id} OR PROD_CARD_T.ACCEPT_NO=#{id}")
public Map<String,Object>selectByAcceptNoOrCardIdFromTaskList(String id);
public List<String> selectByAcceptNoOrCardIdFromTaskList(String id);
@Select("SELECT ACC_CARD_T.ACCEPT_NO,COUNTY_DIC.COUNTYNAME,ACC_CARD_T.NAME,CARD_TYPE_DIC.CARD_TYPE,ACC_CARD_T.ID_NO,ACC_CARD_T.SEX_NO,\n" +
"GAJG_DM.GAJG_MC AS GAJG1,ACC_CARD_T.BEGIN_DATE,ACC_CARD_T.EXPIRE_DATE,ACC_CARD_T.SIGN_GOVT\n" +
......@@ -44,11 +45,17 @@ public interface SelectSerialNumberMapper {
"LEFT JOIN CARD_TYPE_DIC ON TASK.CARD_TYPE = CARD_TYPE_DIC.CARD_TYPE_ID\n" +
"LEFT JOIN GAJG_DM ON subStr(ACC_CARD_T.upload_no,0,9)= GAJG_DM.GAJG_DM\n" +
"WHERE ACC_CARD_T.ACCEPT_NO =#{id} OR ACC_CARD_T.ID_NO =#{id}")
public Map<String,Object>selectByAcceptNoOrCardIdFromACC(String id);
public List<String> selectByAcceptNoOrCardIdFromACC(String id);
//TODO 不能用decode,这样拿不到工位信息
// "PROD_TRACE_T.PHOTO_DATE,\n" +
// "PROD_TRACE_T.EXPORT_DATE,\n" +
// "PROD_TRACE_T.DOWNLOAD_DATE,\n" +
// "PROD_TRACE_T.ELECTRIC_WRITE_DATE,\n" +
// "PROD_TRACE_T.CHECK_DATE,\n" +
// "PROD_TRACE_T.MOVE_DATE\n" +
@Select("SELECT PROD_CARD_T.ACCEPT_NO,COUNTY_DIC.COUNTYNAME,PROD_CARD_T.NAME,CARD_TYPE_DIC.CARD_TYPE,PROD_CARD_T.ID_NO,PROD_CARD_T.SEX_NO,\n" +
"GAJG_DM.GAJG_MC AS GAJG1,PROD_CARD_T.BEGIN_DATE,PROD_CARD_T.EXPIRE_DATE,PROD_CARD_T.SIGN_GOVT,\n" +
"decode(PROD_TRACE_T.PHOTO_DATE,null,decode(PROD_TRACE_T.EXPORT_DATE,null,decode(PROD_TRACE_T.DOWNLOAD_DATE,null,decode(PROD_TRACE_T.ELECTRIC_WRITE_DATE,null,decode(PROD_TRACE_T.CHECK_DATE,null,decode(PROD_TRACE_T.MOVE_DATE,null,To_date('20190304','yyyyMMdd'),PROD_TRACE_T.MOVE_DATE),PROD_TRACE_T.CHECK_DATE),PROD_TRACE_T.ELECTRIC_WRITE_DATE),PROD_TRACE_T.DOWNLOAD_DATE),PROD_TRACE_T.EXPORT_DATE),PROD_TRACE_T.PHOTO_DATE)\n" +
"GAJG_DM.GAJG_MC AS GAJG1,PROD_CARD_T.BEGIN_DATE,PROD_CARD_T.EXPIRE_DATE,PROD_CARD_T.SIGN_GOVT\n" +
"FROM PROD_CARD_T@PROD_LINK\n" +
"LEFT JOIN COUNTY_DIC ON subStr(PROD_CARD_T.UPLOAD_NO,0,6)=COUNTY_DIC.COUNTY_CODE\n" +
"LEFT JOIN GROUP_NO ON subStr(PROD_CARD_T.ACCEPT_NO,0,8)=GROUP_NO.GROUP_NO \n" +
......@@ -57,6 +64,6 @@ public interface SelectSerialNumberMapper {
"LEFT JOIN GAJG_DM ON subStr(PROD_CARD_T.upload_no,0,9)= GAJG_DM.GAJG_DM\n" +
"LEFT JOIN PROD_TRACE_T@PROD_LINK ON PROD_TRACE_T.ACCEPT_NO =PROD_CARD_T.ACCEPT_NO\n" +
"WHERE PROD_CARD_T.ACCEPT_NO =#{id} OR PROD_CARD_T.ID_NO =#{id}")
public Map<String,Object>selectByAcceptNoOrCardIdFromPROD(String id);
public List<String> selectByAcceptNoOrCardIdFromPROD(String id);
}
......@@ -2,19 +2,19 @@ package com.yxproject.start.service;
import java.util.Map;
import java.util.List;
public interface SelectSerialNumberService {
/*根据任务单查询辅助库*/
Map<String, Object> selectByWorkOrderFromYX(String id);
List<String> selectByWorkOrderFromYX(String id);
/*根据组号查询辅助库*/
Map<String,Object> selectByGroupNo(String id);
List<String> selectByGroupNo(String id);
/*根据身份证号或受理号查询辅助库*/
Map<String,Object>selectByAcceptNoOrCardIdFromTaskList(String id);
List<String>selectByAcceptNoOrCardIdFromTaskList(String id);
/*根据身份证号或受理号查询受理库*/
Map<String,Object>selectByAcceptNoOrCardIdFromACC(String id);
List<String>selectByAcceptNoOrCardIdFromACC(String id);
/*根据身份证号或受理号查询制证库*/
Map<String,Object>selectByAcceptNoOrCardIdFromPROD(String id);
List<String>selectByAcceptNoOrCardIdFromPROD(String id);
}
......@@ -2,10 +2,14 @@ package com.yxproject.start.service.impl;
import com.yxproject.start.mapper.SelectSerialNumberMapper;
import com.yxproject.start.service.SelectSerialNumberService;
import com.yxproject.start.utils.CompareDateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@Service
public class SelectSerialNumberServiceImpl implements SelectSerialNumberService{
......@@ -14,53 +18,35 @@ public class SelectSerialNumberServiceImpl implements SelectSerialNumberService{
public SelectSerialNumberMapper selectSerialNumberMapper;
@Override
public Map<String, Object> selectByWorkOrderFromYX(String id){
Map<String,Object> result = selectSerialNumberMapper.selectByWorkOrder(id);
public List<String> selectByWorkOrderFromYX(String id){
List<String> result = selectSerialNumberMapper.selectByWorkOrder(id);
return result;
}
@Override
public Map<String, Object> selectByGroupNo(String id) {
public List<String> selectByGroupNo(String id) {
System.out.println("impl");
Map<String,Object> result = selectSerialNumberMapper.selectByGroupNo(id);
List<String> result = selectSerialNumberMapper.selectByGroupNo(id);
System.out.println("查询结果:"+result);
return result;
}
@Override
public Map<String, Object> selectByAcceptNoOrCardIdFromTaskList(String id) {
Map<String,Object> result = selectSerialNumberMapper.selectByAcceptNoOrCardIdFromTaskList(id);
public List<String> selectByAcceptNoOrCardIdFromTaskList(String id) {
List<String> result = selectSerialNumberMapper.selectByAcceptNoOrCardIdFromTaskList(id);
return result;
}
@Override
public Map<String, Object> selectByAcceptNoOrCardIdFromACC(String id) {
Map<String,Object> result = selectSerialNumberMapper.selectByAcceptNoOrCardIdFromACC(id);
// if (result.get("SEX_ID").equals("1")){
// result.put("sex","男");
// }else if(result.get("SEX_ID").equals("2")){
// result.put("sex","女");
// }else {
// result.put("sex","未知");
//
// }
System.out.println("FromACC:"+result);
public List<String> selectByAcceptNoOrCardIdFromACC(String id) {
List<String> result = selectSerialNumberMapper.selectByAcceptNoOrCardIdFromACC(id);
return result;
}
//TODO 拿不到当前工位信息
@Override
public Map<String, Object> selectByAcceptNoOrCardIdFromPROD(String id) {
Map<String,Object> result = selectSerialNumberMapper.selectByAcceptNoOrCardIdFromPROD(id);
// if (result.get("SEX_ID").equals("1")){
// result.put("sex","男");
// }else if(result.get("SEX_ID").equals("2")){
// result.put("sex","女");
// }else {
// result.put("sex","未知");
//
// }
System.out.println("FromPROD:"+result);
public List<String> selectByAcceptNoOrCardIdFromPROD(String id) {
List<String> result = selectSerialNumberMapper.selectByAcceptNoOrCardIdFromPROD(id);
return result;
}
}
package com.yxproject.start.utils;
import java.util.Date;
import java.util.List;
public class CompareDateUtil {
public static List<Date> getd(List<Date> dateList){
dateList.sort((a1, a2) -> {
return a1.compareTo(a2);
});
return dateList;
}
}
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