Browse Source

add:admin和相关角色看手机全号
add:修改订单的收货人信息 需要待付款状态限制
add:excel导入修改订单信息

ct 3 days ago
parent
commit
bee574ed1e
19 changed files with 559 additions and 142 deletions
  1. 24 2
      fs-admin/src/main/java/com/fs/crm/controller/CrmCustomerController.java
  2. 51 1
      fs-admin/src/main/java/com/fs/his/controller/FsStoreOrderController.java
  3. 37 6
      fs-admin/src/main/java/com/fs/his/controller/FsUserController.java
  4. 6 2
      fs-common/src/main/java/com/fs/common/annotation/Excel.java
  5. 14 2
      fs-common/src/main/java/com/fs/common/core/domain/entity/SysRole.java
  6. 63 0
      fs-common/src/main/java/com/fs/common/utils/ExcelUtils.java
  7. 66 45
      fs-common/src/main/java/com/fs/common/utils/poi/ExcelUtil.java
  8. 13 2
      fs-company/src/main/java/com/fs/company/controller/store/FsStoreOrderController.java
  9. 1 0
      fs-service/src/main/java/com/fs/his/enums/FsStoreOrderStatusEnum.java
  10. 1 1
      fs-service/src/main/java/com/fs/his/service/IFsExportTaskService.java
  11. 10 0
      fs-service/src/main/java/com/fs/his/service/IFsStoreOrderService.java
  12. 6 2
      fs-service/src/main/java/com/fs/his/service/impl/FsExportTaskServiceImpl.java
  13. 127 4
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java
  14. 32 0
      fs-service/src/main/java/com/fs/his/vo/FsStoreOrderStatusExcelVO.java
  15. 16 13
      fs-service/src/main/java/com/fs/system/mapper/SysRoleMapper.java
  16. 23 21
      fs-service/src/main/java/com/fs/system/service/ISysRoleService.java
  17. 37 22
      fs-service/src/main/java/com/fs/system/service/impl/SysRoleServiceImpl.java
  18. 1 1
      fs-service/src/main/resources/application-common.yml
  19. 31 18
      fs-service/src/main/resources/mapper/system/SysRoleMapper.xml

+ 24 - 2
fs-admin/src/main/java/com/fs/crm/controller/CrmCustomerController.java

@@ -4,6 +4,8 @@ import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.domain.R;
+import com.fs.common.core.domain.entity.SysRole;
+import com.fs.common.core.domain.entity.SysUser;
 import com.fs.common.core.domain.model.LoginUser;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
@@ -19,6 +21,7 @@ import com.fs.crm.service.ICrmCustomerService;
 import com.fs.crm.vo.CrmCustomerExportVO;
 import com.fs.crm.vo.CrmCustomerListVO;
 import com.fs.framework.web.service.TokenService;
+import com.fs.system.service.ISysRoleService;
 import com.github.pagehelper.PageHelper;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -148,13 +151,14 @@ public class CrmCustomerController extends BaseController
         crmCustomer.setIsLine(0);
         List<CrmCustomerListVO> list = crmCustomerService.selectCrmCustomerListVO(crmCustomer);
         List<CrmCustomerExportVO> exportList=new ArrayList<>();
