|
|
@ -4,6 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|
|
|
import com.baomidou.mybatisplus.extension.api.R; |
|
|
|
import com.baomidou.mybatisplus.extension.api.R; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
|
|
|
import net.sourceforge.pinyin4j.PinyinHelper; |
|
|
|
|
|
|
|
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; |
|
|
|
|
|
|
|
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; |
|
|
|
|
|
|
|
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; |
|
|
|
|
|
|
|
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; |
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
|
|
|
import org.apache.poi.ss.usermodel.Cell; |
|
|
|
import org.apache.poi.ss.usermodel.Cell; |
|
|
|
import org.apache.poi.ss.usermodel.Row; |
|
|
|
import org.apache.poi.ss.usermodel.Row; |
|
|
@ -479,12 +484,6 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl |
|
|
|
modulexVo.setRelatedBean(value); |
|
|
|
modulexVo.setRelatedBean(value); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 16: |
|
|
|
case 16: |
|
|
|
modulexVo.setPrototypes(value); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 17: |
|
|
|
|
|
|
|
modulexVo.setDiagrams(value); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 18: |
|
|
|
|
|
|
|
if (value == null || value == "") { |
|
|
|
if (value == null || value == "") { |
|
|
|
message.put("isVisible", "false"); |
|
|
|
message.put("isVisible", "false"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
@ -492,7 +491,7 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl |
|
|
|
} |
|
|
|
} |
|
|
|
modulexVo.setStatus(value); |
|
|
|
modulexVo.setStatus(value); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 19: |
|
|
|
case 17: |
|
|
|
if (value == null || value == "") { |
|
|
|
if (value == null || value == "") { |
|
|
|
message.put("isVisible", "false"); |
|
|
|
message.put("isVisible", "false"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
@ -500,7 +499,7 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl |
|
|
|
} |
|
|
|
} |
|
|
|
modulexVo.setVerisonStatus(value); |
|
|
|
modulexVo.setVerisonStatus(value); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 20: |
|
|
|
case 18: |
|
|
|
if (value == null || value == "") { |
|
|
|
if (value == null || value == "") { |
|
|
|
message.put("isVisible", "false"); |
|
|
|
message.put("isVisible", "false"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
@ -621,6 +620,23 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("导入失败,模块编码不能为空或者模块编码过长"); |
|
|
|
return Result.error("导入失败,模块编码不能为空或者模块编码过长"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
String modulecode = null; |
|
|
|
|
|
|
|
LambdaQueryWrapper<Projectx> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
queryWrapper.eq(Projectx::getProjectName,projectId); |
|
|
|
|
|
|
|
Projectx projectx = projectxService.getOne(queryWrapper); |
|
|
|
|
|
|
|
String firstChar = this.toFirstChar(moduleName); |
|
|
|
|
|
|
|
String projectCode = projectx.getProjectCode(); |
|
|
|
|
|
|
|
if(projectCode==null){ |
|
|
|
|
|
|
|
message.put("isVisible", "false"); |
|
|
|
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
|
|
|
return Result.error("项目编码不存在,请重新填写"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
modulecode = projectCode + firstChar; |
|
|
|
|
|
|
|
if(!modulecode.equals(moduleCode)){ |
|
|
|
|
|
|
|
message.put("isVisible", "false"); |
|
|
|
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
|
|
|
return Result.error("模块编码不规范,导入失败"); |
|
|
|
|
|
|
|
} |
|
|
|
modulex.setModuleCode(moduleCode); |
|
|
|
modulex.setModuleCode(moduleCode); |
|
|
|
String pmDescribe = modulexTemplate.getPmDescribe(); |
|
|
|
String pmDescribe = modulexTemplate.getPmDescribe(); |
|
|
|
if(StringUtils.isBlank(pmDescribe)){ |
|
|
|
if(StringUtils.isBlank(pmDescribe)){ |
|
|
@ -631,20 +647,23 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl |
|
|
|
modulex.setManagerUsers(null); |
|
|
|
modulex.setManagerUsers(null); |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
LambdaQueryWrapper<SysUser> sysUserLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<SysUser> sysUserLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
sysUserLambdaQueryWrapper.eq(SysUser::getUsername,managerUsers); |
|
|
|
String[] split = managerUsers.split(","); |
|
|
|
SysUser iSysUserServiceOne = iSysUserService.getOne(sysUserLambdaQueryWrapper); |
|
|
|
// sysUserLambdaQueryWrapper.eq(SysUser::getUsername,managerUsers);
|
|
|
|
|
|
|
|
sysUserLambdaQueryWrapper.in(SysUser::getUsername,split); |
|
|
|
|
|
|
|
List<SysUser> iSysUserServiceOne = iSysUserService.list(sysUserLambdaQueryWrapper); |
|
|
|
if(iSysUserServiceOne==null){ |
|
|
|
if(iSysUserServiceOne==null){ |
|
|
|
message.put("isVisible", "false"); |
|
|
|
message.put("isVisible", "false"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("导入失败,责任人信息查询不到"); |
|
|
|
return Result.error("导入失败,责任人信息查询不到"); |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
String id = iSysUserServiceOne.getId(); |
|
|
|
List<String> list = iSysUserServiceOne.stream().map(SysUser::getId).collect(Collectors.toList()); |
|
|
|
if (id == null) { |
|
|
|
// String id = iSysUserServiceOne.getId();
|
|
|
|
|
|
|
|
if (list == null) { |
|
|
|
message.put("isVisible", "false"); |
|
|
|
message.put("isVisible", "false"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("导入失败,责任人信息查询不到"); |
|
|
|
return Result.error("导入失败,责任人信息查询不到"); |
|
|
|
} |
|
|
|
} |
|
|
|
modulex.setManagerUsers(id); |
|
|
|
modulex.setManagerUsers(String.valueOf(list)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
String workLevel = modulexTemplate.getWorkLevel(); |
|
|
|
String workLevel = modulexTemplate.getWorkLevel(); |
|
|
@ -784,14 +803,6 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl |
|
|
|
return Result.error("关联实体不存在"); |
|
|
|
return Result.error("关联实体不存在"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
String prototypes = modulexTemplate.getPrototypes(); |
|
|
|
|
|
|
|
if(StringUtils.isBlank(prototypes)){ |
|
|
|
|
|
|
|
modulex.setPrototypes(null); |
|
|
|
|
|
|
|
}modulex.setPrototypes(prototypes); |
|
|
|
|
|
|
|
String diagrams = modulexTemplate.getDiagrams(); |
|
|
|
|
|
|
|
if(StringUtils.isBlank(diagrams)){ |
|
|
|
|
|
|
|
modulex.setDiagrams(null); |
|
|
|
|
|
|
|
}modulex.setDiagrams(diagrams); |
|
|
|
|
|
|
|
String status = modulexTemplate.getStatus(); |
|
|
|
String status = modulexTemplate.getStatus(); |
|
|
|
if(StringUtils.isBlank(status)){ |
|
|
|
if(StringUtils.isBlank(status)){ |
|
|
|
message.put("isVisible", "false"); |
|
|
|
message.put("isVisible", "false"); |
|
|
@ -1179,4 +1190,32 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl |
|
|
|
moduleFunctionRule.setVerison(x.getVerison()); |
|
|
|
moduleFunctionRule.setVerison(x.getVerison()); |
|
|
|
return moduleFunctionRule; |
|
|
|
return moduleFunctionRule; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 获取字符串拼音的第一个字母 |
|
|
|
|
|
|
|
* @param chinese |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String toFirstChar(String chinese){ |
|
|
|
|
|
|
|
String pinyinStr = ""; |
|
|
|
|
|
|
|
char[] newChar = chinese.toCharArray(); //转为单个字符
|
|
|
|
|
|
|
|
HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat(); |
|
|
|
|
|
|
|
defaultFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE); |
|
|
|
|
|
|
|
defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE); |
|
|
|
|
|
|
|
for (int i = 0; i < newChar.length; i++) { |
|
|
|
|
|
|
|
if (newChar[i] > 128) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
pinyinStr += PinyinHelper.toHanyuPinyinStringArray(newChar[i], defaultFormat)[0].charAt(0); |
|
|
|
|
|
|
|
} catch (BadHanyuPinyinOutputFormatCombination e) { |
|
|
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
pinyinStr += newChar[i]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return pinyinStr; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|