Kaynağa Gözat

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

zouxuan 5 yıl önce
ebeveyn
işleme
c7fef9254f

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleTeacherSalaryDao.java

@@ -59,7 +59,7 @@ public interface CourseScheduleTeacherSalaryDao extends BaseDAO<Long, CourseSche
 	 * @params [days:天数]
 	 * @describe 获取多少天之前的未结算教师课酬记录(vip课)
 	 */
-	List<CourseScheduleTeacherSalary> findSomeDayAgoTeacherCourseSalaryNoSettlement(Integer days);
+	List<CourseScheduleTeacherSalary> findSomeDayAgoTeacherCourseSalaryNoSettlement(@Param("days") Integer days);
 
 	/**
 	 * 查询老师指定课程的课酬

+ 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> {
+
+
+}

+ 13 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -1114,7 +1114,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 holiday = jiaRiFeignService.query(now.getYear());
                 holidayDays = holiday.get(now.getYear());
             }
-            if (classGroup4MixDto.getHoliday() && holidayDays.containsKey(now.format(DateTimeFormatter.ofPattern("MM-dd")))) {
+            if (classGroup4MixDto.getHoliday() && holidayDays.containsKey(now.format(DateTimeFormatter.ofPattern("MMdd")))) {
                 now = now.plusDays(1);
                 continue;
             }
@@ -1277,6 +1277,15 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
         //1、更新班级关联老师信息
         List<ClassGroupTeacherMapper> newClassGroupTeacherMapperList = classGroup4MixDto.getClassGroupTeacherMapperList();
+        Integer teacherId = null;
+        for (ClassGroupTeacherMapper groupTeacherMapper : newClassGroupTeacherMapperList) {
+            groupTeacherMapper.setGroupType(classGroup.getGroupType());
+            groupTeacherMapper.setClassGroupId(classGroup.getId());
+            groupTeacherMapper.setMusicGroupId(classGroup4MixDto.getMusicGroupId());
+            if (groupTeacherMapper.getTeacherRole().equals(TeachTypeEnum.BISHOP)) {
+                teacherId = groupTeacherMapper.getUserId();
+            }
+        }
 
         Set<String> newTeacher = newClassGroupTeacherMapperList.stream().map(
                 classGroupTeacherMapper -> classGroupTeacherMapper.getTeacherRole().getCode() + classGroupTeacherMapper.getUserId()
@@ -1292,13 +1301,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             classGroupTeacherMapperService.classGroupTeachersInsert(newClassGroupTeacherMapperList);
         }
 
-        Integer teacherId = null;
-        for (ClassGroupTeacherMapper groupTeacherMapper : newClassGroupTeacherMapperList) {
-            if (groupTeacherMapper.getTeacherRole().equals(TeachTypeEnum.BISHOP)) {
-                teacherId = groupTeacherMapper.getUserId();
-                break;
-            }
-        }
+
 
         //2、获取班级学生
         List<StudentRegistration> studentList = classGroupStudentMapperDao.findClassStudentList(classGroup.getId(), ClassGroupStudentStatusEnum.NORMAL);
@@ -1326,7 +1329,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 holiday = jiaRiFeignService.query(now.getYear());
                 holidayDays = holiday.get(now.getYear());
             }
-            if (classGroup4MixDto.getHoliday() && holidayDays.containsKey(now.format(DateTimeFormatter.ofPattern("MM-dd")))) {
+            if (classGroup4MixDto.getHoliday() && holidayDays.containsKey(now.format(DateTimeFormatter.ofPattern("MMdd")))) {
                 now = now.plusDays(1);
                 continue;
             }
@@ -1558,7 +1561,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 holiday = jiaRiFeignService.query(now.getYear());
                 holidayDays = holiday.get(now.getYear());
             }
-            if (classGroup4MixDto.getHoliday() && holidayDays.containsKey(now.format(DateTimeFormatter.ofPattern("MM-dd")))) {
+            if (classGroup4MixDto.getHoliday() && holidayDays.containsKey(now.format(DateTimeFormatter.ofPattern("MMdd")))) {
                 now = now.plusDays(1);
                 continue;
             }

+ 5 - 9
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java

@@ -199,11 +199,6 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
 
         //处理课酬信息
         someDayAgoTeacherCourseSalaryNoSettlement.forEach(courseScheduleTeacherSalary -> {
-            TeacherAttendance teacherAttendanceInfo = teacherAttendanceDao.findByTeacherAttendanceInfo(courseScheduleTeacherSalary.getUserId().longValue(), courseScheduleTeacherSalary.getCourseScheduleId());
-            if(Objects.isNull(teacherAttendanceInfo)
-                    ||(Objects.isNull(teacherAttendanceInfo.getSignInTime())&&Objects.isNull(teacherAttendanceInfo.getSignOutTime()))){
-                return;
-            }
             //获取当前课程学生缴费记录
             List<CourseScheduleStudentPayment> studentPaymentsWithCourse = studentPaymentGroupByCourse.get(courseScheduleTeacherSalary.getCourseScheduleId());
 
@@ -300,13 +295,14 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                     }
                     studentLiabilityRatio = new BigDecimal(temp).divide(percent,CommonConstants.DECIMAL_PLACE,BigDecimal.ROUND_DOWN);
                 } else {
-                    studentLiabilityRatio = new BigDecimal(0);
+                    studentLiabilityRatio = new BigDecimal(1);
                 }
 
-                //当前课程学生应退费用
-                BigDecimal returnPrice = studentExpectPrice.multiply(studentLiabilityRatio);
+
                 //当前课程学生实际缴费
-                BigDecimal actualPrice = studentExpectPrice.subtract(returnPrice);
+                BigDecimal actualPrice = studentExpectPrice.multiply(studentLiabilityRatio);
+                //当前课程学生应退费用
+                BigDecimal returnPrice = studentExpectPrice.subtract(actualPrice);
                 //更新学生结算信息
                 studentPayment.setActualPrice(actualPrice);
                 studentPayment.setSettlementTime(now);

+ 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;
+    }
+}

+ 1 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleComplaintsMapper.xml

@@ -104,5 +104,6 @@
 		<foreach collection="ids" item="id" open="(" close=")" separator=",">
 			#{id}
 		</foreach>
+		AND status_!='REJECT'
 	</select>
 </mapper>

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

@@ -211,8 +211,10 @@
 		FROM
 		course_schedule_teacher_salary csts
 		LEFT JOIN course_schedule cs ON cs.id_ = csts.course_schedule_id_
-		WHERE
-		cs.class_date_ &lt;= DATE_FORMAT(DATE_ADD( NOW( ), INTERVAL - 1 DAY ),'%Y-%m-%d')
+		WHERE 1=1
+		<if test="days!=null">
+			AND cs.class_date_ = DATE_FORMAT(DATE_ADD( NOW( ), INTERVAL - #{days} DAY ),'%Y-%m-%d')
+		</if>
 		AND cs.type_='VIP'
 		AND csts.settlement_time_ IS NULL
 		AND (cs.del_flag_ IS NULL OR cs.del_flag_=0)

+ 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));
+    }
+}