Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

zouxuan 4 gadi atpakaļ
vecāks
revīzija
941f6af5b1

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupStudentDto.java

@@ -38,6 +38,28 @@ public class VipGroupStudentDto {
 
     private Integer studentStatus;
 
+    /** 线上课单价 */
+    private java.math.BigDecimal onlineClassesUnitPrice;
+
+    /** 线下课单价 */
+    private java.math.BigDecimal offlineClassesUnitPrice;
+
+    public BigDecimal getOnlineClassesUnitPrice() {
+        return onlineClassesUnitPrice;
+    }
+
+    public void setOnlineClassesUnitPrice(BigDecimal onlineClassesUnitPrice) {
+        this.onlineClassesUnitPrice = onlineClassesUnitPrice;
+    }
+
+    public BigDecimal getOfflineClassesUnitPrice() {
+        return offlineClassesUnitPrice;
+    }
+
+    public void setOfflineClassesUnitPrice(BigDecimal offlineClassesUnitPrice) {
+        this.offlineClassesUnitPrice = offlineClassesUnitPrice;
+    }
+
     public BigDecimal getBalance() {
         return balance;
     }

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleStudentPayment.java

@@ -55,7 +55,7 @@ public class CourseScheduleStudentPayment implements Comparable<CourseScheduleSt
 
 	private String examSongDownloadJson;
 
-	private Boolean beMerged = false;
+	private Boolean beMerged;
 
 	public Boolean getBeMerged() {
 		return beMerged;

+ 11 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TeacherDefaultVipGroupSalary.java

@@ -22,6 +22,8 @@ public class TeacherDefaultVipGroupSalary {
 	/** 课程类型 */
 	@ApiModelProperty(value = "课程类型名称(1v1,1v2)", required = false)
 	private String vipGroupCategoryName;
+
+	private Boolean musicTheory;
 	
 	/** 线上课薪酬 */
 	@ApiModelProperty(value = "线上课薪酬", required = false)
@@ -100,7 +102,15 @@ public class TeacherDefaultVipGroupSalary {
 	public java.util.Date getUpdateTime(){
 		return this.updateTime;
 	}
-			
+
+	public Boolean getMusicTheory() {
+		return musicTheory;
+	}
+
+	public void setMusicTheory(Boolean musicTheory) {
+		this.musicTheory = musicTheory;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

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

@@ -5353,9 +5353,10 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		}
 		courseScheduleDao.batchUpdate(mergeCourses);
 
-//		if(!CollectionUtils.isEmpty(updatePayments)){
-//			courseScheduleStudentPaymentDao.batchUpdate(updatePayments);
-//		}
+		if(!CollectionUtils.isEmpty(courseScheduleStudentPayments)){
+			courseScheduleStudentPayments.forEach(c->c.setBeMerged(false));
+			courseScheduleStudentPaymentDao.batchUpdate(courseScheduleStudentPayments);
+		}
 		if(!CollectionUtils.isEmpty(newPayments))
 			courseScheduleStudentPaymentDao.batchInsert(newPayments);
 

+ 8 - 12
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java

@@ -385,7 +385,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 //未签到扣除全部课酬
                 deductCost = deductCost.add(expectSalary);
                 deductReasons.add("未签到扣除全部课酬");
-            }else if(YesOrNoEnum.NO.equals(courseTeacherAttendances.get(0).getSignInStatus())){
+            }else if(YesOrNoEnum.NO.equals(courseTeacherAttendances.get(0).getSignInStatus())&&TeachModeEnum.ONLINE.equals(courseScheduleTeacherSalary.getCourseSchedule().getTeachMode())){
                 //异常签到
                 int signCourseTimeBetweenSeconds = DateUtil.secondsBetween(courseTeacherAttendances.get(0).getSignInTime(), courseScheduleTeacherSalary.getCourseSchedule().getStartClassTime());
                 float signCourseTimeBetween = (float)signCourseTimeBetweenSeconds/(float)60;
@@ -398,18 +398,16 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                     deductCost = deductCost.add(expectSalary);
                     deductReasons.add("课程开始后3分钟进入教室扣除全部课酬");
                 }
-
-                if(TeachModeEnum.OFFLINE.equals(courseScheduleTeacherSalary.getCourseSchedule().getTeachMode())){
-                    deductCost = deductCost.add(expectSalary);
-                    deductReasons.add("点名时经纬度不在范围内扣除全部课酬");
-                }
+            }else if(YesOrNoEnum.NO.equals(courseTeacherAttendances.get(0).getSignInStatus())&&TeachModeEnum.OFFLINE.equals(courseScheduleTeacherSalary.getCourseSchedule().getTeachMode())){
+                deductCost = deductCost.add(expectSalary);
+                deductReasons.add("点名时经纬度不在范围内扣除全部课酬");
             }
 
             if(CollectionUtils.isEmpty(courseTeacherAttendances)||Objects.isNull(courseTeacherAttendances.get(0).getSignOutStatus())){
                 //未签退扣除全部课酬
                 deductCost = deductCost.add(expectSalary);
                 deductReasons.add("未签退扣除全部课酬");
-            }else if(YesOrNoEnum.NO.equals(courseTeacherAttendances.get(0).getSignOutStatus())){
+            }else if(YesOrNoEnum.NO.equals(courseTeacherAttendances.get(0).getSignOutStatus())&&TeachModeEnum.ONLINE.equals(courseScheduleTeacherSalary.getCourseSchedule().getTeachMode())){
                 //异常签退
                 int signOutCourseTimeBetweenSeconds = DateUtil.secondsBetween(courseTeacherAttendances.get(0).getSignOutTime(), courseScheduleTeacherSalary.getCourseSchedule().getEndClassTime());
                 float signOutCourseTimeBetween = (float)signOutCourseTimeBetweenSeconds/(float)60;
@@ -423,11 +421,9 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                     deductCost = deductCost.add(expectSalary.divide(new BigDecimal(2)));
                     deductReasons.add("课程结束前3分钟后至课程结束前退出教室扣除一半课酬");
                 }
-
-                if(TeachModeEnum.OFFLINE.equals(courseScheduleTeacherSalary.getCourseSchedule().getTeachMode())){
-                    deductCost = deductCost.add(expectSalary);
-                    deductReasons.add("点名时经纬度不在范围内扣除全部课酬");
-                }
+            }else if(YesOrNoEnum.NO.equals(courseTeacherAttendances.get(0).getSignInStatus())&&TeachModeEnum.OFFLINE.equals(courseScheduleTeacherSalary.getCourseSchedule().getTeachMode())){
+                deductCost = deductCost.add(expectSalary);
+                deductReasons.add("点名时经纬度不在范围内扣除全部课酬");
             }
 
             if(BigDecimal.ZERO.compareTo(deductCost)<0){

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

@@ -326,16 +326,20 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         if(Objects.isNull(vipGroupDefaultClassesUnitPrice)){
             vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.ING);
         }else{
-            if(Objects.nonNull(vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice())
-                    &&vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice().compareTo(vipGroupDefaultClassesUnitPrice.getOfflineClassesUnitPrice())!=0){
-                vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.ING);
-            }
-            if(Objects.nonNull(vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice())
-                    &&vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice().compareTo(vipGroupDefaultClassesUnitPrice.getOnlineClassesUnitPrice())!=0){
-                vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.ING);
-            }
+			if(Objects.nonNull(vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice())
+					&&vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice().compareTo(vipGroupDefaultClassesUnitPrice.getOfflineClassesUnitPrice())!=0){
+				vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.ING);
+			}
+			if(Objects.nonNull(vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice())
+					&&vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice().compareTo(vipGroupDefaultClassesUnitPrice.getOnlineClassesUnitPrice())!=0){
+				vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.ING);
+			}
         }
 