+        boolean checkPhone = isCheckPhone();
         for(CrmCustomerListVO customer:list){
             CrmCustomerExportVO vo=new CrmCustomerExportVO();
             if(customer.getSource()!=null){
                 vo.setSource(customer.getSource().toString());
             }
             BeanUtils.copyProperties(customer,vo);
-            if(customer.getMobile()!=null){
+            if(customer.getMobile()!=null && !checkPhone){
                 vo.setMobile(customer.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
             }
             exportList.add(vo);
@@ -193,8 +197,9 @@ public class CrmCustomerController extends BaseController
         }
         List<CrmCustomerListVO> list = crmCustomerService.selectCrmCustomerListQueryParam(crmCustomer);
         if (list != null) {
+            boolean checkPhone = isCheckPhone();
             for (CrmCustomerListVO vo : list) {
-                if(vo.getMobile()!=null){
+                if(vo.getMobile()!=null && !checkPhone){
                     vo.setMobile(vo.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
                 }
 
@@ -204,6 +209,23 @@ public class CrmCustomerController extends BaseController
         return getDataTable(list);
     }
 
+    @Autowired
+    private ISysRoleService sysRoleService;
+    private boolean isCheckPhone() {
+        SysUser user = getLoginUser().getUser();
+        boolean flag = user.isAdmin();
+        if (flag) {
+            return true;
+        }
+        List<SysRole> roles = user.getRoles();
+        if (roles != null && !roles.isEmpty()) {
+            Long[] roleIds = roles.stream().map(SysRole::getRoleId).toArray(Long[]::new);
+            return sysRoleService.getIsCheckPhone(roleIds);
+        }
+
+        return false;
+    }
+
 
     @PreAuthorize("@ss.hasPermi('crm:customer:query')")
     @GetMapping(value = "/query/{customerId}")

+ 51 - 1
fs-admin/src/main/java/com/fs/his/controller/FsStoreOrderController.java

@@ -9,6 +9,8 @@ import java.util.stream.Collectors;
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
 import com.fs.common.core.domain.R;
+import com.fs.common.core.domain.entity.SysRole;
+import com.fs.common.core.domain.entity.SysUser;
 import com.fs.common.core.domain.model.LoginUser;
 import com.fs.common.utils.ParseUtils;
 import com.fs.common.utils.SecurityUtils;
@@ -43,6 +45,7 @@ import com.fs.his.utils.ConfigUtil;
 import com.fs.his.vo.*;
 import com.fs.system.domain.SysConfig;
 import com.fs.system.mapper.SysConfigMapper;
+import com.fs.system.service.ISysRoleService;
 import com.github.pagehelper.PageHelper;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Qualifier;
@@ -213,13 +216,31 @@ public class FsStoreOrderController extends BaseController
         task.setUserId(SecurityUtils.getUserId());
         exportTaskService.insertFsExportTask(task);
         param.setTaskId(task.getTaskId());
-        exportTaskService.exportStore1Data(param);
+        boolean checkPhone = isCheckPhone();
+        exportTaskService.exportStore1Data(param,checkPhone);
 
         return new AjaxResult(200,"后台正在导出,请等待...任务ID:"+task.getTaskId(),task.getTaskId());
 
 
     }
 
+    @Autowired
+    private ISysRoleService sysRoleService;
+    private boolean isCheckPhone() {
+        SysUser user = getLoginUser().getUser();
+        boolean flag = user.isAdmin();
+        if (flag) {
+            return true;
+        }
+        List<SysRole> roles = user.getRoles();
+        if (roles != null && !roles.isEmpty()) {
+            Long[] roleIds = roles.stream().map(SysRole::getRoleId).toArray(Long[]::new);
+            return sysRoleService.getIsCheckPhone(roleIds);
+        }
+
+        return false;
+    }
+
     @GetMapping("/importTemplate")
     public AjaxResult sendExport()
     {
@@ -227,6 +248,13 @@ public class FsStoreOrderController extends BaseController
         return util.importTemplateExcel("导入运单号");
     }
 
+    @GetMapping("/importUpdateOrderTemplate")
+    public AjaxResult importUpdateOrderTemplate()
+    {
+        ExcelUtil<FsStoreOrderStatusExcelVO> util = new ExcelUtil<>(FsStoreOrderStatusExcelVO.class);
+        return util.importTemplateExcel("修改订单");
+    }
+
     @Log(title = "导入", businessType = BusinessType.IMPORT)
     @PreAuthorize("@ss.hasPermi('store:storeOrder:importExpress')")
     @PostMapping("/importExpress")
@@ -248,6 +276,17 @@ public class FsStoreOrderController extends BaseController
         return AjaxResult.success(message);
     }
 
+    @Log(title = "导入修改订单", businessType = BusinessType.IMPORT)
+    @PostMapping("/importOrderStatusData")
+    @PreAuthorize("@ss.hasPermi('his:storeOrder:editImport')")
+    public AjaxResult importOrderStatusData(MultipartFile file, boolean updateSupport) throws Exception
+    {
+        ExcelUtil<FsStoreOrderStatusExcelVO> util = new ExcelUtil<>(FsStoreOrderStatusExcelVO.class);
+        List<FsStoreOrderStatusExcelVO> list = util.importExcel(file.getInputStream());
+        String message = fsStoreOrderService.importOrderStatusData(list);
+        return AjaxResult.success(message);
+    }
+
     @GetMapping("/importExpressTemplate")
     public AjaxResult importExpressTemplate() {
         ExcelUtil<StoreOrderExpressExportDTO> util = new ExcelUtil<StoreOrderExpressExportDTO>(StoreOrderExpressExportDTO.class);
@@ -341,6 +380,17 @@ public class FsStoreOrderController extends BaseController
         return toAjax(fsStoreOrderService.updateFsStoreOrder(fsStoreOrder));
     }
 
+    /**
+     * 修改订单
+     */
+    @PreAuthorize("@ss.hasPermi('his:storeOrder:edit')")
+    @Log(title = "订单", businessType = BusinessType.UPDATE)
+    @PutMapping("/updateStoreOrder")
+    public R updateStoreOrder(@RequestBody FsStoreOrder fsStoreOrder)
+    {
+        return fsStoreOrderService.updateStoreOrder(fsStoreOrder);
+    }
+
     @PreAuthorize("@ss.hasPermi('his:storeOrder:updateDelivery')")
     @Log(title = "修改物流", businessType = BusinessType.UPDATE)
     @PutMapping("/updateDelivery")

+ 37 - 6
fs-admin/src/main/java/com/fs/his/controller/FsUserController.java

@@ -7,6 +7,8 @@ import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.ResponseResult;
+import com.fs.common.core.domain.entity.SysRole;
+import com.fs.common.core.domain.entity.SysUser;
 import com.fs.common.exception.CustomException;
 import com.fs.common.utils.ParseUtils;
 import com.fs.common.utils.SecurityUtils;
@@ -28,6 +30,7 @@ import com.fs.his.vo.UserVo;
 import com.fs.qw.dto.UserProjectDTO;
 import com.fs.store.param.h5.FsUserPageListParam;
 import com.fs.store.vo.h5.FsUserPageListVO;
+import com.fs.system.service.ISysRoleService;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.google.common.collect.Lists;
@@ -94,20 +97,43 @@ public class FsUserController extends BaseController
             fsUser.setPhone(encryptPhone(fsUser.getPhone()));
         }
         List<FsUserVO> list = fsUserService.selectFsUserListVO(fsUser);
+        boolean checkPhone = isCheckPhone();
         for (FsUserVO fsUserVO : list) {
             if(fsUserVO.getPhone() != null&&fsUserVO.getPhone()!=""){
-                if (fsUserVO.getPhone().length()>11){
-                    fsUserVO.setPhone(decryptPhoneMk(fsUserVO.getPhone()));
-                }else {
-                    fsUserVO.setPhone(fsUserVO.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                if (!checkPhone){
+                    if (fsUserVO.getPhone().length()>11){
+                        fsUserVO.setPhone(decryptPhoneMk(fsUserVO.getPhone()));
+                    }else {
+                        fsUserVO.setPhone(fsUserVO.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                    }
+                } else {
+                    if (fsUserVO.getPhone().length()>11) {
+                        fsUserVO.setPhone(decryptPhone(fsUserVO.getPhone()));
+                    }
                 }
-
             }
 
         }
         return getDataTable(list);
     }
 
+    @Autowired
+    private ISysRoleService sysRoleService;
+    private boolean isCheckPhone() {
+        SysUser user = getLoginUser().getUser();
+        boolean flag = user.isAdmin();
+        if (flag) {
+            return true;
+        }
+        List<SysRole> roles = user.getRoles();
+        if (roles != null && !roles.isEmpty()) {
+            Long[] roleIds = roles.stream().map(SysRole::getRoleId).toArray(Long[]::new);
+            return sysRoleService.getIsCheckPhone(roleIds);
+        }
+
+        return false;
+    }
+
     @PreAuthorize("@ss.hasPermi('his:user:list')")
     @GetMapping("/listProject")
     public TableDataInfo listProject(FsUser fsUser)
@@ -137,9 +163,14 @@ public class FsUserController extends BaseController
             return AjaxResult.error("导出数据不可超过1w条");
         }
         List<FsUserExportListVO> list = fsUserService.selectFsUserExportListVO(fsUser);
+        boolean checkPhone = isCheckPhone();
         for (FsUserExportListVO vo : list) {
-            if (vo.getMobile()!=null){
+            if (vo.getMobile()!=null && !checkPhone){
                 vo.setMobile(vo.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+            } else {
+                if (vo.getMobile().length()>11){
+                    vo.setMobile(decryptPhone(vo.getMobile()));
+                }
             }
         }
         ExcelUtil<FsUserExportListVO> util = new ExcelUtil<FsUserExportListVO>(FsUserExportListVO.class);

+ 6 - 2
fs-common/src/main/java/com/fs/common/annotation/Excel.java

@@ -8,13 +8,17 @@ import java.math.BigDecimal;
 
 /**
  * 自定义导出Excel数据注解
- * 
+ *
 
  */
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.FIELD)
 public @interface Excel
 {
+    /**
+     * 是否为必填字段
+     */
+    boolean required() default false;
     /**
      * 导出时在excel中排序
      */
@@ -162,4 +166,4 @@ public @interface Excel
             return this.value;
         }
     }
-}
+}

+ 14 - 2
fs-common/src/main/java/com/fs/common/core/domain/entity/SysRole.java

@@ -10,7 +10,7 @@ import com.fs.common.core.domain.BaseEntity;
 
 /**
  * 角色表 sys_role
- * 
+ *
 
  */
 public class SysRole extends BaseEntity
@@ -59,6 +59,9 @@ public class SysRole extends BaseEntity
     /** 部门组(数据权限) */
     private Long[] deptIds;
 
+    /** 是否可以查看手机全号 0否 1是 */
+    private Integer isCheckPhone;
+
     public SysRole()
     {
 
@@ -203,7 +206,15 @@ public class SysRole extends BaseEntity
     {
         this.deptIds = deptIds;
     }
-    
+
+    public Integer getIsCheckPhone() {
+        return isCheckPhone;
+    }
+
+    public void setIsCheckPhone(Integer isCheckPhone) {
+        this.isCheckPhone = isCheckPhone;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -221,6 +232,7 @@ public class SysRole extends BaseEntity
             .append("updateBy", getUpdateBy())
             .append("updateTime", getUpdateTime())
             .append("remark", getRemark())
+            .append("isCheckPhone", getIsCheckPhone())
             .toString();
     }
 }

+ 63 - 0
fs-common/src/main/java/com/fs/common/utils/ExcelUtils.java

@@ -0,0 +1,63 @@
+package com.fs.common.utils;
+
+import com.fs.common.annotation.Excel;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * excel工具类
+ */
+public class ExcelUtils {
+    private static final Map<Class<?>, List<Field>> fieldCache = new ConcurrentHashMap<>();
+
+    public static void validateRequiredFields(Object obj, int rowIndex) throws Exception {
+        List<String> errorMessages = new ArrayList<>();
+        Class<?> clazz = obj.getClass();
+
+        // 从缓存中获取字段
+        List<Field> fields = getCachedFields(clazz);
+
+        for (Field field : fields) {
+            if (field.isAnnotationPresent(Excel.class)) {
+                Excel excel = field.getAnnotation(Excel.class);
+                if (excel.required()) {
+                    field.setAccessible(true);
+                    Object value = field.get(obj);
+                    if (isEmpty(value)) {
+                        errorMessages.add("第 " + rowIndex + " 行的 " + excel.name() + " 是必填项,不能为空!");
+                    }
+                }
+            }
+        }
+
+        if (!errorMessages.isEmpty()) {
+            throw new Exception(String.join("; ", errorMessages));
+        }
+    }
+
+    private static List<Field> getCachedFields(Class<?> clazz) {
+        return fieldCache.computeIfAbsent(clazz, k -> {
+            Field[] fields = k.getDeclaredFields();
+            return Arrays.asList(fields);
+        });
+    }
+
+    private static boolean isEmpty(Object value) {
+        if (value == null) {
+            return true;
+        }
+        if (value instanceof String) {
+            return ((String) value).trim().isEmpty();
+        }
+        if (value instanceof Iterable) {
+            return !((Iterable<?>) value).iterator().hasNext();
+        }
+        return false;
+    }
+
+}

+ 66 - 45
fs-common/src/main/java/com/fs/common/utils/poi/ExcelUtil.java

@@ -26,26 +26,7 @@ import org.apache.poi.hssf.usermodel.HSSFShape;
 import org.apache.poi.hssf.usermodel.HSSFSheet;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ooxml.POIXMLDocumentPart;
-import org.apache.poi.ss.usermodel.BorderStyle;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.CellType;
-import org.apache.poi.ss.usermodel.ClientAnchor;
-import org.apache.poi.ss.usermodel.DataValidation;
-import org.apache.poi.ss.usermodel.DataValidationConstraint;
-import org.apache.poi.ss.usermodel.DataValidationHelper;
-import org.apache.poi.ss.usermodel.DateUtil;
-import org.apache.poi.ss.usermodel.Drawing;
-import org.apache.poi.ss.usermodel.FillPatternType;
-import org.apache.poi.ss.usermodel.Font;
-import org.apache.poi.ss.usermodel.HorizontalAlignment;
-import org.apache.poi.ss.usermodel.IndexedColors;
-import org.apache.poi.ss.usermodel.PictureData;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.VerticalAlignment;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.ss.usermodel.WorkbookFactory;
+import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddressList;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.xssf.streaming.SXSSFWorkbook;
@@ -77,7 +58,7 @@ import com.fs.common.utils.reflect.ReflectUtils;
 
 /**
  * Excel相关处理
- * 
+ *
 
  */
 public class ExcelUtil<T>
@@ -164,7 +145,7 @@ public class ExcelUtil<T>
 
     /**
      * 对excel表单默认第一个索引名转换成list
-     * 
+     *
      * @param is 输入流
      * @return 转换后集合
      */
@@ -175,7 +156,7 @@ public class ExcelUtil<T>
 
     /**
      * 对excel表单指定表格索引名转换成list
-     * 
+     *
      * @param sheetName 表格索引名
      * @param is 输入流
      * @return 转换后集合
@@ -354,7 +335,7 @@ public class ExcelUtil<T>
 
     /**
      * 对list数据源将其里面的数据导入到excel表单
-     * 
+     *
      * @param list 导出数据集合
      * @param sheetName 工作表的名称
      * @return 结果
@@ -367,7 +348,7 @@ public class ExcelUtil<T>
 
     /**
      * 对list数据源将其里面的数据导入到excel表单
-     * 
+     *
      * @param response 返回数据
      * @param list 导出数据集合
      * @param sheetName 工作表的名称
@@ -384,7 +365,7 @@ public class ExcelUtil<T>
 
     /**
      * 对list数据源将其里面的数据导入到excel表单
-     * 
+     *
      * @param sheetName 工作表的名称
      * @return 结果
      */
@@ -396,7 +377,7 @@ public class ExcelUtil<T>
 
     /**
      * 对list数据源将其里面的数据导入到excel表单
-     * 
+     *
      * @param sheetName 工作表的名称
      * @return 结果
      */
@@ -410,7 +391,7 @@ public class ExcelUtil<T>
 
     /**
      * 对list数据源将其里面的数据导入到excel表单
-     * 
+     *
      * @return 结果
      */
     public void exportExcel(OutputStream out)
@@ -433,7 +414,7 @@ public class ExcelUtil<T>
 
     /**
      * 对list数据源将其里面的数据导入到excel表单
-     * 
+     *
      * @return 结果
      */
     public AjaxResult exportExcel()
@@ -489,7 +470,7 @@ public class ExcelUtil<T>
 
     /**
      * 填充excel数据
-     * 
+     *
      * @param index 序号
      * @param row 单元格行
      */
@@ -516,7 +497,7 @@ public class ExcelUtil<T>
 
     /**
      * 创建表格样式
-     * 
+     *
      * @param wb 工作薄对象
      * @return 样式列表
      */
@@ -591,14 +572,54 @@ public class ExcelUtil<T>
         Cell cell = row.createCell(column);
         // 写入列信息
         cell.setCellValue(attr.name());
+//        setDataValidation(attr, row, column);
+//        cell.setCellStyle(styles.get("header"));
+        // 获取默认样式
+        CellStyle cellStyle = styles.get("header");
+        // 如果是必填项,应用红色字体样式
+        if (attr.required()) {
+//            CellStyle requiredStyle = row.getSheet().getWorkbook().createCellStyle();
+//            requiredStyle.cloneStyleFrom(cellStyle); // 复制原样式
+//            Font font = row.getSheet().getWorkbook().createFont();
+//            font.setColor(IndexedColors.RED.getIndex()); // 设置字体红色
+//            requiredStyle.setFont(font);
+//            cellStyle = requiredStyle;
+
+            // 添加 Excel 注释,提示用户该字段必填
+            addCellComment(cell, row.getSheet(), "必填项");
+        }
+        // 应用单元格样式
+        cell.setCellStyle(cellStyle);
+        // 设置数据校验规则(如果有)
         setDataValidation(attr, row, column);
-        cell.setCellStyle(styles.get("header"));
         return cell;
     }
 
