# Conflicts:
#	nursing-unit-system/nu-system-start/src/main/resources/application-dev.yml
#	nursing-unit-system/nu-system-start/src/main/resources/application-uat.yml
This commit is contained in:
1378012178@qq.com 2025-05-30 16:47:34 +08:00
commit 7161b4307e
22 changed files with 1663 additions and 888 deletions

View File

@ -1,6 +1,7 @@
package com.nu.modules.NuBizAdvisoryInfo.controller; package com.nu.modules.NuBizAdvisoryInfo.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nu.modules.NuBizAdvisoryInfo.entity.NuBizAdvisoryInfo; import com.nu.modules.NuBizAdvisoryInfo.entity.NuBizAdvisoryInfo;
@ -57,6 +58,11 @@ public class H5ApiAdvisoryInfoController extends JeecgController<NuBizAdvisoryIn
return Result.OK(nuBizAdvisoryInfo); return Result.OK(nuBizAdvisoryInfo);
} }
/**
* 获取是否有注册信息
* @param openId
* @return
*/
@GetMapping(value = "/queryByOpenId") @GetMapping(value = "/queryByOpenId")
public Result<NuBizAdvisoryInfo> queryByOpenId(@RequestParam(name="openId",required=true) String openId) { public Result<NuBizAdvisoryInfo> queryByOpenId(@RequestParam(name="openId",required=true) String openId) {
QueryWrapper<NuBizAdvisoryInfo> queryWrapper = new QueryWrapper<>(); QueryWrapper<NuBizAdvisoryInfo> queryWrapper = new QueryWrapper<>();
@ -97,4 +103,47 @@ public class H5ApiAdvisoryInfoController extends JeecgController<NuBizAdvisoryIn
} }
return Result.OK(nuBizAdvisoryInfo); return Result.OK(nuBizAdvisoryInfo);
} }
/**
* 获取微信信息
* @param openId
* @param wechatName
* @return
*/
@GetMapping(value = "/queryWeixinInfo")
public Result<NuBizAdvisoryInfo> queryByOpenId(@RequestParam(name="openId",required=true) String openId,@RequestParam(name="wechatName",required=true) String wechatName) {
NuBizAdvisoryInfo nuBizAdvisoryInfo = nuBizAdvisoryInfoService.queryWeixinInfo(openId,wechatName);
return Result.OK(nuBizAdvisoryInfo);
}
/**
* 根据openId修改serverUrl
* @param nuBizAdvisoryInfo
* @return
*/
@ApiOperation(value="修改咨询信息", notes="修改咨询信息")
@RequestMapping(value = "/editNuBizAdvisoryInfo", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> editNuBizAdvisoryInfo(@RequestBody NuBizAdvisoryInfo nuBizAdvisoryInfo) {
if(StringUtils.isEmpty(nuBizAdvisoryInfo.getOpenId())){
return Result.error("填写openId");
}
if(StringUtils.isEmpty(nuBizAdvisoryInfo.getServerUrl())){
return Result.error("填写微信名称");
}
QueryWrapper<NuBizAdvisoryInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("open_id",nuBizAdvisoryInfo.getOpenId());
NuBizAdvisoryInfo nuBizAdvisoryInfoQuery = nuBizAdvisoryInfoService.getOne(queryWrapper);
if(nuBizAdvisoryInfoQuery == null){
return Result.error("未找到对应数据");
}
UpdateWrapper<NuBizAdvisoryInfo> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("open_id",nuBizAdvisoryInfo.getOpenId());
updateWrapper.set("server_url",nuBizAdvisoryInfo.getServerUrl());
nuBizAdvisoryInfoService.update(updateWrapper);
return Result.OK("编辑成功!");
}
} }

View File

@ -11,4 +11,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface INuBizAdvisoryInfoService extends IService<NuBizAdvisoryInfo> { public interface INuBizAdvisoryInfoService extends IService<NuBizAdvisoryInfo> {
NuBizAdvisoryInfo queryWeixinInfo(String openId, String wechatName);
} }

View File

@ -1,5 +1,6 @@
package com.nu.modules.NuBizAdvisoryInfo.service.impl; package com.nu.modules.NuBizAdvisoryInfo.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.nu.modules.NuBizAdvisoryInfo.entity.NuBizAdvisoryInfo; import com.nu.modules.NuBizAdvisoryInfo.entity.NuBizAdvisoryInfo;
import com.nu.modules.NuBizAdvisoryInfo.mapper.NuBizAdvisoryInfoMapper; import com.nu.modules.NuBizAdvisoryInfo.mapper.NuBizAdvisoryInfoMapper;
import com.nu.modules.NuBizAdvisoryInfo.service.INuBizAdvisoryInfoService; import com.nu.modules.NuBizAdvisoryInfo.service.INuBizAdvisoryInfoService;
@ -16,4 +17,19 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service @Service
public class NuBizAdvisoryInfoServiceImpl extends ServiceImpl<NuBizAdvisoryInfoMapper, NuBizAdvisoryInfo> implements INuBizAdvisoryInfoService { public class NuBizAdvisoryInfoServiceImpl extends ServiceImpl<NuBizAdvisoryInfoMapper, NuBizAdvisoryInfo> implements INuBizAdvisoryInfoService {
@Override
public NuBizAdvisoryInfo queryWeixinInfo(String openId, String wechatName) {
QueryWrapper<NuBizAdvisoryInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("open_id",openId);
queryWrapper.eq("wechat_name",wechatName);
NuBizAdvisoryInfo nuBizAdvisoryInfo = baseMapper.selectOne(queryWrapper);
//查询是否有微信注册信息没有则创建
if(nuBizAdvisoryInfo==null) {
nuBizAdvisoryInfo = new NuBizAdvisoryInfo();
nuBizAdvisoryInfo.setOpenId(openId);
nuBizAdvisoryInfo.setWechatName(wechatName);
baseMapper.insert(nuBizAdvisoryInfo);
}
return nuBizAdvisoryInfo;
}
} }

View File

