From 1beafa4faf68008fa93d54c2401684ab8576c409 Mon Sep 17 00:00:00 2001 From: "1378012178@qq.com" <1378012178@qq.com> Date: Thu, 9 Oct 2025 14:50:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=B5=84=E6=BA=90=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E8=87=B3=E7=AE=A1=E7=90=86=E5=B9=B3=E5=8F=B0=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../orgapplyinfo/api/IOrgApplyInfoApi.java | 2 +- .../entity/OrgAllInfoApiEntity.java | 3 + .../NuEmployeesAdvisoryInfoServiceImpl.java | 19 ++ .../nubill/mapper/xml/NuBillMapper.xml | 2 +- .../orgapplyinfo/entity/OrgAllInfo.java | 2 + .../mapper/OrgApplyInfoMapper.java | 2 +- .../mapper/xml/OrgApplyInfoMapper.xml | 47 ++--- .../service/impl/OrgApplyInfoServiceImpl.java | 6 +- .../listener/EmployeesMQListener.java | 18 ++ .../com/nu/modules/common/NuCommonApi.java | 32 +++- .../employess/api/EmployessApplyApi.java | 8 +- .../wechat/nubaseinfo/api/NuBaseInfoApi.java | 3 +- .../org/jeecg/config/shiro/ShiroConfig.java | 2 + .../com/nu/entity/SysUploadPreEntity.java | 19 ++ .../controller/ElderTagController.java | 24 +-- .../listener/ElderTaggMQListener.java | 8 +- .../ConfigServiceDirectiveController.java | 24 +-- .../ConfigServiceDirectiveServiceImpl.java | 48 ++--- .../system/controller/CommonController.java | 164 ++++++++++++++---- 19 files changed, 309 insertions(+), 124 deletions(-) create mode 100644 nursing-unit-common/src/main/java/com/nu/entity/SysUploadPreEntity.java diff --git a/nursing-unit-admin/nu-admin-api/nu-admin-local-api/src/main/java/com/nu/modules/orgapplyinfo/api/IOrgApplyInfoApi.java b/nursing-unit-admin/nu-admin-api/nu-admin-local-api/src/main/java/com/nu/modules/orgapplyinfo/api/IOrgApplyInfoApi.java index 631c727..be66a9f 100644 --- a/nursing-unit-admin/nu-admin-api/nu-admin-local-api/src/main/java/com/nu/modules/orgapplyinfo/api/IOrgApplyInfoApi.java +++ b/nursing-unit-admin/nu-admin-api/nu-admin-local-api/src/main/java/com/nu/modules/orgapplyinfo/api/IOrgApplyInfoApi.java @@ -16,5 +16,5 @@ public interface IOrgApplyInfoApi { IPage queryOrgAllInfo(Integer pageNo, Integer pageSize, String orgCode, String title); - List getOrgByOpenId(String id,String status,String openId,String invited); + List getOrgByOpenId(String id, String status, String openId, String invited, String izHistory); } diff --git a/nursing-unit-admin/nu-admin-api/nu-admin-local-api/src/main/java/com/nu/modules/orgapplyinfo/entity/OrgAllInfoApiEntity.java b/nursing-unit-admin/nu-admin-api/nu-admin-local-api/src/main/java/com/nu/modules/orgapplyinfo/entity/OrgAllInfoApiEntity.java index 29bfbc9..615aa0c 100644 --- a/nursing-unit-admin/nu-admin-api/nu-admin-local-api/src/main/java/com/nu/modules/orgapplyinfo/entity/OrgAllInfoApiEntity.java +++ b/nursing-unit-admin/nu-admin-api/nu-admin-local-api/src/main/java/com/nu/modules/orgapplyinfo/entity/OrgAllInfoApiEntity.java @@ -310,4 +310,7 @@ public class OrgAllInfoApiEntity implements Serializable { */ private String modifyState; + //0历史数据 1当前数据 + private String izHistory; + } diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/employees/service/impl/NuEmployeesAdvisoryInfoServiceImpl.java b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/employees/service/impl/NuEmployeesAdvisoryInfoServiceImpl.java index c497136..869c077 100644 --- a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/employees/service/impl/NuEmployeesAdvisoryInfoServiceImpl.java +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/employees/service/impl/NuEmployeesAdvisoryInfoServiceImpl.java @@ -69,6 +69,25 @@ public class NuEmployeesAdvisoryInfoServiceImpl extends ServiceImpl(); + uw.eq("employees_id",dto.getId()); +// uw.eq("iz_history","1"); + uw.eq("org_code",dto.getOrgCode()); + employeesOrg = new EmployeesOrg(); + employeesOrg.setIzHistory("0"); + employeesOrgService.update(employeesOrg,uw); + + //插入数据 + EmployeesOrg emAdd = new EmployeesOrg(); + BeanUtils.copyProperties(dto, emAdd); + emAdd.setId(null); + emAdd.setEmployeesId(dto.getId()); + emAdd.setIzHistory("1"); + emAdd.setModifyStatus("1"); + emAdd.setStatus("1"); + emAdd.setApplyType("2"); + employeesOrgService.save(emAdd); //更新员工信息需要有审核流程 审核通过后才修改正式数据 //通知业务平台有员工信息变更 EmployeesApplyMQDto mqdto = new EmployeesApplyMQDto(); diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/nubill/mapper/xml/NuBillMapper.xml b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/nubill/mapper/xml/NuBillMapper.xml index 399892b..81d821a 100644 --- a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/nubill/mapper/xml/NuBillMapper.xml +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/nubill/mapper/xml/NuBillMapper.xml @@ -32,7 +32,7 @@ and billinfo.elder_id = #{dto.elderId} - and billinfo.nu_id = #{nuId} + and billinfo.nu_id = #{dto.nuId} order by billinfo.create_time desc diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/orgapplyinfo/entity/OrgAllInfo.java b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/orgapplyinfo/entity/OrgAllInfo.java index 3e22115..6e98f76 100644 --- a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/orgapplyinfo/entity/OrgAllInfo.java +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/orgapplyinfo/entity/OrgAllInfo.java @@ -192,4 +192,6 @@ public class OrgAllInfo implements Serializable { private String auditTime; /**信息修改状态 空:没提交过修改 1修改申请中 2通过 3驳回*/ private String modifyState; + //0历史数据 1当前数据 + private String izHistory; } diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/orgapplyinfo/mapper/OrgApplyInfoMapper.java b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/orgapplyinfo/mapper/OrgApplyInfoMapper.java index 34a123d..2680867 100644 --- a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/orgapplyinfo/mapper/OrgApplyInfoMapper.java +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/orgapplyinfo/mapper/OrgApplyInfoMapper.java @@ -20,5 +20,5 @@ public interface OrgApplyInfoMapper extends BaseMapper { IPage queryOrgInfo(@Param("page") IPage page, @Param("orgCode") String orgCode, @Param("title") String title); - IPage getOrgByOpenId(IPage page, @Param("id") String id, @Param("openId") String openId, @Param("status") String status, @Param("invited") String invited); + IPage getOrgByOpenId(IPage page, @Param("id") String id, @Param("openId") String openId, @Param("status") String status, @Param("invited") String invited, @Param("izHistory") String izHistory); } diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/orgapplyinfo/mapper/xml/OrgApplyInfoMapper.xml b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/orgapplyinfo/mapper/xml/OrgApplyInfoMapper.xml index 97c8cb3..4a8082e 100644 --- a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/orgapplyinfo/mapper/xml/OrgApplyInfoMapper.xml +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/orgapplyinfo/mapper/xml/OrgApplyInfoMapper.xml @@ -92,7 +92,8 @@ eo.entry_time, eo.create_time AS apply_time, eo.update_time AS audit_time, - eo.modify_status AS modify_state + eo.modify_status AS modify_state, + eo.iz_history from sys_depart d inner join nu_org_apply_info o on d.id = o.pk_id inner join nu_biz_employees_org eo on d.org_code = eo.org_code @@ -100,7 +101,9 @@ o.status = '2' and d.del_flag = '0' AND eo.open_id = #{openId} - AND eo.iz_history = '1' + + and eo.iz_history = #{izHistory} + and eo.status in @@ -108,28 +111,32 @@ - and eo.apply_type = #{invited} + and eo.apply_type in + + #{item} + and eo.id = #{id} - - - ORDER BY (d.org_code + 0) ASC - - - ORDER BY - eo.iz_history desc, - CASE eo.status - WHEN '2' THEN 1 - WHEN '1' THEN 2 - WHEN '3' THEN 3 - ELSE 4 - END, - eo.create_time DESC - - - + order by eo.create_time DESC + + + + + + + + + + + + + + + + + diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/orgapplyinfo/service/impl/OrgApplyInfoServiceImpl.java b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/orgapplyinfo/service/impl/OrgApplyInfoServiceImpl.java index 5b36528..58df8e1 100644 --- a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/orgapplyinfo/service/impl/OrgApplyInfoServiceImpl.java +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/orgapplyinfo/service/impl/OrgApplyInfoServiceImpl.java @@ -348,7 +348,7 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl getOrgByOpenId(IPage page, String openId) { - return baseMapper.getOrgByOpenId(page, null, openId, "2", null); + return baseMapper.getOrgByOpenId(page, null, openId, "2", null, null); } @Override @@ -372,9 +372,9 @@ public class OrgApplyInfoServiceImpl extends ServiceImpl getOrgByOpenId(String id, String status, String openId, String invited) { + public List getOrgByOpenId(String id, String status, String openId, String invited, String izHistory) { IPage page = new Page<>(1, -1); - IPage r_ = baseMapper.getOrgByOpenId(page, id, openId, status, invited); + IPage r_ = baseMapper.getOrgByOpenId(page, id, openId, status, invited, izHistory); List records = r_.getRecords(); List result = BeanUtil.copyToList(records, OrgAllInfoApiEntity.class); return result; diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/mq/employees/listener/EmployeesMQListener.java b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/mq/employees/listener/EmployeesMQListener.java index 5145ead..de04eeb 100644 --- a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/mq/employees/listener/EmployeesMQListener.java +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/mq/employees/listener/EmployeesMQListener.java @@ -356,6 +356,15 @@ public class EmployeesMQListener { EmployeesOrg eo = new EmployeesOrg(); eo.setModifyStatus("2"); employeesOrgService.update(eo, uw); + + uw = new UpdateWrapper<>(); + uw.eq("employees_id", dto.getEmployeeId()); + uw.eq("org_code", dto.getOrgCode()); + uw.eq("iz_history", "1"); + eo = new EmployeesOrg(); + eo.setStatus("2"); + employeesOrgService.update(eo, uw); + //修改员工咨询表信息 NuEmployeesAdvisoryInfo employeeInfo = new NuEmployeesAdvisoryInfo(); BeanUtils.copyProperties(dto, employeeInfo); @@ -399,6 +408,15 @@ public class EmployeesMQListener { EmployeesOrg eo = new EmployeesOrg(); eo.setModifyStatus("3"); employeesOrgService.update(eo, uw); + + uw = new UpdateWrapper<>(); + uw.eq("employees_id", dto.getEmployeeId()); + uw.eq("org_code", dto.getOrgCode()); + uw.eq("iz_history", "1"); + eo = new EmployeesOrg(); + eo.setStatus("3"); + eo.setAuditContent(dto.getAuditContent()); + employeesOrgService.update(eo, uw); } //增加机构邀请员工的消息通知 diff --git a/nursing-unit-api/src/main/java/com/nu/modules/common/NuCommonApi.java b/nursing-unit-api/src/main/java/com/nu/modules/common/NuCommonApi.java index 586bb31..da43ade 100644 --- a/nursing-unit-api/src/main/java/com/nu/modules/common/NuCommonApi.java +++ b/nursing-unit-api/src/main/java/com/nu/modules/common/NuCommonApi.java @@ -1,13 +1,12 @@ package com.nu.modules.common; import com.alibaba.fastjson.JSONObject; +import com.nu.entity.SysUploadPreEntity; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.api.ISysBaseAPI; +import org.jeecg.common.util.RedisUtil; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** * 通用接口 @@ -21,31 +20,35 @@ public class NuCommonApi { @Autowired private ISysBaseAPI sysBaseAPI; + @Autowired + private RedisUtil redisUtil; /** * 获取机构信息 + * * @param orgCode 机构编码 * @return */ @GetMapping("/getOrgInfo") - public Result getOrgInfo(@RequestParam("orgCode") String orgCode){ + public Result getOrgInfo(@RequestParam("orgCode") String orgCode) { return Result.ok(sysBaseAPI.getOrgInfo(orgCode)); } //获取标准指令库机构信息 @GetMapping("/getDMOrgInfo") - public Result getDMOrgInfo(){ + public Result getDMOrgInfo() { return Result.ok(sysBaseAPI.getDMOrgInfo()); } //获取长者标准标签库机构信息 @GetMapping("/getETMOrgInfo") - public Result getETMOrgInfo(){ + public Result getETMOrgInfo() { return Result.ok(sysBaseAPI.getETMOrgInfo()); } /** * 根据父id查询对应省、市、区/县 列表 + * * @param id 父id * @return 列表 */ @@ -56,6 +59,7 @@ public class NuCommonApi { /** * 根据id查询对应省市区县信息 + * * @param id * @return 对应的一条数据 */ @@ -63,4 +67,18 @@ public class NuCommonApi { public Result queryAreaNameById(@RequestParam("id") String id) { return Result.ok(sysBaseAPI.queryAreaNameById(id)); } + + /** + * 上传资源前置方法,存储必要信息,用于后续验证 + * + * @param dto + * @return 对应的一条数据 + */ + @PostMapping("/saveFileType") + public Result saveFileType(@RequestBody SysUploadPreEntity dto) { + String fileName = dto.getFileName(); + String fileSize = dto.getFileSize(); + redisUtil.sSet("canuploadparams", fileName + "-" + fileSize); + return Result.ok(200); + } } diff --git a/nursing-unit-api/src/main/java/com/nu/modules/wechat/employess/api/EmployessApplyApi.java b/nursing-unit-api/src/main/java/com/nu/modules/wechat/employess/api/EmployessApplyApi.java index 5d0f096..5a242c4 100644 --- a/nursing-unit-api/src/main/java/com/nu/modules/wechat/employess/api/EmployessApplyApi.java +++ b/nursing-unit-api/src/main/java/com/nu/modules/wechat/employess/api/EmployessApplyApi.java @@ -110,8 +110,12 @@ public class EmployessApplyApi { * @return */ @GetMapping(value = "/getEmployeesOrgRela") - public Result> getEmployeesOrgRela(@RequestParam(value = "id", required = false) String id, @RequestParam(value = "status", required = false) String status, @RequestParam(value = "invited", required = false) String invited, @RequestParam(value = "openId") String openId) { - List result = orgApplyInfoApi.getOrgByOpenId(id, status, openId, invited); + public Result> getEmployeesOrgRela(@RequestParam(value = "id", required = false) String id, + @RequestParam(value = "status", required = false) String status, + @RequestParam(value = "invited", required = false) String invited, + @RequestParam(value = "openId") String openId, + @RequestParam(value = "izHistory", required = false) String izHistory) { + List result = orgApplyInfoApi.getOrgByOpenId(id, status, openId, invited, izHistory); return Result.OK(result); } diff --git a/nursing-unit-api/src/main/java/com/nu/modules/wechat/nubaseinfo/api/NuBaseInfoApi.java b/nursing-unit-api/src/main/java/com/nu/modules/wechat/nubaseinfo/api/NuBaseInfoApi.java index fe2670b..4e0891b 100644 --- a/nursing-unit-api/src/main/java/com/nu/modules/wechat/nubaseinfo/api/NuBaseInfoApi.java +++ b/nursing-unit-api/src/main/java/com/nu/modules/wechat/nubaseinfo/api/NuBaseInfoApi.java @@ -69,7 +69,7 @@ public class NuBaseInfoApi { * @return */ @GetMapping("/queryBillList") - public Result> queryBillList(@RequestParam("openId") String openId, @RequestParam("orgCode") String orgCode) { + public Result> queryBillList(@RequestParam("openId") String openId, @RequestParam("nuId") String nuId, @RequestParam("orgCode") String orgCode) { //护理单元信息 // List nuElderList = nuBaseElderApi.queryByOpenId(openId, null); // if (nuElderList == null || nuElderList.size() == 0) { @@ -93,6 +93,7 @@ public class NuBaseInfoApi { DynamicDataSourceContextHolder.push(orgCode); NuBillEntity params = new NuBillEntity(); params.setOpenId(openId); + params.setNuId(nuId); List list = nuBillApi.queryByOpenId(params); // if (list == null || list.size() == 0) { // continue; diff --git a/nursing-unit-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java b/nursing-unit-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java index cf0cf20..d95ab65 100644 --- a/nursing-unit-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java +++ b/nursing-unit-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java @@ -110,6 +110,8 @@ public class ShiroConfig { //filterChainDefinitionMap.put("/sys/common/view/**", "anon");//图片预览不限制token //filterChainDefinitionMap.put("/sys/common/download/**", "anon");//文件下载不限制token filterChainDefinitionMap.put("/generic/**", "anon");//pdf预览需要文件 + filterChainDefinitionMap.put("/api/common/saveFileType", "anon");//上传文件前调用的前置接口,存储文件信息,用于验证 + filterChainDefinitionMap.put("/sys/common/static/upload/export", "anon");//上传暴露接口 filterChainDefinitionMap.put("/sys/dict/getDictItems/**", "anon");//获取字典数据 filterChainDefinitionMap.put("/sys/sysDepart/queryInstitutionsList", "anon");//授权接口排除 diff --git a/nursing-unit-common/src/main/java/com/nu/entity/SysUploadPreEntity.java b/nursing-unit-common/src/main/java/com/nu/entity/SysUploadPreEntity.java new file mode 100644 index 0000000..9fbf4de --- /dev/null +++ b/nursing-unit-common/src/main/java/com/nu/entity/SysUploadPreEntity.java @@ -0,0 +1,19 @@ +package com.nu.entity; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description: 文件上传前置参数 + * @Author: zmy + * @Date: 2025-10-9 09:26:22 + * @Version: V1.0 + */ +@Data +public class SysUploadPreEntity implements Serializable { + + private String fileName; + private String fileSubfix; + private String fileSize; +} diff --git a/nursing-unit-elder/nu-elder-biz/src/main/java/com/nu/modules/eldertag/controller/ElderTagController.java b/nursing-unit-elder/nu-elder-biz/src/main/java/com/nu/modules/eldertag/controller/ElderTagController.java index 329ea1d..adc380b 100644 --- a/nursing-unit-elder/nu-elder-biz/src/main/java/com/nu/modules/eldertag/controller/ElderTagController.java +++ b/nursing-unit-elder/nu-elder-biz/src/main/java/com/nu/modules/eldertag/controller/ElderTagController.java @@ -143,18 +143,18 @@ public class ElderTagController extends JeecgController syncElderTag(@RequestParam(name = "sourceOrgCode") String sourceOrgCode, @RequestBody ElderTagSyncDto dto) { //处理接口地址 String fullPath = ""; - if ("all".equals(dto.getSyncOption()) || "media".equals(dto.getSyncOption()) || StringUtils.isNotBlank(dto.getUpIds())) { - JSONObject deptInfo = elderTagService.getDeptInfo("master", sourceOrgCode); - String url = deptInfo.getString("url"); - String contextPath = deptInfo.getString("contextPath"); - String baseUrl = url.endsWith("/") ? url.substring(0, url.length() - 1) : url; - String normalizedContextPath = contextPath.startsWith("/") ? contextPath : "/" + contextPath; - normalizedContextPath = normalizedContextPath.endsWith("/") - ? normalizedContextPath.substring(0, normalizedContextPath.length() - 1) - : normalizedContextPath; - //接口协议、域名、上下文路径 - fullPath = baseUrl + normalizedContextPath; - } +// if ("all".equals(dto.getSyncOption()) || "media".equals(dto.getSyncOption()) || StringUtils.isNotBlank(dto.getUpIds())) { +// JSONObject deptInfo = elderTagService.getDeptInfo("master", sourceOrgCode); +// String url = deptInfo.getString("url"); +// String contextPath = deptInfo.getString("contextPath"); +// String baseUrl = url.endsWith("/") ? url.substring(0, url.length() - 1) : url; +// String normalizedContextPath = contextPath.startsWith("/") ? contextPath : "/" + contextPath; +// normalizedContextPath = normalizedContextPath.endsWith("/") +// ? normalizedContextPath.substring(0, normalizedContextPath.length() - 1) +// : normalizedContextPath; +// //接口协议、域名、上下文路径 +// fullPath = baseUrl + normalizedContextPath; +// } //同步-新增服务指令 if (StringUtils.isNotBlank(dto.getSyncIds())) { diff --git a/nursing-unit-elder/nu-elder-biz/src/main/java/com/nu/mq/eldertag/listener/ElderTaggMQListener.java b/nursing-unit-elder/nu-elder-biz/src/main/java/com/nu/mq/eldertag/listener/ElderTaggMQListener.java index f171947..765aab5 100644 --- a/nursing-unit-elder/nu-elder-biz/src/main/java/com/nu/mq/eldertag/listener/ElderTaggMQListener.java +++ b/nursing-unit-elder/nu-elder-biz/src/main/java/com/nu/mq/eldertag/listener/ElderTaggMQListener.java @@ -126,7 +126,7 @@ public class ElderTaggMQListener { extend.put("orgCode", dto.getOrgCode()); extend.put("dataId", dto.getId()); wxNoticeEntity.setExtend(JSONObject.toJSONString(extend)); - wxNoticeEntity.setClientType(WxClientType.EMPLOYEE.getCode()); + wxNoticeEntity.setClientType(WxClientType.ELDER.getCode()); wxNoticeApi.addNotice(wxNoticeEntity); wxNoticeApi.sendWechartMinMessage(wxNoticeEntity); } @@ -143,7 +143,7 @@ public class ElderTaggMQListener { extend.put("orgCode", dto.getOrgCode()); extend.put("dataId", dto.getId()); wxNoticeEntity.setExtend(JSONObject.toJSONString(extend)); - wxNoticeEntity.setClientType(WxClientType.EMPLOYEE.getCode()); + wxNoticeEntity.setClientType(WxClientType.ELDER.getCode()); wxNoticeApi.addNotice(wxNoticeEntity); wxNoticeApi.sendWechartMinMessage(wxNoticeEntity); } @@ -168,7 +168,7 @@ public class ElderTaggMQListener { extend.put("orgCode", dto.getOrgCode()); extend.put("dataId", dto.getId()); wxNoticeEntity.setExtend(JSONObject.toJSONString(extend)); - wxNoticeEntity.setClientType(WxClientType.EMPLOYEE.getCode()); + wxNoticeEntity.setClientType(WxClientType.ELDER.getCode()); wxNoticeApi.addNotice(wxNoticeEntity); wxNoticeApi.sendWechartMinMessage(wxNoticeEntity); } @@ -190,7 +190,7 @@ public class ElderTaggMQListener { extend.put("orgCode", dto.getOrgCode()); extend.put("dataId", dto.getId()); wxNoticeEntity.setExtend(JSONObject.toJSONString(extend)); - wxNoticeEntity.setClientType(WxClientType.EMPLOYEE.getCode()); + wxNoticeEntity.setClientType(WxClientType.ELDER.getCode()); wxNoticeApi.addNotice(wxNoticeEntity); wxNoticeApi.sendWechartMinMessage(wxNoticeEntity); } diff --git a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/controller/ConfigServiceDirectiveController.java b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/controller/ConfigServiceDirectiveController.java index a4a7156..b3d5450 100644 --- a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/controller/ConfigServiceDirectiveController.java +++ b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/controller/ConfigServiceDirectiveController.java @@ -442,18 +442,18 @@ public class ConfigServiceDirectiveController extends JeecgController syncDirective(@RequestParam(name = "dataSourceCode") String dataSourceCode, @RequestBody DirectiveSyncDto dto) { //处理接口地址 String fullPath = ""; - if ("all".equals(dto.getSyncOption()) || "media".equals(dto.getSyncOption()) || StringUtils.isNotBlank(dto.getUpIds())) { - JSONObject deptInfo = configServiceDirectiveService.getDeptInfo("master", dataSourceCode); - String url = deptInfo.getString("url"); - String contextPath = deptInfo.getString("contextPath"); - String baseUrl = url.endsWith("/") ? url.substring(0, url.length() - 1) : url; - String normalizedContextPath = contextPath.startsWith("/") ? contextPath : "/" + contextPath; - normalizedContextPath = normalizedContextPath.endsWith("/") - ? normalizedContextPath.substring(0, normalizedContextPath.length() - 1) - : normalizedContextPath; - //接口协议、域名、上下文路径 - fullPath = baseUrl + normalizedContextPath; - } +// if ("all".equals(dto.getSyncOption()) || "media".equals(dto.getSyncOption()) || StringUtils.isNotBlank(dto.getUpIds())) { +// JSONObject deptInfo = configServiceDirectiveService.getDeptInfo("master", dataSourceCode); +// String url = deptInfo.getString("url"); +// String contextPath = deptInfo.getString("contextPath"); +// String baseUrl = url.endsWith("/") ? url.substring(0, url.length() - 1) : url; +// String normalizedContextPath = contextPath.startsWith("/") ? contextPath : "/" + contextPath; +// normalizedContextPath = normalizedContextPath.endsWith("/") +// ? normalizedContextPath.substring(0, normalizedContextPath.length() - 1) +// : normalizedContextPath; +// //接口协议、域名、上下文路径 +// fullPath = baseUrl + normalizedContextPath; +// } //同步-新增服务指令 if (StringUtils.isNotBlank(dto.getSyncIds())) { diff --git a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/service/impl/ConfigServiceDirectiveServiceImpl.java b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/service/impl/ConfigServiceDirectiveServiceImpl.java index 69fc4b9..1a7af01 100644 --- a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/service/impl/ConfigServiceDirectiveServiceImpl.java +++ b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/service/impl/ConfigServiceDirectiveServiceImpl.java @@ -442,25 +442,25 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl { //清空指令资源字段的值 - if ("business".equals(syncOption)) { - record.setPreviewFile(null); - record.setImmediateFile(null); - record.setImmediateFileFocus(null); - record.setMp3File(null); - record.setMp4File(null); - record.setServiceContent(null); - record.setPreviewFileMd5(null); - record.setImmediateFileMd5(null); - record.setImmediateFileFocusMd5(null); - record.setMp3FileMd5(null); - record.setMp4FileMd5(null); - } +// if ("business".equals(syncOption)) { +// record.setPreviewFile(null); +// record.setImmediateFile(null); +// record.setImmediateFileFocus(null); +// record.setMp3File(null); +// record.setMp4File(null); +// record.setServiceContent(null); +// record.setPreviewFileMd5(null); +// record.setImmediateFileMd5(null); +// record.setImmediateFileFocusMd5(null); +// record.setMp3FileMd5(null); +// record.setMp4FileMd5(null); +// } - List bodyTagList = record.getBodyTagList(); - record.setBodyTags(bodyTagList.stream().map(DirectiveBodyTag::getId).collect(Collectors.joining(","))); - - List emotionTagList = record.getEmotionTagList(); - record.setEmotionTags(emotionTagList.stream().map(DirectiveEmotionTag::getId).collect(Collectors.joining(","))); +// List bodyTagList = record.getBodyTagList(); +// record.setBodyTags(bodyTagList.stream().map(DirectiveBodyTag::getId).collect(Collectors.joining(","))); +// +// List emotionTagList = record.getEmotionTagList(); +// record.setEmotionTags(emotionTagList.stream().map(DirectiveEmotionTag::getId).collect(Collectors.joining(","))); }); } directiveMQDto.setDirectiveList(BeanUtil.copyToList(directives, DirectiveAsyncMQDto.class)); @@ -502,13 +502,13 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl { AsyncMain asyncMain = new AsyncMain(); diff --git a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java index 5dffc36..79eb0d8 100644 --- a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java +++ b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java @@ -5,13 +5,13 @@ import lombok.extern.slf4j.Slf4j; import org.jeecg.common.api.vo.Result; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.SymbolConstant; -import org.jeecg.common.constant.enums.FileTypeEnum; import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.util.CommonUtils; +import org.jeecg.common.util.RedisUtil; import org.jeecg.common.util.filter.SsrfFileTypeFilter; import org.jeecg.common.util.oConvertUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Lazy; import org.springframework.util.AntPathMatcher; import org.springframework.util.FileCopyUtils; import org.springframework.web.bind.annotation.*; @@ -43,20 +43,24 @@ public class CommonController { /** * 本地:local minio:minio 阿里:alioss */ - @Value(value="${jeecg.uploadType}") + @Value(value = "${jeecg.uploadType}") private String uploadType; + @Autowired + private RedisUtil redisUtil; + /** - * @Author 政辉 * @return + * @Author 政辉 */ @GetMapping("/403") - public Result noauth() { + public Result noauth() { return Result.error("没有权限,请联系管理员分配权限!"); } /** * 文件上传统一方法 + * * @param request * @param response * @return @@ -69,7 +73,7 @@ public class CommonController { //LOWCOD-2580 sys/common/upload接口存在任意文件上传漏洞 if (oConvertUtils.isNotEmpty(bizPath)) { - if(bizPath.contains(SymbolConstant.SPOT_SINGLE_SLASH) || bizPath.contains(SymbolConstant.SPOT_DOUBLE_BACKSLASH)){ + if (bizPath.contains(SymbolConstant.SPOT_SINGLE_SLASH) || bizPath.contains(SymbolConstant.SPOT_DOUBLE_BACKSLASH)) { throw new JeecgBootException("上传目录bizPath,格式非法!"); } } @@ -77,44 +81,44 @@ public class CommonController { MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; // 获取上传文件对象 MultipartFile file = multipartRequest.getFile("file"); - if(oConvertUtils.isEmpty(bizPath)){ - if(CommonConstant.UPLOAD_TYPE_OSS.equals(uploadType)){ + if (oConvertUtils.isEmpty(bizPath)) { + if (CommonConstant.UPLOAD_TYPE_OSS.equals(uploadType)) { //未指定目录,则用阿里云默认目录 upload bizPath = "upload"; //result.setMessage("使用阿里云文件上传时,必须添加目录!"); //result.setSuccess(false); //return result; - }else{ + } else { bizPath = ""; } } - if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)){ + if (CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) { //update-begin-author:liusq date:20221102 for: 过滤上传文件类型 SsrfFileTypeFilter.checkUploadFileType(file); //update-end-author:liusq date:20221102 for: 过滤上传文件类型 //update-begin-author:lvdandan date:20200928 for:修改JEditor编辑器本地上传 - savePath = this.uploadLocal(file,bizPath); + savePath = this.uploadLocal(file, bizPath); //update-begin-author:lvdandan date:20200928 for:修改JEditor编辑器本地上传 /** 富文本编辑器及markdown本地上传时,采用返回链接方式 - //针对jeditor编辑器如何使 lcaol模式,采用 base64格式存储 - String jeditor = request.getParameter("jeditor"); - if(oConvertUtils.isNotEmpty(jeditor)){ - result.setMessage(CommonConstant.UPLOAD_TYPE_LOCAL); - result.setSuccess(true); - return result; - }else{ - savePath = this.uploadLocal(file,bizPath); - } - */ - }else{ + //针对jeditor编辑器如何使 lcaol模式,采用 base64格式存储 + String jeditor = request.getParameter("jeditor"); + if(oConvertUtils.isNotEmpty(jeditor)){ + result.setMessage(CommonConstant.UPLOAD_TYPE_LOCAL); + result.setSuccess(true); + return result; + }else{ + savePath = this.uploadLocal(file,bizPath); + } + */ + } else { //update-begin-author:taoyan date:20200814 for:文件上传改造 savePath = CommonUtils.upload(file, bizPath, uploadType); //update-end-author:taoyan date:20200814 for:文件上传改造 } - if(oConvertUtils.isNotEmpty(savePath)){ + if (oConvertUtils.isNotEmpty(savePath)) { result.setMessage(savePath); result.setSuccess(true); - }else { + } else { result.setMessage("上传失败!"); result.setSuccess(false); } @@ -123,15 +127,16 @@ public class CommonController { /** * 本地文件上传 - * @param mf 文件 - * @param bizPath 自定义路径 + * + * @param mf 文件 + * @param bizPath 自定义路径 * @return */ - private String uploadLocal(MultipartFile mf,String bizPath){ + private String uploadLocal(MultipartFile mf, String bizPath) { try { String ctxPath = uploadpath; String fileName = null; - File file = new File(ctxPath + File.separator + bizPath + File.separator ); + File file = new File(ctxPath + File.separator + bizPath + File.separator); if (!file.exists()) { // 创建文件根目录 file.mkdirs(); @@ -139,18 +144,18 @@ public class CommonController { // 获取文件名 String orgName = mf.getOriginalFilename(); orgName = CommonUtils.getFileName(orgName); - if(orgName.indexOf(SymbolConstant.SPOT)!=-1){ + if (orgName.indexOf(SymbolConstant.SPOT) != -1) { fileName = orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.lastIndexOf(".")); - }else{ - fileName = orgName+ "_" + System.currentTimeMillis(); + } else { + fileName = orgName + "_" + System.currentTimeMillis(); } String savePath = file.getPath() + File.separator + fileName; File savefile = new File(savePath); FileCopyUtils.copy(mf.getBytes(), savefile); String dbpath = null; - if(oConvertUtils.isNotEmpty(bizPath)){ + if (oConvertUtils.isNotEmpty(bizPath)) { dbpath = bizPath + File.separator + fileName; - }else{ + } else { dbpath = fileName; } if (dbpath.contains(SymbolConstant.DOUBLE_BACKSLASH)) { @@ -331,9 +336,9 @@ public class CommonController { // } /** - * @功能:pdf预览Iframe * @param modelAndView * @return + * @功能:pdf预览Iframe */ @RequestMapping("/pdf/pdfPreviewIframe") public ModelAndView pdfPreviewIframe(ModelAndView modelAndView) { @@ -342,8 +347,9 @@ public class CommonController { } /** - * 把指定URL后的字符串全部截断当成参数 - * 这么做是为了防止URL中包含中文或者特殊字符(/等)时,匹配不了的问题 + * 把指定URL后的字符串全部截断当成参数 + * 这么做是为了防止URL中包含中文或者特殊字符(/等)时,匹配不了的问题 + * * @param request * @return */ @@ -423,4 +429,90 @@ public class CommonController { } } + + /** + * 文件上传统一方法 暴露接口! + * + * @param request + * @param response + * @return + */ + @PostMapping(value = "/static/upload/export") + public Result upload(@RequestParam(value = "name", defaultValue = "aaa") String secureKey, @RequestParam(value = "size",defaultValue = "1") String fileSize, HttpServletRequest request, HttpServletResponse response) throws Exception { + Result result = new Result<>(); + //先验证秘钥是否正确 + if (!SafetyUtil.validateSecureKey(secureKey)) { + result.setMessage("上传失败!"); + result.setSuccess(false); + return result; + } + + MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; + // 获取上传文件对象 + MultipartFile file = multipartRequest.getFile("file"); + //验证文件名称、大小是否可具备存储“资格” + { + boolean contains = redisUtil.sGet("canuploadparams").contains(file.getOriginalFilename() + "-" + fileSize); + if (!contains) { + result.setMessage("上传失败!"); + result.setSuccess(false); + return result; + } else { + //删除set中元素 + redisUtil.setRemove("canuploadparams", file.getOriginalFilename() + "-" + fileSize); + } + } + String savePath = ""; + String bizPath = request.getParameter("biz"); + + //LOWCOD-2580 sys/common/upload接口存在任意文件上传漏洞 + if (oConvertUtils.isNotEmpty(bizPath)) { + if (bizPath.contains(SymbolConstant.SPOT_SINGLE_SLASH) || bizPath.contains(SymbolConstant.SPOT_DOUBLE_BACKSLASH)) { + throw new JeecgBootException("上传目录bizPath,格式非法!"); + } + } + + if (oConvertUtils.isEmpty(bizPath)) { + if (CommonConstant.UPLOAD_TYPE_OSS.equals(uploadType)) { + //未指定目录,则用阿里云默认目录 upload + bizPath = "upload"; + //result.setMessage("使用阿里云文件上传时,必须添加目录!"); + //result.setSuccess(false); + //return result; + } else { + bizPath = ""; + } + } + if (CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)) { + //update-begin-author:liusq date:20221102 for: 过滤上传文件类型 + SsrfFileTypeFilter.checkUploadFileType(file); + //update-end-author:liusq date:20221102 for: 过滤上传文件类型 + //update-begin-author:lvdandan date:20200928 for:修改JEditor编辑器本地上传 + savePath = this.uploadLocal(file, bizPath); + //update-begin-author:lvdandan date:20200928 for:修改JEditor编辑器本地上传 + /** 富文本编辑器及markdown本地上传时,采用返回链接方式 + //针对jeditor编辑器如何使 lcaol模式,采用 base64格式存储 + String jeditor = request.getParameter("jeditor"); + if(oConvertUtils.isNotEmpty(jeditor)){ + result.setMessage(CommonConstant.UPLOAD_TYPE_LOCAL); + result.setSuccess(true); + return result; + }else{ + savePath = this.uploadLocal(file,bizPath); + } + */ + } else { + //update-begin-author:taoyan date:20200814 for:文件上传改造 + savePath = CommonUtils.upload(file, bizPath, uploadType); + //update-end-author:taoyan date:20200814 for:文件上传改造 + } + if (oConvertUtils.isNotEmpty(savePath)) { + result.setMessage(savePath); + result.setSuccess(true); + } else { + result.setMessage("上传失败!"); + result.setSuccess(false); + } + return result; + } }