+    /**
+     * 给 Excel 单元格添加注释
+     */
+    private void addCellComment(Cell cell, Sheet sheet, String commentText) {
+        if (cell.getCellComment() != null) {
+            return; // 如果已存在注释,直接返回,避免重复添加
+        }
+        Drawing<?> drawing = sheet.createDrawingPatriarch();
+        CreationHelper factory = sheet.getWorkbook().getCreationHelper();
+
+        // 创建注释框
+        ClientAnchor anchor = factory.createClientAnchor();
+        // 确保 anchor 对象配置正确
+        anchor.setCol1(cell.getColumnIndex());  // 设置注释的列
+        anchor.setRow1(cell.getRowIndex());    // 设置注释的行
+        Comment comment = drawing.createCellComment(anchor);
+        comment.setString(factory.createRichTextString(commentText));
+
+        // 绑定注释到单元格
+        cell.setCellComment(comment);
+    }
+
     /**
      * 设置单元格信息
-     * 
+     *
      * @param value 单元格值
      * @param attr 注解相关
      * @param cell 单元格信息
@@ -743,7 +764,7 @@ public class ExcelUtil<T>
 
     /**
      * 设置 POI XSSFSheet 单元格提示
-     * 
+     *
      * @param sheet 表单
      * @param promptTitle 提示标题
      * @param promptContent 提示内容
@@ -766,7 +787,7 @@ public class ExcelUtil<T>
 
     /**
      * 设置某些列的值只能输入预制的数据,显示下拉框.
-     * 
+     *
      * @param sheet 要设置的sheet.
      * @param textlist 下拉框显示的内容
      * @param firstRow 开始行
@@ -800,7 +821,7 @@ public class ExcelUtil<T>
 
     /**
      * 解析导出值 0=男,1=女,2=未知
-     * 
+     *
      * @param propertyValue 参数值
      * @param converterExp 翻译注解
      * @param separator 分隔符
@@ -837,7 +858,7 @@ public class ExcelUtil<T>
 
     /**
      * 反向解析值 男=0,女=1,未知=2
-     * 
+     *
      * @param propertyValue 参数值
      * @param converterExp 翻译注解
      * @param separator 分隔符
@@ -874,7 +895,7 @@ public class ExcelUtil<T>
 
     /**
      * 解析字典值
-     * 
+     *
      * @param dictValue 字典值
      * @param dictType 字典类型
      * @param separator 分隔符
@@ -887,7 +908,7 @@ public class ExcelUtil<T>
 
     /**
      * 反向解析值字典值
-     * 
+     *
      * @param dictLabel 字典标签
      * @param dictType 字典类型
      * @param separator 分隔符
@@ -955,7 +976,7 @@ public class ExcelUtil<T>
 
     /**
      * 获取下载路径
-     * 
+     *
      * @param filename 文件名称
      */
     public String getAbsoluteFile(String filename)