@ -0,0 +1,161 @@
package com.nu.modules.weixin.controller;
import com.alibaba.cloud.commons.lang.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nu.modules.appversionconfig.entity.AppVersionConfig;
import com.nu.modules.appversionconfig.service.IAppVersionConfigService;
import com.nu.modules.weixin.utils.SignUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.client.RestTemplate;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.client.RestTemplate;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
@RestController
@RequestMapping("/weixin")
@Slf4j
public class WeixinController {
@Value("${wechat.appId}")
private String appId;
@Value("${wechat.appSecret:}")
private String appSecret;
// RestTemplate 用于发送 HTTP 请求
private final RestTemplate restTemplate;
public WeixinController(RestTemplate restTemplate) {
this.restTemplate = restTemplate;
}
/**
* @description 微信公众号服务器配置校验token
* @author: liyinlong
* @date 2019-05-09 9:38
* @return
*/
@ApiOperation("微信公众号服务器配置校验token")
@RequestMapping("/checkToken")
public void checkToken(HttpServletRequest request,HttpServletResponse response){
//token验证代码段
try{
log.info("请求已到达开始校验token");
if (StringUtils.isNotBlank(request.getParameter("signature"))) {
String signature = request.getParameter("signature");
String timestamp = request.getParameter("timestamp");
String nonce = request.getParameter("nonce");
String echostr = request.getParameter("echostr");
log.info("signature[{}], timestamp[{}], nonce[{}], echostr[{}]", signature, timestamp, nonce, echostr);
if (SignUtil.checkSignature(signature, timestamp, nonce)) {
log.info("数据源为微信后台将echostr[{}]返回!", echostr);
response.getOutputStream().println(echostr);
}
}
}catch (IOException e){
log.error("校验出错");
e.printStackTrace();
}
}
@GetMapping("/auth/callback")
public String wxCallback(String code) {
// 1. 用code换token
// 2. 获取用户信息 return
return "redirect:https://www.focusnu.com/wechat/thd/#/pages/index/callback";
}
@GetMapping("/wechat/callback")
public Map<String,Object> callback(@RequestParam("code") String code, Model model) {
String tokenUrl = String.format(
"https://api.weixin.qq.com/sns/oauth2/access_token?appid=%s&secret=%s&code=%s&grant_type=authorization_code",
appId, appSecret, code
);
System.out.println(tokenUrl);
RestTemplate restTemplate = new RestTemplate();
System.out.println("-------------------11111111111111111----------");
String tokenResponse = restTemplate.getForObject(tokenUrl, String.class);
System.out.println("-------------------22222222222222222----------"+tokenResponse);
JsonNode retJson = null;
ObjectMapper objectMapper = new ObjectMapper();
String accessToken = "";
try {
System.out.println("-------------------33333333333333----------");
JsonNode tokenNode = objectMapper.readTree(tokenResponse);
System.out.println("-------------------444444444444444----------"+tokenNode);
accessToken = tokenNode.get("access_token").asText();
System.out.println("-------------------55555555555555----------"+accessToken);
String openId = tokenNode.get("openid").asText();
System.out.println("-------------------666666666666666----------"+openId);
String userInfoUrl = String.format(
"https://api.weixin.qq.com/sns/userinfo?access_token=%s&openid=%s&lang=zh_CN",
accessToken, openId
);
System.out.println("-------------------777777777777777----------"+userInfoUrl);
String userInfoResponse = restTemplate.getForObject(userInfoUrl, String.class);
System.out.println("-------------------888888888888888----------"+userInfoResponse);
JsonNode userInfoNode = objectMapper.readTree(userInfoResponse);
System.out.println("-------------------999999999999999----------"+userInfoNode);
model.addAttribute("openid", openId);
System.out.println("-------------------999999999999999----------"+openId);
model.addAttribute("nickname", userInfoNode.get("nickname").asText());
model.addAttribute("headimgurl", userInfoNode.get("headimgurl").asText());
model.addAttribute("code", code);
retJson = userInfoNode;
} catch (IOException e) {
e.printStackTrace();
model.addAttribute("openid", "Error parsing JSON response");
}
Map<String,Object> map = new HashMap<>();
map.put("data",retJson);
map.put("code",200);
map.put("msg","success");
map.put("accessToken",accessToken);
return map;
}
}

View File

@ -0,0 +1,66 @@
package com.nu.modules.weixin.utils;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
public class SignUtil {
private static String token = "Blxc20250520";
/**
* 校验签名
* @param signature 签名
* @param timestamp 时间戳
* @param nonce 随机数
* @return 布尔值
*/
public static boolean checkSignature(String signature,String timestamp,String nonce){
String checktext = null;
if (null != signature) {
//对ToKen,timestamp,nonce 按字典排序
String[] paramArr = new String[]{token,timestamp,nonce};
Arrays.sort(paramArr);
//将排序后的结果拼成一个字符串
String content = paramArr[0].concat(paramArr[1]).concat(paramArr[2]);
try {
MessageDigest md = MessageDigest.getInstance("SHA-1");
//对接后的字符串进行sha1加密
byte[] digest = md.digest(content.toString().getBytes());
checktext = byteToStr(digest);
} catch (NoSuchAlgorithmException e){
e.printStackTrace();
}
}
//将加密后的字符串与signature进行对比
return checktext !=null ? checktext.equals(signature.toUpperCase()) : false;
}
/**
* 将字节数组转化我16进制字符串
* @param byteArrays 字符数组
* @return 字符串
*/
private static String byteToStr(byte[] byteArrays){
String str = "";
for (int i = 0; i < byteArrays.length; i++) {
str += byteToHexStr(byteArrays[i]);
}
return str;
}
/**
* 将字节转化为十六进制字符串
* @param myByte 字节
* @return 字符串
*/
private static String byteToHexStr(byte myByte) {
char[] Digit = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
char[] tampArr = new char[2];
tampArr[0] = Digit[(myByte >>> 4) & 0X0F];
tampArr[1] = Digit[myByte & 0X0F];
String str = new String(tampArr);
return str;
}
}

View File

@ -97,4 +97,22 @@ public class DocumentRecognitionApi {
} }
} }
/**
* 营业执照识别
* @param file 图片文件
*/
@PostMapping("/businessLicense")
public Result<String> recognizeBusinessLicense(
@RequestParam("file") MultipartFile file) {
DocumentRecognitionUtils utils = new DocumentRecognitionUtils(accessKeyId, accessKeySecret);
try (InputStream inputStream = file.getInputStream()) {
String result = utils.recognizeBusinessLicense(inputStream);
return Result.ok(result);
} catch (Exception e) {
return Result.error("营业执照识别失败: " + e.getMessage());
} finally {
utils.close();
}
}
} }

View File

