zouxuan 5 年之前
父節點
當前提交
5463c5152e
共有 25 個文件被更改,包括 1098 次插入17 次删除
  1. 10 0
      src/main/java/com/ym/mec/collectfee/controller/OrderController.java
  2. 11 0
      src/main/java/com/ym/mec/collectfee/dao/ApplyInfoDao.java
  3. 11 0
      src/main/java/com/ym/mec/collectfee/dao/CourseGroupInfoDao.java
  4. 11 0
      src/main/java/com/ym/mec/collectfee/dao/SchoolDao.java
  5. 191 0
      src/main/java/com/ym/mec/collectfee/entity/ApplyInfo.java
  6. 166 0
      src/main/java/com/ym/mec/collectfee/entity/Course.java
  7. 125 0
      src/main/java/com/ym/mec/collectfee/entity/CourseGroupInfo.java
  8. 2 2
      src/main/java/com/ym/mec/collectfee/entity/RequestHead.java
  9. 4 0
      src/main/java/com/ym/mec/collectfee/entity/RequestParamBean.java
  10. 19 0
      src/main/java/com/ym/mec/collectfee/entity/ResponseCourseEntity.java
  11. 125 0
      src/main/java/com/ym/mec/collectfee/entity/School.java
  12. 8 0
      src/main/java/com/ym/mec/collectfee/service/ApplyInfoService.java
  13. 8 0
      src/main/java/com/ym/mec/collectfee/service/CourseGroupInfoService.java
  14. 7 0
      src/main/java/com/ym/mec/collectfee/service/OrderService.java
  15. 11 0
      src/main/java/com/ym/mec/collectfee/service/SchoolService.java
  16. 1 0
      src/main/java/com/ym/mec/collectfee/service/YqQueryService.java
  17. 22 0
      src/main/java/com/ym/mec/collectfee/service/impl/ApplyInfoServiceImpl.java
  18. 22 0
      src/main/java/com/ym/mec/collectfee/service/impl/CourseGroupInfoServiceImpl.java
  19. 50 9
      src/main/java/com/ym/mec/collectfee/service/impl/OrderServiceImpl.java
  20. 27 0
      src/main/java/com/ym/mec/collectfee/service/impl/SchoolServiceImpl.java
  21. 75 4
      src/main/java/com/ym/mec/collectfee/utils/HttpUtil.java
  22. 3 2
      src/main/java/com/ym/mec/collectfee/utils/XStreamUtil.java
  23. 67 0
      src/main/resources/config/mybatis/ApplyInfoMapper.xml
  24. 61 0
      src/main/resources/config/mybatis/CourseGroupInfoMapper.xml
  25. 61 0
      src/main/resources/config/mybatis/SchoolMapper.xml

+ 10 - 0
src/main/java/com/ym/mec/collectfee/controller/OrderController.java

@@ -45,4 +45,14 @@ public class OrderController extends BaseController {
         return orderService.pushOrder(batchNum);
     }
 
+    /**
+     * 根据乐团编号获取乐团信息
+     * @param schoolId
+     * @return
+     */
+    @RequestMapping("/getSchoolDetail")
+    public Object getSchoolDetail(Integer schoolId,Integer clazzId){
+        return orderService.getSchoolDetail(schoolId,clazzId);
+    }
+
 }

+ 11 - 0
src/main/java/com/ym/mec/collectfee/dao/ApplyInfoDao.java

@@ -0,0 +1,11 @@
+package com.ym.mec.collectfee.dao;
+
+import com.ym.mec.collectfee.common.dao.BaseDAO;
+import com.ym.mec.collectfee.entity.ApplyInfo;
+import org.springframework.stereotype.Component;
+
+@Component
+public interface ApplyInfoDao extends BaseDAO<Integer, ApplyInfo> {
+
+	
+}

+ 11 - 0
src/main/java/com/ym/mec/collectfee/dao/CourseGroupInfoDao.java

@@ -0,0 +1,11 @@
+package com.ym.mec.collectfee.dao;
+
+import com.ym.mec.collectfee.common.dao.BaseDAO;
+import com.ym.mec.collectfee.entity.CourseGroupInfo;
+import org.springframework.stereotype.Component;
+
+@Component
+public interface CourseGroupInfoDao extends BaseDAO<Integer, CourseGroupInfo> {
+
+	
+}

+ 11 - 0
src/main/java/com/ym/mec/collectfee/dao/SchoolDao.java

@@ -0,0 +1,11 @@
+package com.ym.mec.collectfee.dao;
+
+import com.ym.mec.collectfee.common.dao.BaseDAO;
+import com.ym.mec.collectfee.entity.School;
+import org.springframework.stereotype.Component;
+
+@Component
+public interface SchoolDao extends BaseDAO<Integer, School> {
+
+	
+}

