|
|
@@ -5,17 +5,20 @@ import com.uas.account.entity.UserSpaceDetail;
|
|
|
import com.uas.account.support.Page;
|
|
|
import com.uas.account.util.AccountUtils;
|
|
|
import com.uas.platform.b2c.common.account.model.Enterprise;
|
|
|
+import com.uas.platform.b2c.common.account.model.User;
|
|
|
import com.uas.platform.b2c.common.account.model.UserBaseInfo;
|
|
|
import com.uas.platform.b2c.common.account.model.FormEnterprise;
|
|
|
import com.uas.platform.b2c.common.account.service.EnterpriseService;
|
|
|
+import com.uas.platform.b2c.common.account.service.UserService;
|
|
|
import com.uas.platform.b2c.core.support.SystemSession;
|
|
|
import com.uas.platform.b2c.fa.payment.utils.StringUtils;
|
|
|
import com.uas.platform.b2c.prod.store.service.StoreInService;
|
|
|
import com.uas.platform.b2c.trade.support.ResultMap;
|
|
|
+import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* 企业信息
|
|
|
@@ -32,6 +35,9 @@ public class EnterpriseController {
|
|
|
@Autowired
|
|
|
private StoreInService storeService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private UserService userService;
|
|
|
+
|
|
|
/**
|
|
|
* 根据UU获取企业信息
|
|
|
* @param enuu 企业uu号
|
|
|
@@ -197,17 +203,41 @@ public class EnterpriseController {
|
|
|
* @param phone
|
|
|
*/
|
|
|
@RequestMapping(value = "/findApplyInfo", method = RequestMethod.GET)
|
|
|
- public Page<ApplyUserSpace> findApplyInfo(String phone) {
|
|
|
+ public List<Map<String,Object>> findApplyInfo(String phone) {
|
|
|
if (StringUtils.isEmpty(phone)) {
|
|
|
throw new IllegalArgumentException("信息未填写完整!");
|
|
|
}
|
|
|
Page<ApplyUserSpace> applyUserSpacePage= null;
|
|
|
+ List<Map<String,Object>> mapList = new ArrayList<>();
|
|
|
try {
|
|
|
- applyUserSpacePage = AccountUtils.findApplyInfo(phone,1024*1024*1024,1);
|
|
|
+ applyUserSpacePage = AccountUtils.findApplyInfo(phone,1,1024*1024*1024);
|
|
|
+ if (!CollectionUtils.isEmpty(applyUserSpacePage.getContent())) {
|
|
|
+ List<ApplyUserSpace> applyUserSpaceList = applyUserSpacePage.getContent();
|
|
|
+ for (ApplyUserSpace applyUserSpace : applyUserSpaceList) {
|
|
|
+ Enterprise e = enterpriseService.findByEnBussinessCode(applyUserSpace.getBusinessCode());
|
|
|
+ User admin = userService.findUserByUserUU(e.getEnAdminuu());
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ map.put("enName", e.getEnName());
|
|
|
+ map.put("date",applyUserSpace.getSubmitDate());
|
|
|
+ map.put("adminName",admin == null ? null : admin.getUserName());
|
|
|
+ map.put("status",applyUserSpace.getStatus());
|
|
|
+ mapList.add(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
} catch (Exception e) {
|
|
|
throw new IllegalArgumentException("系统异常");
|
|
|
}
|
|
|
- return applyUserSpacePage;
|
|
|
+ Collections.sort(mapList,new Comparator(){
|
|
|
+ @Override
|
|
|
+ public int compare(Object o1, Object o2) {
|
|
|
+ Map<String,Object> s1 = (Map<String,Object>) o1;
|
|
|
+ Map<String,Object> s2 = (Map<String,Object>)o2;
|
|
|
+ Long timeA = Long.parseLong(s1.get("date").toString());
|
|
|
+ Long timeB = Long.parseLong(s2.get("date").toString());
|
|
|
+ return timeA.compareTo(timeB);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return mapList;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -215,7 +245,7 @@ public class EnterpriseController {
|
|
|
* @param businessCode
|
|
|
*/
|
|
|
@RequestMapping(value = "/applyCount", method = RequestMethod.GET)
|
|
|
- public Map<String, Integer> applyCount(String businessCode) {
|
|
|
+ public ResultMap applyCount(String businessCode) {
|
|
|
if (StringUtils.isEmpty(businessCode)) {
|
|
|
throw new IllegalArgumentException("信息未填写完整!");
|
|
|
}
|
|
|
@@ -225,6 +255,12 @@ public class EnterpriseController {
|
|
|
} catch (Exception e) {
|
|
|
throw new IllegalArgumentException("系统异常");
|
|
|
}
|
|
|
- return result;
|
|
|
+ int count = 0;
|
|
|
+ for (String key : result.keySet()) {
|
|
|
+ if ("311".equals(key)){
|
|
|
+ count = count + result.get(key);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ResultMap.success(count);
|
|
|
}
|
|
|
}
|