Commit d313a095 authored by dahai's avatar dahai

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

parents 55e54eb4 84287c32
......@@ -25,21 +25,30 @@ public class SelectApi {
private SelectSerialNumberService selectSerialNumberService;
@RequestMapping(value = "selectByCard")
public Map<String, Object> selectByCard(@RequestParam("id") String id){
public Map<String,Object> selectByCard(@RequestParam("id") String id){
Map<String,Object> resultMap = new HashMap<>();
if (id.length() ==10){
List<String> workOrderData = selectSerialNumberService.selectByWorkOrderFromYX(id);
resultMap.put("workOrderData", workOrderData);
}else if (id.length() ==8){
List<String> workOrderData = selectSerialNumberService.selectByGroupNo(id);
if (id.length() == 11) {
List<Map<String, Object>> workOrderData = selectSerialNumberService.selectByWorkOrderFromYX(id);
List<Map<String, Object>> ACCdata = new ArrayList<>();
List<Map<String, Object>> PRODData = new ArrayList<>();
resultMap.put("workOrderData", workOrderData);
resultMap.put("ACCdata", ACCdata);
resultMap.put("PRODData", PRODData);
} else if (id.length() == 8) {
List<Map<String, Object>> workOrderData = selectSerialNumberService.selectByGroupNo(id);
List<Map<String, Object>> ACCdata = new ArrayList<>();
List<Map<String, Object>> PRODData = new ArrayList<>();
} else if (id.length() == 11 || id.length() == 18) {
resultMap.put("workOrderData", workOrderData);
resultMap.put("ACCdata", ACCdata);
resultMap.put("PRODData", PRODData);
} else if (id.length() == 10 || id.length() == 18) {
List<String> workOrderData = selectSerialNumberService.selectByAcceptNoOrCardIdFromTaskList(id);
List<String> ACCdata = selectSerialNumberService.selectByAcceptNoOrCardIdFromACC(id);
List<String> PRODData = selectSerialNumberService.selectByAcceptNoOrCardIdFromPROD(id);
List<Map<String, Object>> workOrderData = selectSerialNumberService.selectByAcceptNoOrCardIdFromTaskList(id);
List<Map<String, Object>> ACCdata = selectSerialNumberService.selectByAcceptNoOrCardIdFromACC(id);
List<Map<String, Object>> PRODData = selectSerialNumberService.selectByAcceptNoOrCardIdFromPROD(id);
resultMap.put("workOrderDate", workOrderData);
resultMap.put("ACCdata", ACCdata);
......
package com.yxproject.start.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
......@@ -16,7 +14,8 @@ 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 List<String> selectByWorkOrder(String id);
public List<Map<String,Object>> 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" +
......@@ -24,7 +23,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 List<String> selectByGroupNo(String id);
public List<Map<String,Object>> 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" +
......@@ -34,7 +33,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 List<String> selectByAcceptNoOrCardIdFromTaskList(String id);
public List<Map<String,Object>> 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" +
......@@ -45,7 +44,7 @@ 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 List<String> selectByAcceptNoOrCardIdFromACC(String id);
public List<Map<String,Object>> selectByAcceptNoOrCardIdFromACC(String id);
//TODO 不能用decode,这样拿不到工位信息
// "PROD_TRACE_T.PHOTO_DATE,\n" +
......@@ -64,6 +63,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 List<String> selectByAcceptNoOrCardIdFromPROD(String id);
public List<Map<String,Object>> selectByAcceptNoOrCardIdFromPROD(String id);
}
......@@ -3,18 +3,19 @@ package com.yxproject.start.service;
import java.util.List;
import java.util.Map;
public interface SelectSerialNumberService {
/*根据任务单查询辅助库*/
List<String> selectByWorkOrderFromYX(String id);
List<Map<String, Object>> selectByWorkOrderFromYX(String id);
/*根据组号查询辅助库*/
List<String> selectByGroupNo(String id);
List<Map<String, Object>> selectByGroupNo(String id);
/*根据身份证号或受理号查询辅助库*/
List<String>selectByAcceptNoOrCardIdFromTaskList(String id);
List<Map<String, Object>> selectByAcceptNoOrCardIdFromTaskList(String id);
/*根据身份证号或受理号查询受理库*/
List<String>selectByAcceptNoOrCardIdFromACC(String id);
List<Map<String, Object>> selectByAcceptNoOrCardIdFromACC(String id);
/*根据身份证号或受理号查询制证库*/
List<String>selectByAcceptNoOrCardIdFromPROD(String id);
List<Map<String, Object>> selectByAcceptNoOrCardIdFromPROD(String id);
}
......@@ -2,13 +2,9 @@ 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.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@Service
......@@ -18,35 +14,36 @@ public class SelectSerialNumberServiceImpl implements SelectSerialNumberService{
public SelectSerialNumberMapper selectSerialNumberMapper;
@Override
public List<String> selectByWorkOrderFromYX(String id){
List<String> result = selectSerialNumberMapper.selectByWorkOrder(id);
public List<Map<String, Object>> selectByWorkOrderFromYX(String id){
List<Map<String, Object>> result = selectSerialNumberMapper.selectByWorkOrder(id);
System.out.println("任务单信息:"+result);
return result;
}
@Override
public List<String> selectByGroupNo(String id) {
public List<Map<String, Object>> selectByGroupNo(String id) {
System.out.println("impl");
List<String> result = selectSerialNumberMapper.selectByGroupNo(id);
List<Map<String, Object>> result = selectSerialNumberMapper.selectByGroupNo(id);
System.out.println("查询结果:"+result);
return result;
}
@Override
public List<String> selectByAcceptNoOrCardIdFromTaskList(String id) {
List<String> result = selectSerialNumberMapper.selectByAcceptNoOrCardIdFromTaskList(id);
public List<Map<String, Object>> selectByAcceptNoOrCardIdFromTaskList(String id) {
List<Map<String, Object>> result = selectSerialNumberMapper.selectByAcceptNoOrCardIdFromTaskList(id);
return result;
}
@Override
public List<String> selectByAcceptNoOrCardIdFromACC(String id) {
List<String> result = selectSerialNumberMapper.selectByAcceptNoOrCardIdFromACC(id);
public List<Map<String, Object>> selectByAcceptNoOrCardIdFromACC(String id) {
List<Map<String, Object>> result = selectSerialNumberMapper.selectByAcceptNoOrCardIdFromACC(id);
return result;
}
//TODO 拿不到当前工位信息
@Override
public List<String> selectByAcceptNoOrCardIdFromPROD(String id) {
List<String> result = selectSerialNumberMapper.selectByAcceptNoOrCardIdFromPROD(id);
public List<Map<String, Object>> selectByAcceptNoOrCardIdFromPROD(String id) {
List<Map<String, Object>> 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;
}
}
......@@ -5,6 +5,7 @@ PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
<configuration>
<settings>
<setting name="mapUnderscoreToCamelCase" value="true"/>
<setting name="callSettersOnNulls" value="true"/>
<setting name="logImpl" value="STDOUT_LOGGING" />
</settings>
</configuration>
\ No newline at end of file
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