浏览代码

1、 VIP课管理-查看-VIP课程财务优化
2、乐团列表支持合作单位搜索
3、人力资源表新增搜索条件

zouxuan 3 年之前
父节点
当前提交
e7aeb510cf

+ 2 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java

@@ -164,15 +164,13 @@ public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrde
     int countSurplusCourseByMusicGroupAndUser(@Param("musicGroupId") String musicGroupId, @Param("userId") Integer userId);
 
     /**
-     * @param musicGroupId: 乐团或小课金额
-     * @param groupType:
+     * @param vipGroupId: 乐团或小课金额
      * @return java.math.BigDecimal
      * @describe 统计乐团或vip课的收入金额
      * @author Joburgess
      * @date 2019/12/4
      */
-    BigDecimal sumGroupIncomeFee(@Param("musicGroupId") String musicGroupId,
-                                 @Param("groupType") String groupType);
+    BigDecimal sumGroupIncomeFee(@Param("vipGroupId") Long vipGroupId);
 
     List<StudentPaymentOrder> findStudentPaymentOrder(@Param("groupType") String groupType, @Param("musicGroupId") String musicGroupId);
 

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/EmployeeInfoQueryInfo.java

@@ -43,6 +43,17 @@ public class EmployeeInfoQueryInfo extends QueryInfo {
 	
 	private String hrbp;
 
+	@ApiModelProperty(value = "是否没有手机号和微信", required = false)
+	private Boolean notMobileAndWechat;
+
+	public Boolean getNotMobileAndWechat() {
+		return notMobileAndWechat;
+	}
+
+	public void setNotMobileAndWechat(Boolean notMobileAndWechat) {
+		this.notMobileAndWechat = notMobileAndWechat;
+	}
+
 	public String getUserNameOrIdOrMobile() {
 		return userNameOrIdOrMobile;
 	}

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/MusicGroupQueryInfo.java

@@ -29,6 +29,9 @@ public class MusicGroupQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "教务老师编号")
     private Integer educationalTeacherId;
 
+    @ApiModelProperty(value = "合作单位编号")
+    private Integer cooperationOrganId;
+
     private MusicGroupStatusEnum status;
 
     private Boolean noClassStudentMusicGroup;
@@ -47,6 +50,14 @@ public class MusicGroupQueryInfo extends QueryInfo {
     
     private Date billEndDate;
 
+    public Integer getCooperationOrganId() {
+        return cooperationOrganId;
+    }
+
+    public void setCooperationOrganId(Integer cooperationOrganId) {
+        this.cooperationOrganId = cooperationOrganId;
+    }
+
     public CourseViewTypeEnum getCourseViewType() {
         return courseViewType;
     }

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

@@ -3725,9 +3725,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			vipGroupSalaryBaseInfo.setTotalFeeDeduction(new BigDecimal(0));
 		}
 
-		BigDecimal totalCoursePrice= studentPaymentOrderDao.sumGroupIncomeFee(vipGroup.getId().toString(),GroupType.VIP.getCode());
+		BigDecimal totalCoursePrice = studentPaymentOrderDao.sumGroupIncomeFee(vipGroup.getId());
 		if(Objects.isNull(totalCoursePrice)){
-			totalCoursePrice=new BigDecimal(0);
+			totalCoursePrice = new BigDecimal(0);
 		}
 
 		//课程总价

+ 6 - 0
mec-biz/src/main/resources/config/mybatis/EmployeeInfoMapper.xml

@@ -159,6 +159,12 @@
 	
 	<sql id="queryPageMap">
 		<where>
+			<if test="notMobileAndWechat == 1">
+            	AND ei.mobile_no_ IS NULL AND ei.wechat_no_ IS NULL
+	        </if>
+			<if test="notMobileAndWechat == 0">
+				AND (ei.mobile_no_ IS NOT NULL OR ei.wechat_no_ IS NOT NULL)
+	        </if>
 			<if test="organId != null">
             	AND ei.organ_id_ = #{organId}
 	        </if>

+ 22 - 19
mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml

@@ -245,66 +245,69 @@
     </delete>
 
     <select id="queryPage" resultMap="MusicGroup" parameterType="map">
-        SELECT * FROM music_group
+        SELECT mg.* FROM music_group mg
+        LEFT JOIN cooperation_organ co ON mg.cooperation_organ_id_ = co.id_
         <include refid="musicGroupQueryPageSql"/>
