Browse Source

个人信息

liangpeile 1 year ago
parent
commit
9d5dec6ee3

+ 23 - 11
crmeb-admin/src/main/java/com/zbkj/admin/task/sms/DynamicScheduledTask.java

@@ -19,6 +19,7 @@ package com.zbkj.admin.task.sms;
  */
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.sun.corba.se.spi.ior.iiop.IIOPFactories;
 import com.zbkj.admin.task.order.OrderReceiptTask;
 import com.zbkj.common.model.merchant.MerchantSmsTiming;
 import com.zbkj.service.service.MerchantSmsTimingService;
@@ -70,22 +71,27 @@ public class DynamicScheduledTask {
                 String hour = sendTime.substring(11, 13);
                 String minute = sendTime.substring(14, 16);
                 //单次发送
-                if (list.get(i).getSendType() == 1) {
+                if (1==list.get(i).getSendType()) {
                     cronExpression = "0 " + minute + "" + hour + "" + day + "" + month + " ? ";
                     System.out.println(cronExpression);
                     //循环发送
                 } else {
                     //每天
-                    if (list.get(i).getIsCirculate() == 1) {
+                    if (1==list.get(i).getIsCirculate()) {
                         cronExpression = "0 " + minute + "" + hour + "" + "*" + "" + "*" + " ? ";
 
                         //每月
                     } else {
                         //每月最后一天
-                        if (list.get(i).getIsLastDay() == 1) {
-                            cronExpression = "0 " + minute + "" + hour + "" + "28-31" + "" + "*" + " ? ";
-                        } else {
-                            cronExpression = "0 " + minute + "" + hour + "" + "*" + "" + month + " ? ";
+                        if (null!=list.get(i).getIsLastDay()) {
+                            if (1==list.get(i).getIsLastDay()) {
+                                cronExpression = "0 " + "0" + " " + "0" + " " + "28-31" + " " + "*" + " ? ";
+                            } else {
+                                cronExpression = "0 " + minute + " " + hour + " " + "*" + " " + month + " ? ";
+                            }
+                        }
+                        else {
+                            cronExpression = "0 " + minute + " " + hour + " " + "*" + " " + month + " ? ";
                         }
 
                     }
@@ -120,21 +126,27 @@ public class DynamicScheduledTask {
                 String hour = sendTime.substring(11, 13);
                 String minute = sendTime.substring(14, 16);
                 //单次发送
-                if (list.get(i).getSendType() == 1) {
+                if (1==list.get(i).getSendType()) {
                     cronExpression = "0 " + minute + " " + hour + " " + day + " " + month + " ? ";
                     //循环发送
                 } else {
                     //每天
-                    if (list.get(i).getIsCirculate() == 1) {
+                    if (1==list.get(i).getIsCirculate()) {
                         cronExpression = "0 " + minute + " " + hour + " " + "*" + " " + "*" + " ? ";
                         //每月
                     } else {
                         //每月最后一天
-                        if (list.get(i).getIsLastDay() == 1) {
-                            cronExpression = "0 " + "0" + " " + "0" + " " + "28-31" + " " + "*" + " ? ";
-                        } else {
+                        if (null!=list.get(i).getIsLastDay()) {
+                            if (1==list.get(i).getIsLastDay()) {
+                                cronExpression = "0 " + "0" + " " + "0" + " " + "28-31" + " " + "*" + " ? ";
+                            } else {
+                                cronExpression = "0 " + minute + " " + hour + " " + "*" + " " + month + " ? ";
+                            }
+                        }
+                        else {
                             cronExpression = "0 " + minute + " " + hour + " " + "*" + " " + month + " ? ";
                         }
+
                     }
                 }
                 String tempId = list.get(i).getTempId();

+ 17 - 6
crmeb-front/src/main/java/com/zbkj/front/controller/NewFrontApi.java

@@ -105,6 +105,9 @@ public class NewFrontApi {
     private MerchantSmsService merchantSmsService;
     @Autowired
     private OrganizationDepartmentUserService organizationDepartmentUserService;
+    @Autowired
+    private OrganizationDepartmentService organizationDepartmentService;
+
 
 
     @ApiOperation(value = "判断用户是否为企业用户还是企业子用户还是普通用户")
@@ -187,19 +190,27 @@ public class NewFrontApi {
 
     @ApiOperation(value = "查看部门,筛选用,只有企业账号有筛选(子账号不能筛选)(id为企业账户id)")
     @RequestMapping(value = "/getDepartment/{id}", method = RequestMethod.POST)
-    public CommonResult<List<String>> getDepartment(@PathVariable Integer id) {
+    public CommonResult<?> getDepartment(@PathVariable Integer id) {
 //        User info = userService.getInfo();
         try {
             LambdaQueryWrapper<UserBypassAccount> queryWrapper2 = new LambdaQueryWrapper<>();
             queryWrapper2.eq(UserBypassAccount::getEnterpriseId, id);
             queryWrapper2.eq(UserBypassAccount::getIsDelete, 0);
             List<UserBypassAccount> list = userBypassAccountService.list(queryWrapper2);
-            List<String> pepartments = list.stream()
-                    .map(UserBypassAccount::getDepartment)
-                    .collect(Collectors.toList());
 
-            List<String> distinctDepartments = new ArrayList<>(new HashSet<>(pepartments));
-            distinctDepartments.add("主账号");
+
+            List<Object> distinctDepartments = new ArrayList<>();
+            UserEnterprise userEnterprise = userEnterpriseService.getById(id);
+            String organizationId = userEnterprise.getOrganizationId();
+            LambdaQueryWrapper<OrganizationDepartment> queryWrapperDepart = new LambdaQueryWrapper<>();
+            queryWrapperDepart.eq(OrganizationDepartment::getOrganizationId,organizationId);
+            List<OrganizationDepartment> departmentList = organizationDepartmentService.list(queryWrapperDepart);
+            OrganizationDepartment organizationDepartment = new OrganizationDepartment();
+            organizationDepartment.setName("主账号");
+            organizationDepartment.setId("");
+
+            departmentList.add(organizationDepartment);
+            distinctDepartments.add(departmentList);
             return CommonResult.success(distinctDepartments);
         } catch (Exception e) {
             return CommonResult.failed("查看部门失败,接口错误");

+ 1 - 1
crmeb-front/src/main/java/com/zbkj/front/service/impl/AAAServiceImpl.java

@@ -64,7 +64,7 @@ public class AAAServiceImpl implements AAAService {
         String fileNmae = "/crmebimage/public/miniprogrampic/" + System.currentTimeMillis() + ".png";
 //        String fileNmaes = "C:\\Users\\ASUS\\Desktop\\mer_java\\crmebimage\\public\\miniprogrampic\\"+fileNmae;
         String fileNmaes = "/usr/java/AimagePath" + fileNmae;
-        //将分享的购物车数据存入新表,以便后期查看数据保证分享数据不发生变化
+
         String cartIdString = scene.substring(0, scene.indexOf("&"));
         String substring = cartIdString.substring(cartIdString.indexOf("=")+1);
         String[] cartIds = substring.split(",");

+ 15 - 7
crmeb-front/src/main/java/com/zbkj/front/service/impl/UserCenterServiceImpl.java

@@ -148,14 +148,22 @@ public class UserCenterServiceImpl extends ServiceImpl<UserDao, User> implements
             LambdaQueryWrapper<UserBypassAccount> queryWrapper1 = new LambdaQueryWrapper<>();
             queryWrapper1.eq(UserBypassAccount::getUserId, uid);
             UserBypassAccount userBypassAccount = userBypassAccountService.getOne(queryWrapper1);
-            Integer enterpriseId = userBypassAccount.getEnterpriseId();
-            LambdaQueryWrapper<UserEnterprise> queryWrapper2 = new LambdaQueryWrapper<>();
-            queryWrapper2.eq(UserEnterprise::getId, enterpriseId);
-            UserEnterprise userEnterprise1 = userEnterpriseService.getOne(queryWrapper2);
+            if(null!=userBypassAccount){
+                Integer enterpriseId = userBypassAccount.getEnterpriseId();
+                LambdaQueryWrapper<UserEnterprise> queryWrapper2 = new LambdaQueryWrapper<>();
+                queryWrapper2.eq(UserEnterprise::getId, enterpriseId);
+                UserEnterprise userEnterprise1 = userEnterpriseService.getOne(queryWrapper2);
+
+                response.setQyName(userEnterprise1.getEnterpriseName());
+                response.setBmName(userBypassAccount.getDepartment());
+                response.setRealName(userBypassAccount.getRealName());
+            }else {
+                User byId = userService.getById(uid);
+                response.setQyName("");
+                response.setBmName("");
+                response.setRealName(byId.getNickname());
+            }
 
-            response.setQyName(userEnterprise1.getEnterpriseName());
-            response.setBmName(userBypassAccount.getDepartment());
-            response.setRealName(userBypassAccount.getRealName());
         }
         // 保存用户访问记录
         asyncService.visitUserCenter(user.getId());