‘linchangsheng’ 5 months ago
parent
commit
1c68fae139

+ 0 - 162
mall-server-sync-api/src/main/java/com/gree/mall/manager/controller/admin/AdminWebsitController.java

@@ -1,162 +0,0 @@
-package com.gree.mall.manager.controller.admin;
-
-import com.gree.mall.manager.bean.ExcelData;
-import com.gree.mall.manager.bean.admin.AdminWebsitNewBean;
-import com.gree.mall.manager.bean.admin.AdminWebsitTree;
-import com.gree.mall.manager.bean.workorder.AdminWebsitList;
-import com.gree.mall.manager.exception.RemoteServiceException;
-import com.gree.mall.manager.helper.ResponseHelper;
-import com.gree.mall.manager.logic.admin.AdminWebsitLogic;
-import com.gree.mall.manager.plus.entity.AdminWebsit;
-import com.gree.mall.manager.plus.entity.AdminWebsitPayConfig;
-import com.gree.mall.manager.plus.entity.AdminZone;
-import com.gree.mall.manager.utils.excel.ExcelUtils;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import lombok.extern.slf4j.Slf4j;
-import me.chanjar.weixin.common.error.WxErrorException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.util.List;
-
-@Slf4j
-@RestController
-@Api(value = "企业微信部门管理API", tags = {"企业微信部门管理API"})
-@RequestMapping(value = "/admin/websit", produces = "application/json; charset=utf-8")
-public class AdminWebsitController {
-
-    @Autowired
-    AdminWebsitLogic adminWebsitLogic;
-
-    @GetMapping("/tree")
-    @ApiOperation("部门树")
-    public ResponseHelper<AdminWebsitTree> tree(HttpServletRequest request) {
-        List<AdminWebsitTree> tree = adminWebsitLogic.tree(request);
-        return ResponseHelper.success(tree);
-    }
-
-    @GetMapping("/list")
-    @ApiOperation("部门列表")
-    public ResponseHelper<List<AdminWebsit>> list(
-            @ApiParam(value = "A=平台 B=商户网点 C=普通网点") @RequestParam(required = false) String type,
-            @RequestParam(required = false) Boolean isAll,
-            @RequestParam(required = false) String websitId,
-            @RequestParam(required = false) String websitName,
-            @RequestParam(required = false) Boolean status,
-            @RequestParam(required = false) Boolean isIncre,
-            @RequestParam(required = false) String streetCode,
-            @RequestParam(required = false) String channelId,
-            @RequestParam(required = false) String categoryId,
-            @RequestParam(required = false) String orderSourceId,
-            @RequestParam(required = false) String orderSmallId,
-            @RequestParam(required = false) Boolean queryPartsWebsit,
-            @RequestParam(required = false)   @ApiParam(value = "网点属性 SELF=自建网点 MAJOR=第三方专业网点 MERCHANT=第三方经销商家网点")String attr,
-            @RequestParam(required = false) Integer level
-    ) {
-        List<AdminWebsit> list = adminWebsitLogic.list(attr,websitId,websitName,type, isAll, isIncre, status, streetCode, channelId, categoryId, orderSmallId, orderSourceId, queryPartsWebsit, level);
-        return ResponseHelper.success(list);
-    }
-
-
-    @GetMapping("/websitList")
-    @ApiOperation("网点列表")
-    public ResponseHelper<List<AdminWebsitList>> websitList(
-            @ApiParam(value = "A=平台 B=商户网点 C=普通网点") @RequestParam(required = false) String type,
-            @ApiParam(value = "当前权限网点") @RequestParam(required = false) Boolean isAll,
-            @ApiParam(value = "状态") @RequestParam(required = false) Boolean status,
-            @ApiParam(value = "是否增值网点") @RequestParam(required = false) Boolean isIncre,
-            @ApiParam(value = "街道id") @RequestParam(required = false) String streetCode,
-            @ApiParam(value = "渠道") @RequestParam(required = false) String channelId,
-            @ApiParam(value = "产品大类") @RequestParam(required = false) String categoryId,
-            @ApiParam(value = "工单来源") @RequestParam(required = false) String orderSource,
-            @ApiParam(value = "工单类型") @RequestParam(required = false) String orderSmallId
-    ) {
-        List<AdminWebsitList> list = adminWebsitLogic.websitList(type, isAll, isIncre, status, streetCode, channelId, categoryId, orderSmallId, orderSource);
-        return ResponseHelper.success(list);
-    }
-
-    @GetMapping("/zone/list")
-    @ApiOperation("区域列表")
-    public ResponseHelper<AdminZone> zoneList() {
-        List<AdminZone> adminZones = adminWebsitLogic.adminZoneList();
-        return ResponseHelper.success(adminZones);
-    }
-
-    @PostMapping("/add")
-    @ApiOperation("新增部门")
-    public ResponseHelper add(@RequestBody AdminWebsitNewBean adminWebsit, HttpServletRequest request) throws RemoteServiceException, WxErrorException {
-        adminWebsitLogic.add(adminWebsit, request);
-        return ResponseHelper.success();
-    }
-
-    @PostMapping("/update")
-    @ApiOperation("修改部门")
-    public ResponseHelper update(@RequestBody AdminWebsitNewBean adminWebsit, HttpServletRequest request) throws RemoteServiceException, WxErrorException {
-        adminWebsitLogic.update(adminWebsit, request);
-        return ResponseHelper.success();
-    }
-
-    @PostMapping("/delete")
-    @ApiOperation("删除部门")
-    public ResponseHelper delete(@RequestParam String id, HttpServletRequest request) throws WxErrorException {
-        adminWebsitLogic.delete(id, request);
-        return ResponseHelper.success();
-    }
-
-    @GetMapping("/detail")
-    @ApiOperation("部门详情")
-    public ResponseHelper<AdminWebsitNewBean> detail(@RequestParam String id) {
-        AdminWebsitNewBean detail = adminWebsitLogic.detail(id);
-        return ResponseHelper.success(detail);
-    }
-
-    @PostMapping("/save/pay/config")
-    @ApiOperation("新增编辑网点支付配置")
-    public ResponseHelper savePayConfig(@RequestBody AdminWebsitPayConfig payConfig, HttpServletRequest request) throws RemoteServiceException {
-        adminWebsitLogic.savePayConfig(payConfig, request);
-        return ResponseHelper.success();
-    }
-
-    @PostMapping("/delete/pay/config")
-    @ApiOperation("删除网点支付配置")
-    public ResponseHelper deletePayConfig(@RequestParam String id, HttpServletRequest request) {
-        adminWebsitLogic.deletePayConfig(id, request);
-        return ResponseHelper.success();
-    }
-
-
-    @PostMapping("/pay/config/list")
-    @ApiOperation("网点支付配置列表")
-    public ResponseHelper<List<AdminWebsitPayConfig>> payConfigList(
-            @ApiParam(value = "网点编号") @RequestParam(required = false) String websitId,
-            @ApiParam(value = "类别 M=辅材 P=配件") @RequestParam(required = false) String type,
-            @ApiParam(value = "状态 true=开启 false=关闭") @RequestParam(required = false) Boolean status
-    ) {
-        List<AdminWebsitPayConfig> list = adminWebsitLogic.payConfigList(websitId, type, status);
-        return ResponseHelper.success(list);
-    }
-
-    @PostMapping("/import")
-    @ApiOperation(value = "网点管理-导入(下载模板:网点管理导入模板.xlsx)")
-    public ResponseHelper<String> importData(
-            @RequestPart("file") MultipartFile file
-    ) throws Exception {
-        adminWebsitLogic.importData(file);
-        return ResponseHelper.success();
-    }
-
-    @GetMapping("/export")
-    @ApiOperation(value = "网点管理-导出")
-    public void export(
-            HttpServletRequest request,
-            HttpServletResponse response
-    ) throws Exception {
-        ExcelData excelData = adminWebsitLogic.exportData();
-        ExcelUtils.exportExcel(request, response, "网点管理列表.xlsx", excelData);
-    }
-}

+ 0 - 202
mall-server-sync-api/src/main/java/com/gree/mall/manager/controller/big/BigController.java

