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

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

zouxuan 5 éve
szülő
commit
4ee22d9fdb

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

@@ -2,6 +2,8 @@ package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.SysPaymentConfig;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
 
 public interface SysPaymentConfigDao extends BaseDAO<Integer, SysPaymentConfig> {
+    SysPaymentConfig findPaymentConfigByOrganId(@Param("organId") Integer organId);
 }

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/SysPaymentConfigService.java

@@ -5,5 +5,6 @@ import com.ym.mec.common.service.BaseService;
 
 public interface SysPaymentConfigService extends BaseService<Integer, SysPaymentConfig> {
 
+    SysPaymentConfig findPaymentConfigByOrganId(Integer organId);
 
 }

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysPaymentConfigServiceImpl.java

@@ -17,4 +17,9 @@ public class SysPaymentConfigServiceImpl extends BaseServiceImpl<Integer, SysPay
     public BaseDAO<Integer, SysPaymentConfig> getDAO() {
         return sysPaymentConfigDao;
     }
+
+    @Override
+    public SysPaymentConfig findPaymentConfigByOrganId(Integer organId) {
+        return sysPaymentConfigDao.findPaymentConfigByOrganId(organId);
+    }
 }

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -1146,7 +1146,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		try {
 			contractService.transferVipGroupCoursesContract(userId,vipGroupId);
 		} catch (Exception e) {
-			e.printStackTrace();
+			LOGGER.error("小课[{}]开课失败:",vipGroupId,e.getMessage());
 		}
 	}
 

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

@@ -136,9 +136,9 @@
     </update>
 
     <!-- 根据主键删除一条记录 -->
-    <delete id="delete">
-        UPDATE class_group SET del_flag_ = 1 WHERE id_ = #{id}
-    </delete>
+    <update id="delete">
+        UPDATE class_group SET del_flag_ = 1,update_time_=NOW() WHERE id_ = #{id}
+    </update>
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="ClassGroup" parameterType="map">
@@ -780,7 +780,7 @@
 
     <!-- 根据主键批量删除班级-->
     <update id="batchSoftDelete">
-        UPDATE class_group SET del_flag_ = 1 WHERE id_ IN
+        UPDATE class_group SET del_flag_ = 1,update_time_=NOW() WHERE id_ IN
         <foreach collection="classGroupIds" item="classGroupId" open="(" close=")" separator=",">
             #{classGroupId}
         </foreach>

+ 6 - 1
mec-biz/src/main/resources/config/mybatis/SysPaymentConfigMapper.xml

@@ -106,7 +106,7 @@
         update sys_payment_config
         <set>
             <if test="type != null">
-                type_ = #{organId,jdbcType=INTEGER},
+                type_ = #{type,jdbcType=INTEGER},
             </if>
             <if test="organId != null">
                 organ_id_ = #{organId,jdbcType=INTEGER},
@@ -157,4 +157,9 @@
         SELECT COUNT(*) FROM sys_payment_config
         <include refid="global.limit"/>
     </select>
+
+    <!-- 按分部编号查配置 -->
+    <select id="findPaymentConfigByOrganId" resultMap="SysPaymentConfig">
+        SELECT * FROM sys_payment_config WHERE organ_id_ = #{organId}
+    </select>
 </mapper>

+ 17 - 9
mec-web/src/main/java/com/ym/mec/web/controller/SysPaymentConfigController.java

@@ -3,6 +3,7 @@ package com.ym.mec.web.controller;
 import com.ym.mec.biz.dal.entity.SysPaymentConfig;
 import com.ym.mec.biz.service.SysPaymentConfigService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.*;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -22,18 +23,25 @@ public class SysPaymentConfigController extends BaseController {
     @ApiOperation(value = "新增支付配置")
     @PostMapping("/add")
     @PreAuthorize("@pcs.hasPermissions('paymentConfig/add')")
-    public Object add(SysPaymentConfig sysPaymentConfig){
+    public HttpResponseResult add(SysPaymentConfig sysPaymentConfig) {
+        if (sysPaymentConfig.getOrganId() == null) {
+            return failed("请选择分部");
+        }
+        SysPaymentConfig paymentConfig = sysPaymentConfigService.findPaymentConfigByOrganId(sysPaymentConfig.getOrganId());
+        if (paymentConfig != null) {
+            return failed("此分部配置已经存在");
+        }
         return succeed(sysPaymentConfigService.insert(sysPaymentConfig));
     }
 
     @ApiOperation(value = "删除支付配置")
     @PostMapping("/del/{id}")
     @PreAuthorize("@pcs.hasPermissions('paymentConfig/del')")
-    public Object del(@ApiParam(value = "支付配置编号", required = true) @PathVariable("id") Integer id){
-    	SysPaymentConfig sysPaymentConfig = sysPaymentConfigService.get(id);
-    	if(sysPaymentConfig == null){
-    		return failed("参数错误");
-    	}
+    public Object del(@ApiParam(value = "支付配置编号", required = true) @PathVariable("id") Integer id) {
+        SysPaymentConfig sysPaymentConfig = sysPaymentConfigService.get(id);
+        if (sysPaymentConfig == null) {
+            return failed("参数错误");
+        }
         sysPaymentConfigService.delete(id);
         return succeed();
     }
@@ -41,7 +49,7 @@ public class SysPaymentConfigController extends BaseController {
     @ApiOperation(value = "修改支付配置")
     @PostMapping("/update")
     @PreAuthorize("@pcs.hasPermissions('paymentConfig/update')")
-    public Object update(SysPaymentConfig sysPaymentConfig){
+    public Object update(SysPaymentConfig sysPaymentConfig) {
         sysPaymentConfig.setUpdateTime(new Date());
         sysPaymentConfigService.update(sysPaymentConfig);
         return succeed();
@@ -50,14 +58,14 @@ public class SysPaymentConfigController extends BaseController {
     @ApiOperation(value = "根据支付配置编号查询支付配置")
     @GetMapping("/get/{id}")
     @PreAuthorize("@pcs.hasPermissions('paymentConfig/get')")
-    public Object get(@ApiParam(value = "支付配置编号", required = true) @PathVariable("id") Integer id){
+    public Object get(@ApiParam(value = "支付配置编号", required = true) @PathVariable("id") Integer id) {
         return succeed(sysPaymentConfigService.get(id));
     }
 
     @ApiOperation(value = "分页查询支付配置列表")
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('paymentConfig/queryPage')")
-    public Object queryPage(QueryInfo queryInfo){
+    public Object queryPage(QueryInfo queryInfo) {
         return succeed(sysPaymentConfigService.queryPage(queryInfo));
     }
 }