瀏覽代碼

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

yonge 4 年之前
父節點
當前提交
48bafc9ede

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentAttendanceDao.java

@@ -8,6 +8,7 @@ import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Delete;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
 
 import java.util.Date;
 import java.util.List;
@@ -138,6 +139,19 @@ public interface StudentAttendanceDao extends BaseDAO<Long, StudentAttendance> {
     int countByCourseSchedule(Long courseScheduleId);
 
     /**
+     * @describe 统计已发送到课提醒的人数
+     * @author Joburgess
+     * @date 2021/3/31 0031
+     * @param courseId:
+     * @return int
+     */
+    @Select("SELECT COUNT(*) FROM student_attendance WHERE course_schedule_id_=#{courseId} AND normal_remind_=1")
+    int countNormalRemindNum(Long courseId);
+
+    @Update("UPDATE student_attendance SET normal_remind_=1 WHERE course_schedule_id_=#{courseId}")
+    int updateNormalRemind(@Param("courseId") Long courseId);
+
+    /**
      * @describe 统计每节课上的学生数,排除学员自己请假的记录
      * @author Joburgess
      * @date 2019/12/26

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherAttendanceDto.java

@@ -95,6 +95,9 @@ public class TeacherAttendanceDto {
     @ApiModelProperty(value = "能否布置作业")
     private int enableAssignHomework;
 
+    @ApiModelProperty(value = "是否已经发送过到课提醒:0否,1已发送")
+    private int normalRemind;
+
     private Integer enableStudentAttendanceTimeRange;
 
     private Integer enableStudentAttendanceTimeRangeVip;
@@ -331,4 +334,12 @@ public class TeacherAttendanceDto {
     public void setMusicGroupName(String musicGroupName) {
         this.musicGroupName = musicGroupName;
     }
+
+    public int getNormalRemind() {
+        return normalRemind;
+    }
+
+    public void setNormalRemind(int normalRemind) {
+        this.normalRemind = normalRemind;
+    }
 }

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -276,6 +276,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             currentCourseDetail.setStudentAttendanceIsFirstTime(1);
         }
 
+        int normalRemindNum = studentAttendanceDao.countNormalRemindNum(courseID);
+        currentCourseDetail.setNormalRemind(normalRemindNum<=0?0:1);
+
         currentCourseDetail.setCurrentTime(new Date());
         currentCourseDetail.setAdvanceSignInMinutes(Integer.parseInt(sysConfigDao.findConfigValue(SysConfigService.ADVANCE_SIGN_IN_MINUTES)));
 		currentCourseDetail.setAttendanceRange(CourseScheduleType.VIP.equals(currentCourseDetail.getCourseType())?Integer.parseInt(sysConfigDao.findConfigValue(SysConfigService.ATTENDANCE_RANGE_VIP)):Integer.parseInt(sysConfigDao.findConfigValue(SysConfigService.ATTENDANCE_RANGE)));

+ 5 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

@@ -918,22 +918,24 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
             BigDecimal multiply2 = goodsSellDto.getGoodsPrice().multiply(new BigDecimal(sellOrder.getNum()));
             //获取比例
             BigDecimal ratioAmount = multiply2.divide(totalAmount, 6, BigDecimal.ROUND_HALF_UP);
+            //实际支付价格
+            BigDecimal actualAmount = goodsSellDto.getGoodsPrice();
             //如果有减免金额
             if (marketAmount.doubleValue() > 0l) {
                 //如果是最后一件商品
                 if (i == sellOrderList.size() - 1) {
-                    goodsSellDto.setTotalGoodsPrice(multiply2.subtract(usableMarketAmount));
+                    actualAmount = multiply2.subtract(usableMarketAmount);
                 } else {
                     //获取分配的减免金额
                     BigDecimal multiply = ratioAmount.multiply(marketAmount).setScale(2, BigDecimal.ROUND_HALF_UP);
-                    goodsSellDto.setTotalGoodsPrice(multiply2.subtract(multiply));
+                    actualAmount = multiply2.subtract(multiply);
                     usableMarketAmount = usableMarketAmount.subtract(multiply);
                 }
             }
 
             //如果没有使用余额,那么实际金额和预计金额一致
             if (balancePaymentAmount.doubleValue() == 0l) {
-                sellOrder.setActualAmount(goodsSellDto.getTotalGoodsPrice());
+                sellOrder.setActualAmount(actualAmount);
                 sellOrder.setBalanceAmount(BigDecimal.ZERO);
             } else {
                 //如果是最后一件商品

+ 9 - 9
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -1385,12 +1385,12 @@
                 AND CONCAT( cs.class_date_, ' ', cs.end_class_time_ )&lt;now()
             </if>
             <if test="status!=null">
-                AND cs.status_ = #{status}
+                AND cs.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
-            <if test="startClassDate!=null">
+            <if test="startClassDate!=null and startClassDate!=''">
                 AND cs.class_date_ &gt;= #{startClassDate}
             </if>
-            <if test="endClassDate!=null">
+            <if test="endClassDate!=null and endClassDate!=''">
                 AND cs.class_date_ &lt;= #{endClassDate}
             </if>
         </where>
@@ -1494,12 +1494,12 @@
             AND sa.teacher_id_=#{userId}
         </if>
         <if test="status!=null">
-            AND cs.status_ = #{status}
+            AND cs.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
         </if>
-        <if test="startClassDate!=null">
+        <if test="startClassDate!=null and startClassDate!=''">
             AND cs.class_date_ &gt;= #{startClassDate}
         </if>
-        <if test="endClassDate!=null">
+        <if test="endClassDate!=null and endClassDate!=''">
             AND cs.class_date_ &lt;= #{endClassDate}
         </if>
         GROUP BY sa.course_schedule_id_
@@ -1528,12 +1528,12 @@
             AND sa.teacher_id_=#{userId}
         </if>
         <if test="status!=null">
-            AND cs.status_ = #{status}
+            AND cs.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
         </if>
-        <if test="startClassDate!=null">
+        <if test="startClassDate!=null and startClassDate!=''">
             AND cs.class_date_ &gt;= #{startClassDate}
         </if>
-        <if test="endClassDate!=null">
+        <if test="endClassDate!=null and endClassDate!=''">
             AND cs.class_date_ &lt;= #{endClassDate}
         </if>
     </select>

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

@@ -133,11 +133,11 @@
 		SELECT COUNT(*) FROM goods_procurement
 	</select>
 
-	<select id="getWithStockSurplusProcurement" resultMap="GoodsProcurement">
+	<select id="getWithStockSurplusProcurement" resultMap="GoodsProcurement" useCache="false" flushCache="true">
 		SELECT * FROM goods_procurement WHERE goods_id_ = #{goodsId} AND stock_count_>stock_sold_num_ ORDER BY create_time_ LIMIT 1
 	</select>
 
-	<select id="getWithTaxStockSurplusProcurement" resultMap="GoodsProcurement">
+	<select id="getWithTaxStockSurplusProcurement" resultMap="GoodsProcurement" useCache="false" flushCache="true">
 		SELECT * FROM goods_procurement WHERE goods_id_ = #{goodsId} AND tax_stock_count_>tax_stock_sold_num_ ORDER BY create_time_ LIMIT 1
 	</select>
 

+ 2 - 1
mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -155,7 +155,8 @@
 
     <select id="findStudentsByOrganId" resultMap="studentManageListDto">
         SELECT o.`name_` organ_name_,o.grade_type_,s.`user_id_` ,su.`username_` ,su.`phone_` parents_phone_,su.`real_name_` ,su.`gender_` , su.organ_id_,
-		tu.`real_name_` teacher_name_,CASE s.service_tag_ WHEN 2 THEN 0 ELSE s.service_tag_ END service_tag_ ,s.`operating_tag_` , s.care_package_, s.come_on_package_, suca.`course_balance_` ,
+		tu.`real_name_` teacher_name_,CASE s.service_tag_ WHEN 2 THEN 0 ELSE s.service_tag_ END service_tag_ ,s.`operating_tag_` ,
+        s.care_package_, s.come_on_package_, suca.`course_balance_` ,suca.balance_,
 		sub.`name_` music_group_subject_ ,su.birthdate_,s.subject_id_list_,s.teacher_id_,s.current_grade_num_,s.current_class_,
         case when su.password_ is null then false else true end isActive_,s.is_new_user_,case when sut.user_id_ is null then 0 else 1 end is_signed_contract_
 		FROM `student` s LEFT JOIN `sys_user` su on s.`user_id_` = su.`id_`

+ 1 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherAttendanceController.java

@@ -93,6 +93,7 @@ public class TeacherAttendanceController extends BaseController {
             sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_NAMES_ACHIEVE,
                     receivers, null, 0, "2", "STUDENT", DateUtil.format(new Date(), DateUtil.DATE_FORMAT_MIN));
         }
+        studentAttendanceDao.updateNormalRemind(courseId);
         return succeed();
     }