@@ -1,202 +0,0 @@
-package com.gree.mall.manager.controller.big;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.gree.mall.manager.annotation.ApiNotAuth;
-import com.gree.mall.manager.bean.big.*;
-import com.gree.mall.manager.exception.RemoteServiceException;
-import com.gree.mall.manager.helper.ResponseHelper;
-import com.gree.mall.manager.logic.ExpressLogic;
-import com.gree.mall.manager.logic.big.BigLogic;
-import com.gree.mall.manager.logic.common.CommonLogic;
-import com.gree.mall.manager.logic.common.WechatLogic;
-import com.gree.mall.manager.logic.common.kuaidi100.response.SubscribeResp;
-import com.gree.mall.manager.plus.entity.*;
-import com.gree.mall.manager.plus.service.AdminCompanyWechatService;
-import com.gree.mall.manager.plus.service.OrderDetailService;
-import com.gree.mall.manager.plus.service.OrderInfoService;
-import com.gree.mall.manager.utils.CommonUtils;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import lombok.extern.slf4j.Slf4j;
-import me.chanjar.weixin.common.error.WxErrorException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.validation.constraints.NotBlank;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-
-@Slf4j
-@RestController
-@Api(value = "大屏API", tags ={"大屏API"} )
-@RequestMapping(value = "/big", produces = "application/json; charset=utf-8")
-public class BigController {
-
-    @Autowired
-    BigLogic bigLogic;
-
-
-
-    @ApiNotAuth
-    @ApiOperation("天气预报")
-    @GetMapping("/water/get")
-    public ResponseHelper<Map<String,Object>> getWater(
-            @ApiParam(value = "city",required = true) @RequestParam(required = true) String city
-    ){
-        Map<String, Object> water = bigLogic.getWater(city);
-        return ResponseHelper.success(water);
-    }
-
-
-
-    @PostMapping("/getRegion")
-    @ApiOperation(value = "获得区域坐标")
-    public ResponseHelper<String> getRegion(
-            @ApiParam(required = false, value = "国家") @RequestParam(required = false) String country,
-            @ApiParam(required = false, value = "省") @RequestParam(required = false) String province,
-            @ApiParam(required = false, value = "市") @RequestParam(required = false) String city,
-            @ApiParam(required = false, value = "区") @RequestParam(required = false) String area
-    ) throws IOException, RemoteServiceException {
-        String region = bigLogic.getRegion(country,province,city,area);
-        return ResponseHelper.success(region);
-    }
-
-
-
-    @PostMapping("/getLarge1")
-    @ApiOperation(value = "平台获得地图总数据")
-    public ResponseHelper<LargeOneBean> getLarge1(
-            @ApiParam(required = false, value = "省") @RequestParam(required = false) String province
-    ) throws IOException, RemoteServiceException {
-        LargeOneBean largeOneBean = bigLogic.getLarge1(province);
-        return ResponseHelper.success(largeOneBean);
-    }
-
-
-    @PostMapping("/getLarge2")
-    @ApiOperation(value = "商户获得地图总数据")
-    public ResponseHelper<LargeOneBean> getLarge2(
-    ) throws IOException, RemoteServiceException {
-        LargeOneBean largeOneBean = bigLogic.getLarge2();
-        return ResponseHelper.success(largeOneBean);
-    }
-
-
-    @PostMapping("/getLarge3")
-    @ApiOperation(value = "浏览量,访客量")
-    public ResponseHelper<List<largeSeeLogin>> getLarge3(
-    ) throws IOException, RemoteServiceException {
-        List<largeSeeLogin> largeOneBean = bigLogic.getLarge3();
-        return ResponseHelper.success(largeOneBean);
-    }
-
-
-
-    @PostMapping("/getLarge4")
-    @ApiOperation(value = "近30天辅配件统计")
-    public ResponseHelper<LargeMpBean> getLarge4(
-    ) throws IOException, RemoteServiceException {
-        LargeMpBean largeMpBean = bigLogic.getLarge4();
-        return ResponseHelper.success(largeMpBean);
-    }
-
-
-
-    @PostMapping("/getLarge5")
-    @ApiOperation(value = "近30天累计工单数量")
-    public ResponseHelper<LargeWorkerOrderBean> getLarge5(
-    ) throws IOException, RemoteServiceException {
-        LargeWorkerOrderBean largeMpBean = bigLogic.getLarge5();
-        return ResponseHelper.success(largeMpBean);
-    }
-
-
-    @PostMapping("/getLarge6")
-    @ApiOperation(value = "近30天工单趋势")
-    public ResponseHelper<List<LargeWorkerOrderDateBean>> getLarge6(
-    ) throws IOException, RemoteServiceException {
-        List<LargeWorkerOrderDateBean> largeMpBean = bigLogic.getLarge6();
-        return ResponseHelper.success(largeMpBean);
-    }
-
-
-
-    @PostMapping("/getLarge7")
-    @ApiOperation(value = "近30天累计订单统计")
-    public ResponseHelper<LargeOrderBean> getLarge7(
-    ) throws IOException, RemoteServiceException {
-        LargeOrderBean largeMpBean = bigLogic.getLarge7();
-        return ResponseHelper.success(largeMpBean);
-    }
-
-
-    @PostMapping("/getLarge8")
-    @ApiOperation(value = "近30天订单趋势")
-    public ResponseHelper<List<LargeOrderBean>> getLarge8(
-    ) throws IOException, RemoteServiceException {
-        List<LargeOrderBean> largeMpBean = bigLogic.getLarge8();
-        return ResponseHelper.success(largeMpBean);
-    }
-
-
-    @GetMapping("/list")
-    @ApiOperation(value = "商户街道完工数据")
-    public ResponseHelper<Page<LargeWorkerOrderList>> page(
-            HttpServletRequest request,
-            @ApiParam(value = "市",required = false) @RequestParam(required = false) String city,
-            @ApiParam(value = "省",required = false) @RequestParam(required = false) String province,
-            @ApiParam(value = "区",required = false) @RequestParam(required = false) String area,
-
-            @ApiParam(value = "页号",required = true) @RequestParam(required = true) Integer pageNum,
-            @ApiParam(value = "页大小",required = true) @RequestParam(required = true) Integer pageSize
-    ){
-        IPage<LargeWorkerOrderList> list = bigLogic.list(request,city, province,area, pageNum, pageSize);
-        return ResponseHelper.success(list);
-    }
-
-
-    @PostMapping("/getLarge9")
-    @ApiOperation(value = "数据省份获得")
-    public ResponseHelper<List<String>> getLarge9(
-    ) throws IOException, RemoteServiceException {
-        List<String> largeMpBean = bigLogic.getLarge9();
-        return ResponseHelper.success(largeMpBean);
-    }
-
-
-    @GetMapping("/getLarge10")
-    @ApiOperation(value = "区工单台数")
-    public ResponseHelper<List<LargeNumCity>> getLarge10(
-            HttpServletRequest request,
-            @ApiParam(value = "市",required = false) @RequestParam(required = false) String city,
-            @ApiParam(value = "省",required = false) @RequestParam(required = false) String province
-
-    ){
-        List<LargeNumCity> list = bigLogic.getLarge10(city, province);
-        return ResponseHelper.success(list);
-    }
-
-
-    @GetMapping("/getLarge11")
-    @ApiOperation(value = "市工单台数")
-    public ResponseHelper<LargeNumCity> getLarge11(
-            HttpServletRequest request,
-            @ApiParam(value = "市",required = false) @RequestParam(required = false) String city,
-            @ApiParam(value = "省",required = false) @RequestParam(required = false) String province
-
-    ){
-        LargeNumCity list = bigLogic.getLarge11(city, province);
-        return ResponseHelper.success(list);
-    }
-
-
-}

+ 0 - 14
mall-server-sync-api/src/main/java/com/gree/mall/manager/controller/big/ServiceClassController.java

@@ -1,14 +0,0 @@
-package com.gree.mall.manager.controller.big;
-
-import io.swagger.annotations.Api;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-@Slf4j
-@RestController
-@Api(value = "大屏服务类API", tags ={"大屏服务类API"} )
-@RequestMapping(value = "/big/service/class", produces = "application/json; charset=utf-8")
-public class ServiceClassController {
-
-}

+ 2 - 3
mall-server-sync-api/src/main/java/com/gree/mall/manager/logic/admin/AdminCompanyWechatLogic.java

