Forráskód Böngészése

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

zouxuan 5 éve
szülő
commit
bc2fdfb8f8

+ 26 - 0
data_migration/pom.xml

@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>com.ym</groupId>
+    <artifactId>mec</artifactId>
+    <version>1.0</version>
+  </parent>
+  <groupId>com.ym</groupId>
+  <artifactId>data_migration</artifactId>
+  <version>1.0</version>
+  <name>data_migration</name>
+  <url>http://maven.apache.org</url>
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>

+ 13 - 0
data_migration/src/main/java/com/ym/App.java

@@ -0,0 +1,13 @@
+package com.ym;
+
+/**
+ * Hello world!
+ *
+ */
+public class App 
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+    }
+}

+ 38 - 0
data_migration/src/test/java/com/ym/AppTest.java

@@ -0,0 +1,38 @@
+package com.ym;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest 
+    extends TestCase
+{
+    /**
+     * Create the test case
+     *
+     * @param testName name of the test case
+     */
+    public AppTest( String testName )
+    {
+        super( testName );
+    }
+
+    /**
+     * @return the suite of tests being tested
+     */
+    public static Test suite()
+    {
+        return new TestSuite( AppTest.class );
+    }
+
+    /**
+     * Rigourous Test :-)
+     */
+    public void testApp()
+    {
+        assertTrue( true );
+    }
+}

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -242,4 +242,11 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
      */
     List<Map<Integer, Integer>> queryVipGroupTeachereClassTimesByMonth(@Param("monthDate") Date monthDate,@Param("status") CourseStatusEnum status);
 
+    /**
+     * 查询已完成未更新状态的课程列表
+     * @return
+     */
+    List<CourseSchedule> queryFinishedWithNoUpdateStatus();
+    
+    int batchUpdate(List<CourseSchedule> courseScheduleList);
 }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentPaymentOrder.java

@@ -74,6 +74,8 @@ public class StudentPaymentOrder {
 	/**  */
 	@ApiModelProperty(value = "课程组编号",required = true)
 	private Integer classGroupId;
+
+	private Integer version;
 	
 	public void setId(Long id){
 		this.id = id;
@@ -203,6 +205,14 @@ public class StudentPaymentOrder {
 		this.status = status;
 	}
 
+	public Integer getVersion() {
+		return version;
+	}
+
+	public void setVersion(Integer version) {
+		this.version = version;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 6 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleService.java

@@ -162,4 +162,10 @@ public interface CourseScheduleService extends BaseService<Long, CourseSchedule>
      * @describe 课程投诉审核
      */
     void courseScheduleCommplaintAudit(CourseScheduleComplaints courseScheduleComplaints);
+    
+    /**
+     * 更新课程至结束状态
+     * @return
+     */
+    boolean updateCourseScheduleToOverStatus();
 }

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -14,6 +14,7 @@ import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
 import com.ym.mec.biz.dal.entity.SysConfig;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
+import com.ym.mec.biz.dal.enums.CourseStatusEnum;
 import com.ym.mec.biz.dal.enums.ParamEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo;
@@ -25,6 +26,7 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
+
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.time.DateUtils;
 import org.springframework.beans.BeanUtils;
@@ -508,4 +510,22 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		newCourseScheduleComplaints.setStatus(courseScheduleComplaints.getStatus());
 		courseScheduleComplaintsDao.update(newCourseScheduleComplaints);
 	}
+
+	@Override
+	public boolean updateCourseScheduleToOverStatus() {
+		List<CourseSchedule> list = courseScheduleDao.queryFinishedWithNoUpdateStatus();
+		
+		List<CourseSchedule> updateList = new ArrayList<CourseSchedule>();
+		Date date = new Date();
+		for(CourseSchedule courseSchedule : list){
+			courseSchedule.setStatus(CourseStatusEnum.OVER);
+			courseSchedule.setUpdateTime(date);
+			updateList.add(courseSchedule);
+		}
+		
+		if(updateList.size()>0){
+			
+		}
+		return true;
+	}
 }

+ 9 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PayServiceImpl.java

