Browse Source

分发清单导出,课程费用为0

周箭河 5 years ago
parent
commit
424d685ba7

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysPaymentConfig.java

@@ -44,6 +44,12 @@ public class SysPaymentConfig {
     private String routeScale;
     private String routeScale;
 
 
     /**
     /**
+     * 根据费用分配规则
+     */
+    @ApiModelProperty(value = "根据费用分配规则")
+    private String typeRouteScale;
+
+    /**
      * 分部id
      * 分部id
      */
      */
     @ApiModelProperty(value = "分部id")
     @ApiModelProperty(value = "分部id")
@@ -247,5 +253,13 @@ public class SysPaymentConfig {
     public void setAccountType(AccountType accountType) {
     public void setAccountType(AccountType accountType) {
         this.accountType = accountType;
         this.accountType = accountType;
     }
     }
+
+    public String getTypeRouteScale() {
+        return typeRouteScale;
+    }
+
+    public void setTypeRouteScale(String typeRouteScale) {
+        this.typeRouteScale = typeRouteScale;
+    }
 }
 }
 
 

+ 35 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/SysPaymentConfigQueryInfo.java

@@ -0,0 +1,35 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+public class SysPaymentConfigQueryInfo extends QueryInfo {
+
+    /**
+     * 分部id
+     */
+    @ApiModelProperty(value = "分部id", required = true)
+    private Integer organId;
+
+    /**
+     * 是否设置按费用类型分润
+     */
+    @ApiModelProperty(value = "是否设置按费用类型分润 1-是 0 -否", required = true)
+    private Integer hasTypeRoute;
+
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
+    public Integer getHasTypeRoute() {
+        return hasTypeRoute;
+    }
+
+    public void setHasTypeRoute(Integer hasTypeRoute) {
+        this.hasTypeRoute = hasTypeRoute;
+    }
+}

+ 31 - 3
mec-biz/src/main/resources/config/mybatis/SysPaymentConfigMapper.xml

@@ -5,12 +5,14 @@
         <!--@Table sys_payment_config-->
         <!--@Table sys_payment_config-->
         <id column="id_" jdbcType="INTEGER" property="id"/>
         <id column="id_" jdbcType="INTEGER" property="id"/>
         <result column="organ_id_" property="organId"/>
         <result column="organ_id_" property="organId"/>
-        <result column="account_type_" property="accountType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="account_type_" property="accountType"
+                typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="pay_type_" property="payType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="pay_type_" property="payType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="yq_mer_no_" property="yqMerNo"/>
         <result column="yq_mer_no_" property="yqMerNo"/>
         <result column="hf_mer_no_" property="hfMerNo"/>
         <result column="hf_mer_no_" property="hfMerNo"/>
         <result column="type_" property="type"/>
         <result column="type_" property="type"/>
         <result column="route_scale_" property="routeScale"/>
         <result column="route_scale_" property="routeScale"/>
+        <result column="type_route_scale_" property="typeRouteScale"/>
         <result column="organ_name" property="organName"/>
         <result column="organ_name" property="organName"/>
         <result column="per_scale_" property="perScale"/>
         <result column="per_scale_" property="perScale"/>
         <result column="com_scale_" property="comScale"/>
         <result column="com_scale_" property="comScale"/>
@@ -23,7 +25,8 @@
     </resultMap>
     </resultMap>
     <sql id="Base_Column_List">
     <sql id="Base_Column_List">
         <!--@mbg.generated-->
         <!--@mbg.generated-->
-        id_, organ_id_,account_type_,pay_type_,yq_mer_no_,hf_mer_no_,type_,route_scale_,create_time_, update_time_
+        id_, organ_id_,account_type_,pay_type_,yq_mer_no_,hf_mer_no_,type_,route_scale_,type_route_scale_,create_time_,
+        update_time_
     </sql>
     </sql>
     <select id="get" parameterType="java.lang.Integer" resultMap="SysPaymentConfig">
     <select id="get" parameterType="java.lang.Integer" resultMap="SysPaymentConfig">
         <!--@mbg.generated-->
         <!--@mbg.generated-->
@@ -60,6 +63,9 @@
             <if test="routeScale != null">
             <if test="routeScale != null">
                 route_scale_,
                 route_scale_,
             </if>
             </if>
+            <if test="typeRouteScale != null">
+                type_route_scale_,
+            </if>
             <if test="type != null">
             <if test="type != null">
                 type_,
                 type_,
             </if>
             </if>
@@ -89,6 +95,9 @@
             <if test="routeScale != null">
             <if test="routeScale != null">
                 #{routeScale},
                 #{routeScale},
             </if>
             </if>
+            <if test="typeRouteScale != null">
+                #{typeRouteScale},
+            </if>
             <if test="type != null">
             <if test="type != null">
                 #{type},
                 #{type},
             </if>
             </if>
@@ -122,6 +131,9 @@
             <if test="routeScale != null">
             <if test="routeScale != null">
                 route_scale_ = #{routeScale},
                 route_scale_ = #{routeScale},
             </if>
             </if>
+            <if test="typeRouteScale != null">
+                type_route_scale_ = #{typeRouteScale},
+            </if>
             <if test="type != null">
             <if test="type != null">
                 type_ = #{type},
                 type_ = #{type},
             </if>
             </if>
@@ -137,15 +149,31 @@
         ORDER BY id_
         ORDER BY id_
     </select>
     </select>
 
 
