瀏覽代碼

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

zouxuan 5 年之前
父節點
當前提交
13eccd888c

+ 12 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/WithdrawDto.java

@@ -9,8 +9,11 @@ public class WithdrawDto extends QueryInfo {
 	@ApiModelProperty(value = "用户id", required = false)
 	private Integer userId;
 
-	@ApiModelProperty(value = "银行卡号", required = true)
+	@ApiModelProperty(value = "银行卡号", required = false)
 	private String bankCardNo;
+	
+	@ApiModelProperty(value = "分部", required = false)
+	private String organId;
 
 	public WithdrawDto() {
 	}
@@ -30,4 +33,12 @@ public class WithdrawDto extends QueryInfo {
 	public void setBankCardNo(String bankCardNo) {
 		this.bankCardNo = bankCardNo;
 	}
+
+	public String getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(String organId) {
+		this.organId = organId;
+	}
 }

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentApplyrefundsQueryInfo.java

@@ -12,7 +12,7 @@ public class StudentApplyrefundsQueryInfo extends QueryInfo {
 
 	private String status;
 	
-	private Integer organId;
+	private String organId;
 
 	public String getStatus() {
 		return status;
@@ -38,11 +38,11 @@ public class StudentApplyrefundsQueryInfo extends QueryInfo {
 		this.endTime = endTime;
 	}
 
-	public Integer getOrganId() {
+	public String getOrganId() {
 		return organId;
 	}
 
-	public void setOrganId(Integer organId) {
+	public void setOrganId(String organId) {
 		this.organId = organId;
 	}
 }

+ 13 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentRechargeQueryInfo.java

@@ -1,5 +1,7 @@
 package com.ym.mec.biz.dal.page;
 
+import io.swagger.annotations.ApiModelProperty;
+
 import java.util.Date;
 
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
@@ -15,6 +17,9 @@ public class StudentRechargeQueryInfo extends QueryInfo {
 	private Date startDate;
 	
 	private Date endDate;
+	
+	@ApiModelProperty(value = "分部", required = false)
+	private String organId;
 
 	public DealStatusEnum getStatus() {
 		return status;
@@ -48,4 +53,12 @@ public class StudentRechargeQueryInfo extends QueryInfo {
 		this.endDate = endDate;
 	}
 
+	public String getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(String organId) {
+		this.organId = organId;
+	}
+
 }

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -285,6 +285,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             Date date;
             date = new Date();
             highClassGroup.setId(null);
+            highClassGroup.setGroupType(GroupType.MUSIC);
             highClassGroup.setCreateTime(date);
             highClassGroup.setUpdateTime(date);
             highClassGroup.setType(ClassGroupTypeEnum.HIGH);

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

@@ -124,7 +124,7 @@ public class ClassGroupTeacherMapperServiceImpl extends BaseServiceImpl<Long, Cl
         List<TeacherDefaultMusicGroupSalary> teacherSalaryList = teacherDefaultMusicGroupSalaryDao.findByTeacher(teacherUserIds);
         Map<String, TeacherDefaultMusicGroupSalary> teacherDefaultSalary = new HashMap<>();
         if (teacherSalaryList.size() > 0) {
-            teacherDefaultSalary = teacherSalaryList.stream().collect(Collectors.toMap(teacherDefaultMusicGroupSalary->teacherDefaultMusicGroupSalary.getCourseScheduleType().getCode()+teacherDefaultMusicGroupSalary.getUserId(), teacherDefaultMusicGroupSalary -> teacherDefaultMusicGroupSalary));
+            teacherDefaultSalary = teacherSalaryList.stream().collect(Collectors.toMap(teacherDefaultMusicGroupSalary -> teacherDefaultMusicGroupSalary.getCourseScheduleType().getCode() + teacherDefaultMusicGroupSalary.getUserId(), teacherDefaultMusicGroupSalary -> teacherDefaultMusicGroupSalary));
         }
         List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaryList = new ArrayList<>();
         String musicGroupId = classGroupTeacherMapperList.get(0).getMusicGroupId();
@@ -149,7 +149,7 @@ public class ClassGroupTeacherMapperServiceImpl extends BaseServiceImpl<Long, Cl
 
                 TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary = collect.get(classGroupNoStartCourseSchedule.getType());
                 if (teacherDefaultMusicGroupSalary == null) {
-                    teacherDefaultMusicGroupSalary = teacherDefaultSalary.get(classGroupNoStartCourseSchedule.getType().getCode()+classGroupTeacherMapper.getUserId());
+                    teacherDefaultMusicGroupSalary = teacherDefaultSalary.get(classGroupNoStartCourseSchedule.getType().getCode() + classGroupTeacherMapper.getUserId());
                 }
                 if (teacherDefaultMusicGroupSalary == null) {
                     throw new BizException("请先设置老师课酬");
@@ -158,6 +158,7 @@ public class ClassGroupTeacherMapperServiceImpl extends BaseServiceImpl<Long, Cl
                 //对应基准课酬
                 BigDecimal baseSalary = new BigDecimal(0), classTimeDuty = new BigDecimal(0);
 
+
                 //2.0课酬
                 if (musicGroup.getSettlementType().equals(SalarySettlementTypeEnum.TEACHER_DEFAULT)) {
                     //课程时长与结算单位时长占比
@@ -176,6 +177,13 @@ public class ClassGroupTeacherMapperServiceImpl extends BaseServiceImpl<Long, Cl
                     classTimeDuty = new BigDecimal(duration).divide(new BigDecimal(40), 6, BigDecimal.ROUND_HALF_UP);
                     baseSalary = classGroupTeacherMapper.getTeacherRole().equals(TeachTypeEnum.BISHOP) ? teacherDefaultMusicGroupSalary.getMainTeacher30MinSalary() : teacherDefaultMusicGroupSalary.getAssistantTeacher30MinSalary();
                 }
+                //基础技能提高课
+                if (classGroupNoStartCourseSchedule.getType().equals(CourseSchedule.CourseScheduleType.HIGH)) {
+                    //课程时长与结算单位时长占比
+                    classTimeDuty = new BigDecimal(duration).divide(new BigDecimal(45), 6, BigDecimal.ROUND_HALF_UP);
+                    baseSalary = classGroupTeacherMapper.getTeacherRole().equals(TeachTypeEnum.BISHOP) ? teacherDefaultMusicGroupSalary.getMainTeacher30MinSalary() : teacherDefaultMusicGroupSalary.getAssistantTeacher30MinSalary();
+                }
+
                 salary = baseSalary.multiply(classTimeDuty).setScale(2, BigDecimal.ROUND_HALF_UP);
 
                 //课程与老师薪水表

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

@@ -593,6 +593,7 @@
                  close=")" separator=",">
             #{classGroupTeacherMapper.classGroupId}
         </foreach>
+        AND group_type_ = 'MUSIC'
     </select>
 
     <select id="getStudentCourseScheduleDate" resultType="java.util.Date">

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

@@ -112,6 +112,9 @@
         <if test="endDate != null">
            and sr.create_time_ &lt;= #{endTime}
         </if>
+        <if test="organId!=null and organId!=''">
+            and u.organ_id_=#{organId}
+        </if>
         ORDER BY sr.id_
         <include refid="global.limit"/>
     </select>
@@ -131,6 +134,9 @@
         <if test="endDate != null">
            and sr.create_time_ &lt;= #{endTime}
         </if>
+        <if test="organId!=null and organId!=''">
+            and u.organ_id_=#{organId}
+        </if>
 	</select>
 
     <select id="queryByTransNo" resultMap="StudentRecharge">

+ 10 - 5
mec-biz/src/main/resources/config/mybatis/StudentWithdrawMapper.xml

@@ -102,21 +102,26 @@
         <if test="bankCardNo != null">
             and sw.bank_card_no_ = #{bankCardNo}
         </if>
+        <if test="organId!=null and organId!=''">
+            and su.organ_id_=#{organId}
+        </if>
         ORDER BY sw.create_time_ DESC
         <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM student_withdraw
-        <where>
+		SELECT COUNT(sw.id_) FROM student_withdraw sw,sys_user su
+        where  su.id_ = sw.user_id_
             <if test="userId != null">
-                and user_id_ = #{userId}
+                and sw.user_id_ = #{userId}
             </if>
             <if test="bankCardNo != null">
-                and bank_card_no_ = #{bankCardNo}
+                and sw.bank_card_no_ = #{bankCardNo}
             </if>
-        </where>
+	        <if test="organId!=null and organId!=''">
+	            and su.organ_id_=#{organId}
+	        </if>
 	</select>
 
     <select id="getByUserId" resultMap="StudentWithdraw" parameterType="Long">

+ 21 - 1
mec-web/src/main/java/com/ym/mec/web/controller/StudentApplyRefundsController.java

@@ -3,12 +3,17 @@ package com.ym.mec.web.controller;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.EmployeeDao;
+import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.page.StudentApplyrefundsQueryInfo;
 import com.ym.mec.biz.service.StudentApplyRefundsService;
 import com.ym.mec.common.controller.BaseController;
@@ -21,11 +26,26 @@ public class StudentApplyRefundsController extends BaseController {
 	@Autowired
 	private StudentApplyRefundsService studentApplyRefundsService;
 
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
+
+	@Autowired
+	private EmployeeDao employeeDao;
+
 	@ApiOperation(value = "查询退费列表")
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('studentRefunds/queryPage')")
     public Object queryPage(StudentApplyrefundsQueryInfo queryInfo){
-		
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null) {
+			return failed("用户信息获取失败");
+		}
+		if(!sysUser.getIsSuperAdmin()){
+			if(StringUtils.isEmpty(queryInfo.getOrganId())){
+				Employee employee = employeeDao.get(sysUser.getId());
+				queryInfo.setOrganId(employee.getOrganIdList());
+			}
+		}
         return succeed(studentApplyRefundsService.queryPage(queryInfo));
     }
 }

+ 21 - 0
mec-web/src/main/java/com/ym/mec/web/controller/StudentRechargeController.java

@@ -3,6 +3,7 @@ package com.ym.mec.web.controller;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -10,6 +11,10 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.EmployeeDao;
+import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.page.StudentRechargeQueryInfo;
 import com.ym.mec.biz.service.StudentRechargeService;
 import com.ym.mec.common.controller.BaseController;
@@ -22,10 +27,26 @@ public class StudentRechargeController extends BaseController {
 	@Autowired
 	private StudentRechargeService studentRechargeService;
 
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
+
+	@Autowired
+	private EmployeeDao employeeDao;
+
 	@ApiOperation(value = "列表分页查询")
 	@GetMapping(value = "/queryPage", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     @PreAuthorize("@pcs.hasPermissions('studentRecharge/queryPage')")
 	public Object queryPage(StudentRechargeQueryInfo queryInfo) {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null) {
+			return failed("用户信息获取失败");
+		}
+		if(!sysUser.getIsSuperAdmin()){
+			if(StringUtils.isEmpty(queryInfo.getOrganId())){
+				Employee employee = employeeDao.get(sysUser.getId());
+				queryInfo.setOrganId(employee.getOrganIdList());
+			}
+		}
 		return succeed(studentRechargeService.queryPage(queryInfo));
 	}
 

+ 21 - 0
mec-web/src/main/java/com/ym/mec/web/controller/StudentWithdrawController.java

@@ -3,6 +3,7 @@ package com.ym.mec.web.controller;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -10,7 +11,11 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dto.WithdrawDto;
+import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.TransTypeEnum;
 import com.ym.mec.biz.service.StudentWithdrawService;
@@ -24,6 +29,12 @@ public class StudentWithdrawController extends BaseController {
 	@Autowired
 	private StudentWithdrawService studentWithdrawService;
 
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
+
+	@Autowired
+	private EmployeeDao employeeDao;
+
 	@PostMapping("confirm")
 	@ApiOperation(value = "确认提现")
 	@PreAuthorize("@pcs.hasPermissions('studentWithdraw/confirm')")
@@ -36,6 +47,16 @@ public class StudentWithdrawController extends BaseController {
 	@GetMapping("/queryPage")
 	@PreAuthorize("@pcs.hasPermissions('studentWithdraw/queryPage')")
 	public Object queryPage(WithdrawDto queryInfo) {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null) {
+			return failed("用户信息获取失败");
+		}
+		if(!sysUser.getIsSuperAdmin()){
+			if(StringUtils.isEmpty(queryInfo.getOrganId())){
+				Employee employee = employeeDao.get(sysUser.getId());
+				queryInfo.setOrganId(employee.getOrganIdList());
+			}
+		}
 		return succeed(studentWithdrawService.queryPage(queryInfo));
 	}
 }