@@ -48,13 +48,15 @@ public class PayServiceImpl implements PayService {
         HashMap<String, Object> unionPay = new HashMap<>();
         String type = "YQPAY";
         Map payMap;
-        if (routingAccount != null) {
-            //易乾支付
-            payMap = YqPayUtil.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject, orderBody, routingAccount.getMerNo());
-        } else {
-            type = "UNIONPAY";
-            payMap = UnionPay.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject);
-        }
+//        if (routingAccount != null) {
+//            //易乾支付
+//            payMap = YqPayUtil.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject, orderBody, routingAccount.getMerNo());
+//        } else {
+//            type = "UNIONPAY";
+//            payMap = UnionPay.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject);
+//        }
+        type = "UNIONPAY";
+        payMap = UnionPay.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject);
         unionPay.put("orderNo", orderNo);
         unionPay.put("type", type);
         unionPay.put("payMap", payMap);

+ 47 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -686,4 +686,51 @@
     <select id="queryVipGroupTeachereClassTimesByMonth" resultType="map" parameterType="map">
         SELECT vp.organ_id_ organ_id_,cs.actual_teacher_id_ teacher_id_,count(cs.id_) times FROM course_schedule cs left join vip_group_class_group_mapper vgm on cs.class_group_id_ = vgm.class_group_id_ left join vip_group vp on vgm.vip_group_id_ = vp.id_ where cs.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} and date_format(#{monthDate} , '%Y%m' ) = date_format(cs.class_date_, '%Y%m' ) group by vp.organ_id_,cs.actual_teacher_id_
     </select>
+    
+    <select id="queryFinishedWithNoUpdateStatus" resultMap="CourseSchedule">
+    	select * from course_schedule where CONCAT(class_date_,' ',end_class_time_) &lt;= now() and status_ != 'OVER'
+    </select>
+    
+    <update id="batchUpdate" parameterType="com.ym.mec.biz.dal.entity.CourseSchedule">
+        UPDATE course_schedule
+        <set>
+            <if test="classDate != null">
+                class_date_ = #{classDate},
+            </if>
+            <if test="endClassTime != null">
+                end_class_time_ = #{endClassTime},
+            </if>
+            <if test="status != null">
+                status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="type != null">
+                type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="actualTeacherId != null">
+                actual_teacher_id_ = #{actualTeacherId},
+            </if>
+            <if test="subsidy != null">
+                subsidy_ = #{subsidy},
+            </if>
+            <if test="classGroupId != null">
+                class_group_id_ = #{classGroupId},
+            </if>
+            <if test="startClassTime != null">
+                start_class_time_ = #{startClassTime},
+            </if>
+            <if test="teacherId != null">
+                teacher_id_ = #{teacherId},
+            </if>
+            <if test="updateTime != null">
+                update_time_ = #{updateTime},
+            </if>
+            <if test="studentNum != null">
+                student_num_ = #{studentNum},
+            </if>
+            <if test="leaveStudentNum != null">
+                leave_student_num_ = #{leaveStudentNum},
+            </if>
+        </set>
+        WHERE id_ = #{id}
+    </update>
 </mapper>

+ 5 - 1
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml

@@ -23,6 +23,7 @@
         <result column="order_no_" property="orderNo"/>
         <result column="music_group_id_" property="musicGroupId"/>
         <result column="class_group_id_" property="classGroupId"/>
+        <result column="version_" property="version"/>
     </resultMap>
 
     <resultMap type="com.ym.mec.biz.dal.entity.Goods" id="Goods">
@@ -121,8 +122,11 @@
             <if test="musicGroupId != null">
                 music_group_id_ = #{musicGroupId},
             </if>
+            <if test="version != null">
+                version_ = version_+1,
+            </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} AND version_ = #{version}
     </update>
 
     <!-- 根据主键删除一条记录 -->

+ 2 - 2
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java

@@ -348,8 +348,8 @@ public class MusicGroupController extends BaseController {
 //
         IdWorker idWorker = new IdWorker(0, 0);
         String orderNo = "1017" + idWorker.nextId();
-        BigDecimal amount = new BigDecimal("200");
-        Map map = payService.getPayMap(amount, orderNo, "https://pay.dayaedu.com/notify", "https://baodiu.com", "测试订单", "测试订单");
+        BigDecimal amount = new BigDecimal("0.01");
+        Map map = payService.getPayMap(amount, orderNo, "http://47.99.212.176:8000/studentOrder/notify", "https://baodiu.com", "测试订单", "测试订单");
        return succeed(map);
     }
 

