Browse Source

Merge branch 'V0.0.5' of http://10.87.21.221:8000/jzyd_yyds/soc into V0.0.5

jiawuxian 1 year ago
parent
commit
b0c7de904c

+ 5 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/impl/CoreDrillPlanServiceImpl.java

@@ -634,6 +634,11 @@ public class CoreDrillPlanServiceImpl extends ServiceImpl<CoreDrillPlanMapper, C
     @Transactional(rollbackFor = Exception.class)
     public void deleteCoreDrillPlanByIds(Long id) {
         List<Long> list = baseMapper.selectIdByParentId(id);
+        if (ObjectUtil.isEmpty(list)) {
+            //说明没有下发,还是草稿状态
+            removeById(id);
+            return;
+        }
         Integer isExecute = coreDrillTaskMapper.selectCount(new LambdaQueryWrapper<CoreDrillTask>()
                         .in(CoreDrillTask::getPlanId, list)
                         .eq(CoreDrillTask::getStatus, DrillDoStatus.DONE.getCode()))

+ 5 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/service/impl/CoreEduTrainingPlanServiceImpl.java

@@ -626,6 +626,11 @@ public class CoreEduTrainingPlanServiceImpl extends ServiceImpl<CoreEduTrainingP
     @Transactional(rollbackFor = Exception.class)
     public void deleteCoreEduTrainingPlanByIds(Long id) {
         List<Long> list = baseMapper.selectIdByParentId(id);
+        if (ObjectUtil.isEmpty(list)) {
+            //说明没有下发,还是草稿状态
+            removeById(id);
+            return;
+        }
         Integer isExecute = coreEduTrainingTaskMapper.selectCount(new LambdaQueryWrapper<CoreEduTrainingTask>()
                         .in(CoreEduTrainingTask::getPlanId, list)
                         .eq(CoreEduTrainingTask::getStatus, EduTrainingDoStatus.DONE.getCode()))

+ 2 - 2
soc-modules/soc-modules-core/src/main/resources/bootstrap.yml

@@ -15,11 +15,11 @@ spring:
       discovery:
         namespace: 13d6af5d-c288-40d6-b1ee-4fc370665aba
         # 服务注册地址
-        server-addr: 10.87.10.54:8848
+        server-addr: 10.87.21.102:8848
       config:
         namespace: 13d6af5d-c288-40d6-b1ee-4fc370665aba
         # 配置中心地址
-        server-addr: 10.87.10.54:8848
+        server-addr: 10.87.21.102:8848
         # 配置文件格式
         file-extension: yml
         # 共享配置

+ 1 - 1
soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/FileUploadUtils.java

@@ -110,7 +110,7 @@ public class FileUploadUtils
         String fileName = extractFilename(file);
 
         String absPath = getAbsoluteFile(baseDir, fileName).getAbsolutePath();
-        String type = FileTypeUtil.getType(file.getInputStream());
+        String type = FileTypeUtil.getType(file.getInputStream(),fileName);
         File target = FileUtils.getFile(absPath);
         file.transferTo(target);
         if(!isAllowedExtension(type,allowedExtension)){

+ 11 - 2
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysDeptController.java

@@ -66,8 +66,15 @@ public class SysDeptController extends BaseController {
      */
     @RequiresPermissions("system:dept:list")
     @GetMapping("/list")
-    public TableDataInfo<SysOrg> list(SysOrg dept) {
-        return orgService.selectPage(dept);
+    public AjaxResult list(SysOrg dept) {
+        AjaxResult ajaxResult = AjaxResult.success();
+        ajaxResult.put(AjaxResult.DATA_TAG, orgService.selectPage(dept));
+        boolean isEdit = false;
+        if (SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
+            isEdit = true;
+        }
+        ajaxResult.put("isEdit", isEdit);
+        return ajaxResult;
     }
 
     @RequiresPermissions("system:dept:exportConstructionDetails")
@@ -100,6 +107,7 @@ public class SysDeptController extends BaseController {
             response.setCharacterEncoding("utf-8");
         }
     }
+
     @RequiresPermissions("system:dept:exportSecurityWork")
     @PostMapping("/exportSecurityWork")
     public void exportSecurityWork(SysOrg dept, HttpServletResponse response) {
@@ -129,6 +137,7 @@ public class SysDeptController extends BaseController {
             response.setCharacterEncoding("utf-8");
         }
     }
+
     @RequiresPermissions("system:dept:exportConstruction")
     @PostMapping("/exportConstruction")
     public void exportConstruction(SysOrg dept, HttpServletResponse response) {

+ 6 - 4
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysDeviceController.java

@@ -230,10 +230,12 @@ public class SysDeviceController extends BaseController {
                                 throw new RuntimeException("设备" + d.getDeviceName() + "关联主机不正确");
                             }
                         }
-                        if (d.getDefinition().equals("是")){
-                            sysDevice.setDefinition("1");
-                        }else {
-                            sysDevice.setDefinition("0");
+                        if(null!=d.getDefinition()){
+                            if (d.getDefinition().equals("是")){
+                                sysDevice.setDefinition("1");
+                            }else {
+                                sysDevice.setDefinition("0");
+                            }
                         }
                         if (d.getAssetType().equals("消防类")) {
                             if (null == d.getCheckTime()) {

+ 0 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysUserController.java

@@ -636,7 +636,6 @@ public class SysUserController extends BaseController {
             // 全部解析完成被调用
             @Override
             public void doAfterAllAnalysed(AnalysisContext analysisContext) {
-//                System.out.println("解析完成...");
                 List<String> names = list.stream().map(UserImport::getName).collect(Collectors.toList());
                 List<String> exist = userService.selectCountByNames(names);
                 if (exist.size() > 0) {

+ 1 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/UserExport.java

@@ -13,7 +13,7 @@ import lombok.Setter;
 
 import java.util.Date;
 
-@Data
+@Data//导出
 @ColumnWidth(15) //列宽,最大值为255
 @HeadRowHeight(16) //表头行高
 @ContentRowHeight(16) //数据行高

+ 9 - 11
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/UserImport.java

@@ -13,7 +13,7 @@ import java.util.Date;
  * @author :LuoWei
  * @date : 2023/11/15
  */
-@Data
+@Data//导出
 @ColumnWidth(15) //列宽,最大值为255
 @HeadRowHeight(16) //表头行高
 @ContentRowHeight(16) //数据行高
@@ -29,16 +29,14 @@ public class UserImport {
     private String orgName;
     @ExcelProperty(value = "用户角色", index = 4)
     private String roleNames;
-    @ExcelProperty(value = "手机号码", index = 5)
-    private String phone;
-    @ExcelProperty(value = "性别", index = 6)
-    private String gender;
-    @ExcelProperty(value = "账号状态", index = 7)
+    @ExcelProperty(value = "账号状态", index = 5)
     private String isLock;
-    @ExcelProperty(value = "安保部门从业人员", index = 8)
+    @ExcelProperty(value = "安保部门从业人员", index = 6)
     private String isManage;
-    @ExcelProperty(value = "登录IP", index = 9)
-    private String lastIp;
-    @ExcelProperty(value = "登录时间", index = 10)
-    private Date lastTime;
+    @ExcelProperty(value = "手机号码", index = 7)
+    private String phone;
+    @ExcelProperty(value = "性别", index = 8)
+    private String gender;
+
+
 }