Commit 513d0686 authored by dahai's avatar dahai

更新交接单 交接单详单实体

parent b0320bbe
...@@ -29,10 +29,7 @@ import javax.ws.rs.core.MediaType; ...@@ -29,10 +29,7 @@ import javax.ws.rs.core.MediaType;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.HashMap; import java.util.*;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@RestController @RestController
@RequestMapping("importXML") @RequestMapping("importXML")
...@@ -77,39 +74,44 @@ public class ReadXmlApi { ...@@ -77,39 +74,44 @@ public class ReadXmlApi {
MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) requ; MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) requ;
Iterator<String> iter = multiRequest.getFileNames(); Iterator<String> iter = multiRequest.getFileNames();
while (iter.hasNext()) { while (iter.hasNext()) {
MultipartFile item = multiRequest.getFile(iter.next()); List<MultipartFile> fileRows = multiRequest.getFiles(iter.next().toString());
try { for (MultipartFile item: fileRows) {
// 如果fileitem中封装的是普通输入项的数据 try {
// 如果fileitem中封装的是上传文件 // 如果fileitem中封装的是普通输入项的数据
// 得到上传的文件名称 // 如果fileitem中封装的是上传文件
filename = item.getName(); // 得到上传的文件名称
if (filename == null || filename.trim().equals("")) { filename = item.getName();
System.out.println(filename+"===============");
if (filename == null || filename.trim().equals("")) {
continue;
}
InputStream in = item.getInputStream();
String str = YXStringUtils.inputStream2String(in, "utf-8");
in.close();
IDCardFactory idCardFactory = new IDCardFactory();
idcardsFactory(idCardFactory.extractIDCard(str));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
yxresp.outPutError("UnsupportedEncodingException", "上传文件时发现文件编码错误:" + e.getMessage());
continue;
} catch (IOException e) {
e.printStackTrace();
yxresp.outPutError("IOException", "上传文件时发生IO错误:" + e.getMessage());
continue;
} catch (DocumentException e) {
e.printStackTrace();
yxresp.outPutError("DocumentException", "上传文件时发生IO错误:" + e.getMessage());
continue;
} catch (Exception e) {
e.printStackTrace();
yxresp.outPutError("Exception", "上传文件时发生错误,非法XML文件:" + filename);
continue; continue;
} }
InputStream in = item.getInputStream();
String str = YXStringUtils.inputStream2String(in, "utf-8");
in.close();
IDCardFactory idCardFactory = new IDCardFactory();
idcardsFactory(idCardFactory.extractIDCard(str));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
yxresp.outPutError("UnsupportedEncodingException", "上传文件时发现文件编码错误:" + e.getMessage());
continue;
} catch (IOException e) {
e.printStackTrace();
yxresp.outPutError("IOException", "上传文件时发生IO错误:" + e.getMessage());
continue;
} catch (DocumentException e) {
e.printStackTrace();
yxresp.outPutError("DocumentException", "上传文件时发生IO错误:" + e.getMessage());
continue;
} catch (Exception e) {
e.printStackTrace();
yxresp.outPutError("Exception", "上传文件时发生错误,非法XML文件:" + filename);
continue;
} }
} }
} }
// item
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
yxresp.outPutError("FileUploadException", "文件上传发生异常:" + e.getMessage()); yxresp.outPutError("FileUploadException", "文件上传发生异常:" + e.getMessage());
......
package com.yxproject.start.entity; package com.yxproject.start.entity;
import javax.persistence.*; import javax.persistence.*;
import java.sql.Time;
import java.util.Objects; import java.util.Objects;
/** /**
* @auther zhangyusheng * @auther zhangyusheng
* 2019/3/9 14:53 * 2019/3/10 14:52
*/ */
@Entity @Entity
@Table(name = "DETAIL_RECEIPT_LIST", schema = "YINGXIN", catalog = "") @Table(name = "DETAIL_RECEIPT_LIST", schema = "YINGXIN", catalog = "")
...@@ -17,8 +16,6 @@ public class DetailReceiptListEntity { ...@@ -17,8 +16,6 @@ public class DetailReceiptListEntity {
private String name; private String name;
private String policeCode; private String policeCode;
private String cardId; private String cardId;
private Time printUninstallMark;
private Time eQualityMark;
private String note; private String note;
private String signGovt; private String signGovt;
...@@ -82,26 +79,6 @@ public class DetailReceiptListEntity { ...@@ -82,26 +79,6 @@ public class DetailReceiptListEntity {
this.cardId = cardId; this.cardId = cardId;
} }
@Basic
@Column(name = "PRINT_UNINSTALL_MARK")
public Time getPrintUninstallMark() {
return printUninstallMark;
}
public void setPrintUninstallMark(Time printUninstallMark) {
this.printUninstallMark = printUninstallMark;
}
@Basic
@Column(name = "E_QUALITY_MARK")
public Time geteQualityMark() {
return eQualityMark;
}
public void seteQualityMark(Time eQualityMark) {
this.eQualityMark = eQualityMark;
}
@Basic @Basic
@Column(name = "NOTE") @Column(name = "NOTE")
public String getNote() { public String getNote() {
...@@ -133,14 +110,12 @@ public class DetailReceiptListEntity { ...@@ -133,14 +110,12 @@ public class DetailReceiptListEntity {
Objects.equals(name, that.name) && Objects.equals(name, that.name) &&
Objects.equals(policeCode, that.policeCode) && Objects.equals(policeCode, that.policeCode) &&
Objects.equals(cardId, that.cardId) && Objects.equals(cardId, that.cardId) &&
Objects.equals(printUninstallMark, that.printUninstallMark) &&
Objects.equals(eQualityMark, that.eQualityMark) &&
Objects.equals(note, that.note) && Objects.equals(note, that.note) &&
Objects.equals(signGovt, that.signGovt); Objects.equals(signGovt, that.signGovt);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(id, uploadNo, acceptNo, name, policeCode, cardId, printUninstallMark, eQualityMark, note, signGovt); return Objects.hash(id, uploadNo, acceptNo, name, policeCode, cardId, note, signGovt);
} }
} }
...@@ -4,17 +4,21 @@ import javax.persistence.*; ...@@ -4,17 +4,21 @@ import javax.persistence.*;
import java.sql.Time; import java.sql.Time;
import java.util.Objects; import java.util.Objects;
/**
* @auther zhangyusheng
* 2019/3/10 14:52
*/
@Entity @Entity
@Table(name = "RECEIPT_LIST", schema = "YINGXIN", catalog = "") @Table(name = "RECEIPT_LIST", schema = "YINGXIN", catalog = "")
public class ReceiptListEntity { public class ReceiptListEntity {
private long id; private long id;
private Long taskId; private String qrCode;
private Time saveDate; private Time receiptDate;
private String policeCode; private String policeCode;
private Long finishCount; private Long finishCount;
private Long inStorageCount; private Time checkDate;
private Long outStorageCount; private String checkName;
private String note; private Long state;
@Id @Id
@Column(name = "ID") @Column(name = "ID")
...@@ -27,23 +31,23 @@ public class ReceiptListEntity { ...@@ -27,23 +31,23 @@ public class ReceiptListEntity {
} }
@Basic @Basic
@Column(name = "TASK_ID") @Column(name = "QR_CODE")
public Long getTaskId() { public String getQrCode() {
return taskId; return qrCode;
} }
public void setTaskId(Long taskId) { public void setQrCode(String qrCode) {
this.taskId = taskId; this.qrCode = qrCode;
} }
@Basic @Basic
@Column(name = "SAVE_DATE") @Column(name = "RECEIPT_DATE")
public Time getSaveDate() { public Time getReceiptDate() {
return saveDate; return receiptDate;
} }
public void setSaveDate(Time saveDate) { public void setReceiptDate(Time receiptDate) {
this.saveDate = saveDate; this.receiptDate = receiptDate;
} }
@Basic @Basic
...@@ -67,33 +71,33 @@ public class ReceiptListEntity { ...@@ -67,33 +71,33 @@ public class ReceiptListEntity {
} }
@Basic @Basic
@Column(name = "IN_STORAGE_COUNT") @Column(name = "CHECK_DATE")
public Long getInStorageCount() { public Time getCheckDate() {
return inStorageCount; return checkDate;
} }
public void setInStorageCount(Long inStorageCount) { public void setCheckDate(Time checkDate) {
this.inStorageCount = inStorageCount; this.checkDate = checkDate;
} }
@Basic @Basic
@Column(name = "OUT_STORAGE_COUNT") @Column(name = "CHECK_NAME")
public Long getOutStorageCount() { public String getCheckName() {
return outStorageCount; return checkName;
} }
public void setOutStorageCount(Long outStorageCount) { public void setCheckName(String checkName) {
this.outStorageCount = outStorageCount; this.checkName = checkName;
} }
@Basic @Basic
@Column(name = "NOTE") @Column(name = "STATE")
public String getNote() { public Long getState() {
return note; return state;
} }
public void setNote(String note) { public void setState(Long state) {
this.note = note; this.state = state;
} }
@Override @Override
...@@ -102,17 +106,17 @@ public class ReceiptListEntity { ...@@ -102,17 +106,17 @@ public class ReceiptListEntity {
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
ReceiptListEntity that = (ReceiptListEntity) o; ReceiptListEntity that = (ReceiptListEntity) o;
return id == that.id && return id == that.id &&
Objects.equals(taskId, that.taskId) && Objects.equals(qrCode, that.qrCode) &&
Objects.equals(saveDate, that.saveDate) && Objects.equals(receiptDate, that.receiptDate) &&
Objects.equals(policeCode, that.policeCode) && Objects.equals(policeCode, that.policeCode) &&
Objects.equals(finishCount, that.finishCount) && Objects.equals(finishCount, that.finishCount) &&
Objects.equals(inStorageCount, that.inStorageCount) && Objects.equals(checkDate, that.checkDate) &&
Objects.equals(outStorageCount, that.outStorageCount) && Objects.equals(checkName, that.checkName) &&
Objects.equals(note, that.note); Objects.equals(state, that.state);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(id, taskId, saveDate, policeCode, finishCount, inStorageCount, outStorageCount, note); return Objects.hash(id, qrCode, receiptDate, policeCode, finishCount, checkDate, checkName, state);
} }
} }
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