@@ -971,7 +992,7 @@ public class ExcelUtil<T>
 
     /**
      * 获取bean中的属性值
-     * 
+     *
      * @param vo 实体对象
      * @param field 字段
      * @param excel 注解
@@ -1002,7 +1023,7 @@ public class ExcelUtil<T>
 
     /**
      * 以类的属性的get方法方法形式获取值
-     * 
+     *
      * @param o
      * @param name
      * @return value
@@ -1087,7 +1108,7 @@ public class ExcelUtil<T>
 
     /**
      * 创建工作表
-     * 
+     *
      * @param sheetNo sheet数量
      * @param index 序号
      */
@@ -1108,7 +1129,7 @@ public class ExcelUtil<T>
 
     /**
      * 获取单元格值
-     * 
+     *
      * @param row 获取的行
      * @param column 获取单元格列号
      * @return 单元格值
@@ -1168,7 +1189,7 @@ public class ExcelUtil<T>
 
     /**
      * 判断是否是空行
-     * 
+     *
      * @param row 判断的行
      * @return
      */

+ 13 - 2
fs-company/src/main/java/com/fs/company/controller/store/FsStoreOrderController.java

@@ -130,7 +130,7 @@ public class FsStoreOrderController extends BaseController
         task.setCompanyUserId(userId);
         exportTaskService.insertFsExportTask(task);
         param.setTaskId(task.getTaskId());
-        exportTaskService.exportStore1Data(param);
+        exportTaskService.exportStore1Data(param,false);
         return new AjaxResult(200,"后台正在导出,请等待...任务ID:"+task.getTaskId(),task.getTaskId());
 
 
@@ -172,7 +172,7 @@ public class FsStoreOrderController extends BaseController
         task.setCompanyUserId(userId);
         exportTaskService.insertFsExportTask(task);
         param.setTaskId(task.getTaskId());
-        exportTaskService.exportStore1Data(param);
+        exportTaskService.exportStore1Data(param,false);
         return new AjaxResult(200,"后台正在导出,请等待...任务ID:"+task.getTaskId(),task.getTaskId());
     }
     /**
@@ -298,6 +298,17 @@ public class FsStoreOrderController extends BaseController
         return toAjax(fsStoreOrderService.updateFsStoreOrder(fsStoreOrder));
     }
 
+    /**
+     * 修改订单
+     */
+    @PreAuthorize("@ss.hasPermi('his:storeOrder:edit')")
+    @Log(title = "订单", businessType = BusinessType.UPDATE)
+    @PutMapping("/updateStoreOrder")
+    public R updateStoreOrder(@RequestBody FsStoreOrder fsStoreOrder)
+    {
+        return fsStoreOrderService.updateStoreOrder(fsStoreOrder);
+    }
+
     /**
      * 删除订单
      */

