|
|
@@ -11,18 +11,25 @@ import com.uas.platform.b2c.common.account.service.EnterpriseService;
|
|
|
import com.uas.platform.b2c.core.support.SystemSession;
|
|
|
import com.uas.platform.b2c.logistics.dao.ReceiptDao;
|
|
|
import com.uas.platform.b2c.logistics.model.Receipt;
|
|
|
+import com.uas.platform.b2c.trade.aftersale.model.ReturnFB2c;
|
|
|
import com.uas.platform.b2c.trade.support.CodeType;
|
|
|
import com.uas.platform.b2c.trade.support.ResultMap;
|
|
|
import com.uas.platform.core.exception.SystemException;
|
|
|
import com.uas.platform.core.model.Status;
|
|
|
+import com.uas.sso.entity.UserSpaceDetail;
|
|
|
+import com.uas.sso.entity.UserSpaceView;
|
|
|
+import com.uas.sso.entity.UserView;
|
|
|
import com.uas.sso.util.AccountUtils;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
+import org.hibernate.loader.custom.Return;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.core.userdetails.UserDetails;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.lang.reflect.Array;
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
@Service
|
|
|
@@ -141,46 +148,54 @@ public class EnterpriseServiceImpl implements EnterpriseService{
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResultMap registerEnterprise(FormEnterprise enterprise, String filePath, User user) {
|
|
|
- /*UserSpaceDetail detail = new UserSpaceDetail();
|
|
|
- detail.setName(enterprise.getName());
|
|
|
- detail.setShortName(null);
|
|
|
+ public ResultMap registerEnterprise(FormEnterprise enterprise, String filePath, User user) {
|
|
|
+ //封装注册时的个人账户信息;
|
|
|
+ if (user == null) {
|
|
|
+ throw new RuntimeException("登录异常:用户不存在!");
|
|
|
+ }
|
|
|
+ UserSpaceView detail = new UserSpaceView();
|
|
|
+ UserView userView = new UserView();
|
|
|
+ userView.setUserUU(user.getUserUU());
|
|
|
+ userView.setName(user.getUserName());
|
|
|
+ userView.setSex(user.getUserSex());
|
|
|
+ userView.setPassword(user.getUserPwd());
|
|
|
+ userView.setMobile(user.getUserTel());
|
|
|
+ userView.setEmail(user.getUserEmail());
|
|
|
+ userView.setIdCard(user.getUserIdcode());
|
|
|
+ userView.setImId(user.getUserIMId().toString());
|
|
|
+ //封装注册企业信息;
|
|
|
+ detail.setSpaceName(enterprise.getName());
|
|
|
+ detail.setCorporation(enterprise.getLawPerson());
|
|
|
+ detail.setAdmin(userView);
|
|
|
+ detail.setAdminUU(userView.getUserUU());
|
|
|
detail.setBusinessCode(enterprise.getLicenceId());
|
|
|
detail.setBusinessCodeImage(enterprise.getUrl());
|
|
|
- if (null == detail.getName()|| null==detail.getBusinessCode() || null==detail.getBusinessCodeImage()){
|
|
|
+ detail.setRegAddress(enterprise.getAddress());
|
|
|
+ detail.setLogoImage(enterprise.getLogoUrl());
|
|
|
+ detail.setTelephone(enterprise.getPhone());
|
|
|
+ detail.setProfession(enterprise.getProfession());
|
|
|
+ if (null == detail.getSpaceName() || null == detail.getBusinessCode() || null == detail.getBusinessCodeImage()) {
|
|
|
return new ResultMap(CodeType.SYSTEM_NOT_EXIST, "参数不能为空");
|
|
|
}
|
|
|
- detail.setArea("中国大陆");
|
|
|
- detail.setCorporation(enterprise.getLawPerson());
|
|
|
- detail.setAddress(enterprise.getAddress());
|
|
|
- detail.setUrl(enterprise.getWebsite());
|
|
|
- detail.setContactMan(enterprise.getLinkman());
|
|
|
- detail.setContactTel(enterprise.getPhone());
|
|
|
- detail.setContactEmail(enterprise.getEmail());
|
|
|
- detail.setFax(enterprise.getFax());
|
|
|
- detail.setLogoImage(enterprise.getLogoUrl());
|
|
|
- detail.setProfession(enterprise.getProfession());
|
|
|
- if (null != enterprise.getTagsData() || enterprise.getTagsData().length>0){
|
|
|
+ if (null != enterprise.getTagsData() || enterprise.getTagsData().length > 0) {
|
|
|
String str = Arrays.toString(enterprise.getTagsData());
|
|
|
- str = str.substring(1, str.length()-1);
|
|
|
+ str = str.substring(1, str.length() - 1);
|
|
|
detail.setTags(str);
|
|
|
} else {
|
|
|
detail.setTags(null);
|
|
|
}
|
|
|
- detail.setAdminName(user.getUserName());
|
|
|
- detail.setAdminEmail(user.getUserEmail());
|
|
|
- detail.setAdminTel(user.getUserTel());
|
|
|
+
|
|
|
String result = null;
|
|
|
try {
|
|
|
- result = AccountUtils.applyAppForMall(detail);
|
|
|
- }catch (Exception e){
|
|
|
+ AccountUtils.register(detail);
|
|
|
+ } catch (Exception e) {
|
|
|
return new ResultMap(CodeType.SYSTEM_ERROR, "账户中心异常,注册失败");
|
|
|
}
|
|
|
- if (result.contains("errMsg") || !result.contains("enuu")){
|
|
|
+ if (result.contains("errMsg") || !result.contains("enuu")) {
|
|
|
return new ResultMap(CodeType.SYSTEM_ERROR, "注册失败");
|
|
|
- }*/
|
|
|
+ }
|
|
|
|
|
|
- return null; //ResultMap.success(JSONObject.parseObject(result));
|
|
|
+ return ResultMap.success(JSONObject.parseObject(result));
|
|
|
}
|
|
|
|
|
|
@Override
|