Procházet zdrojové kódy

Merge branch 'master' of http://git.dayaedu.com/yonge/edu-saas

zouxuan před 5 roky
rodič
revize
0daea54b65

+ 6 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamOrderController.java

@@ -189,5 +189,11 @@ public class ExamOrderController extends BaseController {
         return msg;
     }
 
+    @ApiOperation(value = "/关闭订单")
+    @PostMapping("/closeOrder")
+    public HttpResponseResult closeOrder(String orderNo){
+        return succeed(examRegistrationPaymentService.closeOrder(orderNo));
+    }
+
 
 }

+ 8 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamRegistrationPaymentService.java

@@ -60,4 +60,12 @@ public interface ExamRegistrationPaymentService extends BaseService<Long, ExamRe
      */
     void queryPaymentStatus() throws Exception;
 
+
+    /**
+     * 关闭支付中订单
+     * @param orderNo 订单编号
+     * @return
+     */
+    Boolean closeOrder(String orderNo);
+
 }

+ 15 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRegistrationPaymentServiceImpl.java

@@ -147,6 +147,21 @@ public class ExamRegistrationPaymentServiceImpl extends BaseServiceImpl<Long, Ex
         adaPayQuery();
     }
 
+    @Override
+    public Boolean closeOrder(String orderNo) {
+        ExamRegistrationPayment order = examRegistrationPaymentDao.getByOrderNo(orderNo);
+        if (!order.getTransStatus().equals(TransStatusEnum.ING)) {
+            throw new BizException("订单不是待支付状态,请重新报名");
+        }
+        Date nowDate = new Date();
+        order.setTransStatus(TransStatusEnum.CLOSE);
+        order.setUpdateTime(nowDate);
+        if (examRegistrationPaymentDao.update(order) <= 0) {
+            throw new BizException("订单关闭失败,请重试");
+        }
+        return true;
+    }
+
 
     private void yqPayQuery() throws Exception {
         List<ExamRegistrationPayment> orders = examRegistrationPaymentDao.getOrdersByStatus("ING", "YQPAY");

+ 1 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRegistrationServiceImpl.java

@@ -293,7 +293,6 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
         }
         Date nowDate = new Date();
         order.setTransStatus(TransStatusEnum.CLOSE);
-        order.setCreateTime(nowDate);
         order.setUpdateTime(nowDate);
         examRegistrationPaymentService.update(order);
 
@@ -301,6 +300,7 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
 
         order.setId(null);
         order.setTransNo(null);
+        order.setCreateTime(nowDate);
         order.setTransStatus(TransStatusEnum.ING);
         order.setOrderNo(orderNo);
         examRegistrationPaymentService.insert(order);

+ 36 - 17
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationMapper.xml

@@ -69,35 +69,47 @@
 			<if test="examinationBasicId != null">
 				examination_basic_id_ = #{examinationBasicId},
 			</if>
+			<if test="studentId != null != null">
+				student_id_ = #{studentId},
+			</if>
+			<if test="organId != null">
+				organ_id_ = #{organId},
+			</if>
 			<if test="subjectId != null">
 				subject_id_ = #{subjectId},
 			</if>
-			<if test="adviserPhone != null">
-				adviser_phone_ = #{adviserPhone},
+			<if test="level != null">
+				level_ = #{level},
+			</if>
+			<if test="levelFee != null">
+				level_fee_ = #{levelFee},
+			</if>
+			<if test="songJson != null">
+				song_json_ = #{songJson},
 			</if>
 			<if test="lastExamLevel != null">
 				last_exam_level_ = #{lastExamLevel},
 			</if>
-			<if test="tenantId != null and tenantId != 0">
-				tenant_id_ = #{tenantId},
+			<if test="lastExamCertificateUrl != null">
+				last_exam_certificate_url_ = #{lastExamCertificateUrl},
 			</if>
-			<if test="level != null">
-				level_ = #{level},
+			<if test="examMusicTheoryLevel!= null">
+				exam_music_theory_level_ = #{examMusicTheoryLevel},
 			</if>
-			<if test="organId != null">
-				organ_id_ = #{organId},
+			<if test="theoryLevelFee!= null">
+				theory_level_fee_ = #{theoryLevelFee},
 			</if>
-			<if test="songJson != null">
-				song_json_ = #{songJson},
+			<if test="lastMusicTheoryLevel != null">
+				last_music_theory_level_ = #{lastMusicTheoryLevel},
+			</if>
+			<if test="lastMusicTheoryCertificateUrl != null">
+				last_music_theory_certificate_url_ = #{lastMusicTheoryCertificateUrl},
 			</if>
 			<if test="adviserName != null">
 				adviser_name_ = #{adviserName},
 			</if>
-			<if test="studentId != null">
-				student_id_ = #{studentId},
-			</if>
-			<if test="lastExamCertificateUrl != null">
-				last_exam_certificate_url_ = #{lastExamCertificateUrl},
+			<if test="adviserPhone != null">
+				adviser_phone_ = #{adviserPhone},
 			</if>
 			<if test="cardNo!=null">
 				card_no_ =#{cardNo},
@@ -105,11 +117,18 @@
 			<if test="status!=null">
 				status_ = #{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
 			</if>
+			<if test="tenantId != null">
+				tenant_id_ = #{tenantId},
+			</if>
+			<if test="createTime != null">
+				create_time_ = #{createTime},
+			</if>
 			<if test="memo!=null">
 				memo_ = #{memo},
 			</if>
-				update_time_ = NOW()
-		</set> WHERE id_ = #{id}
+			update_time_ = NOW()
+		</set>
+		WHERE id_ = #{id}
 	</update>
 
 	<!-- 根据主键删除一条记录 -->