-        ORDER BY create_time_ DESC,id_
+        ORDER BY mg.create_time_ DESC,mg.id_
         <include refid="global.limit"/>
     </select>
 
     <sql id="musicGroupQueryPageSql">
         <where>
-            del_flag_ = 0
+            mg.del_flag_ = 0
             <if test="organId != null">
-                AND FIND_IN_SET(organ_id_,#{organId})
+                AND FIND_IN_SET(mg.organ_id_,#{organId})
             </if>
             <if test="cooperationOrganId != null">
-                AND cooperation_organ_id_ = #{cooperationOrganId}
+                AND mg.cooperation_organ_id_ = #{cooperationOrganId}
             </if>
-            <if test="musicGroupName != null and musicGroupName != ''">
-                AND (name_ LIKE CONCAT('%',#{musicGroupName},'%') OR id_ LIKE CONCAT('%',#{musicGroupName},'%'))
+            <if test="search != null and search != ''">
+                AND (mg.name_ LIKE CONCAT('%',#{search},'%') OR mg.id_ LIKE CONCAT('%',#{search},'%')
+                 OR mg.cooperation_organ_id_ = #{search} OR co.name_ LIKE CONCAT('%',#{search},'%'))
             </if>
             <if test="chargeTypeId != null">
-                AND charge_type_id_ = #{chargeTypeId}
+                AND mg.charge_type_id_ = #{chargeTypeId}
             </if>
             <if test="musicGroupStatus != null">
-                AND FIND_IN_SET(status_,#{musicGroupStatus})
+                AND FIND_IN_SET(mg.status_,#{musicGroupStatus})
             </if>
             <if test="musicGroupId != null">
-                AND FIND_IN_SET(id_,#{musicGroupId})
+                AND FIND_IN_SET(mg.id_,#{musicGroupId})
             </if>
             <if test="transactionTeacherId!=null">
-                AND transaction_teacher_id_ = #{transactionTeacherId}
+                AND mg.transaction_teacher_id_ = #{transactionTeacherId}
             </if>
             <if test="educationalTeacherId!=null">
-                AND educational_teacher_id_ = #{educationalTeacherId}
+                AND mg.educational_teacher_id_ = #{educationalTeacherId}
             </if>
             <if test="courseViewType != null">
-                AND course_view_type_ = #{courseViewType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+                AND mg.course_view_type_ = #{courseViewType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
             <if test="musicGroupIds!=null and musicGroupIds.size()>0">
-                AND id_ IN
+                AND mg.id_ IN
                 <foreach collection="musicGroupIds" item="musicGroupId" open="(" close=")" separator=",">
                     #{musicGroupId}
                 </foreach>
             </if>
             <if test="createStartDate!=null">
-                AND date(create_time_) &gt;= #{createStartDate}
+                AND date(mg.create_time_) &gt;= #{createStartDate}
             </if>
             <if test="createEndDate!=null">
-                AND date(create_time_) &lt;= #{createEndDate}
+                AND date(mg.create_time_) &lt;= #{createEndDate}
             </if>
             <if test="billStartDate!=null">
-                AND date(bill_start_date_) &gt;= #{billStartDate}
+                AND date(mg.bill_start_date_) &gt;= #{billStartDate}
             </if>
             <if test="billEndDate!=null">
-                AND date(bill_start_date_) &lt;= #{billEndDate}
+                AND date(mg.bill_start_date_) &lt;= #{billEndDate}
             </if>
         </where>
     </sql>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
-        SELECT COUNT(*) FROM music_group
+        SELECT COUNT(mg.id_) FROM music_group mg
+        LEFT JOIN cooperation_organ co ON mg.cooperation_organ_id_ = co.id_
         <include refid="musicGroupQueryPageSql"/>
     </select>
 

+ 13 - 5
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml

@@ -554,11 +554,19 @@
           AND CONCAT(cs.class_date_, ' ', cs.start_class_time_) &gt; NOW()
     </select>
     <select id="sumGroupIncomeFee" resultType="java.math.BigDecimal">
-        SELECT SUM(expect_amount_)
-        FROM student_payment_order
-        WHERE group_type_ = #{groupType}
-          AND music_group_id_ = #{musicGroupId}
-          AND status_ = 'SUCCESS'
+        SELECT
+        (CASE WHEN a.a IS NULL THEN 0 ELSE a.a END) +
+        (CASE WHEN c.c IS NULL THEN 0 ELSE c.c END) +
+        (CASE WHEN d.d IS NULL THEN 0 ELSE d.d END) +
+        (CASE WHEN e.e IS NULL THEN 0 ELSE e.e END) -
+        (CASE WHEN b.b IS NULL THEN 0 ELSE b.b END) amount_
+        FROM
+        (SELECT SUM(CASE WHEN expect_amount_ IS NULL THEN 0 ELSE expect_amount_ END) a FROM student_payment_order
+         WHERE group_type_ = 'VIP' AND type_ = 'SMALL_CLASS_TO_BUY' AND music_group_id_ = #{vipGroupId} AND status_ = 'SUCCESS') a,
+        (SELECT SUM(CASE WHEN amount_ IS NULL THEN 0 ELSE amount_ END) b FROM sys_user_cash_account_log WHERE group_id_ = 1200) b,
+        (SELECT SUM(CASE WHEN actual_price_ IS NULL THEN 0 ELSE actual_price_ END) c FROM activity_user_mapper WHERE vip_group_id_ = 1200) c,
+        (SELECT SUM(CASE WHEN amount_ IS NULL THEN 0 ELSE amount_ END) d FROM sys_user_cash_account_detail WHERE group_id_ = 1200) d,
+        (SELECT SUM(CASE WHEN amount_ IS NULL THEN 0 ELSE amount_ END) e FROM sys_user_courses_account_detail WHERE group_id_ = 1200) e
     </select>
     <select id="findStudentPaymentOrder" resultMap="StudentPaymentOrder">
         SELECT *

+ 6 - 38
mec-biz/src/main/resources/config/mybatis/SysUserCashAccountLogMapper.xml

@@ -28,6 +28,7 @@
         <result column="channel_" property="channel"/>
         <result column="organ_name_" property="organName"/>
         <result column="platform_account_no_" property="platformAccountNo"/>
+        <result column="group_id_" property="groupId"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -46,45 +47,12 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysUserCashAccountLog" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
         INSERT INTO sys_user_cash_account_log
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="id!=null">id_,</if>
-            <if test="userId!=null">user_id_,</if>
-            <if test="transNo!=null">trans_no_,</if>
-            <if test="type!=null">type_,</if>
-            <if test="transType!=null">trans_type_,</if>
-            <if test="status!=null">status_,</if>
-            <if test="amount!=null">amount_,</if>
-            <if test="comAmount!=null">com_amount_,</if>
-            <if test="perAmount!=null">per_amount_,</if>
-            <if test="balance!=null">balance_,</if>
-            <if test="description!=null">description_,</if>
-            <if test="comment!=null">comment_,</if>
-            create_time_,
-            update_time_,
-            <if test="attribute!=null">attribute1_,</if>
-            <if test="channel!=null">channel_,</if>
-            <if test="platformAccountNo!=null">platform_account_no_,</if>
-        </trim>
+            (user_id_,trans_no_,type_,trans_type_,status_,amount_,com_amount_,
+             per_amount_,balance_,description_,comment_,attribute1_,channel_,platform_account_no_,create_time_,update_time_)
         VALUES
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="id!=null">#{id},</if>
-            <if test="userId!=null">#{userId},</if>
-            <if test="transNo!=null">#{transNo},</if>
-            <if test="type!=null">#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},</if>
-            <if test="transType!=null">#{transType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},</if>
-            <if test="status!=null">#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},</if>
-            <if test="amount!=null">#{amount},</if>
-            <if test="comAmount!=null">#{comAmount},</if>
-            <if test="perAmount!=null">#{perAmount},</if>
-            <if test="balance!=null">#{balance},</if>
-            <if test="description!=null">#{description},</if>
-            <if test="comment!=null">#{comment},</if>
-            NOW(),
-            NOW(),
-            <if test="attribute!=null">#{attribute},</if>
-            <if test="channel!=null">#{channel},</if>
-            <if test="platformAccountNo!=null">#{platformAccountNo},</if>
-        </trim>
+        (#{userId},#{transNo},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+         #{transType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            #{amount},#{comAmount},#{perAmount},#{balance},#{description},#{comment},#{attribute},#{channel},#{platformAccountNo},NOW(),NOW()
     </insert>
 
     <!-- 根据主键查询一条记录 -->