周箭河 před 5 roky
rodič
revize
3ce3dd19b7

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

@@ -0,0 +1,7 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.SysPaymentConfig;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface SysPaymentConfigDao extends BaseDAO<Integer, SysPaymentConfig> {
+}

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

@@ -0,0 +1,163 @@
+package com.ym.mec.biz.dal.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Date;
+
+public class SysPaymentConfig {
+    /**
+     * id
+     */
+    @ApiModelProperty(value = "id")
+    private Integer id;
+
+    /**
+     * 分部id
+     */
+    @ApiModelProperty(value = "分部id")
+    private Integer organId;
+
+    /**
+     * 分部名称
+     */
+    @ApiModelProperty(value = "分部名称")
+    private String organName;
+
+    /**
+     * 私户收款占比
+     */
+    @ApiModelProperty(value = "私户收款占比")
+    private Integer perScale;
+
+    /**
+     * 公户收款占比
+     */
+    @ApiModelProperty(value = "公户收款占比")
+    private Integer comScale;
+
+    /**
+     * 课程费用收费去向
+     */
+    @ApiModelProperty(value = "课程费用收费去向")
+    private String courseFee;
+
+    /**
+     * 乐器费用去向
+     */
+    @ApiModelProperty(value = "乐器费用去向")
+    private String instrumentFee;
+
+    /**
+     * 辅件费用去向
+     */
+    @ApiModelProperty(value = "辅件费用去向")
+    private String accessoriesFee;
+
+    /**
+     * 其他费用
+     */
+    @ApiModelProperty(value = "其他费用")
+    private String otherFee;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
+    public Integer getPerScale() {
+        return perScale;
+    }
+
+    public void setPerScale(Integer perScale) {
+        this.perScale = perScale;
+    }
+
+    public Integer getComScale() {
+        return comScale;
+    }
+
+    public void setComScale(Integer comScale) {
+        this.comScale = comScale;
+    }
+
+    public String getCourseFee() {
+        return courseFee;
+    }
+
+    public void setCourseFee(String courseFee) {
+        this.courseFee = courseFee;
+    }
+
+    public String getInstrumentFee() {
+        return instrumentFee;
+    }
+
+    public void setInstrumentFee(String instrumentFee) {
+        this.instrumentFee = instrumentFee;
+    }
+
+    public String getAccessoriesFee() {
+        return accessoriesFee;
+    }
+
+    public void setAccessoriesFee(String accessoriesFee) {
+        this.accessoriesFee = accessoriesFee;
+    }
+
+    public String getOtherFee() {
+        return otherFee;
+    }
+
+    public void setOtherFee(String otherFee) {
+        this.otherFee = otherFee;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+}
+

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

@@ -0,0 +1,9 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.SysPaymentConfig;
+import com.ym.mec.common.service.BaseService;
+
+public interface SysPaymentConfigService extends BaseService<Integer, SysPaymentConfig> {
+
+
+}

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

@@ -0,0 +1,20 @@
+package com.ym.mec.biz.service.impl;
+
+import com.ym.mec.biz.dal.dao.SysPaymentConfigDao;
+import com.ym.mec.biz.dal.entity.SysPaymentConfig;
+import com.ym.mec.biz.service.SysPaymentConfigService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class SysPaymentConfigServiceImpl extends BaseServiceImpl<Integer, SysPaymentConfig> implements SysPaymentConfigService {
+    @Autowired
+    private SysPaymentConfigDao sysPaymentConfigDao;
+
+    @Override
+    public BaseDAO<Integer, SysPaymentConfig> getDAO() {
+        return sysPaymentConfigDao;
+    }
+}

+ 150 - 0
mec-biz/src/main/resources/config/mybatis/SysPaymentConfigMapper.xml

@@ -0,0 +1,150 @@
+<?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.SysPaymentConfigDao">
+    <resultMap id="SysPaymentConfig" type="com.ym.mec.biz.dal.entity.SysPaymentConfig">
+        <!--@Table sys_payment_config-->
+        <id column="id_" jdbcType="INTEGER" property="id"/>
+        <result column="organ_id_" jdbcType="INTEGER" property="organId"/>
+        <result column="organ_name" jdbcType="VARCHAR" property="organName"/>
+        <result column="per_scale_" jdbcType="INTEGER" property="perScale"/>
+        <result column="com_scale_" jdbcType="INTEGER" property="comScale"/>
+        <result column="course_fee_" jdbcType="VARCHAR" property="courseFee"/>
+        <result column="instrument_fee_" jdbcType="VARCHAR" property="instrumentFee"/>
+        <result column="accessories_fee_" jdbcType="VARCHAR" property="accessoriesFee"/>
+        <result column="other_fee_" jdbcType="VARCHAR" property="otherFee"/>
+        <result column="create_time_" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
+        id_, organ_id_, per_scale_, com_scale_, course_fee_, instrument_fee_, accessories_fee_,
+        other_fee_, create_time_, update_time_
+    </sql>
+    <select id="get" parameterType="java.lang.Integer" resultMap="SysPaymentConfig">
+        <!--@mbg.generated-->
+        select
+        <include refid="Base_Column_List"/>
+        from sys_payment_config
+        where id_ = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="delete" parameterType="java.lang.Integer">
+        delete from sys_payment_config
+        where id_ = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.SysPaymentConfig"
+            useGeneratedKeys="true">
+        <!--@mbg.generated-->
+        insert into sys_payment_config
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="organId != null">
+                organ_id_,
+            </if>
+            <if test="perScale != null">
+                per_scale_,
+            </if>
+            <if test="comScale != null">
+                com_scale_,
+            </if>
+            <if test="courseFee != null">
+                course_fee_,
+            </if>
+            <if test="instrumentFee != null">
+                instrument_fee_,
+            </if>
+            <if test="accessoriesFee != null">
+                accessories_fee_,
+            </if>
+            <if test="otherFee != null">
+                other_fee_,
+            </if>
+            <if test="createTime != null">
+                create_time_,
+            </if>
+            <if test="updateTime != null">
+                update_time_,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="organId != null">
+                #{organId,jdbcType=INTEGER},
+            </if>
+            <if test="perScale != null">
+                #{perScale,jdbcType=INTEGER},
+            </if>
+            <if test="comScale != null">
+                #{comScale,jdbcType=INTEGER},
+            </if>
+            <if test="courseFee != null">
+                #{courseFee,jdbcType=VARCHAR},
+            </if>
+            <if test="instrumentFee != null">
+                #{instrumentFee,jdbcType=VARCHAR},
+            </if>
+            <if test="accessoriesFee != null">
+                #{accessoriesFee,jdbcType=VARCHAR},
+            </if>
+            <if test="otherFee != null">
+                #{otherFee,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime != null">
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateTime != null">
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+        </trim>
+    </insert>
+    <update id="update" parameterType="com.ym.mec.biz.dal.entity.SysPaymentConfig">
+        <!--@mbg.generated-->
+        update sys_payment_config
+        <set>
+            <if test="organId != null">
+                organ_id_ = #{organId,jdbcType=INTEGER},
+            </if>
+            <if test="perScale != null">
+                per_scale_ = #{perScale,jdbcType=INTEGER},
+            </if>
+            <if test="comScale != null">
+                com_scale_ = #{comScale,jdbcType=INTEGER},
+            </if>
+            <if test="courseFee != null">
+                course_fee_ = #{courseFee,jdbcType=VARCHAR},
+            </if>
+            <if test="instrumentFee != null">
+                instrument_fee_ = #{instrumentFee,jdbcType=VARCHAR},
+            </if>
+            <if test="accessoriesFee != null">
+                accessories_fee_ = #{accessoriesFee,jdbcType=VARCHAR},
+            </if>
+            <if test="otherFee != null">
+                other_fee_ = #{otherFee,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime != null">
+                create_time_ = #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateTime != null">
+                update_time_ = #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+        </set>
+        where id_ = #{id,jdbcType=INTEGER}
+    </update>
+
+    <!-- 全查询 -->
+    <select id="findAll" resultMap="SysPaymentConfig">
+        SELECT *
+        FROM sys_payment_config
+        ORDER BY id_
+    </select>
+
+    <!-- 分页查询 -->
+    <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_
+        <include refid="global.limit"/>
+    </select>
+
+    <!-- 查询当前表的总记录数 -->
+    <select id="queryCount" resultType="int">
+        SELECT COUNT(*) FROM sys_payment_config
+        <include refid="global.limit"/>
+    </select>
+</mapper>

+ 63 - 0
mec-web/src/main/java/com/ym/mec/web/controller/SysPaymentConfigController.java

@@ -0,0 +1,63 @@
+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.page.QueryInfo;
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+
+@RequestMapping("paymentConfig")
+@Api(tags = "支付设置服务")
+@RestController
+public class SysPaymentConfigController extends BaseController {
+
+    @Autowired
+    private SysPaymentConfigService sysPaymentConfigService;
+
+    @ApiOperation(value = "新增支付配置")
+    @PostMapping("/add")
+    @PreAuthorize("@pcs.hasPermissions('paymentConfig/add')")
+    public Object add(SysPaymentConfig sysPaymentConfig){
+        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("参数错误");
+    	}
+        sysPaymentConfigService.delete(id);
+        return succeed();
+    }
+
+    @ApiOperation(value = "修改支付配置")
+    @PostMapping("/update")
+    @PreAuthorize("@pcs.hasPermissions('paymentConfig/update')")
+    public Object update(SysPaymentConfig sysPaymentConfig){
+        sysPaymentConfig.setUpdateTime(new Date());
+        sysPaymentConfigService.update(sysPaymentConfig);
+        return succeed();
+    }
+
+    @ApiOperation(value = "根据支付配置编号查询支付配置")
+    @GetMapping("/get/{id}")
+    @PreAuthorize("@pcs.hasPermissions('paymentConfig/get')")
+    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){
+        return succeed(sysPaymentConfigService.queryPage(queryInfo));
+    }
+}