+ 1 - 0
fs-service/src/main/java/com/fs/his/enums/FsStoreOrderStatusEnum.java

@@ -17,6 +17,7 @@ public enum FsStoreOrderStatusEnum {
     STATUS_2(2,"待发货"),
     STATUS_3(3,"待收货"),
     STATUS_4(4,"已完成"),
+    STATUS_6(6,"待推送"), //金牛代服特殊状态
 
     REFUND_STATUS_0(0,"正常"),
     REFUND_STATUS_1(1,"退款中"),

+ 1 - 1
fs-service/src/main/java/com/fs/his/service/IFsExportTaskService.java

@@ -63,7 +63,7 @@ public interface IFsExportTaskService
 
     Integer isExportType1( Long userId);
 
-    public void exportStore1Data(FsStoreOrderParam param);
+    public void exportStore1Data(FsStoreOrderParam param,boolean isAdmin);
 
     public void exportStoreData(FsStoreOrderParam fsStoreOrder);
 

+ 10 - 0
fs-service/src/main/java/com/fs/his/service/IFsStoreOrderService.java

@@ -62,6 +62,14 @@ public interface IFsStoreOrderService
      */
     public int updateFsStoreOrder(FsStoreOrder fsStoreOrder);
 
+    /**
+     * 修改订单状态-收货信息
+     *
+     * @param fsStoreOrder 订单
+     * @return 结果(含具体报错信息)
+     */
+    R updateStoreOrder(FsStoreOrder fsStoreOrder);
+
     /**
      * 批量删除订单
      *
@@ -248,4 +256,6 @@ public interface IFsStoreOrderService
 
     List<FsStoreOrderListVO> selectFsStoreOrderListVOByErpAccount(FsStoreOrderParam fsStoreOrder);
     List<FsStoreOrder> selectFsStoreOrderByFsUserId(Long fsUserId);
+
+    String importOrderStatusData(List<FsStoreOrderStatusExcelVO> list);
 }

+ 6 - 2
fs-service/src/main/java/com/fs/his/service/impl/FsExportTaskServiceImpl.java

@@ -11,6 +11,7 @@ import com.fs.his.mapper.FsStorePaymentMapper;
 import com.fs.his.param.FsStoreOrderParam;
 import com.fs.his.param.FsStorePaymentParam;
 import com.fs.his.service.IFsStoreOrderService;
+import com.fs.his.utils.PhoneUtil;
 import com.fs.his.vo.FsStoreOrderExcelVO;
 import com.fs.his.vo.FsStoreOrderExportVO;
 import com.fs.his.vo.FsStorePaymentExcelVO;
@@ -117,7 +118,7 @@ public class FsExportTaskServiceImpl implements IFsExportTaskService
 
     @Async
     @Override
-    public void exportStore1Data(FsStoreOrderParam fsStoreOrder) {
+    public void exportStore1Data(FsStoreOrderParam fsStoreOrder,boolean isAdmin) {
         List<FsStoreOrderExportVO> list = fsStoreOrderMapper.selectFsStoreOrderListVOByExport(fsStoreOrder);
         //对手机号脱敏
         if (list != null) {
@@ -126,9 +127,12 @@ public class FsExportTaskServiceImpl implements IFsExportTaskService
                 if (vo.getCycle()!=null){
                     vo.setFollowCount(vo.getCycle()/ vo.getFollowFrequency());
                 }
-                if (vo.getUserPhone() != null) {
+                if (vo.getUserPhone() != null &&  !isAdmin) {
                     vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
                 }
+                if (vo.getUserPhone() != null && isAdmin && vo.getUserPhone().length()>11) {
+                    vo.setUserPhone(PhoneUtil.decryptPhone(vo.getUserPhone()));
+                }
                 if (vo.getUserAddress() != null) {
                     vo.setUserAddress(ParseUtils.parseAddress(vo.getUserAddress()));
                 }

+ 127 - 4
fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java

@@ -10,10 +10,7 @@ import com.fs.common.core.domain.R;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.common.exception.CustomException;
 import com.fs.common.exception.ServiceException;
-import com.fs.common.utils.DateUtils;
-import com.fs.common.utils.ParseUtils;
-import com.fs.common.utils.ServletUtils;
-import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.*;
 import com.fs.common.utils.ip.IpUtils;
 import com.fs.company.domain.Company;
 import com.fs.company.domain.CompanyDept;
@@ -305,6 +302,56 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
         return fsStoreOrderMapper.updateFsStoreOrder(fsStoreOrder);
     }
 
+    /**
+     * 修改订单状态-收货信息
+     *
+     * @param fsStoreOrder 订单
+     * @return 结果(含具体报错信息)
+     */
+    @Override
+    public R updateStoreOrder(FsStoreOrder fsStoreOrder) {
+        //userPhone 电话处理
+        String userPhone = fsStoreOrder.getUserPhone();
+        if (StringUtils.isNotBlank(userPhone)) {
+            if (!userPhone.contains("*")){
+                fsStoreOrder.setUserPhone(userPhone);
+            } else {
+                userPhone = null;
+                fsStoreOrder.setUserPhone(null);
+            }
+        }
+        String userAddress = fsStoreOrder.getUserAddress();
+        if (StringUtils.isNotBlank(userAddress)) {
+            if (!userAddress.contains("*")){
+                fsStoreOrder.setUserAddress(userAddress);
+            } else {
+                userAddress = null;
+                fsStoreOrder.setUserAddress(null);
+            }
+        }
+        FsStoreOrder oldOrder = fsStoreOrderMapper.selectFsStoreOrderByOrderId(fsStoreOrder.getOrderId());
+        if (oldOrder == null) return R.error("修改订单不存在");
+        if (StringUtils.isNotBlank(userAddress)){
+            if (userAddress.equals(oldOrder.getUserAddress())) {
+                userAddress = null;
+            }
+        }
+        if (StringUtils.isNotBlank(userAddress) || StringUtils.isNotBlank(userPhone)){
+            Integer status = fsStoreOrder.getStatus();
+            if (status == null){
+                status = oldOrder.getStatus();
+            }
+            if (Objects.equals(FsStoreOrderStatusEnum.STATUS_1.getValue(), status) || Objects.equals(FsStoreOrderStatusEnum.STATUS_6.getValue(), status)) {
+                fsStoreOrder.setUserAddress(StringUtils.isNotBlank(userAddress)?null:userAddress);
+                fsStoreOrder.setUserPhone(StringUtils.isNotBlank(userPhone)?null:userPhone);
+            } else {
+                return R.error("该订单状态不支持修改收货地址/电话");
+            }
+        }
+        fsStoreOrder.setUpdateTime(DateUtils.getNowDate());
+        return fsStoreOrderMapper.updateFsStoreOrder(fsStoreOrder)>0?R.ok():R.error();
+    }
+
     /**
      * 批量删除订单
      *
@@ -3422,4 +3469,80 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
         return fsStoreOrderMapper.selectFsStoreOrderByFsUserId(fsUserId);
     }
 
+    @Override
+    public String importOrderStatusData(List<FsStoreOrderStatusExcelVO> list) {
+        if (StringUtils.isNull(list) || list.isEmpty()) {
+            throw new ServiceException("导入数据不能为空!");
+        }
+        int successNum = 0;
+        int failureNum = 0;
+        StringBuilder successMsg = new StringBuilder();
+        StringBuilder failureMsg = new StringBuilder();
+        for (FsStoreOrderStatusExcelVO vo : list) {
+            try {
+                //1.必填参数
+                ExcelUtils.validateRequiredFields(vo, list.indexOf(vo) + 1); // 传入行号
+                FsStoreOrder o = fsStoreOrderMapper.selectFsStoreOrderByOrderCode(vo.getOrderCode());
+                if (o ==null){
+                    failureNum++;
+                    String msg = "<br/>" + failureNum + "、订单编号 " + vo.getOrderCode() + " 导入失败:";
+                    failureMsg.append(msg).append("订单不存在");
+                    continue;
+                }
+                FsStoreOrder param = new FsStoreOrder(); //修改订单的参数
+                param.setOrderCode(vo.getOrderCode());
+                param.setOrderId(o.getOrderId());
+                if ("6".equals(vo.getStatus())) {
+                    failureNum++;
+                    String msg = "<br/>" + failureNum + "、订单编号 " + vo.getOrderCode() + " 导入失败:";
+                    failureMsg.append(msg).append("该状态不支持修改为待推送");
+                    continue;
+                }
+
+                Integer status = o.getStatus();
+
+                if (StringUtils.isNotBlank(vo.getStatus())){
+                    param.setStatus(Integer.valueOf(vo.getStatus()));
+                    status = Integer.valueOf(vo.getStatus());
+                }
+                /**
+                 * 地址和电话仅待付款和待推送可以修改
+                 */
+                String userAddress = vo.getUserAddress();
+                String userPhone = vo.getUserPhone();
+                if (StringUtils.isNotBlank(userAddress) || StringUtils.isNotBlank(userPhone)){
+                    if (Objects.equals(FsStoreOrderStatusEnum.STATUS_1.getValue(), status) || Objects.equals(FsStoreOrderStatusEnum.STATUS_6.getValue(), status)) {
+                        param.setUserAddress(userAddress.isEmpty()?null:userAddress);
+                        param.setUserPhone(userPhone.isEmpty()?null:userPhone);
+                    } else {
+                        failureNum++;
+                        String msg = "<br/>" + failureNum + "、订单编号 " + vo.getOrderCode() + " 修改失败:";
+                        failureMsg.append(msg).append("该状态不支持修改收货人地址或电话");
+                        continue;
+                    }
+                }
+                param.setDeliveryStatus((vo.getDeliveryStatus()==null|| vo.getDeliveryStatus().isEmpty())?null:Integer.valueOf(vo.getDeliveryStatus()));
+                param.setDeliveryType(vo.getDeliveryType().isEmpty()?null:vo.getDeliveryType());
+                param.setUpdateTime(DateUtils.getNowDate());
+                fsStoreOrderMapper.updateFsStoreOrder(param);
+
+                successNum++;
+                successMsg.append("<br/>").append(successNum).append("、订单编号 ").append(vo.getOrderCode()).append(" 修改成功");
+
+            } catch (Exception e) {
+
+                failureNum++;
+                String msg = "<br/>" + failureNum + "、订单编号 " + vo.getOrderCode() + " 修改失败:";
+                failureMsg.append(msg).append(e.getMessage());
+            }
+        }
+        if (failureNum > 0) {
+            failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
+            throw new ServiceException(failureMsg.toString());
+        } else {
+            successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
+        }
+        return successMsg.toString();
+    }
+
 }