@ -108,6 +108,7 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/sys/dict/getDictItems/**", "anon");//获取字典数据 filterChainDefinitionMap.put("/sys/dict/getDictItems/**", "anon");//获取字典数据
filterChainDefinitionMap.put("/sys/sysDepart/queryInstitutionsList", "anon");//授权接口排除 filterChainDefinitionMap.put("/sys/sysDepart/queryInstitutionsList", "anon");//授权接口排除
filterChainDefinitionMap.put("/h5Api/nuBizAdvisoryInfo/**", "anon"); //授权接口排除 filterChainDefinitionMap.put("/h5Api/nuBizAdvisoryInfo/**", "anon"); //授权接口排除
filterChainDefinitionMap.put("/weixin/**", "anon"); //授权接口排除
filterChainDefinitionMap.put("/sys/getLoginQrcode/**", "anon"); //登录二维码 filterChainDefinitionMap.put("/sys/getLoginQrcode/**", "anon"); //登录二维码

View File

@ -34,6 +34,12 @@
<artifactId>guava</artifactId> <artifactId>guava</artifactId>
<version>33.4.8-jre</version> <version>33.4.8-jre</version>
</dependency> </dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.15.3</version>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -99,4 +99,19 @@ public class DocumentRecognitionUtils {
RecognizeSocialSecurityCardVersionIIResponse response = future.get(); RecognizeSocialSecurityCardVersionIIResponse response = future.get();
return new Gson().toJson(response.getBody()); return new Gson().toJson(response.getBody());
} }
/**
* 识别营业执照
* @param inputStream 图片输入流
* @return 识别结果JSON字符串
*/
public String recognizeBusinessLicense(InputStream inputStream) throws Exception {
RecognizeBusinessLicenseRequest request = RecognizeBusinessLicenseRequest.builder()
.body(inputStream)
.build();
CompletableFuture<RecognizeBusinessLicenseResponse> future = client.recognizeBusinessLicense(request);
RecognizeBusinessLicenseResponse response = future.get();
return new Gson().toJson(response.getBody());
}
} }

View File

@ -0,0 +1,166 @@
package com.nu.utils;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.regex.Pattern;
import java.util.UUID;
public class RegionCodeProcessor {
private static final String ROOT_ID = "1927641061017837570";
private static final String CREATE_BY = "admin";
private static final int TENANT_ID = 0;
private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
private static final String CURRENT_TIME = LocalDateTime.now().format(DATE_FORMAT);
private static final String INPUT_FILE = "D:\\downLoad\\行政区划代码.txt";
private static final String OUTPUT_FILE = "D:\\downLoad\\region_inserts.sql";
public static void main(String[] args) {
try {
List<Region> regions = readRegionsFromFile();
Map<String, String> codeToIdMap = new HashMap<>();
Map<String, List<Region>> parentCodeToChildrenMap = new HashMap<>();
// 处理省一级编码后四位是0000的
for (Region region : regions) {
if (region.code.endsWith("0000")) {
region.pid = ROOT_ID;
region.level = 2;
codeToIdMap.put(region.code, region.id);
}
}
// 处理市一级编码后两位是00的和省直辖县级行政单位
for (Region region : regions) {
if (region.code.endsWith("00") && !region.code.endsWith("0000")) {
String parentCode = region.code.substring(0, 2) + "0000";
region.pid = codeToIdMap.getOrDefault(parentCode, ROOT_ID);
region.level = 3;
codeToIdMap.put(region.code, region.id);
} else if (region.name.equals("省直辖县级行政单位")) {
String parentCode = region.code.substring(0, 2) + "0000";
region.pid = codeToIdMap.getOrDefault(parentCode, ROOT_ID);
region.level = 3;
codeToIdMap.put(region.code, region.id);
}
}
// 处理县一级其他情况
for (Region region : regions) {
if (region.pid == null) {
if (region.code.endsWith("0000")) {
continue; // 已经处理过的省一级
}
// 尝试找市级父节点
String cityCode = region.code.substring(0, 4) + "00";
if (codeToIdMap.containsKey(cityCode)) {
region.pid = codeToIdMap.get(cityCode);
region.level = 4;
} else {
// 如果没有市级则直接挂到省级下
String provinceCode = region.code.substring(0, 2) + "0000";
region.pid = codeToIdMap.getOrDefault(provinceCode, ROOT_ID);
region.level = 3;
}
codeToIdMap.put(region.code, region.id);
}
}
// 构建父节点到子节点的映射
for (Region region : regions) {
if (!region.pid.equals(ROOT_ID)) {
parentCodeToChildrenMap
.computeIfAbsent(region.pid, k -> new ArrayList<>())
.add(region);
}
}
// 生成SQL语句
generateSqlFile(regions, parentCodeToChildrenMap);
System.out.println("SQL文件已生成到: " + OUTPUT_FILE);
} catch (IOException e) {
e.printStackTrace();
}
}
private static List<Region> readRegionsFromFile() throws IOException {
List<Region> regions = new ArrayList<>();
Pattern pattern = Pattern.compile("^\\d+");
// 使用明确的GBK编码读取文件常见的中文编码
try (BufferedReader reader = new BufferedReader(new InputStreamReader(
new FileInputStream(INPUT_FILE), "GBK"))) {
String line;
while ((line = reader.readLine()) != null) {
line = line.trim();
if (line.isEmpty() || !pattern.matcher(line).find()) {
continue;
}
// 处理行数据考虑中文名称可能包含空格的情况
String code = line.substring(0, 6).trim();
String name = line.substring(6).trim();
// 处理特殊名称"省直辖县级行政单位"
if (name.equals("省直辖县级行政单位")) {
name = "省直辖县级行政单位";
}
// 生成UUID作为ID
String id = UUID.randomUUID().toString().replaceAll("-","");
regions.add(new Region(id, null, name, code));
}
}
return regions;
}
private static void generateSqlFile(List<Region> regions,
Map<String, List<Region>> parentCodeToChildrenMap) throws IOException {
// 使用UTF-8编码写入SQL文件
try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(OUTPUT_FILE), StandardCharsets.UTF_8))) {
// 先处理所有区域
for (Region region : regions) {
String hasChild = parentCodeToChildrenMap.containsKey(region.id) ? "1" : "0";
String sql = String.format(
"INSERT INTO sys_category (id, pid, name, code, create_by, create_time, update_by, update_time, sys_org_code, has_child, tenant_id) " +
"VALUES ('%s', '%s', '%s', '%s', '%s', '%s', NULL, NULL, NULL, '%s', %d);",
region.id, region.pid, escapeSql(region.name), region.code,
CREATE_BY, CURRENT_TIME, hasChild, TENANT_ID
);
writer.write(sql);
writer.newLine();
}
}
}
private static String escapeSql(String str) {
if (str == null) {
return "";
}
return str.replace("'", "''");
}
static class Region {
String id;
String pid;
String name;
String code;
int level;
public Region(String id, String pid, String name, String code) {
this.id = id;
this.pid = pid;
this.name = name;
this.code = code;
}
}
}

View File

