فهرست منبع

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

zouxuan 5 سال پیش
والد
کامیت
26c3ebe562

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

@@ -459,5 +459,6 @@ public interface CourseScheduleTeacherSalaryDao extends BaseDAO<Long, CourseSche
      * @param month:
      * @return int
      */
-    int countOpenConfirmSalarysWithMonth(@Param("month") String month);
+    int countOpenConfirmSalarysWithMonth(@Param("month") String month,
+										 @Param("confirmStatus") TeacherSalaryConfirmStatus confirmStatus);
 }

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

@@ -929,8 +929,8 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
         if(Objects.isNull(month)){
             month=DateUtil.dateToString(DateUtil.addMonths(new Date(), -1), "yyyy-MM");
         }
-        int i = courseScheduleTeacherSalaryDao.countOpenConfirmSalarysWithMonth(month);
-        if(i>0){
+        int i = courseScheduleTeacherSalaryDao.countOpenConfirmSalarysWithMonth(month,null);
+        if(i<=0){
             throw new BizException("课酬确认已开启");
         }
         List<Long> teacherSalaryIds = courseScheduleTeacherSalaryDao.findTeacherSalaryIdsWithMonth(null, month);
@@ -949,6 +949,9 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void closeSalaryConfirm(String month) {
+        if(Objects.isNull(month)){
+            month=DateUtil.dateToString(DateUtil.addMonths(new Date(), -1), "yyyy-MM");
+        }
         List<Long> teacherSalaryIds = courseScheduleTeacherSalaryDao.findTeacherSalaryIdsWithMonth(null, month);
         if(CollectionUtils.isEmpty(teacherSalaryIds)){
             return;

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

@@ -771,7 +771,7 @@
 				AND ta.sign_out_status_=#{signOutStatus}
 			</if>
 			<if test="confirmStatus!=null">
-				AND csts.reduce_salary=#{confirmStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+				AND csts.confirm_status_=#{confirmStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 			</if>
 			<if test="groupName!=null">
 				AND cs.name_ LIKE CONCAT('%', #{groupName}, '%')
@@ -908,6 +908,12 @@
 			LEFT JOIN course_schedule cs ON cs.id_ = csts.course_schedule_id_
 		WHERE
 			DATE_FORMAT( cs.class_date_, '%Y-%m' ) = #{month}
-			AND csts.settlement_time_ IS NOT NULL AND csts.confirm_status_ IS NOT NULL
+			AND csts.settlement_time_ IS NOT NULL
+			<if test="confirmStatus!=null">
+				AND csts.confirm_status_=#{confirmStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+			</if>
+			<if test="confirmStatus==null">
+				AND csts.confirm_status_ IS NULL
+			</if>
 	</select>
 </mapper>

+ 12 - 2
mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleTeacherSalaryController.java

@@ -5,6 +5,7 @@ import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.CourseScheduleTeacherSalaryDao;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.Employee;
+import com.ym.mec.biz.dal.enums.TeacherSalaryConfirmStatus;
 import com.ym.mec.biz.dal.page.CourseSalaryQueryInfo4Web;
 import com.ym.mec.biz.dal.page.CourseScheduleTeacherSalaryQueryInfo;
 import com.ym.mec.biz.service.CourseScheduleTeacherSalaryService;
@@ -76,8 +77,17 @@ public class CourseScheduleTeacherSalaryController extends BaseController {
 
         Map<String, Object> result=new HashMap<>();
         result.put("pageInfo", courseScheduleTeacherSalaryService.findIsSettlementCourseSalarys(queryInfo));
-        int i = courseScheduleTeacherSalaryDao.countOpenConfirmSalarysWithMonth(DateUtil.getMonth(DateUtil.addMonths(new Date(), -1)));
-        result.put("isOpenConfirm", i>0?1:0);
+        int i = courseScheduleTeacherSalaryDao.countOpenConfirmSalarysWithMonth(DateUtil.dateToString(DateUtil.addMonths(new Date(), -1), "yyyy-MM"), TeacherSalaryConfirmStatus.UNCONFIRMED);
+        if(i>0){
+            result.put("isOpenConfirm", 1);
+        }else{
+            int j = courseScheduleTeacherSalaryDao.countOpenConfirmSalarysWithMonth(DateUtil.dateToString(DateUtil.addMonths(new Date(), -1), "yyyy-MM"), null);
+            if(j<=0){
+                result.put("isOpenConfirm", 2);
+            }else{
+                result.put("isOpenConfirm", 0);
+            }
+        }
         return succeed(result);
     }