+ 32 - 0
fs-service/src/main/java/com/fs/his/vo/FsStoreOrderStatusExcelVO.java

@@ -0,0 +1,32 @@
+package com.fs.his.vo;
+
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+@Data
+public class FsStoreOrderStatusExcelVO {
+
+    @Excel(name = "药品订单号",required = true)
+    private String orderCode;
+
+    @Excel(name = "订单状态",dictType = "sys_order_status")
+    private String status;
+
+
+    /** 物流状态 */
+    @Excel(name = "物流状态",dictType = "sys_store_order_delivery_status")
+    private String deliveryStatus;
+
+    /** 物流跟踪状态 */
+    @Excel(name = "物流跟踪状态",dictType = "sys_delivery_type")
+    private String deliveryType;
+
+    /** shou */
+    @Excel(name = "收货人电话")
+    private String userPhone;
+    /** 详情地址 */
+    @Excel(name = "详情地址")
+    private String userAddress;
+
+
+}

+ 16 - 13
fs-service/src/main/java/com/fs/system/mapper/SysRoleMapper.java

@@ -2,17 +2,18 @@ package com.fs.system.mapper;
 
 import java.util.List;
 import com.fs.common.core.domain.entity.SysRole;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 角色表 数据层
- * 
+ *
 
  */
 public interface SysRoleMapper
 {
     /**
      * 根据条件分页查询角色数据
-     * 
+     *
      * @param role 角色信息
      * @return 角色数据集合信息
      */
@@ -20,7 +21,7 @@ public interface SysRoleMapper
 
     /**
      * 根据用户ID查询角色
-     * 
+     *
      * @param userId 用户ID
      * @return 角色列表
      */
@@ -28,14 +29,14 @@ public interface SysRoleMapper
 
     /**
      * 查询所有角色
-     * 
+     *
      * @return 角色列表
      */
     public List<SysRole> selectRoleAll();
 
     /**
      * 根据用户ID获取角色选择框列表
-     * 
+     *
      * @param userId 用户ID
      * @return 选中角色ID列表
      */
@@ -43,7 +44,7 @@ public interface SysRoleMapper
 
     /**
      * 通过角色ID查询角色
-     * 
+     *
      * @param roleId 角色ID
      * @return 角色对象信息
      */
@@ -51,7 +52,7 @@ public interface SysRoleMapper
 
     /**
      * 根据用户ID查询角色
-     * 
+     *
      * @param userName 用户名
      * @return 角色列表
      */
@@ -59,7 +60,7 @@ public interface SysRoleMapper
 
     /**
      * 校验角色名称是否唯一
-     * 
+     *
      * @param roleName 角色名称
      * @return 角色信息
      */
@@ -67,7 +68,7 @@ public interface SysRoleMapper
 
     /**
      * 校验角色权限是否唯一
-     * 
+     *
      * @param roleKey 角色权限
      * @return 角色信息
      */
@@ -75,7 +76,7 @@ public interface SysRoleMapper
 
     /**
      * 修改角色信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -83,7 +84,7 @@ public interface SysRoleMapper
 
     /**
      * 新增角色信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -91,7 +92,7 @@ public interface SysRoleMapper
 
     /**
      * 通过角色ID删除角色
-     * 
+     *
      * @param roleId 角色ID
      * @return 结果
      */
@@ -99,9 +100,11 @@ public interface SysRoleMapper
 
     /**
      * 批量删除角色信息
-     * 
+     *
      * @param roleIds 需要删除的角色ID
      * @return 结果
      */
     public int deleteRoleByIds(Long[] roleIds);
+
+    List<SysRole> selectSysRoleByIds(Long[] roleIds);
 }