@@ -51,8 +51,7 @@ public class AdminCompanyWechatLogic {
     WxConfiguration wxConfiguration;
     @Autowired
     private AdminUserLogic adminUserLogic;
-    @Autowired
-    AdminWebsitLogic adminWebsitLogic;
+
     @Autowired
     AdminCompanyWechatTemplateLogic adminCompanyWechatTemplateLogic;
     @Autowired
@@ -207,7 +206,7 @@ public class AdminCompanyWechatLogic {
         adminCompanyWechat.setSubAppId(adminCompanyWechat.getPubAppId());
         adminCompanyWechat.setSubSecret(adminCompanyWechat.getPubAppSecret());
         adminCompanyWechat.updateById();
-        adminWebsitLogic.reloadJoinCode(adminCompanyWechat.getCompanyWechatId(),adminCompanyWechat.getJoinCode());
+
         //刷新
         AdminCompanyWechat adminCompanyWechat1 = adminCompanyWechatService.getById(adminCompanyWechat.getCompanyWechatId());
         wxConfiguration.reloadWxConfig(Lists.newArrayList(adminCompanyWechat1));

+ 0 - 1237
mall-server-sync-api/src/main/java/com/gree/mall/manager/logic/admin/AdminWebsitLogic.java

@@ -1,1237 +0,0 @@
-package com.gree.mall.manager.logic.admin;
-
-import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.collection.CollectionUtil;
-import com.alibaba.excel.util.StringUtils;
-import com.baomidou.mybatisplus.core.toolkit.IdWorker;
-import com.gree.mall.manager.bean.ExcelData;
-import com.gree.mall.manager.bean.admin.AdminUserCom;
-import com.gree.mall.manager.bean.admin.AdminWebsitNewBean;
-import com.gree.mall.manager.bean.admin.AdminWebsitTree;
-import com.gree.mall.manager.bean.admin.reqDto.AdminUserAddReqBean;
-import com.gree.mall.manager.bean.workorder.AdminWebsitList;
-import com.gree.mall.manager.constant.Constant;
-import com.gree.mall.manager.enums.ExamineStatusEnum;
-import com.gree.mall.manager.enums.WebsitAttrEnum;
-import com.gree.mall.manager.enums.admin.AdminWebsitTypeEnum;
-import com.gree.mall.manager.enums.base.BaseEnum;
-import com.gree.mall.manager.enums.material.WebsitGoodsTypeEnum;
-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.CommonUtils;
-import com.gree.mall.manager.utils.StringUtil;
-import com.gree.mall.manager.utils.excel.ExcelUtils;
-import lombok.extern.slf4j.Slf4j;
-import me.chanjar.weixin.common.error.WxErrorException;
-import org.apache.commons.collections4.CollectionUtils;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import java.util.*;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-@Slf4j
-@Service
-public class AdminWebsitLogic {
-
-    //    @Autowired
-//    WorkWechatLogic workWechatLogic;
-    @Autowired
-    AdminWebsitService adminWebsitService;
-    @Autowired
-    AdminZoneService adminZoneService;
-    @Autowired
-    AdminUserWebsitRelaService adminUserWebsitRelaService;
-    @Autowired
-    AdminCompanyWechatService adminCompanyWechatService;
-    @Autowired
-    CommonLogic commonLogic;
-    @Autowired
-    StorageService storageService;
-    @Autowired
-    AdminWebsitPayConfigService adminWebsitPayConfigService;
-
-    @Autowired
-    AdminDeptService adminDeptService;
-
-    @Autowired
-    AdminDeptWebsitService adminDeptWebsitService;
-    @Resource
-    LbsAmapLogic lbsAmapLogic;
-    @Resource
-    AdminCompanyWechatPayConfigService adminCompanyWechatPayConfigService;
-    @Resource
-    WebsitUserService websitUserService;
-
-    @Autowired
-    WebsitDispatchService websitDispatchService;
-    @Resource
-    AdminUserLogic adminUserLogic;
-//    @Autowired
-//    EnterpriseWechatWorkerLogic enterpriseWechatWorkerLogic;
-    @Autowired
-    PgOrderBaseService pgOrderBaseService;
-    @Autowired
-    AdminUserService adminUserService;
-    @Autowired
-    AdminWebsitBakService adminWebsitBakService;
-    @Autowired
-    SysDictCompanyService sysDictCompanyService;
-    @Autowired
-    AdminRoleService adminRoleService;
-
-    /**
-     * 区域列表
-     */
-    public List<AdminZone> adminZoneList() {
-        List<AdminZone> list = adminZoneService.list();
-        return list;
-    }
-
-    /**
-     * 部门树
-     */
-    public List<AdminWebsitTree> tree(HttpServletRequest request) {
-        AdminUserCom adminUser = commonLogic.getAdminUser(request);
-
-        List<AdminWebsit> list = adminWebsitService.lambdaQuery()
-                .and(CollectionUtils.isNotEmpty(adminUser.getCompanyWechatIds()), v -> v.in(AdminWebsit::getCompanyWechatId, adminUser.getCompanyWechatIds()))
-                .list();
-        List<AdminWebsitTree> trees = new ArrayList<>();
-        for (AdminWebsit adminWebsit : list) {
-            AdminWebsitTree adminWebsitTree = new AdminWebsitTree();
-            BeanUtils.copyProperties(adminWebsit, adminWebsitTree);
-            trees.add(adminWebsitTree);
-        }
-        AdminUserWebsitRela one = adminUserWebsitRelaService.lambdaQuery()
-                .eq(AdminUserWebsitRela::getAdminUserId, adminUser.getAdminUserId()).last("limit 1").one();
-
-        List<AdminWebsitTree> parentList = trees.stream()
-                .filter(x -> (CollectionUtils.isEmpty(adminUser.getAdminWebsitIds()) && x.getParentId().equals("0")) ||
-                        (!CollectionUtils.isEmpty(adminUser.getAdminWebsitIds()) && adminUser.getAdminWebsitIds().contains(x.getWebsitId())
-
-                        ))
-                .collect(Collectors.toList());
-        if (CollectionUtils.isEmpty(parentList)) {
-            parentList = trees.stream().filter(x -> x.getParentId().equals("0")).collect(Collectors.toList());
-        }
-        if (parentList.stream().filter(item -> item.getParentId().equals("1")).count() > 0){
-            parentList = trees.stream().filter(x -> x.getParentId().equals("1")).collect(Collectors.toList());
-        }
-        for (AdminWebsitTree adminWebsit : parentList) {
-            adminWebsit.setChildren(this.treeModule(trees, adminWebsit.getWebsitId()));
-        }
-        return parentList;
-    }
-
-    public List<AdminWebsit> list(String attr,String websitId,String websitName,String type, Boolean isAll, Boolean isIncre, Boolean status, String streetCode, String channelId, String categoryId,
-                                  String orderSmallId, String orderSourceId, Boolean queryPartsWebsit, Integer level) {
-        AdminUserCom adminUser = commonLogic.getAdminUser();
-
-
-        List<String> websitIds = new ArrayList<>();
-        if (!StringUtil.isEmpty(streetCode)) {
-            websitIds = websitDispatchService.lambdaQuery()
-                    .eq(!StringUtil.isEmpty(adminUser.getCompanyWechatId()), WebsitDispatch::getCompanyWechatId, adminUser.getCompanyWechatId())
-                    .eq(!StringUtil.isEmpty(streetCode), WebsitDispatch::getStreetCode, streetCode)
-                    .eq(!StringUtil.isEmpty(channelId), WebsitDispatch::getDictCode, channelId)
-                    .eq(!StringUtil.isEmpty(categoryId), WebsitDispatch::getCategoryId, categoryId)
-                    .eq(!StringUtil.isEmpty(orderSmallId), WebsitDispatch::getOrderSmallId, orderSmallId)
-                    .eq(!StringUtil.isEmpty(orderSourceId), WebsitDispatch::getOrderSource, orderSourceId)
-                    .like(!StringUtil.isEmpty(websitId), WebsitDispatch::getWebsitId, websitId)
-                    .like(!StringUtil.isEmpty(websitName), WebsitDispatch::getWebsitName, websitName)
-                    .list().stream().map(WebsitDispatch::getWebsitId).collect(Collectors.toList());
-        }
-
-
-        List<AdminWebsit> list = adminWebsitService.lambdaQuery()
-                .eq(Objects.nonNull(level), AdminWebsit::getLevel, level)
-                .eq(StringUtils.isNotBlank(type), AdminWebsit::getType, type)
-                .in(StringUtils.isNotBlank(streetCode) && !CollectionUtils.isEmpty(websitIds), AdminWebsit::getWebsitId, websitIds)
-                .eq(isIncre != null, AdminWebsit::getIsIncre, isIncre)
-                .eq(status != null, AdminWebsit::getStatus, status)
-                .like(!StringUtil.isEmpty(websitId), AdminWebsit::getWebsitId, websitId)
-                .like(!StringUtil.isEmpty(websitName), AdminWebsit::getName, websitName)
-                .eq(!StringUtil.isEmpty(attr), AdminWebsit::getAttr, attr)
-                .in(CollectionUtils.isNotEmpty(adminUser.getAdminWebsitIds()) && (isAll == null || !isAll),
-                        AdminWebsit::getWebsitId, adminUser.getAdminWebsitIds())
-                .in(CollectionUtils.isNotEmpty(adminUser.getCompanyWechatIds()), AdminWebsit::getCompanyWechatId, adminUser.getCompanyWechatIds())
-                .and(Objects.nonNull(queryPartsWebsit) && queryPartsWebsit, v -> v.isNotNull(AdminWebsit::getPartsWebsitId)
-                        .or()
-                        .ne(AdminWebsit::getPartsWebsitId, ""))
-                .list();
-        return list;
-    }
-
-
-    /**
-     * 新增部门
-     */
-    @Transactional
-    public void add(AdminWebsitNewBean adminWebsit, HttpServletRequest request) throws WxErrorException, RemoteServiceException {
-        AdminUserCom adminUser = commonLogic.getAdminUser(request);
-
-        AdminWebsit parent = adminWebsitService.getById(adminWebsit.getParentId());
-        if (Objects.isNull(parent)) {
-            throw new RemoteServiceException("请选择上级");
-        }
-        if (parent.getType().equals(AdminWebsitTypeEnum.A.getKey()) && adminUser.getType() != 2) {
-            throw new RemoteServiceException("非平台账号不能创建商户");
-        }
-        if (parent.getType().equals(AdminWebsitTypeEnum.B.getKey()) && adminUser.getType() == 0) {
-            throw new RemoteServiceException("网点账号不能创建网点");
-        }
-//        if(StringUtils.isNotBlank(parent.getCompanyWechatId())) {
-//            //最多3个部门
-//            final int max = 3;
-//            Integer count1 = adminWebsitService.lambdaQuery()
-//                    .eq(AdminWebsit::getCompanyWechatId, parent.getCompanyWechatId())
-//                    .eq(AdminWebsit::getType, AdminWebsitTypeEnum.C.getKey()).count();
-//            if(count1 >= max){
-//                throw new RemoteServiceException("创建网点数量已达上限3,请联系相关人员");
-//            }
-//        }
-
-        adminWebsit.setCompanyWechatId(parent.getCompanyWechatId());
-        adminWebsit.setCompanyWechatName(parent.getCompanyWechatName());
-
-        adminWebsit.setType(AdminWebsitTypeEnum.C.getKey());
-        if (parent.getType().equals(AdminWebsitTypeEnum.A.getKey())) {
-            adminWebsit.setType(AdminWebsitTypeEnum.B.getKey());
-            adminWebsit.setWebsitId(IdWorker.getIdStr());
-        } else if (parent.getType().equals(AdminWebsitTypeEnum.B.getKey())
-                && org.apache.commons.lang3.StringUtils.isBlank(adminWebsit.getWebsitId())) {
-            String websitId = commonLogic.getIncrKeyValue(adminWebsit.getCompanyWechatId(), "WEBSIT_ID", "A",6);
-            adminWebsit.setWebsitId(websitId);
-        }
-
-        if (adminUser.getType() == 2 && adminWebsit.getType().equals(AdminWebsitTypeEnum.C.getKey())) {
-            throw new RemoteServiceException("平台账号不能创建网点");
-        }
-
-        this.checkWebsitIdAndName(adminWebsit, adminUser, true);
-
-        if (adminWebsit.getType().equals(AdminWebsitTypeEnum.C.getKey())
-                && adminWebsit.getIsUseAllinpay()
-                && CollectionUtil.isEmpty(adminWebsit.getPayConfigList())) {
-            throw new RemoteServiceException("支付配置不能为空");
-        }
-
-        adminWebsit.setWebsitNumber(adminWebsit.getWebsitId());
-        adminWebsit.insert();
-
-        if (adminWebsit.getIsUseAllinpay()
-                && CollectionUtil.isNotEmpty(adminWebsit.getPayConfigList())) {
-            for (int i = 0; i < adminWebsit.getPayConfigList().size(); i++) {
-                AdminWebsitPayConfig payConfig = adminWebsit.getPayConfigList().get(i);
-                if (org.apache.commons.lang3.StringUtils.isBlank(payConfig.getName())) {
-                    throw new RemoteServiceException("第" + (i + 1) + "行, 商户名称不能为空");
-                }
-                if (org.apache.commons.lang3.StringUtils.isBlank(payConfig.getType())) {
-                    throw new RemoteServiceException("第" + (i + 1) + "行, 请选择类别");
-                }
-                if (org.apache.commons.lang3.StringUtils.isBlank(payConfig.getMchNo())) {
-                    throw new RemoteServiceException("第" + (i + 1) + "行, 通联商户号不能为空");
-                }
-                if (org.apache.commons.lang3.StringUtils.isBlank(payConfig.getAppid())) {
-                    throw new RemoteServiceException("第" + (i + 1) + "行, 通联商户appid不能为空");
-                }
-                payConfig.setCompanyWechatId(adminWebsit.getCompanyWechatId())
-                        .setCompanyWechatName(adminWebsit.getCompanyWechatName())
-                        .setWebsitId(adminWebsit.getWebsitId());
-            }
-            adminWebsitPayConfigService.saveBatch(adminWebsit.getPayConfigList());
-        }
-
-        reloadJoinCode(adminWebsit.getCompanyWechatId(), adminWebsit.getJoinCode());
-
-        // 初始化辅材配件默认仓
-        initMaterialStorage(adminUser, adminWebsit);
-
-
-        AdminDept adminDept = adminDeptService.lambdaQuery().eq(AdminDept::getCompanyWechatId, adminWebsit.getCompanyWechatId())
-                .eq(AdminDept::getPId, "1").last("limit 1").one();
-        AdminDeptWebsit adminDeptWebsit = new AdminDeptWebsit();
-        adminDeptWebsit.setAdminDeptId(adminDept.getAdminDeptId());
-        adminDeptWebsit.setWebsitId(adminWebsit.getWebsitId());
-        adminDeptWebsit.setWebsitName(adminWebsit.getName());
-        adminDeptWebsit.setDeptName(adminDept.getDeptName());
-        adminDeptWebsit.insert();
-
-        // 网点新增账号
-        if (adminWebsit.getType().equals(AdminWebsitTypeEnum.C.getKey()))
-            this.addAdminUser(adminWebsit);
-    }
-
-    private void addAdminUser(AdminWebsitNewBean adminWebsit) {
-        AdminUserAddReqBean adminUser = new AdminUserAddReqBean();
-
-        final AdminRole adminRole = adminRoleService.lambdaQuery()
-                .eq(AdminRole::getCompanyWechatId, adminWebsit.getCompanyWechatId())
-                .eq(AdminRole::getLevel, adminWebsit.getLevel())
-                .eq(AdminRole::getType, 1)
-                .last("limit 1")
-                .one();
-
-        if (Objects.isNull(adminRole)) {
-            throw new RemoteServiceException("创建主账号失败, 未找到等级的角色");
-        }
-
-        adminUser.setCompanyWechatId(adminWebsit.getCompanyWechatId())
-                .setCompanyName(adminWebsit.getCompanyWechatName())
-                .setUserName(adminWebsit.getWebsitId() + "01")
-                .setNickName(adminWebsit.getName())
-                .setRoleId(adminRole.getAdminRoleId())
-                .setPassword(adminWebsit.getLegalMobile())
-                .setPubNotice(true)
-                .setIsVender(false)
-                .setType(0)
-                .setLinkPhone(adminWebsit.getLinkMobile());
-        adminUser.setAdminWebsitId(Collections.singletonList(adminWebsit.getWebsitId()));
-        adminUserLogic.add(adminUser, false, true);
-    }
-
-    private void initMaterialStorage(AdminUserCom adminUser, AdminWebsit adminWebsit) {
-        if (!adminWebsit.getType().equals(AdminWebsitTypeEnum.C.getKey())) {
-            return;
-        }
-        Storage storage = storageService.lambdaQuery()
-                .eq(Storage::getCompanyWechatId, adminWebsit.getCompanyWechatId())
-                .eq(Storage::getWebsitId, adminWebsit.getWebsitId())
-                .eq(Storage::getType, "辅材,配件")
-                .eq(Storage::getIsDefault, true)
-                .last("limit 1")
-                .one();
-
-        if (Objects.isNull(storage)) {
-            storage = new Storage();
-            storage.setCompanyWechatId(adminWebsit.getCompanyWechatId())
-                    .setCompanyName(adminWebsit.getCompanyWechatName())
-                    .setWebsitId(adminWebsit.getWebsitId())
-                    .setWebsitName(adminWebsit.getName())
-                    .setStorageName("辅材,配件默认仓")
-                    .setType("辅材,配件")
-                    .setStatus(true)
-                    .setIsDefault(true)
-                    .insert();
-        }
-    }
-
-    private void checkWebsitIdAndName(AdminWebsitNewBean adminWebsit, AdminUserCom adminUser, boolean isAdd) {
-        if (adminWebsit.getType().equals(AdminWebsitTypeEnum.C.getKey()) && isAdd) {
-            if (org.apache.commons.lang3.StringUtils.isBlank(adminWebsit.getWebsitId())) {
-                throw new RemoteServiceException("网点编号不能为空");
-            }
-
-            Integer existCount = adminWebsitService.lambdaQuery()
-                    .eq(StringUtils.isNotBlank(adminUser.getCompanyWechatId()), AdminWebsit::getCompanyWechatId, adminUser.getCompanyWechatId())
-                    .eq(AdminWebsit::getWebsitId, adminWebsit.getWebsitId())
-                    .count();
-
-            if (existCount > 0) {
-                throw new RemoteServiceException("网点编号已存在");
-            }
-        }
-
-        Integer count = adminWebsitService.lambdaQuery()
-                .ne(org.apache.commons.lang3.StringUtils.isNotBlank(adminWebsit.getWebsitId()), AdminWebsit::getWebsitId, adminWebsit.getWebsitId())
-                .eq(StringUtils.isNotBlank(adminUser.getCompanyWechatId()), AdminWebsit::getCompanyWechatId, adminUser.getCompanyWechatId())
-                .eq(AdminWebsit::getName, adminWebsit.getName())
-                .count();
-
-        if (count > 0) {
-            throw new RemoteServiceException("名称已存在");
-        }
-
-        if (adminWebsit.getType().equals(AdminWebsitTypeEnum.C.getKey())) {
-            if (org.apache.commons.lang3.StringUtils.isBlank(adminWebsit.getBelongCompanyCode())) {
-                throw new RemoteServiceException("所属公司不能为空");
-            }
-            final SysDictCompany dictCompany = sysDictCompanyService.lambdaQuery()
-                    .eq(SysDictCompany::getCompanyWechatId, adminWebsit.getCompanyWechatId())
-                    .eq(SysDictCompany::getDictType, "BELONG_COMPANY")
-                    .eq(SysDictCompany::getDictCode, adminWebsit.getBelongCompanyCode())
-                    .one();
-            if (Objects.isNull(dictCompany)) {
-                throw new RemoteServiceException("所属公司不存在");
-            }
-            adminWebsit.setBelongCompany(dictCompany.getDictValue());
-
-            if (org.apache.commons.lang3.StringUtils.isBlank(adminWebsit.getAttr())) {
-                throw new RemoteServiceException("网点属性不能为空");
-            }
-
-            if (Objects.isNull(adminWebsit.getLevel())) {
-                throw new RemoteServiceException("级别不能为空");
-            }
-
-            if (adminWebsit.getAttr().equals(WebsitAttrEnum.SELF.getKey())
-                    && org.apache.commons.lang3.StringUtils.isBlank(adminWebsit.getPayInsureCodeId())) {
-                throw new RemoteServiceException("保险支付商户不能为空");
-            }
-
-            if (org.apache.commons.lang3.StringUtils.isBlank(adminWebsit.getInsureType())) {
-                throw new RemoteServiceException("保险类型不能为空");
-            }
-
-            if (!adminWebsit.getInsureType().contains("意外险")) {
-                throw new RemoteServiceException("意外险不能为空");
-            }
-
-            if (!adminWebsit.getInsureType().contains("雇主险")) {
-                if (!adminWebsit.getInsureType().contains("工伤险")) {
-                    throw new RemoteServiceException("雇主险,工伤险必选一个");
-                }
-            }
-
-            if (!adminWebsit.getAttr().equals(WebsitAttrEnum.SELF.getKey()) && adminWebsit.getInsureType().contains("工伤险")) {
-                throw new RemoteServiceException("第三方网点是只有意外+雇主险");
-            }
-
-            if (adminWebsit.getInsureType().contains("工伤险")
-                    && org.apache.commons.lang3.StringUtils.isBlank(adminWebsit.getInsureSteadUnit())) {
-                throw new RemoteServiceException("工伤险代买单位不能为空");
-            }
-
-            if (org.apache.commons.lang3.StringUtils.isBlank(adminWebsit.getLegalName())) {
-                throw new RemoteServiceException("企业法人不能为空");
-            }
-
-            if (org.apache.commons.lang3.StringUtils.isBlank(adminWebsit.getLegalMobile())) {
-                throw new RemoteServiceException("法人手机不能为空");
-            }
-
-            if (org.apache.commons.lang3.StringUtils.isBlank(adminWebsit.getLegalIdCard())) {
-                throw new RemoteServiceException("法人身份证不能为空");
-            }
-
-            if (org.apache.commons.lang3.StringUtils.isBlank(adminWebsit.getWebsitPhone())) {
-                throw new RemoteServiceException("办公电话不能为空");
-            }
-
-            if (org.apache.commons.lang3.StringUtils.isBlank(adminWebsit.getAddress())) {
-                throw new RemoteServiceException("地址不能为空");
-            }
-
-            if (org.apache.commons.lang3.StringUtils.isBlank(adminWebsit.getOpenBank())) {
-                throw new RemoteServiceException("开户银行不能为空");
-            }
-
-            if (org.apache.commons.lang3.StringUtils.isBlank(adminWebsit.getBankAccount())) {
-                throw new RemoteServiceException("银行账号不能为空");
-            }
-
-            if (org.apache.commons.lang3.StringUtils.isBlank(adminWebsit.getEmail())) {
-                throw new RemoteServiceException("电子邮箱不能为空");
-            }
-        }
-
-    }
-
-    /**
-     * 编辑部门
-     */
-    @Transactional
-    public void update(AdminWebsitNewBean adminWebsit, HttpServletRequest request) throws RemoteServiceException, WxErrorException {
-
-        AdminUserCom adminUser = commonLogic.getAdminUser(request);
-
-//        Integer count = adminWebsitService.lambdaQuery()
-//                .ne(AdminWebsit::getWebsitId, adminWebsit.getWebsitId())
-//                .eq(StringUtils.isNotBlank(adminUser.getCompanyWechatId()), AdminWebsit::getCompanyWechatId, adminUser.getCompanyWechatId())
-//                .eq(AdminWebsit::getName, adminWebsit.getName())
-//                .count();
-//        if (count > 0) {
-//            throw new RemoteServiceException("名称已存在");
-//        }
-        if (adminWebsit.getParentId().equals("0")) {
-            throw new RemoteServiceException("请选择上级");
-        }
-        AdminWebsit parent = adminWebsitService.getById(adminWebsit.getParentId());
-        if (Objects.isNull(parent)) {
-            throw new RemoteServiceException("请选择上级");
-        }
-        if (parent.getType().equals(AdminWebsitTypeEnum.A.getKey()) && adminUser.getType() != 2) {
-            throw new RemoteServiceException("非平台账号不能创建商户");
-        }
-        if (parent.getType().equals(AdminWebsitTypeEnum.B.getKey()) && adminUser.getType() == 0) {
-            throw new RemoteServiceException("网点账号不能创建网点");
-        }
-        if (StringUtils.equals(adminWebsit.getWebsitId(), adminWebsit.getParentId())) {
-            throw new RemoteServiceException("上级不允许为自己");
-        }
-        if (parent.getType().equals(AdminWebsitTypeEnum.A.getKey())) {
-            adminWebsit.setType(AdminWebsitTypeEnum.B.getKey());
-        } else if (parent.getType().equals(AdminWebsitTypeEnum.B.getKey())) {
-            adminWebsit.setType(AdminWebsitTypeEnum.C.getKey());
-        }
-        adminWebsit.setCompanyWechatId(parent.getCompanyWechatId());
-        adminWebsit.setCompanyWechatName(parent.getCompanyWechatName());
-
-        this.checkWebsitIdAndName(adminWebsit, adminUser, false);
-
-        if (adminUser.getType().equals(0)) {
-            // 网点仅可改联系人、联系电话、地址信息,其他字段都不允许修改,只能由商户账号才有权限修改
-            AdminWebsit websit = new AdminWebsit();
-            websit.setWebsitId(adminWebsit.getWebsitId())
-                    .setLinkName(adminWebsit.getLinkName())
-                    .setLinkMobile(adminWebsit.getLinkMobile())
-                    .setWebsitPhone(adminWebsit.getWebsitPhone())
-                    .setLegalName(adminWebsit.getLegalName())
-                    .setLegalMobile(adminWebsit.getLegalMobile())
-                    .setLegalIdCard(adminWebsit.getLegalIdCard())
-                    .setOpenBank(adminWebsit.getOpenBank())
-                    .setBankAccount(adminWebsit.getBankAccount())
-                    .setEmail(adminWebsit.getEmail())
-                    .setAddress(adminWebsit.getAddress());
-            websit.updateById();
-        } else {
-            adminWebsit.updateById();
-        }
-
-        adminDeptWebsitService.lambdaUpdate().eq(AdminDeptWebsit::getWebsitId, adminWebsit.getWebsitId())
-                .set(AdminDeptWebsit::getWebsitName, adminWebsit.getName()).update();
-
-        AdminWebsit old = adminWebsitService.getById(adminWebsit.getWebsitId());
-        //workWechatLogic.updateOrganization(adminWebsit.getWebsitId(),adminWebsit.getName(),adminWebsit.getParentId(),adminUser.getAdminCompanyWechat());
-        if (old.getType().equals(AdminWebsitTypeEnum.B.getKey())) {
-            adminCompanyWechatService.lambdaUpdate()
-                    .set(AdminCompanyWechat::getLinkPhone, adminWebsit.getWebsitPhone())
-                    .eq(AdminCompanyWechat::getCompanyWechatId, old.getCompanyWechatId()).update();
-        }
-        //刷新成员部门名称
-//        enterpriseWechatWorkerLogic.reloadEnterpriseWechatName(adminWebsit,request);
-        reloadJoinCode(old.getCompanyWechatId(), adminWebsit.getJoinCode());
-
-
-    }
-
-    /**
-     * 删除部门
-     */
-    @Transactional
-    public void delete(String websitId, HttpServletRequest request) throws WxErrorException {
-        Integer count = adminWebsitService.lambdaQuery().eq(AdminWebsit::getParentId, websitId).count();
-        if (count > 0) {
-            throw new RemoteServiceException("当前部门存在子级,删除失败");
-        }
-        final Integer existOrderCount = pgOrderBaseService.lambdaQuery()
-                .eq(PgOrderBase::getWebsitId, websitId)
-                .count();
-        if (existOrderCount > 0) {
-            throw new RemoteServiceException("当前网点已存在关联的工单,删除失败");
-        }
-        AdminUserCom adminUser = commonLogic.getAdminUser(request);
-        final AdminWebsit adminWebsit = adminWebsitService.getById(websitId);
-        // 普通网点连带删除辅材配件仓
-        if (adminWebsit.getType().equals(AdminWebsitTypeEnum.C.getKey())) {
-            storageService.lambdaUpdate()
-                    .eq(Storage::getCompanyWechatId, adminWebsit.getCompanyWechatId())
-                    .eq(Storage::getWebsitId, adminWebsit.getWebsitId())
-                    .remove();
-        }
-
-        //递归删除
-        List<AdminWebsit> list = new ArrayList<>();
-        list.addAll(commonLogic.queryAllChild(list, websitId));
-        List<String> ids = list.stream().map(AdminWebsit::getWebsitId).collect(Collectors.toList());
-        ids.add(websitId);
-        if (ids.size() > 0) {
-//            for(String idd : ids){
-//                workWechatLogic.deleteOrganization(idd,adminUser.getAdminCompanyWechat());
-//            }
-            for (String id : ids) {
-                List<AdminUserWebsitRela> relaList = adminUserWebsitRelaService.lambdaQuery()
-                        .eq(AdminUserWebsitRela::getCompanyWechatId, adminWebsit.getCompanyWechatId())
-                        .eq(AdminUserWebsitRela::getAdminWebsitId, id)
-                        .list();
-
-                adminUserService.lambdaUpdate()
-                        .eq(AdminUser::getCompanyWechatId, adminWebsit.getCompanyWechatId())
-                        .in(AdminUser::getAdminUserId, relaList.stream().map(AdminUserWebsitRela::getAdminUserId).collect(Collectors.toList()))
-                        .remove();
-
-                adminUserWebsitRelaService.lambdaUpdate()
-                        .eq(AdminUserWebsitRela::getCompanyWechatId, adminWebsit.getCompanyWechatId())
-                        .eq(AdminUserWebsitRela::getAdminWebsitId, id)
-                        .remove();
-
-                adminWebsitPayConfigService.lambdaUpdate()
-                        .eq(AdminWebsitPayConfig::getCompanyWechatId, adminWebsit.getCompanyWechatId())
-                        .eq(AdminWebsitPayConfig::getWebsitId, id)
-                        .remove();
-            }
-            // 备份删除的网点
-            final List<AdminWebsitBak> websitBaks = BeanUtil.copyToList(list, AdminWebsitBak.class);
-            if (CollectionUtil.isNotEmpty(websitBaks)) {
-                adminWebsitBakService.saveBatch(websitBaks);
-            }
-
-            adminWebsitService.lambdaUpdate().in(AdminWebsit::getWebsitId, ids).remove();
-        }
-
-        // 删除子级普通网点辅材配件仓
-        final List<String> materialWebsitList = list.stream()
-                .filter(v -> v.getType().equals(AdminWebsitTypeEnum.C.getKey()))
-                .map(AdminWebsit::getWebsitId)
-                .collect(Collectors.toList());
-        if (CollectionUtil.isNotEmpty(materialWebsitList)) {
-            storageService.lambdaUpdate()
-                    .eq(Storage::getCompanyWechatId, adminWebsit.getCompanyWechatId())
-                    .in(Storage::getWebsitId, materialWebsitList)
-                    .remove();
-
-            websitUserService.lambdaUpdate()
-                    .set(WebsitUser::getExamineStatus, ExamineStatusEnum.FAIL.getKey())
-                    .set(WebsitUser::getExamineRemark, "网点已删除")
-                    .in(WebsitUser::getWebsitId, materialWebsitList)
-                    .update();
-        }
-
-        adminDeptWebsitService.lambdaUpdate().in(AdminDeptWebsit::getWebsitId, ids).remove();
-
-    }
-
-    /**
-     * 详情
-     *
-     * @param id
-     */
-    public AdminWebsitNewBean detail(String id) {
-        AdminWebsit adminWebsit = adminWebsitService.getById(id);
-        AdminWebsitNewBean bean = new AdminWebsitNewBean();
-        BeanUtils.copyProperties(adminWebsit, bean);
-        if (bean.getIsUseAllinpay() && bean.getType().equals(AdminWebsitTypeEnum.C.getKey())) {
-            final List<AdminWebsitPayConfig> payConfigList = adminWebsitPayConfigService.lambdaQuery()
-                    .eq(AdminWebsitPayConfig::getWebsitId, bean.getWebsitId())
-                    .list();
-            bean.setPayConfigList(payConfigList);
-        }
-        return bean;
-    }
-
-    /**
-     * 刷新之后关联条码
-     */
-    @Transactional
-    public void reloadJoinCode(String companyWechatId, String joinCode) {
-        if (StringUtils.isBlank(companyWechatId) || joinCode == null) {
-            return;
-        }
-        adminWebsitService.lambdaUpdate()
-                .set(AdminWebsit::getJoinCode, joinCode)
-                .eq(AdminWebsit::getCompanyWechatId, companyWechatId).update();
-
-        adminCompanyWechatService.lambdaUpdate()
-                .set(AdminCompanyWechat::getJoinCode, joinCode)
-                .eq(AdminCompanyWechat::getCompanyWechatId, companyWechatId).update();
-
-    }
-
-
-    /**
-     * 递归组装数据
-     *
-     * @param list
-     * @param parentId
-     * @return
-     */
-    private List<AdminWebsitTree> treeModule(List<AdminWebsitTree> list, String parentId) {
-        //最父级资源树
-        if (parentId == null || parentId.equals("0")) {
-            return null;
-        }
-        List<AdminWebsitTree> collect = list.stream()
-                .filter(e -> e.getParentId().equals(parentId)).collect(Collectors.toList());
-        if (collect.size() == 0) {
-            return null;
-        }
-        for (AdminWebsitTree bean : collect) {
-            bean.setChildren(this.treeModule(list, bean.getWebsitId()));
-        }
-        return collect;
-    }
-
-    public void savePayConfig(AdminWebsitPayConfig payConfig, HttpServletRequest request) {
-        if (org.apache.commons.lang3.StringUtils.isBlank(payConfig.getCompanyWechatId())) {
-            throw new RemoteServiceException("商户信息不能为空");
-        }
-        if (org.apache.commons.lang3.StringUtils.isBlank(payConfig.getCompanyWechatName())) {
-            throw new RemoteServiceException("商户信息不能为空");
-        }
-        if (org.apache.commons.lang3.StringUtils.isBlank(payConfig.getWebsitId())) {
-            throw new RemoteServiceException("网点编号不能为空");
-        }
-        if (org.apache.commons.lang3.StringUtils.isBlank(payConfig.getName())) {
-            throw new RemoteServiceException("商户名称不能为空");
-        }
-        if (org.apache.commons.lang3.StringUtils.isBlank(payConfig.getType())) {
-            throw new RemoteServiceException("请选择类别");
-        }
-        if (org.apache.commons.lang3.StringUtils.isBlank(payConfig.getMchNo())) {
-            throw new RemoteServiceException("通联商户号不能为空");
-        }
-        if (org.apache.commons.lang3.StringUtils.isBlank(payConfig.getAppid())) {
-            throw new RemoteServiceException("通联商户appid不能为空");
-        }
-
-        AdminWebsit adminWebsit = adminWebsitService.getById(payConfig.getWebsitId());
-        if (!adminWebsit.getIsUseAllinpay()) {
-            adminWebsit.setIsUseAllinpay(true)
-                    .updateById();
-        }
-
-        payConfig.insertOrUpdate();
-    }
-
-    public void deletePayConfig(String id, HttpServletRequest request) {
-        adminWebsitPayConfigService.removeById(id);
-    }
-
-    public List<AdminWebsitPayConfig> payConfigList(String websitId, String type, Boolean status) {
-        final AdminUserCom adminUser = commonLogic.getAdminUser();
-        if (Objects.isNull(adminUser.getAdminCompanyWechat())) {
-            throw new RemoteServiceException("请使用商户账号发现支付");
-        }
-        return adminWebsitPayConfigService.lambdaQuery()
-                .eq(AdminWebsitPayConfig::getCompanyWechatId, adminUser.getAdminCompanyWechat().getCompanyWechatId())
-                .eq(StringUtils.isNotBlank(websitId), AdminWebsitPayConfig::getWebsitId, websitId)
-                .eq(StringUtils.isNotBlank(type), AdminWebsitPayConfig::getType, type)
-                .eq(Objects.nonNull(status), AdminWebsitPayConfig::getStatus, status)
-                .list();
-    }
-
-    @Transactional
-    public void importData(MultipartFile file) throws Exception {
-        AdminUserCom adminUser = commonLogic.getAdminUser();
-
-        String companyWechatId = Objects.nonNull(adminUser.getAdminCompanyWechat()) ? adminUser.getAdminCompanyWechat().getCompanyWechatId() : null;
-        String companyName = Objects.nonNull(adminUser.getAdminCompanyWechat()) ? adminUser.getAdminCompanyWechat().getCompanyName() : null;
-
-        if (org.apache.commons.lang3.StringUtils.isBlank(companyWechatId)) {
-            throw new RemoteServiceException("商户编号缺失,导入中止");
-        }
-
-        final AdminWebsit parentWebsit = adminWebsitService.lambdaQuery()
-                .eq(AdminWebsit::getCompanyWechatId, companyWechatId)
-                .eq(AdminWebsit::getType, AdminWebsitTypeEnum.B.getKey())
-                .last("limit 1")
-                .one();
-
-        if (Objects.isNull(parentWebsit)) {
-            throw new RemoteServiceException("未发现上级");
-        }
-
-        List<Object> objects = ExcelUtils.importExcel(file);
-
-        List<AdminWebsit> adminWebsitList = new ArrayList<>();
-        List<AdminWebsitPayConfig> allPayConfigList = new ArrayList<>();
-        for (int i = 0; i < objects.size(); i++) {
-            int rowIndex = i + 2;
-            List<Object> row = (List<Object>) objects.get(i);
-            CommonUtils.initList2(row, 42);
-
-            if (Objects.isNull(row.get(0)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(0).toString())) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 所属公司不能为空");
-            }
-            if (Objects.isNull(row.get(1)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(1).toString())) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 网点编号不能为空");
-            }
-            if (Objects.isNull(row.get(2)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(2).toString())) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 网点名称不能为空");
-            }
-            if (Objects.isNull(row.get(3)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(3).toString())) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 网点属性不能为空");
-            }
-            if (Objects.isNull(row.get(4)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(4).toString())) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 网点级别不能为空");
-            }
-            if (Objects.isNull(row.get(5)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(5).toString())) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 企业法人不能为空");
-            }
-            if (Objects.isNull(row.get(6)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(6).toString())) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 法人手机不能为空");
-            }
-            if (Objects.isNull(row.get(7)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(7).toString())) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 法人身份证不能为空");
-            }
-            if (Objects.isNull(row.get(8)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(8).toString())) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 联系人不能为空");
-            }
-            if (Objects.isNull(row.get(9)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(9).toString())) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 联系电话不能为空");
-            }
-            if (Objects.isNull(row.get(10)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(10).toString())) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 详细地址不能为空");
-            }
-            if (Objects.isNull(row.get(11)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(11).toString())) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 电子支付商户不能为空");
-            }
-            if (Objects.isNull(row.get(12)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(12).toString())) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 保险类型不能为空");
-            }
-            if (Objects.isNull(row.get(15)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(15).toString())) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 状态不能为空");
-            }
-            if (Objects.isNull(row.get(16)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(16).toString())) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 办公电话不能为空");
-            }
-            if (Objects.isNull(row.get(17)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(17).toString())) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 开户银行不能为空");
-            }
-            if (Objects.isNull(row.get(18)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(18).toString())) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 银行账号不能为空");
-            }
-            if (Objects.isNull(row.get(19)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(19).toString())) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 邮箱不能为空");
-            }
-            if (Objects.isNull(row.get(20)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(20).toString())) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 通联支付开关不能为空");
-            }
-
-            String belongCompanyName = row.get(0).toString().trim();
-            final SysDictCompany belongCompany = sysDictCompanyService.lambdaQuery()
-                    .eq(SysDictCompany::getCompanyWechatId, adminUser.getCompanyWechatId())
-                    .eq(SysDictCompany::getDictType, "BELONG_COMPANY")
-                    .eq(SysDictCompany::getDictValue, belongCompanyName)
-                    .one();
-            if (Objects.isNull(belongCompany)) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 所属公司不存在");
-            }
-
-            String websitName = row.get(2).toString().trim();
-            final Integer existNameCount = adminWebsitService.lambdaQuery()
-                    .eq(AdminWebsit::getName, websitName)
-                    .count();
-            if (existNameCount > 0) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 网点名称已重复存在");
-            }
-            String address = row.get(10).toString().trim();
-            String lnglat = lbsAmapLogic.getLocationByAddress(address);
-
-            String payName = row.get(11).toString().trim();
-            final AdminCompanyWechatPayConfig wechatPayConfig = adminCompanyWechatPayConfigService.lambdaQuery()
-                    .eq(AdminCompanyWechatPayConfig::getPayMerchantName, payName)
-                    .like(AdminCompanyWechatPayConfig::getAttr, Constant.COMPANY_PAY_CONFIG_1)
-                    .one();
-            if (Objects.isNull(wechatPayConfig)) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 电子支付商户不存在");
-            }
-
-            final String attrName =row.get(3).toString().trim();
-            final WebsitAttrEnum websitAttrEnum = BaseEnum.valueToEnumDefault(WebsitAttrEnum.class, attrName, WebsitAttrEnum.SELF);
-            String insurePayConfigId = null;
-            if (websitAttrEnum.getKey().equals(WebsitAttrEnum.SELF.getKey())) {
-                if (Objects.isNull(row.get(13)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(13).toString())) {
-                    throw new RemoteServiceException("第" + rowIndex + "行, 保险支付商户号不能为空");
-                }
-                String insurePayName = row.get(13).toString().trim();
-                final AdminCompanyWechatPayConfig insurePayConfig = adminCompanyWechatPayConfigService.lambdaQuery()
-                        .eq(AdminCompanyWechatPayConfig::getPayMerchantName, insurePayName)
-                        .like(AdminCompanyWechatPayConfig::getAttr, Constant.COMPANY_PAY_CONFIG_2)
-                        .one();
-                if (Objects.isNull(insurePayConfig)) {
-                    throw new RemoteServiceException("第" + rowIndex + "行, 保险支付商户号不存在");
-                }
-                insurePayConfigId = insurePayConfig.getId();
-            }
-
-            final String insureType = row.get(12).toString().trim();
-            if (org.apache.commons.lang3.StringUtils.isBlank(insureType)) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 保险类型不能为空");
-            }
-            if (!insureType.contains("意外险")) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 意外险不能为空");
-            }
-
-            if (!insureType.contains("雇主险")) {
-                if (!insureType.contains("工伤险")) {
-                    throw new RemoteServiceException("第" + rowIndex + "行, 雇主险,工伤险必选一个");
-                }
-            }
-
-            if (!websitAttrEnum.getKey().equals(WebsitAttrEnum.SELF.getKey()) && insureType.contains("工伤险")) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 第三方网点是只有意外+雇主险");
-            }
-
-
-            final String insureSteadUnitName = Optional.ofNullable(row.get(14)).orElse("").toString();
-            if (insureType.contains("工伤险")
-                    && org.apache.commons.lang3.StringUtils.isBlank(insureSteadUnitName)) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 工伤险代买单位不能为空");
-            }
-
-
-            final SysDictCompany steadUnit = sysDictCompanyService.lambdaQuery()
-                    .eq(SysDictCompany::getCompanyWechatId, adminUser.getCompanyWechatId())
-                    .eq(SysDictCompany::getDictType, "INSURE_STEAD_UNIT")
-                    .eq(SysDictCompany::getDictValue, insureSteadUnitName)
-                    .one();
-            if (org.apache.commons.lang3.StringUtils.isNotBlank(insureSteadUnitName) && Objects.isNull(steadUnit)) {
-                throw new RemoteServiceException("第" + rowIndex + "行, 工伤险代买单位不存在");
-            }
-
-            final String statusName = row.get(15).toString().trim();
-            final boolean status = statusName.equals("启用");
-            final String allinpayName = row.get(20).toString().trim();
-            final boolean isUseAllinpay = allinpayName.equals("开启");
-
-            AdminWebsit addWebsit = new AdminWebsit();
-            addWebsit.setBelongCompany(belongCompany.getDictValue())
-                    .setBelongCompanyCode(belongCompany.getDictCode());
-            addWebsit.setWebsitId(row.get(1).toString());
-            addWebsit.setName(websitName);
-            addWebsit.setAttr(websitAttrEnum.getKey());
-            addWebsit.setLevel("一级网点".equals(row.get(4).toString().trim()) ? 1 : 2);
-            addWebsit.setLegalName(row.get(5).toString().trim())
-                    .setLegalMobile(row.get(6).toString().trim())
-                    .setLegalIdCard(row.get(7).toString().trim());
-            addWebsit.setType(AdminWebsitTypeEnum.C.getKey());
-            addWebsit.setParentId(parentWebsit.getWebsitId());
-            addWebsit.setWebsitNumber(addWebsit.getWebsitId());
-            addWebsit.setStatus(status);
-            addWebsit.setAddress(address);
-            addWebsit.setCompanyWechatId(companyWechatId);
-            addWebsit.setCompanyWechatName(companyName);
-            addWebsit.setLng(lnglat.split(",")[0]);
-            addWebsit.setLat(lnglat.split(",")[1]);
-            addWebsit.setLinkName(row.get(8).toString().trim());
-            addWebsit.setLinkMobile(row.get(9).toString().trim());
-            addWebsit.setWebsitPhone(row.get(16).toString().trim());
-            addWebsit.setPayWorkerCodeId(wechatPayConfig.getId());
-            addWebsit.setIsUseAllinpay(isUseAllinpay);
-            addWebsit.setInsureType(insureType.replace(",", ","));
-            addWebsit.setPayInsureCodeId(insurePayConfigId);
-            addWebsit.setInsureSteadUnit(Objects.nonNull(steadUnit) ? steadUnit.getDictCode() : null);
-            addWebsit.setOpenBank(row.get(17).toString().trim());
-            addWebsit.setBankAccount(row.get(18).toString().trim());
-            addWebsit.setEmail(row.get(19).toString().trim());
-
-            adminWebsitList.add(addWebsit);
-            List<AdminWebsitPayConfig> payConfigList = new ArrayList<>();
-            if (isUseAllinpay) {
-                boolean isOn = true;
-                int detailIndex = 1;
-                int detailStartIndex = 20;
-                while (isOn) {
-                    try {
-                        row.get(detailStartIndex + 1);
-                    } catch (IndexOutOfBoundsException e) {
-                        isOn = false;
-                        continue;
-                    }
-
-                    try {
-                        if (Objects.isNull(row.get(detailStartIndex + 1)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(detailStartIndex + 1).toString())) {
-//                            throw new RemoteServiceException("第" + rowIndex + "行, 通联商户名称" + detailIndex + "不能为空");
-                            isOn = false;
-                            continue;
-                        }
-
-//                      if (Objects.isNull(row.get(detailStartIndex + 2)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(detailStartIndex + 2).toString())) {
-//                          throw new RemoteServiceException("第" + rowIndex + "行, 通联集团号" + detailIndex + "不能为空");
-//                      }
-                        if (Objects.isNull(row.get(detailStartIndex + 3)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(detailStartIndex + 3).toString())) {
-                            throw new RemoteServiceException("第" + rowIndex + "行, 类别" + detailIndex + "不能为空");
-                        }
-                        if (Objects.isNull(row.get(detailStartIndex + 4)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(detailStartIndex + 4).toString())) {
-                            throw new RemoteServiceException("第" + rowIndex + "行, 通联商户号" + detailIndex + "不能为空");
-                        }
-                        if (Objects.isNull(row.get(detailStartIndex + 5)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(detailStartIndex + 5).toString())) {
-                            throw new RemoteServiceException("第" + rowIndex + "行, 通联商户appid" + detailIndex + "不能为空");
-                        }
-                        if (Objects.isNull(row.get(detailStartIndex + 6)) || org.apache.commons.lang3.StringUtils.isBlank(row.get(detailStartIndex + 6).toString())) {
-                            throw new RemoteServiceException("第" + rowIndex + "行, 状态" + detailIndex + "不能为空");
-                        }
-                        AdminWebsitPayConfig config = new AdminWebsitPayConfig();
-                        config.setCompanyWechatId(addWebsit.getCompanyWechatId());
-                        config.setCompanyWechatName(addWebsit.getCompanyWechatName());
-                        config.setWebsitId(addWebsit.getWebsitId());
-                        config.setName(row.get(detailStartIndex + 1).toString());
-                        config.setOrgId(Optional.ofNullable(row.get(detailStartIndex + 2)).orElse("").toString().trim());
-                        config.setType(row.get(detailStartIndex + 3).toString().equals(WebsitGoodsTypeEnum.M.getRemark()) ? WebsitGoodsTypeEnum.M.getKey() : WebsitGoodsTypeEnum.P.getKey());
-                        config.setMchNo(row.get(detailStartIndex + 4).toString().trim());
-                        config.setAppid(row.get(detailStartIndex + 5).toString().trim());
-                        config.setStatus(row.get(detailStartIndex + 6).toString().trim().equals("开启"));
-                        payConfigList.add(config);
-
-                        detailIndex++;
-                        detailStartIndex = detailStartIndex + 6;
-                    } catch (IndexOutOfBoundsException e) {
-                        throw new RemoteServiceException("第" + rowIndex + "行, 第" + (detailStartIndex + 1) + "个通联相关配置缺失");
-                    }
-                }
-            }
-
-            if (CollectionUtil.isNotEmpty(payConfigList)) {
-                allPayConfigList.addAll(payConfigList);
-            }
-        }
-
-        if (CollectionUtil.isNotEmpty(adminWebsitList)) {
-            // 检查本次导入是否有重复编号和名称
-            Map<String, List<AdminWebsit>> websitGroup = adminWebsitList.stream().collect(Collectors.groupingBy(AdminWebsit::getName));
-            for (Map.Entry<String, List<AdminWebsit>> entry : websitGroup.entrySet()) {
-                if (entry.getValue().size() > 1) {
-                    throw new RemoteServiceException("导入文档有重复的网点名称" + entry.getKey());
-                }
-            }
-
-            websitGroup = adminWebsitList.stream().collect(Collectors.groupingBy(AdminWebsit::getWebsitId));
-            for (Map.Entry<String, List<AdminWebsit>> entry : websitGroup.entrySet()) {
-                if (entry.getValue().size() > 1) {
-                    throw new RemoteServiceException("导入文档有重复的网点编号" + entry.getKey());
-                }
-                final Integer count = adminWebsitService.lambdaQuery()
-                        .eq(AdminWebsit::getCompanyWechatId, companyWechatId)
-                        .eq(AdminWebsit::getType, AdminWebsitTypeEnum.C.getKey())
-                        .eq(AdminWebsit::getWebsitId, entry.getKey())
-                        .count();
-                if (count > 0) {
-                    throw new RemoteServiceException("网点编号" + entry.getKey() + " 在系统里已存在");
-                }
-
-                final Integer nameCount = adminWebsitService.lambdaQuery()
-                        .eq(AdminWebsit::getCompanyWechatId, companyWechatId)
-                        .eq(AdminWebsit::getType, AdminWebsitTypeEnum.C.getKey())
-                        .eq(AdminWebsit::getName, entry.getValue().get(0).getName())
-                        .count();
-                if (nameCount > 0) {
-                    throw new RemoteServiceException("网点名称" + entry.getKey() + " 在系统里已存在");
-                }
-            }
-
-            adminWebsitService.saveBatch(adminWebsitList);
-
-            for (AdminWebsit websit : adminWebsitList) {
-                reloadJoinCode(websit.getCompanyWechatId(), websit.getJoinCode());
-
-                // 初始化辅材配件默认仓
-                initMaterialStorage(adminUser, websit);
-
-
-                AdminDept adminDept = adminDeptService.lambdaQuery().eq(AdminDept::getCompanyWechatId, websit.getCompanyWechatId())
-                        .eq(AdminDept::getPId, "1").last("limit 1").one();
-                AdminDeptWebsit adminDeptWebsit = new AdminDeptWebsit();
-                adminDeptWebsit.setAdminDeptId(adminDept.getAdminDeptId());
-                adminDeptWebsit.setWebsitId(websit.getWebsitId());
-                adminDeptWebsit.setWebsitName(websit.getName());
-                adminDeptWebsit.setDeptName(adminDept.getDeptName());
-                adminDeptWebsit.insert();
-
-                // 网点新增账号
-                if (websit.getType().equals(AdminWebsitTypeEnum.C.getKey())) {
-                    AdminWebsitNewBean reqBean = new AdminWebsitNewBean();
-                    BeanUtils.copyProperties(websit, reqBean);
-                    this.addAdminUser(reqBean);
-                }
-            }
-            if (CollectionUtil.isNotEmpty(allPayConfigList)) {
-                adminWebsitPayConfigService.saveBatch(allPayConfigList);
-            }
-
-
-        }
-    }
-
-    public ExcelData exportData() {
-        AdminUserCom adminUser = commonLogic.getAdminUser();
-        List<List<Object>> rows = new ArrayList<>();
-
-        String companyId = "";
-        String companyName = "";
-        if (Objects.nonNull(adminUser.getAdminCompanyWechat())) {
-            companyId = adminUser.getAdminCompanyWechat().getCompanyWechatId();
-            companyName = adminUser.getAdminCompanyWechat().getCompanyName();
-        }
-
-        ExcelData excelData = new ExcelData();
-
-        final List<AdminWebsit> websitList = adminWebsitService.lambdaQuery()
-                .eq(org.apache.commons.lang3.StringUtils.isNotBlank(companyId), AdminWebsit::getCompanyWechatId, companyId)
-                .eq(AdminWebsit::getType, AdminWebsitTypeEnum.C.getKey())
-                .in(CollectionUtil.isNotEmpty(adminUser.getAdminWebsitIds()), AdminWebsit::getWebsitId, adminUser.getAdminWebsitIds())
-                .list();
-
-        List<String> titleList = new ArrayList<>();
-        titleList.add("所属公司");
-        titleList.add("网点编号");
-        titleList.add("网点名称");
-        titleList.add("网点属性");
-        titleList.add("网点级别");
-        titleList.add("企业法人");
-        titleList.add("法人手机");
-        titleList.add("法人身份证");
-        titleList.add("联系人");
-        titleList.add("联系电话");
-        titleList.add("详细地址");
-        titleList.add("电子支付商户名称");
-        titleList.add("保险类型");
-        titleList.add("保险支付商户号");
-        titleList.add("工伤险代买单位");
-        titleList.add("状态");
-        titleList.add("办公电话");
-        titleList.add("开户银行");
-        titleList.add("银行账号");
-        titleList.add("邮箱");
-        titleList.add("通联支付开关");
-
-        if (CollectionUtil.isEmpty(websitList)) {
-            excelData.setTitles(titleList);
-            excelData.setRows(rows);
-            return excelData;
-        }
-
-        final List<AdminWebsitPayConfig> payConfigList = adminWebsitPayConfigService.lambdaQuery()
-                .in(AdminWebsitPayConfig::getWebsitId, websitList.stream()
-                        .map(AdminWebsit::getWebsitId)
-                        .collect(Collectors.toList()))
-                .list();
-
-        final List<AdminCompanyWechatPayConfig> wechatPayConfigs = adminCompanyWechatPayConfigService.lambdaQuery()
-                .eq(org.apache.commons.lang3.StringUtils.isNotBlank(companyId), AdminCompanyWechatPayConfig::getCompanyWechatId, companyId)
-                .list();
-
-        final List<SysDictCompany> steadUnitList = sysDictCompanyService.lambdaQuery()
-                .eq(SysDictCompany::getCompanyWechatId, companyId)
-                .eq(SysDictCompany::getDictType, "INSURE_STEAD_UNIT")
-                .list();
-
-
-        final Map<String, AdminCompanyWechatPayConfig> wechatPayConfigMap = wechatPayConfigs.stream()
-                .collect(Collectors.toMap(AdminCompanyWechatPayConfig::getId, Function.identity()));
-
-        final Map<String, List<AdminWebsitPayConfig>> itemMap = payConfigList.stream()
-                .collect(Collectors.groupingBy(AdminWebsitPayConfig::getWebsitId));
-
-        final Map<String, SysDictCompany> steadUnitMap = steadUnitList.stream()
-                .collect(Collectors.toMap(SysDictCompany::getDictCode, Function.identity()));
-
-        // 计算出最多行配置数量
-        int configCount = 0;
-        for (Map.Entry<String, List<AdminWebsitPayConfig>> entry : itemMap.entrySet()) {
-            if (entry.getValue().size() > configCount) {
-                configCount = entry.getValue().size();
-            }
-        }
-
-        for (int i = 0; i < configCount; i++) {
-            titleList.add("通联商户名称" + (i + 1));
-            titleList.add("通联集团号" + (i + 1));
-            titleList.add("类别" + (i + 1));
-            titleList.add("通联商户号" + (i + 1));
-            titleList.add("通联商户appid" + (i + 1));
-            titleList.add("状态" + (i + 1));
-        }
-
-        int requireRowSize = titleList.size();
-
-        for (AdminWebsit websit : websitList) {
-            List<Object> row = new ArrayList<>();
-
-            final AdminCompanyWechatPayConfig wechatPayConfig = wechatPayConfigMap.get(websit.getPayWorkerCodeId());
-            final AdminCompanyWechatPayConfig insurePayConfig = wechatPayConfigMap.get(websit.getPayInsureCodeId());
-            final SysDictCompany steadUnit = steadUnitMap.get(websit.getInsureSteadUnit());
-            row.add(websit.getBelongCompany());
-            row.add(websit.getWebsitId());
-            row.add(websit.getName());
-            row.add(BaseEnum.keyToEnumNotNull(WebsitAttrEnum.class, websit.getAttr()).getRemark());
-            row.add(websit.getLevel() == 1 ? "一级网点" : "二级网点");
-            row.add(websit.getLegalName());
-            row.add(websit.getLegalMobile());
-            row.add(websit.getLegalIdCard());
-            row.add(websit.getLinkName());
-            row.add(websit.getLinkMobile());
-            row.add(websit.getAddress());
-            row.add(Objects.nonNull(wechatPayConfig) ? wechatPayConfig.getPayMerchantName() : "");
-            row.add(websit.getInsureType());
-            row.add(Objects.nonNull(insurePayConfig) ? insurePayConfig.getPayMerchantName() : "");
-            row.add(Objects.nonNull(steadUnit) ? steadUnit.getDictValue() : "");
-            row.add(websit.getStatus() ? "启用" : "禁用");
-            row.add(websit.getWebsitPhone());
-            row.add(websit.getOpenBank());
-            row.add(websit.getBankAccount());
-            row.add(websit.getEmail());
-            row.add(websit.getIsUseAllinpay() ? "开启" : "关闭");
-
-            final List<AdminWebsitPayConfig> items = itemMap.get(websit.getWebsitId());
-            if (CollectionUtil.isNotEmpty(items)) {
-                for (AdminWebsitPayConfig item : items) {
-                    row.add(item.getName());
-                    row.add(item.getOrgId());
-                    row.add(item.getType().equals(WebsitGoodsTypeEnum.M.getKey()) ? WebsitGoodsTypeEnum.M.getRemark() : WebsitGoodsTypeEnum.P.getRemark());
-                    row.add(item.getMchNo());
-                    row.add(item.getAppid());
-                    row.add(item.getStatus() ? "开启" : "关闭");
-                }
-            }
-
-            if (row.size() != requireRowSize) {
-                int needRowSize = requireRowSize - row.size();
-                if (needRowSize > 0) {
-                    for (int i = 0; i < needRowSize; i++) {
-                        row.add("");
-                    }
-                }
-            }
-
-            rows.add(row);
-        }
-
-        excelData.setTitles(titleList);
-        excelData.setRows(rows);
-        return excelData;
-    }
-
-    public List<AdminWebsitList> websitList(String type, Boolean isAll, Boolean isIncre, Boolean status, String streetCode, String channelId, String categoryId,
-                                            String orderSmallId, String orderSourceId) {
-
-            AdminUserCom adminUser = commonLogic.getAdminUser();
-
-
-            List<String> websitIds = new ArrayList<>();
-            if (!StringUtil.isEmpty(streetCode)) {
-                websitIds = websitDispatchService.lambdaQuery()
-                        .eq(!StringUtil.isEmpty(adminUser.getCompanyWechatId()), WebsitDispatch::getCompanyWechatId, adminUser.getCompanyWechatId())
-                        .eq(!StringUtil.isEmpty(streetCode), WebsitDispatch::getStreetCode, streetCode)
-                        .eq(!StringUtil.isEmpty(channelId), WebsitDispatch::getDictCode, channelId)
-                        .eq(!StringUtil.isEmpty(categoryId), WebsitDispatch::getCategoryId, categoryId)
-                        .eq(!StringUtil.isEmpty(orderSmallId), WebsitDispatch::getOrderSmallId, orderSmallId)
-                        .eq(!StringUtil.isEmpty(orderSourceId), WebsitDispatch::getOrderSource, orderSourceId)
-                        .list().stream().map(WebsitDispatch::getWebsitId).collect(Collectors.toList());
-            }
-
-
-            List<AdminWebsit> list = adminWebsitService.lambdaQuery()
-                    .eq(StringUtils.isNotBlank(type), AdminWebsit::getType, type)
-                  //  .in(StringUtils.isNotBlank(streetCode) && !CollectionUtils.isEmpty(websitIds), AdminWebsit::getWebsitId, websitIds)
-                    .eq(isIncre != null, AdminWebsit::getIsIncre, isIncre)
-                    .eq(status != null, AdminWebsit::getStatus, status)
-                    .in(CollectionUtils.isNotEmpty(adminUser.getAdminWebsitIds()) && (isAll == null || !isAll), AdminWebsit::getWebsitId, adminUser.getAdminWebsitIds())
-                    .in(CollectionUtils.isNotEmpty(adminUser.getCompanyWechatIds()), AdminWebsit::getCompanyWechatId, adminUser.getCompanyWechatIds())
-                    .list();
-
-
-        List<AdminWebsitList> adminWebsitLists = BeanUtil.copyToList(list, AdminWebsitList.class);
-
-        if (!CollectionUtils.isEmpty(websitIds)) {
-
-            for (AdminWebsitList adminWebsitList : adminWebsitLists) {
-                if (websitIds.contains(adminWebsitList.getWebsitId())) {
-                    adminWebsitList.setIfDispatch(true);
-                }
-            }
-        }
-
-        return adminWebsitLists;
-    }
-}

+ 2 - 2
mall-server-sync-api/src/main/java/com/gree/mall/manager/schedule/SyncSchedule.java

@@ -3,7 +3,7 @@ package com.gree.mall.manager.schedule;
 
 
 import com.gree.mall.manager.logic.SyncOrderInfoLogic;
-import com.gree.mall.manager.logic.policy.AgreementLogic;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.scheduling.annotation.Scheduled;
@@ -15,7 +15,7 @@ import java.io.IOException;
 /**
  * 定时购买保险
  */
-//@ConditionalOnProperty(name = "schedule.enable", havingValue = "true", matchIfMissing = true)
+@ConditionalOnProperty(name = "schedule.enable", havingValue = "true", matchIfMissing = true)
 @Component
 public class SyncSchedule {