+        if(StringUtils.isBlank(vipGroupApplyBaseInfoDto.getStudentIdList())){
+			vipGroupApplyBaseInfoDto.setStudentIdList(StringUtils.join(vscps.stream().map(VipGroupStudentCoursePrice::getStudentId).collect(Collectors.toList()), ","));
+		}
+
         if(vipGroup.getOnlyProgress()){
 			vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.PASS);
 		}
@@ -791,12 +795,23 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		Map<String, Object> params = new HashMap<String, Object>();
 		MapUtil.populateMap(params, queryInfo);
 
-		List dataList = null;
+		List<VipGroupStudentDto> dataList = null;
 		int count = vipGroupDao.countHaveCourseBalanceStudentNum(params);
 		if (count > 0) {
 			pageInfo.setTotal(count);
 			params.put("offset", pageInfo.getOffset());
 			dataList = vipGroupDao.findHaveCourseBalanceStudents(params);
+
+			List<VipGroupStudentCoursePrice> vipGroupStudentCoursePrices = vipGroupStudentCoursePriceDao.getVipGroupStudentCoursePrice(queryInfo.getVipGroupId(), null);
+			Map<Integer, VipGroupStudentCoursePrice> userPriceMap = vipGroupStudentCoursePrices.stream().collect(Collectors.toMap(VipGroupStudentCoursePrice::getStudentId, v -> v, (v1, v2) -> v1));
+			for (VipGroupStudentDto vipGroupStudentDto : dataList) {
+				if(!userPriceMap.containsKey(vipGroupStudentDto.getId())){
+					continue;
+				}
+				VipGroupStudentCoursePrice vipGroupStudentCoursePrice = userPriceMap.get(vipGroupStudentDto.getId());
+				vipGroupStudentDto.setOnlineClassesUnitPrice(vipGroupStudentCoursePrice.getOnlineClassesUnitPrice());
+				vipGroupStudentDto.setOfflineClassesUnitPrice(vipGroupStudentCoursePrice.getOfflineClassesUnitPrice());
+			}
 		}
 		if (count == 0) {
 			dataList = new ArrayList<>();

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

@@ -11,6 +11,7 @@
         <result column="user_id_" property="userId"/>
         <result column="vip_group_category_id_" property="vipGroupCategoryId"/>
         <result column="vip_group_category_name_" property="vipGroupCategoryName"/>
+        <result column="music_theory_" property="musicTheory"/>
         <result column="online_classes_salary_" property="onlineClassesSalary"/>
         <result column="offline_classes_salary_" property="offlineClassesSalary"/>
         <result column="create_time_" property="createTime"/>
@@ -75,7 +76,7 @@
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="TeacherDefaultVipGroupSalary" parameterType="map">
-        SELECT tdvgs.*,vgc.name_ vip_group_category_name_ FROM teacher_default_vip_group_salary tdvgs
+        SELECT tdvgs.*,vgc.name_ vip_group_category_name_,vgc.music_theory_ FROM teacher_default_vip_group_salary tdvgs
         LEFT JOIN  vip_group_category vgc ON tdvgs.vip_group_category_id_ = vgc.id_
         <where>
             <if test="search != null and search != ''">

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

@@ -352,7 +352,6 @@
             AND status_='SUCCESS') = 0
             AND vg.organ_id_ = #{organId} AND IF(vg.student_id_list_ IS NULL,1,FIND_IN_SET(#{userId},
             vg.student_id_list_))