+    <sql id="queryCondition">
+        <where>
+            <if test="organId!=null">
+                AND spc.organ_id_=#{organId}
+            </if>
+            <if test='hasTypeRoute != null and hasTypeRoute.toString()=="1".toString()'>
+                AND spc.type_route_scale_ != ''
+            </if>
+            <if test='hasTypeRoute != null and hasTypeRoute.toString()=="0".toString()'>
+                AND spc.type_route_scale_ = ''
+            </if>
+        </where>
+    </sql>
+
     <!-- 分页查询 -->
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="SysPaymentConfig" parameterType="map">
     <select id="queryPage" resultMap="SysPaymentConfig" parameterType="map">
         SELECT spc.*,o.name_ organ_name FROM sys_payment_config spc LEFT JOIN organization o on spc.organ_id_ = o.id_
         SELECT spc.*,o.name_ organ_name FROM sys_payment_config spc LEFT JOIN organization o on spc.organ_id_ = o.id_
+        <include refid="queryCondition"/>
         <include refid="global.limit"/>
         <include refid="global.limit"/>
     </select>
     </select>
 
 
     <!-- 查询当前表的总记录数 -->
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
     <select id="queryCount" resultType="int">
-        SELECT COUNT(*) FROM sys_payment_config
+        SELECT COUNT(*) FROM sys_payment_config spc
+        <include refid="queryCondition"/>
         <include refid="global.limit"/>
         <include refid="global.limit"/>
     </select>
     </select>
 
 

+ 52 - 1
mec-web/src/main/java/com/ym/mec/web/controller/SysPaymentConfigController.java

@@ -2,11 +2,13 @@ package com.ym.mec.web.controller;
 
 
 import com.ym.mec.biz.dal.entity.SysPaymentConfig;
 import com.ym.mec.biz.dal.entity.SysPaymentConfig;
 import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
 import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
+import com.ym.mec.biz.dal.page.SysPaymentConfigQueryInfo;
 import com.ym.mec.biz.service.SysPaymentConfigService;
 import com.ym.mec.biz.service.SysPaymentConfigService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.*;
 import io.swagger.annotations.*;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
@@ -69,7 +71,7 @@ public class SysPaymentConfigController extends BaseController {
     @ApiOperation(value = "分页查询支付配置列表")
     @ApiOperation(value = "分页查询支付配置列表")
     @GetMapping("/queryPage")
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('paymentConfig/queryPage')")
     @PreAuthorize("@pcs.hasPermissions('paymentConfig/queryPage')")
-    public Object queryPage(QueryInfo queryInfo) {
+    public Object queryPage(SysPaymentConfigQueryInfo queryInfo) {
         return succeed(sysPaymentConfigService.queryPage(queryInfo));
         return succeed(sysPaymentConfigService.queryPage(queryInfo));
     }
     }
 
 
@@ -80,4 +82,53 @@ public class SysPaymentConfigController extends BaseController {
         return succeed(sysPaymentConfigService.getPaymentConfigs(payType));
         return succeed(sysPaymentConfigService.getPaymentConfigs(payType));
     }
     }
 
 
+
+    @ApiOperation(value = "新增按费用类型配置")
+    @PostMapping("/addTypeRoute")
+    @PreAuthorize("@pcs.hasPermissions('paymentConfig/addTypeRoute')")
+    public HttpResponseResult<SysPaymentConfig> addTypeRoute(SysPaymentConfig config) {
+        if (StringUtils.isBlank(config.getTypeRouteScale())) {
+            return failed("分润配置不能为空");
+        }
+        SysPaymentConfig paymentConfig = sysPaymentConfigService.get(config.getId());
+        if (paymentConfig != null && StringUtils.isNotBlank(paymentConfig.getTypeRouteScale())) {
+            return failed("此分部配置存在,请核查");
+        }
+        Date nowDate = new Date();
+        paymentConfig.setTypeRouteScale(config.getTypeRouteScale());
+        paymentConfig.setUpdateTime(nowDate);
+        sysPaymentConfigService.update(paymentConfig);
+        return succeed(paymentConfig);
+    }
+
+    @ApiOperation(value = "更新按费用类型配置")
+    @PostMapping("/updateTypeRoute")
+    @PreAuthorize("@pcs.hasPermissions('paymentConfig/updateTypeRoute')")
+    public HttpResponseResult<SysPaymentConfig> updateTypeRoute(SysPaymentConfig config) {
+        if (StringUtils.isBlank(config.getTypeRouteScale())) {
+            return failed("分润配置不能为空");
+        }
+        SysPaymentConfig paymentConfig = sysPaymentConfigService.get(config.getId());
+        Date nowDate = new Date();
+        paymentConfig.setTypeRouteScale(config.getTypeRouteScale());
+        paymentConfig.setUpdateTime(nowDate);
+        sysPaymentConfigService.update(paymentConfig);
+        return succeed(paymentConfig);
+    }
+
+    @ApiOperation(value = "删除按费用类型配置")
+    @PostMapping("/delTypeRoute")
+    @PreAuthorize("@pcs.hasPermissions('paymentConfig/delTypeRoute')")
+    public HttpResponseResult<SysPaymentConfig> delTypeRoute(Integer id) {
+        SysPaymentConfig paymentConfig = sysPaymentConfigService.get(id);
+        if (paymentConfig != null) {
+            return failed("此分部配置不存在");
+        }
+        Date nowDate = new Date();
+        paymentConfig.setTypeRouteScale("");
+        paymentConfig.setUpdateTime(nowDate);
+        sysPaymentConfigService.update(paymentConfig);
+        return succeed(paymentConfig);
+    }
+
 }
 }