Przeglądaj źródła

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan 5 lat temu
rodzic
commit
9098d00dcb
37 zmienionych plików z 1149 dodań i 65 usunięć
  1. 10 0
      mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/entity/SysRole.java
  2. 43 6
      mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/entity/SysUser.java
  3. 6 2
      mec-auth/mec-auth-server/src/main/resources/config/mybatis/SysRoleMapper.xml
  4. 14 2
      mec-auth/mec-auth-server/src/main/resources/config/mybatis/SysUserMapper.xml
  5. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/DemoGroupClassGroupMapperDao.java
  6. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/DemoGroupCoursesPlanDao.java
  7. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/DemoGroupDao.java
  8. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentWithdrawDao.java
  9. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CashAccountDetail.java
  10. 54 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/WithdrawDto.java
  11. 134 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/WithdrawInfoDto.java
  12. 92 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/DemoGroup.java
  13. 59 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/DemoGroupClassGroupMapper.java
  14. 59 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/DemoGroupCoursesPlan.java
  15. 37 24
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysUserCashAccountDetail.java
  16. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ClassGroupTypeEnum.java
  17. 4 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/TransTypeEnum.java
  18. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/DemoGroupClassGroupMapperService.java
  19. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/DemoGroupCoursesPlanService.java
  20. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/DemoGroupService.java
  21. 19 1
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentWithdrawService.java
  22. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/DemoGroupClassGroupMapperServiceImpl.java
  23. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/DemoGroupCoursesPlanServiceImpl.java
  24. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/DemoGroupServiceImpl.java
  25. 134 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentWithdrawServiceImpl.java
  26. 68 0
      mec-biz/src/main/resources/config/mybatis/DemoGroupClassGroupMapperMapper.xml
  27. 68 0
      mec-biz/src/main/resources/config/mybatis/DemoGroupCoursesPlanMapper.xml
  28. 80 0
      mec-biz/src/main/resources/config/mybatis/DemoGroupMapper.xml
  29. 2 2
      mec-biz/src/main/resources/config/mybatis/EmployeeMapper.xml
  30. 12 2
      mec-biz/src/main/resources/config/mybatis/StudentWithdrawMapper.xml
  31. 10 4
      mec-biz/src/main/resources/config/mybatis/SysUserCashAccountDetailMapper.xml
  32. 11 0
      mec-common/common-core/src/main/java/com/ym/mec/common/utils/DateUtils.java
  33. 19 0
      mec-education/pom.xml
  34. 22 0
      mec-education/src/main/java/com/ym/mec/education/config/MybatisPlusConfig.java
  35. 14 10
      mec-education/src/main/resources/application.yml
  36. 41 0
      mec-student/src/main/java/com/ym/mec/student/controller/WithdrawController.java
  37. 2 2
      mec-student/src/main/resources/application.yml

+ 10 - 0
mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/entity/SysRole.java

