RequestHead.java 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. package com.ym.mec.collectfee.entity;
  2. import com.thoughtworks.xstream.annotations.XStreamAlias;
  3. import java.text.SimpleDateFormat;
  4. import java.time.LocalDateTime;
  5. import java.time.format.DateTimeFormatter;
  6. import java.util.SimpleTimeZone;
  7. @XStreamAlias("head")
  8. public class RequestHead {
  9. //消息编号,不可重复
  10. private String msgId;
  11. //交易指令
  12. private Integer cmd;
  13. //调用接口的用户id
  14. private Integer uid = 1048;
  15. //请求时间戳,yyyymmddhhmmss
  16. private String ts;
  17. //响应数据类别,xml
  18. private String ret = "xml";
  19. //加密类型 0不加密(默认),1DES加密,2专用算法1,3专用算法2,4DES加密(Ansi版, ECB模式,PKCS5)
  20. private Integer encrypt = 0;
  21. //签名
  22. private String sign;
  23. public RequestHead() {
  24. String format = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
  25. setTs(format);
  26. }
  27. public String getMsgId() {
  28. return msgId;
  29. }
  30. public void setMsgId(String msgId) {
  31. this.msgId = msgId;
  32. }
  33. public Integer getCmd() {
  34. return cmd;
  35. }
  36. public void setCmd(Integer cmd) {
  37. this.cmd = cmd;
  38. }
  39. public Integer getUid() {
  40. return uid;
  41. }
  42. public void setUid(Integer uid) {
  43. this.uid = uid;
  44. }
  45. public String getTs() {
  46. return ts;
  47. }
  48. public void setTs(String ts) {
  49. this.ts = ts;
  50. }
  51. public String getRet() {
  52. return ret;
  53. }
  54. public void setRet(String ret) {
  55. this.ret = ret;
  56. }
  57. public Integer getEncrypt() {
  58. return encrypt;
  59. }
  60. public void setEncrypt(Integer encrypt) {
  61. this.encrypt = encrypt;
  62. }
  63. public String getSign() {
  64. return sign;
  65. }
  66. public void setSign(String sign) {
  67. this.sign = sign;
  68. }
  69. }