yonge 5 years ago
parent
commit
e8377c145e

+ 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;
+	}
+
 }

+ 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));
 	}
 }