zouxuan 5 years ago
parent
commit
0f3f2bda97

+ 17 - 5
src/main/java/com/ym/mec/collectfee/controller/UserController.java

@@ -2,10 +2,7 @@ package com.ym.mec.collectfee.controller;
 
 
 import com.ym.mec.collectfee.common.web.BaseController;
-import com.ym.mec.collectfee.entity.ApplyInfo;
-import com.ym.mec.collectfee.entity.MusicTeamsPageInfo;
-import com.ym.mec.collectfee.entity.School;
-import com.ym.mec.collectfee.entity.StudentsQueryInfo;
+import com.ym.mec.collectfee.entity.*;
 import com.ym.mec.collectfee.service.ApplyInfoService;
 import com.ym.mec.collectfee.service.CourseGroupInfoService;
 import com.ym.mec.collectfee.service.OrderService;
@@ -18,6 +15,9 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpSession;
 import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 @RestController()
 @RequestMapping("user")
@@ -255,7 +255,19 @@ public class UserController extends BaseController {
         if(userId == null){
             return failed(Constants.PARAM_VERIFY_ERROR_MSG);
         }
-        return succeed(applyInfoService.queryUserCourse(userId));
+        List<Branch> branches = applyInfoService.getBranches();
+        MecUser mecUser = applyInfoService.findMecUser(userId);
+        Map<String,Object> resultMap = new HashMap<>(2);
+        if(branches != null && branches.size() > 0 && mecUser != null){
+            for (Branch branch:branches) {
+                if(branch.getBranchId().equals(mecUser.getBranchId())){
+                    resultMap.put("memo",branch.getMemo());
+                    break;
+                }
+            }
+        }
+        resultMap.put("courses",applyInfoService.queryUserCourse(userId));
+        return succeed(resultMap);
     }
 
     /**

+ 11 - 1
src/main/java/com/ym/mec/collectfee/entity/Branch.java

@@ -20,7 +20,17 @@ public class Branch {
 	
 	/**  */
 	private Integer city;
-	
+
+	private String memo;
+
+	public String getMemo() {
+		return memo;
+	}
+
+	public void setMemo(String memo) {
+		this.memo = memo;
+	}
+
 	public void setBranchId(Integer branchId){
 		this.branchId = branchId;
 	}

+ 3 - 2
src/main/java/com/ym/mec/collectfee/service/impl/ApplyInfoServiceImpl.java

@@ -168,13 +168,14 @@ public class ApplyInfoServiceImpl extends BaseServiceImpl<Integer, ApplyInfo> im
 	@Override
 	public List<Branch> getBranches() {
 		try {
-			List<Branch> branchList = branchDao.findAll(null);
+//			List<Branch> branchList = branchDao.findAll(null);
+			List<Branch> branchList = null;
 			if(branchList == null || branchList.size() < 1){
 				String body = "<province>0</province>";
 				body = getBody(body,121002);
 				body = "<body><branches>" + new String(Base64.getDecoder().decode(body)) + "</branches></body>";
 				ResponseBranchesBean branches = XStreamUtil.xmlToObject("body", ResponseBranchesBean.class, body);
-				branchDao.batchInsert(branches.getBranches());
+//				branchDao.batchInsert(branches.getBranches());
 				return branches.getBranches();
 			}
 			return branchList;