+ 126 - 0
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/union/NotifyMsg.java

@@ -0,0 +1,126 @@
+package com.ym.mec.thirdparty.union;
+
+import java.math.BigDecimal;
+
+/**
+ * 异步通知具体信息
+ */
+public class NotifyMsg {
+    private String mid;//商户号
+    private String tid;//终端号
+    private String instMid;//业务类型
+    private String billFunds;//资金渠道
+    private String billFundsDesc;//资金渠道说明
+    private Integer totalAmount;//订单总金额(分)
+    private String merOrderId;//商户订单号
+    private String payTime;//支付时间
+    private String seqId; //支付系统交易流水号
+    private String status; //交易状态,NEW_ORDER-新订单 UNKNOWN-不明交易状态 TRADE_CLOSED-关闭的交易 WAIT_BUYER_PAY-交易创建等待付款 TRADE_SUCCESS-交易成功
+    private String targetOrderId; //渠道订单号
+    private String targetSys;//支付渠道,WXPay,等
+    private String sign;//签名
+
+    public String getMid() {
+        return mid;
+    }
+
+    public void setMid(String mid) {
+        this.mid = mid;
+    }
+
+    public String getTid() {
+        return tid;
+    }
+
+    public void setTid(String tid) {
+        this.tid = tid;
+    }
+
+    public String getInstMid() {
+        return instMid;
+    }
+
+    public void setInstMid(String instMid) {
+        this.instMid = instMid;
+    }
+
+    public String getBillFunds() {
+        return billFunds;
+    }
+
+    public void setBillFunds(String billFunds) {
+        this.billFunds = billFunds;
+    }
+
+    public String getBillFundsDesc() {
+        return billFundsDesc;
+    }
+
+    public void setBillFundsDesc(String billFundsDesc) {
+        this.billFundsDesc = billFundsDesc;
+    }
+
+    public Integer getTotalAmount() {
+        return totalAmount;
+    }
+
+    public void setTotalAmount(Integer totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+
+    public String getMerOrderId() {
+        return merOrderId;
+    }
+
+    public void setMerOrderId(String merOrderId) {
+        this.merOrderId = merOrderId;
+    }
+
+    public String getPayTime() {
+        return payTime;
+    }
+
+    public void setPayTime(String payTime) {
+        this.payTime = payTime;
+    }
+
+    public String getSeqId() {
+        return seqId;
+    }
+
+    public void setSeqId(String seqId) {
+        this.seqId = seqId;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getTargetOrderId() {
+        return targetOrderId;
+    }
+
+    public void setTargetOrderId(String targetOrderId) {
+        this.targetOrderId = targetOrderId;
+    }
+
+    public String getTargetSys() {
+        return targetSys;
+    }
+
+    public void setTargetSys(String targetSys) {
+        this.targetSys = targetSys;
+    }
+
+    public String getSign() {
+        return sign;
+    }
+
+    public void setSign(String sign) {
+        this.sign = sign;
+    }
+}

+ 10 - 0
mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java

@@ -168,4 +168,14 @@ public class ClassGroupController extends BaseController {
         return succeed();
     }
 
+
+    @ApiOperation(value = "合并班级")
+    @PostMapping("/mergeClassGroup")
+    @ApiImplicitParams({@ApiImplicitParam(name = "classGroupIds", value = "班级编号,号分割", required = true, dataType = "String")})
+    public HttpResponseResult mergeClassGroup(String classGroupIds) throws Exception {
+        //软删除班级
+
+        return succeed();
+    }
+
 }

+ 5 - 4
pom.xml

@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 
 	<groupId>com.ym</groupId>
@@ -298,7 +297,8 @@
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-resources-plugin</artifactId>
-				<configuration><encoding>UTF-8</encoding>
+				<configuration>
+          <encoding>UTF-8</encoding>
 					<!-- 过滤后缀为pem、pfx的证书文件 -->
 					<nonFilteredFileExtensions>
 						<nonFilteredFileExtension>cer</nonFilteredFileExtension>
@@ -331,5 +331,6 @@
 		<module>mec-teacher</module>
 		<module>mec-education</module>
 		<module>mec-biz</module>
-	</modules>
+	  <module>data_migration</module>
+  </modules>
 </project>