@ -5,7 +5,7 @@ import org.springframework.stereotype.Component;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.time.LocalDate; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
@Component @Component
@ -24,22 +24,26 @@ public class SafetyUtil {
* @param secureKey 客户端传入的密钥MD5 * @param secureKey 客户端传入的密钥MD5
* @return true=验证通过false=验证失败 * @return true=验证通过false=验证失败
*/ */
public static boolean validateSecureKey(String secureKey) { public static boolean validateSecureKey(String secureKey) {
if (secureKey == null || downloadkey == null) { if (secureKey == null || downloadkey == null) {
return false; return false;
} }
// 1. 获取当前日期yyyyMMdd // 获取当前时间精确到分钟格式为 yyyyMMddHHmm
String currentDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); String currentTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm"));
// 获取前一分钟的时间用于扩大验证窗口
String previousMinute = LocalDateTime.now().minusMinutes(1).format(DateTimeFormatter.ofPattern("yyyyMMddHHmm"));
// 2. 复杂混拼固定规则 // 验证当前时间的密钥
String mixedKey = complexMix(downloadkey, currentDate); String mixedKey = complexMix(downloadkey, currentTime);
// 3. 计算 MD5
String md5Hash = calculateMD5(mixedKey); String md5Hash = calculateMD5(mixedKey);
if (secureKey.equalsIgnoreCase(md5Hash)) {
return true;
}
// 4. 比较 secureKey 是否匹配忽略大小写 // 验证前一分钟的密钥扩大验证窗口
mixedKey = complexMix(downloadkey, previousMinute);
md5Hash = calculateMD5(mixedKey);
return secureKey.equalsIgnoreCase(md5Hash); return secureKey.equalsIgnoreCase(md5Hash);
} }
@ -54,7 +58,6 @@ public class SafetyUtil {
* 进行倒序 * 进行倒序
* 3. 3个字符插入一个固定干扰符 '#' * 3. 3个字符插入一个固定干扰符 '#'
*/ */
private static String complexMix(String key, String date) { private static String complexMix(String key, String date) {
StringBuilder mixed = new StringBuilder(); StringBuilder mixed = new StringBuilder();
@ -102,19 +105,22 @@ public class SafetyUtil {
} }
} }
/**
* 获取当前的安全密钥
* 现在包含精确到分钟的时间信息yyyyMMddHHmm
*/
public static String getSecureKey() { public static String getSecureKey() {
if (downloadkey == null) { if (downloadkey == null) {
return "aaa"; return "aaa";
} }
// 1. 获取当前日期yyyyMMdd // 获取当前时间精确到分钟格式为 yyyyMMddHHmm
String currentDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); String currentTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm"));
// 2. 复杂混拼固定规则 // 复杂混拼固定规则
String mixedKey = complexMix(downloadkey, currentDate); String mixedKey = complexMix(downloadkey, currentTime);
// 3. 计算 MD5 并返回 // 计算 MD5 并返回
return calculateMD5(mixedKey); return calculateMD5(mixedKey);
} }
} }

View File

