Commit 9d1d77a8 authored by suichenguang's avatar suichenguang

搜索框查询

parent 35ffc44d
......@@ -3,63 +3,48 @@ package com.yxproject.start.api;
import com.yxproject.start.entity.SpecialCardInfoEntity;
import com.yxproject.start.service.SelectSerialNumberService;
import com.yxproject.start.utils.YXJSONResponse;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;
/**
* 根据 组号、受理号、身份证号、任务单号查询
*
*
*搜索框查询
*/
@RestController
@RequestMapping("specialCardInfo")
public class selectApi {
/**
*搜索框查询
* 根据 组号、受理号、身份证号、任务单号查询
*/
@Autowired
private SelectSerialNumberService selectSerialNumberService;
public String selectByCard(@RequestParam("id") String id, HttpServletResponse resp){
String library;
SpecialCardInfoEntity specialCardInfoEntity;
@RequestMapping(value = "selectByCard", method = RequestMethod.GET)
public Map<String,Object> selectByCard(@RequestParam("id") String id, HttpServletResponse resp){
resp.setCharacterEncoding("UTF-8");
Map<String, Object> map = new HashMap<>();
switch (id.length()){
case 8:
library="盈信库";
specialCardInfoEntity= selectSerialNumberService.selectByGroupNumber(id);
specialCardInfoEntity.setLibrary(library);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(specialCardInfoEntity);
return yxjsonResponse.toJSONString();
SpecialCardInfoEntity specialCardInfo= selectSerialNumberService.selectByGroupNumber(id);
map.put("searchResult",specialCardInfo);
break;
case 10:
library ="受理库";
SpecialCardInfoEntity specialCardInfo2 = selectSerialNumberService.selectByIDCardOrAccepted(id);
map.put("searchResult",specialCardInfo2);
break;
case 18:
library="受理库";
break;
SpecialCardInfoEntity specialCardInfo3 = selectSerialNumberService.selectByIDCardOrAccepted(id);
map.put("searchResult",specialCardInfo3);
break;
case 11:
break;
SpecialCardInfoEntity specialCardInfo4 = selectSerialNumberService.selectByWorkOrderNumber(id);
map.put("searchResult",specialCardInfo4);
break;
}
return null;
JSONObject resultJson = JSONObject.fromObject(map);
System.out.println("api111111111111"+resultJson);
return resultJson;
}
}
......@@ -3,75 +3,64 @@ package com.yxproject.start.entity;
import javax.persistence.Entity;
import javax.xml.crypto.Data;
@Entity
public class SpecialCardInfoEntity {
/**库名*/
private String library;
/**组号*/
private long groupIn;
/**证件类型*/
private int specialType;
/**地域*/
private String countryName;
/**循环单生成时间*/
private Data submitDate;
/**工序*/
private String taskState;
/**转入制证库时间*/
private Data ZzSubmitDate;
/**原文件名*/
private String originalNo;
/**装库日期*/
/**循环单流水号*/
/**打印机器*/
/**操作时间*/
/***/
private TaskEntity taskEntity;
private GroupNoEntity groupNoEntity;
private AccCardTEntity accCardTEntity;
private String taskState;
private String cityName;
private String library;
private String painterName;
private String cardType;
private Data lastModifyTime;
public Data getLastModifyTime() {
return lastModifyTime;
}
public void setLastModifyTime(Data lastModifyTime) {
this.lastModifyTime = lastModifyTime;
}
public String getLibrary() {
return library;
public AccCardTEntity getAccCardTEntity() {
return accCardTEntity;
}
public void setLibrary(String library) {
this.library = library;
public void setAccCardTEntity(AccCardTEntity accCardTEntity) {
this.accCardTEntity = accCardTEntity;
}
public long getGroupIn() {
return groupIn;
public String getCardType() {
return cardType;
}
public void setGroupIn(long groupIn) {
this.groupIn = groupIn;
public void setCardType(String cardType) {
this.cardType = cardType;
}
public int getSpecialType() {
return specialType;
public String getPainterName() {
return painterName;
}
public void setSpecialType(int specialType) {
this.specialType = specialType;
public void setPainterName(String painterName) {
this.painterName = painterName;
}
public String getCountryName() {
return countryName;
public TaskEntity getTaskEntity() {
return taskEntity;
}
public void setCountryName(String countryName) {
this.countryName = countryName;
public void setTaskEntity(TaskEntity taskEntity) {
this.taskEntity = taskEntity;
}
public Data getSubmitDate() {
return submitDate;
public GroupNoEntity getGroupNoEntity() {
return groupNoEntity;
}
public void setSubmitDate(Data submitDate) {
this.submitDate = submitDate;
public void setGroupNoEntity(GroupNoEntity groupNoEntity) {
this.groupNoEntity = groupNoEntity;
}
public String getTaskState() {
......@@ -82,23 +71,24 @@ public class SpecialCardInfoEntity {
this.taskState = taskState;
}
public Data getZzSubmitDate() {
return ZzSubmitDate;
public String getCityName() {
return cityName;
}
public void setZzSubmitDate(Data zzSubmitDate) {
ZzSubmitDate = zzSubmitDate;
public void setCityName(String cityName) {
this.cityName = cityName;
}
public String getOriginalNo() {
return originalNo;
public String getLibrary() {
return library;
}
public void setOriginalNo(String originalNo) {
this.originalNo = originalNo;
public void setLibrary(String library) {
this.library = library;
}
}
package com.yxproject.start.mapper;
import com.yxproject.start.entity.SpecialCardEntity;
import com.yxproject.start.entity.SpecialCardInfoEntity;
import com.yxproject.start.entity.accu.AccCardTEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@Mapper
......
......@@ -4,6 +4,10 @@ import com.yxproject.start.entity.SpecialCardInfoEntity;
public interface SelectSerialNumberService {
public SpecialCardInfoEntity selectByGroupNumber(String id);
SpecialCardInfoEntity selectByGroupNumber(String id);
SpecialCardInfoEntity selectByIDCardOrAccepted(String id);
SpecialCardInfoEntity selectByWorkOrderNumber(String id);
}
package com.yxproject.start.service.impl;
import com.yxproject.start.entity.SpecialCardInfoEntity;
import com.yxproject.start.mapper.SelectSerialNumberMapper;
import com.yxproject.start.service.SelectSerialNumberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
public class SelectSerialNumberServiceImpl {
import javax.xml.crypto.Data;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
@Service
public class SelectSerialNumberServiceImpl implements SelectSerialNumberService {
@Autowired
public SelectSerialNumberMapper selectSerialNumberMapper;
@Override
public SpecialCardInfoEntity selectByGroupNumber(String id){
Map<String, Object> map = selectSerialNumberMapper.selectByGroupNumber(id);
System.out.println("数据111"+map);
SpecialCardInfoEntity specialCardInfoEntity = new SpecialCardInfoEntity();
specialCardInfoEntity.setLibrary("盈信库");
specialCardInfoEntity.getGroupNoEntity().setTask_Id((Long) map.get("TASK_ID"));
specialCardInfoEntity.getGroupNoEntity().setGroup_No(String.valueOf(map.get("GROUP_NO")));
specialCardInfoEntity.setCityName(String.valueOf(map.get("CITYNAME")));
specialCardInfoEntity.setCardType((String) map.get("CARD_TYPE"));
specialCardInfoEntity.getTaskEntity().setSubmit_Date((Date) map.get("SUBMIT_DATE"));
specialCardInfoEntity.setPainterName((String) map.get("PRINTER_NAME"));
specialCardInfoEntity.getTaskEntity().setPosition_Date((Date) map.get("POSITION_DATE"));
specialCardInfoEntity.getTaskEntity().setQuality_People_Name((String) map.get("QUALITY_PEOPLE_NAME"));
specialCardInfoEntity.getTaskEntity().setOut_Storage_Date((Date) map.get("OUT_STORAGE_DATE"));
specialCardInfoEntity.getTaskEntity().setIn_Storage_Date((Date) map.get("IN_STORAGE_DATE"));
specialCardInfoEntity.getTaskEntity().setException_Information((String) map.get("EXCEPTION_INFORMATION"));
return specialCardInfoEntity;
}
@Override
public SpecialCardInfoEntity selectByIDCardOrAccepted(String id){
Map<String,Object> map = selectSerialNumberMapper.selectByIDCardOrAccepted(id);
SpecialCardInfoEntity specialCardInfoEntity = new SpecialCardInfoEntity();
String sex ;
if ((Integer)map.get("SEX_NO")==1){
sex = "男";
}else if ((Integer)map.get("SEX_NO")==2){
sex = "女";
}else {
sex = "缺失";
}
if ((Integer) map.get("CARD_TYPE")==0){
specialCardInfoEntity.setCardType((String) map.get("CARD_TYPE"));
}else if ( (Integer) map.get("CARD_TYPE")!= 0&& map.get("CARD_TYPE")!=null){
}else {
specialCardInfoEntity.setCardType("缺失");
}
specialCardInfoEntity.setLibrary("受理库");
specialCardInfoEntity.getAccCardTEntity().setAcceptNo((String) map.get("ACCEPT_NO"));
specialCardInfoEntity.getAccCardTEntity().setName((String) map.get("NAME"));
specialCardInfoEntity.getAccCardTEntity().setIdNo((String) map.get("ID_NO"));
specialCardInfoEntity.getAccCardTEntity().setSexNo(sex);
specialCardInfoEntity.getAccCardTEntity().setBirthday((String) map.get("BIRTHDAY"));
specialCardInfoEntity.getAccCardTEntity().setSignGovt((String) map.get("SIGN_GOVT"));
specialCardInfoEntity.getAccCardTEntity().setBeginDate((String) map.get("BEGIN_DATE"));
specialCardInfoEntity.getAccCardTEntity().setExpireDate((String) map.get("EXPIRE_DATE"));
specialCardInfoEntity.getAccCardTEntity().setStatusNo((String) map.get("STATUS_NO"));
specialCardInfoEntity.setTaskState((String) map.get("TASK_STATE"));
specialCardInfoEntity.setCityName((String) map.get("CITYNAME"));
specialCardInfoEntity.setLastModifyTime((Data) map.get("lastModifyTime;"));
return specialCardInfoEntity;
}
@Override
public SpecialCardInfoEntity selectByWorkOrderNumber(String id){
Map<String,Object> map = selectSerialNumberMapper.selectByWorkOrderNumber(id);
SpecialCardInfoEntity specialCardInfoEntity = new SpecialCardInfoEntity();
specialCardInfoEntity.setLibrary("盈信库");
specialCardInfoEntity.getTaskEntity().setTask_Id((Long) map.get("TASK_ID"));
specialCardInfoEntity.setCityName((String) map.get("CITYNAME"));
specialCardInfoEntity.setCardType((String) map.get("CARD_TYPE"));
specialCardInfoEntity.getTaskEntity().setSubmit_Date((Date) map.get("SUBMIT_DATE"));
specialCardInfoEntity.setPainterName((String) map.get("PRINTER_NAME"));
specialCardInfoEntity.getTaskEntity().setPosition_Date((Date) map.get("POSITION_DATE"));
specialCardInfoEntity.getTaskEntity().setQuality_People_Name((String) map.get("QUALITY_PEOPLE_NAME"));
specialCardInfoEntity.getTaskEntity().setOut_Storage_Date((Date) map.get("OUT_STORAGE_DATE"));
specialCardInfoEntity.getTaskEntity().setIn_Storage_Date((Date) map.get("IN_STORAGE_DATE"));
specialCardInfoEntity.getTaskEntity().setException_Information((String) map.get("EXCEPTION_INFORMATION"));
return specialCardInfoEntity;
}
}
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