@@ -32,6 +32,8 @@ public class SysRole {
 	/** 删除标识(0-正常,1-删除) */
 	@ApiModelProperty(value = "删除标识(0-正常,1-删除)",required = false)
 	private String delFlag;
+	
+	private Integer organId;
 
 	public Integer getId() {
 		return id;
@@ -89,6 +91,14 @@ public class SysRole {
 		return this.delFlag;
 	}
 			
+	public Integer getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(Integer organId) {
+		this.organId = organId;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 43 - 6
mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/entity/SysUser.java

@@ -1,18 +1,25 @@
 package com.ym.mec.auth.api.entity;
 
-import com.ym.mec.auth.api.enums.SysUserType;
-import com.ym.mec.auth.api.enums.UserLockFlag;
-import com.ym.mec.auth.api.enums.YesOrNoEnum;
-import com.ym.mec.common.enums.UserGenderEnum;
 import io.swagger.annotations.ApiModelProperty;
-import org.apache.commons.lang3.builder.ToStringBuilder;
 
+import java.io.Serializable;
 import java.util.Date;
 
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.ym.mec.auth.api.enums.SysUserType;
+import com.ym.mec.auth.api.enums.UserLockFlag;
+import com.ym.mec.auth.api.enums.YesOrNoEnum;
+
 /**
  * 对应数据库表(sys_user):
  */
-public class SysUser {
+public class SysUser implements Serializable{
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -1374403507360017093L;
 
 	/** 主键ID */
 	private Integer id;
@@ -81,6 +88,12 @@ public class SysUser {
 
 	@ApiModelProperty(value = "融云token",required = false)
 	private String imToken;
+	
+	private String idCardNo;
+	
+	private String esignId;
+	
+	private String wechatId;
 
 	public String getImToken() {
 		return imToken;
@@ -234,6 +247,30 @@ public class SysUser {
 		this.email = email;
 	}
 
+	public String getIdCardNo() {
+		return idCardNo;
+	}
+
+	public void setIdCardNo(String idCardNo) {
+		this.idCardNo = idCardNo;
+	}
+
+	public String getEsignId() {
+		return esignId;
+	}
+
+	public void setEsignId(String esignId) {
+		this.esignId = esignId;
+	}
+
+	public String getWechatId() {
+		return wechatId;
+	}
+
+	public void setWechatId(String wechatId) {
+		this.wechatId = wechatId;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 6 - 2
mec-auth/mec-auth-server/src/main/resources/config/mybatis/SysRoleMapper.xml

@@ -14,6 +14,7 @@
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
         <result column="del_flag_" property="delFlag"/>
+        <result column="organ_id_" property="organId"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -34,8 +35,8 @@
         SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
         </selectKey>
         -->
-        INSERT INTO sys_role (id_,role_name_,role_code_,role_desc_,create_time_,update_time_)
-        VALUES(#{id},#{roleName},#{roleCode},#{roleDesc},now(),now())
+        INSERT INTO sys_role (id_,role_name_,role_code_,role_desc_,create_time_,update_time_,organ_id_)
+        VALUES(#{id},#{roleName},#{roleCode},#{roleDesc},now(),now(),organId)
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -57,6 +58,9 @@
             <if test="updateTime != null">
                 update_time_ = #{updateTime},
             </if>
+            <if test="organId != null">
+                organ_id_ = #{organId},
+            </if>
         </set>
         WHERE id_ = #{id}
     </update>

+ 14 - 2
mec-auth/mec-auth-server/src/main/resources/config/mybatis/SysUserMapper.xml

@@ -26,6 +26,9 @@
         <result column="birthdate_" property="birthdate"/>
         <result column="email_" property="email"/>
         <result column="im_token_" property="imToken"/>
+        <result column="id_card_no_" property="idCardNo"/>
+        <result column="esign_id_" property="esignId"/>
+        <result column="wechat_id_" property="wechatId"/>
     </resultMap>
 
     <!-- 查询条件 -->
@@ -63,9 +66,9 @@
         </selectKey>
         -->
         INSERT INTO sys_user
-        (im_token_,id_,username_,salt_,phone_,avatar_,organ_id_,create_time_,update_time_,wx_openid_,qq_openid_,user_type_,gender_,nation_,birthdate_,email_)
+        (im_token_,id_,username_,salt_,phone_,avatar_,organ_id_,create_time_,update_time_,wx_openid_,qq_openid_,user_type_,gender_,nation_,birthdate_,email_,id_card_no_,esign_id_,wechat_id_)
         VALUES(#{imToken},#{id},#{username},#{salt},#{phone},#{avatar},#{organId},now(),now(),#{wxOpenid},#{qqOpenid},#{userType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-        #{gender},#{nation},#{birthdate},#{email})
+        #{gender},#{nation},#{birthdate},#{email},#{idCardNo},#{esignId},#{wechatId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -120,6 +123,15 @@
             <if test="imToken != null">
                 im_token_ = #{imToken},
             </if>
+            <if test="idCardNo != null">
+                id_card_no_ = #{idCardNo},
+            </if>
+            <if test="esignId != null">
+                esign_id_ = #{esignId},
+            </if>
+            <if test="wechatId != null">
+                wechat_id_ = #{wechatId},
+            </if>
         </set>
         WHERE id_ = #{id}
     </update>

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/DemoGroupClassGroupMapperDao.java

@@ -0,0 +1,9 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.DemoGroupClassGroupMapper;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface DemoGroupClassGroupMapperDao extends BaseDAO<Long, DemoGroupClassGroupMapper> {
+
+	
+}

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/DemoGroupCoursesPlanDao.java

@@ -0,0 +1,9 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.DemoGroupCoursesPlan;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface DemoGroupCoursesPlanDao extends BaseDAO<Long, DemoGroupCoursesPlan> {
+
+	
+}

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/DemoGroupDao.java

@@ -0,0 +1,9 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.DemoGroup;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface DemoGroupDao extends BaseDAO<Long, DemoGroup> {
+
+	
+}

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentWithdrawDao.java

@@ -5,5 +5,5 @@ import com.ym.mec.common.dal.BaseDAO;
 
 public interface StudentWithdrawDao extends BaseDAO<String, StudentWithdraw> {
 
-	
-}
+    StudentWithdraw getByUserId(Long userId);
+}

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CashAccountDetail.java

@@ -1,10 +1,14 @@
 package com.ym.mec.biz.dal.dto;
 
 import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
 
 public class CashAccountDetail extends QueryInfo {
     private Integer userId;
 
+    @ApiModelProperty(value = "交易类型", required = true)
+    private String type;
+
     public Integer getUserId() {
         return userId;
     }
@@ -12,4 +16,12 @@ public class CashAccountDetail extends QueryInfo {
     public void setUserId(Integer userId) {
         this.userId = userId;
     }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
 }

+ 54 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/WithdrawDto.java

@@ -2,12 +2,31 @@ package com.ym.mec.biz.dal.dto;
 
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiModelProperty;
+import java.math.BigDecimal;
 
+/**
+ * @program: mec
+ * @description: 提现
+ * @author: xw
+ * @create: 2019-09-23 17:12
+ */
 public class WithdrawDto extends QueryInfo {
 
-    @ApiModelProperty(value = "最新课次",required = false)
+    @ApiModelProperty(value = "用户id",required = false)
     private Integer userId;
 
+    @ApiModelProperty(value = "银行卡号", required = true)
+    private String bankCardNo;
+
+    @ApiModelProperty(value = "提现金额", required = true)
+    private BigDecimal amount;
+
+    @ApiModelProperty(value = "交易类型", required = true)
+    private Integer TransType;
+
+    public WithdrawDto() {
+    }
+
     public Integer getUserId() {
         return userId;
     }
@@ -15,4 +34,38 @@ public class WithdrawDto extends QueryInfo {
     public void setUserId(Integer userId) {
         this.userId = userId;
     }
+
+    public String getBankCardNo() {
+        return bankCardNo;
+    }
+
+    public void setBankCardNo(String bankCardNo) {
+        this.bankCardNo = bankCardNo;
+    }
+
+    public BigDecimal getAmount() {
+        return amount;
+    }
+
+    public void setAmount(BigDecimal amount) {
+        this.amount = amount;
+    }
+
+    public Integer getTransType() {
+        return TransType;
+    }
+
+    public void setTransType(Integer transType) {
+        TransType = transType;
+    }
+
+    @Override
+    public String toString() {
+        return "WithdrawDto{" +
+                "userId=" + userId +
+                ", bankCardNo='" + bankCardNo + '\'' +
+                ", amount=" + amount +
+                ", TransType=" + TransType +
+                '}';
+    }
 }

+ 134 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/WithdrawInfoDto.java

@@ -0,0 +1,134 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @program: mec
+ * @description: 学员详情(提现)
+ * @author: xw
+ * @create: 2019-09-24 19:10
+ */
+public class WithdrawInfoDto implements Serializable {
+
+    @ApiModelProperty(value = "提现交易流水号",required = false)
+    private String withdrawId;
+    @ApiModelProperty(value = "申请时间",required = false)
+    private String dateTime;
+    @ApiModelProperty(value = "提现金额",required = false)
+    private BigDecimal amount;
+    @ApiModelProperty(value = "账户金额",required = false)
+    private BigDecimal balance;
+    @ApiModelProperty(value = "提现账户",required = false)
+    private String transTypeName;
+    @ApiModelProperty(value = "账户号",required = false)
+    private String accountNo;
+    @ApiModelProperty(value = "提现状态",required = false)
+    private String withdrawStatus;
+    @ApiModelProperty(value = "支付账号",required = false)
+    private String payAccountNo;
+    @ApiModelProperty(value = "支付渠道",required = false)
+    private String payChannel;
+    @ApiModelProperty(value = "交易流水号",required = false)
+    private String transactionalNo;
+
+    public WithdrawInfoDto() {
+    }
+
+    public String getWithdrawId() {
+        return withdrawId;
+    }
+
+    public void setWithdrawId(String withdrawId) {
+        this.withdrawId = withdrawId;
+    }
+
+    public String getDateTime() {
+        return dateTime;
+    }
+
+    public void setDateTime(String dateTime) {
+        this.dateTime = dateTime;
+    }
+
+    public BigDecimal getAmount() {
+        return amount;
+    }
+
+    public void setAmount(BigDecimal amount) {
+        this.amount = amount;
+    }
+
+    public BigDecimal getBalance() {
+        return balance;
+    }
+
+    public void setBalance(BigDecimal balance) {
+        this.balance = balance;
+    }
+
+    public String getTransTypeName() {
+        return transTypeName;
+    }
+
+    public void setTransTypeName(String transTypeName) {
+        this.transTypeName = transTypeName;
+    }
+
+    public String getAccountNo() {
+        return accountNo;
+    }
+
+    public void setAccountNo(String accountNo) {
+        this.accountNo = accountNo;
+    }
+
+    public String getWithdrawStatus() {
+        return withdrawStatus;
+    }
+
+    public void setWithdrawStatus(String withdrawStatus) {
+        this.withdrawStatus = withdrawStatus;
+    }
+
+    public String getPayAccountNo() {
+        return payAccountNo;
+    }
+
+    public void setPayAccountNo(String payAccountNo) {
+        this.payAccountNo = payAccountNo;
+    }
+
+    public String getPayChannel() {
+        return payChannel;
+    }
+
+    public void setPayChannel(String payChannel) {
+        this.payChannel = payChannel;
+    }
+
+    public String getTransactionalNo() {
+        return transactionalNo;
+    }
+
+    public void setTransactionalNo(String transactionalNo) {
+        this.transactionalNo = transactionalNo;
+    }
+
+    @Override
+    public String toString() {
+        return "WithdrawInfoDto{" +
+                "withdrawId='" + withdrawId + '\'' +
+                ", dateTime='" + dateTime + '\'' +
+                ", amount=" + amount +
+                ", balance=" + balance +
+                ", transTypeName='" + transTypeName + '\'' +
+                ", accountNo='" + accountNo + '\'' +
+                ", withdrawStatus='" + withdrawStatus + '\'' +
+                ", payAccountNo='" + payAccountNo + '\'' +
+                ", payChannel='" + payChannel + '\'' +
+                ", transactionalNo='" + transactionalNo + '\'' +
+                '}';
+    }
+}

+ 92 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/DemoGroup.java

@@ -0,0 +1,92 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(demo_group):
+ */
+public class DemoGroup {
+
+	/**  */
+	private Long id;
+	
+	/**  */
+	private String name;
+	
+	/** 单节课时 */
+	private Integer singleClassMinutes;
+	
+	/** 所属分部列表 */
+	private String organIdList;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	/** 老师编号 */
+	private Integer userId;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setName(String name){
+		this.name = name;
+	}
+	
+	public String getName(){
+		return this.name;
+	}
+			
+	public void setSingleClassMinutes(Integer singleClassMinutes){
+		this.singleClassMinutes = singleClassMinutes;
+	}
+	
+	public Integer getSingleClassMinutes(){
+		return this.singleClassMinutes;
+	}
+			
+	public void setOrganIdList(String organIdList){
+		this.organIdList = organIdList;
+	}
+	
+	public String getOrganIdList(){
+		return this.organIdList;
+	}
+			
+	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;
+	}
+			
+	public void setUserId(Integer userId){
+		this.userId = userId;
+	}
+	
+	public Integer getUserId(){
+		return this.userId;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 59 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/DemoGroupClassGroupMapper.java

@@ -0,0 +1,59 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(demo_group_class_group_mapper):
+ */
+public class DemoGroupClassGroupMapper {
+
+	/**  */
+	private Long id;
+	
+	/**  */
+	private Long demoGroupId;
+	
+	/**  */
+	private Integer classGroupId;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setDemoGroupId(Long demoGroupId){
+		this.demoGroupId = demoGroupId;
+	}
+	
+	public Long getDemoGroupId(){
+		return this.demoGroupId;
+	}
+			
+	public void setClassGroupId(Integer classGroupId){
+		this.classGroupId = classGroupId;
+	}
+	
+	public Integer getClassGroupId(){
+		return this.classGroupId;
+	}
+			
+	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);
+	}
+
+}

+ 59 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/DemoGroupCoursesPlan.java

@@ -0,0 +1,59 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(demo_group_courses_plan):
+ */
+public class DemoGroupCoursesPlan {
+
+	/**  */
+	private Long id;
+	
+	/**  */
+	private Long demoGroupId;
+	
+	/**  */
+	private java.util.Date coursesStartTime;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setDemoGroupId(Long demoGroupId){
+		this.demoGroupId = demoGroupId;
+	}
+	
+	public Long getDemoGroupId(){
+		return this.demoGroupId;
+	}
+			
+	public void setCoursesStartTime(java.util.Date coursesStartTime){
+		this.coursesStartTime = coursesStartTime;
+	}
+	
+	public java.util.Date getCoursesStartTime(){
+		return this.coursesStartTime;
+	}
+			
+	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);
+	}
+
+}

+ 37 - 24
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysUserCashAccountDetail.java

@@ -3,6 +3,7 @@ package com.ym.mec.biz.dal.entity;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.PlatformCashAccountDetailTypeEnum;
 
+import com.ym.mec.biz.dal.enums.TransTypeEnum;
 import io.swagger.annotations.ApiModelProperty;
 
 import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -17,65 +18,69 @@ public class SysUserCashAccountDetail {
 	/** 序号 */
 	@ApiModelProperty(value = "序号",required = false)
 	private Long id;
-	
+
 	/** 用户编号 */
 	@ApiModelProperty(value = "用户编号",required = false)
 	private Integer userId;
-	
+
 	/** 交易流水号 */
 	@ApiModelProperty(value = "交易流水号",required = false)
 	private String transNo;
-	
+
 	/** 交易类型 (RECHARGE 充值,WITHDRAW 提现,PAY_FEE 缴费,REFUNDS 退费,FILL_ACCOUNT 人工补账) */
 	@ApiModelProperty(value = "交易类型",required = false)
 	private PlatformCashAccountDetailTypeEnum type;
-	
+
+	/** 交易方式1.微信,2支付宝,3快捷*/
+	@ApiModelProperty(value = "交易方式",required = false)
+	private TransTypeEnum transType;
+
 	/** 交易状态(1,交易中;2,成功交易;-1,交易失败;) */
 	@ApiModelProperty(value = "交易状态",required = false)
 	private DealStatusEnum status;
-	
+
 	/** 交易金额 */
 	@ApiModelProperty(value = "交易金额",required = false)
 	private BigDecimal amount;
-	
+
 	/** 账户可用余额 */
 	@ApiModelProperty(value = "账户可用余额",required = false)
 	private BigDecimal balance;
-	
+
 	/** 描述 */
 	@ApiModelProperty(value = "描述",required = false)
 	private String description;
-	
+
 	/** 后台备注 */
 	@ApiModelProperty(value = "后台备注",required = false)
 	private String comment;
-	
+
 	/** 创建时间 */
 	private java.util.Date createTime;
-	
+
 	/** 修改时间 */
 	private java.util.Date updateTime;
-	
+
 	public void setId(Long id){
 		this.id = id;
 	}
-	
+
 	public Long getId(){
 		return this.id;
 	}
-			
+
 	public void setUserId(Integer userId){
 		this.userId = userId;
 	}
-	
+
 	public Integer getUserId(){
 		return this.userId;
 	}
-			
+
 	public void setTransNo(String transNo){
 		this.transNo = transNo;
 	}
-	
+
 	public String getTransNo(){
 		return this.transNo;
 	}
@@ -115,35 +120,43 @@ public class SysUserCashAccountDetail {
 	public void setDescription(String description){
 		this.description = description;
 	}
-	
+
 	public String getDescription(){
 		return this.description;
 	}
-			
+
 	public void setComment(String comment){
 		this.comment = comment;
 	}
-	
+
 	public String getComment(){
 		return this.comment;
 	}
-			
+
 	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;
 	}
-			
+
+	public TransTypeEnum getTransType() {
+		return transType;
+	}
+
+	public void setTransType(TransTypeEnum transType) {
+		this.transType = transType;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ClassGroupTypeEnum.java

@@ -6,7 +6,7 @@ import com.ym.mec.common.enums.BaseEnum;
  * 班级类型
  */
 public enum ClassGroupTypeEnum implements BaseEnum<String, ClassGroupTypeEnum> {
-	NORMAL("NORMAL", "普通班级"), MIX("MIX", "合奏班级"), HIGH("HIGH", "提高班"), VIP("VIP", "vip课"), TRIAL("trial", "试听课");
+	NORMAL("NORMAL", "普通班级"), MIX("MIX", "合奏班级"), HIGH("HIGH", "提高班"), VIP("VIP", "vip课"), DEMO("demo", "试听课");
 
 	private String code;
 

+ 4 - 2
mec-common/common-core/src/main/java/com/ym/mec/common/enums/TransTypeEnum.java → mec-biz/src/main/java/com/ym/mec/biz/dal/enums/TransTypeEnum.java

@@ -1,5 +1,6 @@
-package com.ym.mec.common.enums;
+package com.ym.mec.biz.dal.enums;
 
+import com.ym.mec.common.enums.BaseEnum;
 import java.util.Arrays;
 
 /**
@@ -8,7 +9,7 @@ import java.util.Arrays;
  * @author: xw
  * @create: 2019-09-24 16:00
  */
-public enum TransTypeEnum {
+public enum TransTypeEnum implements BaseEnum<Integer, TransTypeEnum> {
 
     WECHAT(1, "微信"),
     ALIPAY(2, "支付宝"),
@@ -23,6 +24,7 @@ public enum TransTypeEnum {
         this.description = description;
     }
 
+    @Override
     public Integer getCode() {
         return code;
     }

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/DemoGroupClassGroupMapperService.java

@@ -0,0 +1,8 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.DemoGroupClassGroupMapper;
+import com.ym.mec.common.service.BaseService;
+
+public interface DemoGroupClassGroupMapperService extends BaseService<Long, DemoGroupClassGroupMapper> {
+
+}

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/DemoGroupCoursesPlanService.java

@@ -0,0 +1,8 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.DemoGroupCoursesPlan;
+import com.ym.mec.common.service.BaseService;
+
+public interface DemoGroupCoursesPlanService extends BaseService<Long, DemoGroupCoursesPlan> {
+
+}

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/DemoGroupService.java

@@ -0,0 +1,8 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.DemoGroup;
+import com.ym.mec.common.service.BaseService;
+
+public interface DemoGroupService extends BaseService<Long, DemoGroup> {
+
+}

+ 19 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/StudentWithdrawService.java

@@ -1,8 +1,26 @@
 package com.ym.mec.biz.service;
 
+import com.ym.mec.biz.dal.dto.CashAccountDetail;
+import com.ym.mec.biz.dal.dto.WithdrawDto;
+import com.ym.mec.biz.dal.dto.WithdrawInfoDto;
 import com.ym.mec.biz.dal.entity.StudentWithdraw;
+import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 
 public interface StudentWithdrawService extends BaseService<String, StudentWithdraw> {
 
-}
+    /**
+     * 确认提现
+     * @param withdrawDto
+     * @return
+     */
+    boolean confirmWithdraw(WithdrawDto withdrawDto);
+
+    /**
+     * 根据学员id查询提现记录
+     * @param cashAccountDetail
+     * @return
+     */
+    PageInfo<WithdrawInfoDto> queryWithdrawPage(CashAccountDetail cashAccountDetail);
+
+}

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/DemoGroupClassGroupMapperServiceImpl.java

@@ -0,0 +1,23 @@
+package com.ym.mec.biz.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.biz.dal.dao.DemoGroupClassGroupMapperDao;
+import com.ym.mec.biz.dal.entity.DemoGroupClassGroupMapper;
+import com.ym.mec.biz.service.DemoGroupClassGroupMapperService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+
+@Service
+public class DemoGroupClassGroupMapperServiceImpl extends BaseServiceImpl<Long, DemoGroupClassGroupMapper>  implements DemoGroupClassGroupMapperService {
+	
+	@Autowired
+	private DemoGroupClassGroupMapperDao demoGroupClassGroupMapperDao;
+
+	@Override
+	public BaseDAO<Long, DemoGroupClassGroupMapper> getDAO() {
+		return demoGroupClassGroupMapperDao;
+	}
+	
+}

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/DemoGroupCoursesPlanServiceImpl.java

@@ -0,0 +1,23 @@
+package com.ym.mec.biz.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.biz.dal.dao.DemoGroupCoursesPlanDao;
+import com.ym.mec.biz.dal.entity.DemoGroupCoursesPlan;
+import com.ym.mec.biz.service.DemoGroupCoursesPlanService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+
+@Service
+public class DemoGroupCoursesPlanServiceImpl extends BaseServiceImpl<Long, DemoGroupCoursesPlan>  implements DemoGroupCoursesPlanService {
+	
+	@Autowired
+	private DemoGroupCoursesPlanDao demoGroupCoursesPlanDao;
+
+	@Override
+	public BaseDAO<Long, DemoGroupCoursesPlan> getDAO() {
+		return demoGroupCoursesPlanDao;
+	}
+	
+}

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/DemoGroupServiceImpl.java

@@ -0,0 +1,23 @@
+package com.ym.mec.biz.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.biz.dal.dao.DemoGroupDao;
+import com.ym.mec.biz.dal.entity.DemoGroup;
+import com.ym.mec.biz.service.DemoGroupService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+
+@Service
+public class DemoGroupServiceImpl extends BaseServiceImpl<Long, DemoGroup>  implements DemoGroupService {
+	
+	@Autowired
+	private DemoGroupDao demoGroupDao;
+
+	@Override
+	public BaseDAO<Long, DemoGroup> getDAO() {
+		return demoGroupDao;
+	}
+	
+}

+ 134 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentWithdrawServiceImpl.java

@@ -1,17 +1,41 @@
 package com.ym.mec.biz.service.impl;
 
+import com.google.common.collect.Lists;
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dto.CashAccountDetail;
+import com.ym.mec.biz.dal.dto.WithdrawDto;
+import com.ym.mec.biz.dal.dto.WithdrawInfoDto;
+import com.ym.mec.biz.dal.entity.SysUserCashAccount;
+import com.ym.mec.biz.dal.entity.SysUserCashAccountDetail;
+import com.ym.mec.biz.dal.enums.PlatformCashAccountDetailTypeEnum;
+import com.ym.mec.biz.service.SysUserCashAccountDetailService;
+import com.ym.mec.biz.service.SysUserCashAccountService;
+import com.ym.mec.biz.dal.enums.TransTypeEnum;
+import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.utils.DateUtils;
+import com.ym.mec.util.string.IdWorker;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
-
 import com.ym.mec.biz.dal.dao.StudentWithdrawDao;
 import com.ym.mec.biz.dal.entity.StudentWithdraw;
 import com.ym.mec.biz.service.StudentWithdrawService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.springframework.transaction.annotation.Transactional;
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
 
 @Service
 public class StudentWithdrawServiceImpl extends BaseServiceImpl<String, StudentWithdraw>  implements StudentWithdrawService {
-	
+
 	@Autowired
 	private StudentWithdrawDao studentWithdrawDao;
 
@@ -19,5 +43,111 @@ public class StudentWithdrawServiceImpl extends BaseServiceImpl<String, StudentW
 	public BaseDAO<String, StudentWithdraw> getDAO() {
 		return studentWithdrawDao;
 	}
-	
-}
+
+	private static final Logger log = LoggerFactory.getLogger(StudentWithdrawServiceImpl.class);
+
+//	@Qualifier("auth-server")
+//	@Autowired
+//	private SysUserFeignService sysUserFeignService;
+	@Autowired
+	private SysUserCashAccountService cashAccountService;
+	@Autowired
+	private SysUserCashAccountDetailService cashAccountDetailService;
+	@Autowired
+	private SysUserCashAccountDetailService accountDetailService;
+
+	private Lock lock = new ReentrantLock();
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public boolean confirmWithdraw(WithdrawDto withdrawDto) {
+		try {
+//			SysUser sysUser = sysUserFeignService.queryUserInfo();
+//			if (Objects.isNull(sysUser)) {
+//				throw new BizException("请重新登录");
+//			}
+			lock.lock();
+			SysUserCashAccount sysUserCashAccount = cashAccountService.get(withdrawDto.getUserId().intValue());
+			if (Objects.isNull(sysUserCashAccount)){
+				throw new BizException("账户不存在!");
+			}
+			//校验银行账户余额
+			if (sysUserCashAccount.getBalance().compareTo(withdrawDto.getAmount()) < 0) {
+				throw new BizException("余额不足,提现失败!");
+			}
+			//第三方提现到用户银行卡
+			//用户个人虚拟账户金额减少
+			updateCashAccount(sysUserCashAccount, withdrawDto);
+			//生成提现记录(缺少银行流水号,交易状态,用户承担的费用,平台承担的费用)
+			saveStudentWithdraw(withdrawDto);
+		} catch (Exception e) {
+			log.error("用户提现出现异常 {}", e.getMessage(), e);
+			throw new BizException(e.getMessage());
+		} finally {
+			lock.unlock();
+		}
+		return true;
+	}
+
+	@Override
+	public PageInfo<WithdrawInfoDto> queryWithdrawPage(CashAccountDetail cashAccountDetail) {
+		PageInfo<WithdrawInfoDto> result = new PageInfo<>();
+		cashAccountDetail.setType(PlatformCashAccountDetailTypeEnum.WITHDRAW.getCode());
+		PageInfo<SysUserCashAccountDetail> accountDetailPageInfo = accountDetailService.queryPage(cashAccountDetail);
+		List<WithdrawInfoDto> dataList = Lists.newArrayList();
+		accountDetailPageInfo.getRows().forEach(data ->{
+			WithdrawInfoDto withdrawInfoDto = new WithdrawInfoDto();
+			StudentWithdraw studentWithdraw = studentWithdrawDao.getByUserId(data.getUserId().longValue());
+			withdrawInfoDto.setWithdrawId(studentWithdraw.getId());
+			withdrawInfoDto.setDateTime(DateUtils.date2ChineseDate(studentWithdraw.getCreateTime()));
+			withdrawInfoDto.setAmount(data.getAmount());
+			withdrawInfoDto.setBalance(data.getBalance());
+			withdrawInfoDto.setTransTypeName(TransTypeEnum.getDescriptionByCode(data.getTransType().getCode()));
+			withdrawInfoDto.setAccountNo(studentWithdraw.getBankCardNo());
+			withdrawInfoDto.setWithdrawStatus(studentWithdraw.getStatus().getMsg());
+			//支付账号
+			dataList.add(withdrawInfoDto);
+		});
+		BeanUtils.copyProperties(accountDetailPageInfo, result);
+		result.setRows(dataList);
+		return result;
+	}
+
+	/**
+	 * 修改用户账户余额,保存账户明细
+	 *
+	 * @param withdrawDto
+	 */
+	private void updateCashAccount(SysUserCashAccount sysUserCashAccount, WithdrawDto withdrawDto) {
+		BigDecimal balance = sysUserCashAccount.getBalance().subtract(withdrawDto.getAmount());
+		SysUserCashAccount account = new SysUserCashAccount();
+		account.setUserId(sysUserCashAccount.getUserId());
+		account.setBalance(balance);
+		account.setUpdateTime(new Date());
+		cashAccountService.update(account);
+		SysUserCashAccountDetail cashAccountDetail = new SysUserCashAccountDetail();
+		cashAccountDetail.setUserId(withdrawDto.getUserId());
+		cashAccountDetail.setType(PlatformCashAccountDetailTypeEnum.WITHDRAW);
+		cashAccountDetail.setAmount(withdrawDto.getAmount());
+		cashAccountDetail.setBalance(balance);
+		cashAccountDetail.setCreateTime(new Date());
+		cashAccountDetailService.insert(cashAccountDetail);
+	}
+
+	/**
+	 * 保存提现记录
+	 *
+	 * @param withdrawDto
+	 */
+	private void saveStudentWithdraw(WithdrawDto withdrawDto) {
+		IdWorker idWorker = new IdWorker(0, 0);
+		StudentWithdraw studentWithdraw = new StudentWithdraw();
+		studentWithdraw.setId(idWorker.nextId());
+		studentWithdraw.setUserId(withdrawDto.getUserId().longValue());
+		studentWithdraw.setBankCardNo(withdrawDto.getBankCardNo());
+		studentWithdraw.setAmount(withdrawDto.getAmount());
+		studentWithdraw.setCreateTime(new Date());
+		insert(studentWithdraw);
+	}
+
+}

+ 68 - 0
mec-biz/src/main/resources/config/mybatis/DemoGroupClassGroupMapperMapper.xml

@@ -0,0 +1,68 @@
+<?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.biz.dal.dao.DemoGroupClassGroupMapperDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.DemoGroupClassGroupMapper" id="DemoGroupClassGroupMapper">
+		<result column="id_" property="id" />
+		<result column="demo_group_id_" property="demoGroupId" />
+		<result column="class_group_id_" property="classGroupId" />
+		<result column="create_time_" property="createTime" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="DemoGroupClassGroupMapper" >
+		SELECT * FROM demo_group_class_group_mapper WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="DemoGroupClassGroupMapper">
+		SELECT * FROM demo_group_class_group_mapper ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.DemoGroupClassGroupMapper" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		INSERT INTO demo_group_class_group_mapper (id_,demo_group_id_,class_group_id_,create_time_) VALUES(#{id},#{demoGroupId},#{classGroupId},#{createTime})
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.DemoGroupClassGroupMapper">
+		UPDATE demo_group_class_group_mapper <set>
+<if test="id != null">
+id_ = #{id},
+</if>
+<if test="classGroupId != null">
+class_group_id_ = #{classGroupId},
+</if>
+<if test="demoGroupId != null">
+demo_group_id_ = #{demoGroupId},
+</if>
+<if test="createTime != null">
+create_time_ = #{createTime},
+</if>
+</set> WHERE id_ = #{id} 
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM demo_group_class_group_mapper WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="DemoGroupClassGroupMapper" parameterType="map">
+		SELECT * FROM demo_group_class_group_mapper ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM demo_group_class_group_mapper
+	</select>
+</mapper>

+ 68 - 0
mec-biz/src/main/resources/config/mybatis/DemoGroupCoursesPlanMapper.xml

@@ -0,0 +1,68 @@
+<?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.biz.dal.dao.DemoGroupCoursesPlanDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.DemoGroupCoursesPlan" id="DemoGroupCoursesPlan">
+		<result column="id_" property="id" />
+		<result column="demo_group_id_" property="demoGroupId" />
+		<result column="courses_start_time_" property="coursesStartTime" />
+		<result column="create_time_" property="createTime" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="DemoGroupCoursesPlan" >
+		SELECT * FROM demo_group_courses_plan WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="DemoGroupCoursesPlan">
+		SELECT * FROM demo_group_courses_plan ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.DemoGroupCoursesPlan" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		INSERT INTO demo_group_courses_plan (id_,demo_group_id_,courses_start_time_,create_time_) VALUES(#{id},#{demoGroupId},#{coursesStartTime},#{createTime})
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.DemoGroupCoursesPlan">
+		UPDATE demo_group_courses_plan <set>
+<if test="id != null">
+id_ = #{id},
+</if>
+<if test="demoGroupId != null">
+demo_group_id_ = #{demoGroupId},
+</if>
+<if test="coursesStartTime != null">
+courses_start_time_ = #{coursesStartTime},
+</if>
+<if test="createTime != null">
+create_time_ = #{createTime},
+</if>
+</set> WHERE id_ = #{id} 
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM demo_group_courses_plan WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="DemoGroupCoursesPlan" parameterType="map">
+		SELECT * FROM demo_group_courses_plan ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM demo_group_courses_plan
+	</select>
+</mapper>

+ 80 - 0
mec-biz/src/main/resources/config/mybatis/DemoGroupMapper.xml

@@ -0,0 +1,80 @@
+<?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.biz.dal.dao.DemoGroupDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.DemoGroup" id="DemoGroup">
+		<result column="id_" property="id" />
+		<result column="name_" property="name" />
+		<result column="single_class_minutes_" property="singleClassMinutes" />
+		<result column="organ_id_list_" property="organIdList" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+		<result column="user_id_" property="userId" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="DemoGroup" >
+		SELECT * FROM demo_group WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="DemoGroup">
+		SELECT * FROM demo_group ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.DemoGroup" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		INSERT INTO demo_group (id_,name_,single_class_minutes_,organ_id_list_,create_time_,update_time_,user_id_) VALUES(#{id},#{name},#{singleClassMinutes},#{organIdList},#{createTime},#{updateTime},#{userId})
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.DemoGroup">
+		UPDATE demo_group <set>
+<if test="userId != null">
+user_id_ = #{userId},
+</if>
+<if test="id != null">
+id_ = #{id},
+</if>
+<if test="updateTime != null">
+update_time_ = #{updateTime},
+</if>
+<if test="singleClassMinutes != null">
+single_class_minutes_ = #{singleClassMinutes},
+</if>
+<if test="organIdList != null">
+organ_id_list_ = #{organIdList},
+</if>
+<if test="name != null">
+name_ = #{name},
+</if>
+<if test="createTime != null">
+create_time_ = #{createTime},
+</if>
+</set> WHERE id_ = #{id} 
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM demo_group WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="DemoGroup" parameterType="map">
+		SELECT * FROM demo_group ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM demo_group
+	</select>
+</mapper>

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/EmployeeMapper.xml

@@ -119,8 +119,8 @@
         <result property="username" column="username_" />
         <result property="gender" column="gender_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result property="phone" column="phone_" />
-        <result property="lockFlag" column="role_name_" />
-        <result property="roleName" column="lock_flag_" />
+        <result property="lockFlag" column="lock_flag_" />
+        <result property="roleName" column="role_name_" />
         <result property="jobNature" column="job_nature_" />
         <result property="entryDate" column="entry_date_" />
         <result property="demissionDate" column="demission_date_" />

+ 12 - 2
mec-biz/src/main/resources/config/mybatis/StudentWithdrawMapper.xml

@@ -23,7 +23,7 @@
 
     <!-- 根据主键查询一条记录 -->
     <select id="get" resultMap="StudentWithdraw">
-		SELECT * FROM student_withdraw WHERE id_ = #{id} 
+		SELECT * FROM student_withdraw WHERE id_ = #{id}
 	</select>
 
     <!-- 全查询 -->
@@ -84,7 +84,7 @@
 
     <!-- 根据主键删除一条记录 -->
     <delete id="delete">
-		DELETE FROM student_withdraw WHERE id_ = #{id} 
+		DELETE FROM student_withdraw WHERE id_ = #{id}
 	</delete>
 
     <!-- 分页查询 -->
@@ -108,4 +108,14 @@
             </if>
         </where>
 	</select>
+
+    <select id="getByUserId" resultMap="StudentWithdraw" parameterType="Long">
+        SELECT * FROM student_withdraw
+        <where>
+            <if test="userId != null">
+                user_id_ = #{userId}
+            </if>
+        </where>
+        LIMIT 1
+    </select>
 </mapper>

+ 10 - 4
mec-biz/src/main/resources/config/mybatis/SysUserCashAccountDetailMapper.xml

@@ -11,6 +11,7 @@
         <result column="user_id_" property="userId"/>
         <result column="trans_no_" property="transNo"/>
         <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="trans_type_" property="transType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="amount_" property="amount"/>
         <result column="balance_" property="balance"/>
@@ -22,7 +23,7 @@
 
     <!-- 根据主键查询一条记录 -->
     <select id="get" resultMap="SysUserCashAccountDetail">
-		SELECT * FROM sys_user_cash_account_detail WHERE id_ = #{id} 
+		SELECT * FROM sys_user_cash_account_detail WHERE id_ = #{id}
 	</select>
 
     <!-- 全查询 -->
@@ -39,8 +40,10 @@
         </selectKey>
         -->
         INSERT INTO sys_user_cash_account_detail
-        (id_,user_id_,trans_no_,type_,status_,amount_,balance_,description_,comment_,create_time_,update_time_)
-        VALUES(#{id},#{userId},#{transNo},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{amount},#{balance},#{description},#{comment},now(),now())
+        (id_,user_id_,trans_no_,type_,trans_type_, status_,amount_,balance_,description_,comment_,create_time_,update_time_)
+        VALUES(#{id},#{userId},#{transNo},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+        ,#{transType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+        #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{amount},#{balance},#{description},#{comment},now(),now())
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -74,13 +77,16 @@
             <if test="type != null">
                 type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
+            <if test="transType != null">
+                trans_type_ = #{transType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
         </set>
         WHERE id_ = #{id}
     </update>
 
     <!-- 根据主键删除一条记录 -->
     <delete id="delete">
-		DELETE FROM sys_user_cash_account_detail WHERE id_ = #{id} 
+		DELETE FROM sys_user_cash_account_detail WHERE id_ = #{id}
 	</delete>
 
     <!-- 分页查询 -->

+ 11 - 0
mec-common/common-core/src/main/java/com/ym/mec/common/utils/DateUtils.java

@@ -13,6 +13,8 @@ import java.util.List;
  */
 public class DateUtils {
 
+    private static final String CHINESE_DATA_FORMAT = "yyyy年MM月dd日 HH:mm:ss";
+
     /**
      * @Author: Joburgess
      * @Date: 2019/9/23
@@ -32,6 +34,15 @@ public class DateUtils {
         return dates;
     }
 
+    /**
+     * 时间转换为中文格式
+     * @param date
+     * @return
+     */
+    public static String date2ChineseDate(Date date){
+        return new SimpleDateFormat(CHINESE_DATA_FORMAT).format(date);
+    }
+
     public static void main(String[] args) throws ParseException {
         SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd");
         List<Date> mondayCount = getWeekDays(simpleDateFormat.parse("2019-9-23"), simpleDateFormat.parse("2019-10-23"), Calendar.SUNDAY);

+ 19 - 0
mec-education/pom.xml

@@ -50,6 +50,25 @@
 			<groupId>com.ym</groupId>
 			<artifactId>mec-biz</artifactId>
 		</dependency>
+
+		<dependency>
+			<groupId>com.baomidou</groupId>
+			<artifactId>mybatis-plus-boot-starter</artifactId>
+			<version>3.1.0</version>
+		</dependency>
+
+		<dependency>
+			<groupId>com.baomidou</groupId>
+			<artifactId>mybatis-plus-extension</artifactId>
+			<version>3.1.0</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.projectlombok</groupId>
+			<artifactId>lombok</artifactId>
+			<version>1.18.4</version>
+			<scope>provided</scope>
+		</dependency>
 	</dependencies>
 	<build>
 		<plugins>

+ 22 - 0
mec-education/src/main/java/com/ym/mec/education/config/MybatisPlusConfig.java

@@ -0,0 +1,22 @@
+package com.ym.mec.education.config;
+
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * program: mec
+ * description: mybatisplus分页插件
+ * @author xw
+ * create: 2019-09-25 13:26
+ */
+@Configuration
+public class MybatisPlusConfig {
+
+    @Bean
+    public PaginationInterceptor paginationInterceptor(){
+        PaginationInterceptor page = new PaginationInterceptor();
+        page.setDialectType("mysql");
+        return page;
+    }
+}

+ 14 - 10
mec-education/src/main/resources/application.yml

@@ -9,7 +9,7 @@ eureka:
 spring:
   application:
     name: education-server
-    
+
   datasource:
     name: test
     url: jdbc:mysql://47.99.212.176:3306/mec_dev?useUnicode=true&characterEncoding=UTF8&serverTimezone=Asia/Shanghai
@@ -31,11 +31,11 @@ spring:
     testOnReturn: false
     poolPreparedStatements: true
     maxOpenPreparedStatements: 20
-    
+
   redis:
     host: 47.99.212.176
     port: 6379
-    password: 
+    password:
     database: 0
     #连接超时时间(毫秒)
     timeout: 10000
@@ -50,12 +50,16 @@ spring:
       min-idle: 0
 
 mybatis:
-    mapperLocations: classpath:config/mybatis/*.xml
-    
+  mapperLocations: classpath:config/mybatis/*.xml
+mybatis-plus:
+  mapper-locations: classpath*:config/mybatis/*.xml
+  configuration:
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+
 swagger:
   base-package: com.ym.mec.education.controller
- 
-##认证 
+
+##认证
 security:
   oauth2:
     client:
@@ -63,7 +67,7 @@ security:
       client-secret: app
     resource:
       token-info-uri: http://localhost:8001/oauth/check_token
-  
+
 #spring boot admin 相关配置
 management:
   endpoints:
@@ -73,7 +77,7 @@ management:
   endpoint:
     health:
       show-details: ALWAYS
-  
+
 feign:
   hystrix:
-    enabled: true
+    enabled: true

+ 41 - 0
mec-student/src/main/java/com/ym/mec/student/controller/WithdrawController.java

@@ -0,0 +1,41 @@
+package com.ym.mec.student.controller;
+
+import com.ym.mec.biz.dal.dto.CashAccountDetail;
+import com.ym.mec.biz.dal.dto.WithdrawDto;
+import com.ym.mec.biz.service.StudentWithdrawService;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @program: mec
+ * @description: 提现
+ * @author: xw
+ * @create: 2019-09-23 17:12
+ */
+@RestController
+@RequestMapping("withdraw")
+@Api(tags = "提现服务")
+public class WithdrawController extends BaseController {
+
+    @Autowired
+    private StudentWithdrawService withdrawService;
+
+    @PostMapping("confirm")
+    @ApiOperation(value = "确认提现")
+    public Object confirmWithdraw(@RequestBody WithdrawDto withdrawDto) {
+        withdrawService.confirmWithdraw(withdrawDto);
+        return succeed();
+    }
+
+    @PostMapping("page")
+    @ApiOperation(value = "学员提现详情")
+    public Object getInfo(@RequestBody CashAccountDetail cashAccountDetail) {
+        return succeed(withdrawService.queryWithdrawPage(cashAccountDetail));
+    }
+}

+ 2 - 2
mec-student/src/main/resources/application.yml

@@ -59,8 +59,8 @@ swagger:
 security:
   oauth2:
     client:
-      client-id: app
-      client-secret: app
+      client-id: student
+      client-secret: student
     resource:
       token-info-uri: http://localhost:8001/oauth/check_token