|
@@ -18,6 +18,7 @@ import com.mooctest.crowd.site.data.dto.*;
|
|
|
import com.mooctest.crowd.site.data.enums.RoleType;
|
|
|
import com.mooctest.crowd.site.data.vo.*;
|
|
|
import com.mooctest.crowd.site.mediator.ViewMediator;
|
|
|
+import com.mooctest.crowd.site.service.UploadService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.codehaus.jettison.json.JSONException;
|
|
|
import org.codehaus.jettison.json.JSONObject;
|
|
@@ -28,8 +29,12 @@ import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
+import java.awt.*;
|
|
|
+import java.io.File;
|
|
|
import java.util.*;
|
|
|
+import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -96,6 +101,9 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
@Autowired
|
|
|
private BankLogoDao bankLogoDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private UploadService uploadService;
|
|
|
+
|
|
|
@Value("${agency}")
|
|
|
private String agencyId;
|
|
|
|
|
@@ -128,10 +136,7 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
|
|
|
@Override
|
|
|
public UserDTO loginByMobileAndPwd(LoginCommand cmd) {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- return null;
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -785,6 +790,7 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
userVO.setProvince(userPO.get().getProvince());
|
|
|
userVO.setCity(userPO.get().getCity());
|
|
|
userVO.setCounty(userPO.get().getCounty());
|
|
|
+ userVO.setDetailedAddress(userPO.get().getDetailedAddress());
|
|
|
userVO.setPersonalCompetence(userPO.get().getPersonalCompetence());
|
|
|
userDTO.setUserVO(userVO);
|
|
|
return userDTO;
|
|
@@ -795,13 +801,15 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
@Override
|
|
|
public UserDTO updateInformation(long userId, UserVO userVO) {
|
|
|
Optional<UserPO> userPO = userDao.findById(userId);
|
|
|
+ if(userVO.getUnit()==null||userVO.getUnit().length()<=0){
|
|
|
+ throw new HttpBadRequestException("请输入企业简称");
|
|
|
+ }
|
|
|
userPO.get().setUnit(userVO.getUnit());
|
|
|
userPO.get().setGender(userVO.getGender());
|
|
|
userPO.get().setBirthday(userVO.getBirthday());
|
|
|
userPO.get().setProvince(userVO.getProvince());
|
|
|
userPO.get().setCity(userVO.getCity());
|
|
|
userPO.get().setCounty(userVO.getCounty());
|
|
|
-// userPO.get().setDetailedAddress(userVO.getDetailedAddress());
|
|
|
userPO.get().setPersonalCompetence(userVO.getPersonalCompetence());
|
|
|
userDao.save(userPO.get());
|
|
|
return this.getInformation(userId);
|
|
@@ -886,6 +894,10 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
RestTemplate restTemplate = new RestTemplate();
|
|
|
String result = restTemplate.getForObject(url, String.class);
|
|
|
JSONObject json = new JSONObject(result);
|
|
|
+ String validated = String.valueOf(json.get("validated"));
|
|
|
+ if("false".equals(validated)){
|
|
|
+ throw new HttpBadRequestException("请输入正确的卡号");
|
|
|
+ }
|
|
|
String bank = String.valueOf(json.get("bank"));
|
|
|
bankCardPO.setUser(bankCardVO.getUser());
|
|
|
bankCardPO.setNumber(bankCardVO.getNumber());
|