-            AND vg.vip_group_activity_id_ IS NOT NULL
             AND vgc.music_theory_ = 0
             <if test="subjectId!=null">
                 AND FIND_IN_SET(#{subjectId},cg.subject_id_list_)

+ 49 - 4
mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemPlanConclusionController.java

@@ -1,18 +1,28 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.entity.Employee;
+import com.ym.mec.biz.dal.entity.OperatingReport;
 import com.ym.mec.biz.service.InspectionItemPlanConclusionService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.util.date.DateUtil;
+import com.ym.mec.util.excel.POIUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.List;
-import java.util.Map;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.*;
 
 @Api(tags = "巡查结果")
 @RequestMapping("inspectionItemPlanConclusion")
@@ -33,7 +43,42 @@ public class InspectionItemPlanConclusionController extends BaseController {
     @GetMapping("/exportPlanConclusion")
     @PreAuthorize("@pcs.hasPermissions('inspectionItemPlanConclusion/exportPlanConclusion')")
     @ApiImplicitParams({@ApiImplicitParam(name = "planId", value = "日程id", required = true, dataType = "int")})
-    public HttpResponseResult<List<Map<String, String>>> exportPlanConclusion(Long planId) {
-        return succeed(InspectionItemPlanConclusionService.getPlanConclusion(planId));
+    public void exportPlanConclusion(Long planId, HttpServletResponse response) throws Exception {
+        List<Map<String, String>> conclusions = InspectionItemPlanConclusionService.getPlanConclusion(planId);
+        if (conclusions.size() <= 0) {
+            response.setStatus(200);
+            response.setContentType("Content-Type: application/json;charset=UTF-8");
+            response.getOutputStream().write("{\"data\": null, \"code\": 500, \"status\": false, \"msg\": \"没有可导出的记录\"}".getBytes());
+            response.flushBuffer();
+            return;
+        }
+        OutputStream outputStream = response.getOutputStream();
+        try {
+            List<String> bodyList = new ArrayList<>();
+            conclusions.get(0).forEach((key,vak)->{
+                bodyList.add(key);
+            });
+            String[] body = bodyList.toArray(new String[bodyList.size()]);
+
+            String[] header = {"老师","老师是否提前准备板书(本课内容、作业)","老师是否佩戴工牌","老师是否仪容仪表整洁","老师是否携带乐器","老师是否携带教学资料、设备","老师是否合理安排学员座位","乐器箱包、书包是否摆放整齐","课堂纪律是否保持良好","老师是否全程站立教学","老师是否全程使用节拍器或教学音频","是否发现学员需要更换新乐器","老师是否将上课照片/视频发送到声部群","老师是否保持教室环境卫生","老师是否关好所有电源、门窗","老师是否有序组织学员放学"};
+            HSSFWorkbook workbook = POIUtil.exportExcel(header, body, conclusions);
+
+            response.setContentType("application/octet-stream");
+            response.setHeader("Content-Disposition", "attachment;filename=cooperationOrgan-" + DateUtil.getDate(new Date()) + ".xls");
+            response.flushBuffer();
+            outputStream = response.getOutputStream();
+            workbook.write(outputStream);
+            outputStream.flush();
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if (outputStream != null) {
+                try {
+                    outputStream.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
     }
 }