|
@@ -3,12 +3,15 @@ package com.gree.mall.manager.logic.admin;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.gree.mall.manager.bean.admin.AdminUserBean;
|
|
|
import com.gree.mall.manager.bean.admin.AdminUserCom;
|
|
|
import com.gree.mall.manager.bean.admin.AdminWebsitTree;
|
|
|
import com.gree.mall.manager.bean.admin.AdminWebsitVO;
|
|
|
+import com.gree.mall.manager.bean.admin.reqDto.AdminUserAddReqBean;
|
|
|
import com.gree.mall.manager.commonmapper.AdminMapper;
|
|
|
import com.gree.mall.manager.exception.RemoteServiceException;
|
|
|
import com.gree.mall.manager.logic.common.CommonLogic;
|
|
|
+import com.gree.mall.manager.logic.common.LbsAmapLogic;
|
|
|
import com.gree.mall.manager.plus.entity.*;
|
|
|
import com.gree.mall.manager.plus.service.*;
|
|
|
import com.gree.mall.manager.utils.StringUtil;
|
|
@@ -50,6 +53,12 @@ public class AdminWebsitLogic {
|
|
|
@Autowired
|
|
|
SysDictCompanyService sysDictCompanyService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ AdminUserLogic adminUserLogic;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ LbsAmapLogic lbsAmapLogic;
|
|
|
+
|
|
|
/**
|
|
|
* 区域列表
|
|
|
*/
|
|
@@ -105,15 +114,28 @@ public class AdminWebsitLogic {
|
|
|
AdminCompanyWechat adminCompanyWechat = adminCompanyWechatService.getById(adminWebsit.getPayWorkerCodeId());
|
|
|
AdminCompanyWechat adminCompanyWechatP = adminCompanyWechatService.getById(adminWebsit.getCompanyWechatId());
|
|
|
|
|
|
- //Long aLong = workWechatLogic.addOrganization(adminWebsit.getName(), adminWebsit.getParentId(),adminUser.getAdminCompanyWechat());
|
|
|
- String aLong = IdWorker.getIdStr();
|
|
|
- adminWebsit.setWebsitId(aLong+"");
|
|
|
-// adminWebsit.setCorpId(adminUser.getCorpIds().get(0));
|
|
|
- adminWebsit.setWebsitId(aLong);
|
|
|
+
|
|
|
+ adminWebsit.setWebsitId(adminWebsit.getWebsitNumber());
|
|
|
adminWebsit.setCompanyName(adminCompanyWechatP.getCompanyName());
|
|
|
adminWebsit.setPayWorkerCodeName(adminCompanyWechat.getCompanyName());
|
|
|
adminWebsit.insert();
|
|
|
|
|
|
+ AdminUserAddReqBean adminUserBean = new AdminUserAddReqBean();
|
|
|
+ adminUserBean.setUserName(adminWebsit.getWebsitId());
|
|
|
+ adminUserBean.setNickName(adminWebsit.getName());
|
|
|
+ adminUserBean.setLinkPhone(adminWebsit.getPersonMobile());
|
|
|
+ adminUserBean.setLinkName(adminWebsit.getPerson());
|
|
|
+ adminUserBean.setPassword("123456");
|
|
|
+ adminUserBean.setRoleId("1899638664615489538");
|
|
|
+ adminUserBean.setRoleName("网点");
|
|
|
+ adminUserBean.setWebsitId(adminWebsit.getWebsitId());
|
|
|
+ adminUserBean.setWebsitName(adminWebsit.getName());
|
|
|
+ adminUserBean.setCompanyWechatId(adminWebsit.getCompanyWechatId());
|
|
|
+ adminUserBean.setCompanyName(adminWebsit.getCompanyName());
|
|
|
+ adminUserBean.setAddress(adminWebsit.getAddress());
|
|
|
+ adminUserBean.setType(2);
|
|
|
+ adminUserLogic.save(adminUserBean, request);
|
|
|
+
|
|
|
}
|
|
|
/**
|
|
|
* 编辑部门
|
|
@@ -240,7 +262,8 @@ public class AdminWebsitLogic {
|
|
|
return adminDeptWebsitVOIPage;
|
|
|
}
|
|
|
|
|
|
- public void importData(List<Object> objects) {
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void importData(List<Object> objects,HttpServletRequest request) {
|
|
|
|
|
|
List<AdminWebsit> adminWebsits = new ArrayList<>();
|
|
|
|
|
@@ -285,6 +308,11 @@ public class AdminWebsitLogic {
|
|
|
throw new RemoteServiceException("第"+rowIndex+"行,找不到支付商户");
|
|
|
adminWebsit.setPayWorkerCodeName(one.getCompanyName());
|
|
|
adminWebsit.setPayWorkerCodeId(one.getCompanyWechatId());
|
|
|
+
|
|
|
+ String lnglat = lbsAmapLogic.getLocationByAddress(adminWebsit.getAddress());
|
|
|
+
|
|
|
+ adminWebsit.setLng(lnglat.split(",")[0]);
|
|
|
+ adminWebsit.setLat(lnglat.split(",")[1]);
|
|
|
if (row.size() > 7) {
|
|
|
adminWebsit.setYunAppid((String) row.get(9));
|
|
|
adminWebsit.setYunAppkey((String) row.get(10));
|
|
@@ -301,5 +329,24 @@ public class AdminWebsitLogic {
|
|
|
}
|
|
|
|
|
|
adminWebsitService.saveBatch(adminWebsits);
|
|
|
+
|
|
|
+ for (AdminWebsit adminWebsit : adminWebsits) {
|
|
|
+
|
|
|
+ AdminUserAddReqBean adminUserBean = new AdminUserAddReqBean();
|
|
|
+ adminUserBean.setUserName(adminWebsit.getWebsitId());
|
|
|
+ adminUserBean.setNickName(adminWebsit.getName());
|
|
|
+ adminUserBean.setLinkPhone(adminWebsit.getPersonMobile());
|
|
|
+ adminUserBean.setLinkName(adminWebsit.getPerson());
|
|
|
+ adminUserBean.setPassword("123456");
|
|
|
+ adminUserBean.setRoleId("1899638664615489538");
|
|
|
+ adminUserBean.setRoleName("网点");
|
|
|
+ adminUserBean.setWebsitId(adminWebsit.getWebsitId());
|
|
|
+ adminUserBean.setWebsitName(adminWebsit.getName());
|
|
|
+ adminUserBean.setCompanyWechatId(adminWebsit.getCompanyWechatId());
|
|
|
+ adminUserBean.setCompanyName(adminWebsit.getCompanyName());
|
|
|
+ adminUserBean.setAddress(adminWebsit.getAddress());
|
|
|
+ adminUserBean.setType(2);
|
|
|
+ adminUserLogic.save(adminUserBean, request);
|
|
|
+ }
|
|
|
}
|
|
|
}
|