+ 191 - 0
src/main/java/com/ym/mec/collectfee/entity/ApplyInfo.java

@@ -0,0 +1,191 @@
+package com.ym.mec.collectfee.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(apply_info):
+ */
+public class ApplyInfo {
+
+	/**  */
+	private Integer id;
+	
+	/** 学生姓名 */
+	private String name;
+	
+	/** 性别0男1女 */
+	private Integer sex;
+	
+	/** 生日 */
+	private java.util.Date birthday;
+	
+	/** 城市 */
+	private String city;
+	
+	/** 学校编号 */
+	private String school;
+	
+	/** 年级 */
+	private String grade;
+	
+	/** 班级 */
+	private String gClass;
+	
+	/** 科目id */
+	private Integer subId;
+	
+	/** 是否服从调剂 0 否 1是 */
+	private Integer isAdjust;
+	
+	/** 家长手机号 */
+	private String patriarchPhone;
+	
+	/** 家长姓名 */
+	private String patriarchName;
+	
+	/** 家长工作单位 */
+	private String patriarchUnit;
+	
+	/** 0报名中,1报名完成,2报名失败 */
+	private Integer status;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setName(String name){
+		this.name = name;
+	}
+	
+	public String getName(){
+		return this.name;
+	}
+			
+	public void setSex(Integer sex){
+		this.sex = sex;
+	}
+	
+	public Integer getSex(){
+		return this.sex;
+	}
+			
+	public void setBirthday(java.util.Date birthday){
+		this.birthday = birthday;
+	}
+	
+	public java.util.Date getBirthday(){
+		return this.birthday;
+	}
+			
+	public void setCity(String city){
+		this.city = city;
+	}
+	
+	public String getCity(){
+		return this.city;
+	}
+			
+	public void setSchool(String school){
+		this.school = school;
+	}
+	
+	public String getSchool(){
+		return this.school;
+	}
+			
+	public void setGrade(String grade){
+		this.grade = grade;
+	}
+	
+	public String getGrade(){
+		return this.grade;
+	}
+			
+	public void setGClass(String gClass){
+		this.gClass = gClass;
+	}
+	
+	public String getGClass(){
+		return this.gClass;
+	}
+			
+	public void setSubId(Integer subId){
+		this.subId = subId;
+	}
+	
+	public Integer getSubId(){
+		return this.subId;
+	}
+			
+	public void setIsAdjust(Integer isAdjust){
+		this.isAdjust = isAdjust;
+	}
+	
+	public Integer getIsAdjust(){
+		return this.isAdjust;
+	}
+			
+	public void setPatriarchPhone(String patriarchPhone){
+		this.patriarchPhone = patriarchPhone;
+	}
+	
+	public String getPatriarchPhone(){
+		return this.patriarchPhone;
+	}
+			
+	public void setPatriarchName(String patriarchName){
+		this.patriarchName = patriarchName;
+	}
+	
+	public String getPatriarchName(){
+		return this.patriarchName;
+	}
+			
+	public void setPatriarchUnit(String patriarchUnit){
+		this.patriarchUnit = patriarchUnit;
+	}
+	
+	public String getPatriarchUnit(){
+		return this.patriarchUnit;
+	}
+			
+	public void setStatus(Integer status){
+		this.status = status;
+	}
+	
+	public Integer getStatus(){
+		return this.status;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 166 - 0
src/main/java/com/ym/mec/collectfee/entity/Course.java

@@ -0,0 +1,166 @@
+package com.ym.mec.collectfee.entity;
+
+import com.thoughtworks.xstream.annotations.XStreamAlias;
+
+import java.math.BigDecimal;
+
+/**
+ * 乐团请求实体类
+ */
+@XStreamAlias("course")
+public class Course {
+
+    //课程组id
+    private Integer courseId;
+
+    //课程组名称
+    private String courseName;
+
+    //班级id
+    private Integer classId;
+
+    //班级名称
+    private String className;
+
+    //专业编号
+    private Integer subId;
+
+    //专业名称
+    private String subNames;
+
+    //计划招生人数
+    private Integer enrollCount;
+
+    //已报名或在读学员人数
+    private Integer stuCount;
+
+    //课程班状态,1招生中,其他状态见文档
+    private Integer status;
+
+    //所属分部编号
+    private Integer branchId;
+
+    //课程班收费类别
+    private Integer chargeType;
+
+    //课程班收费账户
+    private Integer chargeAcct;
+
+    //课程学费收费方式,1按课时收费,2包期限收费,21自动包月收费
+    private Integer chargeMode;
+
+    //学费单价(元)。课程收费方式为按课时收费(小课)时,该值为每课时的收费金额(元/课时);为包月收费(乐团)时,该值为每月的收费金额(元/月)
+    private BigDecimal price;
+
+    public Integer getCourseId() {
+        return courseId;
+    }
+
+    public void setCourseId(Integer courseId) {
+        this.courseId = courseId;
+    }
+
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
+
+    public Integer getClassId() {
+        return classId;
+    }
+
+    public void setClassId(Integer classId) {
+        this.classId = classId;
+    }
+
+    public String getClassName() {
+        return className;
+    }
+
+    public void setClassName(String className) {
+        this.className = className;
+    }
+
+    public Integer getSubId() {
+        return subId;
+    }
+
+    public void setSubId(Integer subId) {
+        this.subId = subId;
+    }
+
+    public String getSubNames() {
+        return subNames;
+    }
+
+    public void setSubNames(String subNames) {
+        this.subNames = subNames;
+    }
+
+    public Integer getEnrollCount() {
+        return enrollCount;
+    }
+
+    public void setEnrollCount(Integer enrollCount) {
+        this.enrollCount = enrollCount;
+    }
+
+    public Integer getStuCount() {
+        return stuCount;
+    }
+
+    public void setStuCount(Integer stuCount) {
+        this.stuCount = stuCount;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getBranchId() {
+        return branchId;
+    }
+
+    public void setBranchId(Integer branchId) {
+        this.branchId = branchId;
+    }
+
+    public Integer getChargeType() {
+        return chargeType;
+    }
+
+    public void setChargeType(Integer chargeType) {
+        this.chargeType = chargeType;
+    }
+
+    public Integer getChargeAcct() {
+        return chargeAcct;
+    }
+
+    public void setChargeAcct(Integer chargeAcct) {
+        this.chargeAcct = chargeAcct;
+    }
+
+    public Integer getChargeMode() {
+        return chargeMode;
+    }
+
+    public void setChargeMode(Integer chargeMode) {
+        this.chargeMode = chargeMode;
+    }
+
+    public BigDecimal getPrice() {
+        return price;
+    }
+
+    public void setPrice(BigDecimal price) {
+        this.price = price;
+    }
+}

+ 125 - 0
src/main/java/com/ym/mec/collectfee/entity/CourseGroupInfo.java

@@ -0,0 +1,125 @@
+package com.ym.mec.collectfee.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(course_group_info):
+ */
+public class CourseGroupInfo {
+
+	/** 课程组编号 */
+	private Integer id;
+	
+	/** 课程组名称 */
+	private String name;
+	
+	/** 专业编号 */
+	private Integer subId;
+	
+	/** 专业名称 */
+	private String subName;
+	
+	/** 计划招生人数 */
+	private Integer planNum;
+	
+	/** 实际招生人数 */
+	private Integer regNum;
+	
+	/** 收费类型 */
+	private Integer feeType;
+	
+	/** 收费金额 */
+	private java.math.BigDecimal feeAmount;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setName(String name){
+		this.name = name;
+	}
+	
+	public String getName(){
+		return this.name;
+	}
+			
+	public void setSubId(Integer subId){
+		this.subId = subId;
+	}
+	
+	public Integer getSubId(){
+		return this.subId;
+	}
+			
+	public void setSubName(String subName){
+		this.subName = subName;
+	}
+	
+	public String getSubName(){
+		return this.subName;
+	}
+			
+	public void setPlanNum(Integer planNum){
+		this.planNum = planNum;
+	}
+	
+	public Integer getPlanNum(){
+		return this.planNum;
+	}
+			
+	public void setRegNum(Integer regNum){
+		this.regNum = regNum;
+	}
+	
+	public Integer getRegNum(){
+		return this.regNum;
+	}
+			
+	public void setFeeType(Integer feeType){
+		this.feeType = feeType;
+	}
+	
+	public Integer getFeeType(){
+		return this.feeType;
+	}
+			
+	public void setFeeAmount(java.math.BigDecimal feeAmount){
+		this.feeAmount = feeAmount;
+	}
+	
+	public java.math.BigDecimal getFeeAmount(){
+		return this.feeAmount;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 2 - 2
src/main/java/com/ym/mec/collectfee/entity/RequestHead.java

@@ -14,10 +14,10 @@ public class RequestHead {
     private String msgId;
 
     //交易指令
-    private Integer cmd = 121512;
+    private Integer cmd;
 
     //调用接口的用户id
-    private Integer uid = 2;
+    private Integer uid = 102;
 
     //请求时间戳,yyyymmddhhmmss
     private String ts;

+ 4 - 0
src/main/java/com/ym/mec/collectfee/entity/RequestParamBean.java

@@ -1,7 +1,11 @@
 package com.ym.mec.collectfee.entity;
 
+import com.thoughtworks.xstream.XStream;
 import com.thoughtworks.xstream.annotations.XStreamAlias;
 
+import java.io.StringWriter;
+import java.io.Writer;
+
 @XStreamAlias("request")
 public class RequestParamBean {
 

+ 19 - 0
src/main/java/com/ym/mec/collectfee/entity/ResponseCourseEntity.java

@@ -0,0 +1,19 @@
+package com.ym.mec.collectfee.entity;
+
+import com.thoughtworks.xstream.annotations.XStreamAlias;
+
+import java.util.List;
+
+@XStreamAlias("body")
+public class ResponseCourseEntity {
+    @XStreamAlias("courses")
+    private List<Course> courses;
+
+    public List<Course> getCourses() {
+        return courses;
+    }
+
+    public void setCourses(List<Course> courses) {
+        this.courses = courses;
+    }
+}

+ 125 - 0
src/main/java/com/ym/mec/collectfee/entity/School.java

@@ -0,0 +1,125 @@
+package com.ym.mec.collectfee.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(school):
+ */
+public class School {
+
+	/** 乐团id */
+	private Integer id;
+	
+	/** 乐团名称 */
+	private String name;
+	
+	/** 状态1报名中,2缴费中,3报名截止,4已开团 */
+	private Integer status;
+	
+	/** 分部编号 */
+	private Integer branchId;
+	
+	/** 分部名称 */
+	private String branchName;
+	
+	/** 乐器保证金 */
+	private String eDeposit;
+	
+	/** 学校id */
+	private Integer schoolId;
+	
+	/** 学校名称 */
+	private String schoolName;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setName(String name){
+		this.name = name;
+	}
+	
+	public String getName(){
+		return this.name;
+	}
+			
+	public void setStatus(Integer status){
+		this.status = status;
+	}
+	
+	public Integer getStatus(){
+		return this.status;
+	}
+			
+	public void setBranchId(Integer branchId){
+		this.branchId = branchId;
+	}
+	
+	public Integer getBranchId(){
+		return this.branchId;
+	}
+			
+	public void setBranchName(String branchName){
+		this.branchName = branchName;
+	}
+	
+	public String getBranchName(){
+		return this.branchName;
+	}
+			
+	public void setEDeposit(String eDeposit){
+		this.eDeposit = eDeposit;
+	}
+	
+	public String getEDeposit(){
+		return this.eDeposit;
+	}
+			
+	public void setSchoolId(Integer schoolId){
+		this.schoolId = schoolId;
+	}
+	
+	public Integer getSchoolId(){
+		return this.schoolId;
+	}
+			
+	public void setSchoolName(String schoolName){
+		this.schoolName = schoolName;
+	}
+	
+	public String getSchoolName(){
+		return this.schoolName;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 8 - 0
src/main/java/com/ym/mec/collectfee/service/ApplyInfoService.java

@@ -0,0 +1,8 @@
+package com.ym.mec.collectfee.service;
+
+import com.ym.mec.collectfee.common.service.BaseService;
+import com.ym.mec.collectfee.entity.ApplyInfo;
+
+public interface ApplyInfoService extends BaseService<Integer, ApplyInfo> {
+
+}

+ 8 - 0
src/main/java/com/ym/mec/collectfee/service/CourseGroupInfoService.java

@@ -0,0 +1,8 @@
+package com.ym.mec.collectfee.service;
+
+import com.ym.mec.collectfee.common.service.BaseService;
+import com.ym.mec.collectfee.entity.CourseGroupInfo;
+
+public interface CourseGroupInfoService extends BaseService<Integer, CourseGroupInfo> {
+
+}

+ 7 - 0
src/main/java/com/ym/mec/collectfee/service/OrderService.java

@@ -29,4 +29,11 @@ public interface OrderService extends BaseService<Integer, Order> {
      * @return
      */
     int countOrder(String poName,String voicePort);
+
+    /**
+     * 根据乐团编号获取乐团信息
+     * @param schoolId
+     * @return
+     */
+    Object getSchoolDetail(Integer schoolId,Integer clazzId);
 }

+ 11 - 0
src/main/java/com/ym/mec/collectfee/service/SchoolService.java

@@ -0,0 +1,11 @@
+package com.ym.mec.collectfee.service;
+
+import com.ym.mec.collectfee.common.service.BaseService;
+import com.ym.mec.collectfee.entity.ResponseCourseEntity;
+import com.ym.mec.collectfee.entity.School;
+
+public interface SchoolService extends BaseService<Integer, School> {
+
+    School upsetSchool(ResponseCourseEntity courseEntity);
+
+}

+ 1 - 0
src/main/java/com/ym/mec/collectfee/service/YqQueryService.java

@@ -9,6 +9,7 @@ import java.util.Map;
 
 @FeignClient(value = "yqQuery", url = "${yq-pay.query-host}")
 public interface YqQueryService {
+
     @RequestMapping(name = "订单查询", value = "/query/trade/tradeQuery", method = RequestMethod.POST)
     String orderQuery(@RequestParam Map<String, Object> map);
 

+ 22 - 0
src/main/java/com/ym/mec/collectfee/service/impl/ApplyInfoServiceImpl.java

@@ -0,0 +1,22 @@
+package com.ym.mec.collectfee.service.impl;
+
+import com.ym.mec.collectfee.common.dao.BaseDAO;
+import com.ym.mec.collectfee.common.service.impl.BaseServiceImpl;
+import com.ym.mec.collectfee.dao.ApplyInfoDao;
+import com.ym.mec.collectfee.entity.ApplyInfo;
+import com.ym.mec.collectfee.service.ApplyInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ApplyInfoServiceImpl extends BaseServiceImpl<Integer, ApplyInfo> implements ApplyInfoService {
+	
+	@Autowired
+	private ApplyInfoDao applyInfoDao;
+
+	@Override
+	public BaseDAO<Integer, ApplyInfo> getDAO() {
+		return applyInfoDao;
+	}
+	
+}

+ 22 - 0
src/main/java/com/ym/mec/collectfee/service/impl/CourseGroupInfoServiceImpl.java

@@ -0,0 +1,22 @@
+package com.ym.mec.collectfee.service.impl;
+
+import com.ym.mec.collectfee.common.dao.BaseDAO;
+import com.ym.mec.collectfee.common.service.impl.BaseServiceImpl;
+import com.ym.mec.collectfee.dao.CourseGroupInfoDao;
+import com.ym.mec.collectfee.entity.CourseGroupInfo;
+import com.ym.mec.collectfee.service.CourseGroupInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class CourseGroupInfoServiceImpl extends BaseServiceImpl<Integer, CourseGroupInfo> implements CourseGroupInfoService {
+	
+	@Autowired
+	private CourseGroupInfoDao courseGroupInfoDao;
+
+	@Override
+	public BaseDAO<Integer, CourseGroupInfo> getDAO() {
+		return courseGroupInfoDao;
+	}
+	
+}

+ 50 - 9
src/main/java/com/ym/mec/collectfee/service/impl/OrderServiceImpl.java

@@ -5,19 +5,21 @@ import com.thoughtworks.xstream.XStream;
 import com.ym.mec.collectfee.common.dao.BaseDAO;
 import com.ym.mec.collectfee.common.service.impl.BaseServiceImpl;
 import com.ym.mec.collectfee.dao.OrderDao;
-import com.ym.mec.collectfee.entity.Order;
-import com.ym.mec.collectfee.entity.Orders;
-import com.ym.mec.collectfee.entity.RequestParamBean;
-import com.ym.mec.collectfee.entity.RequestHead;
+import com.ym.mec.collectfee.entity.*;
 import com.ym.mec.collectfee.service.OrderService;
+import com.ym.mec.collectfee.utils.HttpUtil;
 import com.ym.mec.collectfee.utils.XStreamUtil;
+import org.apache.commons.lang3.RandomUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.io.IOException;
 import java.io.StringWriter;
 import java.io.Writer;
+import java.util.ArrayList;
 import java.util.Base64;
 import java.util.List;
+import java.util.Random;
 
 @Service
 public class OrderServiceImpl extends BaseServiceImpl<Integer, Order> implements OrderService {
@@ -28,6 +30,8 @@ public class OrderServiceImpl extends BaseServiceImpl<Integer, Order> implements
 	//公共密钥
 	private String publicKey = "e99a18c428cb38d5f260853678922e03";
 
+	private String url = "http://101.200.2.249:9001/api/sys";
+
 	@Override
 	public BaseDAO<Integer, Order> getDAO() {
 		return orderDao;
@@ -53,11 +57,10 @@ public class OrderServiceImpl extends BaseServiceImpl<Integer, Order> implements
 			xs.toXML(orders,writer);
 			String body = writer.toString();
 			body = body.substring(body.indexOf("<body>")+6,body.indexOf("</body>"));
-//			String body = "<id>1</id><oid>123456</oid><userId>100018</userId><amount>1000.00</amount><pay>1000.00</pay><bank>301</bank><account>2342345</account><uAccount>123423452</uAccount><payId>234562354234</payId><payTime>2019-08-19 16:33:42.0 UTC</payTime><remark>test</remark><classId>1</classId><status>0</status><createTime>2019-08-19 16:34:12.0 UTC</createTime><poName>er而为人</poName><voicyPart>阿道夫</voicyPart><balance>500.00</balance><batchNum>23452345</batchNum>";
 
 			body = Base64.getEncoder().encodeToString(body.getBytes());
 			requestParamBean.setBody(body);
-			requestParamBean.setHead(getOrdersHead(orderList,body));
+			requestParamBean.setHead(getOrdersHead(body,121512));
 
 			xs.autodetectAnnotations(true);
 			writer = new StringWriter();
@@ -70,10 +73,10 @@ public class OrderServiceImpl extends BaseServiceImpl<Integer, Order> implements
 		return null;
 	}
 
-	private RequestHead getOrdersHead(List<Order> orders,String body){
-		Order order = orders.get(0);
+	private RequestHead getOrdersHead(String body,Integer cmd){
 		RequestHead head = new RequestHead();
-		head.setMsgId(order.getBatchNum());
+		head.setMsgId(getRandom(7));
+		head.setCmd(cmd);
 		head.setSign(getSign(head, body, publicKey));
 		return head;
 	}
@@ -90,4 +93,42 @@ public class OrderServiceImpl extends BaseServiceImpl<Integer, Order> implements
 	public int countOrder(String poName, String voicePort) {
 		return orderDao.countOrder(poName,voicePort);
 	}
+
+	@Override
+	public Object getSchoolDetail(Integer schoolId,Integer clazzId) {
+		try {
+			RequestParamBean requestParamBean = new RequestParamBean();
+			String body = "<schoolId>" + schoolId + "</schoolId><classId>" + clazzId + "</classId>";
+			body = Base64.getEncoder().encodeToString(body.getBytes());
+			requestParamBean.setBody(body);
+			requestParamBean.setHead(getOrdersHead(body,124005));
+			XStream xs = new XStream();
+			xs.autodetectAnnotations(true);
+			Writer writer = new StringWriter();
+			writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
+			xs.toXML(requestParamBean,writer);
+			String parseBody = parseBody(HttpUtil.postXmlData(writer.toString(), url));
+			ResponseCourseEntity xmlToObject = XStreamUtil.xmlToObject("body", ResponseCourseEntity.class, parseBody);
+			return xmlToObject;
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+	public String parseBody(String body){
+		body = body.substring(body.indexOf("<body>")+6,body.indexOf("</body>"));
+		return "<body><courses>" + new String(Base64.getDecoder().decode(body)) + "</courses></body>";
+	}
+
+	public static String getRandom(int length) {
+		String base = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+		Random random = new Random();
+		StringBuffer sb = new StringBuffer();
+		for (int i = 0; i < length; i++) {
+			int number = random.nextInt(base.length());
+			sb.append(base.charAt(number));
+		}
+		return sb.toString();
+	}
 }

+ 27 - 0
src/main/java/com/ym/mec/collectfee/service/impl/SchoolServiceImpl.java

@@ -0,0 +1,27 @@
+package com.ym.mec.collectfee.service.impl;
+
+import com.ym.mec.collectfee.common.dao.BaseDAO;
+import com.ym.mec.collectfee.common.service.impl.BaseServiceImpl;
+import com.ym.mec.collectfee.dao.SchoolDao;
+import com.ym.mec.collectfee.entity.ResponseCourseEntity;
+import com.ym.mec.collectfee.entity.School;
+import com.ym.mec.collectfee.service.SchoolService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class SchoolServiceImpl extends BaseServiceImpl<Integer, School> implements SchoolService {
+	
+	@Autowired
+	private SchoolDao schoolDao;
+
+	@Override
+	public BaseDAO<Integer, School> getDAO() {
+		return schoolDao;
+	}
+
+	@Override
+	public School upsetSchool(ResponseCourseEntity courseEntity) {
+		return null;
+	}
+}

+ 75 - 4
src/main/java/com/ym/mec/collectfee/utils/HttpUtil.java

@@ -1,10 +1,12 @@
 package com.ym.mec.collectfee.utils;
 
+import com.thoughtworks.xstream.XStream;
 import org.apache.commons.beanutils.ConvertUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
 import org.apache.http.NameValuePair;
+import org.apache.http.client.HttpClient;
 import org.apache.http.client.entity.UrlEncodedFormEntity;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.methods.HttpPost;
@@ -15,13 +17,14 @@ import org.apache.http.message.BasicNameValuePair;
 import org.apache.http.util.EntityUtils;
 import org.apache.tomcat.util.http.fileupload.IOUtils;
 
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.security.KeyManagementException;
 import java.security.KeyStoreException;
 import java.security.NoSuchAlgorithmException;
+import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -29,6 +32,74 @@ import java.util.Map.Entry;
 
 public class HttpUtil {
 
+	public static String postXmlData(String xmlData, String url)
+			throws Exception {
+		OutputStreamWriter osw;
+		//获取http连接
+		HttpURLConnection con = getConnection(url);
+		byte[] xmlByteData = xmlData.getBytes("utf-8");
+		try {
+			//设置Context-Length
+			con.setRequestProperty("Context-Length", String.valueOf(xmlByteData.length));
+			//获得输出流
+			OutputStream outputStream = con.getOutputStream();
+			BufferedOutputStream bos = new BufferedOutputStream(outputStream);
+			osw = new OutputStreamWriter(bos, "UTF-8");
+			//写入
+			osw.write(xmlData);
+			//清空缓存
+			osw.flush();
+			osw.close();
+			//解析返回报文
+
+			StringBuffer out = new StringBuffer();
+			byte[] b = new byte[4096];
+			for (int n; (n = con.getInputStream().read(b)) != -1;) {
+				out.append(new String(b, 0, n));
+			}
+			return out.toString();
+		} catch (IOException ex) {
+			throw new IOException(ex.getMessage());
+		} catch (IllegalArgumentException argumetEx) {
+			throw new IllegalArgumentException(argumetEx.getMessage());
+		} catch (Exception ex) {
+			throw new Exception(ex.getMessage());
+		}
+	}
+	/**
+	 * 得到一个有效的连接
+	 * @param url 连接端口
+	 * @return HttpURLConnection 一个有效的连接
+	 */
+	public static HttpURLConnection getConnection(String url) throws IOException {
+
+		HttpURLConnection urlconnection = null;
+		try {
+			//得到url连接对象
+			URL urlcon = new URL(url);
+			//获取到connection连接对象
+			urlconnection = (HttpURLConnection) urlcon.openConnection();
+			//设置头参数
+//			urlconnection.setRequestProperty("Content-Type", "text/xml;charset=UTF-8");
+			urlconnection.addRequestProperty("content-type", "application/x-www-form-urlencoded;charset=UTF-8");
+//			urlconnection.setRequestProperty("Accept", "text/xml");
+			urlconnection.setRequestProperty("version", "100");
+			urlconnection.setRequestMethod("POST");
+			urlconnection.setDoOutput(true);
+			urlconnection.setDoInput(true);
+			urlconnection.setUseCaches(false);
+		} catch (java.net.ProtocolException proEx) {
+			throw new IOException(proEx.getMessage());
+		} catch (MalformedURLException MaEx) {
+			throw new IOException(MaEx.getMessage());
+		} catch (Exception ex) {
+			throw new IOException(ex.getMessage());
+		}
+		//返回连接
+		return urlconnection;
+	}
+
+
 	/**
 	 * POST请求http url
 	 * 

+ 3 - 2
src/main/java/com/ym/mec/collectfee/utils/XStreamUtil.java

@@ -28,11 +28,12 @@ public final class XStreamUtil {
 	 */
 	@SuppressWarnings("unchecked")
 	public static <T> T xmlToObject(String rootNode, Class<T> rootNodeType,
-			InputStream inputStream) {
+			String body) {
 		XStream xStream = new XStream();// 默认用xppDriver
+		xStream.autodetectAnnotations(true);
 		xStream.alias(rootNode, rootNodeType);// 尽可能的加上,否则会抛CannotResolveClassException异常
 		// 将xml转换成对�?
-		return (T) xStream.fromXML(inputStream);
+		return (T) xStream.fromXML(body);
 	}
 
 	/**

+ 67 - 0
src/main/resources/config/mybatis/ApplyInfoMapper.xml

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--
+这个文件是自动生成的。
+不要修改此文件。所有改动将在下次重新自动生成时丢失。
+-->
+<mapper namespace="com.ym.mec.collectfee.dao.ApplyInfoDao">
+	
+	<resultMap type="com.ym.mec.collectfee.entity.ApplyInfo" id="ApplyInfo">
+		<result column="id_" property="id" />
+		<result column="name_" property="name" />
+		<result column="sex_" property="sex" />
+		<result column="birthday_" property="birthday" />
+		<result column="city_" property="city" />
+		<result column="school_" property="school" />
+		<result column="grade_" property="grade" />
+		<result column="g_class_" property="gClass" />
+		<result column="sub_id_" property="subId" />
+		<result column="is_adjust_" property="isAdjust" />
+		<result column="patriarch_phone_" property="patriarchPhone" />
+		<result column="patriarch_name_" property="patriarchName" />
+		<result column="patriarch_unit_" property="patriarchUnit" />
+		<result column="status_" property="status" />
+		<result column="update_time_" property="updateTime" />
+		<result column="create_time_" property="createTime" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="ApplyInfo" >
+		SELECT * FROM apply_info WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="ApplyInfo">
+		SELECT * FROM apply_info ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.collectfee.entity.ApplyInfo" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		INSERT INTO apply_info (id_,name_,sex_,birthday_,city_,school_,grade_,g_class_,sub_id_,is_adjust_,patriarch_phone_,patriarch_name_,patriarch_unit_,status_,update_time_,create_time_) VALUES(#{id},#{name},#{sex},#{birthday},#{city},#{school},#{grade},#{gClass},#{subId},#{isAdjust},#{patriarchPhone},#{patriarchName},#{patriarchUnit},#{status},#{updateTime},#{createTime})
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.collectfee.entity.ApplyInfo">
+		UPDATE apply_info SET sub_id_ = #{subId},school_ = #{school},is_adjust_ = #{isAdjust},status_ = #{status},id_ = #{id},g_class_ = #{gClass},sex_ = #{sex},birthday_ = #{birthday},name_ = #{name},create_time_ = #{createTime},city_ = #{city},patriarch_phone_ = #{patriarchPhone},patriarch_name_ = #{patriarchName},patriarch_unit_ = #{patriarchUnit},update_time_ = #{updateTime},grade_ = #{grade} WHERE id_ = #{id} 
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM apply_info WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="ApplyInfo" parameterType="map">
+		SELECT * FROM apply_info ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM apply_info
+	</select>
+</mapper>

+ 61 - 0
src/main/resources/config/mybatis/CourseGroupInfoMapper.xml

@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--
+这个文件是自动生成的。
+不要修改此文件。所有改动将在下次重新自动生成时丢失。
+-->
+<mapper namespace="com.ym.mec.collectfee.dao.CourseGroupInfoDao">
+	
+	<resultMap type="com.ym.mec.collectfee.entity.CourseGroupInfo" id="CourseGroupInfo">
+		<result column="id_" property="id" />
+		<result column="name_" property="name" />
+		<result column="sub_id_" property="subId" />
+		<result column="sub_name_" property="subName" />
+		<result column="plan_num_" property="planNum" />
+		<result column="reg_num_" property="regNum" />
+		<result column="fee_type_" property="feeType" />
+		<result column="fee_amount_" property="feeAmount" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="CourseGroupInfo" >
+		SELECT * FROM course_group_info WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="CourseGroupInfo">
+		SELECT * FROM course_group_info ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.collectfee.entity.CourseGroupInfo" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		INSERT INTO course_group_info (id_,name_,sub_id_,sub_name_,plan_num_,reg_num_,fee_type_,fee_amount_,create_time_,update_time_) VALUES(#{id},#{name},#{subId},#{subName},#{planNum},#{regNum},#{feeType},#{feeAmount},#{createTime},#{updateTime})
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.collectfee.entity.CourseGroupInfo">
+		UPDATE course_group_info SET sub_id_ = #{subId},plan_num_ = #{planNum},fee_type_ = #{feeType},id_ = #{id},fee_amount_ = #{feeAmount},sub_name_ = #{subName},update_time_ = #{updateTime},reg_num_ = #{regNum},name_ = #{name},create_time_ = #{createTime} WHERE id_ = #{id} 
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM course_group_info WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="CourseGroupInfo" parameterType="map">
+		SELECT * FROM course_group_info ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM course_group_info
+	</select>
+</mapper>

+ 61 - 0
src/main/resources/config/mybatis/SchoolMapper.xml

@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--
+这个文件是自动生成的。
+不要修改此文件。所有改动将在下次重新自动生成时丢失。
+-->
+<mapper namespace="com.ym.mec.collectfee.dao.SchoolDao">
+	
+	<resultMap type="com.ym.mec.collectfee.entity.School" id="School">
+		<result column="id_" property="id" />
+		<result column="name_" property="name" />
+		<result column="status_" property="status" />
+		<result column="branch_id_" property="branchId" />
+		<result column="branch_name_" property="branchName" />
+		<result column="e_deposit__" property="eDeposit" />
+		<result column="school_id_" property="schoolId" />
+		<result column="school_name_" property="schoolName" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="School" >
+		SELECT * FROM school WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="School">
+		SELECT * FROM school ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.collectfee.entity.School" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		INSERT INTO school (id_,name_,status_,branch_id_,branch_name_,e_deposit__,school_id_,school_name_,create_time_,update_time_) VALUES(#{id},#{name},#{status},#{branchId},#{branchName},#{eDeposit},#{schoolId},#{schoolName},#{createTime},#{updateTime})
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.collectfee.entity.School">
+		UPDATE school SET status_ = #{status},school_id_ = #{schoolId},e_deposit__ = #{eDeposit},id_ = #{id},school_name_ = #{schoolName},update_time_ = #{updateTime},branch_id_ = #{branchId},branch_name_ = #{branchName},name_ = #{name},create_time_ = #{createTime} WHERE id_ = #{id} 
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM school WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="School" parameterType="map">
+		SELECT * FROM school ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM school
+	</select>
+</mapper>