@ -58,6 +58,7 @@ public class SysCategoryController {
/** /**
* 分页列表查询 * 分页列表查询
*
* @param sysCategory * @param sysCategory
* @param pageNo * @param pageNo
* @param pageSize * @param pageSize
@ -69,9 +70,6 @@ public class SysCategoryController {
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
if(oConvertUtils.isEmpty(sysCategory.getPid())){
sysCategory.setPid("0");
}
Result<IPage<SysCategory>> result = new Result<IPage<SysCategory>>(); Result<IPage<SysCategory>> result = new Result<IPage<SysCategory>>();
//------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------
//是否开启系统管理模块的多租户数据隔离SAAS多租户模式 //是否开启系统管理模块的多租户数据隔离SAAS多租户模式
@ -87,7 +85,7 @@ public class SysCategoryController {
String code = sysCategory.getCode(); String code = sysCategory.getCode();
//QueryWrapper<SysCategory> queryWrapper = new QueryWrapper<SysCategory>(); //QueryWrapper<SysCategory> queryWrapper = new QueryWrapper<SysCategory>();
if (StringUtils.isBlank(name) && StringUtils.isBlank(code)) { if (StringUtils.isBlank(name) && StringUtils.isBlank(code)) {
queryWrapper.eq("pid", sysCategory.getPid()); queryWrapper.eq("pid","0");
} }
//--author:liusq---date:20211119 -----for: 分类字典页面查询条件配置--------end //--author:liusq---date:20211119 -----for: 分类字典页面查询条件配置--------end
//--author:os_chengtgen---date:20190804 -----for:vue3 分类字典页面显示错误,issues:377--------end //--author:os_chengtgen---date:20190804 -----for:vue3 分类字典页面显示错误,issues:377--------end
@ -109,6 +107,7 @@ public class SysCategoryController {
//------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------
Result<List<SysCategory>> result = new Result<List<SysCategory>>(); Result<List<SysCategory>> result = new Result<List<SysCategory>>();
QueryWrapper<SysCategory> queryWrapper = QueryGenerator.initQueryWrapper(sysCategory, req.getParameterMap()); QueryWrapper<SysCategory> queryWrapper = QueryGenerator.initQueryWrapper(sysCategory, req.getParameterMap());
queryWrapper.orderByAsc("code");
List<SysCategory> list = sysCategoryService.list(queryWrapper); List<SysCategory> list = sysCategoryService.list(queryWrapper);
result.setSuccess(true); result.setSuccess(true);
result.setResult(list); result.setResult(list);
@ -118,6 +117,7 @@ public class SysCategoryController {
/** /**
* 添加 * 添加
*
* @param sysCategory * @param sysCategory
* @return * @return
*/ */
@ -129,13 +129,14 @@ public class SysCategoryController {
result.success("添加成功!"); result.success("添加成功!");
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
result.error500("操作失败"); result.error500("编码重复!");
} }
return result; return result;
} }
/** /**
* 编辑 * 编辑
*
* @param sysCategory * @param sysCategory
* @return * @return
*/ */
@ -144,7 +145,7 @@ public class SysCategoryController {
Result<SysCategory> result = new Result<SysCategory>(); Result<SysCategory> result = new Result<SysCategory>();
SysCategory sysCategoryEntity = sysCategoryService.getById(sysCategory.getId()); SysCategory sysCategoryEntity = sysCategoryService.getById(sysCategory.getId());
if (sysCategoryEntity == null) { if (sysCategoryEntity == null) {
result.error500("未找到对应实体"); result.error500("编码重复!");
} else { } else {
sysCategoryService.updateSysCategory(sysCategory); sysCategoryService.updateSysCategory(sysCategory);
result.success("修改成功!"); result.success("修改成功!");
@ -154,6 +155,7 @@ public class SysCategoryController {
/** /**
* 通过id删除 * 通过id删除
*
* @param id * @param id
* @return * @return
*/ */
@ -173,6 +175,7 @@ public class SysCategoryController {
/** /**
* 批量删除 * 批量删除
*
* @param ids * @param ids
* @return * @return
*/ */
@ -190,6 +193,7 @@ public class SysCategoryController {
/** /**
* 通过id查询 * 通过id查询
*
* @param id * @param id
* @return * @return
*/ */
@ -313,7 +317,6 @@ public class SysCategoryController {
} }
/** /**
* 加载单个数据 用于回显 * 加载单个数据 用于回显
*/ */
@ -375,7 +378,10 @@ public class SysCategoryController {
try { try {
List<TreeSelectModel> ls = this.sysCategoryService.queryListByCode(pcode); List<TreeSelectModel> ls = this.sysCategoryService.queryListByCode(pcode);
if (!async) { if (!async) {
loadAllCategoryChildren(ls); //框架自带傻逼for循环套sql 慎用 慢到想骂人 实测几百个非叶节点就已经爆炸了
// loadAllCategoryChildren(ls);
//一次sql查所有系统代码处理循环生成树结构
loadAllCategoryChildrenQO(ls);
} }
result.setResult(ls); result.setResult(ls);
result.setSuccess(true); result.setSuccess(true);
@ -400,8 +406,46 @@ public class SysCategoryController {
} }
} }
/**
* 只查询一次数据库代码内容循环处理避免for-sql
*
* @param ls
*/
private void loadAllCategoryChildrenQO(List<TreeSelectModel> ls) {
// 1. 首先获取所有可能的pid值
Set<String> pids = new HashSet<>();
for (TreeSelectModel tsm : ls) {
pids.add(tsm.getKey());
}
// 2. 一次性查询所有可能需要的节点
List<TreeSelectModel> allNodes = this.sysCategoryService.queryAllCategories();
// 3. 构建节点映射表
Map<String, List<TreeSelectModel>> nodeMap = new HashMap<>();
for (TreeSelectModel node : allNodes) {
String parentId = node.getParentId();
nodeMap.computeIfAbsent(parentId, k -> new ArrayList<>()).add(node);
}
// 4. 递归构建树结构
buildTree(ls, nodeMap);
}
private void buildTree(List<TreeSelectModel> nodes, Map<String, List<TreeSelectModel>> nodeMap) {
for (TreeSelectModel node : nodes) {
String nodeKey = node.getKey();
List<TreeSelectModel> children = nodeMap.get(nodeKey);
if (children != null && !children.isEmpty()) {
node.setChildren(children);
buildTree(children, nodeMap);
}
}
}
/** /**
* 校验编码 * 校验编码
*
* @param pid * @param pid
* @param code * @param code
* @return * @return
@ -426,6 +470,7 @@ public class SysCategoryController {
/** /**
* 分类字典树控件 加载节点 * 分类字典树控件 加载节点
*
* @param pid * @param pid
* @param pcode * @param pcode
* @param condition * @param condition
@ -488,6 +533,7 @@ public class SysCategoryController {
/** /**
* [列表页面]加载分类字典数据 用于值的替换 * [列表页面]加载分类字典数据 用于值的替换
*
* @param code * @param code
* @return * @return
*/ */
@ -515,6 +561,7 @@ public class SysCategoryController {
/** /**
* 根据父级id批量查询子节点 * 根据父级id批量查询子节点
*
* @param parentIds * @param parentIds
* @return * @return
*/ */

View File

@ -703,6 +703,7 @@ public class SysDepartController {
map.put("id",depart.getId()); map.put("id",depart.getId());
map.put("departName",depart.getDepartName()); map.put("departName",depart.getDepartName());
map.put("serverUrl",depart.getServerUrl()); map.put("serverUrl",depart.getServerUrl());
map.put("picUrl",depart.getPicUrl());
result.add(map); result.add(map);
} }
return result; return result;
@ -724,4 +725,5 @@ public class SysDepartController {
return result; return result;
} }
} }

View File

@ -1,6 +1,7 @@
package org.jeecg.modules.system.entity; package org.jeecg.modules.system.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
@ -9,6 +10,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
/** /**
* @Description: 分类字典 * @Description: 分类字典
@ -21,38 +23,66 @@ import java.io.Serializable;
public class SysCategory implements Serializable, Comparable<SysCategory> { public class SysCategory implements Serializable, Comparable<SysCategory> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**主键*/ /**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
private java.lang.String id; private java.lang.String id;
/**父级节点*/ /**
* 父级节点
*/
private java.lang.String pid; private java.lang.String pid;
/**类型名称*/ /**
* 类型名称
*/
@Excel(name = "类型名称", width = 15) @Excel(name = "类型名称", width = 15)
private java.lang.String name; private java.lang.String name;
/**类型编码*/ /**
* 类型编码
*/
@Excel(name = "类型编码", width = 15) @Excel(name = "类型编码", width = 15)
private java.lang.String code; private java.lang.String code;
/**创建人*/ /**
* 创建人
*/
private java.lang.String createBy; private java.lang.String createBy;
/**创建日期*/ /**
* 创建日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime; private java.util.Date createTime;
/**更新人*/ /**
* 更新人
*/
private java.lang.String updateBy; private java.lang.String updateBy;
/**更新日期*/ /**
* 更新日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private java.util.Date updateTime; private java.util.Date updateTime;
/**所属部门*/ /**
* 所属部门
*/
private java.lang.String sysOrgCode; private java.lang.String sysOrgCode;
/**是否有子节点*/ /**
* 是否有子节点
*/
@Excel(name = "是否有子节点(1:有)", width = 15) @Excel(name = "是否有子节点(1:有)", width = 15)
private java.lang.String hasChild; private java.lang.String hasChild;
/**租户ID*/ /**
* 租户ID
*/
private java.lang.Integer tenantId; private java.lang.Integer tenantId;
/**
* 子节点列表 - 非数据库字段
*/
@TableField(exist = false)
private List<SysCategory> children;
@Override @Override
public int compareTo(SysCategory o) { public int compareTo(SysCategory o) {
//比较条件我们定的是按照code的长度升序 //比较条件我们定的是按照code的长度升序
@ -62,8 +92,17 @@ public class SysCategory implements Serializable,Comparable<SysCategory>{
int s = this.code.length() - o.code.length(); int s = this.code.length() - o.code.length();
return s; return s;
} }
@Override @Override
public String toString() { public String toString() {
return "SysCategory [code=" + code + ", name=" + name + "]"; return "SysCategory [code=" + code + ", name=" + name + "]";
} }
public List<SysCategory> getChildren() {
return children;
}
public void setChildren(List<SysCategory> children) {
this.children = children;
}
} }

View File

@ -27,101 +27,184 @@ import java.util.Objects;
public class SysDepart implements Serializable { public class SysDepart implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**ID*/ /**
* ID
*/
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
private String id; private String id;
/**父机构ID*/ /**
* 父机构ID
*/
private String parentId; private String parentId;
/**机构/部门名称*/ /**
* 机构/部门名称
*/
@Excel(name = "机构/部门名称", width = 15) @Excel(name = "机构/部门名称", width = 15)
private String departName; private String departName;
/**英文名*/ /**
* 英文名
*/
@Excel(name = "英文名", width = 15) @Excel(name = "英文名", width = 15)
private String departNameEn; private String departNameEn;
/**缩写*/ /**
* 缩写
*/
private String departNameAbbr; private String departNameAbbr;
/**排序*/ /**
* 排序
*/
@Excel(name = "排序", width = 15) @Excel(name = "排序", width = 15)
private Integer departOrder; private Integer departOrder;
/**描述*/ /**
* 描述
*/
@Excel(name = "描述", width = 15) @Excel(name = "描述", width = 15)
private String description; private String description;
/**机构类别 1=公司2=组织机构3=岗位*/ /**
* 机构类别 1=公司2=组织机构3=岗位
*/
@Excel(name = "机构类别", width = 15, dicCode = "org_category") @Excel(name = "机构类别", width = 15, dicCode = "org_category")
private String orgCategory; private String orgCategory;
/**机构类型*/ /**
* 机构类型
*/
private String orgType; private String orgType;
/**机构编码*/ /**
* 机构编码
*/
@Excel(name = "机构编码", width = 15) @Excel(name = "机构编码", width = 15)
private String orgCode; private String orgCode;
/**业务平台类型*/ /**
* 省份
*/
@Excel(name = "省份", width = 30)
private String province;
/**
* 城市
*/
@Excel(name = "城市", width = 30)
private String city;
/**
* 区县
*/
@Excel(name = "区县", width = 30)
private String district;
/**
* 业务平台类型
*/
@Excel(name = "业务平台类型", width = 15) @Excel(name = "业务平台类型", width = 15)
@Dict(dicCode = "iz_test_site") @Dict(dicCode = "iz_test_site")
private String platType; private String platType;
/**运营开始时间*/ /**
* 运营开始时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")
private Date operationStartTime; private Date operationStartTime;
/**运营到期时间*/ /**
* 运营到期时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")
private Date operationEndTime; private Date operationEndTime;
/**合同开始时间*/ /**
* 合同开始时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")
private Date contractStartTime; private Date contractStartTime;
/**合同到期时间*/ /**
* 合同到期时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")
private Date contractEndTime; private Date contractEndTime;
/**手机号*/ /**
* 手机号
*/
@Excel(name = "手机号", width = 15) @Excel(name = "手机号", width = 15)
private String mobile; private String mobile;
/**传真*/ /**
* 传真
*/
@Excel(name = "传真", width = 15) @Excel(name = "传真", width = 15)
private String fax; private String fax;
/**地址*/ /**
* 地址
*/
@Excel(name = "地址", width = 15) @Excel(name = "地址", width = 15)
private String address; private String address;
/**备注*/ /**
* 备注
*/
@Excel(name = "备注", width = 15) @Excel(name = "备注", width = 15)
private String memo; private String memo;
/**状态1启用0不启用*/ /**
* 状态1启用0不启用
*/
@Dict(dicCode = "depart_status") @Dict(dicCode = "depart_status")
private String status; private String status;
/**删除状态0正常1已删除*/ /**
* 删除状态0正常1已删除
*/
@Dict(dicCode = "del_flag") @Dict(dicCode = "del_flag")
private String delFlag; private String delFlag;
/**对接企业微信的ID*/ /**
* 对接企业微信的ID
*/
private String qywxIdentifier; private String qywxIdentifier;
/**对接钉钉的部门ID*/ /**
* 对接钉钉的部门ID
*/
private String dingIdentifier; private String dingIdentifier;
/**创建人*/ /**
* 创建人
*/
private String createBy; private String createBy;
/**创建日期*/ /**
* 创建日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime; private Date createTime;
/**更新人*/ /**
* 更新人
*/
private String updateBy; private String updateBy;
/**更新日期*/ /**
* 更新日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime; private Date updateTime;
/**租户ID*/ /**
* 租户ID
*/
private java.lang.Integer tenantId; private java.lang.Integer tenantId;
/**是否有叶子节点: 1是0否*/ /**
* 是否有叶子节点: 1是0否
*/
private Integer izLeaf; private Integer izLeaf;
/**各机构服务器后台接口地址*/ /**
* 各机构服务器后台接口地址
*/
private String serverUrl; private String serverUrl;
/**
* 各机构服务器后台接口地址
*/
private String picUrl;
//update-begin---author:wangshuai ---date:20200308 for[JTC-119]在部门管理菜单下设置部门负责人新增字段负责人ids和旧的负责人ids //update-begin---author:wangshuai ---date:20200308 for[JTC-119]在部门管理菜单下设置部门负责人新增字段负责人ids和旧的负责人ids
/**部门负责人的ids*/ /**
* 部门负责人的ids
*/
@TableField(exist = false) @TableField(exist = false)
private String directorUserIds; private String directorUserIds;
/**旧的部门负责人的ids(用于比较删除和新增)*/ /**
* 旧的部门负责人的ids(用于比较删除和新增)
*/
@TableField(exist = false) @TableField(exist = false)
private String oldDirectorUserIds; private String oldDirectorUserIds;
//update-end---author:wangshuai ---date:20200308 for[JTC-119]新增字段负责人ids和旧的负责人ids //update-end---author:wangshuai ---date:20200308 for[JTC-119]新增字段负责人ids和旧的负责人ids
@ -151,6 +234,9 @@ public class SysDepart implements Serializable {
Objects.equals(orgCategory, depart.orgCategory) && Objects.equals(orgCategory, depart.orgCategory) &&
Objects.equals(orgType, depart.orgType) && Objects.equals(orgType, depart.orgType) &&
Objects.equals(orgCode, depart.orgCode) && Objects.equals(orgCode, depart.orgCode) &&
Objects.equals(province, depart.province) &&
Objects.equals(city, depart.city) &&
Objects.equals(district, depart.district) &&
Objects.equals(mobile, depart.mobile) && Objects.equals(mobile, depart.mobile) &&
Objects.equals(fax, depart.fax) && Objects.equals(fax, depart.fax) &&
Objects.equals(address, depart.address) && Objects.equals(address, depart.address) &&
@ -171,7 +257,7 @@ public class SysDepart implements Serializable {
public int hashCode() { public int hashCode() {
return Objects.hash(super.hashCode(), id, parentId, departName, return Objects.hash(super.hashCode(), id, parentId, departName,
departNameEn, departNameAbbr, departOrder, description, orgCategory, departNameEn, departNameAbbr, departOrder, description, orgCategory,
orgType, orgCode, mobile, fax, address, memo, status, orgType, orgCode, province, city, district, mobile, fax, address, memo, status,
delFlag, createBy, createTime, updateBy, updateTime, tenantId); delFlag, createBy, createTime, updateBy, updateTime, tenantId);
} }
} }

View File

@ -48,4 +48,6 @@ public interface SysCategoryMapper extends BaseMapper<SysCategory> {
@InterceptorIgnore(tenantLine = "true") @InterceptorIgnore(tenantLine = "true")
@Select("SELECT code FROM sys_category WHERE ID = #{id}") @Select("SELECT code FROM sys_category WHERE ID = #{id}")
SysCategory selectSysCategoryById(@Param("id") String id); SysCategory selectSysCategoryById(@Param("id") String id);
List<TreeSelectModel> queryAllCategories();
} }

View File

@ -32,6 +32,15 @@
</if> </if>
</if> </if>
</select> </select>
<select id="queryAllCategories" resultType="org.jeecg.modules.system.model.TreeSelectModel">
select code,
name as "title",
id as "key",
(case when has_child = '1' then 0 else 1 end) as isLeaf,
pid as parentId
from sys_category
order by code
</select>
</mapper> </mapper>

View File

@ -22,13 +22,19 @@ public class SysDepartTreeModel implements Serializable{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 对应SysDepart中的id字段,前端数据树中的key*/ /**
* 对应SysDepart中的id字段,前端数据树中的key
*/
private String key; private String key;
/** 对应SysDepart中的id字段,前端数据树中的value*/ /**
* 对应SysDepart中的id字段,前端数据树中的value
*/
private String value; private String value;
/** 对应depart_name字段,前端数据树中的title*/ /**
* 对应depart_name字段,前端数据树中的title
*/
private String title; private String title;
@ -57,6 +63,12 @@ public class SysDepartTreeModel implements Serializable{
private String orgCode; private String orgCode;
private String province;
private String city;
private String district;
private Date operationStartTime; private Date operationStartTime;
private Date operationEndTime; private Date operationEndTime;
@ -87,8 +99,12 @@ public class SysDepartTreeModel implements Serializable{
private Date updateTime; private Date updateTime;
private String picUrl;
//update-begin---author:wangshuai ---date:20200308 for[JTC-119]在部门管理菜单下设置部门负责人新增字段部门负责人ids //update-begin---author:wangshuai ---date:20200308 for[JTC-119]在部门管理菜单下设置部门负责人新增字段部门负责人ids
/**部门负责人ids*/ /**
* 部门负责人ids
*/
private String directorUserIds; private String directorUserIds;
//update-end---author:wangshuai ---date:20200308 for[JTC-119]在部门管理菜单下设置部门负责人新增字段部门负责人ids //update-end---author:wangshuai ---date:20200308 for[JTC-119]在部门管理菜单下设置部门负责人新增字段部门负责人ids
@ -97,6 +113,7 @@ public class SysDepartTreeModel implements Serializable{
/** /**
* 将SysDepart对象转换成SysDepartTreeModel对象 * 将SysDepart对象转换成SysDepartTreeModel对象
*
* @param sysDepart * @param sysDepart
*/ */
public SysDepartTreeModel(SysDepart sysDepart) { public SysDepartTreeModel(SysDepart sysDepart) {
@ -114,6 +131,9 @@ public class SysDepartTreeModel implements Serializable{
this.orgCategory = sysDepart.getOrgCategory(); this.orgCategory = sysDepart.getOrgCategory();
this.orgType = sysDepart.getOrgType(); this.orgType = sysDepart.getOrgType();
this.orgCode = sysDepart.getOrgCode(); this.orgCode = sysDepart.getOrgCode();
this.province = sysDepart.getProvince();
this.city = sysDepart.getCity();
this.district = sysDepart.getDistrict();
this.operationStartTime = sysDepart.getOperationStartTime(); this.operationStartTime = sysDepart.getOperationStartTime();
this.operationEndTime = sysDepart.getOperationEndTime(); this.operationEndTime = sysDepart.getOperationEndTime();
this.contractStartTime = sysDepart.getContractStartTime(); this.contractStartTime = sysDepart.getContractStartTime();
@ -130,6 +150,7 @@ public class SysDepartTreeModel implements Serializable{
this.updateBy = sysDepart.getUpdateBy(); this.updateBy = sysDepart.getUpdateBy();
this.updateTime = sysDepart.getUpdateTime(); this.updateTime = sysDepart.getUpdateTime();
this.directorUserIds = sysDepart.getDirectorUserIds(); this.directorUserIds = sysDepart.getDirectorUserIds();
this.picUrl = sysDepart.getPicUrl();
if (0 == sysDepart.getIzLeaf()) { if (0 == sysDepart.getIzLeaf()) {
this.isLeaf = false; this.isLeaf = false;
} else { } else {
@ -398,7 +419,8 @@ public class SysDepartTreeModel implements Serializable{
this.updateTime = updateTime; this.updateTime = updateTime;
} }
public SysDepartTreeModel() { } public SysDepartTreeModel() {
}
public String getDirectorUserIds() { public String getDirectorUserIds() {
return directorUserIds; return directorUserIds;
@ -408,6 +430,38 @@ public class SysDepartTreeModel implements Serializable{
this.directorUserIds = directorUserIds; this.directorUserIds = directorUserIds;
} }
public String getPicUrl() {
return picUrl;
}
public void setPicUrl(String picUrl) {
this.picUrl = picUrl;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district;
}
/** /**
* 重写equals方法 * 重写equals方法
*/ */
@ -431,6 +485,9 @@ public class SysDepartTreeModel implements Serializable{
Objects.equals(orgCategory, model.orgCategory) && Objects.equals(orgCategory, model.orgCategory) &&
Objects.equals(orgType, model.orgType) && Objects.equals(orgType, model.orgType) &&
Objects.equals(orgCode, model.orgCode) && Objects.equals(orgCode, model.orgCode) &&
Objects.equals(province, model.province) &&
Objects.equals(city, model.city) &&
Objects.equals(district, model.district) &&
Objects.equals(operationStartTime, model.operationStartTime) && Objects.equals(operationStartTime, model.operationStartTime) &&
Objects.equals(operationEndTime, model.operationEndTime) && Objects.equals(operationEndTime, model.operationEndTime) &&
Objects.equals(contractStartTime, model.contractStartTime) && Objects.equals(contractStartTime, model.contractStartTime) &&
@ -457,7 +514,7 @@ public class SysDepartTreeModel implements Serializable{
public int hashCode() { public int hashCode() {
return Objects.hash(id, parentId, platType, departName, departNameEn, departNameAbbr, return Objects.hash(id, parentId, platType, departName, departNameEn, departNameAbbr,
departOrder, description, orgCategory, orgType, orgCode, departOrder, description, orgCategory, orgType, orgCode, province, city, district,
operationStartTime, operationEndTime, contractStartTime, contractEndTime, operationStartTime, operationEndTime, contractStartTime, contractEndTime,
mobile, fax, address, memo, status, delFlag, qywxIdentifier, mobile, fax, address, memo, status, delFlag, qywxIdentifier,
createBy, createTime, updateBy, updateTime, children, directorUserIds); createBy, createTime, updateBy, updateTime, children, directorUserIds);

View File

@ -51,6 +51,8 @@ public interface ISysCategoryService extends IService<SysCategory> {
*/ */
public List<TreeSelectModel> queryListByPid(String pid); public List<TreeSelectModel> queryListByPid(String pid);
public List<TreeSelectModel> queryAllCategories();
/** /**
* 根据pid查询子节点集合,支持查询条件 * 根据pid查询子节点集合,支持查询条件
* @param pid * @param pid

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang.StringUtils;
import org.jeecg.common.constant.FillRuleConstant; import org.jeecg.common.constant.FillRuleConstant;
import org.jeecg.common.constant.SymbolConstant; import org.jeecg.common.constant.SymbolConstant;
import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.exception.JeecgBootException;
@ -52,7 +53,9 @@ public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCa
formData.put("pid", categoryPid); formData.put("pid", categoryPid);
categoryCode = (String) FillRuleUtil.executeRule(FillRuleConstant.CATEGORY, formData); categoryCode = (String) FillRuleUtil.executeRule(FillRuleConstant.CATEGORY, formData);
//update-end--Author:baihailong Date:20191209 for分类字典编码规则生成器做成公用配置 //update-end--Author:baihailong Date:20191209 for分类字典编码规则生成器做成公用配置
if (StringUtils.isBlank(sysCategory.getCode())) {
sysCategory.setCode(categoryCode); sysCategory.setCode(categoryCode);
}
sysCategory.setPid(categoryPid); sysCategory.setPid(categoryPid);
baseMapper.insert(sysCategory); baseMapper.insert(sysCategory);
} }
@ -96,6 +99,11 @@ public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCa
return baseMapper.queryListByPid(pid, null); return baseMapper.queryListByPid(pid, null);
} }
@Override
public List<TreeSelectModel> queryAllCategories() {
return baseMapper.queryAllCategories();
}
@Override @Override
public List<TreeSelectModel> queryListByPid(String pid, Map<String, String> condition) { public List<TreeSelectModel> queryListByPid(String pid, Map<String, String> condition) {
if (oConvertUtils.isEmpty(pid)) { if (oConvertUtils.isEmpty(pid)) {
@ -128,6 +136,7 @@ public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCa
/** /**
* 查询节点下所有子节点 * 查询节点下所有子节点
*
* @param ids * @param ids
* @return * @return
*/ */
@ -151,6 +160,7 @@ public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCa
/** /**
* 查询需修改标识的父节点ids * 查询需修改标识的父节点ids
*
* @param ids * @param ids
* @return * @return
*/ */
@ -184,6 +194,7 @@ public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCa
/** /**
* 递归 根据父id获取子节点id * 递归 根据父id获取子节点id
*
* @param pidVal * @param pidVal
* @param sb * @param sb
* @return * @return

View File

@ -363,10 +363,19 @@ justauth:
type: default type: default
prefix: 'demo::' prefix: 'demo::'
timeout: 1h timeout: 1h
#zmy #zmy
aliyun: aliyun:
ocr: ocr:
accessKeyId: LTAI5tMoCTt4sb9VQrcnZFsb # accessKeyId: LTAI5tMoCTt4sb9VQrcnZFsb
accessKeySecret: pQBMT6TlUWgRfvvDnOu0IKVYXCfKee # accessKeySecret: pQBMT6TlUWgRfvvDnOu0IKVYXCfKee
accessKeyId: LTAI5tJxmaqyXSG1T8Q6PSE9
accessKeySecret: baBJyQOvph6dVugiSnx3tsiEuJeMy3
#文件传输秘钥 #文件传输秘钥
downloadkey: hP2K9Z!WLuj"M#8, downloadkey: hP2K9Z!WLuj"M#8,
# 微信
wechat:
appId: wx8fc3e4305d2fbf0b
appSecret: 3bf3dd4ec72f591432db6b28c2c044e5

View File

@ -1,5 +1,5 @@
server: server:
port: 8082 port: 8080
tomcat: tomcat:
max-swallow-size: -1 max-swallow-size: -1
error: error:
@ -7,7 +7,7 @@ server:
include-stacktrace: ALWAYS include-stacktrace: ALWAYS
include-message: ALWAYS include-message: ALWAYS
servlet: servlet:
context-path: /nursing-unit-nacos context-path: /nursing-unit
compression: compression:
enabled: true enabled: true
min-response-size: 1024 min-response-size: 1024
@ -362,6 +362,7 @@ justauth:
type: default type: default
prefix: 'demo::' prefix: 'demo::'
timeout: 1h timeout: 1h
#zmy #zmy
aliyun: aliyun:
ocr: ocr:
@ -369,3 +370,8 @@ aliyun:
accessKeySecret: pQBMT6TlUWgRfvvDnOu0IKVYXCfKee accessKeySecret: pQBMT6TlUWgRfvvDnOu0IKVYXCfKee
#文件传输秘钥 #文件传输秘钥
downloadkey: hP2K9Z!WLuj"M#8, downloadkey: hP2K9Z!WLuj"M#8,
# 微信
wechat:
appId: wx8fc3e4305d2fbf0b
appSecret: 3bf3dd4ec72f591432db6b28c2c044e5