+ 23 - 21
fs-service/src/main/java/com/fs/system/service/ISysRoleService.java

@@ -7,14 +7,14 @@ import com.fs.system.domain.SysUserRole;
 
 /**
  * 角色业务层
- * 
+ *
 
  */
 public interface ISysRoleService
 {
     /**
      * 根据条件分页查询角色数据
-     * 
+     *
      * @param role 角色信息
      * @return 角色数据集合信息
      */
@@ -22,7 +22,7 @@ public interface ISysRoleService
 
     /**
      * 根据用户ID查询角色列表
-     * 
+     *
      * @param userId 用户ID
      * @return 角色列表
      */
@@ -30,7 +30,7 @@ public interface ISysRoleService
 
     /**
      * 根据用户ID查询角色权限
-     * 
+     *
      * @param userId 用户ID
      * @return 权限列表
      */
@@ -38,14 +38,14 @@ public interface ISysRoleService
 
     /**
      * 查询所有角色
-     * 
+     *
      * @return 角色列表
      */
     public List<SysRole> selectRoleAll();
 
     /**
      * 根据用户ID获取角色选择框列表
-     * 
+     *
      * @param userId 用户ID
      * @return 选中角色ID列表
      */
@@ -53,7 +53,7 @@ public interface ISysRoleService
 
     /**
      * 通过角色ID查询角色
-     * 
+     *
      * @param roleId 角色ID
      * @return 角色对象信息
      */
@@ -61,7 +61,7 @@ public interface ISysRoleService
 
     /**
      * 校验角色名称是否唯一
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -69,7 +69,7 @@ public interface ISysRoleService
 
     /**
      * 校验角色权限是否唯一
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -77,21 +77,21 @@ public interface ISysRoleService
 
     /**
      * 校验角色是否允许操作
-     * 
+     *
      * @param role 角色信息
      */
     public void checkRoleAllowed(SysRole role);
 
     /**
      * 校验角色是否有数据权限
-     * 
+     *
      * @param roleId 角色id
      */
     public void checkRoleDataScope(Long roleId);
 
     /**
      * 通过角色ID查询角色使用数量
-     * 
+     *
      * @param roleId 角色ID
      * @return 结果
      */
@@ -99,7 +99,7 @@ public interface ISysRoleService
 
     /**
      * 新增保存角色信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -107,7 +107,7 @@ public interface ISysRoleService
 
     /**
      * 修改保存角色信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -115,7 +115,7 @@ public interface ISysRoleService
 
     /**
      * 修改角色状态
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -123,7 +123,7 @@ public interface ISysRoleService
 
     /**
      * 修改数据权限信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -131,7 +131,7 @@ public interface ISysRoleService
 
     /**
      * 通过角色ID删除角色
-     * 
+     *
      * @param roleId 角色ID
      * @return 结果
      */
@@ -139,7 +139,7 @@ public interface ISysRoleService
 
     /**
      * 批量删除角色信息
-     * 
+     *
      * @param roleIds 需要删除的角色ID
      * @return 结果
      */
@@ -147,7 +147,7 @@ public interface ISysRoleService
 
     /**
      * 取消授权用户角色
-     * 
+     *
      * @param userRole 用户和角色关联信息
      * @return 结果
      */
@@ -155,7 +155,7 @@ public interface ISysRoleService
 
     /**
      * 批量取消授权用户角色
-     * 
+     *
      * @param roleId 角色ID
      * @param userIds 需要取消授权的用户数据ID
      * @return 结果
@@ -164,10 +164,12 @@ public interface ISysRoleService
 
     /**
      * 批量选择授权用户角色
-     * 
+     *
      * @param roleId 角色ID
      * @param userIds 需要删除的用户数据ID
      * @return 结果
      */
     public int insertAuthUsers(Long roleId, Long[] userIds);
+
+    boolean getIsCheckPhone(Long[] roleIds);
 }

+ 37 - 22
fs-service/src/main/java/com/fs/system/service/impl/SysRoleServiceImpl.java

@@ -27,7 +27,7 @@ import com.fs.system.service.ISysRoleService;
 
 /**
  * 角色 业务层处理
- * 
+ *
 
  */
 @Service
@@ -47,7 +47,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 根据条件分页查询角色数据
-     * 
+     *
      * @param role 角色信息
      * @return 角色数据集合信息
      */
@@ -60,7 +60,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 根据用户ID查询角色
-     * 
+     *
      * @param userId 用户ID
      * @return 角色列表
      */
@@ -85,7 +85,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 根据用户ID查询权限
-     * 
+     *
      * @param userId 用户ID
      * @return 权限列表
      */
@@ -106,7 +106,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 查询所有角色
-     * 
+     *
      * @return 角色列表
      */
     @Override
@@ -117,7 +117,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 根据用户ID获取角色选择框列表
-     * 
+     *
      * @param userId 用户ID
      * @return 选中角色ID列表
      */
@@ -129,7 +129,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 通过角色ID查询角色
-     * 
+     *
      * @param roleId 角色ID
      * @return 角色对象信息
      */
@@ -141,7 +141,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 校验角色名称是否唯一
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -159,7 +159,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 校验角色权限是否唯一
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -177,7 +177,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 校验角色是否允许操作
-     * 
+     *
      * @param role 角色信息
      */
     @Override
@@ -191,7 +191,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 校验角色是否有数据权限
-     * 
+     *
      * @param roleId 角色id
      */
     @Override
@@ -211,7 +211,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 通过角色ID查询角色使用数量
-     * 
+     *
      * @param roleId 角色ID
      * @return 结果
      */
