‘linchangsheng’ hai 1 mes
pai
achega
bd86033fb3

+ 2 - 1
mall-server-api/src/main/java/com/gree/mall/manager/logic/comlist/WorkerComListLogic.java

@@ -143,13 +143,14 @@ public class WorkerComListLogic {
         for (Object o : objects) {
             List<Object> row = (List<Object>) o;
             String workerNumber = (String) row.get(0);
+            String websitNumber = (String) row.get(1);
             if (StringUtils.isEmpty(workerNumber)) {
                 continue;
             }
             WorkerComListWorker workerComListWorker = new WorkerComListWorker();
             workerComListWorker.setCreateBy(workerComList.getCreateBy());
             workerComListWorker.setCreateTime(new Date());
-            workerComListWorker.setWebsitId(workerNumber);
+            workerComListWorker.setWebsitId(websitNumber);
             workerComListWorker.setWorkerComListId(workerComList.getId());
             workerComListWorker.setWorkerComListWorkerNumber(workerNumber);
             workerComListWorkers.add(workerComListWorker);

+ 11 - 35
mall-server-api/src/main/java/com/gree/mall/manager/logic/worker/WorkerWarrantyLogic.java

@@ -147,43 +147,21 @@ public class WorkerWarrantyLogic {
 
         List<WorkerWarranty> workerWarrantyList = workerWarrantyService.lambdaQuery()
                 .eq(WorkerWarranty::getCompanyWechatId, adminUser.getCompanyWechatId())
-                .in(CollectionUtils.isNotEmpty(adminUser.getAdminWebsitIds()) && !adminUser.getType().equals(1), WorkerWarranty::getWebsitId, adminUser.getAdminWebsitIds())
+                .in(CollectionUtils.isNotEmpty(adminUser.getAdminWebsitIds()) && !adminUser.getType().equals(1),
+                        WorkerWarranty::getWebsitId, adminUser.getAdminWebsitIds())
                 .list();
 
 
 
-        //网点名称
-/*        Map<String, AdminWebsit> adminWebsitMap = adminWebsitService.lambdaQuery()
-                .eq(AdminWebsit::getCompanyWechatId, adminUser.getCompanyWechatId())
-                .in(CollectionUtils.isNotEmpty(adminUser.getAdminWebsitIds()) && !adminUser.getType().equals(1), AdminWebsit::getWebsitId, adminUser.getAdminWebsitIds())
-                .eq(AdminWebsit::getType, AdminWebsitTypeEnum.C.getKey())
-                .list().stream().collect(Collectors.toMap(AdminWebsit::getWebsitId, Function.identity()));
-        log.info("网点");*/
-
-        //网点名称
-        Map<String, User> userMap = userService.lambdaQuery()
-                .eq(User::getCompanyWechatId, adminUser.getCompanyWechatId())
-                .eq(User::getType,"WORKER")
-                .ne(User::getMobile,"")
-                .isNotNull(User::getMobile)
-                .list().stream().collect(Collectors.toMap(User::getMobile, Function.identity()));
-
-        log.info("用户");
-
         for (int i = 0; i < objects.size(); i++) {
             int rowIndex = i + 2;
             List<Object> row = (List<Object>) objects.get(i);
 
-            AdminWebsit adminWebsit = adminWebsitService.getById((String) row.get(0));
-           // AdminWebsit adminWebsit = adminWebsitMap.get((String) row.get(0));
-            User user = userMap.get((String) row.get(8));
-
-
             WorkerWarranty workerWarranty = new WorkerWarranty();
 
 
-            workerWarranty.setWebsitId(adminWebsit.getWebsitId());
-            workerWarranty.setWebsitName(adminWebsit.getName());
+            workerWarranty.setWebsitId((String) row.get(0));
+            workerWarranty.setWebsitName((String)row.get(1));
 
 
 
@@ -192,15 +170,13 @@ public class WorkerWarrantyLogic {
              workerWarranty.setOutTime(DateUtil.parse((String)row.get(5), "yyyy-MM-dd"));
 
 
-
-
-            workerWarranty.setCompanyWechatId(adminWebsit.getCompanyWechatId());
-            workerWarranty.setCompanyWechatName(adminWebsit.getCompanyWechatName());
-            workerWarranty.setWorkerNumber(user.getWorkerNumber());
-            workerWarranty.setWorkerName(user.getNickName());
-            workerWarranty.setIdCard(user.getIdCard());
-            workerWarranty.setMobile(user.getMobile());
-            workerWarranty.setWorkerId(user.getUserId());
+            workerWarranty.setCompanyWechatId(adminUser.getCompanyWechatId());
+            workerWarranty.setCompanyWechatName(adminUser.getCompanyName());
+            workerWarranty.setWorkerNumber((String) row.get(6));
+            workerWarranty.setWorkerName((String) row.get(7));
+            workerWarranty.setIdCard((String) row.get(9));
+            workerWarranty.setMobile((String) row.get(8));
+            workerWarranty.setWorkerId((String) row.get(6));
             if (!StringUtil.isEmpty((String)row.get(11)))
                 workerWarranty.setEveryAmount(Convert.toBigDecimal(row.get(11)));