@@ -223,7 +223,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 新增保存角色信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -238,7 +238,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 修改保存角色信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -255,7 +255,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 修改角色状态
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -267,7 +267,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 修改数据权限信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -285,7 +285,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 新增角色菜单信息
-     * 
+     *
      * @param role 角色对象
      */
     public int insertRoleMenu(SysRole role)
@@ -333,7 +333,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 通过角色ID删除角色
-     * 
+     *
      * @param roleId 角色ID
      * @return 结果
      */
@@ -350,7 +350,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 批量删除角色信息
-     * 
+     *
      * @param roleIds 需要删除的角色ID
      * @return 结果
      */
@@ -376,7 +376,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 取消授权用户角色
-     * 
+     *
      * @param userRole 用户和角色关联信息
      * @return 结果
      */
@@ -388,7 +388,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 批量取消授权用户角色
-     * 
+     *
      * @param roleId 角色ID
      * @param userIds 需要取消授权的用户数据ID
      * @return 结果
@@ -401,7 +401,7 @@ public class SysRoleServiceImpl implements ISysRoleService
 
     /**
      * 批量选择授权用户角色
-     * 
+     *
      * @param roleId 角色ID
      * @param userIds 需要删除的用户数据ID
      * @return 结果
@@ -420,4 +420,19 @@ public class SysRoleServiceImpl implements ISysRoleService
         }
         return userRoleMapper.batchUserRole(list);
     }
+
+    @Override
+    public boolean getIsCheckPhone(Long[] roleIds) {
+        if (roleIds != null && roleIds.length > 0){
+            List<SysRole> roles = roleMapper.selectSysRoleByIds(roleIds);
+            if (roles != null && !roles.isEmpty()){
+                for (SysRole role : roles) {
+                    if (role.getIsCheckPhone() == 1){
+                        return true;
+                    }
+                }
+            }
+        }
+        return false;
+    }
 }

+ 1 - 1
fs-service/src/main/resources/application-common.yml

@@ -36,7 +36,7 @@ server:
 # 日志配置
 logging:
   level:
-    com.fs: debug
+    com.fs: info
     org.springframework: warn
 
 express:

+ 31 - 18
fs-service/src/main/resources/mapper/system/SysRoleMapper.xml

@@ -19,17 +19,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<result property="updateBy"           column="update_by"             />
 		<result property="updateTime"         column="update_time"           />
 		<result property="remark"             column="remark"                />
+		<result property="isCheckPhone"       column="is_check_phone"                />
 	</resultMap>
-	
+
 	<sql id="selectRoleVo">
 	    select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
-            r.status, r.del_flag, r.create_time, r.remark 
+            r.status, r.del_flag, r.create_time, r.remark,r.is_check_phone
         from sys_role r
 	        left join sys_user_role ur on ur.role_id = r.role_id
 	        left join sys_user u on u.user_id = ur.user_id
 	        left join sys_dept d on u.dept_id = d.dept_id
     </sql>
-    
+
     <select id="selectRoleList" parameterType="SysRole" resultMap="SysRoleResult">
 		<include refid="selectRoleVo"/>
 		where r.del_flag = '0'
@@ -51,20 +52,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
 			and date_format(r.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
 		</if>
+		<if test="params.isCheckPhone != null"><!-- 结束时间检索 -->
+			and r.is_check_phone = #{params.isCheckPhone}
+		</if>
 		<!-- 数据范围过滤 -->
 		${params.dataScope}
 		order by r.role_sort
 	</select>
-    
+
 	<select id="selectRolePermissionByUserId" parameterType="Long" resultMap="SysRoleResult">
 		<include refid="selectRoleVo"/>
 		WHERE r.del_flag = '0' and ur.user_id = #{userId}
 	</select>
-	
+
 	<select id="selectRoleAll" resultMap="SysRoleResult">
 		<include refid="selectRoleVo"/>
 	</select>
-	
+
 	<select id="selectRoleListByUserId" parameterType="Long" resultType="Integer">
 		select r.role_id
         from sys_role r
@@ -72,28 +76,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	        left join sys_user u on u.user_id = ur.user_id
 	    where u.user_id = #{userId}
 	</select>
-	
+
 	<select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult">
 		<include refid="selectRoleVo"/>
 		where r.role_id = #{roleId}
 	</select>
-	
+
 	<select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult">
 		<include refid="selectRoleVo"/>
 		WHERE r.del_flag = '0' and u.user_name = #{userName}
 	</select>
-	
+
 	<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
 		<include refid="selectRoleVo"/>
 		 where r.role_name=#{roleName} limit 1
 	</select>
-	
+
 	<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
 		<include refid="selectRoleVo"/>
 		 where r.role_key=#{roleKey} limit 1
 	</select>
-	
- 	<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
+	<select id="selectSysRoleByIds" resultType="com.fs.common.core.domain.entity.SysRole">
+		select role_id,is_check_phone from sys_role where role_id in
+		<foreach collection="array" item="roleId" open="(" separator="," close=")">
+			#{roleId}
+		</foreach>
+	</select>
+
+	<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
  		insert into sys_role(
  			<if test="roleId != null and roleId != 0">role_id,</if>
  			<if test="roleName != null and roleName != ''">role_name,</if>
@@ -105,6 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="status != null and status != ''">status,</if>
  			<if test="remark != null and remark != ''">remark,</if>
  			<if test="createBy != null and createBy != ''">create_by,</if>
+ 			<if test="isCheckPhone != null">is_check_phone,</if>
  			create_time
  		)values(
  			<if test="roleId != null and roleId != 0">#{roleId},</if>
@@ -117,10 +128,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="status != null and status != ''">#{status},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
+ 			<if test="isCheckPhone != null">#{isCheckPhone},</if>
  			sysdate()
  		)
 	</insert>
-	
+
 	<update id="updateRole" parameterType="SysRole">
  		update sys_role
  		<set>
@@ -133,20 +145,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="status != null and status != ''">status = #{status},</if>
  			<if test="remark != null">remark = #{remark},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+ 			<if test="isCheckPhone != null">is_check_phone = #{isCheckPhone},</if>
  			update_time = sysdate()
  		</set>
  		where role_id = #{roleId}
 	</update>
-	
+
 	<delete id="deleteRoleById" parameterType="Long">
 		update sys_role set del_flag = '2' where role_id = #{roleId}
  	</delete>
- 	
+
  	<delete id="deleteRoleByIds" parameterType="Long">
  	    update sys_role set del_flag = '2' where role_id in
  		<foreach collection="array" item="roleId" open="(" separator="," close=")">
  			#{roleId}
-        </foreach> 
+        </foreach>
  	</delete>
- 	
-</mapper> 
+
+</mapper>