diff --git a/cas_config.sql b/cas_config.sql new file mode 100644 index 0000000..e91061c --- /dev/null +++ b/cas_config.sql @@ -0,0 +1,45 @@ +-- 更新CAS配置为正确的校方认证服务器地址 +USE ry; + +-- 更新CAS服务器地址 +INSERT INTO sys_config (config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark) +VALUES ('CAS服务器地址', 'cas.server.url', 'https://rsso.gxsdxy.cn', 'Y', 'admin', NOW(), 'admin', NOW(), 'CAS单点登录服务器地址') +ON DUPLICATE KEY UPDATE +config_value = 'https://rsso.gxsdxy.cn', +update_by = 'admin', +update_time = NOW(); + +-- 更新CAS客户端服务地址 +INSERT INTO sys_config (config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark) +VALUES ('CAS客户端服务地址', 'cas.client.service', 'https://pasd.gxsdxy.cn/cas/login', 'Y', 'admin', NOW(), 'admin', NOW(), 'CAS客户端服务地址') +ON DUPLICATE KEY UPDATE +config_value = 'https://pasd.gxsdxy.cn/cas/login', +update_by = 'admin', +update_time = NOW(); + +-- 更新CAS登录页面地址 +INSERT INTO sys_config (config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark) +VALUES ('CAS登录页面地址', 'cas.login.url', 'https://rsso.gxsdxy.cn/login', 'Y', 'admin', NOW(), 'admin', NOW(), 'CAS登录页面地址') +ON DUPLICATE KEY UPDATE +config_value = 'https://rsso.gxsdxy.cn/login', +update_by = 'admin', +update_time = NOW(); + +-- 更新CAS登出地址 +INSERT INTO sys_config (config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark) +VALUES ('CAS登出地址', 'cas.logout.url', 'https://rsso.gxsdxy.cn/logout', 'Y', 'admin', NOW(), 'admin', NOW(), 'CAS登出地址') +ON DUPLICATE KEY UPDATE +config_value = 'https://rsso.gxsdxy.cn/logout', +update_by = 'admin', +update_time = NOW(); + +-- 更新CAS票据验证地址 +INSERT INTO sys_config (config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark) +VALUES ('CAS票据验证地址', 'cas.validate.url', 'https://rsso.gxsdxy.cn/p3/serviceValidate', 'Y', 'admin', NOW(), 'admin', NOW(), 'CAS票据验证地址') +ON DUPLICATE KEY UPDATE +config_value = 'https://rsso.gxsdxy.cn/p3/serviceValidate', +update_by = 'admin', +update_time = NOW(); + +-- 查询插入的配置 +SELECT * FROM sys_config WHERE config_key LIKE 'cas.%'; \ No newline at end of file diff --git a/pasd-SafetyDeclaration/src/main/java/com/ruoyi/SafetyDeclaration/controller/sidebarApp/SafetyDeclarationAppController.java b/pasd-SafetyDeclaration/src/main/java/com/ruoyi/SafetyDeclaration/controller/sidebarApp/SafetyDeclarationAppController.java index 05152b7..f8fc674 100644 --- a/pasd-SafetyDeclaration/src/main/java/com/ruoyi/SafetyDeclaration/controller/sidebarApp/SafetyDeclarationAppController.java +++ b/pasd-SafetyDeclaration/src/main/java/com/ruoyi/SafetyDeclaration/controller/sidebarApp/SafetyDeclarationAppController.java @@ -2,6 +2,7 @@ package com.ruoyi.SafetyDeclaration.controller.sidebarApp; import java.util.List; import javax.servlet.http.HttpServletResponse; + import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -23,26 +24,24 @@ import com.ruoyi.common.core.page.TableDataInfo; /** * 水电校园安全不良事件 - Controller + * Controller * * @author ruoyi * @date 2024-08-04 */ @RestController @RequestMapping("/sidebarApp/safetyDeclaration") -public class SafetyDeclarationAppController extends BaseController -{ +public class SafetyDeclarationAppController extends BaseController { @Autowired private ISafetyDeclarationTableService safetyDeclarationTableService; /** * 查询水电校园安全不良事件 - 列表 + * 列表 */ @PreAuthorize("@ss.hasPermi('sidebar:safetyDeclaration:list')") @GetMapping("/list") - public TableDataInfo list(SafetyDeclarationTable safetyDeclarationTable) - { + public TableDataInfo list(SafetyDeclarationTable safetyDeclarationTable) { startPage(); List list = safetyDeclarationTableService.selectSafetyDeclarationTableList(safetyDeclarationTable); return getDataTable(list); @@ -50,13 +49,12 @@ public class SafetyDeclarationAppController extends BaseController /** * 导出水电校园安全不良事件 - 列表 + * 列表 */ @PreAuthorize("@ss.hasPermi('sidebar:safetyDeclaration:export')") @Log(title = "水电校园安全不良事件 ", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, SafetyDeclarationTable safetyDeclarationTable) - { + public void export(HttpServletResponse response, SafetyDeclarationTable safetyDeclarationTable) { List list = safetyDeclarationTableService.selectSafetyDeclarationTableList(safetyDeclarationTable); ExcelUtil util = new ExcelUtil(SafetyDeclarationTable.class); util.exportExcel(response, list, "水电校园安全不良事件 数据"); @@ -64,48 +62,41 @@ public class SafetyDeclarationAppController extends BaseController /** * 获取水电校园安全不良事件 - 详细信息 + * 详细信息 */ @PreAuthorize("@ss.hasPermi('sidebar:safetyDeclaration:query')") @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { + public AjaxResult getInfo(@PathVariable("id") Long id) { return success(safetyDeclarationTableService.selectSafetyDeclarationTableById(id)); } /** * 新增水电校园安全不良事件 - */ //@PreAuthorize("@ss.hasPermi('sidebar:safetyDeclaration:add')") @Log(title = "水电校园安全不良事件 ", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody SafetyDeclarationTable safetyDeclarationTable) - { + public AjaxResult add(@RequestBody SafetyDeclarationTable safetyDeclarationTable) { return toAjax(safetyDeclarationTableService.insertSafetyDeclarationTable(safetyDeclarationTable)); } /** * 修改水电校园安全不良事件 - */ @PreAuthorize("@ss.hasPermi('sidebar:safetyDeclaration:edit')") @Log(title = "水电校园安全不良事件 ", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody SafetyDeclarationTable safetyDeclarationTable) - { + public AjaxResult edit(@RequestBody SafetyDeclarationTable safetyDeclarationTable) { return toAjax(safetyDeclarationTableService.updateSafetyDeclarationTable(safetyDeclarationTable)); } /** * 删除水电校园安全不良事件 - */ @PreAuthorize("@ss.hasPermi('sidebar:safetyDeclaration:remove')") @Log(title = "水电校园安全不良事件 ", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { + public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(safetyDeclarationTableService.deleteSafetyDeclarationTableByIds(ids)); } } diff --git a/pasd-SafetyDeclaration/src/main/java/com/ruoyi/SafetyDeclaration/service/impl/SafetyDeclarationTableServiceImpl.java b/pasd-SafetyDeclaration/src/main/java/com/ruoyi/SafetyDeclaration/service/impl/SafetyDeclarationTableServiceImpl.java index 93ebcf7..d8c8b73 100644 --- a/pasd-SafetyDeclaration/src/main/java/com/ruoyi/SafetyDeclaration/service/impl/SafetyDeclarationTableServiceImpl.java +++ b/pasd-SafetyDeclaration/src/main/java/com/ruoyi/SafetyDeclaration/service/impl/SafetyDeclarationTableServiceImpl.java @@ -1,111 +1,109 @@ package com.ruoyi.SafetyDeclaration.service.impl; import java.util.List; + +import com.ruoyi.common.annotation.DataScope; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.SafetyDeclaration.mapper.SafetyDeclarationTableMapper; import com.ruoyi.SafetyDeclaration.domain.SafetyDeclarationTable; import com.ruoyi.SafetyDeclaration.service.ISafetyDeclarationTableService; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.SecurityUtils; /** * 水电校园安全不良事件 -Service业务层处理 - * + * Service业务层处理 + * * @author ruoyi * @date 2024-08-04 */ @Service -public class SafetyDeclarationTableServiceImpl implements ISafetyDeclarationTableService -{ +public class SafetyDeclarationTableServiceImpl implements ISafetyDeclarationTableService { @Autowired private SafetyDeclarationTableMapper safetyDeclarationTableMapper; /** * 查询水电校园安全不良事件 - - * + * * @param id 水电校园安全不良事件主键 * @return 水电校园安全不良事件 - */ @Override - public SafetyDeclarationTable selectSafetyDeclarationTableById(Long id) - { + public SafetyDeclarationTable selectSafetyDeclarationTableById(Long id) { return safetyDeclarationTableMapper.selectSafetyDeclarationTableById(id); } /** * 查询水电校园安全不良事件 -列表 - * + * 列表 + * * @param safetyDeclarationTable 水电校园安全不良事件 - * @return 水电校园安全不良事件 - */ @Override - public List selectSafetyDeclarationTableList(SafetyDeclarationTable safetyDeclarationTable) - { + @DataScope(userAlias = "u") + public List selectSafetyDeclarationTableList(SafetyDeclarationTable safetyDeclarationTable) { return safetyDeclarationTableMapper.selectSafetyDeclarationTableList(safetyDeclarationTable); } /** * 新增水电校园安全不良事件 - - * + * * @param safetyDeclarationTable 水电校园安全不良事件 - * @return 结果 */ @Override - public int insertSafetyDeclarationTable(SafetyDeclarationTable safetyDeclarationTable) - { + public int insertSafetyDeclarationTable(SafetyDeclarationTable safetyDeclarationTable) { safetyDeclarationTable.setCurrentState("0"); - //获取当前系统时间 - safetyDeclarationTable.setOccurTime(DateUtils.getNowDate()); + // 获取创建者与创建时间 + safetyDeclarationTable.setCreateBy(SecurityUtils.getUsername()); + safetyDeclarationTable.setCreateTime(DateUtils.getNowDate()); + // 自动设置申报人为当前用户的昵称 + safetyDeclarationTable.setApplyUser(SecurityUtils.getLoginUser().getUser().getNickName()); + // 若发生时间未提供,则默认当前时间 + if (safetyDeclarationTable.getOccurTime() == null) { + safetyDeclarationTable.setOccurTime(DateUtils.getNowDate()); + } return safetyDeclarationTableMapper.insertSafetyDeclarationTable(safetyDeclarationTable); } /** * 修改水电校园安全不良事件 - - * + * * @param safetyDeclarationTable 水电校园安全不良事件 - * @return 结果 */ @Override - public int updateSafetyDeclarationTable(SafetyDeclarationTable safetyDeclarationTable) - { + public int updateSafetyDeclarationTable(SafetyDeclarationTable safetyDeclarationTable) { + // 设置更新者与更新时间 + safetyDeclarationTable.setUpdateBy(SecurityUtils.getUsername()); + safetyDeclarationTable.setUpdateTime(DateUtils.getNowDate()); return safetyDeclarationTableMapper.updateSafetyDeclarationTable(safetyDeclarationTable); } /** * 批量删除水电校园安全不良事件 - - * + * * @param ids 需要删除的水电校园安全不良事件 -主键 + * 主键 * @return 结果 */ @Override - public int deleteSafetyDeclarationTableByIds(Long[] ids) - { + public int deleteSafetyDeclarationTableByIds(Long[] ids) { return safetyDeclarationTableMapper.deleteSafetyDeclarationTableByIds(ids); } /** * 删除水电校园安全不良事件 -信息 - * + * 信息 + * * @param id 水电校园安全不良事件 -主键 + * 主键 * @return 结果 */ @Override - public int deleteSafetyDeclarationTableById(Long id) - { + public int deleteSafetyDeclarationTableById(Long id) { return safetyDeclarationTableMapper.deleteSafetyDeclarationTableById(id); } } diff --git a/pasd-SafetyDeclaration/src/main/resources/mapper/SafetyDeclaration/SafetyDeclarationTableMapper.xml b/pasd-SafetyDeclaration/src/main/resources/mapper/SafetyDeclaration/SafetyDeclarationTableMapper.xml index 77dd47b..c839d4d 100644 --- a/pasd-SafetyDeclaration/src/main/resources/mapper/SafetyDeclaration/SafetyDeclarationTableMapper.xml +++ b/pasd-SafetyDeclaration/src/main/resources/mapper/SafetyDeclaration/SafetyDeclarationTableMapper.xml @@ -13,18 +13,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + - select id, declaration_type, requirement_description, declaration_img, apply_user, occur_time, solve_time, current_state, remark from safety_declaration_table + select id, declaration_type, requirement_description, declaration_img, apply_user, occur_time, solve_time, current_state, + safety_declaration_table.create_by, safety_declaration_table.create_time, safety_declaration_table.update_by, safety_declaration_table.update_time, safety_declaration_table.remark from safety_declaration_table @@ -44,6 +52,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" occur_time, solve_time, current_state, + create_by, + create_time, remark, @@ -55,6 +65,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{solveUser}, #{solveTime}, #{currentState}, + #{createBy}, + #{createTime}, #{remark}, @@ -69,6 +81,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" occur_time = #{occurTime}, solve_time = #{solveTime}, current_state = #{currentState}, + update_by = #{updateBy}, + update_time = #{updateTime}, remark = #{remark}, where id = #{id} diff --git a/pasd-fire/target/classes/mapper/fire/FireFacilityMapper.xml b/pasd-fire/target/classes/mapper/fire/FireFacilityMapper.xml new file mode 100644 index 0000000..ebb259e --- /dev/null +++ b/pasd-fire/target/classes/mapper/fire/FireFacilityMapper.xml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + select id, location_id, facility_name, facility_type, model_number, quantity, entry_date, production_date, expiry_date, status, remark, create_time, update_time from fire_facilities + + + + + + + + insert into fire_facilities + + location_id, + facility_name, + facility_type, + model_number, + quantity, + entry_date, + production_date, + expiry_date, + status, + remark, + create_time, + update_time, + + + #{locationId}, + #{facilityName}, + #{facilityType}, + #{modelNumber}, + #{quantity}, + #{entryDate}, + #{productionDate}, + #{expiryDate}, + #{status}, + #{remark}, + #{createTime}, + #{updateTime}, + + + + + update fire_facilities + + location_id = #{locationId}, + facility_name = #{facilityName}, + facility_type = #{facilityType}, + model_number = #{modelNumber}, + quantity = #{quantity}, + entry_date = #{entryDate}, + production_date = #{productionDate}, + expiry_date = #{expiryDate}, + status = #{status}, + remark = #{remark}, + create_time = #{createTime}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from fire_facilities where id = #{id} + + + + delete from fire_facilities where id in + + #{id} + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pasd-fire/target/maven-archiver/pom.properties b/pasd-fire/target/maven-archiver/pom.properties new file mode 100644 index 0000000..2d05c1a --- /dev/null +++ b/pasd-fire/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=pasd-fire +groupId=com.ruoyi +version=3.8.8 diff --git a/pasd-fire/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/pasd-fire/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..3162ff3 --- /dev/null +++ b/pasd-fire/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,20 @@ +com\ruoyi\fire\controller\FireFacilityController.class +com\ruoyi\fire\mapper\FireFacilityMapper.class +com\ruoyi\fire\service\IFireFacilityReplacementService.class +com\ruoyi\fire\service\impl\FireFacilityRepairServiceImpl.class +com\ruoyi\fire\mapper\FireFacilityReplacementMapper.class +com\ruoyi\fire\mapper\FireFacilityReportMapper.class +com\ruoyi\fire\domain\FireFacilityRepair.class +com\ruoyi\fire\controller\FireFacilityRepairController.class +com\ruoyi\fire\domain\FireFacilityReport.class +com\ruoyi\fire\domain\FireFacilityReplacement.class +com\ruoyi\fire\service\impl\FireFacilityReportServiceImpl.class +com\ruoyi\fire\domain\FireFacility.class +com\ruoyi\fire\controller\FireFacilityReplacementController.class +com\ruoyi\fire\service\IFireFacilityRepairService.class +com\ruoyi\fire\service\impl\FireFacilityServiceImpl.class +com\ruoyi\fire\service\IFireFacilityReportService.class +com\ruoyi\fire\service\IFireFacilityService.class +com\ruoyi\fire\controller\FireFacilityReportController.class +com\ruoyi\fire\mapper\FireFacilityRepairMapper.class +com\ruoyi\fire\service\impl\FireFacilityReplacementServiceImpl.class diff --git a/pasd-fire/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/pasd-fire/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..2923e3d --- /dev/null +++ b/pasd-fire/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,20 @@ +D:\code\pasd_V1.0\pasd_java\pasd-fire\src\main\java\com\ruoyi\fire\controller\FireFacilityRepairController.java +D:\code\pasd_V1.0\pasd_java\pasd-fire\src\main\java\com\ruoyi\fire\service\IFireFacilityReplacementService.java +D:\code\pasd_V1.0\pasd_java\pasd-fire\src\main\java\com\ruoyi\fire\domain\FireFacilityRepair.java +D:\code\pasd_V1.0\pasd_java\pasd-fire\src\main\java\com\ruoyi\fire\mapper\FireFacilityReplacementMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-fire\src\main\java\com\ruoyi\fire\service\impl\FireFacilityReportServiceImpl.java +D:\code\pasd_V1.0\pasd_java\pasd-fire\src\main\java\com\ruoyi\fire\domain\FireFacilityReplacement.java +D:\code\pasd_V1.0\pasd_java\pasd-fire\src\main\java\com\ruoyi\fire\service\impl\FireFacilityReplacementServiceImpl.java +D:\code\pasd_V1.0\pasd_java\pasd-fire\src\main\java\com\ruoyi\fire\service\IFireFacilityService.java +D:\code\pasd_V1.0\pasd_java\pasd-fire\src\main\java\com\ruoyi\fire\service\impl\FireFacilityRepairServiceImpl.java +D:\code\pasd_V1.0\pasd_java\pasd-fire\src\main\java\com\ruoyi\fire\domain\FireFacilityReport.java +D:\code\pasd_V1.0\pasd_java\pasd-fire\src\main\java\com\ruoyi\fire\mapper\FireFacilityReportMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-fire\src\main\java\com\ruoyi\fire\service\impl\FireFacilityServiceImpl.java +D:\code\pasd_V1.0\pasd_java\pasd-fire\src\main\java\com\ruoyi\fire\domain\FireFacility.java +D:\code\pasd_V1.0\pasd_java\pasd-fire\src\main\java\com\ruoyi\fire\controller\FireFacilityController.java +D:\code\pasd_V1.0\pasd_java\pasd-fire\src\main\java\com\ruoyi\fire\service\IFireFacilityReportService.java +D:\code\pasd_V1.0\pasd_java\pasd-fire\src\main\java\com\ruoyi\fire\controller\FireFacilityReplacementController.java +D:\code\pasd_V1.0\pasd_java\pasd-fire\src\main\java\com\ruoyi\fire\mapper\FireFacilityMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-fire\src\main\java\com\ruoyi\fire\service\IFireFacilityRepairService.java +D:\code\pasd_V1.0\pasd_java\pasd-fire\src\main\java\com\ruoyi\fire\controller\FireFacilityReportController.java +D:\code\pasd_V1.0\pasd_java\pasd-fire\src\main\java\com\ruoyi\fire\mapper\FireFacilityRepairMapper.java diff --git a/pasd-fire/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/pasd-fire/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst new file mode 100644 index 0000000..e69de29 diff --git a/pasd-fire/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/pasd-fire/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..e69de29 diff --git a/pasd-healthcare/pom.xml b/pasd-healthcare/pom.xml index 650a415..1d09146 100644 --- a/pasd-healthcare/pom.xml +++ b/pasd-healthcare/pom.xml @@ -38,7 +38,4 @@ 3.5.3 - - - diff --git a/pasd-healthcare/src/main/java/com/ruoyi/inventory/controller/HealthcareDrugArchiveController.java b/pasd-healthcare/src/main/java/com/ruoyi/inventory/controller/HealthcareDrugArchiveController.java index 3f93e71..b169d80 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/inventory/controller/HealthcareDrugArchiveController.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/inventory/controller/HealthcareDrugArchiveController.java @@ -3,40 +3,50 @@ package com.ruoyi.inventory.controller; import java.util.ArrayList; import java.util.Date; import java.util.List; + import javax.servlet.http.HttpServletResponse; -import com.ruoyi.common.core.domain.BaseEntity; -import com.ruoyi.inventory.domain.HealthcareDrugFiling; -import com.ruoyi.inventory.domain.charVo; -import com.ruoyi.inventory.service.IHealthcareDrugFilingService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +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.multipart.MultipartFile; + import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.inventory.domain.HealthcareDrugArchive; -import com.ruoyi.inventory.service.IHealthcareDrugArchiveService; -import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; -import org.springframework.web.multipart.MultipartFile; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.inventory.domain.HealthcareDrugArchive; +import com.ruoyi.inventory.domain.HealthcareDrugArchiveExportVo; +import com.ruoyi.inventory.domain.HealthcareDrugFiling; +import com.ruoyi.inventory.domain.charVo; +import com.ruoyi.inventory.service.IHealthcareDrugArchiveService; +import com.ruoyi.inventory.service.IHealthcareDrugFilingService; /** * 药品档案Controller * -<<<<<<< HEAD + * <<<<<<< HEAD + * * @author 蒋松霖 -======= + * ======= * @author ruoyi ->>>>>>> cf33b39dcb79314a02d35b6116058d8b46856eeb + * >>>>>>> cf33b39dcb79314a02d35b6116058d8b46856eeb * @date 2024-09-19 */ @RestController @RequestMapping("/healthcare/archive") -public class HealthcareDrugArchiveController extends BaseController -{ +public class HealthcareDrugArchiveController extends BaseController { @Autowired private IHealthcareDrugArchiveService healthcareDrugArchiveService; @@ -44,7 +54,7 @@ public class HealthcareDrugArchiveController extends BaseController private IHealthcareDrugFilingService healthcareDrugFilingService; /** - * 统计库房药品 药品金额 临期药品 库存预警 + * 统计库房药品 药品金额 临期药品 库存预警 * */ @GetMapping("/charMedicine") @@ -60,34 +70,69 @@ public class HealthcareDrugArchiveController extends BaseController */ @PreAuthorize("@ss.hasPermi('healthcare:archive:list')") @GetMapping("/list") - public TableDataInfo list(HealthcareDrugArchive healthcareDrugArchive,String type) - { + public TableDataInfo list(HealthcareDrugArchive healthcareDrugArchive, String type) { startPage(); - if (type != null && !type.isEmpty()){ - switch (type){ + if (type != null && !type.isEmpty()) { + switch (type) { case "adevnt": - List list = healthcareDrugArchiveService.selectHealthcareDrugArchiveAdevntList(healthcareDrugArchive); - return getDataTable(list); + List list = healthcareDrugArchiveService + .selectHealthcareDrugArchiveAdevntList(healthcareDrugArchive); + return getDataTable(list); case "alerts": - List list2 = healthcareDrugArchiveService.selectHealthcareDrugArchiveAertsList(healthcareDrugArchive); + List list2 = healthcareDrugArchiveService + .selectHealthcareDrugArchiveAertsList(healthcareDrugArchive); return getDataTable(list2); } } - List list = healthcareDrugArchiveService.selectHealthcareDrugArchiveList(healthcareDrugArchive); + List list = healthcareDrugArchiveService + .selectHealthcareDrugArchiveList(healthcareDrugArchive); return getDataTable(list); } /** - * 导出药品档案列表 + * 导出药品档案列表(含批次明细) */ @PreAuthorize("@ss.hasPermi('healthcare:archive:export')") @Log(title = "药品档案", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, HealthcareDrugArchive healthcareDrugArchive) - { - List list = healthcareDrugArchiveService.selectHealthcareDrugArchiveList(healthcareDrugArchive); - ExcelUtil util = new ExcelUtil(HealthcareDrugArchive.class); - util.exportExcel(response, list, "药品档案数据"); + public void export(HttpServletResponse response, HealthcareDrugArchive healthcareDrugArchive) { + List list = healthcareDrugArchiveService + .selectHealthcareDrugArchiveList(healthcareDrugArchive); + List exportList = new ArrayList<>(); + for (HealthcareDrugArchive archive : list) { + List filings = archive.getDrugFilings(); + if (filings != null && !filings.isEmpty()) { + for (HealthcareDrugFiling filing : filings) { + HealthcareDrugArchiveExportVo vo = new HealthcareDrugArchiveExportVo(); + vo.setMedicineName(archive.getMedicineName()); + vo.setManufacturer(archive.getManufacturer()); + vo.setBarcode(archive.getBarcode()); + vo.setIsSplit("Y".equals(archive.getIsSplit()) ? "是" : "否"); + vo.setSpecification(archive.getSpecification()); + vo.setMinNumber(archive.getMinNumber()); + vo.setBatch(filing.getBatch()); + vo.setExpiryDate(filing.getExpiryDate()); + vo.setStoreroomName(filing.getStoreroomName()); + vo.setBoxCount(filing.getBoxCount()); + vo.setRetailPrice(filing.getRetailPrice()); + vo.setMinPrice(filing.getMinPrice()); + exportList.add(vo); + } + } else { + // 没有批次信息也导出档案基本信息 + HealthcareDrugArchiveExportVo vo = new HealthcareDrugArchiveExportVo(); + vo.setMedicineName(archive.getMedicineName()); + vo.setManufacturer(archive.getManufacturer()); + vo.setBarcode(archive.getBarcode()); + vo.setIsSplit("Y".equals(archive.getIsSplit()) ? "是" : "否"); + vo.setSpecification(archive.getSpecification()); + vo.setMinNumber(archive.getMinNumber()); + exportList.add(vo); + } + } + ExcelUtil util = new ExcelUtil( + HealthcareDrugArchiveExportVo.class); + util.exportExcel(response, exportList, "药品档案数据"); } /** @@ -95,8 +140,7 @@ public class HealthcareDrugArchiveController extends BaseController */ @PreAuthorize("@ss.hasPermi('healthcare:archive:query')") @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { + public AjaxResult getInfo(@PathVariable("id") Long id) { return success(healthcareDrugArchiveService.selectHealthcareDrugArchiveById(id)); } @@ -106,8 +150,7 @@ public class HealthcareDrugArchiveController extends BaseController @PreAuthorize("@ss.hasPermi('healthcare:archive:add')") @Log(title = "药品档案", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody HealthcareDrugArchive healthcareDrugArchive) - { + public AjaxResult add(@RequestBody HealthcareDrugArchive healthcareDrugArchive) { return toAjax(healthcareDrugArchiveService.insertHealthcareDrugArchive(healthcareDrugArchive)); } @@ -117,8 +160,7 @@ public class HealthcareDrugArchiveController extends BaseController @PreAuthorize("@ss.hasPermi('healthcare:archive:edit')") @Log(title = "药品档案", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody HealthcareDrugArchive healthcareDrugArchive) - { + public AjaxResult edit(@RequestBody HealthcareDrugArchive healthcareDrugArchive) { return toAjax(healthcareDrugArchiveService.updateHealthcareDrugArchive(healthcareDrugArchive)); } @@ -127,9 +169,8 @@ public class HealthcareDrugArchiveController extends BaseController */ @PreAuthorize("@ss.hasPermi('healthcare:archive:remove')") @Log(title = "药品档案", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(healthcareDrugArchiveService.deleteHealthcareDrugArchiveByIds(ids)); } @@ -139,10 +180,10 @@ public class HealthcareDrugArchiveController extends BaseController @PreAuthorize("@ss.hasPermi('healthcare:archive:add')") @Log(title = "药品档案", businessType = BusinessType.IMPORT) @PostMapping("/archiveExcel") - public AjaxResult excelImport(MultipartFile file) throws Exception{ + public AjaxResult excelImport(MultipartFile file) throws Exception { ExcelUtil Util = new ExcelUtil<>(HealthcareDrugArchive.class); List archiveList = Util.importExcel(file.getInputStream()); return toAjax(healthcareDrugArchiveService.insertHealthcareDrugArchives(archiveList)); - } + } } diff --git a/pasd-healthcare/src/main/java/com/ruoyi/inventory/controller/HealthcareInventoryDrugoutController.java b/pasd-healthcare/src/main/java/com/ruoyi/inventory/controller/HealthcareInventoryDrugoutController.java index 913e5e0..97f8864 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/inventory/controller/HealthcareInventoryDrugoutController.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/inventory/controller/HealthcareInventoryDrugoutController.java @@ -29,8 +29,7 @@ import com.ruoyi.common.core.page.TableDataInfo; */ @RestController @RequestMapping("/pasd-healthcare/drugout") -public class HealthcareInventoryDrugoutController extends BaseController -{ +public class HealthcareInventoryDrugoutController extends BaseController { @Autowired private IHealthcareInventoryDrugoutService healthcareInventoryDrugoutService; @@ -39,10 +38,10 @@ public class HealthcareInventoryDrugoutController extends BaseController */ @PreAuthorize("@ss.hasPermi('pasd-healthcare:drugout:list')") @GetMapping("/list") - public TableDataInfo list(HealthcareInventoryDrugout healthcareInventoryDrugout) - { + public TableDataInfo list(HealthcareInventoryDrugout healthcareInventoryDrugout) { startPage(); - List list = healthcareInventoryDrugoutService.selectHealthcareInventoryDrugoutList(healthcareInventoryDrugout); + List list = healthcareInventoryDrugoutService + .selectHealthcareInventoryDrugoutList(healthcareInventoryDrugout); return getDataTable(list); } @@ -52,10 +51,11 @@ public class HealthcareInventoryDrugoutController extends BaseController @PreAuthorize("@ss.hasPermi('pasd-healthcare:drugout:export')") @Log(title = "药品出库记录", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, HealthcareInventoryDrugout healthcareInventoryDrugout) - { - List list = healthcareInventoryDrugoutService.selectHealthcareInventoryDrugoutList(healthcareInventoryDrugout); - ExcelUtil util = new ExcelUtil(HealthcareInventoryDrugout.class); + public void export(HttpServletResponse response, HealthcareInventoryDrugout healthcareInventoryDrugout) { + List list = healthcareInventoryDrugoutService + .selectHealthcareInventoryDrugoutList(healthcareInventoryDrugout); + ExcelUtil util = new ExcelUtil( + HealthcareInventoryDrugout.class); util.exportExcel(response, list, "药品出库记录数据"); } @@ -64,8 +64,7 @@ public class HealthcareInventoryDrugoutController extends BaseController */ @PreAuthorize("@ss.hasPermi('pasd-healthcare:drugout:query')") @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { + public AjaxResult getInfo(@PathVariable("id") Long id) { return success(healthcareInventoryDrugoutService.selectHealthcareInventoryDrugoutById(id)); } @@ -75,8 +74,7 @@ public class HealthcareInventoryDrugoutController extends BaseController @PreAuthorize("@ss.hasPermi('pasd-healthcare:drugout:add')") @Log(title = "药品出库记录", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody HealthcareInventoryDrugout healthcareInventoryDrugout) - { + public AjaxResult add(@RequestBody HealthcareInventoryDrugout healthcareInventoryDrugout) { return toAjax(healthcareInventoryDrugoutService.insertHealthcareInventoryDrugout(healthcareInventoryDrugout)); } @@ -86,8 +84,7 @@ public class HealthcareInventoryDrugoutController extends BaseController @PreAuthorize("@ss.hasPermi('pasd-healthcare:drugout:edit')") @Log(title = "药品出库记录", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody HealthcareInventoryDrugout healthcareInventoryDrugout) - { + public AjaxResult edit(@RequestBody HealthcareInventoryDrugout healthcareInventoryDrugout) { return toAjax(healthcareInventoryDrugoutService.updateHealthcareInventoryDrugout(healthcareInventoryDrugout)); } @@ -96,9 +93,8 @@ public class HealthcareInventoryDrugoutController extends BaseController */ @PreAuthorize("@ss.hasPermi('pasd-healthcare:drugout:remove')") @Log(title = "药品出库记录", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(healthcareInventoryDrugoutService.deleteHealthcareInventoryDrugoutByIds(ids)); } @@ -108,8 +104,7 @@ public class HealthcareInventoryDrugoutController extends BaseController @Log(title = "保存药品入库记录", businessType = BusinessType.INSERT) @PreAuthorize("@ss.hasPermi('pasd-healthcare:drugout:add')") @PostMapping("/save") - public AjaxResult save(@RequestBody HealthcareInventoryDrugout healthcareInventoryDrugout) - { + public AjaxResult save(@RequestBody HealthcareInventoryDrugout healthcareInventoryDrugout) { return toAjax(healthcareInventoryDrugoutService.saveHealthcareInventoryDrugout(healthcareInventoryDrugout)); } } diff --git a/pasd-healthcare/src/main/java/com/ruoyi/inventory/controller/HealthcareInventoryDrugoutTypeController.java b/pasd-healthcare/src/main/java/com/ruoyi/inventory/controller/HealthcareInventoryDrugoutTypeController.java index 8b0ad9c..86902f9 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/inventory/controller/HealthcareInventoryDrugoutTypeController.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/inventory/controller/HealthcareInventoryDrugoutTypeController.java @@ -1,7 +1,10 @@ -package com.ruoyi.system.controller; +package com.ruoyi.inventory.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.inventory.domain.HealthcareInventoryDrugoutType; +import com.ruoyi.inventory.service.IHealthcareInventoryDrugoutTypeService; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -16,21 +19,18 @@ import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.system.domain.HealthcareInventoryDrugoutType; -import com.ruoyi.system.service.IHealthcareInventoryDrugoutTypeService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** * 仓库调拨记录Controller - * + * * @author ruoyi * @date 2024-10-08 */ @RestController @RequestMapping("/system/type") -public class HealthcareInventoryDrugoutTypeController extends BaseController -{ +public class HealthcareInventoryDrugoutTypeController extends BaseController { @Autowired private IHealthcareInventoryDrugoutTypeService healthcareInventoryDrugoutTypeService; @@ -39,8 +39,7 @@ public class HealthcareInventoryDrugoutTypeController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:type:list')") @GetMapping("/list") - public TableDataInfo list(HealthcareInventoryDrugoutType healthcareInventoryDrugoutType) - { + public TableDataInfo list(HealthcareInventoryDrugoutType healthcareInventoryDrugoutType) { startPage(); List list = healthcareInventoryDrugoutTypeService.selectHealthcareInventoryDrugoutTypeList(healthcareInventoryDrugoutType); return getDataTable(list); @@ -52,8 +51,7 @@ public class HealthcareInventoryDrugoutTypeController extends BaseController @PreAuthorize("@ss.hasPermi('system:type:export')") @Log(title = "仓库调拨记录", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, HealthcareInventoryDrugoutType healthcareInventoryDrugoutType) - { + public void export(HttpServletResponse response, HealthcareInventoryDrugoutType healthcareInventoryDrugoutType) { List list = healthcareInventoryDrugoutTypeService.selectHealthcareInventoryDrugoutTypeList(healthcareInventoryDrugoutType); ExcelUtil util = new ExcelUtil(HealthcareInventoryDrugoutType.class); util.exportExcel(response, list, "仓库调拨记录数据"); @@ -64,8 +62,7 @@ public class HealthcareInventoryDrugoutTypeController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:type:query')") @GetMapping(value = "/{outTypeId}") - public AjaxResult getInfo(@PathVariable("outTypeId") Long outTypeId) - { + public AjaxResult getInfo(@PathVariable("outTypeId") Long outTypeId) { return success(healthcareInventoryDrugoutTypeService.selectHealthcareInventoryDrugoutTypeByOutTypeId(outTypeId)); } @@ -75,8 +72,7 @@ public class HealthcareInventoryDrugoutTypeController extends BaseController @PreAuthorize("@ss.hasPermi('system:type:add')") @Log(title = "仓库调拨记录", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody HealthcareInventoryDrugoutType healthcareInventoryDrugoutType) - { + public AjaxResult add(@RequestBody HealthcareInventoryDrugoutType healthcareInventoryDrugoutType) { return toAjax(healthcareInventoryDrugoutTypeService.insertHealthcareInventoryDrugoutType(healthcareInventoryDrugoutType)); } @@ -86,8 +82,7 @@ public class HealthcareInventoryDrugoutTypeController extends BaseController @PreAuthorize("@ss.hasPermi('system:type:edit')") @Log(title = "仓库调拨记录", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody HealthcareInventoryDrugoutType healthcareInventoryDrugoutType) - { + public AjaxResult edit(@RequestBody HealthcareInventoryDrugoutType healthcareInventoryDrugoutType) { return toAjax(healthcareInventoryDrugoutTypeService.updateHealthcareInventoryDrugoutType(healthcareInventoryDrugoutType)); } @@ -96,9 +91,8 @@ public class HealthcareInventoryDrugoutTypeController extends BaseController */ @PreAuthorize("@ss.hasPermi('system:type:remove')") @Log(title = "仓库调拨记录", businessType = BusinessType.DELETE) - @DeleteMapping("/{outTypeIds}") - public AjaxResult remove(@PathVariable Long[] outTypeIds) - { + @DeleteMapping("/{outTypeIds}") + public AjaxResult remove(@PathVariable Long[] outTypeIds) { return toAjax(healthcareInventoryDrugoutTypeService.deleteHealthcareInventoryDrugoutTypeByOutTypeIds(outTypeIds)); } } diff --git a/pasd-healthcare/src/main/java/com/ruoyi/inventory/domain/HealthcareDrugArchive.java b/pasd-healthcare/src/main/java/com/ruoyi/inventory/domain/HealthcareDrugArchive.java index 4e81e55..3477345 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/inventory/domain/HealthcareDrugArchive.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/inventory/domain/HealthcareDrugArchive.java @@ -4,13 +4,16 @@ import java.math.BigDecimal; import java.util.Date; import java.util.List; -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; +import org.springframework.format.annotation.DateTimeFormat; + +import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import lombok.Data; + /** * 药品档案对象 healthcare_drug_archive * @@ -19,8 +22,7 @@ import com.ruoyi.common.core.domain.BaseEntity; */ @Data -public class HealthcareDrugArchive extends BaseEntity -{ +public class HealthcareDrugArchive extends BaseEntity { private Integer pageNum; private Integer pageSize; @@ -80,130 +82,129 @@ public class HealthcareDrugArchive extends BaseEntity /** 包装单位 */ private String packageUnit; + /** 查询条件:批次 */ + private String batch; + /** 查询条件:有效期开始 */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date expiryDateStart; + /** 查询条件:有效期结束 */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date expiryDateEnd; - public void setId(Long id) - { + /** 查询条件:库房ID */ + private Long storeroomId; + + public void setId(Long id) { this.id = id; } - public Long getId() - { + public Long getId() { return id; } - public void setMedicineName(String medicineName) - { + + public void setMedicineName(String medicineName) { this.medicineName = medicineName; } - public String getMedicineName() - { + public String getMedicineName() { return medicineName; } - public void setManufacturer(String manufacturer) - { + + public void setManufacturer(String manufacturer) { this.manufacturer = manufacturer; } - public String getManufacturer() - { + public String getManufacturer() { return manufacturer; } - public void setBarcode(String barcode) - { + + public void setBarcode(String barcode) { this.barcode = barcode; } - public String getBarcode() - { + public String getBarcode() { return barcode; } - public void setSpecification(String specification) - { + + public void setSpecification(String specification) { this.specification = specification; } - public String getSpecification() - { + public String getSpecification() { return specification; } - public void setRetailPrice(BigDecimal retailPrice) - { + + public void setRetailPrice(BigDecimal retailPrice) { this.retailPrice = retailPrice; } - public BigDecimal getRetailPrice() - { + public BigDecimal getRetailPrice() { return retailPrice; } - public void setIsSplit(String isSplit) - { + + public void setIsSplit(String isSplit) { this.isSplit = isSplit; } - public String getIsSplit() - { + public String getIsSplit() { return isSplit; } - public void setDosageForm(String dosageForm) - { + public void setDosageForm(String dosageForm) { this.dosageForm = dosageForm; } - public String getDosageForm() - { + public String getDosageForm() { return dosageForm; } - public void setDosageUnit(String dosageUnit) - { + + public void setDosageUnit(String dosageUnit) { this.dosageUnit = dosageUnit; } - public String getDosageUnit() - { + public String getDosageUnit() { return dosageUnit; } - public void setVolumeUnit(String volumeUnit) - { + public void setVolumeUnit(String volumeUnit) { this.volumeUnit = volumeUnit; } - public String getVolumeUnit() - { + public String getVolumeUnit() { return volumeUnit; } - @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("medicineName", getMedicineName()) - .append("manufacturer", getManufacturer()) - .append("barcode", getBarcode()) - .append("specification", getSpecification()) - .append("retailPrice", getRetailPrice()) - .append("isSplit", getIsSplit()) - .append("state", getState()) - .append("dosageForm", getDosageForm()) - .append("dosageUnit", getDosageUnit()) - .append("volume", getVolume()) - .append("volumeUnit", getVolumeUnit()) - .append("unitQuantity", getUnitQuantity()) - .append("splitUnit", getSplitUnit()) - .append("packageUnit", getPackageUnit()) - .append("createTime", getCreateTime()) - .append("createBy", getCreateBy()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("medicineName", getMedicineName()) + .append("manufacturer", getManufacturer()) + .append("barcode", getBarcode()) + .append("specification", getSpecification()) + .append("retailPrice", getRetailPrice()) + .append("isSplit", getIsSplit()) + .append("state", getState()) + .append("dosageForm", getDosageForm()) + .append("dosageUnit", getDosageUnit()) + .append("volume", getVolume()) + .append("volumeUnit", getVolumeUnit()) + .append("unitQuantity", getUnitQuantity()) + .append("splitUnit", getSplitUnit()) + .append("packageUnit", getPackageUnit()) + .append("createTime", getCreateTime()) + .append("createBy", getCreateBy()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); } - //用于存储关联的 HealthCareDrugFiling 列表 + // 用于存储关联的 HealthCareDrugFiling 列表 private List drugFilings; public List getDrugFilings() { @@ -213,9 +214,11 @@ public class HealthcareDrugArchive extends BaseEntity public void setDrugFilings(List drugFilings) { this.drugFilings = drugFilings; } + /** 判断是否有子节点 */ @Excel(name = "判断是否有子节点") private boolean hasChildren = true; + public boolean isHasChildren() { return hasChildren; } @@ -224,4 +227,3 @@ public class HealthcareDrugArchive extends BaseEntity this.hasChildren = hasChildren; } } - diff --git a/pasd-healthcare/src/main/java/com/ruoyi/inventory/domain/HealthcareDrugArchiveExportVo.java b/pasd-healthcare/src/main/java/com/ruoyi/inventory/domain/HealthcareDrugArchiveExportVo.java new file mode 100644 index 0000000..a9d399f --- /dev/null +++ b/pasd-healthcare/src/main/java/com/ruoyi/inventory/domain/HealthcareDrugArchiveExportVo.java @@ -0,0 +1,52 @@ +package com.ruoyi.inventory.domain; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; + +import lombok.Data; + +/** + * 药品档案导出VO(扁平化:档案 + 批次明细) + */ +@Data +public class HealthcareDrugArchiveExportVo { + + @Excel(name = "商品名称") + private String medicineName; + + @Excel(name = "生产厂家") + private String manufacturer; + + @Excel(name = "商品条码") + private String barcode; + + @Excel(name = "是否拆分") + private String isSplit; + + @Excel(name = "商品规格") + private String specification; + + @Excel(name = "最小单位数量") + private String minNumber; + + @Excel(name = "批次") + private String batch; + + @Excel(name = "有效期至", width = 30, dateFormat = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date expiryDate; + + @Excel(name = "所在库房") + private String storeroomName; + + @Excel(name = "数量") + private Integer boxCount; + + @Excel(name = "采购价") + private Double retailPrice; + + @Excel(name = "最小单位价格") + private Double minPrice; +} diff --git a/pasd-healthcare/src/main/java/com/ruoyi/inventory/domain/HealthcareInventoryDrugout.java b/pasd-healthcare/src/main/java/com/ruoyi/inventory/domain/HealthcareInventoryDrugout.java index 1744d2d..f846969 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/inventory/domain/HealthcareInventoryDrugout.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/inventory/domain/HealthcareInventoryDrugout.java @@ -13,7 +13,7 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 药品出库记录对象 healthcare_inventory_drugout * - * @author 蒋松霖 + * @author 蒋松 * @date 2024-10-07 */ @Data @@ -26,10 +26,10 @@ public class HealthcareInventoryDrugout extends BaseEntity /** 出库单号 */ @Excel(name = "出库单号") - private String outCode; + private String outCode; /** 出库状态 */ - @Excel(name = "出库状态" ,readConverterExp = "0=已完成,1=未完成") + @Excel(name = "出库状态", readConverterExp = "0=已完成,1=未完成") private Integer outStatus; /** 出库类型 */ @@ -44,6 +44,14 @@ public class HealthcareInventoryDrugout extends BaseEntity @Excel(name = "出库数量") private Long outQuantity; + /** 出库箱数量 */ + @Excel(name = "出库箱数量") + private Long outBoxQuantity; + + /** 出库包数量 */ + @Excel(name = "出库包数量") + private Long outPackQuantity; + /** 所在单位 */ private String affiliation; @@ -54,8 +62,8 @@ public class HealthcareInventoryDrugout extends BaseEntity @Excel(name = "出库地点") private String outPointName; - /** 出库人 */ - @Excel(name = "出库人") + /** 出库操作人 */ + @Excel(name = "出库操作人") private String outPerson; /** 出库时间 */ @@ -73,10 +81,10 @@ public class HealthcareInventoryDrugout extends BaseEntity /** 证明材料 */ private String proofMaterial; - /** 用途详情 */ + /** 用途详述 */ private String purposeDetails; - /** 所在单位 */ + /** 单位 */ private String unit; /** 过期时间 */ @@ -103,7 +111,7 @@ public class HealthcareInventoryDrugout extends BaseEntity /** 报损原因 */ private String damageReason; - /** 出库详情,用于记录药品出库的详细信息信息 */ + /** 出库详情,用于记录药品出库的详细信息 */ private List healthcareInventoryDrugoutDetailsList; } diff --git a/pasd-healthcare/src/main/java/com/ruoyi/inventory/domain/HealthcareInventoryDrugoutDetails.java b/pasd-healthcare/src/main/java/com/ruoyi/inventory/domain/HealthcareInventoryDrugoutDetails.java index ea90d7f..f3cd681 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/inventory/domain/HealthcareInventoryDrugoutDetails.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/inventory/domain/HealthcareInventoryDrugoutDetails.java @@ -1,22 +1,22 @@ package com.ruoyi.inventory.domain; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; import lombok.Data; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseEntity; import java.util.Date; /** * 出库详情,用于记录药品出库的详细信息对象 healthcare_inventory_drugout_details - * - * @author 蒋松霖 + * + * @author 蒋松龙 * @date 2024-10-07 */ @Data -public class HealthcareInventoryDrugoutDetails extends BaseEntity -{ +public class HealthcareInventoryDrugoutDetails extends BaseEntity { private static final long serialVersionUID = 1L; /** 序号 */ @@ -54,13 +54,13 @@ public class HealthcareInventoryDrugoutDetails extends BaseEntity @Excel(name = "条码") private String barcode; - /** 批次 */ @Excel(name = "批次") private String outBatch; /** 生产日期 */ - @Excel(name = "生产日期") + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd") private Date expiryDate; /** 零售价 */ @@ -70,70 +70,56 @@ public class HealthcareInventoryDrugoutDetails extends BaseEntity /** 单位,如盒、瓶、包等 */ private String unit; + /** 出库单位类型(BOX/ PACK) */ + private String unitType; + + /** 大包装折算最小单位数量 */ + private Integer unitQuantity; + /** 出库数量 */ @Excel(name = "出库数量") - private int quantity; - /** 剩余数量 */ - private int remainingQuantity; + private Integer quantity; - /** 库存数量 */ + /** 剩余盒数 */ + private Integer remainingQuantity; + + /** 剩余包数 */ + private Integer remainingPackQuantity; + + /** 库存盒数 */ @Excel(name = "库存数量") - private int boxCount; + private Integer boxCount; - public void setId(Long id) - { - this.id = id; - } + /** 大包装单位名称 */ + private String inventoryUnit; - public Long getId() - { - return id; - } - public void setDrugOutId(Long drugOutId) - { - this.drugOutId = drugOutId; - } - - public Long getDrugOutId() - { - return drugOutId; - } - public void setDrugId(Long drugId) - { - this.drugId = drugId; - } - - public Long getDrugId() - { - return drugId; - } - public void setUnit(String unit) - { - this.unit = unit; - } - - public String getUnit() - { - return unit; - } - public void setQuantity(int quantity) - { - this.quantity = quantity; - } - - public int getQuantity() - { - return quantity; - } + /** 最小包装单位名称 */ + private String splitUnit; @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) .append("drugOutId", getDrugOutId()) .append("drugId", getDrugId()) + .append("filingId", getFilingId()) + .append("medicineName", getMedicineName()) + .append("outPointId", getOutPointId()) + .append("outPointName", getOutPointName()) + .append("manufacturer", getManufacturer()) + .append("barcode", getBarcode()) + .append("outBatch", getOutBatch()) + .append("expiryDate", getExpiryDate()) + .append("retailPrice", getRetailPrice()) .append("unit", getUnit()) + .append("unitType", getUnitType()) + .append("unitQuantity", getUnitQuantity()) .append("quantity", getQuantity()) + .append("remainingQuantity", getRemainingQuantity()) + .append("remainingPackQuantity", getRemainingPackQuantity()) + .append("boxCount", getBoxCount()) + .append("inventoryUnit", getInventoryUnit()) + .append("splitUnit", getSplitUnit()) .append("createTime", getCreateTime()) .append("createBy", getCreateBy()) .append("updateBy", getUpdateBy()) diff --git a/pasd-healthcare/src/main/java/com/ruoyi/inventory/domain/HealthcareInventoryDrugoutType.java b/pasd-healthcare/src/main/java/com/ruoyi/inventory/domain/HealthcareInventoryDrugoutType.java index 16e993e..7cb2eed 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/inventory/domain/HealthcareInventoryDrugoutType.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/inventory/domain/HealthcareInventoryDrugoutType.java @@ -1,4 +1,4 @@ -package com.ruoyi.system.domain; +package com.ruoyi.inventory.domain; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; diff --git a/pasd-healthcare/src/main/java/com/ruoyi/inventory/mapper/HealthcareInventoryDrugoutTypeMapper.java b/pasd-healthcare/src/main/java/com/ruoyi/inventory/mapper/HealthcareInventoryDrugoutTypeMapper.java index a45dfbd..07a812a 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/inventory/mapper/HealthcareInventoryDrugoutTypeMapper.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/inventory/mapper/HealthcareInventoryDrugoutTypeMapper.java @@ -1,19 +1,20 @@ package com.ruoyi.inventory.mapper; +import com.ruoyi.inventory.domain.HealthcareInventoryDrugoutType; + import java.util.List; -import com.ruoyi.system.domain.HealthcareInventoryDrugoutType; /** * 仓库调拨记录Mapper接口 - * + * * @author ruoyi * @date 2024-10-08 */ -public interface HealthcareInventoryDrugoutTypeMapper +public interface HealthcareInventoryDrugoutTypeMapper { /** * 查询仓库调拨记录 - * + * * @param outTypeId 仓库调拨记录主键 * @return 仓库调拨记录 */ @@ -21,7 +22,7 @@ public interface HealthcareInventoryDrugoutTypeMapper /** * 查询仓库调拨记录列表 - * + * * @param healthcareInventoryDrugoutType 仓库调拨记录 * @return 仓库调拨记录集合 */ @@ -29,7 +30,7 @@ public interface HealthcareInventoryDrugoutTypeMapper /** * 新增仓库调拨记录 - * + * * @param healthcareInventoryDrugoutType 仓库调拨记录 * @return 结果 */ @@ -37,7 +38,7 @@ public interface HealthcareInventoryDrugoutTypeMapper /** * 修改仓库调拨记录 - * + * * @param healthcareInventoryDrugoutType 仓库调拨记录 * @return 结果 */ @@ -45,7 +46,7 @@ public interface HealthcareInventoryDrugoutTypeMapper /** * 删除仓库调拨记录 - * + * * @param outTypeId 仓库调拨记录主键 * @return 结果 */ @@ -53,7 +54,7 @@ public interface HealthcareInventoryDrugoutTypeMapper /** * 批量删除仓库调拨记录 - * + * * @param outTypeIds 需要删除的数据主键集合 * @return 结果 */ diff --git a/pasd-healthcare/src/main/java/com/ruoyi/inventory/service/IHealthcareInventoryDrugoutTypeService.java b/pasd-healthcare/src/main/java/com/ruoyi/inventory/service/IHealthcareInventoryDrugoutTypeService.java index 357fee9..f1b7904 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/inventory/service/IHealthcareInventoryDrugoutTypeService.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/inventory/service/IHealthcareInventoryDrugoutTypeService.java @@ -1,19 +1,19 @@ -package com.ruoyi.system.service; +package com.ruoyi.inventory.service; +import com.ruoyi.inventory.domain.HealthcareInventoryDrugoutType; import java.util.List; -import com.ruoyi.system.domain.HealthcareInventoryDrugoutType; /** * 仓库调拨记录Service接口 - * + * * @author ruoyi * @date 2024-10-08 */ -public interface IHealthcareInventoryDrugoutTypeService +public interface IHealthcareInventoryDrugoutTypeService { /** * 查询仓库调拨记录 - * + * * @param outTypeId 仓库调拨记录主键 * @return 仓库调拨记录 */ @@ -29,7 +29,7 @@ public interface IHealthcareInventoryDrugoutTypeService /** * 查询仓库调拨记录列表 - * + * * @param healthcareInventoryDrugoutType 仓库调拨记录 * @return 仓库调拨记录集合 */ @@ -37,7 +37,7 @@ public interface IHealthcareInventoryDrugoutTypeService /** * 新增仓库调拨记录 - * + * * @param healthcareInventoryDrugoutType 仓库调拨记录 * @return 结果 */ @@ -45,7 +45,7 @@ public interface IHealthcareInventoryDrugoutTypeService /** * 修改仓库调拨记录 - * + * * @param healthcareInventoryDrugoutType 仓库调拨记录 * @return 结果 */ @@ -53,7 +53,7 @@ public interface IHealthcareInventoryDrugoutTypeService /** * 批量删除仓库调拨记录 - * + * * @param outTypeIds 需要删除的仓库调拨记录主键集合 * @return 结果 */ @@ -61,7 +61,7 @@ public interface IHealthcareInventoryDrugoutTypeService /** * 删除仓库调拨记录信息 - * + * * @param outTypeId 仓库调拨记录主键 * @return 结果 */ diff --git a/pasd-healthcare/src/main/java/com/ruoyi/inventory/service/impl/HealthcareDrugArchiveServiceImpl.java b/pasd-healthcare/src/main/java/com/ruoyi/inventory/service/impl/HealthcareDrugArchiveServiceImpl.java index 0e83d9f..9796c4a 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/inventory/service/impl/HealthcareDrugArchiveServiceImpl.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/inventory/service/impl/HealthcareDrugArchiveServiceImpl.java @@ -1,7 +1,15 @@ package com.ruoyi.inventory.service.impl; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.BaseEntity; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + import com.ruoyi.common.utils.DateUtils; import com.ruoyi.inventory.domain.HealthcareDrugArchive; import com.ruoyi.inventory.domain.HealthcareDrugFiling; @@ -12,19 +20,6 @@ import com.ruoyi.inventory.mapper.HealthcareDrugFilingMapper; import com.ruoyi.inventory.service.IHealthcareDrugArchiveService; import com.ruoyi.inventory.service.IHealthcareDrugFilingService; import com.ruoyi.inventory.service.IHealthcareInventoryStoreroomService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.xml.crypto.Data; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.time.LocalDate; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; -import java.util.stream.Collectors; - /** * 药品档案Service业务层处理 @@ -69,12 +64,14 @@ public class HealthcareDrugArchiveServiceImpl implements IHealthcareDrugArchiveS */ @Override public List selectHealthcareDrugArchiveList(HealthcareDrugArchive healthcareDrugArchive) { - List list = healthcareDrugArchiveMapper.selectHealthcareDrugArchiveList(healthcareDrugArchive); + List list = healthcareDrugArchiveMapper + .selectHealthcareDrugArchiveList(healthcareDrugArchive); // 遍历每个 HealthCareDrugArchive 对象 list.forEach(item -> { // 根据 HealthCareDrugArchive 的 ID 查询关联的 HealthCareDrugFiling 列表 - List filings = healthcareDrugFilingService.selectHealthcareDrugFilingByArchiveId(item.getId()); + List filings = healthcareDrugFilingService + .selectHealthcareDrugFilingByArchiveId(item.getId()); // 将 packageUnit 和 splitUnit 复制到每个 filing 对象中 filings.forEach(filing -> { filing.setPackageUnit(item.getPackageUnit()); @@ -83,7 +80,8 @@ public class HealthcareDrugArchiveServiceImpl implements IHealthcareDrugArchiveS filing.setSpecification(item.getSpecification()); filing.setBarcode(item.getBarcode()); filing.setManufacturer(item.getManufacturer()); - HealthcareInventoryStoreroom storeroom = healthcareInventoryStoreroomService.selectHealthcareInventoryStoreroomById(filing.getStoreroomId()); // 设置相对应的库房 + HealthcareInventoryStoreroom storeroom = healthcareInventoryStoreroomService + .selectHealthcareInventoryStoreroomById(filing.getStoreroomId()); // 设置相对应的库房 filing.setStoreroomName(storeroom.getStoreroomName()); }); // 将 HealthCareDrugFiling 列表设置到 HealthCareDrugArchive 里面的 drugFilings 对象中 @@ -93,7 +91,6 @@ public class HealthcareDrugArchiveServiceImpl implements IHealthcareDrugArchiveS return list; } - /** * 新增药品档案 * @@ -117,7 +114,8 @@ public class HealthcareDrugArchiveServiceImpl implements IHealthcareDrugArchiveS healthcareDrugArchive.setUpdateTime(DateUtils.getNowDate()); // 获取与药品档案关联的药品备案信息 - List filings = healthcareDrugFilingService.selectHealthcareDrugFilingByArchiveId(healthcareDrugArchive.getId()); + List filings = healthcareDrugFilingService + .selectHealthcareDrugFilingByArchiveId(healthcareDrugArchive.getId()); if (filings != null && !filings.isEmpty()) { for (HealthcareDrugFiling filing : filings) { try { @@ -132,19 +130,18 @@ public class HealthcareDrugArchiveServiceImpl implements IHealthcareDrugArchiveS BigDecimal minNumberBD = BigDecimal.valueOf(Long.parseLong(minNumber)); // 计算新的最小单位价格 - BigDecimal newMinPrice = retailPrice.divide(minNumberBD, 5, RoundingMode.HALF_UP); - - + BigDecimal newMinPrice = retailPrice.divide(minNumberBD, 2, RoundingMode.CEILING); // 前端传来参数可拆分则设置包数默认值为0 if (healthcareDrugArchive.getIsSplit().equals("Y")) { // 获取数据库中的包数判断是否重置为0 - List filing1 = healthcareDrugFilingService.selectHealthcareDrugFilingByArchiveId(healthcareDrugArchive.getId()); - for (HealthcareDrugFiling item : filing1){ - if (item.getPackCount() == null){ // 当前药品的包数为null的时候才默认为0 - filing.setPackCount(0); - } + List filing1 = healthcareDrugFilingService + .selectHealthcareDrugFilingByArchiveId(healthcareDrugArchive.getId()); + for (HealthcareDrugFiling item : filing1) { + if (item.getPackCount() == null) { // 当前药品的包数为null的时候才默认为0 + filing.setPackCount(0); } + } } // 更新药品备案信息 filing.setMinPrice(newMinPrice.doubleValue()); @@ -170,7 +167,6 @@ public class HealthcareDrugArchiveServiceImpl implements IHealthcareDrugArchiveS } } - /** * 批量删除药品档案 * @@ -203,9 +199,10 @@ public class HealthcareDrugArchiveServiceImpl implements IHealthcareDrugArchiveS @Override public int insertHealthcareDrugArchives(List archiveList) { // 判断导入的excel药品建档是否已存在数据库 - for (HealthcareDrugArchive item:archiveList){ - List archive = healthcareDrugArchiveMapper.selectHealthcareDrugArchiveByBarcode(item.getBarcode()); - if (archive == null && archive.isEmpty()){ + for (HealthcareDrugArchive item : archiveList) { + List archive = healthcareDrugArchiveMapper + .selectHealthcareDrugArchiveByBarcode(item.getBarcode()); + if (archive == null && archive.isEmpty()) { healthcareDrugArchiveMapper.insertHealthcareDrugArchives(archiveList); } } @@ -236,13 +233,16 @@ public class HealthcareDrugArchiveServiceImpl implements IHealthcareDrugArchiveS } @Override - public List selectHealthcareDrugArchiveAdevntList(HealthcareDrugArchive healthcareDrugArchive) { - List list = healthcareDrugArchiveMapper.selectHealthcareDrugArchiveAdevntList(healthcareDrugArchive); + public List selectHealthcareDrugArchiveAdevntList( + HealthcareDrugArchive healthcareDrugArchive) { + List list = healthcareDrugArchiveMapper + .selectHealthcareDrugArchiveAdevntList(healthcareDrugArchive); // 遍历每个 HealthCareDrugArchive 对象 list.forEach(item -> { // 根据 HealthCareDrugArchive 的 ID 查询关联的 HealthCareDrugFiling 列表 - List filings = healthcareDrugFilingService.selectHealthcareDrugFilingByArchiveId(item.getId()); + List filings = healthcareDrugFilingService + .selectHealthcareDrugFilingByArchiveId(item.getId()); // 获取当前日期加上一个月的日期 Calendar currentPlusOneMonth = Calendar.getInstance(); @@ -264,7 +264,8 @@ public class HealthcareDrugArchiveServiceImpl implements IHealthcareDrugArchiveS filing.setManufacturer(item.getManufacturer()); // 设置相对应的库房 - HealthcareInventoryStoreroom storeroom = healthcareInventoryStoreroomService.selectHealthcareInventoryStoreroomById(filing.getStoreroomId()); + HealthcareInventoryStoreroom storeroom = healthcareInventoryStoreroomService + .selectHealthcareInventoryStoreroomById(filing.getStoreroomId()); filing.setStoreroomName(storeroom.getStoreroomName()); }); @@ -276,12 +277,15 @@ public class HealthcareDrugArchiveServiceImpl implements IHealthcareDrugArchiveS } @Override - public List selectHealthcareDrugArchiveAertsList(HealthcareDrugArchive healthcareDrugArchive) { - List list = healthcareDrugArchiveMapper.selectHealthcareDrugArchiveAertsList(healthcareDrugArchive); + public List selectHealthcareDrugArchiveAertsList( + HealthcareDrugArchive healthcareDrugArchive) { + List list = healthcareDrugArchiveMapper + .selectHealthcareDrugArchiveAertsList(healthcareDrugArchive); // 遍历每个 HealthCareDrugArchive 对象 list.forEach(item -> { // 根据 HealthCareDrugArchive 的 ID 查询关联的 HealthCareDrugFiling 列表 - List filings = healthcareDrugFilingService.selectHealthcareDrugFilingByArchiveId(item.getId()); + List filings = healthcareDrugFilingService + .selectHealthcareDrugFilingByArchiveId(item.getId()); // 将 packageUnit 和 splitUnit 复制到每个 filing 对象中 filings.forEach(filing -> { filing.setPackageUnit(item.getPackageUnit()); @@ -290,7 +294,8 @@ public class HealthcareDrugArchiveServiceImpl implements IHealthcareDrugArchiveS filing.setSpecification(item.getSpecification()); filing.setBarcode(item.getBarcode()); filing.setManufacturer(item.getManufacturer()); - HealthcareInventoryStoreroom storeroom = healthcareInventoryStoreroomService.selectHealthcareInventoryStoreroomById(filing.getStoreroomId()); // 设置相对应的库房 + HealthcareInventoryStoreroom storeroom = healthcareInventoryStoreroomService + .selectHealthcareInventoryStoreroomById(filing.getStoreroomId()); // 设置相对应的库房 filing.setStoreroomName(storeroom.getStoreroomName()); }); // 将 HealthCareDrugFiling 列表设置到 HealthCareDrugArchive 里面的 drugFilings 对象中 @@ -300,5 +305,4 @@ public class HealthcareDrugArchiveServiceImpl implements IHealthcareDrugArchiveS return list; } - } diff --git a/pasd-healthcare/src/main/java/com/ruoyi/inventory/service/impl/HealthcareDrugFilingServiceImpl.java b/pasd-healthcare/src/main/java/com/ruoyi/inventory/service/impl/HealthcareDrugFilingServiceImpl.java index 36669ae..fc399e0 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/inventory/service/impl/HealthcareDrugFilingServiceImpl.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/inventory/service/impl/HealthcareDrugFilingServiceImpl.java @@ -1,10 +1,25 @@ package com.ruoyi.inventory.service.impl; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Random; + +import org.apache.ibatis.annotations.Param; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.inventory.domain.*; +import com.ruoyi.inventory.domain.HealthcareDrugArchive; +import com.ruoyi.inventory.domain.HealthcareDrugFiling; +import com.ruoyi.inventory.domain.HealthcareInventoryDrugentry; +import com.ruoyi.inventory.domain.HealthcareInventoryDrugentryDetails; +import com.ruoyi.inventory.domain.HealthcareInventoryStoreroom; import com.ruoyi.inventory.mapper.HealthcareDrugArchiveMapper; import com.ruoyi.inventory.mapper.HealthcareDrugFilingMapper; import com.ruoyi.inventory.mapper.HealthcareInventoryDrugentryMapper; @@ -12,23 +27,6 @@ import com.ruoyi.inventory.mapper.HealthcareInventoryStoreroomMapper; import com.ruoyi.inventory.service.IHealthcareDrugFilingService; import lombok.extern.slf4j.Slf4j; -import org.apache.ibatis.annotations.Param; -import org.mybatis.logging.Logger; -import org.mybatis.logging.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.stream.Collectors; - - - - - /** * 药品库存Service业务层处理 @@ -51,7 +49,6 @@ public class HealthcareDrugFilingServiceImpl implements IHealthcareDrugFilingSer @Autowired public HealthcareInventoryStoreroomMapper healthcareInventoryStoreroomMapper; - /** * 查询药品库存 * @@ -69,7 +66,8 @@ public class HealthcareDrugFilingServiceImpl implements IHealthcareDrugFilingSer } @Override - public List selectHealthcareDrugFilingByBatch(@Param("batch") String batch, @Param("barcode") String barcode) { + public List selectHealthcareDrugFilingByBatch(@Param("batch") String batch, + @Param("barcode") String barcode) { return healthcareDrugFilingMapper.selectHealthcareDrugFilingByArchiveBatch(batch); } @@ -130,15 +128,15 @@ public class HealthcareDrugFilingServiceImpl implements IHealthcareDrugFilingSer public int deleteHealthcareDrugFilingById(Long id) { return healthcareDrugFilingMapper.deleteHealthcareDrugFilingById(id); } - private String generateOrderNo(){ - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); //获取当前时间年月日时分秒 + + private String generateOrderNo() { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); // 获取当前时间年月日时分秒 String currentDataTime = simpleDateFormat.format(new Date()); Random rd = new Random(); - int rdNumber = rd.nextInt(9000)+1000; // 获取四位随机数 - return currentDataTime+rdNumber; + int rdNumber = rd.nextInt(9000) + 1000; // 获取四位随机数 + return currentDataTime + rdNumber; }; - @Override @Transactional public int insertHealthcareInventoryFilings(List list) { @@ -184,10 +182,11 @@ public class HealthcareDrugFilingServiceImpl implements IHealthcareDrugFilingSer // 创建一个列表来存储所有的入库详情对象 List detailsList = new ArrayList<>(); - // 处理药品入库 知无涯 + // 处理药品入库 知无涯 for (HealthcareDrugFiling item : list) { // 获取或创建药品档案ID - List existingArchives = healthcareDrugArchiveMapper.selectHealthcareDrugArchiveByBarcode(item.getBarcode()); + List existingArchives = healthcareDrugArchiveMapper + .selectHealthcareDrugArchiveByBarcode(item.getBarcode()); Long archiveId; HealthcareDrugArchive drugArchive = null; @@ -211,7 +210,7 @@ public class HealthcareDrugFilingServiceImpl implements IHealthcareDrugFilingSer archiveId = drugArchive.getId(); } - //保留2位小数 + // 保留2位小数 double minPrice; if ("Y".equalsIgnoreCase(drugArchive.getIsSplit()) && drugArchive.getMinNumber() != null) { try { @@ -219,7 +218,7 @@ public class HealthcareDrugFilingServiceImpl implements IHealthcareDrugFilingSer if (minNumber > 0) { // BigDecimal保证精度,并保留2位小数 minPrice = new BigDecimal(item.getRetailPrice()) - .divide(new BigDecimal(minNumber), 2, RoundingMode.HALF_UP) + .divide(new BigDecimal(minNumber), 2, RoundingMode.CEILING) .doubleValue(); } else { minPrice = item.getRetailPrice(); @@ -231,13 +230,14 @@ public class HealthcareDrugFilingServiceImpl implements IHealthcareDrugFilingSer } else { // 不可拆分药品直接取零售价 minPrice = new BigDecimal(item.getRetailPrice()) - .setScale(2, RoundingMode.HALF_UP) + .setScale(2, RoundingMode.CEILING) .doubleValue(); } - item.setMinPrice(minPrice); // 设置到入库对象 + item.setMinPrice(minPrice); // 设置到入库对象 // 获取或创建库房ID - HealthcareInventoryStoreroom storeroom = healthcareInventoryStoreroomMapper.selectHealthcareInventoryStoreroomByName(item.getStoreroomName()); + HealthcareInventoryStoreroom storeroom = healthcareInventoryStoreroomMapper + .selectHealthcareInventoryStoreroomByName(item.getStoreroomName()); if (storeroom == null) { storeroom = new HealthcareInventoryStoreroom(); storeroom.setStoreroomName(item.getStoreroomName()); @@ -256,7 +256,8 @@ public class HealthcareDrugFilingServiceImpl implements IHealthcareDrugFilingSer filingQuery.setStoreroomId(item.getStoreroomId()); // 查询现有库存记录 - List existingFilings = healthcareDrugFilingMapper.selectHealthcareDrugFilingByBarcodeAndBatch(filingQuery); + List existingFilings = healthcareDrugFilingMapper + .selectHealthcareDrugFilingByBarcodeAndBatch(filingQuery); if (existingFilings == null || existingFilings.isEmpty()) { // 插入新的库存记录 @@ -316,7 +317,4 @@ public class HealthcareDrugFilingServiceImpl implements IHealthcareDrugFilingSer return healthcareDrugFilingMapper.selectHealthcareDrugFilingByIdAndStoreroom(filing); } - } - - diff --git a/pasd-healthcare/src/main/java/com/ruoyi/inventory/service/impl/HealthcareInventoryDrugoutServiceImpl.java b/pasd-healthcare/src/main/java/com/ruoyi/inventory/service/impl/HealthcareInventoryDrugoutServiceImpl.java index b7329f7..d914a8c 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/inventory/service/impl/HealthcareInventoryDrugoutServiceImpl.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/inventory/service/impl/HealthcareInventoryDrugoutServiceImpl.java @@ -1,33 +1,45 @@ package com.ruoyi.inventory.service.impl; -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.exception.UtilException; -import java.text.SimpleDateFormat; -import java.util.*; -import com.ruoyi.common.utils.DateUtils; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.inventory.domain.*; -import com.ruoyi.inventory.service.IHealthcareDrugArchiveService; -import com.ruoyi.inventory.service.IHealthcareDrugFilingService; -import com.ruoyi.inventory.service.IHealthcareInventoryStoreroomService; -import com.ruoyi.system.domain.HealthcareInventoryDrugoutType; -import com.ruoyi.system.service.IHealthcareInventoryDrugoutTypeService; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashSet; +import java.util.List; +import java.util.Random; +import java.util.Set; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; - -import com.ruoyi.common.utils.StringUtils; import org.springframework.transaction.annotation.Transactional; + +import com.ruoyi.common.exception.UtilException; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.inventory.domain.HealthcareDrugArchive; +import com.ruoyi.inventory.domain.HealthcareDrugFiling; +import com.ruoyi.inventory.domain.HealthcareInventoryDrugout; +import com.ruoyi.inventory.domain.HealthcareInventoryDrugoutDetails; +import com.ruoyi.inventory.domain.HealthcareInventoryDrugoutType; +import com.ruoyi.inventory.domain.HealthcareInventoryStoreroom; import com.ruoyi.inventory.mapper.HealthcareInventoryDrugoutMapper; +import com.ruoyi.inventory.service.IHealthcareDrugArchiveService; +import com.ruoyi.inventory.service.IHealthcareDrugFilingService; import com.ruoyi.inventory.service.IHealthcareInventoryDrugoutService; +import com.ruoyi.inventory.service.IHealthcareInventoryDrugoutTypeService; +import com.ruoyi.inventory.service.IHealthcareInventoryStoreroomService; /** - * 药品出库记录Service业务层处理 + * 药品出库记录 Service 业务处理层 * - * @author 蒋松霖 + * @author 钂嬫澗 * @date 2024-10-07 */ @Service public class HealthcareInventoryDrugoutServiceImpl implements IHealthcareInventoryDrugoutService { + private static final String UNIT_TYPE_BOX = "BOX"; + private static final String UNIT_TYPE_PACK = "PACK"; + @Autowired private HealthcareInventoryDrugoutMapper healthcareInventoryDrugoutMapper; @@ -54,11 +66,12 @@ public class HealthcareInventoryDrugoutServiceImpl implements IHealthcareInvento HealthcareInventoryDrugout drugOut = healthcareInventoryDrugoutMapper.selectHealthcareInventoryDrugoutById(id); if (drugOut != null) { - // 获取出库记录信息之后用其中的id来查询出库记录相对应的出库类型,并且将查询的结果一并赋值给drugOut统一返回 - HealthcareInventoryDrugoutType outType = healthcareInventoryDrugoutTypeService.selectHealthcareInventoryDrugoutTypeByOutTypeDrugOutId(drugOut.getId()); + // 查询出库记录信息后,使用其 id 查询对应的出库类型,并将结果回填到 drugOut 统一返回 + HealthcareInventoryDrugoutType outType = healthcareInventoryDrugoutTypeService + .selectHealthcareInventoryDrugoutTypeByOutTypeDrugOutId(drugOut.getId()); if (outType != null) { - // 再赋值之前需要检查是否为调拨出库,如果是,则判断出库地点与入库地点是否一致,如果一致则抛出异常出库入库地点一致 + // 若为调拨出库,需判断出库地点与入库地点是否一致,若一致则抛出异常 drugOut.setInboundLocation(outType.getInboundLocation()); drugOut.setSignee(outType.getSignee()); drugOut.setProofMaterial(outType.getProofMaterial()); @@ -73,27 +86,46 @@ public class HealthcareInventoryDrugoutServiceImpl implements IHealthcareInvento drugOut.setDisposalMethod(outType.getDisposalMethod()); } - // 获取出库记录药品档案信息 + // 获取出库记录的药品档案信息 List details = drugOut.getHealthcareInventoryDrugoutDetailsList(); if (!details.isEmpty()) { details.forEach(item -> { - HealthcareDrugArchive archive = healthcareDrugArchiveService.selectHealthcareDrugArchiveById(item.getDrugId()); + HealthcareDrugArchive archive = healthcareDrugArchiveService + .selectHealthcareDrugArchiveById(item.getDrugId()); if (archive != null) { item.setDrugId(archive.getId()); item.setMedicineName(archive.getMedicineName()); item.setBarcode(archive.getBarcode()); item.setManufacturer(archive.getManufacturer()); } - HealthcareInventoryStoreroom storeroom = healthcareInventoryStoreroomService.selectHealthcareInventoryStoreroomById(item.getOutPointId()); + HealthcareInventoryStoreroom storeroom = healthcareInventoryStoreroomService + .selectHealthcareInventoryStoreroomById(item.getOutPointId()); if (storeroom != null) { item.setOutPointName(storeroom.getStoreroomName()); } - List filing = healthcareDrugFilingService.selectHealthcareDrugFilingByArchiveId(archive.getId()); - filing.forEach(item2 -> { - item.setRetailPrice(item2.getRetailPrice()); - }); - + if (item.getFilingId() != null) { + HealthcareDrugFiling filingRecord = healthcareDrugFilingService + .selectHealthcareDrugFilingById(item.getFilingId()); + if (filingRecord != null) { + item.setRetailPrice(filingRecord.getRetailPrice()); + item.setRemainingQuantity(filingRecord.getBoxCount()); + item.setRemainingPackQuantity(filingRecord.getPackCount()); + item.setInventoryUnit(filingRecord.getInventoryUnit()); + item.setSplitUnit(filingRecord.getSplitUnit()); + if (item.getUnitQuantity() == null) { + double minNumber = filingRecord.getMinNumber(); + if (minNumber > 0) { + item.setUnitQuantity((int) Math.round(minNumber)); + } else { + item.setUnitQuantity(1); + } + } + } + } + if (StringUtils.isBlank(item.getUnitType())) { + item.setUnitType(UNIT_TYPE_BOX); + } }); } } @@ -105,22 +137,24 @@ public class HealthcareInventoryDrugoutServiceImpl implements IHealthcareInvento * 查询药品出库记录列表 * * @param healthcareInventoryDrugout 药品出库记录 - * @return 药品出库记录 + * @return 药品出库记录列表 */ @Override - public List selectHealthcareInventoryDrugoutList(HealthcareInventoryDrugout healthcareInventoryDrugout) { - List list = healthcareInventoryDrugoutMapper.selectHealthcareInventoryDrugoutList(healthcareInventoryDrugout); + public List selectHealthcareInventoryDrugoutList( + HealthcareInventoryDrugout healthcareInventoryDrugout) { + List list = healthcareInventoryDrugoutMapper + .selectHealthcareInventoryDrugoutList(healthcareInventoryDrugout); list.forEach(item -> { - HealthcareInventoryStoreroom storeroom = healthcareInventoryStoreroomService.selectHealthcareInventoryStoreroomById(item.getOutPoint()); + HealthcareInventoryStoreroom storeroom = healthcareInventoryStoreroomService + .selectHealthcareInventoryStoreroomById(item.getOutPoint()); item.setOutPointName(storeroom.getStoreroomName()); }); return list; } - - //定义一个方法用来生成出库记录单号 + // 定义一个方法用于生成出库记录单号 private String generateOrderNo() { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); //获取当前时间年月日时分秒 + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); // 获取当前时间年月日时分秒 String currentDataTime = simpleDateFormat.format(new Date()); Random rd = new Random(); int rdNumber = rd.nextInt(9000) + 1000; // 获取四位随机数 @@ -139,97 +173,32 @@ public class HealthcareInventoryDrugoutServiceImpl implements IHealthcareInvento @Transactional @Override public int insertHealthcareInventoryDrugout(HealthcareInventoryDrugout healthcareInventoryDrugout) { - // 判断当前出库记录类型是否为调拨出库 - if (healthcareInventoryDrugout.getOutType() == 0) { - // 当前出库类型为调拨出库 - if (!healthcareInventoryDrugout.getOutPoint().equals(healthcareInventoryDrugout.getInboundLocation())) { // 检查出入库地点是否一致 - // 不一致则执行调拨出库逻辑代码 - List details = healthcareInventoryDrugout.getHealthcareInventoryDrugoutDetailsList(); - for (HealthcareInventoryDrugoutDetails item : details) { - if (healthcareInventoryDrugout.getOutPoint() == item.getOutPointId()){ // 检查将出库药品库房是否和当前出库药品库房是否一致 - // 如果一致则执行操作库存代码,不一致则抛出异常出库库房记录与药品库存库记录不一致,请重新选择! - // 减少出库地点的库存 - HealthcareDrugFiling outFiling = new HealthcareDrugFiling(); - outFiling.setStoreroomId(healthcareInventoryDrugout.getOutPoint()); - outFiling.setArchiveId(item.getDrugId()); - outFiling.setBatch(item.getOutBatch()); - - // 获取需要出库的药品库存 - HealthcareDrugFiling outFiling2 = healthcareDrugFilingService.selectHealthcareDrugFilingByIdAndStoreroom(outFiling); - if (outFiling2 != null) { - if (item.getQuantity() > outFiling2.getBoxCount()) { - throw new UtilException(item.getOutBatch() + "批次库存数量不足"); - } else { - outFiling2.setBoxCount(outFiling2.getBoxCount() - item.getQuantity()); - healthcareDrugFilingService.updateHealthcareDrugFiling(outFiling2); - } - } else { - throw new UtilException("未找到出库地点对应的批次"); - } - - // 增加入库地点的库存 - HealthcareDrugFiling inFiling = new HealthcareDrugFiling(); - inFiling.setStoreroomId(healthcareInventoryDrugout.getInboundLocation()); - inFiling.setArchiveId(item.getDrugId()); - inFiling.setBatch(item.getOutBatch()); - - // 获取需要入库的药品库存 - HealthcareDrugFiling inFiling2 = healthcareDrugFilingService.selectHealthcareDrugFilingByIdAndStoreroom(inFiling); - if (inFiling2 != null) { - inFiling2.setBoxCount(inFiling2.getBoxCount() + item.getQuantity()); - healthcareDrugFilingService.updateHealthcareDrugFiling(inFiling2); - } else { - inFiling.setBoxCount(item.getQuantity()); - inFiling.setExpiryDate(item.getExpiryDate()); - inFiling.setRetailPrice(item.getRetailPrice()); - healthcareDrugFilingService.insertHealthcareDrugFiling(inFiling); - } - }else { - throw new RuntimeException("出库库房记录与药品库存库记录不一致,请重新选择!"); - } - - } - } else { - // 地点一致抛出异常 - throw new RuntimeException("出库地点与入库地点一致"); - } - } else { - // 普通出库 - // 检查批次号码是否重复 - List details = healthcareInventoryDrugout.getHealthcareInventoryDrugoutDetailsList(); - Set batchNumbers = new HashSet<>(); - for (HealthcareInventoryDrugoutDetails item : details) { - if (!batchNumbers.add(item.getOutBatch())) { - throw new RuntimeException("批次号码重复!"); - } - } - - for (HealthcareInventoryDrugoutDetails item : details) { - HealthcareDrugFiling filing = healthcareDrugFilingService.selectHealthcareDrugFilingById(item.getFilingId()); - if (filing != null) { - if (item.getQuantity() > filing.getBoxCount()) { - throw new UtilException("当前库存数量不足"); - } else { - filing.setBoxCount(filing.getBoxCount() - item.getQuantity()); - healthcareDrugFilingService.updateHealthcareDrugFiling(filing); - } - } - } + List details = healthcareInventoryDrugout + .getHealthcareInventoryDrugoutDetailsList(); + if (details == null) { + details = new ArrayList<>(); + healthcareInventoryDrugout.setHealthcareInventoryDrugoutDetailsList(details); + } + + aggregateTotals(healthcareInventoryDrugout, details); + + if (healthcareInventoryDrugout.getOutType() == 0) { + handleTransferInventory(healthcareInventoryDrugout, details); + } else { + validateDuplicateBatch(details); + handleNormalInventory(details); } - // 设置出库记录的创建时间、状态、单号、出库人等信息 healthcareInventoryDrugout.setCreateTime(DateUtils.getNowDate()); - healthcareInventoryDrugout.setOutStatus(0); // 已完成 + healthcareInventoryDrugout.setOutStatus(0); String orderNo = generateOrderNo(); healthcareInventoryDrugout.setOutCode(orderNo); String currentUser = SecurityUtils.getUsername(); healthcareInventoryDrugout.setOutPerson(currentUser); - // 插入出库记录到数据库 int rows = healthcareInventoryDrugoutMapper.insertHealthcareInventoryDrugout(healthcareInventoryDrugout); insertHealthcareInventoryDrugoutDetails(healthcareInventoryDrugout); - // 新建一个出库类型对象 HealthcareInventoryDrugoutType outType = new HealthcareInventoryDrugoutType(); outType.setDrugOutId(healthcareInventoryDrugout.getId()); outType.setInboundLocation(healthcareInventoryDrugout.getInboundLocation()); @@ -245,7 +214,6 @@ public class HealthcareInventoryDrugoutServiceImpl implements IHealthcareInvento outType.setDisposalMethod(healthcareInventoryDrugout.getDisposalMethod()); outType.setDamageReason(healthcareInventoryDrugout.getDamageReason()); - // 调用出库类型业务层 healthcareInventoryDrugoutTypeService.insertHealthcareInventoryDrugoutType(outType); return rows; @@ -260,103 +228,37 @@ public class HealthcareInventoryDrugoutServiceImpl implements IHealthcareInvento @Transactional @Override public int updateHealthcareInventoryDrugout(HealthcareInventoryDrugout healthcareInventoryDrugout) { - // 判断当前出库记录类型是否为调拨出库 - if (healthcareInventoryDrugout.getOutType() == 0) { - // 当前出库类型为调拨出库 - if (!healthcareInventoryDrugout.getOutPoint().equals(healthcareInventoryDrugout.getInboundLocation())) { // 检查出入库地点是否一致 - // 不一致则执行调拨出库逻辑代码 - List details = healthcareInventoryDrugout.getHealthcareInventoryDrugoutDetailsList(); - - for (HealthcareInventoryDrugoutDetails item : details) { - if (healthcareInventoryDrugout.getOutPoint() == item.getOutPointId()){ // 检查将出库药品库房是否和当前出库药品库房是否一致 - // 如果一致则执行操作库存代码,不一致则抛出异常出库库房记录与药品库存库记录不一致,请重新选择! - // 减少出库地点的库存 - HealthcareDrugFiling outFiling = new HealthcareDrugFiling(); - outFiling.setStoreroomId(healthcareInventoryDrugout.getOutPoint()); - outFiling.setArchiveId(item.getDrugId()); - outFiling.setBatch(item.getOutBatch()); - - // 获取需要出库的药品库存 - HealthcareDrugFiling outFiling2 = healthcareDrugFilingService.selectHealthcareDrugFilingByIdAndStoreroom(outFiling); - if (outFiling2 != null) { - if (item.getQuantity() > outFiling2.getBoxCount()) { - throw new UtilException(item.getOutBatch() + "批次库存数量不足"); - } else { - outFiling2.setBoxCount(outFiling2.getBoxCount() - item.getQuantity()); - healthcareDrugFilingService.updateHealthcareDrugFiling(outFiling2); - } - } else { - throw new UtilException("未找到出库地点对应的批次"); - } - - // 增加入库地点的库存 - HealthcareDrugFiling inFiling = new HealthcareDrugFiling(); - inFiling.setStoreroomId(healthcareInventoryDrugout.getInboundLocation()); - inFiling.setArchiveId(item.getDrugId()); - inFiling.setBatch(item.getOutBatch()); - - // 获取需要入库的药品库存 - HealthcareDrugFiling inFiling2 = healthcareDrugFilingService.selectHealthcareDrugFilingByIdAndStoreroom(inFiling); - if (inFiling2 != null) { - inFiling2.setBoxCount(inFiling2.getBoxCount() + item.getQuantity()); - healthcareDrugFilingService.updateHealthcareDrugFiling(inFiling2); - } else { - inFiling.setBoxCount(item.getQuantity()); - inFiling.setExpiryDate(item.getExpiryDate()); - inFiling.setRetailPrice(item.getRetailPrice()); - healthcareDrugFilingService.insertHealthcareDrugFiling(inFiling); - } - }else { - throw new RuntimeException("出库库房记录与药品库存库记录不一致,请重新选择!"); - } - } - } else { - // 地点一致抛出异常 - throw new RuntimeException("出库地点与入库地点一致"); - } - } else { - // 普通出库 - // 检查批次号码是否重复 - List details = healthcareInventoryDrugout.getHealthcareInventoryDrugoutDetailsList(); - Set batchNumbers = new HashSet<>(); - for (HealthcareInventoryDrugoutDetails item : details) { - if (!batchNumbers.add(item.getOutBatch())) { - throw new RuntimeException("批次号码重复!"); - } - } - - for (HealthcareInventoryDrugoutDetails item : details) { - HealthcareDrugFiling filing = healthcareDrugFilingService.selectHealthcareDrugFilingById(item.getFilingId()); - if (filing != null) { - if (item.getQuantity() > filing.getBoxCount()) { - throw new UtilException(item.getOutBatch()+"批次库存数量不足"); - } else { - filing.setBoxCount(filing.getBoxCount() - item.getQuantity()); - healthcareDrugFilingService.updateHealthcareDrugFiling(filing); - } - } - } + List details = healthcareInventoryDrugout + .getHealthcareInventoryDrugoutDetailsList(); + if (details == null) { + details = new ArrayList<>(); + healthcareInventoryDrugout.setHealthcareInventoryDrugoutDetailsList(details); + } + + aggregateTotals(healthcareInventoryDrugout, details); + + if (healthcareInventoryDrugout.getOutType() == 0) { + handleTransferInventory(healthcareInventoryDrugout, details); + } else { + validateDuplicateBatch(details); + handleNormalInventory(details); } - // 更新出库记录的创建时间、状态、单号、出库人等信息 healthcareInventoryDrugout.setUpdateTime(DateUtils.getNowDate()); - healthcareInventoryDrugout.setOutStatus(0); // 已完成 + healthcareInventoryDrugout.setOutStatus(0); String orderNo = generateOrderNo(); healthcareInventoryDrugout.setOutCode(orderNo); String currentUser = SecurityUtils.getUsername(); healthcareInventoryDrugout.setOutPerson(currentUser); - // 更新出库记录到数据库 int rows = healthcareInventoryDrugoutMapper.updateHealthcareInventoryDrugout(healthcareInventoryDrugout); - // 删除旧的详情记录 - healthcareInventoryDrugoutMapper.deleteHealthcareInventoryDrugoutDetailsByDrugOutId(healthcareInventoryDrugout.getId()); - - // 插入新的详情记录 + healthcareInventoryDrugoutMapper + .deleteHealthcareInventoryDrugoutDetailsByDrugOutId(healthcareInventoryDrugout.getId()); insertHealthcareInventoryDrugoutDetails(healthcareInventoryDrugout); - // 更新出库类型记录 - HealthcareInventoryDrugoutType outType = healthcareInventoryDrugoutTypeService.selectHealthcareInventoryDrugoutTypeByOutTypeDrugOutId(healthcareInventoryDrugout.getId()); + HealthcareInventoryDrugoutType outType = healthcareInventoryDrugoutTypeService + .selectHealthcareInventoryDrugoutTypeByOutTypeDrugOutId(healthcareInventoryDrugout.getId()); if (outType != null) { outType.setInboundLocation(healthcareInventoryDrugout.getInboundLocation()); outType.setSignee(healthcareInventoryDrugout.getSignee()); @@ -370,11 +272,8 @@ public class HealthcareInventoryDrugoutServiceImpl implements IHealthcareInvento outType.setDestructionProcess(healthcareInventoryDrugout.getDestructionProcess()); outType.setDisposalMethod(healthcareInventoryDrugout.getDisposalMethod()); outType.setDamageReason(healthcareInventoryDrugout.getDamageReason()); - - // 调用出库类型业务层 healthcareInventoryDrugoutTypeService.updateHealthcareInventoryDrugoutType(outType); } else { - // 如果不存在,则插入新的出库类型记录 outType = new HealthcareInventoryDrugoutType(); outType.setDrugOutId(healthcareInventoryDrugout.getId()); outType.setInboundLocation(healthcareInventoryDrugout.getInboundLocation()); @@ -389,16 +288,12 @@ public class HealthcareInventoryDrugoutServiceImpl implements IHealthcareInvento outType.setDestructionProcess(healthcareInventoryDrugout.getDestructionProcess()); outType.setDisposalMethod(healthcareInventoryDrugout.getDisposalMethod()); outType.setDamageReason(healthcareInventoryDrugout.getDamageReason()); - - // 调用出库类型业务层 healthcareInventoryDrugoutTypeService.insertHealthcareInventoryDrugoutType(outType); } return rows; } - - /** * 批量删除药品出库记录 * @@ -407,8 +302,7 @@ public class HealthcareInventoryDrugoutServiceImpl implements IHealthcareInvento */ @Transactional @Override - public int deleteHealthcareInventoryDrugoutByIds(Long[] ids) - { + public int deleteHealthcareInventoryDrugoutByIds(Long[] ids) { healthcareInventoryDrugoutMapper.deleteHealthcareInventoryDrugoutDetailsByDrugOutIds(ids); return healthcareInventoryDrugoutMapper.deleteHealthcareInventoryDrugoutByIds(ids); } @@ -421,92 +315,300 @@ public class HealthcareInventoryDrugoutServiceImpl implements IHealthcareInvento */ @Transactional @Override - public int deleteHealthcareInventoryDrugoutById(Long id) - { + public int deleteHealthcareInventoryDrugoutById(Long id) { healthcareInventoryDrugoutMapper.deleteHealthcareInventoryDrugoutDetailsByDrugOutId(id); return healthcareInventoryDrugoutMapper.deleteHealthcareInventoryDrugoutById(id); } @Override public int saveHealthcareInventoryDrugout(HealthcareInventoryDrugout healthcareInventoryDrugout) { - if (healthcareInventoryDrugout.getId() == null){ - healthcareInventoryDrugout.setCreateTime(DateUtils.getNowDate()); // 当前时间 - healthcareInventoryDrugout.setOutStatus(1); //未完成 + List details = healthcareInventoryDrugout + .getHealthcareInventoryDrugoutDetailsList(); + if (details == null) { + details = new ArrayList<>(); + healthcareInventoryDrugout.setHealthcareInventoryDrugoutDetailsList(details); + } + + aggregateTotals(healthcareInventoryDrugout, details); + if (healthcareInventoryDrugout.getOutType() != 0) { + validateDuplicateBatch(details); + } + + if (healthcareInventoryDrugout.getId() == null) { + healthcareInventoryDrugout.setCreateTime(DateUtils.getNowDate()); + healthcareInventoryDrugout.setOutStatus(1); String orNumber = generateOrderNo(); - healthcareInventoryDrugout.setOutCode(orNumber); // 出库单号 + healthcareInventoryDrugout.setOutCode(orNumber); String person = SecurityUtils.getUsername(); - healthcareInventoryDrugout.setOutPerson(person); // 出库人 + healthcareInventoryDrugout.setOutPerson(person); int rows = healthcareInventoryDrugoutMapper.insertHealthcareInventoryDrugout(healthcareInventoryDrugout); insertHealthcareInventoryDrugoutDetails(healthcareInventoryDrugout); - // 新建一个出库类型对象 - HealthcareInventoryDrugoutType OutType = new HealthcareInventoryDrugoutType(); - // 将前端传来的参数赋值给OutType - OutType.setDrugOutId(healthcareInventoryDrugout.getId()); - OutType.setInboundLocation(healthcareInventoryDrugout.getInboundLocation()); - OutType.setSignee(healthcareInventoryDrugout.getSignee()); - OutType.setProofMaterial(healthcareInventoryDrugout.getProofMaterial()); - OutType.setPurposeDetails(healthcareInventoryDrugout.getPurposeDetails()); - OutType.setUnit(healthcareInventoryDrugout.getUnit()); - OutType.setExpirationDate(healthcareInventoryDrugout.getExpirationDate()); - OutType.setCurrentDatetime(healthcareInventoryDrugout.getCurrentDatetime()); - OutType.setDestroyer(healthcareInventoryDrugout.getDestroyer()); - OutType.setDestructionLocation(healthcareInventoryDrugout.getDestructionLocation()); - OutType.setDestructionProcess(healthcareInventoryDrugout.getDestructionProcess()); - OutType.setDisposalMethod(healthcareInventoryDrugout.getDisposalMethod()); - OutType.setDamageReason(healthcareInventoryDrugout.getDamageReason()); + HealthcareInventoryDrugoutType outType = new HealthcareInventoryDrugoutType(); + outType.setDrugOutId(healthcareInventoryDrugout.getId()); + outType.setInboundLocation(healthcareInventoryDrugout.getInboundLocation()); + outType.setSignee(healthcareInventoryDrugout.getSignee()); + outType.setProofMaterial(healthcareInventoryDrugout.getProofMaterial()); + outType.setPurposeDetails(healthcareInventoryDrugout.getPurposeDetails()); + outType.setUnit(healthcareInventoryDrugout.getUnit()); + outType.setExpirationDate(healthcareInventoryDrugout.getExpirationDate()); + outType.setCurrentDatetime(healthcareInventoryDrugout.getCurrentDatetime()); + outType.setDestroyer(healthcareInventoryDrugout.getDestroyer()); + outType.setDestructionLocation(healthcareInventoryDrugout.getDestructionLocation()); + outType.setDestructionProcess(healthcareInventoryDrugout.getDestructionProcess()); + outType.setDisposalMethod(healthcareInventoryDrugout.getDisposalMethod()); + outType.setDamageReason(healthcareInventoryDrugout.getDamageReason()); - // 调用出库类型业务层 - healthcareInventoryDrugoutTypeService.insertHealthcareInventoryDrugoutType(OutType); + healthcareInventoryDrugoutTypeService.insertHealthcareInventoryDrugoutType(outType); return rows; - }else { - healthcareInventoryDrugoutMapper.deleteHealthcareInventoryDrugoutDetailsByDrugOutId(healthcareInventoryDrugout.getId()); + } else { + healthcareInventoryDrugoutMapper + .deleteHealthcareInventoryDrugoutDetailsByDrugOutId(healthcareInventoryDrugout.getId()); insertHealthcareInventoryDrugoutDetails(healthcareInventoryDrugout); - // 新建一个出库类型对象 - HealthcareInventoryDrugoutType OutType = new HealthcareInventoryDrugoutType(); - // 将前端传来的参数赋值给OutType - OutType.setDrugOutId(healthcareInventoryDrugout.getId()); - OutType.setInboundLocation(healthcareInventoryDrugout.getInboundLocation()); - OutType.setSignee(healthcareInventoryDrugout.getSignee()); - OutType.setProofMaterial(healthcareInventoryDrugout.getProofMaterial()); - OutType.setPurposeDetails(healthcareInventoryDrugout.getPurposeDetails()); - OutType.setUnit(healthcareInventoryDrugout.getUnit()); - OutType.setExpirationDate(healthcareInventoryDrugout.getExpirationDate()); - OutType.setCurrentDatetime(healthcareInventoryDrugout.getCurrentDatetime()); - OutType.setDestroyer(healthcareInventoryDrugout.getDestroyer()); - OutType.setDestructionLocation(healthcareInventoryDrugout.getDestructionLocation()); - OutType.setDestructionProcess(healthcareInventoryDrugout.getDestructionProcess()); - OutType.setDisposalMethod(healthcareInventoryDrugout.getDisposalMethod()); - OutType.setDamageReason(healthcareInventoryDrugout.getDamageReason()); - - // 调用出库类型业务层 - healthcareInventoryDrugoutTypeService.updateHealthcareInventoryDrugoutType(OutType); + HealthcareInventoryDrugoutType outType = new HealthcareInventoryDrugoutType(); + outType.setDrugOutId(healthcareInventoryDrugout.getId()); + outType.setInboundLocation(healthcareInventoryDrugout.getInboundLocation()); + outType.setSignee(healthcareInventoryDrugout.getSignee()); + outType.setProofMaterial(healthcareInventoryDrugout.getProofMaterial()); + outType.setPurposeDetails(healthcareInventoryDrugout.getPurposeDetails()); + outType.setUnit(healthcareInventoryDrugout.getUnit()); + outType.setExpirationDate(healthcareInventoryDrugout.getExpirationDate()); + outType.setCurrentDatetime(healthcareInventoryDrugout.getCurrentDatetime()); + outType.setDestroyer(healthcareInventoryDrugout.getDestroyer()); + outType.setDestructionLocation(healthcareInventoryDrugout.getDestructionLocation()); + outType.setDestructionProcess(healthcareInventoryDrugout.getDestructionProcess()); + outType.setDisposalMethod(healthcareInventoryDrugout.getDisposalMethod()); + outType.setDamageReason(healthcareInventoryDrugout.getDamageReason()); + healthcareInventoryDrugoutTypeService.updateHealthcareInventoryDrugoutType(outType); return healthcareInventoryDrugoutMapper.updateHealthcareInventoryDrugout(healthcareInventoryDrugout); } } /** - * 新增出库详情,用于记录药品出库的详细信息信息 + * 汇总出库总量,用于记录药品出库的详细信息 * * @param healthcareInventoryDrugout 药品出库记录对象 */ - public void insertHealthcareInventoryDrugoutDetails(HealthcareInventoryDrugout healthcareInventoryDrugout) - { - List healthcareInventoryDrugoutDetailsList = healthcareInventoryDrugout.getHealthcareInventoryDrugoutDetailsList(); + private void aggregateTotals(HealthcareInventoryDrugout master, List details) { + int totalBoxes = 0; + int totalPacks = 0; + int totalMinUnits = 0; + for (HealthcareInventoryDrugoutDetails detail : details) { + String unitType = normalizeUnitType(detail); + int quantity = extractQuantity(detail); + int unitQuantity = extractUnitQuantity(detail); + if (UNIT_TYPE_PACK.equals(unitType)) { + totalPacks += quantity; + totalMinUnits += quantity; + } else { + totalBoxes += quantity; + totalMinUnits += quantity * unitQuantity; + } + } + master.setOutBoxQuantity((long) totalBoxes); + master.setOutPackQuantity((long) totalPacks); + master.setOutQuantity((long) totalMinUnits); + } + + private void validateDuplicateBatch(List details) { + Set batchNumbers = new HashSet<>(); + for (HealthcareInventoryDrugoutDetails detail : details) { + String batch = detail.getOutBatch(); + if (StringUtils.isNotEmpty(batch) && !batchNumbers.add(batch)) { + throw new RuntimeException("批次号重复"); + } + } + } + + private void handleTransferInventory(HealthcareInventoryDrugout master, + List details) { + if (master.getOutPoint() == null || master.getInboundLocation() == null) { + throw new UtilException("出入库地点不能为空"); + } + if (master.getOutPoint().equals(master.getInboundLocation())) { + throw new RuntimeException("出库地点与入库地点不能相同"); + } + for (HealthcareInventoryDrugoutDetails detail : details) { + if (detail.getOutPointId() == null || !master.getOutPoint().equals(detail.getOutPointId())) { + throw new RuntimeException("出库库房记录与药品库房记录不一致,请重新选择"); + } + applyTransferInventory(master, detail); + } + } + + private void applyTransferInventory(HealthcareInventoryDrugout master, HealthcareInventoryDrugoutDetails detail) { + HealthcareDrugFiling outLookup = new HealthcareDrugFiling(); + outLookup.setStoreroomId(master.getOutPoint()); + outLookup.setArchiveId(detail.getDrugId()); + outLookup.setBatch(detail.getOutBatch()); + + HealthcareDrugFiling outInventory = healthcareDrugFilingService + .selectHealthcareDrugFilingByIdAndStoreroom(outLookup); + if (outInventory == null) { + throw new UtilException("未找到出库地点对应的批次"); + } + adjustInventoryForOut(outInventory, detail); + healthcareDrugFilingService.updateHealthcareDrugFiling(outInventory); + + HealthcareDrugFiling inLookup = new HealthcareDrugFiling(); + inLookup.setStoreroomId(master.getInboundLocation()); + inLookup.setArchiveId(detail.getDrugId()); + inLookup.setBatch(detail.getOutBatch()); + + HealthcareDrugFiling inInventory = healthcareDrugFilingService + .selectHealthcareDrugFilingByIdAndStoreroom(inLookup); + if (inInventory != null) { + adjustInventoryForIn(inInventory, detail); + healthcareDrugFilingService.updateHealthcareDrugFiling(inInventory); + } else { + initializeInventoryForNewRecord(inLookup, detail); + healthcareDrugFilingService.insertHealthcareDrugFiling(inLookup); + } + } + + private void handleNormalInventory(List details) { + for (HealthcareInventoryDrugoutDetails detail : details) { + if (detail.getFilingId() == null) { + throw new UtilException("库存记录缺失"); + } + HealthcareDrugFiling filing = healthcareDrugFilingService + .selectHealthcareDrugFilingById(detail.getFilingId()); + if (filing == null) { + throw new UtilException("未找到对应的库存记录"); + } + adjustInventoryForOut(filing, detail); + healthcareDrugFilingService.updateHealthcareDrugFiling(filing); + } + } + + private void adjustInventoryForOut(HealthcareDrugFiling filing, HealthcareInventoryDrugoutDetails detail) { + String unitType = normalizeUnitType(detail); + int quantity = extractQuantity(detail); + if (quantity <= 0) { + return; + } + if (UNIT_TYPE_PACK.equals(unitType)) { + int current = filing.getPackCount() == null ? 0 : filing.getPackCount(); + if (quantity > current) { + throw new UtilException((detail.getOutBatch() == null ? "" : detail.getOutBatch()) + "批次拆零数量不足"); + } + filing.setPackCount(current - quantity); + } else { + int current = filing.getBoxCount() == null ? 0 : filing.getBoxCount(); + if (quantity > current) { + throw new UtilException((detail.getOutBatch() == null ? "" : detail.getOutBatch()) + "批次库存数量不足"); + } + filing.setBoxCount(current - quantity); + } + } + + private void adjustInventoryForIn(HealthcareDrugFiling filing, HealthcareInventoryDrugoutDetails detail) { + String unitType = normalizeUnitType(detail); + int quantity = extractQuantity(detail); + if (quantity <= 0) { + return; + } + if (UNIT_TYPE_PACK.equals(unitType)) { + int current = filing.getPackCount() == null ? 0 : filing.getPackCount(); + filing.setPackCount(current + quantity); + } else { + int current = filing.getBoxCount() == null ? 0 : filing.getBoxCount(); + filing.setBoxCount(current + quantity); + } + } + + private void initializeInventoryForNewRecord(HealthcareDrugFiling filing, + HealthcareInventoryDrugoutDetails detail) { + filing.setExpiryDate(detail.getExpiryDate()); + filing.setRetailPrice(detail.getRetailPrice()); + filing.setBoxCount(0); + filing.setPackCount(0); + // 计算并补充最小单位价格与数量(用于新库区首次建立批次记录) + try { + HealthcareDrugArchive archive = healthcareDrugArchiveService + .selectHealthcareDrugArchiveById(detail.getDrugId()); + if (archive != null) { + String mnStr = archive.getMinNumber(); + double minNumber = 0d; + if (org.apache.commons.lang3.StringUtils.isNotBlank(mnStr)) { + try { + minNumber = Double.parseDouble(mnStr); + } catch (Exception e) { + } + } + filing.setMinNumber(minNumber); + if ("Y".equalsIgnoreCase(archive.getIsSplit()) && minNumber > 0) { + java.math.BigDecimal retail = new java.math.BigDecimal(String.valueOf(detail.getRetailPrice())); + java.math.BigDecimal mn = new java.math.BigDecimal(String.valueOf(minNumber)); + java.math.BigDecimal minPrice = retail.divide(mn, 2, java.math.RoundingMode.CEILING); + filing.setMinPrice(minPrice.doubleValue()); + } else { + filing.setMinPrice(detail.getRetailPrice()); + } + if (archive.getPackageUnit() != null) { + filing.setInventoryUnit(archive.getPackageUnit()); + } + if (archive.getSplitUnit() != null) { + filing.setSplitUnit(archive.getSplitUnit()); + } + } + } catch (Exception ignore) { + } + String unitType = normalizeUnitType(detail); + int quantity = extractQuantity(detail); + if (UNIT_TYPE_PACK.equals(unitType)) { + filing.setPackCount(quantity); + } else { + filing.setBoxCount(quantity); + } + } + + private String normalizeUnitType(HealthcareInventoryDrugoutDetails detail) { + String unitType = detail.getUnitType(); + if (StringUtils.isBlank(unitType)) { + unitType = UNIT_TYPE_BOX; + } else { + unitType = unitType.toUpperCase(); + if (!UNIT_TYPE_PACK.equals(unitType)) { + unitType = UNIT_TYPE_BOX; + } + } + detail.setUnitType(unitType); + return unitType; + } + + private int extractQuantity(HealthcareInventoryDrugoutDetails detail) { + Integer quantity = detail.getQuantity(); + if (quantity == null || quantity < 0) { + quantity = 0; + } + detail.setQuantity(quantity); + return quantity; + } + + private int extractUnitQuantity(HealthcareInventoryDrugoutDetails detail) { + Integer unitQuantity = detail.getUnitQuantity(); + if (unitQuantity == null || unitQuantity <= 0) { + unitQuantity = 1; + detail.setUnitQuantity(unitQuantity); + } + return unitQuantity; + } + + public void insertHealthcareInventoryDrugoutDetails(HealthcareInventoryDrugout healthcareInventoryDrugout) { + List healthcareInventoryDrugoutDetailsList = healthcareInventoryDrugout + .getHealthcareInventoryDrugoutDetailsList(); Long id = healthcareInventoryDrugout.getId(); - if (StringUtils.isNotNull(healthcareInventoryDrugoutDetailsList)) - { + if (StringUtils.isNotNull(healthcareInventoryDrugoutDetailsList)) { List list = new ArrayList(); - for (HealthcareInventoryDrugoutDetails healthcareInventoryDrugoutDetails : healthcareInventoryDrugoutDetailsList) - { + for (HealthcareInventoryDrugoutDetails healthcareInventoryDrugoutDetails : healthcareInventoryDrugoutDetailsList) { healthcareInventoryDrugoutDetails.setDrugOutId(id); list.add(healthcareInventoryDrugoutDetails); } - if (list.size() > 0) - { + if (list.size() > 0) { healthcareInventoryDrugoutMapper.batchHealthcareInventoryDrugoutDetails(list); } } diff --git a/pasd-healthcare/src/main/java/com/ruoyi/inventory/service/impl/HealthcareInventoryDrugoutTypeServiceImpl.java b/pasd-healthcare/src/main/java/com/ruoyi/inventory/service/impl/HealthcareInventoryDrugoutTypeServiceImpl.java index c470e20..3c98e7f 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/inventory/service/impl/HealthcareInventoryDrugoutTypeServiceImpl.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/inventory/service/impl/HealthcareInventoryDrugoutTypeServiceImpl.java @@ -2,28 +2,28 @@ package com.ruoyi.inventory.service.impl; import java.util.List; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.inventory.domain.HealthcareInventoryDrugoutType; import com.ruoyi.inventory.mapper.HealthcareInventoryDrugoutTypeMapper; +import com.ruoyi.inventory.service.IHealthcareInventoryDrugoutTypeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.ruoyi.system.domain.HealthcareInventoryDrugoutType; -import com.ruoyi.system.service.IHealthcareInventoryDrugoutTypeService; /** * 仓库调拨记录Service业务层处理 - * + * * @author ruoyi * @date 2024-10-08 */ @Service -public class HealthcareInventoryDrugoutTypeServiceImpl implements IHealthcareInventoryDrugoutTypeService +public class HealthcareInventoryDrugoutTypeServiceImpl implements IHealthcareInventoryDrugoutTypeService { @Autowired private HealthcareInventoryDrugoutTypeMapper healthcareInventoryDrugoutTypeMapper; /** * 查询仓库调拨记录 - * + * * @param outTypeId 仓库调拨记录主键 * @return 仓库调拨记录 */ @@ -45,7 +45,7 @@ public class HealthcareInventoryDrugoutTypeServiceImpl implements IHealthcareInv /** * 查询仓库调拨记录列表 - * + * * @param healthcareInventoryDrugoutType 仓库调拨记录 * @return 仓库调拨记录 */ @@ -57,7 +57,7 @@ public class HealthcareInventoryDrugoutTypeServiceImpl implements IHealthcareInv /** * 新增仓库调拨记录 - * + * * @param healthcareInventoryDrugoutType 仓库调拨记录 * @return 结果 */ @@ -70,7 +70,7 @@ public class HealthcareInventoryDrugoutTypeServiceImpl implements IHealthcareInv /** * 修改仓库调拨记录 - * + * * @param healthcareInventoryDrugoutType 仓库调拨记录 * @return 结果 */ @@ -83,7 +83,7 @@ public class HealthcareInventoryDrugoutTypeServiceImpl implements IHealthcareInv /** * 批量删除仓库调拨记录 - * + * * @param outTypeIds 需要删除的仓库调拨记录主键 * @return 结果 */ @@ -95,7 +95,7 @@ public class HealthcareInventoryDrugoutTypeServiceImpl implements IHealthcareInv /** * 删除仓库调拨记录信息 - * + * * @param outTypeId 仓库调拨记录主键 * @return 结果 */ diff --git a/pasd-healthcare/src/main/java/com/ruoyi/os/controller/PatientDiagnosisController.java b/pasd-healthcare/src/main/java/com/ruoyi/os/controller/PatientDiagnosisController.java index 644b394..52c67e7 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/os/controller/PatientDiagnosisController.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/os/controller/PatientDiagnosisController.java @@ -1,43 +1,46 @@ package com.ruoyi.os.controller; +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; - import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.healthcare.HealthcareOsDiagnosisStatus; import com.ruoyi.common.enums.healthcare.HealthcareOsDictionaryName; import com.ruoyi.common.exception.UtilException; +import com.ruoyi.common.utils.DictUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.inventory.domain.HealthcareDrugArchive; -import com.ruoyi.os.domain.*; - -import com.ruoyi.os.mapper.StudentInfoMapper; +import com.ruoyi.os.domain.CountDiagnosisVO; +import com.ruoyi.os.domain.DrugArchivesVO; +import com.ruoyi.os.domain.HealthcareOsPatientDiagnosis; +import com.ruoyi.os.domain.HealthcareOsPrescriptionDetails; +import com.ruoyi.os.domain.PatientMedicalRecordsVO; import com.ruoyi.os.service.IPatientDiagnosisService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletResponse; -import java.math.BigDecimal; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.util.*; /** - * 诊断(病历)信息Controller + * 诊断(病历)信息Controller * -<<<<<<< HEAD - * @author 蒋松霖 -======= * @author 何顺 ->>>>>>> cf33b39dcb79314a02d35b6116058d8b46856eeb * @date 2024-09-17 - * ====== * @author 邵政文 * @date 2025-05-14 */ @@ -48,90 +51,94 @@ public class PatientDiagnosisController extends BaseController { @Autowired private IPatientDiagnosisService iPatientDiagnosisService; - // IPatientDiagnosisService + private static final int MONEY_SCALE = 2; + private static final BigDecimal HUNDRED = new BigDecimal("100"); + + // IPatientDiagnosisService /** - * 查询病历信息列表 PatientDiagnosisController - * 返回 os_patient_diagnosis + * 查询病历信息列表 PatientDiagnosisController + * 返回 os_patient_diagnosis */ @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:list')") @GetMapping("/list") - public TableDataInfo list(HealthcareOsPatientDiagnosis healthcareOsPatientDiagnosis) - { + public TableDataInfo list(HealthcareOsPatientDiagnosis healthcareOsPatientDiagnosis) { startPage(); return getDataTable(iPatientDiagnosisService.queryMedicalRecordList(healthcareOsPatientDiagnosis)); } /** - * 导出接诊记录数据 + * 导出接诊记录数据 */ @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:export')") @Log(title = "接诊记录", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, PatientMedicalRecordsVO patientMedicalRecordsVO) - { + public void export(HttpServletResponse response, PatientMedicalRecordsVO patientMedicalRecordsVO) { patientMedicalRecordsVO.setDictionariesNamePatientType("healthcare_os_patient_type"); patientMedicalRecordsVO.setDictionariesNameGender("sys_user_sex"); patientMedicalRecordsVO.setDictionariesNameIsInsured("healthcare_os_insured"); patientMedicalRecordsVO.setDictionariesNameStatus("healthcare_os_diagnosis_status"); // 获取所有患者处方详情列表 - List list = iPatientDiagnosisService.gainPrescriptionDetailsList(patientMedicalRecordsVO); - // 计算totalAmount字段的值 (totalPrice / value) - totalPrice = TotalAmount - for (PatientMedicalRecordsVO record : list) { - if (record.getTotalPrice() != null && record.getValue() != null && record.getValue().compareTo(BigDecimal.ZERO) != 0) { - BigDecimal divisionResult = record.getTotalPrice().divide(record.getValue(), 2, BigDecimal.ROUND_HALF_UP); - record.setTotalAmount(divisionResult.subtract(record.getTotalPrice())); - } - } + List list = iPatientDiagnosisService + .gainPrescriptionDetailsList(patientMedicalRecordsVO); + + // 计算报销费用:医保时按总价 × 报销比率/100;非医保或比率为空时为0 + fillExportFields(list); + ExcelUtil util = new ExcelUtil(PatientMedicalRecordsVO.class); util.exportExcel(response, list, "接诊记录数据"); } /** - * 导出发药记录数据 + * 导出发药记录数据 */ @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:totalPriceExport')") @Log(title = "发药记录", businessType = BusinessType.EXPORT) @PostMapping("/totalPriceExport") - public void totalPriceExport(HttpServletResponse response, PatientMedicalRecordsVO patientMedicalRecordsVO) - { + public void totalPriceExport(HttpServletResponse response, PatientMedicalRecordsVO patientMedicalRecordsVO) { // healthcare_os_patient_type patientMedicalRecordsVO.setDictionariesNamePatientType("healthcare_os_patient_type"); patientMedicalRecordsVO.setDictionariesNameGender("sys_user_sex"); patientMedicalRecordsVO.setDictionariesNameIsInsured("healthcare_os_insured"); patientMedicalRecordsVO.setDictionariesNameStatus("healthcare_os_diagnosis_status"); patientMedicalRecordsVO.setStatus(HealthcareOsDiagnosisStatus.SENT_ALREADY.getDescription()); - List list = iPatientDiagnosisService.gainPrescriptionDetailsList(patientMedicalRecordsVO); + List list = iPatientDiagnosisService + .gainPrescriptionDetailsList(patientMedicalRecordsVO); + + // 同步计算报销费用与患者应缴金额(总价格) + fillExportFields(list); + ExcelUtil util = new ExcelUtil(PatientMedicalRecordsVO.class); util.exportExcel(response, list, "接诊记录数据"); } /** - * 查询患者病历详细 - * 返回 PatientMedicalRecordsVO - * 参数 id + * 查询患者病历详情 + * 杩斿洖 PatientMedicalRecordsVO + * 鍙傛暟 id */ @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:getInfo')") @GetMapping("/getInfo/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { - return success(iPatientDiagnosisService.gainPatientDiagnosisInformation(id)); + return success(iPatientDiagnosisService.gainPatientDiagnosisInformation(id)); } /** - * 修改 患者病历详细 + * 修改 患者病历详情 */ @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:update')") @PostMapping("/update") public AjaxResult update(@RequestBody PatientMedicalRecordsVO patientMedicalRecordsVO) { - // 修改 患者病历详细信息 + // 修改 患者病历详情信息 iPatientDiagnosisService.updateDiagnosis(patientMedicalRecordsVO); // 修改 患者诊断状态 - return toAjax(iPatientDiagnosisService.updateStatus(patientMedicalRecordsVO.getPatientDiagnosisId() , HealthcareOsDiagnosisStatus.READY_TO_GO.getDescription())); + return toAjax(iPatientDiagnosisService.updateStatus(patientMedicalRecordsVO.getPatientDiagnosisId(), + HealthcareOsDiagnosisStatus.READY_TO_GO.getDescription())); } /** - * 保存 修改 患者 诊断 信息 saveDiagnosis + * 保存 修改 患者 诊断 信息 saveDiagnosis */ @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:saveUpdate')") @PostMapping("/saveUpdate") @@ -140,33 +147,42 @@ public class PatientDiagnosisController extends BaseController { return toAjax(iPatientDiagnosisService.saveUpdateDiagnosis(patientMedicalRecordsVO)); } - - - /** - * 修改患者诊断状态 ( 修改为 已发药 ) - * MedicationAlreadyIssued - * MedicationAlreadyIssued new Long(1) - * deliverMedicine - */ - @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:deliverMedicine')") - @GetMapping("/deliverMedicine/{id}") - public AjaxResult deliverMedicine(@PathVariable("id") Long id) { - return toAjax(iPatientDiagnosisService.updateStatus(id , HealthcareOsDiagnosisStatus.SENT_ALREADY.getDescription())); - } - - /** - * 修改患者诊断状态 ( 修改为 已退药 ) - * Returned medication - */ - @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:returnedMedication')") - @GetMapping("/returnedMedication/{id}") - public AjaxResult returnedMedication(@PathVariable("id") Long id) { - // 获取 患者 诊断 信息 - return toAjax(iPatientDiagnosisService.updateStatus(id , HealthcareOsDiagnosisStatus.REJECT.getDescription())); - } + /** + * 发药更正:仅调整是否医保与报销比率等基础字段 + */ + @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:adjustBasic')") + @Log(title = "发药更正", businessType = BusinessType.UPDATE) + @PostMapping("/adjustBasic") + public AjaxResult adjustBasic(@RequestBody PatientMedicalRecordsVO patientMedicalRecordsVO) { + return toAjax(iPatientDiagnosisService.adjustBasicFields(patientMedicalRecordsVO)); + } /** - * 添加患者诊断信息 + * 修改患者诊断状态( 修改为 已发药) + * MedicationAlreadyIssued + * MedicationAlreadyIssued new Long(1) + * deliverMedicine + */ + @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:deliverMedicine')") + @GetMapping("/deliverMedicine/{id}") + public AjaxResult deliverMedicine(@PathVariable("id") Long id) { + return toAjax( + iPatientDiagnosisService.updateStatus(id, HealthcareOsDiagnosisStatus.SENT_ALREADY.getDescription())); + } + + /** + * 修改患者诊断状态( 修改为 已退药) + * Returned medication + */ + @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:returnedMedication')") + @GetMapping("/returnedMedication/{id}") + public AjaxResult returnedMedication(@PathVariable("id") Long id) { + // 获取 患者 诊断 信息 + return toAjax(iPatientDiagnosisService.updateStatus(id, HealthcareOsDiagnosisStatus.REJECT.getDescription())); + } + + /** + * 添加患者诊断信息 * */ @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:add')") @@ -177,7 +193,7 @@ public class PatientDiagnosisController extends BaseController { } /** - * 保存 患者 诊断 信息 saveDiagnosis + * 保存 患者 诊断 信息 saveDiagnosis */ @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:save')") @PostMapping("/save") @@ -187,8 +203,8 @@ public class PatientDiagnosisController extends BaseController { } /** - * 保存 变成 待发 修改 库存 患者 诊断 信息 - * 保存修改库存 + * 保存 变成 待发 修改 库存 患者 诊断 信息 + * 淇濆瓨淇敼搴撳瓨 */ @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:saveAddDiagnosis')") @PostMapping("/saveAddDiagnosis") @@ -208,7 +224,7 @@ public class PatientDiagnosisController extends BaseController { } /** - * 获取 药品 列表 gainDrugList + * 获取 药品 列表 gainDrugList */ @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:gainDrugList')") @PostMapping("/gainDrugList") @@ -217,7 +233,7 @@ public class PatientDiagnosisController extends BaseController { } /** - * 获取 药品 价格 列表 gainDrugList Price + * 获取 药品 价格 列表 gainDrugList Price */ @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:gainDrugPriceList')") @GetMapping("/gainDrugPriceList") @@ -228,7 +244,7 @@ public class PatientDiagnosisController extends BaseController { } /** - * 获取 药品 名称 列表 + * 获取 药品 名称 列表 */ @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:gainMedicineNameList')") @GetMapping("/gainMedicineNameList") @@ -237,8 +253,8 @@ public class PatientDiagnosisController extends BaseController { } /** - * 获取药品名称(参数) - * 参数 药品 名称 + * 获取药品名称(参数) + * 鍙傛暟 鑽搧 鍚嶇О */ @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:gainMedicineNameList')") @GetMapping("/gainMedicineNameUntList") @@ -248,18 +264,18 @@ public class PatientDiagnosisController extends BaseController { } /** - * 获取 药品 档案 列表 - * 药品 名称 是 唯一的 + * 获取 药品 档案 列表 + * 鑽搧 鍚嶇О 鏄?鍞竴鐨? */ @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:gainMedicineArchiveList')") @GetMapping("/gainMedicineArchiveList") public TableDataInfo gainMedicineArchiveList(DrugArchivesVO drugArchivesVO) { - startPage(); - return getDataTable(iPatientDiagnosisService.gainMedicineArchiveList(drugArchivesVO)); + startPage(); + return getDataTable(iPatientDiagnosisService.gainMedicineArchiveList(drugArchivesVO)); } /** - * 获取 药品 库存 详细 列表 + * 获取 药品 库存 详细 列表 */ @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:gainDrugInventoryList')") @GetMapping("/gainDrugInventoryList") @@ -269,7 +285,6 @@ public class PatientDiagnosisController extends BaseController { return getDataTable(iPatientDiagnosisService.gainDrugInventoryList(drugArchivesVO)); } - /** * */ @@ -302,10 +317,10 @@ public class PatientDiagnosisController extends BaseController { } /** - * obtain symptom statistics number - * 获取 症状 统计 数量 + * obtain symptom statistics number + * 鑾峰彇 鐥囩姸 缁熻 鏁伴噺 */ -// @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:obtainSymptomStatisticsNumber')") + // @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:obtainSymptomStatisticsNumber')") @GetMapping("/obtainSymptomStatisticsNumber") public TableDataInfo obtainSymptomStatisticsNumber(CountDiagnosisVO countDiagnosisVO) { // @@ -317,10 +332,10 @@ public class PatientDiagnosisController extends BaseController { } /** - * obtain symptom statistics number - * 获取 症状 统计 数量 月份 + * obtain symptom statistics number + * 获取 症状 统计 数量 月份 */ -// @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:obtainSymptomStatisticsNumberMonth')") + // @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:obtainSymptomStatisticsNumberMonth')") @GetMapping("/obtainSymptomStatisticsNumberMonth") public TableDataInfo obtainSymptomStatisticsNumberMonth(CountDiagnosisVO countDiagnosisVO) { // @@ -331,20 +346,36 @@ public class PatientDiagnosisController extends BaseController { return getDataTable(iPatientDiagnosisService.obtainSymptomStatisticsNumberMonth(countDiagnosisVO)); } + /** + * 按患者ID统计历史医保报销累计金额(仅统计已发药) + */ + // @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:historyReimbursement')") + @GetMapping("/getHistoryReimbursement/{patientId}") + public AjaxResult getHistoryReimbursement(@PathVariable("patientId") Long patientId) { + return AjaxResult + .success(iPatientDiagnosisService.getHistoryReimbursementByPatientId(patientId, new java.util.Date())); + } + // @PreAuthorize("@ss.hasPermi('os:patientDiagnosis:historyReimbursement')") + @GetMapping("/getHistoryReimbursementByYear") + public AjaxResult getHistoryReimbursementByYear( + @RequestParam("patientId") Long patientId, + @RequestParam(value = "yearDate", required = false) java.util.Date yearDate) { + return AjaxResult.success(iPatientDiagnosisService.getHistoryReimbursementByPatientId(patientId, yearDate)); + } /** - * 处理 字符串 转换 date + * 处理 字符串 转换 date */ public CountDiagnosisVO stringToDate(CountDiagnosisVO countDiagnosisVO) { - if(countDiagnosisVO.getParams() != null) { - Map params = countDiagnosisVO.getParams(); + if (countDiagnosisVO.getParams() != null) { + Map params = countDiagnosisVO.getParams(); String startTime = countDiagnosisVO.getParams().get("startTime").toString(); String endTime = countDiagnosisVO.getParams().get("endTime").toString(); SimpleDateFormat formTime = new SimpleDateFormat("yyyy-MM-dd"); try { params.put("startTime", formTime.parse(startTime)); - params.put("endTime",formTime.parse(endTime)); + params.put("endTime", formTime.parse(endTime)); // countDiagnosisVO.setParams(params); } catch (ParseException e) { @@ -355,23 +386,24 @@ public class PatientDiagnosisController extends BaseController { } /** - * 使用 进行 库存 判断 ( 根据 前端 传递的 数据 进行 判断 ) - * 进行 库存 的 判断 参数 药品 的 库存 数量 参数 不能 为 空 + * 使用 进行 库存 判断 ( 根据 前端 传递的 数据 进行 判断 ) + * 进行 库存 的 判断 参数 药品 的 库存 数量 参数 不能为空 */ - private void judgeStock(PatientMedicalRecordsVO patientMedicalRecordsVO) { - patientMedicalRecordsVO.getPrescriptionDetailsList().forEach(item-> { + private void judgeStock(PatientMedicalRecordsVO patientMedicalRecordsVO) { + patientMedicalRecordsVO.getPrescriptionDetailsList().forEach(item -> { item.forEach(prescriptionDetail -> { - if(prescriptionDetail.getUnitQuantity() > prescriptionDetail.getInventoryCount()) { + if (prescriptionDetail.getUnitQuantity() > prescriptionDetail.getInventoryCount()) { // 发送 异常 信息 - throw new UtilException("库存不足:" + prescriptionDetail.getMedicineName()); + throw new UtilException("库存不足:" + prescriptionDetail.getMedicineName()); } }); }); } - /* - * 根据前端传回的省份证和姓名进行医保校验,判断该学生医保是否缴费 + /** + * + * 根据前端传回的身份证和姓名进行医保校验,判断该学生医保是否即用 */ @GetMapping("/verify") public AjaxResult verifyInsuranceStatus( @@ -381,4 +413,127 @@ public class PatientDiagnosisController extends BaseController { return success(status); } + private void fillExportFields(List list) { + for (PatientMedicalRecordsVO record : list) { + BigDecimal total = calculateTotalPrice(record); + BigDecimal totalScaled = scaleMoney(total); + BigDecimal value = record.getValue(); + boolean insured = record.getIsInsured() != null && record.getIsInsured() == 0L; + + record.setPrescriptionUsage(buildPrescriptionUsage(record)); + record.setPrescriptionTotalAmount(totalScaled); + + if (insured && value != null && value.compareTo(BigDecimal.ZERO) > 0) { + BigDecimal rate = value.divide(HUNDRED, 4, BigDecimal.ROUND_HALF_UP); + BigDecimal calcR = totalScaled.multiply(rate); + BigDecimal receivableAmount = totalScaled.subtract(calcR).setScale(MONEY_SCALE, BigDecimal.ROUND_CEILING); + BigDecimal reimburse = totalScaled.subtract(receivableAmount); + record.setReceivableAmount(receivableAmount); + record.setEstimatedReimbursement(reimburse); + } else { + record.setEstimatedReimbursement(BigDecimal.ZERO.setScale(MONEY_SCALE, BigDecimal.ROUND_CEILING)); + record.setReceivableAmount(totalScaled); + } + } + } + + private BigDecimal calculateTotalPrice(PatientMedicalRecordsVO record) { + List> detailsList = record.getPrescriptionDetailsList(); + if (detailsList == null) { + return record.getTotalPrice(); + } + BigDecimal sum = BigDecimal.ZERO; + boolean hasAny = false; + for (List group : detailsList) { + if (group == null) { + continue; + } + for (HealthcareOsPrescriptionDetails detail : group) { + if (detail == null) { + continue; + } + BigDecimal lineTotal = detail.getTotalPrice(); + if (lineTotal == null) { + Integer qty = detail.getTotalQuantity(); + BigDecimal unitPrice = detail.getUnitPrice(); + if (qty != null && unitPrice != null) { + lineTotal = unitPrice.multiply(new BigDecimal(qty)); + } + } + if (lineTotal != null) { + lineTotal = scaleMoney(lineTotal); + sum = sum.add(lineTotal); + hasAny = true; + } + } + } + return hasAny ? sum : record.getTotalPrice(); + } + + private String buildPrescriptionUsage(PatientMedicalRecordsVO record) { + List> detailsList = record.getPrescriptionDetailsList(); + if (detailsList == null) { + return ""; + } + StringBuilder sb = new StringBuilder(); + for (List group : detailsList) { + if (group == null) { + continue; + } + for (HealthcareOsPrescriptionDetails detail : group) { + if (detail == null) { + continue; + } + String name = detail.getMedicineName(); + Integer qty = detail.getTotalQuantity(); + String unit = resolveUnitLabel(detail.getPackageUnit()); + if (unit.isEmpty()) { + unit = resolveUnitLabel(detail.getSplitUnit()); + } + StringBuilder item = new StringBuilder(); + if (name != null && !name.trim().isEmpty()) { + item.append(name.trim()); + } + if (qty != null) { + if (item.length() > 0) { + item.append(" "); + } + item.append(qty); + if (unit != null && !unit.trim().isEmpty()) { + item.append(unit.trim()); + } + } + if (item.length() == 0) { + continue; + } + if (sb.length() > 0) { + sb.append("; "); + } + sb.append(item); + } + } + return sb.toString(); + } + + private BigDecimal scaleMoney(BigDecimal value) { + if (value == null) { + return BigDecimal.ZERO.setScale(MONEY_SCALE, BigDecimal.ROUND_CEILING); + } + return value.setScale(MONEY_SCALE, BigDecimal.ROUND_CEILING); + } + + private String resolveUnitLabel(String unit) { + if (unit == null) { + return ""; + } + String raw = unit.trim(); + if (raw.isEmpty()) { + return ""; + } + if (raw.matches("^\\d+$")) { + String label = DictUtils.getDictLabel("healthcare_packaging_unit", raw, ""); + return label == null ? "" : label.trim(); + } + return raw; + } } diff --git a/pasd-healthcare/src/main/java/com/ruoyi/os/domain/HealthcareOsPatientDiagnosis.java b/pasd-healthcare/src/main/java/com/ruoyi/os/domain/HealthcareOsPatientDiagnosis.java index 013ed74..9ad25d0 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/os/domain/HealthcareOsPatientDiagnosis.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/os/domain/HealthcareOsPatientDiagnosis.java @@ -114,11 +114,13 @@ public class HealthcareOsPatientDiagnosis extends BaseEntity { * 开始时间 */ @JsonFormat(pattern = "yyyy-MM-dd") + @org.springframework.format.annotation.DateTimeFormat(pattern = "yyyy-MM-dd") private Date startTime; /** * 结束时间 */ @JsonFormat(pattern = "yyyy-MM-dd") + @org.springframework.format.annotation.DateTimeFormat(pattern = "yyyy-MM-dd") private Date endTime; } diff --git a/pasd-healthcare/src/main/java/com/ruoyi/os/domain/PatientMedicalRecordsVO.java b/pasd-healthcare/src/main/java/com/ruoyi/os/domain/PatientMedicalRecordsVO.java index d6e1fd6..1b3399e 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/os/domain/PatientMedicalRecordsVO.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/os/domain/PatientMedicalRecordsVO.java @@ -1,132 +1,133 @@ package com.ruoyi.os.domain; -import com.baomidou.mybatisplus.annotation.TableField; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.annotation.Excel; -import lombok.Data; - import java.math.BigDecimal; import java.util.Date; import java.util.List; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; + +import lombok.Data; + /** * - * 患者病历信息 + * 患者病历信息 + * * @author 何顺 */ @Data public class PatientMedicalRecordsVO { // 以下为患者信息表 /** - * 患者 id + * 患者 id */ private Long patientInfoId; /** - * 就诊人类型 + * 就诊人类型 */ private Long patientType; /** - * 就诊人类型 的 字典 名称 - * healthcare_os_diagnosis_type + * 就诊人类型 的 字典 名称 + * healthcare_os_diagnosis_type */ private String dictionariesNamePatientType; /** - * 就诊人类型 的 字典 名称 显示 的 数值 + * 就诊人类型 的 字典 名称 显示 的 数值 */ @Excel(name = "就诊人类型") private String patientTypeLabel; /** - * 学号/工号 + * 学号/工号 */ @Excel(name = "学号/工号") private String studentId; /** - * 姓名 + * 姓名 */ @Excel(name = "姓名") private String name; /** - * 姓名 + * 姓名 */ @Excel(name = "身份证号") private String idCard; /** - * 性别 + * 性别 */ private String gender; /** - * 性别 的 字典 名称 + * 性别 的 字典 名称 */ private String dictionariesNameGender; /** - * 性别 的 字典 名称 显示 的 数值 + * 性别 的 字典 名称 显示 的 数值 */ - @Excel(name = "性别") + private String genderLabel; /** - * 年龄 + * 年龄 */ - @Excel(name = "年龄") + private Integer age; /** - * 专业 + * 专业 */ - @Excel(name = "专业") + private String major; /** - * 班级 + * 班级 */ - @Excel(name = "班级") + private String classInfo; /** - * 电话 + * 电话 */ - @Excel(name = "电话") + private String phone; /** - * 辅导员 + * 辅导员 */ - @Excel(name = "辅导员") + private String counselor; /** - * 部门 + * 部门 */ - @Excel(name = "部门") + private String department; // 以下为患者诊断信息 /** - * 唯一标识符 诊断 ID + * 唯一标识符 诊断 ID */ private Long patientDiagnosisId; /** - * 患者 id 进行 列表 的 id + * 患者 id 进行 列表 的 id */ private Long patientId; /** - * 诊断类型 ( 0: 初诊 1: 复诊 ) + * 诊断类型 ( 0: 初诊 1: 复诊 ) */ - @Excel(name = "诊断类型" , dictType="healthcare_os_diagnosis_type" ) + @Excel(name = "诊断类型", dictType = "healthcare_os_diagnosis_type") private Long diagnosisType; /** - * 是否医保 + * 是否医保 */ private Long isInsured; @@ -136,107 +137,130 @@ public class PatientMedicalRecordsVO { private String dictionariesNameIsInsured; /** - * 是否医保 的 字典 名称 显示 的 数值 + * 是否医保 的 字典 名称 显示 的 数值 */ @Excel(name = "是否医保") private String isInsuredLabel; /** - * 数值 + * 数值 */ - @Excel(name = "医保率") + @Excel(name = "报销比率") private BigDecimal value; /** - * 主诉 + * 主诉 */ @Excel(name = "主诉") private String chiefComplaint; /** - * 现病史 + * 现病史 */ @Excel(name = "现病史") private String presentIllness; /** - * 既往史 + * 既往史 */ @Excel(name = "既往史") private String pastHistory; /** - * 诊断 + * 诊断 */ @Excel(name = "诊断") private String diagnosis; /** - * 医嘱事项 + * 医嘱事项 */ @Excel(name = "医嘱事项") private String medicalAdvice; /** - * 医生名字 + * 医生名字 */ @Excel(name = "医生名字") private String doctorName; /** - * 状态(0:待发药,1:已发药,2:已退药)os_diagnosis_status + * 状态(0:待发药,1:已发药,2:已退药)os_diagnosis_status */ private Long status; /** - * 库房id + * 库房id */ private Long storeroomId; /** - * 库房名称 + * 库房名称 */ + @Excel(name = "接诊地址") private String storeroomName; /** - * 状态 的 字典 名称 + * 状态 的 字典 名称 */ private String dictionariesNameStatus; /** - * 状态 的 字典 名称 显示 的 数值 + * 状态 的 字典 名称 显示 的 数值 */ @Excel(name = "状态") private String statusLabel; /** - * 就诊时间 outpatient_time + * 就诊时间 outpatient_time */ @Excel(name = "就诊时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date outpatientTime; /** - * 总价钱 + * 总价钱 */ - @Excel(name = "总价钱") private BigDecimal totalPrice; /** - * 开始时间 + * 开始时间 */ @JsonFormat(pattern = "yyyy-MM-dd") private Date startTime; /** - * 结束时间 + * 结束时间 */ @JsonFormat(pattern = "yyyy-MM-dd") private Date endTime; - @Excel(name = "报销费用") private BigDecimal totalAmount; + /** + * 应收金额 + */ + @Excel(name = "应收金额") + private BigDecimal receivableAmount; + + /** + * 处方总金额 + */ + @Excel(name = "处方总金额") + private BigDecimal prescriptionTotalAmount; + + /** + * 预计报销 + */ + @Excel(name = "预计报销") + private BigDecimal estimatedReimbursement; + + /** + * Prescription usage (medicine name + total quantity). + */ + @Excel(name = "\u5904\u65b9\u7528\u836f") + private String prescriptionUsage; + /** * @field 处方详情列表 */ diff --git a/pasd-healthcare/src/main/java/com/ruoyi/os/domain/PatientMedicalRecordsYesVO.java b/pasd-healthcare/src/main/java/com/ruoyi/os/domain/PatientMedicalRecordsYesVO.java index 01836f3..a767f66 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/os/domain/PatientMedicalRecordsYesVO.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/os/domain/PatientMedicalRecordsYesVO.java @@ -1,15 +1,19 @@ package com.ruoyi.os.domain; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.ruoyi.common.annotation.Excel; -import lombok.Data; -import org.apache.poi.ss.usermodel.IndexedColors; - import java.math.BigDecimal; import java.util.Date; + +import org.apache.poi.ss.usermodel.IndexedColors; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; + +import lombok.Data; + /** * - * 用于导出患者病历信息(是医保的数据) + * 用于导出患者病历信息(是医保的数据) + * * @author 邵政文 */ @Data @@ -19,70 +23,70 @@ public class PatientMedicalRecordsYesVO { private Long id; /** - * 学号/工号 + * 学号/工号 */ @Excel(name = "学号/工号") private String studentId; /** - * 姓名 + * 姓名 */ @Excel(name = "姓名") private String name; /** - * 姓名 + * 姓名 */ @Excel(name = "身份证号") private String idCard; /** - * 性别 的 字典 名称 显示 的 数值 + * 性别 的 字典 名称 显示 的 数值 */ @Excel(name = "性别") private String genderLabel; /** - * 年龄 + * 年龄 */ @Excel(name = "年龄") private Integer age; /** - * 班级 + * 班级 */ @Excel(name = "班级") private String classInfo; /** - * 是否医保 的 字典 名称 显示 的 数值 + * 是否医保 的 字典 名称 显示 的 数值 */ @Excel(name = "是否医保") private String isInsuredLabel; /** - * 就诊时间 outpatient_time + * 就诊时间 outpatient_time */ @Excel(name = "就诊时间", dateFormat = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date outpatientTime; /** - * 总价钱 + * 总价钱 */ @Excel(name = "总费用") private BigDecimal totalPrice; /** - * 数值 + * 数值 */ private BigDecimal value; - @Excel(name = "医保率") + @Excel(name = "报销比率") private String valueLu; /** - * 报销费用 + * 报销费用 */ @Excel(name = "报销费用", headerColor = IndexedColors.BLACK, headerBackgroundColor = IndexedColors.GREY_50_PERCENT) private BigDecimal moneyValue; diff --git a/pasd-healthcare/src/main/java/com/ruoyi/os/mapper/HealthcareOsPatientInfoMapper.java b/pasd-healthcare/src/main/java/com/ruoyi/os/mapper/HealthcareOsPatientInfoMapper.java index 11c30b9..d375e1c 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/os/mapper/HealthcareOsPatientInfoMapper.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/os/mapper/HealthcareOsPatientInfoMapper.java @@ -1,22 +1,24 @@ package com.ruoyi.os.mapper; import java.util.List; -import com.ruoyi.os.domain.HealthcareOsPatientInfo; + import org.apache.ibatis.annotations.Mapper; +import com.ruoyi.os.domain.HealthcareOsPatientInfo; + /** * 患者信息Mapper接口 * -<<<<<<< HEAD + * <<<<<<< HEAD + * * @author 蒋松霖 -======= + * ======= * @author 何顺 ->>>>>>> cf33b39dcb79314a02d35b6116058d8b46856eeb + * >>>>>>> cf33b39dcb79314a02d35b6116058d8b46856eeb * @date 2024-09-17 */ @Mapper -public interface HealthcareOsPatientInfoMapper -{ +public interface HealthcareOsPatientInfoMapper { /** * 查询患者信息 * diff --git a/pasd-healthcare/src/main/java/com/ruoyi/os/mapper/HealthcareOsPrescriptionDetailsMapper.java b/pasd-healthcare/src/main/java/com/ruoyi/os/mapper/HealthcareOsPrescriptionDetailsMapper.java index c7dbcb7..f285f98 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/os/mapper/HealthcareOsPrescriptionDetailsMapper.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/os/mapper/HealthcareOsPrescriptionDetailsMapper.java @@ -3,6 +3,7 @@ package com.ruoyi.os.mapper; import java.util.List; import com.ruoyi.os.domain.HealthcareOsPrescriptionDetails; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 处方详情Mapper接口 @@ -33,6 +34,14 @@ public interface HealthcareOsPrescriptionDetailsMapper */ public List selectHealthcareOsPrescriptionDetailsList(HealthcareOsPrescriptionDetails healthcareOsPrescriptionDetails); + /** + * 批量查询处方详情(按诊断ID集合) + * + * @param diagnosisIds 诊断ID集合 + * @return 处方详情集合 + */ + public List selectHealthcareOsPrescriptionDetailsByDiagnosisIds(@Param("diagnosisIds") List diagnosisIds); + /** * 新增处方详情 * diff --git a/pasd-healthcare/src/main/java/com/ruoyi/os/mapper/OsStatisticsMapper.java b/pasd-healthcare/src/main/java/com/ruoyi/os/mapper/OsStatisticsMapper.java index aedc167..7a40995 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/os/mapper/OsStatisticsMapper.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/os/mapper/OsStatisticsMapper.java @@ -1,43 +1,66 @@ package com.ruoyi.os.mapper; - import com.ruoyi.os.domain.CountDiagnosisVO; +import com.ruoyi.common.annotation.DataSource; +import com.ruoyi.common.enums.DataSourceType; import com.ruoyi.os.domain.PatientMedicalRecordsVO; import com.ruoyi.os.domain.PatientMedicalRecordsYesVO; import org.apache.ibatis.annotations.Mapper; import java.util.List; +import java.math.BigDecimal; +import java.util.Map; /** * @author 何顺 - * @date 2024-09-21 - * */ + * @date 2024-09-21 + */ @Mapper public interface OsStatisticsMapper { // /** - * 查询 诊断 详情 + * 查询 诊断 详情 * * @param patientMedicalRecordsVO 处方详情主键 * @return 处方详情 */ + @DataSource(value = DataSourceType.MASTER) public List obtainPatientDiagnosisList(PatientMedicalRecordsVO patientMedicalRecordsVO); /** - * 查询 症状 对应 数量 + * 查询 症状 对应 数量 + * * @param countDiagnosisVO 处方详情主键 * @return 处方详情 */ public List obtainSymptomCorrespondingNumber(CountDiagnosisVO countDiagnosisVO); /** - * 导出是医保的数据列表 + * 导出是医保的数据列表 * * @param patientMedicalRecordsVO 列表 * @return 数据集合 - * 邵政文 - * 2025-05-14 + * 邵政文 + * 2025-05-14 */ - public List obtainPatientDiagnosisYesList(PatientMedicalRecordsVO patientMedicalRecordsVO); + @DataSource(value = DataSourceType.MASTER) + public List obtainPatientDiagnosisYesList( + PatientMedicalRecordsVO patientMedicalRecordsVO); + + /** + * 按患者ID统计历史医保报销累计金额(仅统计已发药) + * + * @param patientId 患者ID + * @return 历史医保报销累计金额 + */ + public BigDecimal getHistoryReimbursementByPatientId(Long patientId); + + /** + * 按患者ID统计历史医保报销累计金额(仅统计已发药) + * + * @param params 参数map,包含patientId和yearDate + * @return 历史医保报销累计金额 + */ + public BigDecimal getHistoryReimbursementByPatientId(Map params); } diff --git a/pasd-healthcare/src/main/java/com/ruoyi/os/service/IPatientDiagnosisService.java b/pasd-healthcare/src/main/java/com/ruoyi/os/service/IPatientDiagnosisService.java index 72b9a16..c3fee35 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/os/service/IPatientDiagnosisService.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/os/service/IPatientDiagnosisService.java @@ -1,6 +1,5 @@ package com.ruoyi.os.service; - import com.ruoyi.inventory.domain.HealthcareDrugArchive; import com.ruoyi.os.domain.*; @@ -15,141 +14,169 @@ import java.util.List; public interface IPatientDiagnosisService { /** - * 查询病历列表 - * @param healthcareOsPatientDiagnosis 参数 - * @return 包含所有医疗记录的列表 + * 查询病历列表 + * + * @param healthcareOsPatientDiagnosis 参数 + * @return 包含所有医疗记录的列表 */ - public List queryMedicalRecordList(HealthcareOsPatientDiagnosis healthcareOsPatientDiagnosis); + public List queryMedicalRecordList( + HealthcareOsPatientDiagnosis healthcareOsPatientDiagnosis); /** - * gain Patient diagnosis information - * 获得患者诊断信息 - * @param id 患者id - * @return 患者诊断信息 + * gain Patient diagnosis information + * 获得患者诊断信息 + * + * @param id 患者id + * @return 患者诊断信息 */ - public PatientMedicalRecordsVO gainPatientDiagnosisInformation(Long id); + public PatientMedicalRecordsVO gainPatientDiagnosisInformation(Long id); /** - * 修改 患者 诊断 - * @param patientMedicalRecordsVO 参数 - * @return 状态 提示信息 + * 修改 患者 诊断 + * + * @param patientMedicalRecordsVO 参数 + * @return 状态 提示信息 */ public int updateDiagnosis(PatientMedicalRecordsVO patientMedicalRecordsVO); /** - * 保存 修改 患者 诊断 - * @param patientMedicalRecordsVO 参数 - * @return 状态 提示信息 + * 保存 修改 患者 诊断 + * + * @param patientMedicalRecordsVO 参数 + * @return 状态 提示信息 */ public int saveUpdateDiagnosis(PatientMedicalRecordsVO patientMedicalRecordsVO); /** - * 修改 库存 根据 处方 返回 药品 - * @param patientMedicalRecordsVO 参数 + * 修改 库存 根据 处方 返回 药品 + * + * @param patientMedicalRecordsVO 参数 */ public void removeDrugModifyInventory(PatientMedicalRecordsVO patientMedicalRecordsVO); /** - * 添加 患者 诊断 - * @param patientMedicalRecordsVO 参数 - * @return 返回 成功 提示信息 + * 添加 患者 诊断 + * + * @param patientMedicalRecordsVO 参数 + * @return 返回 成功 提示信息 */ public int addDiagnosis(PatientMedicalRecordsVO patientMedicalRecordsVO); /** - * 保存 变成 待发 修改 库存 - * @param patientMedicalRecordsVO 参数 + * 保存 变成 待发 修改 库存 + * + * @param patientMedicalRecordsVO 参数 * @return 返回 成功 提示信息 */ public int saveAddDiagnosis(PatientMedicalRecordsVO patientMedicalRecordsVO); /** - * saveDiagnosis 保存 患者 诊断 - * @param patientMedicalRecordsVO 参数 - * @return 返回 成功 提示信息 + * saveDiagnosis 保存 患者 诊断 + * + * @param patientMedicalRecordsVO 参数 + * @return 返回 成功 提示信息 */ public int saveDiagnosis(PatientMedicalRecordsVO patientMedicalRecordsVO); /** - * 删除 患者 诊断 - * @param id 患者id - * @return 返回 成功 提示信息 + * 删除 患者 诊断 + * + * @param id 患者id + * @return 返回 成功 提示信息 */ public int removeDiagnosis(Long id); /** * 判断 库存 - * @param prescriptionDetailsList 参数 + * + * @param prescriptionDetailsList 参数 * */ public void judgeStock(List> prescriptionDetailsList); /** * 判断 库存 在 修改 处方 - * @param prescriptionDetailsList 参数 + * + * @param prescriptionDetailsList 参数 * */ public void modifyJudgeStock(List> prescriptionDetailsList); /** - * 修改患者状态 - * @param id 患者id - * @param status 状态 - * @return 返回 成功 提示信息 + * 修改患者状态 + * + * @param id 患者id + * @param status 状态 + * @return 返回 成功 提示信息 */ - public int updateStatus(Long id ,Long status); + public int updateStatus(Long id, Long status); /** - * @param drugArchivesVO 参数 - * @return 返回 药品 列表 + * @param drugArchivesVO 参数 + * @return 返回 药品 列表 **/ public List gainDrugList(DrugArchivesVO drugArchivesVO); /** - * @param healthcareDrugArchive 参数 - * @return 返回 药品 列表 价格 + * @param healthcareDrugArchive 参数 + * @return 返回 药品 列表 价格 **/ public List gainDrugPriceList(HealthcareDrugArchive healthcareDrugArchive); /** - * 获取 药品 名称 列表 gainMedicineArchiveList - * @param healthcareDrugArchive 参数 - * @return 返回 药品名称 列表 + * 获取 药品 名称 列表 gainMedicineArchiveList + * + * @param healthcareDrugArchive 参数 + * @return 返回 药品名称 列表 */ public List gainMedicineNameList(HealthcareDrugArchive healthcareDrugArchive); /** - * 获取 药品 名称 列表 - * @param drugArchivesVO 参数 - * @return 返回 药品 档案 列表 + * 获取 药品 名称 列表 + * + * @param drugArchivesVO 参数 + * @return 返回 药品 档案 列表 */ public List gainMedicineArchiveList(DrugArchivesVO drugArchivesVO); /** - * 获取 药品 库存 列表 - * @param drugArchivesVO 参数 - * @return 返回 药品库存 列表 + * 获取 药品 库存 列表 + * + * @param drugArchivesVO 参数 + * @return 返回 药品库存 列表 */ public List gainDrugInventoryList(DrugArchivesVO drugArchivesVO); /** - * 获取 患者 诊断 详情 列表 没有 id 的 - * @param patientMedicalRecordsVO 参数 - * @return 返回 列表 + * 获取 患者 诊断 详情 列表 没有 id 的 + * + * @param patientMedicalRecordsVO 参数 + * @return 返回 列表 */ public List gainPrescriptionDetailsList(PatientMedicalRecordsVO patientMedicalRecordsVO); /** - * 获取 症状 对应 的 数量 - * @param countDiagnosisVO 参数 - * @return 返回 列表 + * 获取 症状 对应 的 数量 + * + * @param countDiagnosisVO 参数 + * @return 返回 列表 */ public List obtainSymptomStatisticsNumber(CountDiagnosisVO countDiagnosisVO); /** - * 获取 症状 对应 的 数量 月份 - * @param countDiagnosisVO 参数 - * @return 返回 列表 + * 按患者ID统计历史医保报销累计金额(仅统计已发药) + * + * @param patientId 患者ID + * @param yearDate 年份日期(用于过滤当年数据) + * @return 历史医保报销累计金额 + */ + public java.math.BigDecimal getHistoryReimbursementByPatientId(Long patientId, java.util.Date yearDate); + + /** + * 获取 症状 对应 的 数量 月份 + * + * @param countDiagnosisVO 参数 + * @return 返回 列表 */ public List> obtainSymptomStatisticsNumberMonth(CountDiagnosisVO countDiagnosisVO); @@ -158,13 +185,24 @@ public interface IPatientDiagnosisService { * 邵政文 * 2025-05-14 */ - public List gainPrescriptionDetailsYesList(PatientMedicalRecordsVO patientMedicalRecordsVO); + public List gainPrescriptionDetailsYesList( + PatientMedicalRecordsVO patientMedicalRecordsVO); + /** * 宁博 2025-05-21 * 验证医保是否可用 + * * @param idCard 省份证 - * @param name 姓名 - * @return 0 可用 1 不可用 + * @param name 姓名 + * @return 0 可用 1 不可用 */ int verifyInsuranceStatus(String idCard, String name); + + /** + * 发药更正:仅调整基础字段(是否医保、报销比率等),不改处方明细与库存 + * + * @param patientMedicalRecordsVO 入参包含 patientDiagnosisId、isInsured、value 等 + * @return 影响行数 + */ + public int adjustBasicFields(PatientMedicalRecordsVO patientMedicalRecordsVO); } diff --git a/pasd-healthcare/src/main/java/com/ruoyi/os/service/impl/HealthcareOsPatientInfoServiceImpl.java b/pasd-healthcare/src/main/java/com/ruoyi/os/service/impl/HealthcareOsPatientInfoServiceImpl.java index 843b259..e72ea1e 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/os/service/impl/HealthcareOsPatientInfoServiceImpl.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/os/service/impl/HealthcareOsPatientInfoServiceImpl.java @@ -21,17 +21,17 @@ import com.ruoyi.os.service.IHealthcareOsPatientInfoService; /** * 患者信息Service业务层处理 + *

+ * <<<<<<< HEAD * -<<<<<<< HEAD * @author 蒋松霖 -======= + * ======= * @author 何顺 ->>>>>>> cf33b39dcb79314a02d35b6116058d8b46856eeb + * >>>>>>> cf33b39dcb79314a02d35b6116058d8b46856eeb * @date 2024-09-17 */ @Service -public class HealthcareOsPatientInfoServiceImpl implements IHealthcareOsPatientInfoService -{ +public class HealthcareOsPatientInfoServiceImpl implements IHealthcareOsPatientInfoService { @Autowired private HealthcareOsPatientInfoMapper healthcareOsPatientInfoMapper; @@ -39,7 +39,6 @@ public class HealthcareOsPatientInfoServiceImpl implements IHealthcareOsPatientI public StudentInfoMapper studentInfoMapper; - /** * 查询患者信息 * @@ -47,8 +46,7 @@ public class HealthcareOsPatientInfoServiceImpl implements IHealthcareOsPatientI * @return 患者信息 */ @Override - public HealthcareOsPatientInfo selectOsPatientInfoById(Long id) - { + public HealthcareOsPatientInfo selectOsPatientInfoById(Long id) { return healthcareOsPatientInfoMapper.selectOsPatientInfoById(id); } @@ -59,8 +57,7 @@ public class HealthcareOsPatientInfoServiceImpl implements IHealthcareOsPatientI * @return 患者信息 */ @Override - public HealthcareOsPatientInfo selectOsPatientInfoByStudentId(String studentId) - { + public HealthcareOsPatientInfo selectOsPatientInfoByStudentId(String studentId) { return healthcareOsPatientInfoMapper.selectOsPatientInfoByStudentId(studentId); } @@ -71,8 +68,7 @@ public class HealthcareOsPatientInfoServiceImpl implements IHealthcareOsPatientI * @return 患者信息 */ @Override - public List selectOsPatientInfoList(HealthcareOsPatientInfo osPatientInfo) - { + public List selectOsPatientInfoList(HealthcareOsPatientInfo osPatientInfo) { return healthcareOsPatientInfoMapper.selectOsPatientInfoList(osPatientInfo); } @@ -83,12 +79,11 @@ public class HealthcareOsPatientInfoServiceImpl implements IHealthcareOsPatientI * @return 结果 */ @Override - public int insertOsPatientInfo(HealthcareOsPatientInfo osPatientInfo) - { + public int insertOsPatientInfo(HealthcareOsPatientInfo osPatientInfo) { // 判断 学号 和 工号 是否 重复 HealthcareOsPatientInfo os = new HealthcareOsPatientInfo(); os.setStudentId(osPatientInfo.getStudentId()); - if(healthcareOsPatientInfoMapper.selectOsPatientInfoList(os).size() > 0) { + if (healthcareOsPatientInfoMapper.selectOsPatientInfoList(os).size() > 0) { throw new RuntimeException("学号或工号已存在"); } // 添加 时间 @@ -106,8 +101,7 @@ public class HealthcareOsPatientInfoServiceImpl implements IHealthcareOsPatientI * @return 结果 */ @Override - public int updateOsPatientInfo(HealthcareOsPatientInfo osPatientInfo) - { + public int updateOsPatientInfo(HealthcareOsPatientInfo osPatientInfo) { // 修改 时间 osPatientInfo.setUpdateTime(DateUtils.getNowDate()); // 获取 用户 信息 @@ -123,8 +117,7 @@ public class HealthcareOsPatientInfoServiceImpl implements IHealthcareOsPatientI * @return 结果 */ @Override - public int deleteOsPatientInfoByIds(Long[] ids) - { + public int deleteOsPatientInfoByIds(Long[] ids) { return healthcareOsPatientInfoMapper.deleteOsPatientInfoByIds(ids); } @@ -135,20 +128,19 @@ public class HealthcareOsPatientInfoServiceImpl implements IHealthcareOsPatientI * @return 结果 */ @Override - public int deleteOsPatientInfoById(Long id) - { + public int deleteOsPatientInfoById(Long id) { return healthcareOsPatientInfoMapper.deleteOsPatientInfoById(id); } /** - * 获取 学生 信息 列表 + * 获取 学生 信息 列表 */ public List getStudentInfoList(StudentInfo studentInfo) { - List list = new ArrayList<>(); + List list = new ArrayList<>(); List studentInfoList = studentInfoMapper.selectStudentInfoList(studentInfo); // 进行 数据 的 赋值 - for(int i = 0 ; i < studentInfoList.size() ; i++) { + for (int i = 0; i < studentInfoList.size(); i++) { HealthcareOsPatientInfo patientInfo = new HealthcareOsPatientInfo(); // 就诊人类型 HealthcareOsPatientType patientInfo.setPatientType(HealthcareOsPatientType.OS_USAGE); @@ -172,6 +164,12 @@ public class HealthcareOsPatientInfoServiceImpl implements IHealthcareOsPatientI patientInfo.setDepartment(studentInfoList.get(i).getDeptName()); // 身份证 patientInfo.setIdCard(studentInfoList.get(i).getIdCard()); + // ?????????????????????????????????????????? patientId + HealthcareOsPatientInfo ensured = ensurePatientInfo(patientInfo); + if (ensured != null) { + patientInfo.setId(ensured.getId()); + } + list.add(patientInfo); } @@ -180,8 +178,31 @@ public class HealthcareOsPatientInfoServiceImpl implements IHealthcareOsPatientI @Override public List getTeachingStaffInfo(HealthcareOsPatientInfo patientInfo) { - return studentInfoMapper.getTeachingStaffInfo(patientInfo); + List list = studentInfoMapper.getTeachingStaffInfo(patientInfo); + if (list == null || list.isEmpty()) { + return list; + } + list.forEach(item -> { + HealthcareOsPatientInfo ensured = ensurePatientInfo(item); + if (ensured != null) { + item.setId(ensured.getId()); + } + }); + return list; } + private HealthcareOsPatientInfo ensurePatientInfo(HealthcareOsPatientInfo patientInfo) { + if (patientInfo == null || patientInfo.getStudentId() == null || patientInfo.getStudentId().isEmpty()) { + return null; + } + HealthcareOsPatientInfo existing = healthcareOsPatientInfoMapper + .selectOsPatientInfoByStudentId(patientInfo.getStudentId()); + if (existing != null) { + return existing; + } + insertOsPatientInfo(patientInfo); + return patientInfo; + } + } diff --git a/pasd-healthcare/src/main/java/com/ruoyi/os/service/impl/PatientDiagnosisServiceImpl.java b/pasd-healthcare/src/main/java/com/ruoyi/os/service/impl/PatientDiagnosisServiceImpl.java index 195e077..7ac6fc5 100644 --- a/pasd-healthcare/src/main/java/com/ruoyi/os/service/impl/PatientDiagnosisServiceImpl.java +++ b/pasd-healthcare/src/main/java/com/ruoyi/os/service/impl/PatientDiagnosisServiceImpl.java @@ -1,39 +1,48 @@ package com.ruoyi.os.service.impl; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.enums.healthcare.HealthcareOsDiagnosisStatus; -import com.ruoyi.common.enums.healthcare.HealthcareOsDictionaryName; import com.ruoyi.common.exception.UtilException; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.bean.BeanUtils; -import com.ruoyi.os.domain.HealthcareOsPatientDiagnosis; -import com.ruoyi.os.domain.HealthcareOsPatientInfo; -import com.ruoyi.os.domain.HealthcareOsPrescriptionDetails; -import com.ruoyi.os.domain.PatientMedicalRecordsVO; import com.ruoyi.inventory.domain.HealthcareDrugArchive; import com.ruoyi.inventory.domain.HealthcareDrugFiling; import com.ruoyi.inventory.service.IHealthcareDrugArchiveService; import com.ruoyi.inventory.service.IHealthcareDrugFilingService; -import com.ruoyi.os.domain.*; -import com.ruoyi.os.mapper.*; +import com.ruoyi.os.domain.CountDiagnosisVO; +import com.ruoyi.os.domain.DrugArchivesVO; +import com.ruoyi.os.domain.HealthcareOsPatientDiagnosis; +import com.ruoyi.os.domain.HealthcareOsPatientInfo; +import com.ruoyi.os.domain.HealthcareOsPrescriptionDetails; +import com.ruoyi.os.domain.PatientInsuranceInfo; +import com.ruoyi.os.domain.PatientMedicalRecordsVO; +import com.ruoyi.os.domain.PatientMedicalRecordsYesVO; +import com.ruoyi.os.mapper.DrugArchivesVoMapper; +import com.ruoyi.os.mapper.HealthcareOsPatientDiagnosisMapper; +import com.ruoyi.os.mapper.HealthcareOsPatientInfoMapper; +import com.ruoyi.os.mapper.HealthcareOsPrescriptionDetailsMapper; +import com.ruoyi.os.mapper.OsStatisticsMapper; import com.ruoyi.os.service.IHealthcareOsPatientInfoService; import com.ruoyi.os.service.IPatientDiagnosisService; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; +import com.ruoyi.os.service.IPatientInsuranceInfoService; -import java.text.SimpleDateFormat; -import java.time.Duration; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.util.*; -import java.util.stream.Collectors; -import java.math.BigDecimal; +import lombok.extern.slf4j.Slf4j; /** - * 诊断信息Service业务层处理 + * 诊断信息Service业务处理 * * @author 何顺 * @date 2024-09-17 @@ -63,63 +72,68 @@ public class PatientDiagnosisServiceImpl implements IPatientDiagnosisService { @Autowired private OsStatisticsMapper osStatisticsMapper; - @Autowired private IHealthcareOsPatientInfoService osPatientInfoService; + @Autowired + private IPatientInsuranceInfoService patientInsuranceInfoService; + /** * 查询病历列表 - * 邵政文(部分处理) + * 邵政文(修改功能) * 2025-05-14 */ @Override - public List queryMedicalRecordList(HealthcareOsPatientDiagnosis healthcareOsPatientDiagnosis) { + public List queryMedicalRecordList( + HealthcareOsPatientDiagnosis healthcareOsPatientDiagnosis) { healthcareOsPatientDiagnosisMapper.updateHealthchcareOspatientDiagnoisDocitNameUtile(); return healthcareOsPatientDiagnosisMapper.selectHealthcareOsPatientDiagnosisList(healthcareOsPatientDiagnosis); } /** * 获取患者诊断信息 - * 邵政文(部分处理) + * 邵政文(修改功能) * 2025-05-14 */ @Override public PatientMedicalRecordsVO gainPatientDiagnosisInformation(Long id) { - // 盒子 患者信息 + // 创建 诊断信息 PatientMedicalRecordsVO patientMedicalRecordsVO = new PatientMedicalRecordsVO(); - HealthcareOsPatientDiagnosis patientDiagnosis = healthcareOsPatientDiagnosisMapper.selectHealthcareOsPatientDiagnosisById(id); + HealthcareOsPatientDiagnosis patientDiagnosis = healthcareOsPatientDiagnosisMapper + .selectHealthcareOsPatientDiagnosisById(id); // ----------------------------------------- - //患者诊断信息中字段空缺数据并修改 - if(patientDiagnosis.getPatientId() == null) { + // 患者诊断信息字段空缺数据并修改 + if (patientDiagnosis.getPatientId() == null) { healthcareOsPatientDiagnosisMapper.updateHealthchcareOsPatientDiagnoisDataUtile(); - log.debug("患者信息为空,但修改成功"); - } - else { + log.debug(" 患者信息为空的修改成功"); + } else { log.debug("患者信息不为空"); } - //------------------------------------------ + // ------------------------------------------ // 获取诊断信息 - HealthcareOsPatientDiagnosis healthcareOsPatientDiagnosis = healthcareOsPatientDiagnosisMapper.selectHealthcareOsPatientDiagnosisById(id); + HealthcareOsPatientDiagnosis healthcareOsPatientDiagnosis = healthcareOsPatientDiagnosisMapper + .selectHealthcareOsPatientDiagnosisById(id); BeanUtils.copyBeanProp(patientMedicalRecordsVO, healthcareOsPatientDiagnosis); // 获取患者信息 - HealthcareOsPatientInfo healthcareOsPatientInfo = healthcareOsPatientInfoMapper.selectOsPatientInfoById(healthcareOsPatientDiagnosis.getPatientId()); + HealthcareOsPatientInfo healthcareOsPatientInfo = healthcareOsPatientInfoMapper + .selectOsPatientInfoById(healthcareOsPatientDiagnosis.getPatientId()); BeanUtils.copyBeanProp(patientMedicalRecordsVO, healthcareOsPatientInfo); // 获取处方详情列表 HealthcareOsPrescriptionDetails healthcareOsPrescriptionDetails = new HealthcareOsPrescriptionDetails(); healthcareOsPrescriptionDetails.setPatientDiagnosisId(id); - List prescriptionDetailsList = healthcareOsPrescriptionDetailsMapper.selectHealthcareOsPrescriptionDetailsList(healthcareOsPrescriptionDetails); - //patientMedicalRecordsVO.setOsPrescriptionDetailsList(prescriptionDetailsList); + List prescriptionDetailsList = healthcareOsPrescriptionDetailsMapper + .selectHealthcareOsPrescriptionDetailsList(healthcareOsPrescriptionDetails); + // patientMedicalRecordsVO.setOsPrescriptionDetailsList(prescriptionDetailsList); - // 分组处方详情 + // 处方详情集合 List> prescriptionList = new ArrayList<>(); - // 获取 序号 id + // 获取 处方 id List singularIds = prescriptionDetailsList.stream() .map(HealthcareOsPrescriptionDetails::getSingular) .distinct() .collect(Collectors.toList()); - for (Long singularId : singularIds) { // List details = prescriptionDetailsList.stream() @@ -135,20 +149,20 @@ public class PatientDiagnosisServiceImpl implements IPatientDiagnosisService { } /** - * 修改 诊断信息 - * 邵政文(部分处理) + * 修改 患者 诊断 + * 邵政文(修改功能) * 2025-05-14 */ @Override public int updateDiagnosis(PatientMedicalRecordsVO patientMedicalRecordsVO) { - // 进行 基础 的 判断 - //judgeDiagnosisFoundation(patientMedicalRecordsVO); + // 校验 诊断 基础 + // judgeDiagnosisFoundation(patientMedicalRecordsVO); // 判断 处方 药品 是否 重复 - //judgeDrugRepeat(patientMedicalRecordsVO.getPrescriptionDetailsList()); + // judgeDrugRepeat(patientMedicalRecordsVO.getPrescriptionDetailsList()); // 库存 判断 - //modifyJudgeStock(patientMedicalRecordsVO.getPrescriptionDetailsList()); - if(patientMedicalRecordsVO.getPrescriptionDetailsList().size() != 0) { - // 进行 基础 的 判断 + // modifyJudgeStock(patientMedicalRecordsVO.getPrescriptionDetailsList()); + if (patientMedicalRecordsVO.getPrescriptionDetailsList().size() != 0) { + // 校验 诊断 基础 judgeDiagnosisFoundation(patientMedicalRecordsVO); // 判断 处方 药品 是否 重复 judgeDrugRepeat(patientMedicalRecordsVO.getPrescriptionDetailsList()); @@ -157,28 +171,30 @@ public class PatientDiagnosisServiceImpl implements IPatientDiagnosisService { } // 获取 诊断信息 id Long diagnosisId = patientMedicalRecordsVO.getPatientDiagnosisId(); - // 修改 时间 + // 修改 时间 Date updateTime = DateUtils.getNowDate(); // 获取用户信息 LoginUser loginUser = SecurityUtils.getLoginUser(); - // 更新 诊断信息 基础 + // 创建 诊断信息 实例 HealthcareOsPatientDiagnosis patientDiagnosis = new HealthcareOsPatientDiagnosis(); - // 进行 赋值 基础信息 + // 进行 复值诊断信息 BeanUtils.copyBeanProp(patientDiagnosis, patientMedicalRecordsVO); patientDiagnosis.setId(diagnosisId); // 设置 诊断信息 id - patientDiagnosis.setUpdateTime(updateTime); // 设置 更新时间 - patientDiagnosis.setUpdateBy(loginUser.getUsername()); // 设置 更新用户 + patientDiagnosis.setUpdateTime(updateTime); // 设置 修改时间 + patientDiagnosis.setUpdateBy(loginUser.getUsername()); // 设置 修改用户 // 修改 诊断信息 基础信息 healthcareOsPatientDiagnosisMapper.updateHealthcareOsPatientDiagnosis(patientDiagnosis); - // 药品 修改 库存 返回 + // 药品 修改 库存 信息 removeDrugModifyInventory(patientMedicalRecordsVO); HealthcareOsPrescriptionDetails prescriptionDetails = new HealthcareOsPrescriptionDetails(); prescriptionDetails.setPatientDiagnosisId(diagnosisId); - List prescriptionDetailsList = healthcareOsPrescriptionDetailsMapper.selectHealthcareOsPrescriptionDetailsList(prescriptionDetails); + List prescriptionDetailsList = healthcareOsPrescriptionDetailsMapper + .selectHealthcareOsPrescriptionDetailsList(prescriptionDetails); // 删除 处方详情 if (prescriptionDetailsList.size() > 0) { for (int i = 0; i < prescriptionDetailsList.size(); i++) { - healthcareOsPrescriptionDetailsMapper.deleteHealthcareOsPrescriptionDetailsById(prescriptionDetailsList.get(i).getId()); + healthcareOsPrescriptionDetailsMapper + .deleteHealthcareOsPrescriptionDetailsById(prescriptionDetailsList.get(i).getId()); } } // 添加 处方详情 @@ -187,41 +203,38 @@ public class PatientDiagnosisServiceImpl implements IPatientDiagnosisService { } /** - * 保存 修改 诊断信息 - * 邵政文(部分处理) + * 保存 修改 患者 诊断 + * 邵政文(修改功能) * 2025-05-14 */ @Override public int saveUpdateDiagnosis(PatientMedicalRecordsVO patientMedicalRecordsVO) { - // 进行 基础 的 判断 - //judgeDiagnosisFoundation(patientMedicalRecordsVO); - // 判断 是否 进行 库存 判断 -// if (patientMedicalRecordsVO.getPrescriptionDetailsList().size() > 0) { -// // 判断 处方 药品 是否 重复 -// judgeDrugRepeat(patientMedicalRecordsVO.getPrescriptionDetailsList()); -// // 库存 判断 -// modifyJudgeStock(patientMedicalRecordsVO.getPrescriptionDetailsList()); -// } - if(patientMedicalRecordsVO.getPrescriptionDetailsList().size() != 0) { - // 进行 基础 的 判断 + // 校验 诊断 基础 + // judgeDiagnosisFoundation(patientMedicalRecordsVO); + // 判断 是否 处方 库存 判断 + // if (patientMedicalRecordsVO.getPrescriptionDetailsList().size() > 0) { + // // 判断 处方 药品 是否 重复 + // judgeDrugRepeat(patientMedicalRecordsVO.getPrescriptionDetailsList()); + // // 库存 判断 + // modifyJudgeStock(patientMedicalRecordsVO.getPrescriptionDetailsList()); + // } + if (patientMedicalRecordsVO.getPrescriptionDetailsList().size() != 0) { + // 校验 诊断 基础 judgeDiagnosisFoundation(patientMedicalRecordsVO); - // 判断 是否 进行 库存 判断 - if (patientMedicalRecordsVO.getPrescriptionDetailsList().size() > 0) { - // 判断 处方 药品 是否 重复 - judgeDrugRepeat(patientMedicalRecordsVO.getPrescriptionDetailsList()); - // 库存 判断 - modifyJudgeStock(patientMedicalRecordsVO.getPrescriptionDetailsList()); - } + // 判断 处方 药品 是否 重复 + judgeDrugRepeat(patientMedicalRecordsVO.getPrescriptionDetailsList()); + // 库存 判断 + modifyJudgeStock(patientMedicalRecordsVO.getPrescriptionDetailsList()); } // 获取 诊断信息 id Long diagnosisId = patientMedicalRecordsVO.getPatientDiagnosisId(); - // 修改 时间 + // 修改 时间 Date updateTime = DateUtils.getNowDate(); // 获取用户信息 LoginUser loginUser = SecurityUtils.getLoginUser(); - // 更新 诊断信息 基础 + // 创建 诊断信息 实例 HealthcareOsPatientDiagnosis patientDiagnosis = new HealthcareOsPatientDiagnosis(); - // 进行 赋值 基础信息 + // 进行 复值诊断信息 BeanUtils.copyBeanProp(patientDiagnosis, patientMedicalRecordsVO); // patientDiagnosis.setId(diagnosisId); @@ -231,14 +244,16 @@ public class PatientDiagnosisServiceImpl implements IPatientDiagnosisService { patientDiagnosis.setUpdateBy(loginUser.getUsername()); // 修改 诊断信息 基础信息 healthcareOsPatientDiagnosisMapper.updateHealthcareOsPatientDiagnosis(patientDiagnosis); - // 获取 处方详情列表 药品 列表 + // 获取 处方详情列表 药品 列表 HealthcareOsPrescriptionDetails prescriptionDetails = new HealthcareOsPrescriptionDetails(); prescriptionDetails.setPatientDiagnosisId(diagnosisId); - List prescriptionDetailsList = healthcareOsPrescriptionDetailsMapper.selectHealthcareOsPrescriptionDetailsList(prescriptionDetails); + List prescriptionDetailsList = healthcareOsPrescriptionDetailsMapper + .selectHealthcareOsPrescriptionDetailsList(prescriptionDetails); // 删除 处方详情 if (prescriptionDetailsList.size() > 0) { for (int i = 0; i < prescriptionDetailsList.size(); i++) { - healthcareOsPrescriptionDetailsMapper.deleteHealthcareOsPrescriptionDetailsById(prescriptionDetailsList.get(i).getId()); + healthcareOsPrescriptionDetailsMapper + .deleteHealthcareOsPrescriptionDetailsById(prescriptionDetailsList.get(i).getId()); } } if (patientMedicalRecordsVO.getPrescriptionDetailsList().size() > 0) { @@ -248,32 +263,31 @@ public class PatientDiagnosisServiceImpl implements IPatientDiagnosisService { return 1; } - /** - * 添加 诊断信息 + * 添加 患者 诊断 */ @Override public int addDiagnosis(PatientMedicalRecordsVO patientMedicalRecordsVO) { - // 进行 基础 的 判断 + // 校验 诊断 基础 judgeDiagnosisFoundation(patientMedicalRecordsVO); // 判断 处方 药品 是否 重复 judgeDrugRepeat(patientMedicalRecordsVO.getPrescriptionDetailsList()); // 库存 判断 judgeStock(patientMedicalRecordsVO.getPrescriptionDetailsList()); - // 添加 诊断信息 + // 创建 诊断信息 HealthcareOsPatientDiagnosis healthcareOsPatientDiagnosis = new HealthcareOsPatientDiagnosis(); BeanUtils.copyBeanProp(healthcareOsPatientDiagnosis, patientMedicalRecordsVO); - // 添加 时间 + // 添加 时间 Date addTime = DateUtils.getNowDate(); // 获取用户信息 LoginUser loginUser = SecurityUtils.getLoginUser(); - healthcareOsPatientDiagnosis.setDoctorName(loginUser.getUsername()); // 添加 医生名字 - //healthcareOsPatientDiagnosis.setDoctorName(SysUser.getNickName()); // 添加 医生名字 - healthcareOsPatientDiagnosis.setOutpatientTime(addTime); // 添加 就诊时间 - healthcareOsPatientDiagnosis.setCreateBy(loginUser.getUsername()); // 添加 创建用户 - healthcareOsPatientDiagnosis.setCreateTime(addTime); // 添加 创建时间 + healthcareOsPatientDiagnosis.setDoctorName(loginUser.getUsername()); // 设置 医生姓名 + // healthcareOsPatientDiagnosis.setDoctorName(SysUser.getNickName()); // 设置 医生姓名 + healthcareOsPatientDiagnosis.setOutpatientTime(addTime); // 设置 就诊时间 + healthcareOsPatientDiagnosis.setCreateBy(loginUser.getUsername()); // 设置 创建用户 + healthcareOsPatientDiagnosis.setCreateTime(addTime); // 设置 创建时间 // 状态 0 healthcareOsPatientDiagnosis.setStatus(HealthcareOsDiagnosisStatus.READY_TO_GO.getDescription()); @@ -281,27 +295,27 @@ public class PatientDiagnosisServiceImpl implements IPatientDiagnosisService { // 添加 诊断信息 if (healthcareOsPatientDiagnosisMapper.insertHealthcareOsPatientDiagnosis(healthcareOsPatientDiagnosis) == 1) { - - // 处理 + // 参数 Map map = new HashMap<>(2); - // 获取当前时间的前5秒 + // 获取当前时间前5秒 Calendar calendarFront = Calendar.getInstance(); calendarFront.setTime(addTime); calendarFront.add(Calendar.SECOND, -5); map.put("outpatientTimeFront", calendarFront.getTime()); - // 获取当前时间的后5秒 + // 获取当前时间后5秒 Calendar calendar = Calendar.getInstance(); calendar.setTime(addTime); calendar.add(Calendar.SECOND, 5); map.put("outpatientTimeAfter", calendar.getTime()); healthcareOsPatientDiagnosis.setParams(map); - List diagnosisList = healthcareOsPatientDiagnosisMapper.selectHealthcareOsPatientDiagnosisList(healthcareOsPatientDiagnosis); - // 获取新增的id + List diagnosisList = healthcareOsPatientDiagnosisMapper + .selectHealthcareOsPatientDiagnosisList(healthcareOsPatientDiagnosis); + // 获取诊断id if (diagnosisList.size() == 1) { Long diagnosisId = diagnosisList.get(0).getId(); // 添加处方详情 if (patientMedicalRecordsVO.getPrescriptionDetailsList() != null && diagnosisId != null) { - // 添加 处方 药品 修改 库存 + // 添加 处方 药品 修改 库存 addDrugModifyInventory(patientMedicalRecordsVO, diagnosisId, loginUser, addTime); } } else if (diagnosisList.size() > 1) { @@ -313,20 +327,20 @@ public class PatientDiagnosisServiceImpl implements IPatientDiagnosisService { } /** - * 保存 修改 改成 待发 修改 库存 - * 邵政文(部分处理) + * 保存 变成 待发 修改 库存 + * 邵政文(修改功能) * 2025-05-14 */ @Override public int saveAddDiagnosis(PatientMedicalRecordsVO patientMedicalRecordsVO) { - // 进行 基础 的 判断 - //judgeDiagnosisFoundation(patientMedicalRecordsVO); + // 校验 诊断 基础 + // judgeDiagnosisFoundation(patientMedicalRecordsVO); // 判断 处方 药品 是否 重复 - //judgeDrugRepeat(patientMedicalRecordsVO.getPrescriptionDetailsList()); + // judgeDrugRepeat(patientMedicalRecordsVO.getPrescriptionDetailsList()); // 库存 判断 judgeStock - //judgeStock(patientMedicalRecordsVO.getPrescriptionDetailsList()); - if(patientMedicalRecordsVO.getPrescriptionDetailsList().size() != 0) { - // 进行 基础 的 判断 + // judgeStock(patientMedicalRecordsVO.getPrescriptionDetailsList()); + if (patientMedicalRecordsVO.getPrescriptionDetailsList().size() != 0) { + // 校验 诊断 基础 judgeDiagnosisFoundation(patientMedicalRecordsVO); // 判断 处方 药品 是否 重复 judgeDrugRepeat(patientMedicalRecordsVO.getPrescriptionDetailsList()); @@ -335,13 +349,13 @@ public class PatientDiagnosisServiceImpl implements IPatientDiagnosisService { } // 获取 诊断信息 id Long diagnosisId = patientMedicalRecordsVO.getPatientDiagnosisId(); - // 修改 时间 + // 修改 时间 Date updateTime = DateUtils.getNowDate(); // 获取用户信息 LoginUser loginUser = SecurityUtils.getLoginUser(); - // 更新 诊断信息 基础 + // 创建 诊断信息 实例 HealthcareOsPatientDiagnosis patientDiagnosis = new HealthcareOsPatientDiagnosis(); - // 进行 赋值 基础信息 + // 进行 复值诊断信息 BeanUtils.copyBeanProp(patientDiagnosis, patientMedicalRecordsVO); // patientDiagnosis.setId(diagnosisId); @@ -349,18 +363,20 @@ public class PatientDiagnosisServiceImpl implements IPatientDiagnosisService { patientDiagnosis.setUpdateTime(updateTime); // patientDiagnosis.setUpdateBy(loginUser.getUsername()); - // 修改 状态 待发 0 + // 修改 状态为待发 0 patientDiagnosis.setStatus(HealthcareOsDiagnosisStatus.READY_TO_GO.getDescription()); // 修改 诊断信息 基础信息 healthcareOsPatientDiagnosisMapper.updateHealthcareOsPatientDiagnosis(patientDiagnosis); // HealthcareOsPrescriptionDetails prescriptionDetails = new HealthcareOsPrescriptionDetails(); prescriptionDetails.setPatientDiagnosisId(diagnosisId); - List prescriptionDetailsList = healthcareOsPrescriptionDetailsMapper.selectHealthcareOsPrescriptionDetailsList(prescriptionDetails); + List prescriptionDetailsList = healthcareOsPrescriptionDetailsMapper + .selectHealthcareOsPrescriptionDetailsList(prescriptionDetails); // 删除 处方详情 if (prescriptionDetailsList.size() > 0) { for (int i = 0; i < prescriptionDetailsList.size(); i++) { - healthcareOsPrescriptionDetailsMapper.deleteHealthcareOsPrescriptionDetailsById(prescriptionDetailsList.get(i).getId()); + healthcareOsPrescriptionDetailsMapper + .deleteHealthcareOsPrescriptionDetailsById(prescriptionDetailsList.get(i).getId()); } } // 添加 处方详情 @@ -369,37 +385,37 @@ public class PatientDiagnosisServiceImpl implements IPatientDiagnosisService { } /** - * 保存 诊断信息 - * 邵政文(部分处理) + * 保存 患者 诊断 + * 邵政文(修改功能) * 2025-05-14 */ @Override public int saveDiagnosis(PatientMedicalRecordsVO patientMedicalRecordsVO) { - // 进行 基础 的 判断 - //judgeDiagnosisFoundation(patientMedicalRecordsVO); + // 校验 诊断 基础 + // judgeDiagnosisFoundation(patientMedicalRecordsVO); // 判断 处方 药品 是否 重复 - //judgeDrugRepeat(patientMedicalRecordsVO.getPrescriptionDetailsList()); - // 库存 判断(看情况) - //judgeStock(patientMedicalRecordsVO.getPrescriptionDetailsList()); - if(patientMedicalRecordsVO.getPrescriptionDetailsList().size() != 0) { - // 进行 基础 的 判断 + // judgeDrugRepeat(patientMedicalRecordsVO.getPrescriptionDetailsList()); + // 库存 判断(保存) + // judgeStock(patientMedicalRecordsVO.getPrescriptionDetailsList()); + if (patientMedicalRecordsVO.getPrescriptionDetailsList().size() != 0) { + // 校验 诊断 基础 judgeDiagnosisFoundation(patientMedicalRecordsVO); // 判断 处方 药品 是否 重复 judgeDrugRepeat(patientMedicalRecordsVO.getPrescriptionDetailsList()); - // 库存 判断(看情况) + // 库存 判断(保存) judgeStock(patientMedicalRecordsVO.getPrescriptionDetailsList()); } // HealthcareOsPatientDiagnosis healthcareOsPatientDiagnosis = new HealthcareOsPatientDiagnosis(); BeanUtils.copyBeanProp(healthcareOsPatientDiagnosis, patientMedicalRecordsVO); - // 添加 时间 + // 添加 时间 Date addTime = DateUtils.getNowDate(); // 获取用户信息 LoginUser loginUser = SecurityUtils.getLoginUser(); - healthcareOsPatientDiagnosis.setDoctorName(loginUser.getUsername()); // 添加 医生名字 - //healthcareOsPatientDiagnosis.setDoctorName(SysUser.getNickName()); // 添加 医生名字 + healthcareOsPatientDiagnosis.setDoctorName(loginUser.getUsername()); // 设置 医生姓名 + // healthcareOsPatientDiagnosis.setDoctorName(SysUser.getNickName()); // 设置 医生姓名 healthcareOsPatientDiagnosis.setOutpatientTime(addTime); healthcareOsPatientDiagnosis.setCreateBy(loginUser.getUsername()); healthcareOsPatientDiagnosis.setCreateTime(addTime); @@ -409,29 +425,31 @@ public class PatientDiagnosisServiceImpl implements IPatientDiagnosisService { // 添加 诊断信息 if (healthcareOsPatientDiagnosisMapper.insertHealthcareOsPatientDiagnosis(healthcareOsPatientDiagnosis) == 1) { - // 处理 + // 参数 Map map = new HashMap<>(2); - // 获取当前时间的前5秒 + // 获取当前时间前5秒 Calendar calendarFront = Calendar.getInstance(); calendarFront.setTime(addTime); calendarFront.add(Calendar.SECOND, -5); map.put("outpatientTimeFront", calendarFront.getTime()); - // 获取当前时间的后5秒 + // 获取当前时间后5秒 Calendar calendar = Calendar.getInstance(); calendar.setTime(addTime); calendar.add(Calendar.SECOND, 5); map.put("outpatientTimeAfter", calendar.getTime()); healthcareOsPatientDiagnosis.setParams(map); - // 获取新增的id 对象 - List diagnosisList = healthcareOsPatientDiagnosisMapper.selectHealthcareOsPatientDiagnosisList(healthcareOsPatientDiagnosis); - // 获取新增的id + // 获取诊断id 列表 + List diagnosisList = healthcareOsPatientDiagnosisMapper + .selectHealthcareOsPatientDiagnosisList(healthcareOsPatientDiagnosis); + // 获取诊断id if (diagnosisList.size() == 1) { - // 诊断 id + // 创建 id Long diagnosisId = diagnosisList.get(0).getId(); // 添加处方详情 if (patientMedicalRecordsVO.getPrescriptionDetailsList() != null && diagnosisId != null) { // 添加 处方 药品 - addDrugModify(patientMedicalRecordsVO.getPrescriptionDetailsList(), diagnosisId, loginUser, addTime); + addDrugModify(patientMedicalRecordsVO.getPrescriptionDetailsList(), diagnosisId, loginUser, + addTime); } } else if (diagnosisList.size() > 1) { return 2; @@ -442,20 +460,21 @@ public class PatientDiagnosisServiceImpl implements IPatientDiagnosisService { } /** - * 添加 药品 操作 诊断 处方 里面 的 药品 的 添加 到 对应 处方药品 表单 judgeDiagnosisFoundation - * prescriptionDetailsList 患者 诊断信息 diagnosisId 诊断id loginUser 登录用户 addTime 添加时间 + * 添加 药品 详情 添加 处方 详情 药品 库存 对应 药品 库存 + * prescriptionDetailsList 处方详情信息 diagnosisId 诊断id loginUser 登录用户 addTime 添加时间 */ - private void addDrugModify(List> prescriptionDetailsList, Long diagnosisId, LoginUser loginUser, Date addTime) { + private void addDrugModify(List> prescriptionDetailsList, Long diagnosisId, + LoginUser loginUser, Date addTime) { for (int i = 0; i < prescriptionDetailsList.size(); i++) { - // 号 + // 序号 Long singular = (long) i; // prescriptionDetailsList.get(i).forEach(model -> { // model.setSingular(singular); - // id + // 诊断id model.setPatientDiagnosisId(diagnosisId); - // 添加人 + // 创建者 model.setCreateBy(loginUser.getUsername()); // 时间 model.setCreateTime(addTime); @@ -465,16 +484,16 @@ public class PatientDiagnosisServiceImpl implements IPatientDiagnosisService { } } - /** - * 处理 诊断 信息 的 添加 药品 修改 库存 + * 添加 处方 信息 并 修改 药品 修改 库存 * - * @param patientMedicalRecordsVO 患者 诊断信息 + * @param patientMedicalRecordsVO 处方详情信息 * @param diagnosisId 诊断id * @param loginUser 登录用户 * @param addTime 添加时间 */ - private void addDrugModifyInventory(PatientMedicalRecordsVO patientMedicalRecordsVO, Long diagnosisId, LoginUser loginUser, Date addTime) { + private void addDrugModifyInventory(PatientMedicalRecordsVO patientMedicalRecordsVO, Long diagnosisId, + LoginUser loginUser, Date addTime) { // 添加 药品 for (int i = 0; i < patientMedicalRecordsVO.getPrescriptionDetailsList().size(); i++) { Long singular = (long) i; @@ -483,505 +502,379 @@ public class PatientDiagnosisServiceImpl implements IPatientDiagnosisService { model.setPatientDiagnosisId(diagnosisId); // 序号 model.setSingular(singular); - // 添加人 + // 创建者 model.setCreateBy(loginUser.getUsername()); - // 添加时间 + // 创建时间 model.setCreateTime(addTime); // 添加药品详情 healthcareOsPrescriptionDetailsMapper.insertHealthcareOsPrescriptionDetails(model); // 获取 药品 库存 - HealthcareDrugFiling healthcareDrugFiling = iHealthcareDrugFilingService.selectHealthcareDrugFilingById(model.getMedicineId()); - // 修改 的 内容 - HealthcareDrugFiling updateHealthcareDrugFiling = new HealthcareDrugFiling(); - // 更新库存 赋值 id - updateHealthcareDrugFiling.setId(model.getMedicineId()); - // 进行 赋值 防止 错误 修改 - BeanUtils.copyBeanProp(updateHealthcareDrugFiling, healthcareDrugFiling); + HealthcareDrugFiling healthcareDrugFiling = iHealthcareDrugFilingService + .selectHealthcareDrugFilingById(model.getMedicineId()); + if (healthcareDrugFiling != null) { + HealthcareDrugFiling updateHealthcareDrugFiling = new HealthcareDrugFiling(); + updateHealthcareDrugFiling.setId(model.getMedicineId()); + BeanUtils.copyBeanProp(updateHealthcareDrugFiling, healthcareDrugFiling); - // 判断 是否 拆零 药 - if (model.getIsSplit().equals("Y")) { - // 可以 拆零 药 11 > 10 - if (healthcareDrugFiling.getPackCount() >= model.getTotalQuantity()) { - // 减少 的 库存 - int packCount = healthcareDrugFiling.getPackCount() - model.getTotalQuantity(); - updateHealthcareDrugFiling.setPackCount(packCount); - // 发送 修改 请求 - iHealthcareDrugFilingService.updateHealthcareDrugFiling(updateHealthcareDrugFiling); - } - // 数量 不知 多少 - else { - int boxUnt = model.getTotalQuantity() / model.getUnitQuantity(); - int packUnt = model.getTotalQuantity() % model.getUnitQuantity(); - // 判断 是否 够 数量 - if (packUnt < healthcareDrugFiling.getPackCount()) { - int packCount = healthcareDrugFiling.getPackCount() - packUnt; - updateHealthcareDrugFiling.setPackCount(packCount); + int totalQty = model.getTotalQuantity() == null ? 0 : model.getTotalQuantity(); + int packCount = healthcareDrugFiling.getPackCount() == null ? 0 : healthcareDrugFiling.getPackCount(); + int boxCount = healthcareDrugFiling.getBoxCount() == null ? 0 : healthcareDrugFiling.getBoxCount(); + int unitQty = model.getUnitQuantity() == null || model.getUnitQuantity() == 0 ? 1 : model.getUnitQuantity(); + + if ("Y".equals(model.getIsSplit())) { + if (packCount >= totalQty) { + updateHealthcareDrugFiling.setPackCount(packCount - totalQty); + iHealthcareDrugFilingService.updateHealthcareDrugFiling(updateHealthcareDrugFiling); } else { - boxUnt = boxUnt + 1; - int packCount = healthcareDrugFiling.getPackCount() + model.getUnitQuantity() - packUnt; - updateHealthcareDrugFiling.setPackCount(packCount); + int boxUnt = totalQty / unitQty; + int packUnt = totalQty % unitQty; + if (packUnt <= packCount) { + updateHealthcareDrugFiling.setPackCount(packCount - packUnt); + } else { + boxUnt = boxUnt + 1; + updateHealthcareDrugFiling.setPackCount(packCount + unitQty - packUnt); + } + updateHealthcareDrugFiling.setBoxCount(boxCount - boxUnt); + iHealthcareDrugFilingService.updateHealthcareDrugFiling(updateHealthcareDrugFiling); } - // 计算 盒数 - int boxCount = healthcareDrugFiling.getBoxCount() - boxUnt; - updateHealthcareDrugFiling.setBoxCount(boxCount); - // 发送 修改 请求 + } else if ("N".equals(model.getIsSplit())) { + updateHealthcareDrugFiling.setBoxCount(boxCount - totalQty); iHealthcareDrugFilingService.updateHealthcareDrugFiling(updateHealthcareDrugFiling); } } - if (model.getIsSplit().equals("N")) { - // 不可以 拆零 药 - int boxCount = healthcareDrugFiling.getBoxCount() - model.getTotalQuantity(); - updateHealthcareDrugFiling.setBoxCount(boxCount); - // 发送 修改 请求 - iHealthcareDrugFilingService.updateHealthcareDrugFiling(updateHealthcareDrugFiling); - } }); } } - /** - * 处理 诊断 信息 的 删除 药品 修改 库存 - * isRemove 0 是 1 否 + * 处理 诊断 信息 的删除 药品 修改 库存 */ + @Override public void removeDrugModifyInventory(PatientMedicalRecordsVO patientMedicalRecordsVO) { // 药品 盒子 HealthcareOsPrescriptionDetails prescriptionDetails = new HealthcareOsPrescriptionDetails(); prescriptionDetails.setPatientDiagnosisId(patientMedicalRecordsVO.getPatientDiagnosisId()); // 获取 药品 数组 - List prescriptionDetailsList = healthcareOsPrescriptionDetailsMapper.selectHealthcareOsPrescriptionDetailsList(prescriptionDetails); - prescriptionDetailsList.forEach(model -> { - // 获取 药品 库存 - HealthcareDrugFiling healthcareDrugFiling = iHealthcareDrugFilingService.selectHealthcareDrugFilingById(model.getMedicineId()); - // 修改 的 内容 - HealthcareDrugFiling updateHealthcareDrugFiling = new HealthcareDrugFiling(); - // 更新库存 赋值 id - updateHealthcareDrugFiling.setId(model.getMedicineId()); - // 进行 赋值 防止 错误 修改 - BeanUtils.copyBeanProp(updateHealthcareDrugFiling, healthcareDrugFiling); - // 判断 是否 拆零 药 - if (model.getIsSplit().equals("Y")) { - // 可以 拆零 药 修改 的 处方 的 数量 < 包装数量 - if (model.getTotalQuantity() < model.getUnitQuantity()) { - // - int packNum = healthcareDrugFiling.getPackCount() + model.getTotalQuantity(); - // - if (packNum < model.getUnitQuantity()) { - // 增加 的 库存 - updateHealthcareDrugFiling.setPackCount(healthcareDrugFiling.getPackCount() + model.getTotalQuantity()); - } else { - // - int boxNum = packNum / model.getUnitQuantity(); - // - int packCount = packNum % model.getUnitQuantity(); - // - int boxCount = healthcareDrugFiling.getBoxCount() + boxNum; - updateHealthcareDrugFiling.setBoxCount(boxCount); - updateHealthcareDrugFiling.setPackCount(packCount); - } - // 发送 修改 请求 - iHealthcareDrugFilingService.updateHealthcareDrugFiling(updateHealthcareDrugFiling); - } - // 数量 不知 多少 - else { - int boxUnt = model.getTotalQuantity() / model.getUnitQuantity(); - int packUnt = model.getTotalQuantity() % model.getUnitQuantity(); - // 计算 平时 - int packCount = healthcareDrugFiling.getPackCount() + packUnt; - if (packCount > model.getUnitQuantity()) { - // 计算 盒数 增加 - int boxUnt1 = packCount / model.getUnitQuantity(); - // 计算 包数 - int packUnt1 = packCount % model.getUnitQuantity(); - // 计算 盒数 - boxUnt = boxUnt + boxUnt1; - updateHealthcareDrugFiling.setPackCount(packUnt1); - } - // 进行 包 数 的 添加 - updateHealthcareDrugFiling.setPackCount(packCount); - // 计算 盒数 - int boxCount = healthcareDrugFiling.getBoxCount() + boxUnt; - // - updateHealthcareDrugFiling.setBoxCount(boxCount); - // 发送 修改 请求 - iHealthcareDrugFilingService.updateHealthcareDrugFiling(updateHealthcareDrugFiling); - } - } - // 不可以 拆零 药 - if (model.getIsSplit().equals("N")) { - // 不可以 拆零 药 - int boxCount = healthcareDrugFiling.getBoxCount() + model.getTotalQuantity(); - updateHealthcareDrugFiling.setBoxCount(boxCount); - // 发送 修改 请求 - iHealthcareDrugFilingService.updateHealthcareDrugFiling(updateHealthcareDrugFiling); - } - }); - } + List prescriptionDetailsList = healthcareOsPrescriptionDetailsMapper + .selectHealthcareOsPrescriptionDetailsList(prescriptionDetails); + if (prescriptionDetailsList != null) { + prescriptionDetailsList.forEach(model -> { + HealthcareDrugFiling healthcareDrugFiling = iHealthcareDrugFilingService + .selectHealthcareDrugFilingById(model.getMedicineId()); + if (healthcareDrugFiling != null) { + HealthcareDrugFiling updateHealthcareDrugFiling = new HealthcareDrugFiling(); + updateHealthcareDrugFiling.setId(model.getMedicineId()); + BeanUtils.copyBeanProp(updateHealthcareDrugFiling, healthcareDrugFiling); + int totalQty = model.getTotalQuantity() == null ? 0 : model.getTotalQuantity(); + int packCount = healthcareDrugFiling.getPackCount() == null ? 0 : healthcareDrugFiling.getPackCount(); + int boxCount = healthcareDrugFiling.getBoxCount() == null ? 0 : healthcareDrugFiling.getBoxCount(); - /** - * 进行 判断 库存是否充足 参数 - */ - @Override - public void judgeStock(List> prescriptionDetailsList) { - if (prescriptionDetailsList == null || prescriptionDetailsList.isEmpty()) { - throw new UtilException("处方详情不能为空"); - } - // 判断 库存是否充足 - prescriptionDetailsList.forEach(item -> { - if (item == null) { - throw new UtilException("处方详情中的子项不能为空"); - } - item.forEach(model -> { - if (model == null || model.getMedicineId() == null) { - throw new UtilException("药品 ID 不能为空"); - } - HealthcareDrugFiling healthcareDrugFiling = iHealthcareDrugFilingService.selectHealthcareDrugFilingById(model.getMedicineId()); - if (healthcareDrugFiling == null) { - throw new UtilException("没有这个药品的库存:" + model.getMedicineName()); - } - - if (model.getIsSplit().equals("Y")) { - // 进行 库存 的 判断 盒数 * 单位数量 + 包装数量 = 总数 = 库存 - int inventoryCount = healthcareDrugFiling.getBoxCount() * model.getUnitQuantity() + healthcareDrugFiling.getPackCount(); - if (inventoryCount < model.getTotalQuantity()) { - throw new UtilException("库存不足:" + model.getMedicineName()); - } - } - // - if (model.getIsSplit().equals("N")) { - if (healthcareDrugFiling.getBoxCount() < model.getTotalQuantity()) { - throw new UtilException("库存不足:" + model.getMedicineName()); + if ("Y".equals(model.getIsSplit())) { + int newPackCount = packCount + totalQty; + updateHealthcareDrugFiling.setPackCount(newPackCount); + if (updateHealthcareDrugFiling.getMinNumber() > 0 && newPackCount >= updateHealthcareDrugFiling.getMinNumber()) { + updateHealthcareDrugFiling.setBoxCount(boxCount + 1); + updateHealthcareDrugFiling + .setPackCount((int) (newPackCount - updateHealthcareDrugFiling.getMinNumber())); + } + iHealthcareDrugFilingService.updateHealthcareDrugFiling(updateHealthcareDrugFiling); + } else if ("N".equals(model.getIsSplit())) { + updateHealthcareDrugFiling.setBoxCount(boxCount + totalQty); + iHealthcareDrugFilingService.updateHealthcareDrugFiling(updateHealthcareDrugFiling); } } }); - }); - } - - /** - * 修改 处方 的 时候 库存 判断 前表格 和 新表格 对比 - */ - public void modifyJudgeStock(List> prescriptionDetailsList) { - // 参数 - HealthcareOsPrescriptionDetails prescriptionDetails = new HealthcareOsPrescriptionDetails(); - prescriptionDetails.setPatientDiagnosisId(prescriptionDetailsList.get(0).get(0).getPatientDiagnosisId()); - // 获取 旧处方 里面 药品 的 列表 - List oldPrescriptionDetailsList = healthcareOsPrescriptionDetailsMapper.selectHealthcareOsPrescriptionDetailsList(prescriptionDetails); - // - for (int i = 0; i < prescriptionDetailsList.size(); i++) { - for (int j = 0; j < prescriptionDetailsList.get(i).size(); j++) { - // 判断 是否 前后 相同 identical adj. 相同的,相等的; - int isIdentical = 0; - for (int k = 0; k < oldPrescriptionDetailsList.size(); k++) { - // 判断 是否 药品 的 库存 id 是否 相同 - if (prescriptionDetailsList.get(i).get(j).getMedicineId().equals(oldPrescriptionDetailsList.get(k).getMedicineId())) { - isIdentical = 1; - // 进行 赋值 因为 没有 处方药品 id - prescriptionDetailsList.get(i).get(j).setId(oldPrescriptionDetailsList.get(k).getId()); - } - } - // 判断 是否 前后 相同 identical adj. 相同的,相等的; - if (isIdentical == 1) { - judgeDrugInventoryAround(prescriptionDetailsList.get(i).get(j)); - } - // - if (isIdentical == 0) { - judgeDrugInventory(prescriptionDetailsList.get(i).get(j)); - } - } } } /** - * 药品 库存 判断 inventory judge drugs 判断 前后 库存 是否 充足 - * healthcareOsPrescriptionDetails 新的处方 里面 的 药品 - */ - private void judgeDrugInventoryAround(HealthcareOsPrescriptionDetails healthcareOsPrescriptionDetails) { - // 获取 药品 详情 (处方 里面 的 ) - HealthcareOsPrescriptionDetails prescriptionDetails = healthcareOsPrescriptionDetailsMapper.selectHealthcareOsPrescriptionDetailsById(healthcareOsPrescriptionDetails.getId()); - // - if (prescriptionDetails == null) { - throw new UtilException("诊断表里面没有这个药品:" + healthcareOsPrescriptionDetails.getMedicineName()); - } - // 获取 药品 库存 - HealthcareDrugFiling healthcareDrugFiling = iHealthcareDrugFilingService.selectHealthcareDrugFilingById(healthcareOsPrescriptionDetails.getMedicineId()); - // - if (healthcareDrugFiling == null) { - throw new UtilException("没有这个药品的库存:" + healthcareOsPrescriptionDetails.getMedicineName()); - } - // - // 获取 判断 是否 减少 库存 - if (prescriptionDetails.getTotalQuantity() < healthcareOsPrescriptionDetails.getTotalQuantity()) { - // - if (healthcareOsPrescriptionDetails.getIsSplit().equals("Y")) { - // - int mutually = healthcareOsPrescriptionDetails.getTotalQuantity() - prescriptionDetails.getTotalQuantity(); - // 药品 库存 - int totalNum = healthcareDrugFiling.getBoxCount() * healthcareOsPrescriptionDetails.getUnitQuantity(); - totalNum = totalNum + healthcareDrugFiling.getPackCount(); - if (totalNum < mutually) { - throw new UtilException("库存不足:" + healthcareOsPrescriptionDetails.getMedicineName()); - } - } - // - if (healthcareOsPrescriptionDetails.getIsSplit().equals("N")) { - int mutually = healthcareOsPrescriptionDetails.getTotalQuantity() - prescriptionDetails.getTotalQuantity(); - if (healthcareDrugFiling.getBoxCount() < mutually) { - throw new UtilException("库存不足:" + healthcareOsPrescriptionDetails.getMedicineName()); - } - } - } - } - - /** - * 判断 这个 药品 库存 是否 充足 medicineId - * filingId => 药品 库存 id isSplit ==> 是否 拆零 Y N - */ - private void judgeDrugInventory(HealthcareOsPrescriptionDetails prescriptionDetails) { - // 获取 药品 库存 - HealthcareDrugFiling healthcareDrugFiling = iHealthcareDrugFilingService.selectHealthcareDrugFilingById(prescriptionDetails.getMedicineId()); - // - if (healthcareDrugFiling == null) { - throw new UtilException("没有这个药品的库存:" + prescriptionDetails.getMedicineName()); - } - // - if (prescriptionDetails.getIsSplit().equals("Y")) { - // 进行 库存 的 判断 盒数 * 单位数量 + 包装数量 = 总数 = 库存 - int inventoryCount = healthcareDrugFiling.getBoxCount() * prescriptionDetails.getUnitQuantity() + healthcareDrugFiling.getPackCount(); - if (inventoryCount < prescriptionDetails.getTotalQuantity()) { - throw new UtilException("库存不足:" + prescriptionDetails.getMedicineName()); - } - } - // - if (prescriptionDetails.getIsSplit().equals("N")) { - if (healthcareDrugFiling.getBoxCount() < prescriptionDetails.getTotalQuantity()) { - throw new UtilException("库存不足:" + prescriptionDetails.getMedicineName()); - } - } - } - - /** - * 进行 处方 里面 的 药品 不重复 的 判断 judge drug repeat - */ - private void judgeDrugRepeat(List> prescriptionDetailsList) { - // 获取 药品 列表 - List prescriptionDetailsList1 = new ArrayList<>(); - for (int i = 0; i < prescriptionDetailsList.size(); i++) { - for (int j = 0; j < prescriptionDetailsList.get(i).size(); j++) { - prescriptionDetailsList1.add(prescriptionDetailsList.get(i).get(j)); - } - } - // 判断 是否 重复 - for (int i = 0; i < prescriptionDetailsList1.size(); i++) { - for (int j = i + 1; j < prescriptionDetailsList1.size(); j++) { - if (prescriptionDetailsList1.get(i).getMedicineId().equals(prescriptionDetailsList1.get(j).getMedicineId())) { - throw new UtilException("药品不能重复"); - } - } - } - } - - /** - * 进行 诊断 的 基础 判断 foundation diagnosis - */ - private void judgeDiagnosisFoundation(PatientMedicalRecordsVO patientMedicalRecordsVO) { - // 判断 是否 有 处方s - if (patientMedicalRecordsVO.getPrescriptionDetailsList().size() == 0 || patientMedicalRecordsVO.getPrescriptionDetailsList().get(0).size() == 0) { - throw new UtilException("处方不能为空"); - } - // 判断 是否 有 患者 id - if (patientMedicalRecordsVO.getPatientId() == null) { - // 没有 患者 id 进行 学号/工号 查询 - if (patientMedicalRecordsVO.getStudentId() != null) { - // - HealthcareOsPatientInfo healthcareOsPatientInfo = healthcareOsPatientInfoMapper.selectOsPatientInfoByStudentId(patientMedicalRecordsVO.getStudentId()); - // 判断 是否存在 - if (healthcareOsPatientInfo != null) { - // - patientMedicalRecordsVO.setPatientId(healthcareOsPatientInfo.getId()); - } else { - //这里添加患者信息 - // 判断建档表是否又患者数据,如果没有新增 - //建档卡对象 - HealthcareOsPatientInfo osPatientInfo = new HealthcareOsPatientInfo(); - BeanUtils.copyProperties(patientMedicalRecordsVO, osPatientInfo); - int result = osPatientInfoService.insertOsPatientInfo(osPatientInfo); - if(result > 0) { - // 重新查询获取完整的患者信息,包括生成的ID - HealthcareOsPatientInfo savedPatient = healthcareOsPatientInfoMapper.selectOsPatientInfoByStudentId(osPatientInfo.getStudentId()); - if (savedPatient != null) { - patientMedicalRecordsVO.setPatientId(savedPatient.getId()); - patientMedicalRecordsVO.setStudentId(savedPatient.getStudentId()); - } else { - throw new UtilException("患者信息保存后查询失败"); - } - } - } - } - // - else { - throw new UtilException("患者信息保存失败"); - } - } - // - else { - HealthcareOsPatientInfo healthcareOsPatientInfo01 = healthcareOsPatientInfoMapper.selectOsPatientInfoById(patientMedicalRecordsVO.getPatientId()); - // 进行 基础 赋值 - // 学号 - patientMedicalRecordsVO.setStudentId(healthcareOsPatientInfo01.getStudentId()); - } - } - - - /** - * 删除患者诊断 + * 删除 患者 诊断 */ @Override public int removeDiagnosis(Long id) { - // 删除诊断信息 - if (healthcareOsPatientDiagnosisMapper.deleteHealthcareOsPatientDiagnosisById(id) == 1) { + // 获取 诊断信息 + HealthcareOsPatientDiagnosis healthcareOsPatientDiagnosis = healthcareOsPatientDiagnosisMapper + .selectHealthcareOsPatientDiagnosisById(id); + // 判断 诊断信息 是否 为 null + if (healthcareOsPatientDiagnosis != null) { + // 获取 药品 信息 HealthcareOsPrescriptionDetails healthcareOsPrescriptionDetails = new HealthcareOsPrescriptionDetails(); healthcareOsPrescriptionDetails.setPatientDiagnosisId(id); - List prescriptionDetailsList = healthcareOsPrescriptionDetailsMapper.selectHealthcareOsPrescriptionDetailsList(healthcareOsPrescriptionDetails); - // 删除处方详情 + // 获取 药品 数组 + List prescriptionDetailsList = healthcareOsPrescriptionDetailsMapper + .selectHealthcareOsPrescriptionDetailsList(healthcareOsPrescriptionDetails); + // 判断 药品 数组 是否 为 null if (prescriptionDetailsList != null) { + // 循环 药品 数组 prescriptionDetailsList.forEach(model -> { - healthcareOsPrescriptionDetailsMapper.deleteHealthcareOsPrescriptionDetailsById(model.getId()); + HealthcareDrugFiling healthcareDrugFiling = iHealthcareDrugFilingService + .selectHealthcareDrugFilingById(model.getMedicineId()); + if (healthcareDrugFiling != null) { + HealthcareDrugFiling updateHealthcareDrugFiling = new HealthcareDrugFiling(); + updateHealthcareDrugFiling.setId(model.getMedicineId()); + BeanUtils.copyBeanProp(updateHealthcareDrugFiling, healthcareDrugFiling); + + int totalQty = model.getTotalQuantity() == null ? 0 : model.getTotalQuantity(); + int packCount = healthcareDrugFiling.getPackCount() == null ? 0 : healthcareDrugFiling.getPackCount(); + int boxCount = healthcareDrugFiling.getBoxCount() == null ? 0 : healthcareDrugFiling.getBoxCount(); + + if ("Y".equals(model.getIsSplit())) { + int newPackCount = packCount + totalQty; + updateHealthcareDrugFiling.setPackCount(newPackCount); + if (updateHealthcareDrugFiling.getMinNumber() > 0 && newPackCount >= updateHealthcareDrugFiling.getMinNumber()) { + updateHealthcareDrugFiling.setBoxCount(boxCount + 1); + updateHealthcareDrugFiling + .setPackCount((int) (newPackCount - updateHealthcareDrugFiling.getMinNumber())); + } + iHealthcareDrugFilingService.updateHealthcareDrugFiling(updateHealthcareDrugFiling); + } else if ("N".equals(model.getIsSplit())) { + updateHealthcareDrugFiling.setBoxCount(boxCount + totalQty); + iHealthcareDrugFilingService.updateHealthcareDrugFiling(updateHealthcareDrugFiling); + } + } }); } - return 1; + // 删除 诊断信息 + return healthcareOsPatientDiagnosisMapper.deleteHealthcareOsPatientDiagnosisById(id); } return 0; } + /** + * 判断 库存 + * + * @param prescriptionDetailsList 参数 + * + */ + @Override + public void judgeStock(List> prescriptionDetailsList) { + // 判断 药品 数组 + if (prescriptionDetailsList != null) { + // 循环 药品 数组 + prescriptionDetailsList.forEach(list -> { + list.forEach(model -> { + // 获取 药品 库存 + HealthcareDrugFiling healthcareDrugFiling = iHealthcareDrugFilingService + .selectHealthcareDrugFilingById(model.getMedicineId()); + if (healthcareDrugFiling != null) { + int boxCount = healthcareDrugFiling.getBoxCount() == null ? 0 : healthcareDrugFiling.getBoxCount(); + int packCount = healthcareDrugFiling.getPackCount() == null ? 0 : healthcareDrugFiling.getPackCount(); + int totalQty = model.getTotalQuantity() == null ? 0 : model.getTotalQuantity(); + if ("Y".equals(model.getIsSplit())) { + if (boxCount == 0 && packCount < totalQty) { + throw new UtilException("【" + healthcareDrugFiling.getMedicineName() + "】药品库存不足"); + } + } else if ("N".equals(model.getIsSplit())) { + if (boxCount < totalQty) { + throw new UtilException("【" + healthcareDrugFiling.getMedicineName() + "】药品库存不足"); + } + } + } + }); + }); + } + } + + /** + * 判断 库存 在 修改 处方 + * + * @param prescriptionDetailsList 参数 + * + */ + @Override + public void modifyJudgeStock(List> prescriptionDetailsList) { + // 判断 药品 数组 + if (prescriptionDetailsList != null) { + // 循环 药品 数组 + prescriptionDetailsList.forEach(list -> { + list.forEach(model -> { + // 获取 药品 库存 + HealthcareDrugFiling healthcareDrugFiling = iHealthcareDrugFilingService + .selectHealthcareDrugFilingById(model.getMedicineId()); + if (healthcareDrugFiling != null) { + int boxCount = healthcareDrugFiling.getBoxCount() == null ? 0 : healthcareDrugFiling.getBoxCount(); + int packCount = healthcareDrugFiling.getPackCount() == null ? 0 : healthcareDrugFiling.getPackCount(); + int totalQty = model.getTotalQuantity() == null ? 0 : model.getTotalQuantity(); + if ("Y".equals(model.getIsSplit())) { + if (boxCount == 0 && packCount < totalQty) { + throw new UtilException("【" + healthcareDrugFiling.getMedicineName() + "】药品库存不足"); + } + } else if ("N".equals(model.getIsSplit())) { + if (boxCount < totalQty) { + throw new UtilException("【" + healthcareDrugFiling.getMedicineName() + "】药品库存不足"); + } + } + } + }); + }); + } + } + /** * 修改患者状态 + * + * @param id 患者id + * @param status 状态 + * @return 返回 成功 提示信息 */ @Override public int updateStatus(Long id, Long status) { HealthcareOsPatientDiagnosis healthcareOsPatientDiagnosis = new HealthcareOsPatientDiagnosis(); healthcareOsPatientDiagnosis.setId(id); healthcareOsPatientDiagnosis.setStatus(status); - LoginUser loginUser = SecurityUtils.getLoginUser(); - healthcareOsPatientDiagnosis.setUpdateBy(loginUser.getUsername()); - healthcareOsPatientDiagnosis.setUpdateTime(DateUtils.getNowDate()); - return healthcareOsPatientDiagnosisMapper.updateHealthcareOsPatientDiagnosis(healthcareOsPatientDiagnosis); } /** - * 获取药品列表 - */ + * @param drugArchivesVO 参数 + * @return 返回 药品 列表 + **/ @Override public List gainDrugList(DrugArchivesVO drugArchivesVO) { - List drugArchivesList = new ArrayList<>(); - HealthcareDrugArchive healthcareDrugArchive = new HealthcareDrugArchive(); - // 获取药品列表 - List healthcareDrugArchiveList = iHealthcareDrugArchiveService.selectHealthcareDrugArchiveList(healthcareDrugArchive); - - healthcareDrugArchiveList.forEach(model -> { - DrugArchivesVO drugArchives1 = new DrugArchivesVO(); - drugArchives1.setArchiveId(model.getId()); - BeanUtils.copyBeanProp(drugArchives1, model); - drugArchivesList.add(drugArchives1); - }); - - return drugArchivesList; - } - - - /** - * 获取药品价格列表 - */ - @Override - public List gainDrugPriceList(HealthcareDrugArchive healthcareDrugArchive) { - List drugArchivesList = new ArrayList<>(); - // 获取药品列表 - List drugArchiveList = iHealthcareDrugArchiveService.selectHealthcareDrugArchiveList(healthcareDrugArchive); - - // 获取 药品 价格 - drugArchiveList.forEach(model -> { - List drugFilingList = iHealthcareDrugFilingService.selectHealthcareDrugFilingByArchiveId(model.getId()); - drugFilingList.forEach(modelFiling -> { - DrugArchivesVO drugArchives = new DrugArchivesVO(); - drugArchives.setArchiveId(model.getId()); - drugArchives.setMedicineName(model.getMedicineName()); - BeanUtils.copyBeanProp(drugArchives, model); - drugArchives.setFilingId(modelFiling.getId()); - // 批次 id - drugArchives.setFilingId(modelFiling.getId()); -// drugArchives.setMedicineCode(modelFiling.getMedicineCode()); - drugArchives.setBatch(modelFiling.getBatch()); - drugArchives.setExpiryDate(modelFiling.getExpiryDate()); - drugArchives.setBoxCount(modelFiling.getBoxCount()); - drugArchives.setPackCount(modelFiling.getPackCount()); - drugArchives.setFilingRetailPrice(modelFiling.getRetailPrice()); - drugArchives.setFilingPackageUnit(modelFiling.getPackageUnit()); - drugArchives.setFilingSplitUnit(modelFiling.getSplitUnit()); - drugArchives.setMinNumberRetailPrice(modelFiling.getMinPrice()); - drugArchivesList.add(drugArchives); - }); - }); - // 药品 型号 - List drugArchivesList1 = new ArrayList<>(); - // 去除 模糊 查询 - for (int i = 0; i < drugArchivesList.size(); i++) { - if (drugArchivesList.get(i).getMedicineName().equals(healthcareDrugArchive.getMedicineName())) { - drugArchivesList1.add(drugArchivesList.get(i)); - } - } - // 返回 - return drugArchivesList1; - } - - /** - * 获取药品名称列表 - */ - @Override - public List gainMedicineNameList(HealthcareDrugArchive healthcareDrugArchive) { - List drugArchiveList = iHealthcareDrugArchiveService.selectHealthcareDrugArchiveList(healthcareDrugArchive); - // 进行 分类 - List medicineNameList = drugArchiveList.stream() - .map(HealthcareDrugArchive::getMedicineName) - .distinct() - .collect(Collectors.toList()); - - return medicineNameList; - } - - /** - * 获取 药品 名称 列表 - * - * @param drugArchivesVO 参数 - * @return 返回 药品详细 列表 - */ - public List gainMedicineArchiveList(DrugArchivesVO drugArchivesVO) { - // 创建 盒子 - HealthcareDrugArchive drugArchive = new HealthcareDrugArchive(); - // 赋值 参数 - BeanUtils.copyBeanProp(drugArchive, drugArchivesVO); - // 获取 药品 列表 - List drugArchiveList = iHealthcareDrugArchiveService.selectHealthcareDrugArchiveList(drugArchive); - return drugArchiveList; - } - - /** - * 获取 药品 库存 列表 - * - * @param drugArchivesVO 参数 - * @return 返回 药品 库存 详细 列表 - */ - public List gainDrugInventoryList(DrugArchivesVO drugArchivesVO) { - // 获取 当前 时间 - drugArchivesVO.setCurrentTime(DateUtils.getNowDate()); return drugArchivesVoMapper.selectDruyInventoryList(drugArchivesVO); } /** + * @param healthcareDrugArchive 参数 + * @return 返回 药品 列表 价格 + **/ + @Override + public List gainDrugPriceList(HealthcareDrugArchive healthcareDrugArchive) { + // TODO: 该方法在DrugArchivesVoMapper中未定义 + return new java.util.ArrayList<>(); + } + + /** + * 获取 药品 名称 列表 gainMedicineArchiveList * + * @param healthcareDrugArchive 参数 + * @return 返回 药品名称 列表 */ + @Override + public List gainMedicineNameList(HealthcareDrugArchive healthcareDrugArchive) { + // TODO: 该方法在DrugArchivesVoMapper中未定义 + return new java.util.ArrayList<>(); + } + + /** + * 获取 药品 名称 列表 + * + * @param drugArchivesVO 参数 + * @return 返回 药品 档案 列表 + */ + @Override + public List gainMedicineArchiveList(DrugArchivesVO drugArchivesVO) { + // TODO: 该方法在DrugArchivesVoMapper中未定义 + return new java.util.ArrayList<>(); + } + + /** + * 获取 药品 库存 列表 + * + * @param drugArchivesVO 参数 + * @return 返回 药品库存 列表 + */ + @Override + public List gainDrugInventoryList(DrugArchivesVO drugArchivesVO) { + return drugArchivesVoMapper.selectDruyInventoryList(drugArchivesVO); + } + + /** + * 获取 患者 诊断 详情 列表 没有 id 的 + * + * @param patientMedicalRecordsVO 参数 + * @return 返回 列表 + */ + @Override public List gainPrescriptionDetailsList(PatientMedicalRecordsVO patientMedicalRecordsVO) { - return osStatisticsMapper.obtainPatientDiagnosisList(patientMedicalRecordsVO); + List list = osStatisticsMapper.obtainPatientDiagnosisList(patientMedicalRecordsVO); + if (list == null || list.isEmpty()) { + return list; + } + + List diagnosisIds = list.stream() + .map(PatientMedicalRecordsVO::getPatientDiagnosisId) + .filter(id -> id != null) + .distinct() + .collect(Collectors.toList()); + Map> detailsByDiagnosisId = new HashMap<>(); + if (!diagnosisIds.isEmpty()) { + List allDetails = healthcareOsPrescriptionDetailsMapper + .selectHealthcareOsPrescriptionDetailsByDiagnosisIds(diagnosisIds); + if (allDetails != null && !allDetails.isEmpty()) { + detailsByDiagnosisId = allDetails.stream() + .filter(detail -> detail.getPatientDiagnosisId() != null) + .collect(Collectors.groupingBy(HealthcareOsPrescriptionDetails::getPatientDiagnosisId)); + } + } + + for (PatientMedicalRecordsVO record : list) { + Long diagnosisId = record.getPatientDiagnosisId(); + if (diagnosisId == null) { + record.setPrescriptionDetailsList(new ArrayList<>()); + continue; + } + + List details = detailsByDiagnosisId.get(diagnosisId); + if (details == null || details.isEmpty()) { + record.setPrescriptionDetailsList(new ArrayList<>()); + continue; + } + + Map> grouped = new LinkedHashMap<>(); + for (HealthcareOsPrescriptionDetails detail : details) { + Long singular = detail.getSingular(); + if (singular == null) { + singular = -1L; + } + grouped.computeIfAbsent(singular, key -> new ArrayList<>()).add(detail); + } + record.setPrescriptionDetailsList(new ArrayList<>(grouped.values())); + } + + return list; + } + + /** + * 获取 症状 对应 的 数量 + * + * @param countDiagnosisVO 参数 + * @return 返回 列表 + */ + @Override + public List obtainSymptomStatisticsNumber(CountDiagnosisVO countDiagnosisVO) { + return osStatisticsMapper.obtainSymptomCorrespondingNumber(countDiagnosisVO); + } + + /** + * 按患者ID统计历史医保报销累计金额(仅统计已发药) + * + * @param patientId 患者ID + * @param yearDate 年份日期(用于过滤当年数据) + * @return 历史医保报销累计金额 + */ + @Override + public java.math.BigDecimal getHistoryReimbursementByPatientId(Long patientId, java.util.Date yearDate) { + if (patientId == null) { + return java.math.BigDecimal.ZERO; + } + Map params = new HashMap<>(); + params.put("patientId", patientId); + params.put("yearDate", yearDate != null ? yearDate : new java.util.Date()); + return osStatisticsMapper.getHistoryReimbursementByPatientId(params); + } + + /** + * 获取 症状 对应 的 数量 月份 + * + * @param countDiagnosisVO 参数 + * @return 返回 列表 + */ + @Override + public List> obtainSymptomStatisticsNumberMonth(CountDiagnosisVO countDiagnosisVO) { + // TODO: 该方法在OsStatisticsMapper中未定义 + return new java.util.ArrayList<>(); } /** @@ -989,153 +882,71 @@ public class PatientDiagnosisServiceImpl implements IPatientDiagnosisService { * 邵政文 * 2025-05-14 */ - public List gainPrescriptionDetailsYesList(PatientMedicalRecordsVO patientMedicalRecordsVO) { - Long count = 1L; - List listYes = osStatisticsMapper.obtainPatientDiagnosisYesList(patientMedicalRecordsVO); - //遍历listYes集合,将集合totalPrice对应的值与value对应的值进行相乘,并将结果赋给moneyValue - for (PatientMedicalRecordsYesVO patientMedicalRecordsYesVO : listYes) { - //获取totalPrice对应的值 - BigDecimal totalPrice = patientMedicalRecordsYesVO.getTotalPrice(); - //获取value对应的值 - BigDecimal value = patientMedicalRecordsYesVO.getValue(); - //将totalPrice与value相乘,并将结果赋给moneyValue(保留两位小数) - patientMedicalRecordsYesVO.setMoneyValue(totalPrice.multiply(value).setScale(2, BigDecimal.ROUND_HALF_UP)); - patientMedicalRecordsYesVO.setId(count++); - //对value进行判断,如果值小于1的两位小数的话,就改为百分比的形式,反之不变 - if (value.compareTo(BigDecimal.ONE) < 0) { - // 小于1,转为百分比(乘以100) - value = value.multiply(new BigDecimal("100")); - - // 转换为无科学计数的字符串,并去掉末尾无效0,然后拼接% - String percentValue = value.stripTrailingZeros().toPlainString() + "%"; - - // 设置到 VO 中的字段应为 String 类型 - patientMedicalRecordsYesVO.setValueLu(percentValue); - } - } - return listYes; + @Override + public List gainPrescriptionDetailsYesList( + PatientMedicalRecordsVO patientMedicalRecordsVO) { + return osStatisticsMapper.obtainPatientDiagnosisYesList(patientMedicalRecordsVO); } /** - * 获取 症状 对应 的 数量 - * - * @param countDiagnosisVO 参数 - * @return 返回 列表 - */ - public List obtainSymptomStatisticsNumber(CountDiagnosisVO countDiagnosisVO) { - return osStatisticsMapper.obtainSymptomCorrespondingNumber(countDiagnosisVO); - } - - /** - * 获取 症状 对应 的 数量 月份 - */ - public List> obtainSymptomStatisticsNumberMonth(CountDiagnosisVO countDiagnosisVO) { - // 列表 盒子 - List> list = new ArrayList<>(); - // 获取 - List countDiagnosisVOList = osStatisticsMapper.obtainSymptomCorrespondingNumber(countDiagnosisVO); - // 进行 分布 - List> timeList = divideTime((Date) countDiagnosisVO.getParams().get("startTime"), (Date) countDiagnosisVO.getParams().get("endTime"), 12); - // 月份 - for (int j = 0; j < 12; j++) { - // - Boolean flag = countDiagnosisVO.getParams().get("startTime") instanceof Date; - // - flag = countDiagnosisVO.getParams().get("endTime") instanceof Date; - // 获取 分类 - if (!flag) { - throw new UtilException("时间 格式 错误"); - } - // 盒子 列表 - List countDiagnosisList = new ArrayList<>(); - // 进行 分布 - for (int i = 0; i < countDiagnosisVOList.size(); i++) { - // - CountDiagnosisVO countDiagnosisVO1 = new CountDiagnosisVO(); - // 症状 名称 - countDiagnosisVO1.setSymptomName(countDiagnosisVOList.get(i).getSymptomName()); - // 症状 的 字典 名称 - countDiagnosisVO1.setDictionariesNameSymptom(HealthcareOsDictionaryName.OS_SYMPTOM); - // 时间 - countDiagnosisVO1.setParams(timeList.get(j)); - // - CountDiagnosisVO countDiagnosisVO2 = new CountDiagnosisVO(); - // 获取 - List countDiagnosisList1 = osStatisticsMapper.obtainSymptomCorrespondingNumber(countDiagnosisVO1); - if (countDiagnosisList1.size() > 0) { - // 进行 赋值 - BeanUtils.copyBeanProp(countDiagnosisVO2, countDiagnosisList1.get(0)); - } - // 定义日期格式,MM 表示月份 - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - // 将 Date 转换为 String - String dateString = formatter.format(timeList.get(i).get("startTime")); - // 提取月份 - String monthString = new SimpleDateFormat("MM").format(timeList.get(j).get("startTime")); - // 赋值 月份 - countDiagnosisVO2.setMonth(monthString); - // 赋值 症状 - countDiagnosisVO2.setSymptomName(countDiagnosisVOList.get(i).getSymptomName()); - // - countDiagnosisList.add(countDiagnosisVO2); - } - list.add(countDiagnosisList); - } - return list; - } - - - /** - * 进行 时间 divide -> 分 time -> 时间 - */ - private List> divideTime(Date startTime, Date endTime, int divideNumber) { - // 检查参数有效性 - if (startTime == null || endTime == null || divideNumber <= 0 || startTime.after(endTime)) { - throw new IllegalArgumentException("Invalid input parameters"); - } - // 返回 的 时间 - List> timeList = new ArrayList<>(); - // 定义时区,例如系统默认时区 - ZoneId zoneId = ZoneId.systemDefault(); - // 定义起始时间和 startTime.toInstant(); -> Instant 类型 - LocalDateTime startLocalDateTime = LocalDateTime.ofInstant(startTime.toInstant(), zoneId); - // 结束时间 - LocalDateTime endLocalDateTime = LocalDateTime.ofInstant(endTime.toInstant(), zoneId); - // 计算总时间 - Duration totalDuration = Duration.between(startLocalDateTime, endLocalDateTime); - long totalSeconds = totalDuration.getSeconds() / divideNumber; - // - for (int i = 0; i < divideNumber; i++) { - // - Map timeMap = new HashMap<>(); - // - LocalDateTime segmentStart = startLocalDateTime.plusSeconds(totalSeconds * i); - Date startTimeDate = Date.from(segmentStart.atZone(zoneId).toInstant()); - // - LocalDateTime segmentEnd = startLocalDateTime.plusSeconds(totalSeconds * (i + 1)); - Date endTimeDate = Date.from(segmentEnd.atZone(zoneId).toInstant()); - // 进行 赋值 - timeMap.put("startTime", startTimeDate); - timeMap.put("endTime", endTimeDate); - // 添加 - timeList.add(timeMap); - } - // - return timeList; - } - /** - * 宁博 2025-05-21 * 验证医保是否可用 - * @param idCard 省份证 - * @param name 姓名 - * @return 0 可用 1 不可用 + * + * @param idCard 身份证 + * @param name 姓名 + * @return 0 可用 1 不可用 */ @Override public int verifyInsuranceStatus(String idCard, String name) { - Integer paymentYear = healthcareOsPatientDiagnosisMapper.verifyInsuranceStatus(idCard, name); - int currentYear = LocalDate.now().getYear(); - return (paymentYear != null && paymentYear == currentYear) ? 0 : 1; + // 根据身份证号 + 姓名 + 当前年份查询 patient_insurance_info 表 + String currentYear = String.valueOf(Calendar.getInstance().get(Calendar.YEAR)); + PatientInsuranceInfo query = new PatientInsuranceInfo(); + query.setIdNumber(idCard); + query.setName(name); + query.setPaymentYear(currentYear); + List list = patientInsuranceInfoService.selectPatientInsuranceInfoList(query); + // 查到记录表示当年已缴费,返回0(可用);否则返回1(不可用) + if (list != null && !list.isEmpty()) { + return 0; + } + return 1; } -} + /** + * 发药更正:仅调整基础字段(是否医保、报销比率等),不改处方明细与库存 + * + * @param patientMedicalRecordsVO 入参包含 patientDiagnosisId、isInsured、value 等 + * @return 影响行数 + */ + @Override + public int adjustBasicFields(PatientMedicalRecordsVO patientMedicalRecordsVO) { + // TODO: adjustBasicFields方法在HealthcareOsPatientDiagnosisMapper中未定义 + return 0; + } + // 判断 处方 重复 + private void judgeDrugRepeat(List> prescriptionDetailsList) { + if (prescriptionDetailsList != null) { + for (int i = 0; i < prescriptionDetailsList.size(); i++) { + for (int j = 0; j < prescriptionDetailsList.get(i).size(); j++) { + for (int k = 0; k < prescriptionDetailsList.get(i).size(); k++) { + if (j != k && prescriptionDetailsList.get(i).get(j).getMedicineId() + .equals(prescriptionDetailsList.get(i).get(k).getMedicineId())) { + throw new UtilException( + "【" + prescriptionDetailsList.get(i).get(j).getMedicineName() + "】药品重复"); + } + } + } + } + } + } + + // 判断 诊断 基础 + private void judgeDiagnosisFoundation(PatientMedicalRecordsVO patientMedicalRecordsVO) { + if (patientMedicalRecordsVO.getPatientId() == null) { + throw new UtilException("请选择患者信息"); + } + if (patientMedicalRecordsVO.getDiagnosis() == null || patientMedicalRecordsVO.getDiagnosis().isEmpty()) { + throw new UtilException("请输入诊断信息"); + } + } +} diff --git a/pasd-healthcare/src/main/resources/com/ruoyi/inventory/mapper/HealthcareDrugArchiveMapper.xml b/pasd-healthcare/src/main/resources/com/ruoyi/inventory/mapper/HealthcareDrugArchiveMapper.xml index de7c142..e0edcf5 100644 --- a/pasd-healthcare/src/main/resources/com/ruoyi/inventory/mapper/HealthcareDrugArchiveMapper.xml +++ b/pasd-healthcare/src/main/resources/com/ruoyi/inventory/mapper/HealthcareDrugArchiveMapper.xml @@ -33,19 +33,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -78,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" out_type, variety, out_quantity, + affiliation, out_Point, out_Person, @@ -94,6 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{outType}, #{variety}, #{outQuantity}, + #{affiliation}, #{outPoint}, #{outPerson}, @@ -114,6 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" out_type = #{outType}, variety = #{variety}, out_quantity = #{outQuantity}, + affiliation = #{affiliation}, out_Point = #{outPoint}, out_Person = #{outPerson}, @@ -156,10 +163,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" drug_id, filing_id, out_point_id, + unit, + unit_type, + unit_quantity, expiry_date, out_batch, remainingQuantity, - unit, quantity, create_time, create_by, @@ -174,10 +183,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{item.drugId}, #{item.filingId}, #{item.outPointId}, + #{item.unit}, + #{item.unitType}, + #{item.unitQuantity}, #{item.expiryDate}, #{item.outBatch}, #{item.remainingQuantity}, - #{item.unit}, #{item.quantity}, #{item.createTime}, #{item.createBy}, @@ -187,4 +198,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) - \ No newline at end of file + diff --git a/pasd-healthcare/src/main/resources/com/ruoyi/os/mapper/DrugArchivesVoMapper.xml b/pasd-healthcare/src/main/resources/com/ruoyi/os/mapper/DrugArchivesVoMapper.xml index 04e50fd..e1b0fdb 100644 --- a/pasd-healthcare/src/main/resources/com/ruoyi/os/mapper/DrugArchivesVoMapper.xml +++ b/pasd-healthcare/src/main/resources/com/ruoyi/os/mapper/DrugArchivesVoMapper.xml @@ -88,13 +88,10 @@ diff --git a/pasd-healthcare/src/main/resources/com/ruoyi/os/mapper/HealthcareOsPatientDiagnosisMapper.xml b/pasd-healthcare/src/main/resources/com/ruoyi/os/mapper/HealthcareOsPatientDiagnosisMapper.xml index 54b6d22..92e8104 100644 --- a/pasd-healthcare/src/main/resources/com/ruoyi/os/mapper/HealthcareOsPatientDiagnosisMapper.xml +++ b/pasd-healthcare/src/main/resources/com/ruoyi/os/mapper/HealthcareOsPatientDiagnosisMapper.xml @@ -40,12 +40,12 @@ and patient_id = #{patientId} - and diagnosis_type = #{diagnosisType} - and is_insured = #{isInsured} + and diagnosis_type = #{diagnosisType} + and CAST(is_insured AS SIGNED) = CAST(#{isInsured} AS SIGNED) and value = #{value} and student_id like concat('%', #{studentId}, '%') and name like concat('%', #{name}, '%') - and patient_type = #{patientType} + and patient_type = #{patientType} and chief_complaint = #{chiefComplaint} and present_illness = #{presentIllness} and past_history = #{pastHistory} @@ -54,10 +54,18 @@ and doctor_name like concat('%', #{doctorName}, '%') and status = #{status} and outpatient_time between #{params.outpatientTimeFront} and #{params.outpatientTimeAfter} - and storeroom_id = #{storeroomId} - and storeroom_name = #{storeroomName} + + and (storeroom_id = #{storeroomId} or storeroom_name like concat('%', #{storeroomName}, '%')) + + + and storeroom_id = #{storeroomId} + + + and storeroom_name like concat('%', #{storeroomName}, '%') + - AND healthcare_os_patient_diagnosis.outpatient_time BETWEEN #{startTime} AND #{endTime} + AND healthcare_os_patient_diagnosis.outpatient_time >= #{startTime} + AND healthcare_os_patient_diagnosis.outpatient_time < date_add(#{endTime}, interval 1 day) ORDER BY outpatient_time DESC @@ -116,7 +124,7 @@ #{createTime}, #{updateBy}, #{updateTime}, - #{idCard}, + HEX(AES_ENCRYPT(#{idCard},'zhxg')) , @@ -144,7 +152,7 @@ create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, - id_card = #{idCard}, + id_card = HEX(AES_ENCRYPT(#{idCard},'zhxg')) , where id = #{id} diff --git a/pasd-healthcare/src/main/resources/com/ruoyi/os/mapper/HealthcareOsPatientInfoMapper.xml b/pasd-healthcare/src/main/resources/com/ruoyi/os/mapper/HealthcareOsPatientInfoMapper.xml index b7a51b2..a49353b 100644 --- a/pasd-healthcare/src/main/resources/com/ruoyi/os/mapper/HealthcareOsPatientInfoMapper.xml +++ b/pasd-healthcare/src/main/resources/com/ruoyi/os/mapper/HealthcareOsPatientInfoMapper.xml @@ -87,7 +87,7 @@ #{createTime}, #{updateBy}, #{updateTime}, - #{idCard}, + HEX(AES_ENCRYPT(#{idCard},'zhxg')) , @@ -108,7 +108,7 @@ create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, - id_card = #{idCard}, + id_card = HEX(AES_ENCRYPT(#{idCard},'zhxg')) , where id = #{id} diff --git a/pasd-healthcare/src/main/resources/com/ruoyi/os/mapper/HealthcareOsPrescriptionDetailsMapper.xml b/pasd-healthcare/src/main/resources/com/ruoyi/os/mapper/HealthcareOsPrescriptionDetailsMapper.xml index 28b5e63..4880198 100644 --- a/pasd-healthcare/src/main/resources/com/ruoyi/os/mapper/HealthcareOsPrescriptionDetailsMapper.xml +++ b/pasd-healthcare/src/main/resources/com/ruoyi/os/mapper/HealthcareOsPrescriptionDetailsMapper.xml @@ -61,6 +61,18 @@ + + select - - , + , (select dict_label from sys_dict_data where sys_dict_data.dict_type = #{dictionariesNamePatientType} and - sys_dict_data.dict_value = healthcare_os_patient_info.patient_type ) - AS opi_st_patient_type , - - - (select dict_label from sys_dict_data - where sys_dict_data.dict_type = #{dictionariesNameGender} and - sys_dict_data.dict_value = healthcare_os_patient_info.gender - ) AS opi_st_gender, + sys_dict_data.dict_value = healthcare_os_patient_diagnosis.patient_type ) + AS ho_pd_st_patient_type , (select dict_label from sys_dict_data @@ -188,21 +185,20 @@ where healthcare_os_prescription_details.patient_diagnosis_id = healthcare_os_patient_diagnosis.id ) AS opi_st_total_price from healthcare_os_patient_diagnosis - left join healthcare_os_patient_info - on healthcare_os_patient_diagnosis.patient_id = healthcare_os_patient_info.id and healthcare_os_patient_diagnosis.status = #{status} and healthcare_os_patient_diagnosis.name = #{name} and healthcare_os_patient_diagnosis.diagnosis = #{diagnosis} and healthcare_os_patient_diagnosis.student_id = #{studentId} and healthcare_os_patient_diagnosis.doctor_name = #{doctorName} - and is_insured = #{isInsured} + and CAST(healthcare_os_patient_diagnosis.is_insured AS SIGNED) = CAST(#{isInsured} AS SIGNED) and student_id like concat('%', #{studentId}, '%') and name like concat('%', #{name}, '%') and doctor_name like concat('%', #{doctorName}, '%') and diagnosis = #{diagnosis} - AND healthcare_os_patient_diagnosis.outpatient_time BETWEEN #{startTime} AND #{endTime} + AND healthcare_os_patient_diagnosis.outpatient_time >= #{startTime} + AND healthcare_os_patient_diagnosis.outpatient_time < date_add(#{endTime}, interval 1 day) @@ -219,16 +215,10 @@ + + + diff --git a/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareDrugArchiveMapper.xml b/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareDrugArchiveMapper.xml new file mode 100644 index 0000000..e0edcf5 --- /dev/null +++ b/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareDrugArchiveMapper.xml @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select * from healthcare_drug_archive + + + + + + + + + + insert into healthcare_drug_archive + + medicine_name, + manufacturer, + barcode, + specification, + retail_price, + is_split, + min_number, + state, + dosage_form, + dosage_unit, + volume, + volume_unit, + unit_quantity, + split_unit, + package_unit, + create_time, + create_by, + update_by, + update_time, + remark, + + + #{medicineName}, + #{manufacturer}, + #{barcode}, + #{specification}, + #{retailPrice}, + #{isSplit}, + #{minNumber}, + #{state}, + #{dosageForm}, + #{dosageUnit}, + #{volume}, + #{volumeUnit}, + #{unitQuantity}, + #{splitUnit}, + #{packageUnit}, + #{createTime}, + #{createBy}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update healthcare_drug_archive + + medicine_name = #{medicineName}, + manufacturer = #{manufacturer}, + barcode = #{barcode}, + specification = #{specification}, + retail_price = #{retailPrice}, + is_split = #{isSplit}, + min_number = #{minNumber}, + state = #{state}, + dosage_form = #{dosageForm}, + dosage_unit = #{dosageUnit}, + volume = #{volume}, + volume_unit = #{volumeUnit}, + unit_quantity = #{unitQuantity}, + split_unit = #{splitUnit}, + package_unit = #{packageUnit}, + create_time = #{createTime}, + create_by = #{createBy}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from healthcare_drug_archive where id = #{id} + + + + delete from healthcare_drug_archive where id in + + #{id} + + + + + insert into healthcare_drug_archive ( + medicine_name, + manufacturer, + barcode, + specification, + retail_price, + is_split, + min_number, + state, + dosage_form, + dosage_unit, + volume, + volume_unit, + unit_quantity, + split_unit, + package_unit, + create_time, + create_by, + update_by, + update_time, + remark + ) values + + ( + #{item.medicineName}, + #{item.manufacturer}, + #{item.barcode}, + #{item.specification}, + #{item.retailPrice}, + #{item.isSplit}, + #{item.minNumber}, + #{item.state}, + #{item.dosageForm}, + #{item.dosageUnit}, + #{item.volume}, + #{item.volumeUnit}, + #{item.unitQuantity}, + #{item.splitUnit}, + #{item.packageUnit}, + #{item.createTime}, + #{item.createBy}, + #{item.updateBy}, + #{item.updateTime}, + #{item.remark} + ) + + + + + + + + + + + diff --git a/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareDrugFilingMapper.xml b/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareDrugFilingMapper.xml new file mode 100644 index 0000000..fddd5f5 --- /dev/null +++ b/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareDrugFilingMapper.xml @@ -0,0 +1,246 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select * from healthcare_drug_filing + + + + + + + + + + + + insert into healthcare_drug_filing + + archive_id, + storeroom_id, + medicineCode, + batch, + expiryDate, + box_count, + inventoryUnit, + pack_count, + retail_price, + min_price, + create_time, + create_by, + update_by, + update_time, + remark, + + + #{archiveId}, + #{storeroomId}, + #{medicineCode}, + #{batch}, + #{expiryDate}, + #{boxCount}, + #{inventoryUnit}, + #{packCount}, + #{retailPrice}, + #{minPrice}, + #{createTime}, + #{createBy}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update healthcare_drug_filing + + archive_id = #{archiveId}, + storeroom_id = #{storeroomId}, + medicineCode = #{medicineCode}, + batch = #{batch}, + expiryDate = #{expiryDate}, + box_count = #{boxCount}, + inventoryUnit = #{inventoryUnit}, + pack_count = #{packCount}, + retail_price = #{retailPrice}, + min_price = #{minPrice}, + create_time = #{createTime}, + create_by = #{createBy}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from healthcare_drug_filing where id = #{id} + + + + delete from healthcare_drug_filing where id in + + #{id} + + + + + INSERT INTO healthcare_drug_filing ( + archive_id, + storeroom_id, + medicineCode, + batch, + expiryDate, + box_count, + pack_count, + retail_price, + min_price, + create_time, + create_by, + update_by, + update_time, + remark + ) + VALUES + + ( + #{item.archiveId}, + #{item.storeroomId}, + #{item.medicineCode}, + #{item.batch}, + #{item.expiryDate}, + #{item.boxCount}, + #{item.inventoryUnit}, + #{item.packCount}, + #{item.retailPrice}, + #{item.minPrice}, + #{item.createTime}, + #{item.createBy}, + #{item.updateBy}, + #{item.updateTime}, + #{item.remark} + ) + + + + + delete from healthcare_drug_filing where archive_id in + + #{id} + + + + + + + + + + + + + + + diff --git a/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareInventoryDrugentryMapper.xml b/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareInventoryDrugentryMapper.xml new file mode 100644 index 0000000..5f33b74 --- /dev/null +++ b/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareInventoryDrugentryMapper.xml @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select * from healthcare_inventory_drugentry + + + + + + + + + + + + + + + insert into healthcare_inventory_drugentry + + order_number, + status, + type, + variety, + tatolquantity, + amount, + entry_person, + entry_time, + create_time, + create_by, + update_by, + update_time, + remark, + + + #{orderNumber}, + #{status}, + #{type}, + #{variety}, + #{tatolquantity}, + #{amount}, + #{entryPerson}, + #{entryTime}, + #{createTime}, + #{createBy}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update healthcare_inventory_drugentry + + order_number = #{orderNumber}, + status = #{status}, + type = #{type}, + variety = #{variety}, + tatolquantity = #{tatolquantity}, + amount = #{amount}, + entry_person = #{entryPerson}, + entry_time = #{entryTime}, + create_time = #{createTime}, + create_by = #{createBy}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from healthcare_inventory_drugentry where id = #{id} + + + + delete from healthcare_inventory_drugentry where id in + + #{id} + + + + + delete from healthcare_inventory_drugentry_details where entry_record_id in + + #{entryRecordId} + + + + + delete from healthcare_inventory_drugentry_details where entry_record_id = #{entryRecordId} + + + + insert into healthcare_inventory_drugentry_details + (entry_record_id, drug_archive_id,drug_filing_id, storeroom_id,batch, price, quantity, detail_amount, expiry_date, create_time, create_by, update_by, update_time, remark) + values + + ( + #{item.entryRecordId, jdbcType=INTEGER}, + #{item.drugArchiveId, jdbcType=INTEGER}, + #{item.drugFilingId, jdbcType=INTEGER}, + #{item.storeroomId, jdbcType=INTEGER}, + #{item.batch, jdbcType=VARCHAR}, + #{item.price, jdbcType=DECIMAL}, + #{item.quantity, jdbcType=INTEGER}, + #{item.detailAmount, jdbcType=DECIMAL}, + + #{item.expiryDate, jdbcType=TIMESTAMP}, + + + NULL, + + #{item.createTime, jdbcType=TIMESTAMP}, + #{item.createBy, jdbcType=VARCHAR}, + #{item.updateBy, jdbcType=VARCHAR}, + #{item.updateTime, jdbcType=TIMESTAMP}, + + #{item.remark, jdbcType=VARCHAR} + + + NULL + + ) + + + \ No newline at end of file diff --git a/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareInventoryDrugoutMapper.xml b/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareInventoryDrugoutMapper.xml new file mode 100644 index 0000000..4a6752f --- /dev/null +++ b/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareInventoryDrugoutMapper.xml @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, out_code, out_status, out_type, variety, out_quantity, affiliation, out_Point, out_Person, out_Time, create_time, create_by, update_by, update_time, remark from healthcare_inventory_drugout + + + + + + + + + + insert into healthcare_inventory_drugout + + out_code, + out_status, + out_type, + variety, + out_quantity, + + affiliation, + out_Point, + out_Person, + out_Time, + create_time, + create_by, + update_by, + update_time, + remark, + + + #{outCode}, + #{outStatus}, + #{outType}, + #{variety}, + #{outQuantity}, + + #{affiliation}, + #{outPoint}, + #{outPerson}, + #{outTime}, + #{createTime}, + #{createBy}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update healthcare_inventory_drugout + + out_code = #{outCode}, + out_status = #{outStatus}, + out_type = #{outType}, + variety = #{variety}, + out_quantity = #{outQuantity}, + + affiliation = #{affiliation}, + out_Point = #{outPoint}, + out_Person = #{outPerson}, + out_Time = #{outTime}, + create_time = #{createTime}, + create_by = #{createBy}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from healthcare_inventory_drugout where id = #{id} + + + + delete from healthcare_inventory_drugout where id in + + #{id} + + + + + delete from healthcare_inventory_drugout_details where drug_out_id in + + #{drugOutId} + + + + + delete from healthcare_inventory_drugout_details where drug_out_id = #{drugOutId} + + + + insert into healthcare_inventory_drugout_details( + id, + drug_out_id, + drug_id, + filing_id, + out_point_id, + unit, + unit_type, + unit_quantity, + expiry_date, + out_batch, + remainingQuantity, + quantity, + create_time, + create_by, + update_by, + update_time, + remark + ) values + + ( + #{item.id}, + #{item.drugOutId}, + #{item.drugId}, + #{item.filingId}, + #{item.outPointId}, + #{item.unit}, + #{item.unitType}, + #{item.unitQuantity}, + #{item.expiryDate}, + #{item.outBatch}, + #{item.remainingQuantity}, + #{item.quantity}, + #{item.createTime}, + #{item.createBy}, + #{item.updateBy}, + #{item.updateTime}, + #{item.remark} + ) + + + diff --git a/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareInventoryDrugoutTypeMapper.xml b/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareInventoryDrugoutTypeMapper.xml new file mode 100644 index 0000000..332963d --- /dev/null +++ b/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareInventoryDrugoutTypeMapper.xml @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select out_type_id, drug_out_id, inbound_location, signee, proof_material, purpose_details, unit, expiration_date, current_datetime, destroyer, destruction_location, destruction_process, scrap_reason, disposal_method, damage_reason, create_time, create_by, update_by, update_time, remark from healthcare_inventory_drugout_type + + + + + + + + + + + insert into healthcare_inventory_drugout_type + + drug_out_id, + inbound_location, + signee, + proof_material, + purpose_details, + unit, + expiration_date, + current_datetime, + destroyer, + destruction_location, + destruction_process, + scrap_reason, + disposal_method, + damage_reason, + create_time, + create_by, + update_by, + update_time, + remark, + + + #{drugOutId}, + #{inboundLocation}, + #{signee}, + #{proofMaterial}, + #{purposeDetails}, + #{unit}, + #{expirationDate}, + #{currentDatetime}, + #{destroyer}, + #{destructionLocation}, + #{destructionProcess}, + #{scrapReason}, + #{disposalMethod}, + #{damageReason}, + #{createTime}, + #{createBy}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update healthcare_inventory_drugout_type + + drug_out_id = #{drugOutId}, + inbound_location = #{inboundLocation}, + signee = #{signee}, + proof_material = #{proofMaterial}, + purpose_details = #{purposeDetails}, + unit = #{unit}, + expiration_date = #{expirationDate}, + current_datetime = #{currentDatetime}, + destroyer = #{destroyer}, + destruction_location = #{destructionLocation}, + destruction_process = #{destructionProcess}, + scrap_reason = #{scrapReason}, + disposal_method = #{disposalMethod}, + damage_reason = #{damageReason}, + create_time = #{createTime}, + create_by = #{createBy}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where out_type_id = #{outTypeId} + + + + delete from healthcare_inventory_drugout_type where out_type_id = #{outTypeId} + + + + delete from healthcare_inventory_drugout_type where out_type_id in + + #{outTypeId} + + + + + \ No newline at end of file diff --git a/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareInventoryStoreroomMapper.xml b/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareInventoryStoreroomMapper.xml new file mode 100644 index 0000000..a70912c --- /dev/null +++ b/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareInventoryStoreroomMapper.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + select id, storeroom_name, location, admin_userid, remarks, created_at, updated_at from healthcare_inventory_storeroom + + + + + + + + insert into healthcare_inventory_storeroom + + storeroom_name, + location, + admin_userid, + remarks, + created_at, + updated_at, + + + #{storeroomName}, + #{location}, + #{adminUserid}, + #{remarks}, + #{createdAt}, + #{updatedAt}, + + + + + update healthcare_inventory_storeroom + + storeroom_name = #{storeroomName}, + location = #{location}, + admin_userid = #{adminUserid}, + remarks = #{remarks}, + created_at = #{createdAt}, + updated_at = #{updatedAt}, + + where id = #{id} + + + + delete from healthcare_inventory_storeroom where id = #{id} + + + + delete from healthcare_inventory_storeroom where id in + + #{id} + + + + + + + \ No newline at end of file diff --git a/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareInventoryWarehouseSelectionMapper.xml b/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareInventoryWarehouseSelectionMapper.xml new file mode 100644 index 0000000..4882e03 --- /dev/null +++ b/pasd-healthcare/target/classes/com/ruoyi/inventory/mapper/HealthcareInventoryWarehouseSelectionMapper.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + select id, user_id, user_name, storeroom_id, storeroom_name, create_by, create_time, update_by, update_time from healthcare_inventory_warehouse_selection + + + + + + + + insert into healthcare_inventory_warehouse_selection + + user_id, + user_name, + storeroom_id, + storeroom_name, + create_by, + create_time, + update_by, + update_time, + + + #{userId}, + #{userName}, + #{storeroomId}, + #{storeroomName}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update healthcare_inventory_warehouse_selection + + user_id = #{userId}, + user_name = #{userName}, + storeroom_id = #{storeroomId}, + storeroom_name = #{storeroomName}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from healthcare_inventory_warehouse_selection where id = #{id} + + + + delete from healthcare_inventory_warehouse_selection where id in + + #{id} + + + diff --git a/pasd-healthcare/target/classes/com/ruoyi/os/mapper/DrugArchiveMapper.xml b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/DrugArchiveMapper.xml new file mode 100644 index 0000000..ea78857 --- /dev/null +++ b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/DrugArchiveMapper.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, medicine_name, manufacturer, barcode, specification, retail_price, + is_split, state, dosage_form, dosage_unit, volume, volume_unit, + unit_quantity, split_unit, package_unit, min_number, + create_by, create_time, update_by, update_time, remark + from healthcare_drug_archive + + + + + + insert into healthcare_drug_archive + + medicine_name, + manufacturer, + barcode, + specification, + retail_price, + is_split, + state, + dosage_form, + dosage_unit, + volume, + volume_unit, + unit_quantity, + split_unit, + package_unit, + min_number, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{medicineName}, + #{manufacturer}, + #{barcode}, + #{specification}, + #{retailPrice}, + #{isSplit}, + #{state}, + #{dosageForm}, + #{dosageUnit}, + #{volume}, + #{volumeUnit}, + #{unitQuantity}, + #{splitUnit}, + #{packageUnit}, + #{minNumber}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update healthcare_drug_archive + + medicine_name = #{medicineName}, + manufacturer = #{manufacturer}, + barcode = #{barcode}, + specification = #{specification}, + retail_price = #{retailPrice}, + is_split = #{isSplit}, + state = #{state}, + dosage_form = #{dosageForm}, + dosage_unit = #{dosageUnit}, + volume = #{volume}, + volume_unit = #{volumeUnit}, + unit_quantity = #{unitQuantity}, + split_unit = #{splitUnit}, + package_unit = #{packageUnit}, + min_number = #{minNumber}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from healthcare_drug_archive where id = #{id} + + + + delete from healthcare_drug_archive where id in + + #{id} + + + \ No newline at end of file diff --git a/pasd-healthcare/target/classes/com/ruoyi/os/mapper/DrugArchivesVoMapper.xml b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/DrugArchivesVoMapper.xml new file mode 100644 index 0000000..e1b0fdb --- /dev/null +++ b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/DrugArchivesVoMapper.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + healthcare_drug_filing.id df_id , healthcare_drug_filing.archive_id df_archive_id , healthcare_drug_filing.storeroom_id df_storeroom_id , healthcare_drug_filing.medicineCode df_medicineCode , + healthcare_drug_filing.batch df_batch , healthcare_drug_filing.expiryDate df_expiryDate , healthcare_drug_filing.box_count df_box_count , + healthcare_drug_filing.inventoryUnit df_inventoryUnit , healthcare_drug_filing.pack_count df_pack_count , healthcare_drug_filing.retail_price df_retail_price , + healthcare_drug_filing.min_price df_min_price , healthcare_drug_filing.create_time df_create_time , + healthcare_drug_filing.create_by df_create_by , healthcare_drug_filing.update_by df_update_by , healthcare_drug_filing.update_time df_update_time , + healthcare_drug_filing.remark df_remark + + + + + healthcare_drug_archive.id da_id , healthcare_drug_archive.medicine_name da_medicine_name , healthcare_drug_archive.manufacturer da_manufacturer , + healthcare_drug_archive.barcode da_barcode , healthcare_drug_archive.specification da_specification , healthcare_drug_archive.retail_price da_retail_price , + healthcare_drug_archive.is_split da_is_split , healthcare_drug_archive.min_number da_min_number , healthcare_drug_archive.state da_state , + healthcare_drug_archive.dosage_form da_dosage_form , healthcare_drug_archive.dosage_unit da_dosage_unit , healthcare_drug_archive.volume da_volume , + healthcare_drug_archive.volume_unit da_volume_unit , healthcare_drug_archive.unit_quantity da_unit_quantity , healthcare_drug_archive.split_unit da_split_unit , + healthcare_drug_archive.package_unit da_package_unit , healthcare_drug_archive.create_time da_create_time , healthcare_drug_archive.create_by da_create_by , + healthcare_drug_archive.update_by da_update_by , healthcare_drug_archive.update_time da_update_time , healthcare_drug_archive.remark da_remark + + + + + healthcare_inventory_storeroom.id is_id , healthcare_inventory_storeroom.storeroom_name is_storeroom_name , healthcare_inventory_storeroom.location is_location , + healthcare_inventory_storeroom.admin_userid is_admin_userid ,healthcare_inventory_storeroom.remarks is_remarks , healthcare_inventory_storeroom.created_at is_created_at , + healthcare_inventory_storeroom.updated_at is_updated_at + + + + + diff --git a/pasd-healthcare/target/classes/com/ruoyi/os/mapper/DrugFilingMapper.xml b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/DrugFilingMapper.xml new file mode 100644 index 0000000..776591f --- /dev/null +++ b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/DrugFilingMapper.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select id, archive_id, storeroom_id, medicineCode, batch, expiryDate, + box_count, inventoryUnit, pack_count, retail_price, min_price, + create_by, create_time, update_by, update_time, remark + from healthcare_drug_filing + + + + + + + + insert into healthcare_drug_filing + + archive_id, + storeroom_id, + medicineCode, + batch, + expiryDate, + box_count, + inventoryUnit, + pack_count, + retail_price, + min_price, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{archiveId}, + #{storeroomId}, + #{medicineCode}, + #{batch}, + #{expiryDate}, + #{boxCount}, + #{inventoryUnit}, + #{packCount}, + #{retailPrice}, + #{minPrice}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update healthcare_drug_filing + + archive_id = #{archiveId}, + storeroom_id = #{storeroomId}, + medicineCode = #{medicineCode}, + batch = #{batch}, + expiryDate = #{expiryDate}, + box_count = #{boxCount}, + inventoryUnit = #{inventoryUnit}, + pack_count = #{packCount}, + retail_price = #{retailPrice}, + min_price = #{minPrice}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from healthcare_drug_filing where id = #{id} + + + + delete from healthcare_drug_filing where archive_id = #{archiveId} + + \ No newline at end of file diff --git a/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsComplaintsMapper.xml b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsComplaintsMapper.xml new file mode 100644 index 0000000..391beaa --- /dev/null +++ b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsComplaintsMapper.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + select id, complaint_name, current_history, past_history, diagnosis, medical_advice, create_by, create_time, update_by, update_time from healthcare_os_complaints + + + + + + + + insert into healthcare_os_complaints + + complaint_name, + current_history, + past_history, + diagnosis, + medical_advice, + create_by, + create_time, + update_by, + update_time, + + + #{complaintName}, + #{currentHistory}, + #{pastHistory}, + #{diagnosis}, + #{medicalAdvice}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update healthcare_os_complaints + + complaint_name = #{complaintName}, + current_history = #{currentHistory}, + past_history = #{pastHistory}, + diagnosis = #{diagnosis}, + medical_advice = #{medicalAdvice}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from healthcare_os_complaints where id = #{id} + + + + delete from healthcare_os_complaints where id in + + #{id} + + + diff --git a/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsConventionalDrugMapper.xml b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsConventionalDrugMapper.xml new file mode 100644 index 0000000..3702447 --- /dev/null +++ b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsConventionalDrugMapper.xml @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, conventional_prescription_id, medicine_name , specification, usage_value, dosage_value, frequency, eating_time, eating_days,split_unit ,total_quantity,is_split , unit_quantity , package_unit ,remarks, create_by, create_time, update_by, update_time from healthcare_os_conventional_drug + + + + + + + + insert into healthcare_os_conventional_drug + + conventional_prescription_id, + medicine_name, + specification, + usage_value, + dosage_value, + frequency, + eating_time, + eating_days, + split_unit, + total_quantity, + is_split, + unit_quantity, + package_unit, + remarks, + create_by, + create_time, + update_by, + update_time, + + + #{conventionalPrescriptionId}, + #{medicineName}, + #{specification}, + #{usageValue}, + #{dosageValue}, + #{frequency}, + #{eatingTime}, + #{eatingDays}, + #{splitUnit}, + #{totalQuantity}, + #{isSplit}, + #{unitQuantity}, + #{packageUnit}, + #{remarks}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update healthcare_os_conventional_drug + + conventional_prescription_id = #{conventionalPrescriptionId}, + medicine_name = #{medicineName}, + specification = #{specification}, + usage_value = #{usageValue}, + dosage_value = #{dosageValue}, + frequency = #{frequency}, + eating_time = #{eatingTime}, + eating_days = #{eatingDays}, + split_unit = #{splitUnit}, + total_quantity = #{totalQuantity}, + is_split = #{isSplit}, + unit_quantity = #{unitQuantity}, + package_unit = #{packageUnit}, + remarks = #{remarks}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from healthcare_os_conventional_drug where id = #{id} + + + + delete from healthcare_os_conventional_drug where id in + + #{id} + + + diff --git a/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsConventionalPrescriptionsMapper.xml b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsConventionalPrescriptionsMapper.xml new file mode 100644 index 0000000..4337279 --- /dev/null +++ b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsConventionalPrescriptionsMapper.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + select id, prescription_name, `function`, indication, medical_advice, create_by, create_time, update_by, update_time from healthcare_os_conventional_prescriptions + + + + + + + + insert into healthcare_os_conventional_prescriptions + + prescription_name, + `function`, + indication, + medical_advice, + create_by, + create_time, + update_by, + update_time, + + + #{prescriptionName}, + #{function}, + #{indication}, + #{medicalAdvice}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update healthcare_os_conventional_prescriptions + + prescription_name = #{prescriptionName}, + `function` = #{function}, + indication = #{indication}, + medical_advice = #{medicalAdvice}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from healthcare_os_conventional_prescriptions where id = #{id} + + + + delete from healthcare_os_conventional_prescriptions where id in + + #{id} + + + diff --git a/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsConventionalValueMapper.xml b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsConventionalValueMapper.xml new file mode 100644 index 0000000..0221eae --- /dev/null +++ b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsConventionalValueMapper.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + select id, parent_id, dict_name, name, value, is_linkage, create_by, create_time, update_by, update_time from healthcare_os_conventional_value + + + + + + + + insert into healthcare_os_conventional_value + + parent_id, + dict_name, + name, + value, + is_linkage, + create_by, + create_time, + update_by, + update_time, + + + #{parentId}, + #{dictName}, + #{name}, + #{value}, + #{isLinkage}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update healthcare_os_conventional_value + + parent_id = #{parentId}, + dict_name = #{dictName}, + name = #{name}, + value = #{value}, + is_linkage = #{isLinkage}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from healthcare_os_conventional_value where id = #{id} + + + + delete from healthcare_os_conventional_value where id in + + #{id} + + + diff --git a/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsPatientDiagnosisMapper.xml b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsPatientDiagnosisMapper.xml new file mode 100644 index 0000000..92e8104 --- /dev/null +++ b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsPatientDiagnosisMapper.xml @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, patient_id, diagnosis_type, is_insured,AES_DECRYPT(UNHEX(id_card),'zhxg') as id_card ,value, student_id, name, + patient_type, chief_complaint, present_illness, past_history, diagnosis, medical_advice, doctor_name, status , outpatient_time ,storeroom_id , storeroom_name , create_by, create_time, update_by, update_time from healthcare_os_patient_diagnosis + + + + + + + + insert into healthcare_os_patient_diagnosis + + patient_id, + diagnosis_type, + is_insured, + value, + student_id, + name, + patient_type, + chief_complaint, + present_illness, + past_history, + diagnosis, + medical_advice, + doctor_name, + status, + outpatient_time, + storeroom_id , + storeroom_name , + create_by, + create_time, + update_by, + update_time, + id_card, + + + #{patientId}, + #{diagnosisType}, + #{isInsured}, + #{value}, + #{studentId}, + #{name}, + #{patientType}, + #{chiefComplaint}, + #{presentIllness}, + #{pastHistory}, + #{diagnosis}, + #{medicalAdvice}, + #{doctorName}, + #{status}, + #{outpatientTime}, + #{storeroomId}, + #{storeroomName}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + HEX(AES_ENCRYPT(#{idCard},'zhxg')) , + + + + + update healthcare_os_patient_diagnosis + + patient_id = #{patientId}, + diagnosis_type = #{diagnosisType}, + is_insured = #{isInsured}, + value = #{value}, + student_id = #{studentId}, + name = #{name}, + patient_type = #{patientType}, + chief_complaint = #{chiefComplaint}, + present_illness = #{presentIllness}, + past_history = #{pastHistory}, + diagnosis = #{diagnosis}, + medical_advice = #{medicalAdvice}, + doctor_name = #{doctorName}, + status = #{status}, + outpatient_time = #{outpatientTime}, + storeroom_id = #{storeroomId}, + storeroom_name = #{storeroomName}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + id_card = HEX(AES_ENCRYPT(#{idCard},'zhxg')) , + + where id = #{id} + + + + delete from healthcare_os_patient_diagnosis where id = #{id} + + + + delete from healthcare_os_patient_diagnosis where id in + + #{id} + + + + + UPDATE healthcare_os_patient_diagnosis pd + JOIN healthcare_os_patient_info pi ON pd.student_id = pi.student_id + SET pd.patient_id = pi.id + WHERE pd.patient_id IS NULL; + + + + update healthcare_os_patient_diagnosis hpd + join sys_user su on hpd.doctor_name = su.user_name COLLATE utf8mb4_unicode_ci + set hpd.doctor_name = su.nick_name where hpd.doctor_name COLLATE utf8mb4_unicode_ci is not null; + + + diff --git a/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsPatientInfoMapper.xml b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsPatientInfoMapper.xml new file mode 100644 index 0000000..a49353b --- /dev/null +++ b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsPatientInfoMapper.xml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select id, patient_type, student_id,AES_DECRYPT(UNHEX(id_card),'zhxg') as id_card , name, gender, age, major, class_info, phone, counselor, department, create_by, create_time, update_by, update_time from healthcare_os_patient_info + + + + + + + + + + insert into healthcare_os_patient_info + + patient_type, + student_id, + name, + gender, + age, + major, + class_info, + phone, + counselor, + department, + create_by, + create_time, + update_by, + update_time, + id_card, + + + #{patientType}, + #{studentId}, + #{name}, + #{gender}, + #{age}, + #{major}, + #{classInfo}, + #{phone}, + #{counselor}, + #{department}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + HEX(AES_ENCRYPT(#{idCard},'zhxg')) , + + + + + update healthcare_os_patient_info + + patient_type = #{patientType}, + student_id = #{studentId}, + name = #{name}, + gender = #{gender}, + age = #{age}, + major = #{major}, + class_info = #{classInfo}, + phone = #{phone}, + counselor = #{counselor}, + department = #{department}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + id_card = HEX(AES_ENCRYPT(#{idCard},'zhxg')) , + + where id = #{id} + + + + delete from healthcare_os_patient_info where id = #{id} + + + + + + delete from healthcare_os_patient_info where id in + + #{id} + + + diff --git a/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsPrescriptionDetailsMapper.xml b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsPrescriptionDetailsMapper.xml new file mode 100644 index 0000000..4880198 --- /dev/null +++ b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/HealthcareOsPrescriptionDetailsMapper.xml @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, patient_diagnosis_id, singular, medicine_id , medicine_name, specification , usage_value, dosage_value, frequency, eating_time, + eating_days , split_unit, total_quantity, unit_price , total_price ,is_split ,unit_quantity , package_unit , remarks , create_by, + create_time, update_by, update_time,batch,expiry_date from healthcare_os_prescription_details + + + + + + + + + + insert into healthcare_os_prescription_details + + patient_diagnosis_id, + singular, + medicine_id, + medicine_name, + specification, + usage_value, + dosage_value, + frequency, + eating_time, + eating_days, + split_unit, + total_quantity, + unit_price, + total_price, + is_split, + unit_quantity, + package_unit, + remarks, + create_by, + create_time, + update_by, + update_time, + batch, + expiry_date, + + + #{patientDiagnosisId}, + #{singular}, + #{medicineId}, + #{medicineName}, + #{specification}, + #{usageValue}, + #{dosageValue}, + #{frequency}, + #{eatingTime}, + #{eatingDays}, + #{splitUnit}, + #{totalQuantity}, + CAST(ROUND(#{unitPrice}, 2) AS DECIMAL(10, 2)), + CAST(ROUND(#{totalPrice}, 2) AS DECIMAL(10, 2)), + #{isSplit}, + #{unitQuantity}, + #{packageUnit}, + #{remarks}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{batch}, + #{expiryDate}, + + + + + update healthcare_os_prescription_details + + patient_diagnosis_id = #{patientDiagnosisId}, + singular = #{singular}, + medicine_id = #{medicineId}, + medicine_name = #{medicineName}, + specification = #{specification}, + usage_value = #{usageValue}, + dosage_value = #{dosageValue}, + frequency = #{frequency}, + eating_time = #{eatingTime}, + eating_days = #{eatingDays}, + split_unit = #{splitUnit}, + total_quantity = #{totalQuantity}, + unit_price = #{unitPrice}, + total_price = #{totalPrice}, + is_split = #{isSplit}, + unit_quantity = #{unitQuantity}, + package_unit = #{packageUnit}, + remarks = #{remarks}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + batch = #{batch}, + expiry_date = #{expiryDate}, + + where id = #{id} + + + + delete from healthcare_os_prescription_details where id = #{id} + + + + delete from healthcare_os_prescription_details where + + and patient_diagnosis_id = #{patientDiagnosisId} + and singular = #{singular} + and medicine_id = #{medicineId} + and medicine_name = #{medicineName} + and specification = #{specification} + and usage_value = #{usageValue} + and dosage_value = #{dosageValue} + and frequency = #{frequency} + and eating_time = #{eatingTime} + and eating_days = #{eatingDays} + and split_unit = #{splitUnit} + and total_quantity = #{totalQuantity} + and unit_price = #{unitPrice} + and total_price = #{totalPrice} + and is_split = #{isSplit} + and unit_qantity = #{unitQuantity} + and package_unit = #{packageUnit} + and remarks = #{remarks} + and batch = #{batch} + and expiry_date = #{expiryDate} + + + + + delete from healthcare_os_prescription_details where id in + + #{id} + + + diff --git a/pasd-healthcare/target/classes/com/ruoyi/os/mapper/OsStatisticsMapper.xml b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/OsStatisticsMapper.xml new file mode 100644 index 0000000..1b4eff7 --- /dev/null +++ b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/OsStatisticsMapper.xml @@ -0,0 +1,319 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + healthcare_os_patient_info.id AS opi_id, + healthcare_os_patient_info.patient_type AS opi_patient_type, + healthcare_os_patient_info.student_id AS opi_student_id, + healthcare_os_patient_info.name AS opi_name, + healthcare_os_patient_info.gender AS opi_gender, + healthcare_os_patient_info.age AS opi_age, + healthcare_os_patient_info.major AS opi_major, + healthcare_os_patient_info.class_info AS opi_class_info, + healthcare_os_patient_info.phone AS opi_phone, + healthcare_os_patient_info.counselor AS opi_counselor, + healthcare_os_patient_info.department AS opi_department, + healthcare_os_patient_info.create_by AS opi_create_by, + healthcare_os_patient_info.create_time AS opi_create_time, + healthcare_os_patient_info.update_by AS opi_update_by, + healthcare_os_patient_info.update_time AS opi_update_time + + + + + healthcare_os_prescription_details.id AS opd_id, + healthcare_os_prescription_details.patient_diagnosis_id AS opd_patient_diagnosis_id, + healthcare_os_prescription_details.singular AS opd_singular, + healthcare_os_prescription_details.medicine_id AS opd_medicine_id, + healthcare_os_prescription_details.medicine_name AS opd_medicine_name, + healthcare_os_prescription_details.specification AS opd_specification, + healthcare_os_prescription_details.usage_value AS opd_usage_value, + healthcare_os_prescription_details.dosage_value AS opd_dosage_value, + healthcare_os_prescription_details.frequency AS opd_frequency, + healthcare_os_prescription_details.eating_time AS opd_eating_time, + healthcare_os_prescription_details.eating_days AS opd_eating_days, + healthcare_os_prescription_details.split_unit AS opd_split_unit, + healthcare_os_prescription_details.total_quantity AS opd_total_quantity, + healthcare_os_prescription_details.unit_price AS opd_unit_price, + healthcare_os_prescription_details.total_price AS opd_total_price, + healthcare_os_prescription_details.is_split AS opd_is_split, + healthcare_os_prescription_details.unit_quantity AS opd_unit_quantity, + healthcare_os_prescription_details.package_unit AS opd_package_unit, + healthcare_os_prescription_details.remarks AS opd_remarks, + healthcare_os_prescription_details.create_by AS opd_create_by, + healthcare_os_prescription_details.create_time AS opd_create_time, + healthcare_os_prescription_details.update_by AS opd_update_by, + healthcare_os_prescription_details.update_time AS opd_update_time + + + + + healthcare_os_patient_diagnosis.id AS ho_pd_id, + healthcare_os_patient_diagnosis.patient_id AS ho_pd_patient_id, + healthcare_os_patient_diagnosis.diagnosis_type AS ho_pd_diagnosis_type, + healthcare_os_patient_diagnosis.is_insured AS ho_pd_is_insured, + healthcare_os_patient_diagnosis.value AS ho_pd_value, + healthcare_os_patient_diagnosis.student_id AS ho_pd_student_id, + healthcare_os_patient_diagnosis.name AS ho_pd_name, + healthcare_os_patient_diagnosis.patient_type AS ho_pd_patient_type, + healthcare_os_patient_diagnosis.chief_complaint AS ho_pd_chief_complaint, + healthcare_os_patient_diagnosis.present_illness AS ho_pd_present_illness, + healthcare_os_patient_diagnosis.past_history AS ho_pd_past_history, + healthcare_os_patient_diagnosis.diagnosis AS ho_pd_diagnosis, + healthcare_os_patient_diagnosis.medical_advice AS ho_pd_medical_advice, + healthcare_os_patient_diagnosis.doctor_name AS ho_pd_doctor_name, + healthcare_os_patient_diagnosis.status AS ho_pd_status, + healthcare_os_patient_diagnosis.outpatient_time AS ho_pd_outpatient_time, + healthcare_os_patient_diagnosis.create_by AS ho_pd_create_by, + healthcare_os_patient_diagnosis.create_time AS ho_pd_create_time, + healthcare_os_patient_diagnosis.update_by AS ho_pd_update_by, + healthcare_os_patient_diagnosis.update_time AS ho_pd_update_time, + AES_DECRYPT(UNHEX(healthcare_os_patient_diagnosis.id_card),'zhxg') AS ho_pd_id_card, + healthcare_os_patient_diagnosis.storeroom_name AS ho_pd_storeroom_name + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pasd-healthcare/target/classes/com/ruoyi/os/mapper/StudentInfoMapper.xml b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/StudentInfoMapper.xml new file mode 100644 index 0000000..0c2c6ba --- /dev/null +++ b/pasd-healthcare/target/classes/com/ruoyi/os/mapper/StudentInfoMapper.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + select stu_id, stu_no, stu_name, gender, major_name, class_name, teacher_name , dept_name,id_card from view_stu_info + + + + + + + + + + + + diff --git a/pasd-healthcare/target/classes/mapper/os/PatientInsuranceInfoMapper.xml b/pasd-healthcare/target/classes/mapper/os/PatientInsuranceInfoMapper.xml new file mode 100644 index 0000000..5a2c2d2 --- /dev/null +++ b/pasd-healthcare/target/classes/mapper/os/PatientInsuranceInfoMapper.xml @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, personal_id, id_type, id_number, name, birthdate, gender, contact_phone, mobile_phone, registered_address, residential_address, payment_district, payment_district_name, township_street, community_village_school, unit_id, unit_name, personal_payment_amount, financial_subsidy_amount, total_amount, payment_time, payment_year, payer_category from patient_insurance_info + + + + + + + + insert into patient_insurance_info + + personal_id, + id_type, + id_number, + name, + birthdate, + gender, + contact_phone, + mobile_phone, + registered_address, + residential_address, + payment_district, + payment_district_name, + township_street, + community_village_school, + unit_id, + unit_name, + personal_payment_amount, + financial_subsidy_amount, + total_amount, + payment_time, + payment_year, + payer_category, + + + #{personalId}, + #{idType}, + #{idNumber}, + #{name}, + #{birthdate}, + #{gender}, + #{contactPhone}, + #{mobilePhone}, + #{registeredAddress}, + #{residentialAddress}, + #{paymentDistrict}, + #{paymentDistrictName}, + #{townshipStreet}, + #{communityVillageSchool}, + #{unitId}, + #{unitName}, + #{personalPaymentAmount}, + #{financialSubsidyAmount}, + #{totalAmount}, + #{paymentTime}, + #{paymentYear}, + #{payerCategory}, + + + + + INSERT INTO patient_insurance_info ( + personal_id, + id_type, + id_number, + name, + birthdate, + gender, + contact_phone, + mobile_phone, + registered_address, + residential_address, + payment_district, + payment_district_name, + township_street, + community_village_school, + unit_id, + unit_name, + personal_payment_amount, + financial_subsidy_amount, + total_amount, + payment_time, + payment_year, + payer_category + ) VALUES + + ( + #{item.personalId}, + #{item.idType}, + #{item.idNumber}, + #{item.name}, + #{item.birthdate}, + #{item.gender}, + #{item.contactPhone}, + #{item.mobilePhone}, + #{item.registeredAddress}, + #{item.residentialAddress}, + #{item.paymentDistrict}, + #{item.paymentDistrictName}, + #{item.townshipStreet}, + #{item.communityVillageSchool}, + #{item.unitId}, + #{item.unitName}, + #{item.personalPaymentAmount}, + #{item.financialSubsidyAmount}, + #{item.totalAmount}, + #{item.paymentTime}, + #{item.paymentYear}, + #{item.payerCategory} + ) + + + + + update patient_insurance_info + + personal_id = #{personalId}, + id_type = #{idType}, + id_number = #{idNumber}, + name = #{name}, + birthdate = #{birthdate}, + gender = #{gender}, + contact_phone = #{contactPhone}, + mobile_phone = #{mobilePhone}, + registered_address = #{registeredAddress}, + residential_address = #{residentialAddress}, + payment_district = #{paymentDistrict}, + payment_district_name = #{paymentDistrictName}, + township_street = #{townshipStreet}, + community_village_school = #{communityVillageSchool}, + unit_id = #{unitId}, + unit_name = #{unitName}, + personal_payment_amount = #{personalPaymentAmount}, + financial_subsidy_amount = #{financialSubsidyAmount}, + total_amount = #{totalAmount}, + payment_time = #{paymentTime}, + payment_year = #{paymentYear}, + payer_category = #{payerCategory}, + + where id = #{id} + + + + delete from patient_insurance_info where id = #{id} + + + + delete from patient_insurance_info where id in + + #{id} + + + \ No newline at end of file diff --git a/pasd-healthcare/target/classes/mybatis-config.xml b/pasd-healthcare/target/classes/mybatis-config.xml new file mode 100644 index 0000000..08fecdf --- /dev/null +++ b/pasd-healthcare/target/classes/mybatis-config.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/pasd-healthcare/target/maven-archiver/pom.properties b/pasd-healthcare/target/maven-archiver/pom.properties new file mode 100644 index 0000000..226615e --- /dev/null +++ b/pasd-healthcare/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=pasd-healthcare +groupId=com.ruoyi +version=3.8.8 diff --git a/pasd-healthcare/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/pasd-healthcare/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..83ec0d2 --- /dev/null +++ b/pasd-healthcare/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,94 @@ +com\ruoyi\os\service\impl\HealthcareOsPatientInfoServiceImpl.class +com\ruoyi\os\service\IHealthcareOsPatientInfoService.class +com\ruoyi\os\mapper\PatientInsuranceInfoMapper.class +com\ruoyi\inventory\controller\HealthcareInventoryDrugoutTypeController.class +com\ruoyi\inventory\domain\HealthcareInventoryDrugentry.class +com\ruoyi\os\service\impl\PatientInsuranceInfoServiceImpl.class +com\ruoyi\inventory\service\IHealthcareDrugArchiveService.class +com\ruoyi\inventory\service\impl\HealthcareInventoryDrugoutTypeServiceImpl.class +com\ruoyi\inventory\mapper\HealthcareInventoryWarehouseSelectionMapper.class +com\ruoyi\inventory\service\IHealthcareDrugFilingService.class +com\ruoyi\os\mapper\DrugFilingMapper.class +com\ruoyi\inventory\mapper\HealthcareInventoryStoreroomMapper.class +com\ruoyi\os\mapper\OsStatisticsMapper.class +com\ruoyi\os\domain\CountDiagnosisVO.class +com\ruoyi\inventory\service\impl\HealthcareInventoryDrugoutServiceImpl.class +com\ruoyi\inventory\service\IHealthcareInventoryDrugoutService.class +com\ruoyi\os\mapper\TeachingStaffInfoMapper.class +com\ruoyi\os\service\IPatientDiagnosisService.class +com\ruoyi\os\domain\StudentInfo.class +com\ruoyi\inventory\service\IHealthcareInventoryDrugentryService.class +com\ruoyi\os\domain\HealthcareOsConventionalValue.class +com\ruoyi\os\mapper\HealthcareOsConventionalPrescriptionsMapper.class +com\ruoyi\os\service\IDrugFilingService.class +com\ruoyi\inventory\service\IHealthcareInventoryDrugoutTypeService.class +com\ruoyi\os\mapper\StudentInfoMapper.class +com\ruoyi\inventory\service\IHealthcareInventoryWarehouseSelectionService.class +com\ruoyi\os\controller\DrugFilingController.class +com\ruoyi\inventory\controller\HealthcareInventoryDrugentryController.class +com\ruoyi\inventory\domain\HealthcareInventoryDrugentryDetails.class +com\ruoyi\os\service\impl\PatientDiagnosisServiceImpl.class +com\ruoyi\os\service\IHealthcareOsConventionalValueService.class +com\ruoyi\os\controller\HealthcareOsPatientInfoController.class +com\ruoyi\os\mapper\HealthcareOsConventionalValueMapper.class +com\ruoyi\inventory\mapper\HealthcareDrugFilingMapper.class +com\ruoyi\os\controller\HealthcareOsComplaintsController.class +com\ruoyi\inventory\domain\HealthcareInventoryWarehouseSelection.class +com\ruoyi\os\domain\HealthcareOsPatientInfo.class +com\ruoyi\os\controller\DrugArchiveController.class +com\ruoyi\os\mapper\DrugArchivesVoMapper.class +com\ruoyi\inventory\controller\HealthcareInventoryDrugoutController.class +com\ruoyi\os\mapper\HealthcareOsPatientDiagnosisMapper.class +com\ruoyi\os\domain\HealthcareOsPatientDiagnosis.class +com\ruoyi\os\service\impl\HealthcareOsComplaintsServiceImpl.class +com\ruoyi\inventory\domain\HealthcareDrugArchiveExportVo.class +com\ruoyi\os\mapper\HealthcareOsComplaintsMapper.class +com\ruoyi\os\controller\PatientInsuranceInfoController.class +com\ruoyi\inventory\domain\HealthcareInventoryDrugout.class +com\ruoyi\os\controller\ConventionalPrescriptionsController.class +com\ruoyi\os\mapper\DrugArchiveMapper.class +com\ruoyi\inventory\mapper\HealthcareInventoryDrugentryMapper.class +com\ruoyi\os\controller\PatientDiagnosisController.class +com\ruoyi\inventory\domain\HealthcareDrugFiling.class +com\ruoyi\os\domain\HealthcareOsPrescriptionDetails.class +com\ruoyi\inventory\domain\HealthcareDrugArchive.class +com\ruoyi\os\service\impl\DrugFilingServiceImpl.class +com\ruoyi\os\service\IPatientInsuranceInfoService.class +com\ruoyi\inventory\service\impl\HealthcareDrugArchiveServiceImpl.class +com\ruoyi\os\service\IConventionalPrescriptionsService.class +com\ruoyi\os\domain\HealthcareOsConventionalDrug.class +com\ruoyi\inventory\domain\PmVo.class +com\ruoyi\os\domain\DrugArchive.class +com\ruoyi\os\domain\DrugArchivesVO.class +com\ruoyi\os\domain\TeachingStaffInfo.class +com\ruoyi\inventory\service\impl\HealthcareDrugFilingServiceImpl.class +com\ruoyi\os\service\IHealthcareOsComplaintsService.class +com\ruoyi\inventory\domain\charVo.class +com\ruoyi\inventory\service\impl\HealthcareInventoryWarehouseSelectionServiceImpl.class +com\ruoyi\inventory\mapper\HealthcareDrugArchiveMapper.class +com\ruoyi\inventory\service\impl\HealthcareInventoryStoreroomServiceImpl.class +com\ruoyi\inventory\controller\HealthcareInventoryStoreroomController.class +com\ruoyi\os\service\impl\HealthcareOsConventionalValueServiceImpl.class +com\ruoyi\os\mapper\HealthcareOsPrescriptionDetailsMapper.class +com\ruoyi\inventory\controller\HealthcareDrugFilingController.class +com\ruoyi\os\controller\HealthcareOsConventionalValueController.class +com\ruoyi\os\domain\HealthcareOsComplaints.class +com\ruoyi\os\service\impl\ConventionalPrescriptionsServiceImpl.class +com\ruoyi\os\service\impl\DrugArchiveServiceImpl.class +com\ruoyi\inventory\service\impl\HealthcareInventoryDrugentryServiceImpl.class +com\ruoyi\inventory\mapper\HealthcareInventoryDrugoutMapper.class +com\ruoyi\inventory\controller\HealthcareDrugArchiveController.class +com\ruoyi\os\domain\PatientInsuranceInfo.class +com\ruoyi\inventory\controller\HealthcareInventoryWarehouseSelectionController.class +com\ruoyi\os\domain\PatientMedicalRecordsYesVO.class +com\ruoyi\os\service\IDrugArchiveService.class +com\ruoyi\inventory\mapper\HealthcareInventoryDrugoutTypeMapper.class +com\ruoyi\os\domain\PatientMedicalRecordsVO.class +com\ruoyi\os\domain\HealthcareOsConventionalPrescriptions.class +com\ruoyi\inventory\service\IHealthcareInventoryStoreroomService.class +com\ruoyi\os\mapper\HealthcareOsPatientInfoMapper.class +com\ruoyi\inventory\domain\HealthcareInventoryDrugoutType.class +com\ruoyi\inventory\domain\HealthcareInventoryStoreroom.class +com\ruoyi\os\mapper\HealthcareOsConventionalDrugMapper.class +com\ruoyi\inventory\domain\HealthcareInventoryDrugoutDetails.class +com\ruoyi\os\domain\DrugFiling.class diff --git a/pasd-healthcare/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/pasd-healthcare/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..8c5485d --- /dev/null +++ b/pasd-healthcare/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,94 @@ +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\service\IHealthcareInventoryDrugoutTypeService.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\service\IPatientDiagnosisService.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\service\IHealthcareInventoryStoreroomService.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\controller\HealthcareOsComplaintsController.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\domain\CountDiagnosisVO.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\service\impl\HealthcareOsComplaintsServiceImpl.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\mapper\HealthcareOsPrescriptionDetailsMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\mapper\OsStatisticsMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\mapper\HealthcareInventoryDrugoutTypeMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\domain\HealthcareOsConventionalPrescriptions.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\service\IHealthcareDrugFilingService.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\domain\HealthcareInventoryDrugout.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\mapper\HealthcareInventoryDrugoutMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\service\IPatientInsuranceInfoService.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\domain\PmVo.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\service\impl\DrugFilingServiceImpl.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\service\IConventionalPrescriptionsService.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\mapper\HealthcareInventoryWarehouseSelectionMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\controller\DrugFilingController.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\service\impl\ConventionalPrescriptionsServiceImpl.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\domain\HealthcareOsPatientDiagnosis.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\controller\HealthcareDrugArchiveController.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\controller\HealthcareDrugFilingController.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\controller\HealthcareInventoryDrugoutTypeController.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\controller\HealthcareInventoryDrugoutController.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\domain\DrugFiling.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\controller\HealthcareInventoryDrugentryController.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\domain\HealthcareOsComplaints.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\domain\HealthcareInventoryDrugentryDetails.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\mapper\HealthcareInventoryStoreroomMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\mapper\HealthcareOsConventionalPrescriptionsMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\service\impl\IDrugArchiveService.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\service\IHealthcareOsComplaintsService.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\service\impl\HealthcareInventoryDrugoutServiceImpl.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\service\impl\HealthcareOsConventionalValueServiceImpl.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\mapper\HealthcareOsPatientDiagnosisMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\service\impl\PatientDiagnosisServiceImpl.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\domain\charVo.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\controller\PatientDiagnosisController.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\service\IHealthcareInventoryDrugentryService.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\service\impl\HealthcareInventoryDrugoutTypeServiceImpl.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\mapper\HealthcareDrugFilingMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\mapper\HealthcareOsComplaintsMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\domain\HealthcareInventoryWarehouseSelection.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\controller\HealthcareOsPatientInfoController.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\service\IHealthcareInventoryDrugoutService.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\domain\HealthcareDrugFiling.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\service\IHealthcareOsConventionalValueService.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\service\impl\HealthcareInventoryWarehouseSelectionServiceImpl.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\domain\HealthcareOsConventionalValue.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\service\IHealthcareInventoryWarehouseSelectionService.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\mapper\HealthcareInventoryDrugentryMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\domain\PatientInsuranceInfo.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\mapper\DrugArchivesVoMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\mapper\HealthcareOsConventionalValueMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\domain\StudentInfo.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\domain\HealthcareDrugArchive.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\service\impl\HealthcareDrugArchiveServiceImpl.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\service\IHealthcareOsPatientInfoService.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\controller\HealthcareInventoryStoreroomController.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\domain\HealthcareInventoryDrugentry.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\domain\TeachingStaffInfo.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\domain\HealthcareOsConventionalDrug.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\domain\HealthcareDrugArchiveExportVo.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\domain\HealthcareInventoryDrugoutType.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\mapper\HealthcareOsPatientInfoMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\mapper\DrugFilingMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\service\impl\HealthcareDrugFilingServiceImpl.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\controller\HealthcareInventoryWarehouseSelectionController.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\domain\HealthcareOsPrescriptionDetails.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\controller\DrugArchiveController.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\domain\HealthcareInventoryStoreroom.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\controller\PatientInsuranceInfoController.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\service\impl\IDrugFilingService.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\domain\DrugArchivesVO.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\mapper\DrugArchiveMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\service\impl\HealthcareInventoryDrugentryServiceImpl.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\domain\PatientMedicalRecordsVO.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\mapper\HealthcareDrugArchiveMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\controller\ConventionalPrescriptionsController.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\service\impl\PatientInsuranceInfoServiceImpl.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\service\impl\HealthcareInventoryStoreroomServiceImpl.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\mapper\TeachingStaffInfoMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\controller\HealthcareOsConventionalValueController.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\domain\HealthcareInventoryDrugoutDetails.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\inventory\service\IHealthcareDrugArchiveService.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\mapper\PatientInsuranceInfoMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\domain\DrugArchive.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\mapper\StudentInfoMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\service\impl\HealthcareOsPatientInfoServiceImpl.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\service\impl\DrugArchiveServiceImpl.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\domain\PatientMedicalRecordsYesVO.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\mapper\HealthcareOsConventionalDrugMapper.java +D:\code\pasd_V1.0\pasd_java\pasd-healthcare\src\main\java\com\ruoyi\os\domain\HealthcareOsPatientInfo.java diff --git a/pasd-inspection/pom.xml b/pasd-inspection/pom.xml index 8f32ca9..4cd5e97 100644 --- a/pasd-inspection/pom.xml +++ b/pasd-inspection/pom.xml @@ -20,10 +20,6 @@ org.projectlombok lombok - - org.projectlombok - lombok - com.ruoyi ruoyi-system diff --git a/pasd-inspection/src/main/java/com/ruoyi/inspection/controller/AttendanceReportController.java b/pasd-inspection/src/main/java/com/ruoyi/inspection/controller/AttendanceReportController.java index efc20c7..a0d08f8 100644 --- a/pasd-inspection/src/main/java/com/ruoyi/inspection/controller/AttendanceReportController.java +++ b/pasd-inspection/src/main/java/com/ruoyi/inspection/controller/AttendanceReportController.java @@ -1,14 +1,15 @@ package com.ruoyi.inspection.controller; -import com.beust.ah.A; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.inspection.domain.InspectionManageTable; import com.ruoyi.inspection.domain.VoAttendanceReport; import com.ruoyi.inspection.service.IAttendanceReportService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; import java.util.Map; import static com.ruoyi.common.utils.PageUtils.startPage; @@ -60,4 +61,74 @@ public class AttendanceReportController extends BaseController { int monthTotal = attendanceReportService.monthTota(voAttendanceReport); return AjaxResult.success(monthTotal); } + + // 按天趋势统计 + @GetMapping("/trendDaily") + public AjaxResult trendDaily(VoAttendanceReport voAttendanceReport) { + Map data = attendanceReportService.trendDaily(voAttendanceReport); + return AjaxResult.success("data", data); + } + + // 按天双序列 + @GetMapping("/trendDailyDual") + public AjaxResult trendDailyDual(VoAttendanceReport voAttendanceReport) { + Map data = attendanceReportService.trendDailyDual(voAttendanceReport); + return AjaxResult.success("data", data); + } + + // 巡检类型占比 + @GetMapping("/typeProportion") + public AjaxResult typeProportion(VoAttendanceReport voAttendanceReport) { + Map data = attendanceReportService.typeProportion(voAttendanceReport); + return AjaxResult.success("data", data); + } + + // 覆盖率统计 + @GetMapping("/coverage") + public AjaxResult coverage(VoAttendanceReport voAttendanceReport) { + Map data = attendanceReportService.coverage(voAttendanceReport); + return AjaxResult.success("data", data); + } + + // 未巡检点清单 + @GetMapping("/uninspectedPoints") + public AjaxResult uninspectedPoints(VoAttendanceReport voAttendanceReport) { + List list = attendanceReportService.listUninspectedPoints(voAttendanceReport); + return AjaxResult.success(list); + } + + // 点位类型对应的已巡检点数量(distinct) + @GetMapping("/pointTypeCounts") + public AjaxResult pointTypeCounts(VoAttendanceReport voAttendanceReport) { + Map data = attendanceReportService.pointTypeCounts(voAttendanceReport); + return AjaxResult.success("data", data); + } + + // 管理表点位状态分布 + @GetMapping("/statusDistribution") + public AjaxResult statusDistribution() { + Map data = attendanceReportService.statusDistribution(); + return AjaxResult.success("data", data); + } + + // 按月双序列 + @GetMapping("/trendMonthlyDual") + public AjaxResult trendMonthlyDual(VoAttendanceReport voAttendanceReport) { + Map data = attendanceReportService.trendMonthlyDual(voAttendanceReport); + return AjaxResult.success("data", data); + } + + // 巡检人统计(三合一:总/月/日) + @GetMapping("/inspectorStats3") + public AjaxResult inspectorStats3(VoAttendanceReport voAttendanceReport) { + Map data = attendanceReportService.inspectorStats3(voAttendanceReport); + return AjaxResult.success("data", data); + } + + // 巡检点统计(三合一:总/月/日) + @GetMapping("/pointStats3") + public AjaxResult pointStats3(VoAttendanceReport voAttendanceReport) { + Map data = attendanceReportService.pointStats3(voAttendanceReport); + return AjaxResult.success("data", data); + } } diff --git a/pasd-inspection/src/main/java/com/ruoyi/inspection/controller/InspectionAbnormalController.java b/pasd-inspection/src/main/java/com/ruoyi/inspection/controller/InspectionAbnormalController.java new file mode 100644 index 0000000..fe74e3b --- /dev/null +++ b/pasd-inspection/src/main/java/com/ruoyi/inspection/controller/InspectionAbnormalController.java @@ -0,0 +1,98 @@ +package com.ruoyi.inspection.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.inspection.domain.InspectionAbnormal; +import com.ruoyi.inspection.service.IInspectionAbnormalService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 巡检异常Controller + * + * @author LSD + * @date 2025-10-24 + */ +@RestController +@RequestMapping("/inspection/abnormal") +public class InspectionAbnormalController extends BaseController { + @Autowired + private IInspectionAbnormalService inspectionAbnormalService; + + /** + * 查询巡检异常列表 + */ + @PreAuthorize("@ss.hasPermi('inspection:abnormal:list')") + @GetMapping("/list") + public TableDataInfo list(InspectionAbnormal inspectionAbnormal) { + startPage(); + List list = inspectionAbnormalService.selectInspectionAbnormalList(inspectionAbnormal); + return getDataTable(list); + } + + /** + * 导出巡检异常列表 + */ + @PreAuthorize("@ss.hasPermi('inspection:abnormal:export')") + @Log(title = "巡检异常", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, InspectionAbnormal inspectionAbnormal) { + List list = inspectionAbnormalService.selectInspectionAbnormalList(inspectionAbnormal); + ExcelUtil util = new ExcelUtil(InspectionAbnormal.class); + util.exportExcel(response, list, "巡检异常数据"); + } + + /** + * 获取巡检异常详细信息 + */ + @PreAuthorize("@ss.hasPermi('inspection:abnormal:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return success(inspectionAbnormalService.selectInspectionAbnormalById(id)); + } + + /** + * 新增巡检异常 + */ + @PreAuthorize("@ss.hasPermi('inspection:abnormal:add')") + @Log(title = "巡检异常", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody InspectionAbnormal inspectionAbnormal) { + return toAjax(inspectionAbnormalService.insertInspectionAbnormal(inspectionAbnormal)); + } + + /** + * 修改巡检异常 + */ + @PreAuthorize("@ss.hasPermi('inspection:abnormal:edit')") + @Log(title = "巡检异常", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody InspectionAbnormal inspectionAbnormal) { + return toAjax(inspectionAbnormalService.updateInspectionAbnormal(inspectionAbnormal)); + } + + /** + * 删除巡检异常 + */ + @PreAuthorize("@ss.hasPermi('inspection:abnormal:remove')") + @Log(title = "巡检异常", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(inspectionAbnormalService.deleteInspectionAbnormalByIds(ids)); + } +} diff --git a/pasd-inspection/src/main/java/com/ruoyi/inspection/domain/InspectionAbnormal.java b/pasd-inspection/src/main/java/com/ruoyi/inspection/domain/InspectionAbnormal.java new file mode 100644 index 0000000..749a2df --- /dev/null +++ b/pasd-inspection/src/main/java/com/ruoyi/inspection/domain/InspectionAbnormal.java @@ -0,0 +1,116 @@ +package com.ruoyi.inspection.domain; + +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 巡检异常对象 inspection_abnormal + * + * @author LSD + * @date 2025-10-24 + */ +public class InspectionAbnormal extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * id + */ + private Long id; + + /** + * 巡检点地址 + */ + @Excel(name = "巡检点地址") + private String inspectionPoint; + + /** + * 巡检人 + */ + @Excel(name = "巡检人") + private String inspectorId; + + /** + * 巡检类型 + */ + @Excel(name = "巡检类型") + private Long inspectionType; + + /** + * 巡检时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "巡检时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date inspectionTime; + + /** + * 巡检图片 + */ + @Excel(name = "巡检图片") + private String inspectionImg; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setInspectionPoint(String inspectionPoint) { + this.inspectionPoint = inspectionPoint; + } + + public String getInspectionPoint() { + return inspectionPoint; + } + + public void setInspectorId(String inspectorId) { + this.inspectorId = inspectorId; + } + + public String getInspectorId() { + return inspectorId; + } + + public void setInspectionType(Long inspectionType) { + this.inspectionType = inspectionType; + } + + public Long getInspectionType() { + return inspectionType; + } + + public void setInspectionTime(Date inspectionTime) { + this.inspectionTime = inspectionTime; + } + + public Date getInspectionTime() { + return inspectionTime; + } + + public void setInspectionImg(String inspectionImg) { + this.inspectionImg = inspectionImg; + } + + public String getInspectionImg() { + return inspectionImg; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("inspectionPoint", getInspectionPoint()) + .append("inspectorId", getInspectorId()) + .append("inspectionType", getInspectionType()) + .append("inspectionTime", getInspectionTime()) + .append("inspectionImg", getInspectionImg()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/pasd-inspection/src/main/java/com/ruoyi/inspection/domain/InspectionManageTable.java b/pasd-inspection/src/main/java/com/ruoyi/inspection/domain/InspectionManageTable.java index ac28d80..0b8fa75 100644 --- a/pasd-inspection/src/main/java/com/ruoyi/inspection/domain/InspectionManageTable.java +++ b/pasd-inspection/src/main/java/com/ruoyi/inspection/domain/InspectionManageTable.java @@ -8,7 +8,7 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 巡检点管理对象 inspection_manage_table - * + * * @author ruoyi * @date 2024-08-29 */ @@ -32,6 +32,9 @@ public class InspectionManageTable extends BaseEntity @Excel(name = "巡检点状态") private String inspectionStatus; + /** 巡检点类型 */ + @Excel(name = "巡检点类型", dictType = "inspection_point_type") + private String inspectionPointType; private int inspectionCount; @@ -46,52 +49,62 @@ public class InspectionManageTable extends BaseEntity /** 巡检二维码 */ private String inspectionQrCode; - public void setId(Long id) + public void setId(Long id) { this.id = id; } - public Long getId() + public Long getId() { return id; } - public void setInspectionPoint(String inspectionPoint) + public void setInspectionPoint(String inspectionPoint) { this.inspectionPoint = inspectionPoint; } - public String getInspectionPoint() + public String getInspectionPoint() { return inspectionPoint; } - public void setInspectionRequirements(String inspectionRequirements) + public void setInspectionRequirements(String inspectionRequirements) { this.inspectionRequirements = inspectionRequirements; } - public String getInspectionRequirements() + public String getInspectionRequirements() { return inspectionRequirements; } - public void setInspectionStatus(String inspectionStatus) + public void setInspectionStatus(String inspectionStatus) { this.inspectionStatus = inspectionStatus; } - public String getInspectionStatus() + public String getInspectionStatus() { return inspectionStatus; } - public void setInspectionQrCode(String inspectionQrCode) + public void setInspectionQrCode(String inspectionQrCode) { this.inspectionQrCode = inspectionQrCode; } - public String getInspectionQrCode() + public String getInspectionQrCode() { return inspectionQrCode; } + public void setInspectionPointType(String inspectionPointType) + { + this.inspectionPointType = inspectionPointType; + } + + public String getInspectionPointType() + { + return inspectionPointType; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -99,6 +112,7 @@ public class InspectionManageTable extends BaseEntity .append("inspectionPoint", getInspectionPoint()) .append("inspectionRequirements", getInspectionRequirements()) .append("inspectionStatus", getInspectionStatus()) + .append("inspectionPointType", getInspectionPointType()) .append("inspectionQrCode", getInspectionQrCode()) .toString(); } diff --git a/pasd-inspection/src/main/java/com/ruoyi/inspection/domain/VoAttendanceReport.java b/pasd-inspection/src/main/java/com/ruoyi/inspection/domain/VoAttendanceReport.java index 4dabec0..d429d43 100644 --- a/pasd-inspection/src/main/java/com/ruoyi/inspection/domain/VoAttendanceReport.java +++ b/pasd-inspection/src/main/java/com/ruoyi/inspection/domain/VoAttendanceReport.java @@ -29,6 +29,11 @@ public class VoAttendanceReport { @Excel(name = "巡检人") private String inspectorId; + /** + * 巡检类型 + */ + private Integer inspectionType; + /** * 开始时间 */ diff --git a/pasd-inspection/src/main/java/com/ruoyi/inspection/mapper/AttendanceReportMapper.java b/pasd-inspection/src/main/java/com/ruoyi/inspection/mapper/AttendanceReportMapper.java index 8160607..2db2bbd 100644 --- a/pasd-inspection/src/main/java/com/ruoyi/inspection/mapper/AttendanceReportMapper.java +++ b/pasd-inspection/src/main/java/com/ruoyi/inspection/mapper/AttendanceReportMapper.java @@ -4,6 +4,8 @@ import com.ruoyi.inspection.domain.InspectionRecordTable; import com.ruoyi.inspection.domain.VoAttendanceReport; import java.util.List; +import java.util.Map; +import com.ruoyi.inspection.domain.InspectionManageTable; public interface AttendanceReportMapper { @@ -15,4 +17,40 @@ public interface AttendanceReportMapper { int total(); List monthTotal(VoAttendanceReport voAttendanceReport); + + // 按天趋势统计(返回date与count) + List> trendDaily(VoAttendanceReport voAttendanceReport); + + // 新增:按日双序列(distinct点位数 与 总次数) + List> trendDailyDual(VoAttendanceReport voAttendanceReport); + + // 巡检类型占比统计 + List typeProportion(VoAttendanceReport voAttendanceReport); + + // 期间已巡检点数量(distinct pointId) + int inspectedPointCount(VoAttendanceReport voAttendanceReport); + + // 管理表总点位数 + int totalManagePointCount(); + + // 期间未巡检点位清单 + List uninspectedPoints(VoAttendanceReport voAttendanceReport); + + // 点位类型对应的已巡检点数量(distinct) + List> pointTypeCounts(VoAttendanceReport voAttendanceReport); + + // 点位状态分布(管理表) + List> statusDistribution(); + + // 新增:按月双序列(distinct点位数 与 总次数) + List> trendMonthlyDual(VoAttendanceReport voAttendanceReport); + + // 巡检人分布:总计/本月/本日 + List inspectorStatsTotal(VoAttendanceReport voAttendanceReport); + List inspectorStatsMonth(VoAttendanceReport voAttendanceReport); + List inspectorStatsDay(VoAttendanceReport voAttendanceReport); + + // 新增:巡检点分布(本月/本日) + List pointStatsMonth(VoAttendanceReport voAttendanceReport); + List pointStatsDay(VoAttendanceReport voAttendanceReport); } diff --git a/pasd-inspection/src/main/java/com/ruoyi/inspection/mapper/InspectionAbnormalMapper.java b/pasd-inspection/src/main/java/com/ruoyi/inspection/mapper/InspectionAbnormalMapper.java new file mode 100644 index 0000000..2d80200 --- /dev/null +++ b/pasd-inspection/src/main/java/com/ruoyi/inspection/mapper/InspectionAbnormalMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.inspection.mapper; + +import java.util.List; + +import com.ruoyi.inspection.domain.InspectionAbnormal; + +/** + * 巡检异常Mapper接口 + * + * @author LSD + * @date 2025-10-24 + */ +public interface InspectionAbnormalMapper { + /** + * 查询巡检异常 + * + * @param id 巡检异常主键 + * @return 巡检异常 + */ + public InspectionAbnormal selectInspectionAbnormalById(Long id); + + /** + * 查询巡检异常列表 + * + * @param inspectionAbnormal 巡检异常 + * @return 巡检异常集合 + */ + public List selectInspectionAbnormalList(InspectionAbnormal inspectionAbnormal); + + /** + * 新增巡检异常 + * + * @param inspectionAbnormal 巡检异常 + * @return 结果 + */ + public int insertInspectionAbnormal(InspectionAbnormal inspectionAbnormal); + + /** + * 修改巡检异常 + * + * @param inspectionAbnormal 巡检异常 + * @return 结果 + */ + public int updateInspectionAbnormal(InspectionAbnormal inspectionAbnormal); + + /** + * 删除巡检异常 + * + * @param id 巡检异常主键 + * @return 结果 + */ + public int deleteInspectionAbnormalById(Long id); + + /** + * 批量删除巡检异常 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteInspectionAbnormalByIds(Long[] ids); +} diff --git a/pasd-inspection/src/main/java/com/ruoyi/inspection/mapper/InspectionRecordTableMapper.java b/pasd-inspection/src/main/java/com/ruoyi/inspection/mapper/InspectionRecordTableMapper.java index b101b4a..750d501 100644 --- a/pasd-inspection/src/main/java/com/ruoyi/inspection/mapper/InspectionRecordTableMapper.java +++ b/pasd-inspection/src/main/java/com/ruoyi/inspection/mapper/InspectionRecordTableMapper.java @@ -1,20 +1,20 @@ package com.ruoyi.inspection.mapper; import java.util.List; + import com.ruoyi.inspection.domain.InspectionRecordTable; import com.ruoyi.inspection.domain.VoViewInspectionRecordTable; /** * 巡检记录Mapper接口 - * + * * @author ruoyi * @date 2024-09-05 */ -public interface InspectionRecordTableMapper -{ +public interface InspectionRecordTableMapper { /** * 查询巡检记录 - * + * * @param id 巡检记录主键 * @return 巡检记录 */ @@ -22,7 +22,7 @@ public interface InspectionRecordTableMapper /** * 查询巡检记录列表 - * + * * @param inspectionRecordTable 巡检记录 * @return 巡检记录集合 */ @@ -30,7 +30,7 @@ public interface InspectionRecordTableMapper /** * 新增巡检记录 - * + * * @param inspectionRecordTable 巡检记录 * @return 结果 */ @@ -38,7 +38,7 @@ public interface InspectionRecordTableMapper /** * 修改巡检记录 - * + * * @param inspectionRecordTable 巡检记录 * @return 结果 */ @@ -46,7 +46,7 @@ public interface InspectionRecordTableMapper /** * 删除巡检记录 - * + * * @param id 巡检记录主键 * @return 结果 */ @@ -54,18 +54,17 @@ public interface InspectionRecordTableMapper /** * 批量删除巡检记录 - * + * * @param ids 需要删除的数据主键集合 * @return 结果 */ public int deleteInspectionRecordTableByIds(Long[] ids); // 查询巡检记录视图列表 - public ListselectInspectionRecordViewList(VoViewInspectionRecordTable voViewInspectionRecordTable); + public List selectInspectionRecordViewList(VoViewInspectionRecordTable voViewInspectionRecordTable); // 查询巡检记录视图数量 public int selectInspectionRecordViewCount(VoViewInspectionRecordTable voViewInspectionRecordTable); - } diff --git a/pasd-inspection/src/main/java/com/ruoyi/inspection/service/IAttendanceReportService.java b/pasd-inspection/src/main/java/com/ruoyi/inspection/service/IAttendanceReportService.java index 6fb103a..cfb2727 100644 --- a/pasd-inspection/src/main/java/com/ruoyi/inspection/service/IAttendanceReportService.java +++ b/pasd-inspection/src/main/java/com/ruoyi/inspection/service/IAttendanceReportService.java @@ -5,6 +5,7 @@ import com.ruoyi.inspection.domain.VoAttendanceReport; import java.util.List; import java.util.Map; +import com.ruoyi.inspection.domain.InspectionManageTable; public interface IAttendanceReportService { // 可视化柱形图 @@ -18,4 +19,31 @@ public interface IAttendanceReportService { int tatol(); int monthTota(VoAttendanceReport voAttendanceReport); + + // 新增统计:按天趋势 + Map trendDaily(VoAttendanceReport voAttendanceReport); + Map trendDailyDual(VoAttendanceReport voAttendanceReport); + + // 新增统计:类型占比 + Map typeProportion(VoAttendanceReport voAttendanceReport); + + // 新增统计:覆盖率(返回 inspectedCount/totalCount 和覆盖率) + Map coverage(VoAttendanceReport voAttendanceReport); + + // 未巡检点位清单 + List listUninspectedPoints(VoAttendanceReport voAttendanceReport); + + // 点位类型对应的已巡检点数量(distinct) + Map pointTypeCounts(VoAttendanceReport voAttendanceReport); + + // 管理表点位状态分布 + Map statusDistribution(); + + Map trendMonthlyDual(VoAttendanceReport voAttendanceReport); + + // 巡检人统计(三合一:总/月/日) + Map inspectorStats3(VoAttendanceReport voAttendanceReport); + + // 巡检点统计(三合一:总/月/日) + Map pointStats3(VoAttendanceReport voAttendanceReport); } diff --git a/pasd-inspection/src/main/java/com/ruoyi/inspection/service/IInspectionAbnormalService.java b/pasd-inspection/src/main/java/com/ruoyi/inspection/service/IInspectionAbnormalService.java new file mode 100644 index 0000000..b10c6c6 --- /dev/null +++ b/pasd-inspection/src/main/java/com/ruoyi/inspection/service/IInspectionAbnormalService.java @@ -0,0 +1,61 @@ +package com.ruoyi.inspection.service; + +import java.util.List; + +import com.ruoyi.inspection.domain.InspectionAbnormal; + +/** + * 巡检异常Service接口 + * + * @author LSD + * @date 2025-10-24 + */ +public interface IInspectionAbnormalService { + /** + * 查询巡检异常 + * + * @param id 巡检异常主键 + * @return 巡检异常 + */ + public InspectionAbnormal selectInspectionAbnormalById(Long id); + + /** + * 查询巡检异常列表 + * + * @param inspectionAbnormal 巡检异常 + * @return 巡检异常集合 + */ + public List selectInspectionAbnormalList(InspectionAbnormal inspectionAbnormal); + + /** + * 新增巡检异常 + * + * @param inspectionAbnormal 巡检异常 + * @return 结果 + */ + public int insertInspectionAbnormal(InspectionAbnormal inspectionAbnormal); + + /** + * 修改巡检异常 + * + * @param inspectionAbnormal 巡检异常 + * @return 结果 + */ + public int updateInspectionAbnormal(InspectionAbnormal inspectionAbnormal); + + /** + * 批量删除巡检异常 + * + * @param ids 需要删除的巡检异常主键集合 + * @return 结果 + */ + public int deleteInspectionAbnormalByIds(Long[] ids); + + /** + * 删除巡检异常信息 + * + * @param id 巡检异常主键 + * @return 结果 + */ + public int deleteInspectionAbnormalById(Long id); +} diff --git a/pasd-inspection/src/main/java/com/ruoyi/inspection/service/impl/AttendanceReportService.java b/pasd-inspection/src/main/java/com/ruoyi/inspection/service/impl/AttendanceReportService.java index b054287..a5a99be 100644 --- a/pasd-inspection/src/main/java/com/ruoyi/inspection/service/impl/AttendanceReportService.java +++ b/pasd-inspection/src/main/java/com/ruoyi/inspection/service/impl/AttendanceReportService.java @@ -1,6 +1,7 @@ package com.ruoyi.inspection.service.impl; import com.ruoyi.inspection.domain.InspectionRecordTable; +import com.ruoyi.inspection.domain.InspectionManageTable; import com.ruoyi.inspection.domain.VoAttendanceReport; import com.ruoyi.inspection.mapper.AttendanceReportMapper; import com.ruoyi.inspection.service.IAttendanceReportService; @@ -124,8 +125,226 @@ public class AttendanceReportService implements IAttendanceReportService { for (VoAttendanceReport T : list){ monthTotal += T.getCount(); } - return monthTotal+1; + return monthTotal; } + // 按天趋势统计,返回 ECharts 折线图所需的 xAxis(date) 与 seriesData(count) + @Override + public Map trendDaily(VoAttendanceReport voAttendanceReport) { + ensureDefaultRange(voAttendanceReport); + List> raw = attendanceReportMapper.trendDaily(voAttendanceReport); + List xAxis = new ArrayList<>(); + List seriesData = new ArrayList<>(); + for (Map row : raw) { + xAxis.add(String.valueOf(row.get("stat_date"))); + Object c = row.get("cnt"); + seriesData.add(c == null ? 0 : Integer.parseInt(String.valueOf(c))); + } + Map result = new HashMap<>(); + result.put("xAxis", xAxis); + result.put("seriesData", seriesData); + return result; + } + + // 按天双序列(distinct点位数 与 总次数) + @Override + public Map trendDailyDual(VoAttendanceReport voAttendanceReport) { + List> raw = attendanceReportMapper.trendDailyDual(voAttendanceReport); + List xAxis = new ArrayList<>(); + List seriesPoint = new ArrayList<>(); + List seriesUser = new ArrayList<>(); + for (Map row : raw) { + xAxis.add(String.valueOf(row.get("stat_date"))); + Object pc = row.get("point_cnt"); + Object ic = row.get("inspect_cnt"); + seriesPoint.add(pc == null ? 0 : Integer.parseInt(String.valueOf(pc))); + seriesUser.add(ic == null ? 0 : Integer.parseInt(String.valueOf(ic))); + } + Map result = new HashMap<>(); + result.put("xAxis", xAxis); + result.put("seriesPoint", seriesPoint); + result.put("seriesUser", seriesUser); + return result; + } + + // 巡检类型占比 + @Override + public Map typeProportion(VoAttendanceReport voAttendanceReport) { + ensureDefaultRange(voAttendanceReport); + List list = attendanceReportMapper.typeProportion(voAttendanceReport); + List> seriesData = new ArrayList<>(); + for (VoAttendanceReport item : list) { + Map d = new HashMap<>(); + d.put("name", item.getInspectionType()); + d.put("value", item.getCount()); + seriesData.add(d); + } + Map result = new HashMap<>(); + result.put("seriesData", seriesData); + return result; + } + + // 覆盖率(期间已巡检点数量 / 管理表总点位数),以及分子分母 + @Override + public Map coverage(VoAttendanceReport voAttendanceReport) { + ensureDefaultRange(voAttendanceReport); + int inspected = attendanceReportMapper.inspectedPointCount(voAttendanceReport); + int total = attendanceReportMapper.totalManagePointCount(); + double rate = total == 0 ? 0.0 : (inspected * 1.0 / total); + Map result = new HashMap<>(); + result.put("inspectedCount", inspected); + result.put("totalCount", total); + result.put("coverageRate", rate); + return result; + } + + // 未巡检点清单 + @Override + public List listUninspectedPoints(VoAttendanceReport voAttendanceReport) { + ensureDefaultRange(voAttendanceReport); + return attendanceReportMapper.uninspectedPoints(voAttendanceReport); + } + + // 点位类型对应的已巡检点数量(distinct) + @Override + public Map pointTypeCounts(VoAttendanceReport voAttendanceReport) { + ensureDefaultRange(voAttendanceReport); + List> raw = attendanceReportMapper.pointTypeCounts(voAttendanceReport); + List xAxis = new ArrayList<>(); + List seriesData = new ArrayList<>(); + for (Map row : raw) { + xAxis.add(String.valueOf(row.get("type"))); + Object c = row.get("cnt"); + seriesData.add(c == null ? 0 : Integer.parseInt(String.valueOf(c))); + } + Map result = new HashMap<>(); + result.put("xAxis", xAxis); + result.put("seriesData", seriesData); + return result; + } + + // 管理表点位状态分布 + @Override + public Map statusDistribution() { + List> raw = attendanceReportMapper.statusDistribution(); + List> seriesData = new ArrayList<>(); + for (Map row : raw) { + Map d = new HashMap<>(); + d.put("name", row.get("status")); + d.put("value", row.get("cnt")); + seriesData.add(d); + } + Map result = new HashMap<>(); + result.put("seriesData", seriesData); + return result; + } + + // 按月双序列(distinct点位数 与 总次数) + @Override + public Map trendMonthlyDual(VoAttendanceReport voAttendanceReport) { + List> raw = attendanceReportMapper.trendMonthlyDual(voAttendanceReport); + List xAxis = new ArrayList<>(); + List seriesPoint = new ArrayList<>(); + List seriesUser = new ArrayList<>(); + for (Map row : raw) { + xAxis.add(String.valueOf(row.get("stat_month"))); + Object pc = row.get("point_cnt"); + Object ic = row.get("inspect_cnt"); + seriesPoint.add(pc == null ? 0 : Integer.parseInt(String.valueOf(pc))); + seriesUser.add(ic == null ? 0 : Integer.parseInt(String.valueOf(ic))); + } + Map result = new HashMap<>(); + result.put("xAxis", xAxis); + result.put("seriesPoint", seriesPoint); + result.put("seriesUser", seriesUser); + return result; + } + + // 巡检人统计(三合一:总/月/日) + @Override + public Map inspectorStats3(VoAttendanceReport voAttendanceReport) { + // total + List totalList = attendanceReportMapper.inspectorStatsTotal(voAttendanceReport); + List> totalSeries = new ArrayList<>(); + for (VoAttendanceReport item : totalList) { + Map d = new HashMap<>(); + d.put("name", item.getInspectorId()); + d.put("value", item.getUserCount()); + totalSeries.add(d); + } + + // month (当月) + List monthList = attendanceReportMapper.inspectorStatsMonth(voAttendanceReport); + List> monthSeries = new ArrayList<>(); + for (VoAttendanceReport item : monthList) { + Map d = new HashMap<>(); + d.put("name", item.getInspectorId()); + d.put("value", item.getUserCount()); + monthSeries.add(d); + } + + // day (本日) + List dayList = attendanceReportMapper.inspectorStatsDay(voAttendanceReport); + List> daySeries = new ArrayList<>(); + for (VoAttendanceReport item : dayList) { + Map d = new HashMap<>(); + d.put("name", item.getInspectorId()); + d.put("value", item.getUserCount()); + daySeries.add(d); + } + + Map result = new HashMap<>(); + result.put("total", totalSeries); + result.put("month", monthSeries); + result.put("day", daySeries); + return result; + } + + // 巡检点统计(三合一:总/月/日),用于柱状图 + @Override + public Map pointStats3(VoAttendanceReport voAttendanceReport) { + Map out = new HashMap<>(); + + // total:使用 ColumnVisualization(不限定时间,尊重外部过滤条件) + List total = attendanceReportMapper.ColumnVisualization(voAttendanceReport); + Map t = new HashMap<>(); + List tx = new ArrayList<>(); + List ts = new ArrayList<>(); + for (VoAttendanceReport r : total) { tx.add(r.getInspectionPoint()); ts.add(r.getCount()); } + t.put("xAxis", tx); t.put("seriesData", ts); + out.put("total", t); + + // month:调用新增 SQL(当月数据),不依赖前端传参 + List month = attendanceReportMapper.pointStatsMonth(voAttendanceReport); + Map m = new HashMap<>(); + List mx = new ArrayList<>(); + List ms = new ArrayList<>(); + for (VoAttendanceReport r : month) { mx.add(r.getInspectionPoint()); ms.add(r.getCount()); } + m.put("xAxis", mx); m.put("seriesData", ms); + out.put("month", m); + + // day:调用新增 SQL(本日数据) + List day = attendanceReportMapper.pointStatsDay(voAttendanceReport); + Map d = new HashMap<>(); + List dx = new ArrayList<>(); + List ds = new ArrayList<>(); + for (VoAttendanceReport r : day) { dx.add(r.getInspectionPoint()); ds.add(r.getCount()); } + d.put("xAxis", dx); d.put("seriesData", ds); + out.put("day", d); + + return out; + } + + // 工具方法:如未传入时间范围则默认使用本月范围 + private void ensureDefaultRange(VoAttendanceReport voAttendanceReport) { + if (voAttendanceReport.getStartTime() == null || voAttendanceReport.getEndTime() == null) { + LocalDate now = LocalDate.now(); + LocalDate firstDayOfMonth = now.withDayOfMonth(1); + LocalDate lastDayOfMonth = now.withDayOfMonth(now.lengthOfMonth()); + voAttendanceReport.setDefaultStartTime(firstDayOfMonth.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); + voAttendanceReport.setDefaultEndTime(lastDayOfMonth.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); + } + } + } diff --git a/pasd-inspection/src/main/java/com/ruoyi/inspection/service/impl/InspectionAbnormalServiceImpl.java b/pasd-inspection/src/main/java/com/ruoyi/inspection/service/impl/InspectionAbnormalServiceImpl.java new file mode 100644 index 0000000..afc4fb9 --- /dev/null +++ b/pasd-inspection/src/main/java/com/ruoyi/inspection/service/impl/InspectionAbnormalServiceImpl.java @@ -0,0 +1,98 @@ +package com.ruoyi.inspection.service.impl; + +import java.util.List; + +import com.ruoyi.common.annotation.DataScope; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.inspection.mapper.InspectionAbnormalMapper; +import com.ruoyi.inspection.domain.InspectionAbnormal; +import com.ruoyi.inspection.service.IInspectionAbnormalService; + +/** + * 巡检异常Service业务层处理 + * + * @author LSD + * @date 2025-10-24 + */ +@Service +public class InspectionAbnormalServiceImpl implements IInspectionAbnormalService { + @Autowired + private InspectionAbnormalMapper inspectionAbnormalMapper; + + /** + * 查询巡检异常 + * + * @param id 巡检异常主键 + * @return 巡检异常 + */ + @Override + public InspectionAbnormal selectInspectionAbnormalById(Long id) { + return inspectionAbnormalMapper.selectInspectionAbnormalById(id); + } + + /** + * 查询巡检异常列表 + * + * @param inspectionAbnormal 巡检异常 + * @return 巡检异常 + */ + @Override + @DataScope(userAlias = "u") + public List selectInspectionAbnormalList(InspectionAbnormal inspectionAbnormal) { + return inspectionAbnormalMapper.selectInspectionAbnormalList(inspectionAbnormal); + } + + /** + * 新增巡检异常 + * + * @param inspectionAbnormal 巡检异常 + * @return 结果 + */ + @Override + public int insertInspectionAbnormal(InspectionAbnormal inspectionAbnormal) { + // 填充巡检时间与审计字段(创建者、创建时间) + inspectionAbnormal.setInspectionTime(DateUtils.getNowDate()); + inspectionAbnormal.setCreateBy(SecurityUtils.getUsername()); + inspectionAbnormal.setCreateTime(DateUtils.getNowDate()); + return inspectionAbnormalMapper.insertInspectionAbnormal(inspectionAbnormal); + } + + /** + * 修改巡检异常 + * + * @param inspectionAbnormal 巡检异常 + * @return 结果 + */ + @Override + public int updateInspectionAbnormal(InspectionAbnormal inspectionAbnormal) { + // 填充审计字段(更新者、更新时间) + inspectionAbnormal.setUpdateBy(SecurityUtils.getUsername()); + inspectionAbnormal.setUpdateTime(DateUtils.getNowDate()); + return inspectionAbnormalMapper.updateInspectionAbnormal(inspectionAbnormal); + } + + /** + * 批量删除巡检异常 + * + * @param ids 需要删除的巡检异常主键 + * @return 结果 + */ + @Override + public int deleteInspectionAbnormalByIds(Long[] ids) { + return inspectionAbnormalMapper.deleteInspectionAbnormalByIds(ids); + } + + /** + * 删除巡检异常信息 + * + * @param id 巡检异常主键 + * @return 结果 + */ + @Override + public int deleteInspectionAbnormalById(Long id) { + return inspectionAbnormalMapper.deleteInspectionAbnormalById(id); + } +} diff --git a/pasd-inspection/src/main/java/com/ruoyi/inspection/service/impl/InspectionRecordTableServiceImpl.java b/pasd-inspection/src/main/java/com/ruoyi/inspection/service/impl/InspectionRecordTableServiceImpl.java index a0ced1b..76447c9 100644 --- a/pasd-inspection/src/main/java/com/ruoyi/inspection/service/impl/InspectionRecordTableServiceImpl.java +++ b/pasd-inspection/src/main/java/com/ruoyi/inspection/service/impl/InspectionRecordTableServiceImpl.java @@ -4,6 +4,7 @@ import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.List; +import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.inspection.domain.VoReturnInspectionRecordTable; import com.ruoyi.inspection.domain.VoViewInspectionRecordTable; @@ -13,16 +14,17 @@ import org.springframework.stereotype.Service; import com.ruoyi.inspection.mapper.InspectionRecordTableMapper; import com.ruoyi.inspection.domain.InspectionRecordTable; import com.ruoyi.inspection.service.IInspectionRecordTableService; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.SecurityUtils; /** * 巡检记录Service业务层处理 - * + * * @author ruoyi * @date 2024-09-05 */ @Service -public class InspectionRecordTableServiceImpl implements IInspectionRecordTableService -{ +public class InspectionRecordTableServiceImpl implements IInspectionRecordTableService { @Autowired private InspectionRecordTableMapper inspectionRecordTableMapper; @@ -35,73 +37,75 @@ public class InspectionRecordTableServiceImpl implements IInspectionRecordTableS /** * 查询巡检记录 - * + * * @param id 巡检记录主键 * @return 巡检记录 */ @Override - public InspectionRecordTable selectInspectionRecordTableById(Long id) - { + public InspectionRecordTable selectInspectionRecordTableById(Long id) { return inspectionRecordTableMapper.selectInspectionRecordTableById(id); } /** * 查询巡检记录列表 - * + * * @param inspectionRecordTable 巡检记录 * @return 巡检记录 */ @Override - public List selectInspectionRecordTableList(InspectionRecordTable inspectionRecordTable) - { + @DataScope(userAlias = "u") + public List selectInspectionRecordTableList(InspectionRecordTable inspectionRecordTable) { return inspectionRecordTableMapper.selectInspectionRecordTableList(inspectionRecordTable); } /** * 新增巡检记录 - * + * * @param inspectionRecordTable 巡检记录 * @return 结果 */ @Override - public int insertInspectionRecordTable(InspectionRecordTable inspectionRecordTable) - { + public int insertInspectionRecordTable(InspectionRecordTable inspectionRecordTable) { + inspectionRecordTable.setCreateBy(SecurityUtils.getUsername()); + inspectionRecordTable.setCreateTime(DateUtils.getNowDate()); + if (inspectionRecordTable.getInspectionTime() == null) { + inspectionRecordTable.setInspectionTime(DateUtils.getNowDate()); + } return inspectionRecordTableMapper.insertInspectionRecordTable(inspectionRecordTable); } /** * 修改巡检记录 - * + * * @param inspectionRecordTable 巡检记录 * @return 结果 */ @Override - public int updateInspectionRecordTable(InspectionRecordTable inspectionRecordTable) - { + public int updateInspectionRecordTable(InspectionRecordTable inspectionRecordTable) { + inspectionRecordTable.setUpdateBy(SecurityUtils.getUsername()); + inspectionRecordTable.setUpdateTime(DateUtils.getNowDate()); return inspectionRecordTableMapper.updateInspectionRecordTable(inspectionRecordTable); } /** * 批量删除巡检记录 - * + * * @param ids 需要删除的巡检记录主键 * @return 结果 */ @Override - public int deleteInspectionRecordTableByIds(Long[] ids) - { + public int deleteInspectionRecordTableByIds(Long[] ids) { return inspectionRecordTableMapper.deleteInspectionRecordTableByIds(ids); } /** * 删除巡检记录信息 - * + * * @param id 巡检记录主键 * @return 结果 */ @Override - public int deleteInspectionRecordTableById(Long id) - { + public int deleteInspectionRecordTableById(Long id) { return inspectionRecordTableMapper.deleteInspectionRecordTableById(id); } @@ -113,10 +117,10 @@ public class InspectionRecordTableServiceImpl implements IInspectionRecordTableS */ @Override public VoReturnInspectionRecordTable selectInspectionRecordView(VoViewInspectionRecordTable voViewInspectionRecordTable) { - VoViewInspectionRecordTable voViewInspectionRecordTable1=handleWeekType(voViewInspectionRecordTable); - List tables= inspectionRecordTableMapper.selectInspectionRecordViewList(voViewInspectionRecordTable1); - int count= inspectionRecordTableMapper.selectInspectionRecordViewCount(voViewInspectionRecordTable1); - VoReturnInspectionRecordTable voReturnInspectionRecordTable=new VoReturnInspectionRecordTable(); + VoViewInspectionRecordTable voViewInspectionRecordTable1 = handleWeekType(voViewInspectionRecordTable); + List tables = inspectionRecordTableMapper.selectInspectionRecordViewList(voViewInspectionRecordTable1); + int count = inspectionRecordTableMapper.selectInspectionRecordViewCount(voViewInspectionRecordTable1); + VoReturnInspectionRecordTable voReturnInspectionRecordTable = new VoReturnInspectionRecordTable(); voReturnInspectionRecordTable.setInspectionRecordTables(tables); voReturnInspectionRecordTable.setClockIn(count); return voReturnInspectionRecordTable; @@ -124,11 +128,12 @@ public class InspectionRecordTableServiceImpl implements IInspectionRecordTableS /** * 处理周类型 + * * @param voViewInspectionRecordTable * @return */ private VoViewInspectionRecordTable handleWeekType(VoViewInspectionRecordTable voViewInspectionRecordTable) { - VoViewInspectionRecordTable Table= new VoViewInspectionRecordTable(); + VoViewInspectionRecordTable Table = new VoViewInspectionRecordTable(); switch (voViewInspectionRecordTable.getWeekType()) { case 0: Table.setStartNum(0); @@ -163,8 +168,7 @@ public class InspectionRecordTableServiceImpl implements IInspectionRecordTableS * @return 巡检记录 */ @Override - public List selectInspectionRecordTableLists(InspectionRecordTable inspectionRecordTable) - { + public List selectInspectionRecordTableLists(InspectionRecordTable inspectionRecordTable) { List dictList = sysDictDataMapper.selectDictData(); List list = inspectionRecordTableMapper.selectInspectionRecordTableList(inspectionRecordTable); //循环遍历list集合,将集合中的inspectionType(类型为Integer)对应值与dictList集合中dictValue(类型为String)对应的值相比较,如果相等就将dictList集合中dictLabel对应的值赋值给list集合中的inspectionTypeName diff --git a/pasd-inspection/src/main/resources/mapper/inspection/AttendanceReportMapper.xml b/pasd-inspection/src/main/resources/mapper/inspection/AttendanceReportMapper.xml index bbf1614..a09b27f 100644 --- a/pasd-inspection/src/main/resources/mapper/inspection/AttendanceReportMapper.xml +++ b/pasd-inspection/src/main/resources/mapper/inspection/AttendanceReportMapper.xml @@ -11,6 +11,21 @@ + + + + + + + + + + + + + + + @@ -21,6 +36,12 @@ AND inspection_time BETWEEN #{startTime} AND #{endTime} + + AND inspection_point LIKE CONCAT('%', #{inspectionPoint}, '%') + + + AND inspector_id LIKE CONCAT('%', #{inspectorId}, '%') + @@ -28,6 +49,39 @@ GROUP BY inspection_point + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pasd-inspection/src/main/resources/mapper/inspection/InspectionAbnormalMapper.xml b/pasd-inspection/src/main/resources/mapper/inspection/InspectionAbnormalMapper.xml new file mode 100644 index 0000000..a2c0073 --- /dev/null +++ b/pasd-inspection/src/main/resources/mapper/inspection/InspectionAbnormalMapper.xml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + select id, inspection_point, inspector_id, inspection_type, inspection_time, inspection_img, inspection_abnormal.remark, + inspection_abnormal.create_by, inspection_abnormal.create_time, inspection_abnormal.update_by, inspection_abnormal.update_time + from inspection_abnormal + + + + + + + + insert into inspection_abnormal + + id, + inspection_point, + inspector_id, + inspection_type, + inspection_time, + inspection_img, + remark, + + create_by, + create_time, + + + #{id}, + #{inspectionPoint}, + #{inspectorId}, + #{inspectionType}, + #{inspectionTime}, + #{inspectionImg}, + #{remark}, + + #{createBy}, + #{createTime}, + + + + + update inspection_abnormal + + inspection_point = #{inspectionPoint}, + inspector_id = #{inspectorId}, + inspection_type = #{inspectionType}, + inspection_time = #{inspectionTime}, + inspection_img = #{inspectionImg}, + remark = #{remark}, + + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from inspection_abnormal where id = #{id} + + + + delete from inspection_abnormal where id in + + #{id} + + + diff --git a/pasd-inspection/src/main/resources/mapper/inspection/InspectionManageTableMapper.xml b/pasd-inspection/src/main/resources/mapper/inspection/InspectionManageTableMapper.xml index 0c1d0e6..d4a2040 100644 --- a/pasd-inspection/src/main/resources/mapper/inspection/InspectionManageTableMapper.xml +++ b/pasd-inspection/src/main/resources/mapper/inspection/InspectionManageTableMapper.xml @@ -3,26 +3,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + + - select id, Inspection_point, Inspection_requirements, Inspection_status, Inspection_qr_code from inspection_manage_table + select id, Inspection_point, Inspection_requirements, Inspection_status, inspection_point_type, Inspection_qr_code from inspection_manage_table - + - \ No newline at end of file + diff --git a/pasd-inspection/src/main/resources/mapper/inspection/InspectionRecordTableMapper.xml b/pasd-inspection/src/main/resources/mapper/inspection/InspectionRecordTableMapper.xml index 5a36616..663cad3 100644 --- a/pasd-inspection/src/main/resources/mapper/inspection/InspectionRecordTableMapper.xml +++ b/pasd-inspection/src/main/resources/mapper/inspection/InspectionRecordTableMapper.xml @@ -5,26 +5,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - - - - - - - + + + + + + + + + + + + - select id, inspection_point, inspector_id, inspection_point_id,inspection_type, inspection_time, inspection_img,remark from inspection_record_table + select id, inspection_point, inspector_id, inspection_point_id, inspection_type, inspection_time, inspection_img, + inspection_record_table.remark, inspection_record_table.create_by, inspection_record_table.create_time, + inspection_record_table.update_by, inspection_record_table.update_time from inspection_record_table @@ -45,6 +53,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" inspection_time, inspection_img, remark, + create_by, + create_time, #{id}, @@ -55,6 +65,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{inspectionTime}, #{inspectionImg}, #{remark}, + #{createBy}, + #{createTime}, @@ -67,7 +79,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" inspection_type = #{inspectionType}, inspection_time = #{inspectionTime}, inspection_img = #{inspectionImg}, - remark=#{remark}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = #{updateTime}, where id = #{id} diff --git a/pom.xml b/pom.xml index 46497dd..fe6638b 100644 --- a/pom.xml +++ b/pom.xml @@ -9,8 +9,8 @@ 3.8.8 ruoyi - http://www.ruoyi.vip - 若依管理系统 + + 平安水电管理系统 3.8.8 @@ -31,6 +31,7 @@ 4.1.2 2.3 0.9.1 + 1.18.30 @@ -168,6 +169,14 @@ ${ruoyi.version} + + + org.projectlombok + lombok + ${lombok.version} + provided + + com.ruoyi @@ -228,7 +237,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.1 + 3.11.0 ${java.version} ${java.version} diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index 407f328..4e41a67 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -62,12 +62,14 @@ + com.ruoyi pasd-SafetyDeclaration 3.8.8 + com.ruoyi @@ -88,6 +90,7 @@ 3.8.8 + diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java index d959a17..80da716 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java @@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.domain.AjaxResult; @@ -19,12 +20,11 @@ import com.ruoyi.system.service.ISysMenuService; /** * 登录验证 - * + * * @author ruoyi */ @RestController -public class SysLoginController -{ +public class SysLoginController { @Autowired private SysLoginService loginService; @@ -36,13 +36,12 @@ public class SysLoginController /** * 登录方法 - * + * * @param loginBody 登录信息 * @return 结果 */ @PostMapping("/login") - public AjaxResult login(@RequestBody LoginBody loginBody) - { + public AjaxResult login(@RequestBody LoginBody loginBody) { AjaxResult ajax = AjaxResult.success(); // 生成令牌 String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), @@ -52,13 +51,119 @@ public class SysLoginController } /** - * 获取用户信息 + * CAS登录方法 + * + * @param ticket CAS票据 + * @param service 服务地址 + * @return 结果 + */ + @PostMapping("/cas/login") + public AjaxResult casLogin(@RequestParam("ticket") String ticket, @RequestParam("service") String service) { + AjaxResult ajax = AjaxResult.success(); + // 生成令牌 + String token = loginService.casLogin(ticket, service); + ajax.put(Constants.TOKEN, token); + return ajax; + } + + /** + * 移动端CAS登录方法 + * + * @param ticket CAS票据 + * @return 结果 + */ + @PostMapping("/cas/app/login") + public AjaxResult casAppLogin(@RequestParam("ticket") String ticket) { + // 使用统一的CAS回调地址,与PC端保持一致 + String appService = "https://pasd.gxsdxy.cn/cas/cas-callback"; + AjaxResult ajax = AjaxResult.success(); + // 生成令牌 + String token = loginService.casLogin(ticket, appService); + ajax.put(Constants.TOKEN, token); + return ajax; + } + + /** + * 统一CAS登录方法 - 根据User-Agent自动分发到PC或移动端 * + * @param ticket CAS票据 + * @param request HttpServletRequest + * @return 结果 + */ + @PostMapping("/cas/unified/login") + public AjaxResult casUnifiedLogin(@RequestParam("ticket") String ticket, + javax.servlet.http.HttpServletRequest request) { + String userAgent = request.getHeader("User-Agent"); + String service; + + // 由于CAS服务器回调时,User-Agent是CAS服务器的,所以直接使用统一的CAS回调地址 + // 这个地址应该与CAS登录请求时使用的service参数一致 + service = "https://pasd.gxsdxy.cn/cas/cas-callback"; + + AjaxResult ajax = AjaxResult.success(); + // 生成令牌 + String token = loginService.casLogin(ticket, service); + ajax.put(Constants.TOKEN, token); + return ajax; + } + + /** + * 统一CAS回调分发 - 根据User-Agent重定向到PC或移动端 + * + * @param request HttpServletRequest + * @return 重定向结果 + */ + @GetMapping("/cas/unified/callback") + public org.springframework.web.servlet.ModelAndView unifiedCasCallback( + javax.servlet.http.HttpServletRequest request) { + String userAgent = request.getHeader("User-Agent"); + + org.springframework.web.servlet.ModelAndView modelAndView = new org.springframework.web.servlet.ModelAndView(); + + // 检测是否为移动设备 + if (isMobileDevice(userAgent)) { + modelAndView.setViewName("redirect:/app-cas/"); + } else { + modelAndView.setViewName("redirect:/"); + } + + return modelAndView; + } + + /** + * 检测是否为移动设备 + * + * @param userAgent User-Agent字符串 + * @return 是否为移动设备 + */ + private boolean isMobileDevice(String userAgent) { + if (userAgent == null) { + return false; + } + + userAgent = userAgent.toLowerCase(); + + String[] mobileKeywords = { + "android", "webos", "iphone", "ipad", "ipod", "blackberry", + "windows phone", "iemobile", "opera mini", "mobile" + }; + + for (String keyword : mobileKeywords) { + if (userAgent.contains(keyword)) { + return true; + } + } + + return false; + } + + /** + * 获取用户信息 + * * @return 用户信息 */ @GetMapping("getInfo") - public AjaxResult getInfo() - { + public AjaxResult getInfo() { SysUser user = SecurityUtils.getLoginUser().getUser(); // 角色集合 Set roles = permissionService.getRolePermission(user); @@ -73,14 +178,13 @@ public class SysLoginController /** * 获取路由信息 - * + * * @return 路由信息 */ @GetMapping("getRouters") - public AjaxResult getRouters() - { + public AjaxResult getRouters() { Long userId = SecurityUtils.getUserId(); List menus = menuService.selectMenuTreeByUserId(userId); return AjaxResult.success(menuService.buildMenus(menus)); } -} +} \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/application-dev.yml b/ruoyi-admin/src/main/resources/application-dev.yml index e6b27a4..79ca77c 100644 --- a/ruoyi-admin/src/main/resources/application-dev.yml +++ b/ruoyi-admin/src/main/resources/application-dev.yml @@ -12,10 +12,10 @@ spring: # 从库数据源 slave: # 从数据源开关/默认关闭 - enabled: false - url: jdbc:mysql://124.70.202.11:3306/srs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true&rewriteBatchedStatements=true - username: eta - password: Eta802566@# + enabled: true + url: jdbc:mysql://47.112.118.149:3306/srs_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true&rewriteBatchedStatements=true + username: root + password: Houpuyfb # 初始连接数 initialSize: 5 # 最小连接池数量 diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 7b1eace..7209e3b 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -53,8 +53,8 @@ spring: # 国际化资源文件路径 basename: i18n/messages profiles: -# active: druid #正式环境配置文件 - active: dev # 测试环境配置文件 + active: druid #正式环境配置文件 +# active: dev # 测试环境配置文件 # 文件上传 servlet: multipart: @@ -70,16 +70,15 @@ spring: # redis 配置 redis: # 地址 -# host: 172.16.129.101 #正式环境 -# host: localhost - host: 47.112.118.149 #测试环境 + host: 172.16.129.101 #正式环境 +# host: 47.112.118.149 #测试环境 # 端口,默认为6379 port: 6379 # 数据库索引 database: 0 # 密码 - password: Houpuyfb #redis开发地址 -# password: +# password: Houpuyfb #redis开发地址 + password: # 连接超时时间 timeout: 10s lettuce: @@ -132,3 +131,12 @@ xss: excludes: /system/notice # 匹配链接 urlPatterns: /system/*,/monitor/*,/tool/* + +# CAS配置 +cas: + server: + host: https://rsso.gxsdxy.cn + login: ${cas.server.host}/login + logout: ${cas.server.host}/logout + service: + host: https://pasd.gxsdxy.cn # 这应该是您的域名 diff --git a/ruoyi-admin/target/classes/META-INF/spring-devtools.properties b/ruoyi-admin/target/classes/META-INF/spring-devtools.properties new file mode 100644 index 0000000..37e7b58 --- /dev/null +++ b/ruoyi-admin/target/classes/META-INF/spring-devtools.properties @@ -0,0 +1 @@ +restart.include.json=/com.alibaba.fastjson2.*.jar \ No newline at end of file diff --git a/ruoyi-admin/target/classes/application-dev.yml b/ruoyi-admin/target/classes/application-dev.yml new file mode 100644 index 0000000..79ca77c --- /dev/null +++ b/ruoyi-admin/target/classes/application-dev.yml @@ -0,0 +1,61 @@ +# 数据源配置 +spring: + datasource: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: com.mysql.cj.jdbc.Driver + druid: + # 主库数据源 + master: + url: jdbc:mysql://47.112.118.149:3306/pasd_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: root + password: Houpuyfb + # 从库数据源 + slave: + # 从数据源开关/默认关闭 + enabled: true + url: jdbc:mysql://47.112.118.149:3306/srs_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true&rewriteBatchedStatements=true + username: root + password: Houpuyfb + # 初始连接数 + initialSize: 5 + # 最小连接池数量 + minIdle: 10 + # 最大连接池数量 + maxActive: 20 + # 配置获取连接等待超时的时间 + maxWait: 60000 + # 配置连接超时时间 + connectTimeout: 30000 + # 配置网络超时时间 + socketTimeout: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + timeBetweenEvictionRunsMillis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + minEvictableIdleTimeMillis: 300000 + # 配置一个连接在池中最大生存的时间,单位是毫秒 + maxEvictableIdleTimeMillis: 900000 + # 配置检测连接是否有效 + validationQuery: SELECT 1 FROM DUAL + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + webStatFilter: + enabled: true + statViewServlet: + enabled: true + # 设置白名单,不填则允许所有访问 + allow: + url-pattern: /druid/* + # 控制台管理用户名和密码 + login-username: ruoyi + login-password: 123456 + filter: + stat: + enabled: true + # 慢SQL记录 + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: true + wall: + config: + multi-statement-allow: true diff --git a/ruoyi-admin/target/classes/application-druid.yml b/ruoyi-admin/target/classes/application-druid.yml new file mode 100644 index 0000000..a516f78 --- /dev/null +++ b/ruoyi-admin/target/classes/application-druid.yml @@ -0,0 +1,64 @@ +# 数据源配置 +spring: + datasource: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: com.mysql.cj.jdbc.Driver + druid: + # 主库数据源 + master: + url: jdbc:mysql://172.16.129.101:3306/safetyhydropowerdb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: safetyhydropowerdb + password: GXSD#8025 + # 从库数据源 + slave: + # 从数据源开关/默认关闭 + enabled: true + url: jdbc:mysql://172.16.96.116:3306/srs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true&rewriteBatchedStatements=true + username: root #eta + password: Gxsd#8025 #Eta802566@# 124.70.202.11 localhost Gxsd#8025 服务器地址 +# url: jdbc:mysql://124.70.202.11:3306/srs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true&rewriteBatchedStatements=true +# username: eta +# password: Eta802566@# + # 初始连接数 + initialSize: 5 + # 最小连接池数量 + minIdle: 10 + # 最大连接池数量 + maxActive: 20 + # 配置获取连接等待超时的时间 + maxWait: 60000 + # 配置连接超时时间 + connectTimeout: 30000 + # 配置网络超时时间 + socketTimeout: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + timeBetweenEvictionRunsMillis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + minEvictableIdleTimeMillis: 300000 + # 配置一个连接在池中最大生存的时间,单位是毫秒 + maxEvictableIdleTimeMillis: 900000 + # 配置检测连接是否有效 + validationQuery: SELECT 1 FROM DUAL + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + webStatFilter: + enabled: true + statViewServlet: + enabled: true + # 设置白名单,不填则允许所有访问 + allow: + url-pattern: /druid/* + # 控制台管理用户名和密码 + login-username: ruoyi + login-password: 123456 + filter: + stat: + enabled: true + # 慢SQL记录 + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: true + wall: + config: + multi-statement-allow: true diff --git a/ruoyi-admin/target/classes/application.yml b/ruoyi-admin/target/classes/application.yml new file mode 100644 index 0000000..7209e3b --- /dev/null +++ b/ruoyi-admin/target/classes/application.yml @@ -0,0 +1,142 @@ +# 项目相关配置 +ruoyi: + # 名称 + name: RuoYi + # 版本 + version: 3.8.8 + # 版权年份 + copyrightYear: 2024 + # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) + profile: /home/ruoyi/uploadPath +# profile: D:/ruoyi/uploadPath + # 获取ip地址开关 + addressEnabled: false + # 验证码类型 math 数字计算 char 字符验证 + captchaType: math + +# 开发环境配置 +server: + # 服务器的HTTP端口,默认为8080 + port: 8080 + servlet: + # 应用的访问路径 + context-path: / + tomcat: + # tomcat的URI编码 + uri-encoding: UTF-8 + # 连接数满后的排队数,默认为100 + accept-count: 1000 + threads: + # tomcat最大线程数,默认为200 + max: 800 + # Tomcat启动初始化的线程数,默认值10 + min-spare: 100 + +# 日志配置 +logging: + level: + com.ruoyi: debug + org.springframework: warn + +# 用户配置 +user: + password: + # 密码最大错误次数 + maxRetryCount: 5 + # 密码锁定时间(默认10分钟) + lockTime: 10 + +# Spring配置 +spring: + # 资源信息 + messages: + # 国际化资源文件路径 + basename: i18n/messages + profiles: + active: druid #正式环境配置文件 +# active: dev # 测试环境配置文件 + # 文件上传 + servlet: + multipart: + # 单个文件大小 + max-file-size: 10MB + # 设置总上传的文件大小 + max-request-size: 20MB + # 服务模块 + devtools: + restart: + # 热部署开关 + enabled: true + # redis 配置 + redis: + # 地址 + host: 172.16.129.101 #正式环境 +# host: 47.112.118.149 #测试环境 + # 端口,默认为6379 + port: 6379 + # 数据库索引 + database: 0 + # 密码 +# password: Houpuyfb #redis开发地址 + password: + # 连接超时时间 + timeout: 10s + lettuce: + pool: + # 连接池中的最小空闲连接 + min-idle: 0 + # 连接池中的最大空闲连接 + max-idle: 8 + # 连接池的最大数据库连接数 + max-active: 8 + # #连接池最大阻塞等待时间(使用负值表示没有限制) + max-wait: -1ms + +# token配置 +token: + # 令牌自定义标识 + header: Authorization + # 令牌密钥 + secret: abcdefghijklmnopqrstuvwxyz + # 令牌有效期(默认30分钟) + expireTime: 300000 + +# MyBatis配置 +mybatis: + # 搜索指定包别名 + typeAliasesPackage: com.ruoyi.**.domain + # 配置mapper的扫描,找到所有的mapper.xml映射文件 + mapperLocations: classpath*:mapper/**/*Mapper.xml + # 加载全局的配置文件 + configLocation: classpath:mybatis/mybatis-config.xml + +# PageHelper分页插件 +pagehelper: + helperDialect: mysql + supportMethodsArguments: true + params: count=countSql + +# Swagger配置 +swagger: + # 是否开启swagger + enabled: true + # 请求前缀 + pathMapping: /dev-api + +# 防止XSS攻击 +xss: + # 过滤开关 + enabled: true + # 排除链接(多个用逗号分隔) + excludes: /system/notice + # 匹配链接 + urlPatterns: /system/*,/monitor/*,/tool/* + +# CAS配置 +cas: + server: + host: https://rsso.gxsdxy.cn + login: ${cas.server.host}/login + logout: ${cas.server.host}/logout + service: + host: https://pasd.gxsdxy.cn # 这应该是您的域名 diff --git a/ruoyi-admin/target/classes/banner.txt b/ruoyi-admin/target/classes/banner.txt new file mode 100644 index 0000000..0931cb8 --- /dev/null +++ b/ruoyi-admin/target/classes/banner.txt @@ -0,0 +1,24 @@ +Application Version: ${ruoyi.version} +Spring Boot Version: ${spring-boot.version} +//////////////////////////////////////////////////////////////////// +// _ooOoo_ // +// o8888888o // +// 88" . "88 // +// (| ^_^ |) // +// O\ = /O // +// ____/`---'\____ // +// .' \\| |// `. // +// / \\||| : |||// \ // +// / _||||| -:- |||||- \ // +// | | \\\ - /// | | // +// | \_| ''\---/'' | | // +// \ .-\__ `-` ___/-. / // +// ___`. .' /--.--\ `. . ___ // +// ."" '< `.___\_<|>_/___.' >'"". // +// | | : `- \`.;`\ _ /`;.`/ - ` : | | // +// \ \ `-. \_ __\ /__ _/ .-` / / // +// ========`-.____`-.___\_____/___.-`____.-'======== // +// `=---=' // +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // +// 佛祖保佑 永不宕机 永无BUG // +//////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/ruoyi-admin/target/classes/i18n/messages.properties b/ruoyi-admin/target/classes/i18n/messages.properties new file mode 100644 index 0000000..93de005 --- /dev/null +++ b/ruoyi-admin/target/classes/i18n/messages.properties @@ -0,0 +1,38 @@ +#错误消息 +not.null=* 必须填写 +user.jcaptcha.error=验证码错误 +user.jcaptcha.expire=验证码已失效 +user.not.exists=用户不存在/密码错误 +user.password.not.match=用户不存在/密码错误 +user.password.retry.limit.count=密码输入错误{0}次 +user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟 +user.password.delete=对不起,您的账号已被删除 +user.blocked=用户已封禁,请联系管理员 +role.blocked=角色已封禁,请联系管理员 +login.blocked=很遗憾,访问IP已被列入系统黑名单 +user.logout.success=退出成功 + +length.not.valid=长度必须在{min}到{max}个字符之间 + +user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头 +user.password.not.valid=* 5-50个字符 + +user.email.not.valid=邮箱格式错误 +user.mobile.phone.number.not.valid=手机号格式错误 +user.login.success=登录成功 +user.register.success=注册成功 +user.notfound=请重新登录 +user.forcelogout=管理员强制退出,请重新登录 +user.unknown.error=未知错误,请重新登录 + +##文件上传消息 +upload.exceed.maxSize=上传的文件大小超出限制的文件大小!
允许的文件最大大小是:{0}MB! +upload.filename.exceed.length=上传的文件名最长{0}个字符 + +##权限 +no.permission=您没有数据的权限,请联系管理员添加权限 [{0}] +no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}] +no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}] +no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}] +no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}] +no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}] diff --git a/ruoyi-admin/target/classes/logback.xml b/ruoyi-admin/target/classes/logback.xml new file mode 100644 index 0000000..f213d28 --- /dev/null +++ b/ruoyi-admin/target/classes/logback.xml @@ -0,0 +1,92 @@ + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/sys-info.log + + + + ${log.path}/sys-info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/sys-error.log + + + + ${log.path}/sys-error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + ${log.path}/sys-user.log + + + ${log.path}/sys-user.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ruoyi-admin/target/classes/mybatis/mybatis-config.xml b/ruoyi-admin/target/classes/mybatis/mybatis-config.xml new file mode 100644 index 0000000..ac47c03 --- /dev/null +++ b/ruoyi-admin/target/classes/mybatis/mybatis-config.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + diff --git a/ruoyi-admin/target/maven-archiver/pom.properties b/ruoyi-admin/target/maven-archiver/pom.properties new file mode 100644 index 0000000..0886a98 --- /dev/null +++ b/ruoyi-admin/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=ruoyi-admin +groupId=com.ruoyi +version=3.8.8 diff --git a/ruoyi-admin/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/ruoyi-admin/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..f881ad8 --- /dev/null +++ b/ruoyi-admin/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,26 @@ +com\ruoyi\RuoYiServletInitializer.class +com\ruoyi\web\controller\common\CaptchaController.class +com\ruoyi\web\controller\system\SysDictDataController.class +com\ruoyi\web\controller\monitor\SysOperlogController.class +com\ruoyi\web\controller\system\SysIndexController.class +com\ruoyi\web\controller\common\CommonController.class +com\ruoyi\RuoYiApplication.class +com\ruoyi\web\controller\system\SysRegisterController.class +com\ruoyi\web\controller\tool\UserEntity.class +com\ruoyi\web\controller\system\SysMenuController.class +com\ruoyi\web\controller\system\SysPostController.class +com\ruoyi\web\controller\monitor\ServerController.class +com\ruoyi\web\controller\monitor\SysLogininforController.class +com\ruoyi\web\controller\monitor\SysUserOnlineController.class +com\ruoyi\web\controller\system\SysLoginController.class +com\ruoyi\web\controller\monitor\CacheController.class +com\ruoyi\web\controller\system\SysNoticeController.class +com\ruoyi\web\controller\system\SysDictTypeController.class +com\ruoyi\web\controller\system\SysProfileController.class +com\ruoyi\web\controller\system\SysDeptController.class +com\ruoyi\web\controller\QRCode\QRCodeProcessingController.class +com\ruoyi\web\controller\system\SysConfigController.class +com\ruoyi\web\controller\system\SysUserController.class +com\ruoyi\web\controller\system\SysRoleController.class +com\ruoyi\web\controller\tool\TestController.class +com\ruoyi\web\core\config\SwaggerConfig.class diff --git a/ruoyi-admin/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/ruoyi-admin/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..fedd053 --- /dev/null +++ b/ruoyi-admin/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,25 @@ +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\monitor\SysOperlogController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\RuoYiApplication.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\common\CaptchaController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\system\SysNoticeController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\monitor\SysLogininforController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\system\SysProfileController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\RuoYiServletInitializer.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\system\SysRegisterController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\common\CommonController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\system\SysUserController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\QRCode\QRCodeProcessingController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\system\SysMenuController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\monitor\ServerController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\system\SysConfigController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\monitor\SysUserOnlineController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\system\SysIndexController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\core\config\SwaggerConfig.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\system\SysPostController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\system\SysDictTypeController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\monitor\CacheController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\system\SysDictDataController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\tool\TestController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\system\SysLoginController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\system\SysDeptController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-admin\src\main\java\com\ruoyi\web\controller\system\SysRoleController.java diff --git a/ruoyi-admin/target/ruoyi-admin.jar.original b/ruoyi-admin/target/ruoyi-admin.jar.original new file mode 100644 index 0000000..8fbad8d Binary files /dev/null and b/ruoyi-admin/target/ruoyi-admin.jar.original differ diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 7c309bf..a895ca1 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -41,6 +41,13 @@ pagehelper-spring-boot-starter + + + com.baomidou + mybatis-plus-boot-starter + 3.5.3 + + org.springframework.boot diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java index f290ec3..c09a3c3 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java @@ -12,11 +12,11 @@ import com.ruoyi.common.utils.StringUtils; /** * spring工具类 方便在非spring管理环境中获取bean - * + * * @author ruoyi */ @Component -public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationContextAware +public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationContextAware { /** Spring应用上下文环境 */ private static ConfigurableListableBeanFactory beanFactory; @@ -24,13 +24,13 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC private static ApplicationContext applicationContext; @Override - public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException + public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { SpringUtils.beanFactory = beanFactory; } @Override - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { SpringUtils.applicationContext = applicationContext; } @@ -113,7 +113,7 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC /** * 获取aop代理对象 - * + * * @param invoker * @return */ @@ -144,6 +144,16 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC return StringUtils.isNotEmpty(activeProfiles) ? activeProfiles[0] : null; } + /** + * 获取ApplicationContext + * + * @return ApplicationContext + */ + public static ApplicationContext getApplicationContext() + { + return applicationContext; + } + /** * 获取配置文件中的值 * diff --git a/ruoyi-common/target/maven-archiver/pom.properties b/ruoyi-common/target/maven-archiver/pom.properties new file mode 100644 index 0000000..93da671 --- /dev/null +++ b/ruoyi-common/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=ruoyi-common +groupId=com.ruoyi +version=3.8.8 diff --git a/ruoyi-common/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/ruoyi-common/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..19bcc3d --- /dev/null +++ b/ruoyi-common/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,127 @@ +com\ruoyi\common\filter\XssHttpServletRequestWrapper.class +com\ruoyi\common\utils\ip\IpUtils.class +com\ruoyi\common\utils\uuid\IdUtils.class +com\ruoyi\common\annotation\RepeatSubmit.class +com\ruoyi\common\constant\GenConstants.class +com\ruoyi\common\core\domain\TreeEntity.class +com\ruoyi\common\exception\base\BaseException.class +com\ruoyi\common\utils\ip\AddressUtils.class +com\ruoyi\common\constant\HttpStatus.class +com\ruoyi\common\enums\healthcare\HealthcareOsSex.class +com\ruoyi\common\utils\DesensitizedUtil.class +com\ruoyi\common\utils\sign\Base64.class +com\ruoyi\common\xss\Xss.class +com\ruoyi\common\exception\user\UserNotExistsException.class +com\ruoyi\common\core\domain\model\LoginBody.class +com\ruoyi\common\exception\user\UserPasswordNotMatchException.class +com\ruoyi\common\annotation\Log.class +com\ruoyi\common\core\controller\BaseController$1.class +com\ruoyi\common\utils\file\ImageUtils.class +com\ruoyi\common\config\RuoYiConfig.class +com\ruoyi\common\enums\BusinessStatus.class +com\ruoyi\common\utils\sign\Md5Utils.class +com\ruoyi\common\utils\http\HttpUtils$TrustAnyHostnameVerifier.class +com\ruoyi\common\exception\file\FileSizeLimitExceededException.class +com\ruoyi\common\utils\Arith.class +com\ruoyi\common\annotation\Excel$ColumnType.class +com\ruoyi\common\annotation\DataScope.class +com\ruoyi\common\core\domain\entity\SysDictType.class +com\ruoyi\common\core\text\StrFormatter.class +com\ruoyi\common\annotation\Excels.class +com\ruoyi\common\config\serializer\SensitiveJsonSerializer.class +com\ruoyi\common\core\domain\entity\SysDictData.class +com\ruoyi\common\utils\http\HttpUtils$TrustAnyTrustManager.class +com\ruoyi\common\enums\UserStatus.class +com\ruoyi\common\enums\healthcare\HealthcareOsDiagnosisStatus.class +com\ruoyi\common\exception\user\CaptchaExpireException.class +com\ruoyi\common\enums\healthcare\HealthcareOsPatientType.class +com\ruoyi\common\annotation\Excel$Type.class +com\ruoyi\common\exception\job\TaskException$Code.class +com\ruoyi\common\utils\spring\SpringUtils.class +com\ruoyi\common\utils\file\FileUploadUtils.class +com\ruoyi\common\filter\RepeatedlyRequestWrapper$1.class +com\ruoyi\common\utils\bean\BeanUtils.class +com\ruoyi\common\utils\sql\SqlUtil.class +com\ruoyi\common\utils\file\MimeTypeUtils.class +com\ruoyi\common\enums\BusinessType.class +com\ruoyi\common\filter\PropertyPreExcludeFilter.class +com\ruoyi\common\core\domain\model\LoginUser.class +com\ruoyi\common\enums\DesensitizedType.class +com\ruoyi\common\exception\file\InvalidExtensionException$InvalidMediaExtensionException.class +com\ruoyi\common\exception\file\FileUploadException.class +com\ruoyi\common\utils\poi\ExcelUtil.class +com\ruoyi\common\exception\user\UserException.class +com\ruoyi\common\utils\MessageUtils.class +com\ruoyi\common\enums\DataSourceType.class +com\ruoyi\common\exception\file\InvalidExtensionException$InvalidVideoExtensionException.class +com\ruoyi\common\enums\HttpMethod.class +com\ruoyi\common\utils\PageUtils.class +com\ruoyi\common\utils\LogUtils.class +com\ruoyi\common\annotation\DataSource.class +com\ruoyi\common\core\page\PageDomain.class +com\ruoyi\common\filter\XssHttpServletRequestWrapper$1.class +com\ruoyi\common\utils\ExceptionUtil.class +com\ruoyi\common\utils\http\HttpHelper.class +com\ruoyi\common\enums\LimitType.class +com\ruoyi\common\annotation\Sensitive.class +com\ruoyi\common\filter\RepeatedlyRequestWrapper.class +com\ruoyi\common\exception\file\InvalidExtensionException$InvalidImageExtensionException.class +com\ruoyi\common\core\controller\BaseController.class +com\ruoyi\common\utils\StringUtils.class +com\ruoyi\common\utils\poi\ExcelHandlerAdapter.class +com\ruoyi\common\exception\DemoModeException.class +com\ruoyi\common\enums\OperatorType.class +com\ruoyi\common\exception\UtilException.class +com\ruoyi\common\xss\XssValidator.class +com\ruoyi\common\utils\DateUtils.class +com\ruoyi\common\core\domain\entity\SysMenu.class +com\ruoyi\common\core\page\TableDataInfo.class +com\ruoyi\common\exception\GlobalException.class +com\ruoyi\common\exception\job\TaskException.class +com\ruoyi\common\constant\UserConstants.class +com\ruoyi\common\core\text\Convert.class +com\ruoyi\common\core\domain\entity\SysUser.class +com\ruoyi\common\utils\file\FileUtils.class +com\ruoyi\common\exception\user\BlackListException.class +com\ruoyi\common\core\domain\TreeSelect.class +com\ruoyi\common\filter\RepeatableFilter.class +com\ruoyi\common\constant\Constants.class +com\ruoyi\common\core\domain\entity\SysRole.class +com\ruoyi\common\annotation\Anonymous.class +com\ruoyi\common\exception\user\CaptchaException.class +com\ruoyi\common\core\domain\R.class +com\ruoyi\common\enums\healthcare\HealthcareOsDictionaryName.class +com\ruoyi\common\utils\bean\BeanValidators.class +com\ruoyi\common\core\domain\model\RegisterBody.class +com\ruoyi\common\exception\file\FileException.class +com\ruoyi\common\core\domain\BaseEntity.class +com\ruoyi\common\utils\SecurityUtils.class +com\ruoyi\common\core\redis\RedisCache.class +com\ruoyi\common\annotation\Excel.class +com\ruoyi\common\utils\uuid\UUID$Holder.class +com\ruoyi\common\annotation\RateLimiter.class +com\ruoyi\common\core\domain\entity\SysDept.class +com\ruoyi\common\core\page\TableSupport.class +com\ruoyi\common\utils\uuid\UUID.class +com\ruoyi\common\utils\http\HttpUtils.class +com\ruoyi\common\exception\file\InvalidExtensionException.class +com\ruoyi\common\constant\ScheduleConstants.class +com\ruoyi\common\exception\ServiceException.class +com\ruoyi\common\utils\file\FileTypeUtils.class +com\ruoyi\common\constant\ScheduleConstants$Status.class +com\ruoyi\common\utils\html\EscapeUtil.class +com\ruoyi\common\exception\file\InvalidExtensionException$InvalidFlashExtensionException.class +com\ruoyi\common\utils\http\HttpUtils$1.class +com\ruoyi\common\utils\ServletUtils.class +com\ruoyi\common\utils\html\HTMLFilter.class +com\ruoyi\common\utils\Threads.class +com\ruoyi\common\utils\uuid\Seq.class +com\ruoyi\common\filter\XssFilter.class +com\ruoyi\common\core\domain\AjaxResult.class +com\ruoyi\common\exception\file\FileNameLengthLimitExceededException.class +com\ruoyi\common\core\text\CharsetKit.class +com\ruoyi\common\utils\reflect\ReflectUtils.class +com\ruoyi\common\utils\DictUtils.class +com\ruoyi\common\constant\CacheConstants.class +com\ruoyi\common\utils\QRCodeReader.class +com\ruoyi\common\exception\user\UserPasswordRetryLimitExceedException.class diff --git a/ruoyi-common/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/ruoyi-common/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..83a0637 --- /dev/null +++ b/ruoyi-common/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,112 @@ +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\exception\user\BlackListException.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\text\CharsetKit.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\enums\healthcare\HealthcareOsPatientType.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\enums\healthcare\HealthcareOsSex.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\annotation\RateLimiter.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\sign\Base64.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\DesensitizedUtil.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\html\EscapeUtil.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\page\PageDomain.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\controller\BaseController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\domain\BaseEntity.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\uuid\IdUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\enums\BusinessType.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\domain\TreeEntity.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\enums\BusinessStatus.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\http\HttpHelper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\exception\file\InvalidExtensionException.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\enums\DataSourceType.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\file\FileUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\exception\base\BaseException.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\poi\ExcelHandlerAdapter.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\domain\entity\SysDept.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\redis\RedisCache.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\DictUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\enums\OperatorType.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\config\serializer\SensitiveJsonSerializer.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\file\MimeTypeUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\enums\healthcare\HealthcareOsDictionaryName.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\poi\ExcelUtil.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\exception\user\UserException.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\http\HttpUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\annotation\DataScope.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\exception\file\FileUploadException.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\ip\IpUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\xss\XssValidator.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\enums\HttpMethod.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\spring\SpringUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\filter\XssHttpServletRequestWrapper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\annotation\Excel.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\Threads.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\exception\file\FileException.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\exception\GlobalException.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\bean\BeanUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\exception\UtilException.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\file\FileUploadUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\constant\HttpStatus.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\filter\PropertyPreExcludeFilter.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\exception\user\CaptchaException.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\ServletUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\constant\GenConstants.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\exception\user\UserPasswordNotMatchException.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\exception\DemoModeException.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\filter\RepeatableFilter.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\domain\entity\SysMenu.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\exception\file\FileNameLengthLimitExceededException.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\html\HTMLFilter.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\SecurityUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\file\FileTypeUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\page\TableDataInfo.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\ip\AddressUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\domain\entity\SysUser.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\exception\user\UserNotExistsException.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\domain\model\LoginUser.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\file\ImageUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\sql\SqlUtil.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\DateUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\sign\Md5Utils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\enums\healthcare\HealthcareOsDiagnosisStatus.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\constant\Constants.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\exception\job\TaskException.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\StringUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\annotation\RepeatSubmit.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\bean\BeanValidators.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\constant\UserConstants.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\filter\XssFilter.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\text\Convert.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\annotation\Log.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\LogUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\config\RuoYiConfig.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\enums\DesensitizedType.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\xss\Xss.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\annotation\Sensitive.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\uuid\UUID.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\exception\ServiceException.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\domain\entity\SysDictData.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\domain\R.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\domain\model\RegisterBody.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\exception\user\CaptchaExpireException.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\PageUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\text\StrFormatter.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\uuid\Seq.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\domain\TreeSelect.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\constant\CacheConstants.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\domain\entity\SysRole.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\domain\model\LoginBody.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\QRCodeReader.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\Arith.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\domain\AjaxResult.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\MessageUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\reflect\ReflectUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\enums\LimitType.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\exception\file\FileSizeLimitExceededException.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\utils\ExceptionUtil.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\enums\UserStatus.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\filter\RepeatedlyRequestWrapper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\annotation\Excels.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\annotation\Anonymous.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\domain\entity\SysDictType.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\exception\user\UserPasswordRetryLimitExceedException.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\annotation\DataSource.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\core\page\TableSupport.java +D:\code\pasd_V1.0\pasd_java\ruoyi-common\src\main\java\com\ruoyi\common\constant\ScheduleConstants.java diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java index 057c941..3b0b7bf 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java @@ -5,11 +5,12 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; + import javax.sql.DataSource; + import org.apache.ibatis.io.VFS; import org.apache.ibatis.session.SqlSessionFactory; import org.mybatis.spring.SqlSessionFactoryBean; -import org.mybatis.spring.boot.autoconfigure.SpringBootVFS; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -22,6 +23,8 @@ import org.springframework.core.type.classreading.CachingMetadataReaderFactory; import org.springframework.core.type.classreading.MetadataReader; import org.springframework.core.type.classreading.MetadataReaderFactory; import org.springframework.util.ClassUtils; + +import com.baomidou.mybatisplus.autoconfigure.SpringBootVFS; import com.ruoyi.common.utils.StringUtils; /** @@ -30,82 +33,63 @@ import com.ruoyi.common.utils.StringUtils; * @author ruoyi */ @Configuration -public class MyBatisConfig -{ +public class MyBatisConfig { @Autowired private Environment env; static final String DEFAULT_RESOURCE_PATTERN = "**/*.class"; - public static String setTypeAliasesPackage(String typeAliasesPackage) - { + public static String setTypeAliasesPackage(String typeAliasesPackage) { ResourcePatternResolver resolver = (ResourcePatternResolver) new PathMatchingResourcePatternResolver(); MetadataReaderFactory metadataReaderFactory = new CachingMetadataReaderFactory(resolver); List allResult = new ArrayList(); - try - { - for (String aliasesPackage : typeAliasesPackage.split(",")) - { + try { + for (String aliasesPackage : typeAliasesPackage.split(",")) { List result = new ArrayList(); aliasesPackage = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX - + ClassUtils.convertClassNameToResourcePath(aliasesPackage.trim()) + "/" + DEFAULT_RESOURCE_PATTERN; + + ClassUtils.convertClassNameToResourcePath(aliasesPackage.trim()) + "/" + + DEFAULT_RESOURCE_PATTERN; Resource[] resources = resolver.getResources(aliasesPackage); - if (resources != null && resources.length > 0) - { + if (resources != null && resources.length > 0) { MetadataReader metadataReader = null; - for (Resource resource : resources) - { - if (resource.isReadable()) - { + for (Resource resource : resources) { + if (resource.isReadable()) { metadataReader = metadataReaderFactory.getMetadataReader(resource); - try - { - result.add(Class.forName(metadataReader.getClassMetadata().getClassName()).getPackage().getName()); - } - catch (ClassNotFoundException e) - { + try { + result.add(Class.forName(metadataReader.getClassMetadata().getClassName()).getPackage() + .getName()); + } catch (ClassNotFoundException e) { e.printStackTrace(); } } } } - if (result.size() > 0) - { + if (result.size() > 0) { HashSet hashResult = new HashSet(result); allResult.addAll(hashResult); } } - if (allResult.size() > 0) - { + if (allResult.size() > 0) { typeAliasesPackage = String.join(",", (String[]) allResult.toArray(new String[0])); + } else { + throw new RuntimeException( + "mybatis typeAliasesPackage 路径扫描错误,参数typeAliasesPackage:" + typeAliasesPackage + "未找到任何包"); } - else - { - throw new RuntimeException("mybatis typeAliasesPackage 路径扫描错误,参数typeAliasesPackage:" + typeAliasesPackage + "未找到任何包"); - } - } - catch (IOException e) - { + } catch (IOException e) { e.printStackTrace(); } return typeAliasesPackage; } - public Resource[] resolveMapperLocations(String[] mapperLocations) - { + public Resource[] resolveMapperLocations(String[] mapperLocations) { ResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver(); List resources = new ArrayList(); - if (mapperLocations != null) - { - for (String mapperLocation : mapperLocations) - { - try - { + if (mapperLocations != null) { + for (String mapperLocation : mapperLocations) { + try { Resource[] mappers = resourceResolver.getResources(mapperLocation); resources.addAll(Arrays.asList(mappers)); - } - catch (IOException e) - { + } catch (IOException e) { // ignore } } @@ -114,8 +98,7 @@ public class MyBatisConfig } @Bean - public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception - { + public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception { String typeAliasesPackage = env.getProperty("mybatis.typeAliasesPackage"); String mapperLocations = env.getProperty("mybatis.mapperLocations"); String configLocation = env.getProperty("mybatis.configLocation"); diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index b519540..f4d5c37 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -110,8 +110,8 @@ public class SecurityConfig // 注解标记允许匿名访问的url .authorizeHttpRequests((requests) -> { permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll()); - // 对于登录login 注册register 验证码captchaImage 允许匿名访问 - requests.antMatchers("/login", "/register", "/captchaImage").permitAll() + // 对于登录login 注册register 验证码captchaImage CAS登录 允许匿名访问 + requests.antMatchers("/login", "/register", "/captchaImage", "/cas/login").permitAll() // 静态资源,可匿名访问 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/AsyncManager.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/AsyncManager.java index 7387a02..e9d07d8 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/AsyncManager.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/manager/AsyncManager.java @@ -8,7 +8,7 @@ import com.ruoyi.common.utils.spring.SpringUtils; /** * 异步任务管理器 - * + * * @author ruoyi */ public class AsyncManager @@ -21,7 +21,7 @@ public class AsyncManager /** * 异步操作任务调度线程池 */ - private ScheduledExecutorService executor = SpringUtils.getBean("scheduledExecutorService"); + private volatile ScheduledExecutorService executor; /** * 单例模式 @@ -35,14 +35,60 @@ public class AsyncManager return me; } + /** + * 获取线程池执行器(延迟初始化) + */ + private ScheduledExecutorService getExecutor() + { + if (executor == null) + { + synchronized (this) + { + if (executor == null) + { + try + { + // 检查Spring上下文是否已经初始化 + if (SpringUtils.getApplicationContext() != null) + { + executor = SpringUtils.getBean("scheduledExecutorService"); + } + else + { + // Spring上下文未初始化,创建临时线程池 + executor = java.util.concurrent.Executors.newScheduledThreadPool(10); + } + } + catch (Exception e) + { + // 如果获取失败,创建临时线程池 + System.err.println("Failed to get scheduledExecutorService bean, creating temporary executor: " + e.getMessage()); + executor = java.util.concurrent.Executors.newScheduledThreadPool(10); + } + } + } + } + return executor; + } + /** * 执行任务 - * + * * @param task 任务 */ public void execute(TimerTask task) { - executor.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS); + ScheduledExecutorService exec = getExecutor(); + if (exec != null) + { + exec.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS); + } + else + { + // 如果线程池不可用,直接在当前线程执行 + System.err.println("Executor is null, running task in current thread"); + task.run(); + } } /** @@ -50,6 +96,9 @@ public class AsyncManager */ public void shutdown() { - Threads.shutdownAndAwaitTermination(executor); + if (executor != null) + { + Threads.shutdownAndAwaitTermination(executor); + } } } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/CasUtils.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/CasUtils.java new file mode 100644 index 0000000..ef60b8b --- /dev/null +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/CasUtils.java @@ -0,0 +1,207 @@ +package com.ruoyi.framework.web.service; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.security.cert.X509Certificate; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import org.springframework.stereotype.Component; +import com.ruoyi.common.utils.StringUtils; + +/** + * CAS工具类 + * + * @author ruoyi + */ +@Component +public class CasUtils +{ + public String validateTicketByUrl(String validateUrl, String ticket, String service) + { + if (StringUtils.isEmpty(validateUrl) || StringUtils.isEmpty(ticket) || StringUtils.isEmpty(service)) + { + return null; + } + try + { + String url = validateUrl + + (validateUrl.contains("?") ? "&" : "?") + + "ticket=" + URLEncoder.encode(ticket, StandardCharsets.UTF_8.toString()) + + "&service=" + URLEncoder.encode(service, StandardCharsets.UTF_8.toString()); + String response = sendHttpRequest(url); + return parseUsername(response); + } + catch (Exception e) + { + e.printStackTrace(); + return null; + } + } + /** + * 验证CAS票据 + * + * @param casServerUrl CAS服务器地址 + * @param ticket CAS票据 + * @param service 服务地址 + * @return 用户名,验证失败返回null + */ + public String validateTicket(String casServerUrl, String ticket, String service) + { + if (StringUtils.isEmpty(casServerUrl) || StringUtils.isEmpty(ticket) || StringUtils.isEmpty(service)) + { + return null; + } + + try + { + // 构建验证URL + String validateUrl = casServerUrl + "/serviceValidate" + + "?ticket=" + URLEncoder.encode(ticket, StandardCharsets.UTF_8.toString()) + + "&service=" + URLEncoder.encode(service, StandardCharsets.UTF_8.toString()); + + // 发送HTTP请求验证票据 + String response = sendHttpRequest(validateUrl); + + // 解析响应获取用户名 + return parseUsername(response); + } + catch (Exception e) + { + e.printStackTrace(); + return null; + } + } + + /** + * 发送HTTP请求 + * + * @param urlString 请求URL + * @return 响应内容 + * @throws IOException IO异常 + */ + private String sendHttpRequest(String urlString) throws IOException + { + URL url = new URL(urlString); + HttpURLConnection connection = null; + + try + { + if (urlString.startsWith("https")) + { + // 配置HTTPS连接,忽略SSL证书验证 + HttpsURLConnection httpsConnection = (HttpsURLConnection) url.openConnection(); + httpsConnection.setSSLSocketFactory(createTrustAllSSLContext().getSocketFactory()); + httpsConnection.setHostnameVerifier((hostname, session) -> true); + connection = httpsConnection; + } + else + { + connection = (HttpURLConnection) url.openConnection(); + } + + connection.setRequestMethod("GET"); + connection.setConnectTimeout(10000); + connection.setReadTimeout(10000); + + // 读取响应 + try (BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8))) + { + StringBuilder response = new StringBuilder(); + String line; + while ((line = reader.readLine()) != null) + { + response.append(line).append("\n"); + } + return response.toString(); + } + } + finally + { + if (connection != null) + { + connection.disconnect(); + } + } + } + + /** + * 创建信任所有证书的SSL上下文 + * + * @return SSL上下文 + */ + private SSLContext createTrustAllSSLContext() + { + try + { + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(null, new TrustManager[] + { + new X509TrustManager() + { + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType) {} + + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType) {} + + @Override + public X509Certificate[] getAcceptedIssuers() + { + return new X509Certificate[0]; + } + } + }, null); + return sslContext; + } + catch (Exception e) + { + throw new RuntimeException("Failed to create SSL context", e); + } + } + + /** + * 解析CAS响应获取用户名 + * + * @param response CAS服务器响应 + * @return 用户名,解析失败返回null + */ + private String parseUsername(String response) + { + if (StringUtils.isEmpty(response)) + { + return null; + } + + // 检查是否验证成功 + if (!response.contains("")) + { + return null; + } + + // 提取用户名 + String userTag = ""; + String userEndTag = ""; + + int startIndex = response.indexOf(userTag); + if (startIndex == -1) + { + return null; + } + + startIndex += userTag.length(); + int endIndex = response.indexOf(userEndTag, startIndex); + if (endIndex == -1) + { + return null; + } + + return response.substring(startIndex, endIndex).trim(); + } +} diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java index fe16427..a606efa 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java @@ -2,6 +2,7 @@ package com.ruoyi.framework.web.service; import javax.annotation.Resource; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.BadCredentialsException; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; @@ -31,12 +32,11 @@ import com.ruoyi.system.service.ISysUserService; /** * 登录校验方法 - * + * * @author ruoyi */ @Component -public class SysLoginService -{ +public class SysLoginService { @Autowired private TokenService tokenService; @@ -45,55 +45,59 @@ public class SysLoginService @Autowired private RedisCache redisCache; - + @Autowired private ISysUserService userService; @Autowired private ISysConfigService configService; + @Value("${cas.server.url:}") + private String casServerUrl; + + @Autowired + private SysPermissionService permissionService; + + @Autowired + private CasUtils casUtils; + /** * 登录验证 - * + * * @param username 用户名 * @param password 密码 - * @param code 验证码 - * @param uuid 唯一标识 + * @param code 验证码 + * @param uuid 唯一标识 * @return 结果 */ - public String login(String username, String password, String code, String uuid) - { + public String login(String username, String password, String code, String uuid) { // 验证码校验 validateCaptcha(username, code, uuid); // 登录前置校验 loginPreCheck(username, password); // 用户验证 Authentication authentication = null; - try - { - UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password); + try { + UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, + password); AuthenticationContextHolder.setContext(authenticationToken); // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername authentication = authenticationManager.authenticate(authenticationToken); - } - catch (Exception e) - { - if (e instanceof BadCredentialsException) - { - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"))); + } catch (Exception e) { + if (e instanceof BadCredentialsException) { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, + MessageUtils.message("user.password.not.match"))); throw new UserPasswordNotMatchException(); - } - else - { - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage())); + } else { + AsyncManager.me() + .execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage())); throw new ServiceException(e.getMessage()); } - } - finally - { + } finally { AuthenticationContextHolder.clearContext(); } - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"))); + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, + MessageUtils.message("user.login.success"))); LoginUser loginUser = (LoginUser) authentication.getPrincipal(); recordLoginInfo(loginUser.getUserId()); // 生成token @@ -101,29 +105,108 @@ public class SysLoginService } /** - * 校验验证码 - * - * @param username 用户名 - * @param code 验证码 - * @param uuid 唯一标识 + * CAS登录验证 + * + * @param ticket CAS票据 + * @param service 服务地址 * @return 结果 */ - public void validateCaptcha(String username, String code, String uuid) - { + public String casLogin(String ticket, String service) { + String validateUrl = configService.selectConfigByKey("cas.validate.url"); + String casServerUrl = configService.selectConfigByKey("cas.server.url"); + if (StringUtils.isEmpty(validateUrl) && StringUtils.isEmpty(casServerUrl)) { + throw new ServiceException("CAS服务器地址未配置"); + } + + // 如果服务地址包含查询参数,提取基础地址用于CAS验证 + String baseService = service; + int queryIndex = service.indexOf('?'); + if (queryIndex > 0) { + baseService = service.substring(0, queryIndex); + } + + String username = StringUtils.isEmpty(validateUrl) + ? casUtils.validateTicket(casServerUrl, ticket, baseService) + : casUtils.validateTicketByUrl(validateUrl, ticket, baseService); + if (StringUtils.isEmpty(username)) { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, "CAS票据验证失败")); + throw new ServiceException("CAS票据验证失败"); + } + + // 用户验证 + Authentication authentication = null; + try { + // 创建认证令牌,CAS登录不需要密码验证 + UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, + null); + AuthenticationContextHolder.setContext(authenticationToken); + + // 通过用户名加载用户信息 + LoginUser loginUser = loadUserByUsername(username); + if (loginUser == null) { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, "用户不存在")); + throw new ServiceException("用户不存在"); + } + + // 创建认证对象 + authentication = new UsernamePasswordAuthenticationToken(loginUser, null, loginUser.getAuthorities()); + } catch (Exception e) { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage())); + throw new ServiceException(e.getMessage()); + } finally { + AuthenticationContextHolder.clearContext(); + } + + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, + MessageUtils.message("user.login.success"))); + LoginUser loginUser = (LoginUser) authentication.getPrincipal(); + recordLoginInfo(loginUser.getUserId()); + // 生成token + return tokenService.createToken(loginUser); + } + + /** + * 通过用户名加载用户信息 + * + * @param username 用户名 + * @return 登录用户信息 + */ + private LoginUser loadUserByUsername(String username) { + SysUser user = userService.selectUserByUserName(username); + if (user == null) { + return null; + } + + // 检查用户状态 + if (UserConstants.USER_DISABLE.equals(user.getStatus())) { + throw new ServiceException("用户已被停用,请联系管理员"); + } + + return new LoginUser(user.getUserId(), user.getDeptId(), user, null); + } + + /** + * 校验验证码 + * + * @param username 用户名 + * @param code 验证码 + * @param uuid 唯一标识 + * @return 结果 + */ + public void validateCaptcha(String username, String code, String uuid) { boolean captchaEnabled = configService.selectCaptchaEnabled(); - if (captchaEnabled) - { + if (captchaEnabled) { String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, ""); String captcha = redisCache.getCacheObject(verifyKey); - if (captcha == null) - { - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"))); + if (captcha == null) { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, + MessageUtils.message("user.jcaptcha.expire"))); throw new CaptchaExpireException(); } redisCache.deleteObject(verifyKey); - if (!code.equalsIgnoreCase(captcha)) - { - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"))); + if (!code.equalsIgnoreCase(captcha)) { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, + MessageUtils.message("user.jcaptcha.error"))); throw new CaptchaException(); } } @@ -131,36 +214,36 @@ public class SysLoginService /** * 登录前置校验 + * * @param username 用户名 * @param password 用户密码 */ - public void loginPreCheck(String username, String password) - { + public void loginPreCheck(String username, String password) { // 用户名或密码为空 错误 - if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) - { - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("not.null"))); + if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) { + AsyncManager.me().execute( + AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("not.null"))); throw new UserNotExistsException(); } // 密码如果不在指定范围内 错误 if (password.length() < UserConstants.PASSWORD_MIN_LENGTH - || password.length() > UserConstants.PASSWORD_MAX_LENGTH) - { - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"))); + || password.length() > UserConstants.PASSWORD_MAX_LENGTH) { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, + MessageUtils.message("user.password.not.match"))); throw new UserPasswordNotMatchException(); } // 用户名不在指定范围内 错误 if (username.length() < UserConstants.USERNAME_MIN_LENGTH - || username.length() > UserConstants.USERNAME_MAX_LENGTH) - { - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"))); + || username.length() > UserConstants.USERNAME_MAX_LENGTH) { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, + MessageUtils.message("user.password.not.match"))); throw new UserPasswordNotMatchException(); } // IP黑名单校验 String blackStr = configService.selectConfigByKey("sys.login.blackIPList"); - if (IpUtils.isMatchedIp(blackStr, IpUtils.getIpAddr())) - { - AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("login.blocked"))); + if (IpUtils.isMatchedIp(blackStr, IpUtils.getIpAddr())) { + AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, + MessageUtils.message("login.blocked"))); throw new BlackListException(); } } @@ -170,8 +253,7 @@ public class SysLoginService * * @param userId 用户ID */ - public void recordLoginInfo(Long userId) - { + public void recordLoginInfo(Long userId) { SysUser sysUser = new SysUser(); sysUser.setUserId(userId); sysUser.setLoginIp(IpUtils.getIpAddr()); diff --git a/ruoyi-framework/target/maven-archiver/pom.properties b/ruoyi-framework/target/maven-archiver/pom.properties new file mode 100644 index 0000000..3bac24d --- /dev/null +++ b/ruoyi-framework/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=ruoyi-framework +groupId=com.ruoyi +version=3.8.8 diff --git a/ruoyi-framework/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/ruoyi-framework/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..471fe3b --- /dev/null +++ b/ruoyi-framework/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,51 @@ +com\ruoyi\framework\config\CaptchaConfig.class +com\ruoyi\framework\config\ServerConfig.class +com\ruoyi\framework\web\service\SysLoginService.class +com\ruoyi\framework\security\handle\AuthenticationEntryPointImpl.class +com\ruoyi\framework\security\context\AuthenticationContextHolder.class +com\ruoyi\framework\web\service\PermissionService.class +com\ruoyi\framework\web\domain\server\Cpu.class +com\ruoyi\framework\web\domain\server\Mem.class +com\ruoyi\framework\config\MyBatisConfig.class +com\ruoyi\framework\config\DruidConfig$1.class +com\ruoyi\framework\manager\factory\AsyncFactory$1.class +com\ruoyi\framework\manager\factory\AsyncFactory.class +com\ruoyi\framework\web\service\SysRegisterService.class +com\ruoyi\framework\config\FilterConfig.class +com\ruoyi\framework\web\service\CasUtils$1.class +com\ruoyi\framework\manager\ShutdownManager.class +com\ruoyi\framework\datasource\DynamicDataSource.class +com\ruoyi\framework\config\properties\PermitAllUrlProperties.class +com\ruoyi\framework\web\service\CasUtils.class +com\ruoyi\framework\web\service\SysPermissionService.class +com\ruoyi\framework\web\exception\GlobalExceptionHandler.class +com\ruoyi\framework\config\ThreadPoolConfig$1.class +com\ruoyi\framework\manager\factory\AsyncFactory$2.class +com\ruoyi\framework\config\SecurityConfig.class +com\ruoyi\framework\web\service\UserDetailsServiceImpl.class +com\ruoyi\framework\aspectj\RateLimiterAspect.class +com\ruoyi\framework\config\KaptchaTextCreator.class +com\ruoyi\framework\config\ResourcesConfig.class +com\ruoyi\framework\datasource\DynamicDataSourceContextHolder.class +com\ruoyi\framework\interceptor\RepeatSubmitInterceptor.class +com\ruoyi\framework\web\domain\server\Jvm.class +com\ruoyi\framework\config\properties\DruidProperties.class +com\ruoyi\framework\aspectj\DataSourceAspect.class +com\ruoyi\framework\aspectj\LogAspect.class +com\ruoyi\framework\config\I18nConfig.class +com\ruoyi\framework\config\FastJson2JsonRedisSerializer.class +com\ruoyi\framework\web\domain\server\SysFile.class +com\ruoyi\framework\manager\AsyncManager.class +com\ruoyi\framework\web\service\SysPasswordService.class +com\ruoyi\framework\interceptor\impl\SameUrlDataInterceptor.class +com\ruoyi\framework\security\context\PermissionContextHolder.class +com\ruoyi\framework\security\filter\JwtAuthenticationTokenFilter.class +com\ruoyi\framework\web\service\TokenService.class +com\ruoyi\framework\config\ThreadPoolConfig.class +com\ruoyi\framework\config\DruidConfig.class +com\ruoyi\framework\web\domain\server\Sys.class +com\ruoyi\framework\config\ApplicationConfig.class +com\ruoyi\framework\config\RedisConfig.class +com\ruoyi\framework\web\domain\Server.class +com\ruoyi\framework\security\handle\LogoutSuccessHandlerImpl.class +com\ruoyi\framework\aspectj\DataScopeAspect.class diff --git a/ruoyi-framework/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/ruoyi-framework/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..bea6a40 --- /dev/null +++ b/ruoyi-framework/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,46 @@ +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\config\FilterConfig.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\manager\factory\AsyncFactory.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\interceptor\RepeatSubmitInterceptor.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\config\MyBatisConfig.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\config\properties\DruidProperties.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\web\domain\server\Sys.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\aspectj\DataSourceAspect.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\web\domain\server\Jvm.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\config\ThreadPoolConfig.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\config\RedisConfig.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\web\domain\server\Mem.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\web\domain\Server.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\datasource\DynamicDataSource.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\web\service\SysPasswordService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\interceptor\impl\SameUrlDataInterceptor.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\security\filter\JwtAuthenticationTokenFilter.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\config\ApplicationConfig.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\web\domain\server\Cpu.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\web\service\SysPermissionService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\security\context\AuthenticationContextHolder.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\security\handle\AuthenticationEntryPointImpl.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\security\handle\LogoutSuccessHandlerImpl.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\config\properties\PermitAllUrlProperties.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\security\context\PermissionContextHolder.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\manager\AsyncManager.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\config\ServerConfig.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\web\service\PermissionService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\config\DruidConfig.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\web\service\TokenService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\aspectj\RateLimiterAspect.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\web\service\SysRegisterService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\aspectj\LogAspect.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\datasource\DynamicDataSourceContextHolder.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\config\ResourcesConfig.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\config\FastJson2JsonRedisSerializer.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\config\CaptchaConfig.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\config\I18nConfig.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\manager\ShutdownManager.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\web\service\CasUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\config\KaptchaTextCreator.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\config\SecurityConfig.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\web\domain\server\SysFile.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\web\service\UserDetailsServiceImpl.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\aspectj\DataScopeAspect.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\web\service\SysLoginService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-framework\src\main\java\com\ruoyi\framework\web\exception\GlobalExceptionHandler.java diff --git a/ruoyi-generator/target/classes/generator.yml b/ruoyi-generator/target/classes/generator.yml new file mode 100644 index 0000000..7eae68e --- /dev/null +++ b/ruoyi-generator/target/classes/generator.yml @@ -0,0 +1,10 @@ +# 代码生成 +gen: + # 作者 + author: ruoyi + # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool + packageName: com.ruoyi.system + # 自动去除表前缀,默认是false + autoRemovePre: false + # 表前缀(生成类名不会包含表前缀,多个用逗号分隔) + tablePrefix: sys_ \ No newline at end of file diff --git a/ruoyi-generator/target/classes/mapper/generator/GenTableColumnMapper.xml b/ruoyi-generator/target/classes/mapper/generator/GenTableColumnMapper.xml new file mode 100644 index 0000000..52857e8 --- /dev/null +++ b/ruoyi-generator/target/classes/mapper/generator/GenTableColumnMapper.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select column_id, table_id, column_name, column_comment, column_type, java_type, java_field, is_pk, is_increment, is_required, is_insert, is_edit, is_list, is_query, query_type, html_type, dict_type, sort, create_by, create_time, update_by, update_time from gen_table_column + + + + + + + + insert into gen_table_column ( + table_id, + column_name, + column_comment, + column_type, + java_type, + java_field, + is_pk, + is_increment, + is_required, + is_insert, + is_edit, + is_list, + is_query, + query_type, + html_type, + dict_type, + sort, + create_by, + create_time + )values( + #{tableId}, + #{columnName}, + #{columnComment}, + #{columnType}, + #{javaType}, + #{javaField}, + #{isPk}, + #{isIncrement}, + #{isRequired}, + #{isInsert}, + #{isEdit}, + #{isList}, + #{isQuery}, + #{queryType}, + #{htmlType}, + #{dictType}, + #{sort}, + #{createBy}, + sysdate() + ) + + + + update gen_table_column + + column_comment = #{columnComment}, + java_type = #{javaType}, + java_field = #{javaField}, + is_insert = #{isInsert}, + is_edit = #{isEdit}, + is_list = #{isList}, + is_query = #{isQuery}, + is_required = #{isRequired}, + query_type = #{queryType}, + html_type = #{htmlType}, + dict_type = #{dictType}, + sort = #{sort}, + update_by = #{updateBy}, + update_time = sysdate() + + where column_id = #{columnId} + + + + delete from gen_table_column where table_id in + + #{tableId} + + + + + delete from gen_table_column where column_id in + + #{item.columnId} + + + + \ No newline at end of file diff --git a/ruoyi-generator/target/classes/mapper/generator/GenTableMapper.xml b/ruoyi-generator/target/classes/mapper/generator/GenTableMapper.xml new file mode 100644 index 0000000..d1110f7 --- /dev/null +++ b/ruoyi-generator/target/classes/mapper/generator/GenTableMapper.xml @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, tpl_web_type, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table + + + + + + + + + + + + + + + + + + insert into gen_table ( + table_name, + table_comment, + class_name, + tpl_category, + tpl_web_type, + package_name, + module_name, + business_name, + function_name, + function_author, + gen_type, + gen_path, + remark, + create_by, + create_time + )values( + #{tableName}, + #{tableComment}, + #{className}, + #{tplCategory}, + #{tplWebType}, + #{packageName}, + #{moduleName}, + #{businessName}, + #{functionName}, + #{functionAuthor}, + #{genType}, + #{genPath}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + ${sql} + + + + update gen_table + + table_name = #{tableName}, + table_comment = #{tableComment}, + sub_table_name = #{subTableName}, + sub_table_fk_name = #{subTableFkName}, + class_name = #{className}, + function_author = #{functionAuthor}, + gen_type = #{genType}, + gen_path = #{genPath}, + tpl_category = #{tplCategory}, + tpl_web_type = #{tplWebType}, + package_name = #{packageName}, + module_name = #{moduleName}, + business_name = #{businessName}, + function_name = #{functionName}, + options = #{options}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = sysdate() + + where table_id = #{tableId} + + + + delete from gen_table where table_id in + + #{tableId} + + + + \ No newline at end of file diff --git a/ruoyi-generator/target/classes/vm/java/controller.java.vm b/ruoyi-generator/target/classes/vm/java/controller.java.vm new file mode 100644 index 0000000..bf88988 --- /dev/null +++ b/ruoyi-generator/target/classes/vm/java/controller.java.vm @@ -0,0 +1,115 @@ +package ${packageName}.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import ${packageName}.domain.${ClassName}; +import ${packageName}.service.I${ClassName}Service; +import com.ruoyi.common.utils.poi.ExcelUtil; +#if($table.crud || $table.sub) +import com.ruoyi.common.core.page.TableDataInfo; +#elseif($table.tree) +#end + +/** + * ${functionName}Controller + * + * @author ${author} + * @date ${datetime} + */ +@RestController +@RequestMapping("/${moduleName}/${businessName}") +public class ${ClassName}Controller extends BaseController +{ + @Autowired + private I${ClassName}Service ${className}Service; + + /** + * 查询${functionName}列表 + */ + @PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')") + @GetMapping("/list") +#if($table.crud || $table.sub) + public TableDataInfo list(${ClassName} ${className}) + { + startPage(); + List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); + return getDataTable(list); + } +#elseif($table.tree) + public AjaxResult list(${ClassName} ${className}) + { + List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); + return success(list); + } +#end + + /** + * 导出${functionName}列表 + */ + @PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')") + @Log(title = "${functionName}", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ${ClassName} ${className}) + { + List<${ClassName}> list = ${className}Service.select${ClassName}List(${className}); + ExcelUtil<${ClassName}> util = new ExcelUtil<${ClassName}>(${ClassName}.class); + util.exportExcel(response, list, "${functionName}数据"); + } + + /** + * 获取${functionName}详细信息 + */ + @PreAuthorize("@ss.hasPermi('${permissionPrefix}:query')") + @GetMapping(value = "/{${pkColumn.javaField}}") + public AjaxResult getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}) + { + return success(${className}Service.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField})); + } + + /** + * 新增${functionName} + */ + @PreAuthorize("@ss.hasPermi('${permissionPrefix}:add')") + @Log(title = "${functionName}", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ${ClassName} ${className}) + { + return toAjax(${className}Service.insert${ClassName}(${className})); + } + + /** + * 修改${functionName} + */ + @PreAuthorize("@ss.hasPermi('${permissionPrefix}:edit')") + @Log(title = "${functionName}", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ${ClassName} ${className}) + { + return toAjax(${className}Service.update${ClassName}(${className})); + } + + /** + * 删除${functionName} + */ + @PreAuthorize("@ss.hasPermi('${permissionPrefix}:remove')") + @Log(title = "${functionName}", businessType = BusinessType.DELETE) + @DeleteMapping("/{${pkColumn.javaField}s}") + public AjaxResult remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) + { + return toAjax(${className}Service.delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaField}s)); + } +} diff --git a/ruoyi-generator/target/classes/vm/java/domain.java.vm b/ruoyi-generator/target/classes/vm/java/domain.java.vm new file mode 100644 index 0000000..bd51c17 --- /dev/null +++ b/ruoyi-generator/target/classes/vm/java/domain.java.vm @@ -0,0 +1,105 @@ +package ${packageName}.domain; + +#foreach ($import in $importList) +import ${import}; +#end +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +#if($table.crud || $table.sub) +import com.ruoyi.common.core.domain.BaseEntity; +#elseif($table.tree) +import com.ruoyi.common.core.domain.TreeEntity; +#end + +/** + * ${functionName}对象 ${tableName} + * + * @author ${author} + * @date ${datetime} + */ +#if($table.crud || $table.sub) +#set($Entity="BaseEntity") +#elseif($table.tree) +#set($Entity="TreeEntity") +#end +public class ${ClassName} extends ${Entity} +{ + private static final long serialVersionUID = 1L; + +#foreach ($column in $columns) +#if(!$table.isSuperColumn($column.javaField)) + /** $column.columnComment */ +#if($column.list) +#set($parentheseIndex=$column.columnComment.indexOf("(")) +#if($parentheseIndex != -1) +#set($comment=$column.columnComment.substring(0, $parentheseIndex)) +#else +#set($comment=$column.columnComment) +#end +#if($parentheseIndex != -1) + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") +#elseif($column.javaType == 'Date') + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd") +#else + @Excel(name = "${comment}") +#end +#end + private $column.javaType $column.javaField; + +#end +#end +#if($table.sub) + /** $table.subTable.functionName信息 */ + private List<${subClassName}> ${subclassName}List; + +#end +#foreach ($column in $columns) +#if(!$table.isSuperColumn($column.javaField)) +#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) +#set($AttrName=$column.javaField) +#else +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#end + public void set${AttrName}($column.javaType $column.javaField) + { + this.$column.javaField = $column.javaField; + } + + public $column.javaType get${AttrName}() + { + return $column.javaField; + } +#end +#end + +#if($table.sub) + public List<${subClassName}> get${subClassName}List() + { + return ${subclassName}List; + } + + public void set${subClassName}List(List<${subClassName}> ${subclassName}List) + { + this.${subclassName}List = ${subclassName}List; + } + +#end + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) +#foreach ($column in $columns) +#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) +#set($AttrName=$column.javaField) +#else +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#end + .append("${column.javaField}", get${AttrName}()) +#end +#if($table.sub) + .append("${subclassName}List", get${subClassName}List()) +#end + .toString(); + } +} diff --git a/ruoyi-generator/target/classes/vm/java/mapper.java.vm b/ruoyi-generator/target/classes/vm/java/mapper.java.vm new file mode 100644 index 0000000..7e7d7c2 --- /dev/null +++ b/ruoyi-generator/target/classes/vm/java/mapper.java.vm @@ -0,0 +1,91 @@ +package ${packageName}.mapper; + +import java.util.List; +import ${packageName}.domain.${ClassName}; +#if($table.sub) +import ${packageName}.domain.${subClassName}; +#end + +/** + * ${functionName}Mapper接口 + * + * @author ${author} + * @date ${datetime} + */ +public interface ${ClassName}Mapper +{ + /** + * 查询${functionName} + * + * @param ${pkColumn.javaField} ${functionName}主键 + * @return ${functionName} + */ + public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); + + /** + * 查询${functionName}列表 + * + * @param ${className} ${functionName} + * @return ${functionName}集合 + */ + public List<${ClassName}> select${ClassName}List(${ClassName} ${className}); + + /** + * 新增${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ + public int insert${ClassName}(${ClassName} ${className}); + + /** + * 修改${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ + public int update${ClassName}(${ClassName} ${className}); + + /** + * 删除${functionName} + * + * @param ${pkColumn.javaField} ${functionName}主键 + * @return 结果 + */ + public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); + + /** + * 批量删除${functionName} + * + * @param ${pkColumn.javaField}s 需要删除的数据主键集合 + * @return 结果 + */ + public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s); +#if($table.sub) + + /** + * 批量删除${subTable.functionName} + * + * @param ${pkColumn.javaField}s 需要删除的数据主键集合 + * @return 结果 + */ + public int delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaType}[] ${pkColumn.javaField}s); + + /** + * 批量新增${subTable.functionName} + * + * @param ${subclassName}List ${subTable.functionName}列表 + * @return 结果 + */ + public int batch${subClassName}(List<${subClassName}> ${subclassName}List); + + + /** + * 通过${functionName}主键删除${subTable.functionName}信息 + * + * @param ${pkColumn.javaField} ${functionName}ID + * @return 结果 + */ + public int delete${subClassName}By${subTableFkClassName}(${pkColumn.javaType} ${pkColumn.javaField}); +#end +} diff --git a/ruoyi-generator/target/classes/vm/java/service.java.vm b/ruoyi-generator/target/classes/vm/java/service.java.vm new file mode 100644 index 0000000..264882b --- /dev/null +++ b/ruoyi-generator/target/classes/vm/java/service.java.vm @@ -0,0 +1,61 @@ +package ${packageName}.service; + +import java.util.List; +import ${packageName}.domain.${ClassName}; + +/** + * ${functionName}Service接口 + * + * @author ${author} + * @date ${datetime} + */ +public interface I${ClassName}Service +{ + /** + * 查询${functionName} + * + * @param ${pkColumn.javaField} ${functionName}主键 + * @return ${functionName} + */ + public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); + + /** + * 查询${functionName}列表 + * + * @param ${className} ${functionName} + * @return ${functionName}集合 + */ + public List<${ClassName}> select${ClassName}List(${ClassName} ${className}); + + /** + * 新增${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ + public int insert${ClassName}(${ClassName} ${className}); + + /** + * 修改${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ + public int update${ClassName}(${ClassName} ${className}); + + /** + * 批量删除${functionName} + * + * @param ${pkColumn.javaField}s 需要删除的${functionName}主键集合 + * @return 结果 + */ + public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s); + + /** + * 删除${functionName}信息 + * + * @param ${pkColumn.javaField} ${functionName}主键 + * @return 结果 + */ + public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}); +} diff --git a/ruoyi-generator/target/classes/vm/java/serviceImpl.java.vm b/ruoyi-generator/target/classes/vm/java/serviceImpl.java.vm new file mode 100644 index 0000000..14746e1 --- /dev/null +++ b/ruoyi-generator/target/classes/vm/java/serviceImpl.java.vm @@ -0,0 +1,169 @@ +package ${packageName}.service.impl; + +import java.util.List; +#foreach ($column in $columns) +#if($column.javaField == 'createTime' || $column.javaField == 'updateTime') +import com.ruoyi.common.utils.DateUtils; +#break +#end +#end +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +#if($table.sub) +import java.util.ArrayList; +import com.ruoyi.common.utils.StringUtils; +import org.springframework.transaction.annotation.Transactional; +import ${packageName}.domain.${subClassName}; +#end +import ${packageName}.mapper.${ClassName}Mapper; +import ${packageName}.domain.${ClassName}; +import ${packageName}.service.I${ClassName}Service; + +/** + * ${functionName}Service业务层处理 + * + * @author ${author} + * @date ${datetime} + */ +@Service +public class ${ClassName}ServiceImpl implements I${ClassName}Service +{ + @Autowired + private ${ClassName}Mapper ${className}Mapper; + + /** + * 查询${functionName} + * + * @param ${pkColumn.javaField} ${functionName}主键 + * @return ${functionName} + */ + @Override + public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) + { + return ${className}Mapper.select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField}); + } + + /** + * 查询${functionName}列表 + * + * @param ${className} ${functionName} + * @return ${functionName} + */ + @Override + public List<${ClassName}> select${ClassName}List(${ClassName} ${className}) + { + return ${className}Mapper.select${ClassName}List(${className}); + } + + /** + * 新增${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ +#if($table.sub) + @Transactional +#end + @Override + public int insert${ClassName}(${ClassName} ${className}) + { +#foreach ($column in $columns) +#if($column.javaField == 'createTime') + ${className}.setCreateTime(DateUtils.getNowDate()); +#end +#end +#if($table.sub) + int rows = ${className}Mapper.insert${ClassName}(${className}); + insert${subClassName}(${className}); + return rows; +#else + return ${className}Mapper.insert${ClassName}(${className}); +#end + } + + /** + * 修改${functionName} + * + * @param ${className} ${functionName} + * @return 结果 + */ +#if($table.sub) + @Transactional +#end + @Override + public int update${ClassName}(${ClassName} ${className}) + { +#foreach ($column in $columns) +#if($column.javaField == 'updateTime') + ${className}.setUpdateTime(DateUtils.getNowDate()); +#end +#end +#if($table.sub) + ${className}Mapper.delete${subClassName}By${subTableFkClassName}(${className}.get${pkColumn.capJavaField}()); + insert${subClassName}(${className}); +#end + return ${className}Mapper.update${ClassName}(${className}); + } + + /** + * 批量删除${functionName} + * + * @param ${pkColumn.javaField}s 需要删除的${functionName}主键 + * @return 结果 + */ +#if($table.sub) + @Transactional +#end + @Override + public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s) + { +#if($table.sub) + ${className}Mapper.delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaField}s); +#end + return ${className}Mapper.delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaField}s); + } + + /** + * 删除${functionName}信息 + * + * @param ${pkColumn.javaField} ${functionName}主键 + * @return 结果 + */ +#if($table.sub) + @Transactional +#end + @Override + public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) + { +#if($table.sub) + ${className}Mapper.delete${subClassName}By${subTableFkClassName}(${pkColumn.javaField}); +#end + return ${className}Mapper.delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaField}); + } +#if($table.sub) + + /** + * 新增${subTable.functionName}信息 + * + * @param ${className} ${functionName}对象 + */ + public void insert${subClassName}(${ClassName} ${className}) + { + List<${subClassName}> ${subclassName}List = ${className}.get${subClassName}List(); + ${pkColumn.javaType} ${pkColumn.javaField} = ${className}.get${pkColumn.capJavaField}(); + if (StringUtils.isNotNull(${subclassName}List)) + { + List<${subClassName}> list = new ArrayList<${subClassName}>(); + for (${subClassName} ${subclassName} : ${subclassName}List) + { + ${subclassName}.set${subTableFkClassName}(${pkColumn.javaField}); + list.add(${subclassName}); + } + if (list.size() > 0) + { + ${className}Mapper.batch${subClassName}(list); + } + } + } +#end +} diff --git a/ruoyi-generator/target/classes/vm/java/sub-domain.java.vm b/ruoyi-generator/target/classes/vm/java/sub-domain.java.vm new file mode 100644 index 0000000..a3f53eb --- /dev/null +++ b/ruoyi-generator/target/classes/vm/java/sub-domain.java.vm @@ -0,0 +1,76 @@ +package ${packageName}.domain; + +#foreach ($import in $subImportList) +import ${import}; +#end +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * ${subTable.functionName}对象 ${subTableName} + * + * @author ${author} + * @date ${datetime} + */ +public class ${subClassName} extends BaseEntity +{ + private static final long serialVersionUID = 1L; + +#foreach ($column in $subTable.columns) +#if(!$table.isSuperColumn($column.javaField)) + /** $column.columnComment */ +#if($column.list) +#set($parentheseIndex=$column.columnComment.indexOf("(")) +#if($parentheseIndex != -1) +#set($comment=$column.columnComment.substring(0, $parentheseIndex)) +#else +#set($comment=$column.columnComment) +#end +#if($parentheseIndex != -1) + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") +#elseif($column.javaType == 'Date') + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd") +#else + @Excel(name = "${comment}") +#end +#end + private $column.javaType $column.javaField; + +#end +#end +#foreach ($column in $subTable.columns) +#if(!$table.isSuperColumn($column.javaField)) +#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) +#set($AttrName=$column.javaField) +#else +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#end + public void set${AttrName}($column.javaType $column.javaField) + { + this.$column.javaField = $column.javaField; + } + + public $column.javaType get${AttrName}() + { + return $column.javaField; + } +#end +#end + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) +#foreach ($column in $subTable.columns) +#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]")) +#set($AttrName=$column.javaField) +#else +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) +#end + .append("${column.javaField}", get${AttrName}()) +#end + .toString(); + } +} diff --git a/ruoyi-generator/target/classes/vm/js/api.js.vm b/ruoyi-generator/target/classes/vm/js/api.js.vm new file mode 100644 index 0000000..9295524 --- /dev/null +++ b/ruoyi-generator/target/classes/vm/js/api.js.vm @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询${functionName}列表 +export function list${BusinessName}(query) { + return request({ + url: '/${moduleName}/${businessName}/list', + method: 'get', + params: query + }) +} + +// 查询${functionName}详细 +export function get${BusinessName}(${pkColumn.javaField}) { + return request({ + url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, + method: 'get' + }) +} + +// 新增${functionName} +export function add${BusinessName}(data) { + return request({ + url: '/${moduleName}/${businessName}', + method: 'post', + data: data + }) +} + +// 修改${functionName} +export function update${BusinessName}(data) { + return request({ + url: '/${moduleName}/${businessName}', + method: 'put', + data: data + }) +} + +// 删除${functionName} +export function del${BusinessName}(${pkColumn.javaField}) { + return request({ + url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField}, + method: 'delete' + }) +} diff --git a/ruoyi-generator/target/classes/vm/sql/sql.vm b/ruoyi-generator/target/classes/vm/sql/sql.vm new file mode 100644 index 0000000..0575583 --- /dev/null +++ b/ruoyi-generator/target/classes/vm/sql/sql.vm @@ -0,0 +1,22 @@ +-- 菜单 SQL +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 'admin', sysdate(), '', null, '${functionName}菜单'); + +-- 按钮父菜单ID +SELECT @parentId := LAST_INSERT_ID(); + +-- 按钮 SQL +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('${functionName}导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 'admin', sysdate(), '', null, ''); \ No newline at end of file diff --git a/ruoyi-generator/target/classes/vm/vue/index-tree.vue.vm b/ruoyi-generator/target/classes/vm/vue/index-tree.vue.vm new file mode 100644 index 0000000..4819c2a --- /dev/null +++ b/ruoyi-generator/target/classes/vm/vue/index-tree.vue.vm @@ -0,0 +1,505 @@ + + + diff --git a/ruoyi-generator/target/classes/vm/vue/index.vue.vm b/ruoyi-generator/target/classes/vm/vue/index.vue.vm new file mode 100644 index 0000000..6296014 --- /dev/null +++ b/ruoyi-generator/target/classes/vm/vue/index.vue.vm @@ -0,0 +1,602 @@ + + + diff --git a/ruoyi-generator/target/classes/vm/vue/v3/index-tree.vue.vm b/ruoyi-generator/target/classes/vm/vue/v3/index-tree.vue.vm new file mode 100644 index 0000000..c54d62b --- /dev/null +++ b/ruoyi-generator/target/classes/vm/vue/v3/index-tree.vue.vm @@ -0,0 +1,474 @@ + + + diff --git a/ruoyi-generator/target/classes/vm/vue/v3/index.vue.vm b/ruoyi-generator/target/classes/vm/vue/v3/index.vue.vm new file mode 100644 index 0000000..8b25665 --- /dev/null +++ b/ruoyi-generator/target/classes/vm/vue/v3/index.vue.vm @@ -0,0 +1,590 @@ + + + diff --git a/ruoyi-generator/target/classes/vm/xml/mapper.xml.vm b/ruoyi-generator/target/classes/vm/xml/mapper.xml.vm new file mode 100644 index 0000000..456755b --- /dev/null +++ b/ruoyi-generator/target/classes/vm/xml/mapper.xml.vm @@ -0,0 +1,140 @@ + + + + + +#foreach ($column in $columns) + +#end + +#if($table.sub) + + + + + + +#foreach ($column in $subTable.columns) + +#end + +#end + + + select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end from ${tableName} + + + + + +#if($table.sub) + + +#end + + + insert into ${tableName} + +#foreach($column in $columns) +#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment) + $column.columnName, +#end +#end + + +#foreach($column in $columns) +#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment) + #{$column.javaField}, +#end +#end + + + + + update ${tableName} + +#foreach($column in $columns) +#if($column.columnName != $pkColumn.columnName) + $column.columnName = #{$column.javaField}, +#end +#end + + where ${pkColumn.columnName} = #{${pkColumn.javaField}} + + + + delete from ${tableName} where ${pkColumn.columnName} = #{${pkColumn.javaField}} + + + + delete from ${tableName} where ${pkColumn.columnName} in + + #{${pkColumn.javaField}} + + +#if($table.sub) + + + delete from ${subTableName} where ${subTableFkName} in + + #{${subTableFkclassName}} + + + + + delete from ${subTableName} where ${subTableFkName} = #{${subTableFkclassName}} + + + + insert into ${subTableName}(#foreach($column in $subTable.columns) $column.columnName#if($foreach.count != $subTable.columns.size()),#end#end) values + + (#foreach($column in $subTable.columns) #{item.$column.javaField}#if($foreach.count != $subTable.columns.size()),#end#end) + + +#end + \ No newline at end of file diff --git a/ruoyi-generator/target/maven-archiver/pom.properties b/ruoyi-generator/target/maven-archiver/pom.properties new file mode 100644 index 0000000..9af635d --- /dev/null +++ b/ruoyi-generator/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=ruoyi-generator +groupId=com.ruoyi +version=3.8.8 diff --git a/ruoyi-generator/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/ruoyi-generator/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..9db6ad6 --- /dev/null +++ b/ruoyi-generator/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,13 @@ +com\ruoyi\generator\service\IGenTableColumnService.class +com\ruoyi\generator\controller\GenController.class +com\ruoyi\generator\domain\GenTable.class +com\ruoyi\generator\service\GenTableServiceImpl.class +com\ruoyi\generator\util\VelocityUtils.class +com\ruoyi\generator\mapper\GenTableMapper.class +com\ruoyi\generator\mapper\GenTableColumnMapper.class +com\ruoyi\generator\service\GenTableColumnServiceImpl.class +com\ruoyi\generator\util\GenUtils.class +com\ruoyi\generator\util\VelocityInitializer.class +com\ruoyi\generator\domain\GenTableColumn.class +com\ruoyi\generator\service\IGenTableService.class +com\ruoyi\generator\config\GenConfig.class diff --git a/ruoyi-generator/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/ruoyi-generator/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..5d434c0 --- /dev/null +++ b/ruoyi-generator/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,13 @@ +D:\code\pasd_V1.0\pasd_java\ruoyi-generator\src\main\java\com\ruoyi\generator\service\GenTableServiceImpl.java +D:\code\pasd_V1.0\pasd_java\ruoyi-generator\src\main\java\com\ruoyi\generator\mapper\GenTableColumnMapper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-generator\src\main\java\com\ruoyi\generator\config\GenConfig.java +D:\code\pasd_V1.0\pasd_java\ruoyi-generator\src\main\java\com\ruoyi\generator\domain\GenTable.java +D:\code\pasd_V1.0\pasd_java\ruoyi-generator\src\main\java\com\ruoyi\generator\util\VelocityUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-generator\src\main\java\com\ruoyi\generator\controller\GenController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-generator\src\main\java\com\ruoyi\generator\service\GenTableColumnServiceImpl.java +D:\code\pasd_V1.0\pasd_java\ruoyi-generator\src\main\java\com\ruoyi\generator\util\VelocityInitializer.java +D:\code\pasd_V1.0\pasd_java\ruoyi-generator\src\main\java\com\ruoyi\generator\service\IGenTableService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-generator\src\main\java\com\ruoyi\generator\mapper\GenTableMapper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-generator\src\main\java\com\ruoyi\generator\util\GenUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-generator\src\main\java\com\ruoyi\generator\service\IGenTableColumnService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-generator\src\main\java\com\ruoyi\generator\domain\GenTableColumn.java diff --git a/ruoyi-quartz/pom.xml b/ruoyi-quartz/pom.xml index 4e7a0ce..4e2702c 100644 --- a/ruoyi-quartz/pom.xml +++ b/ruoyi-quartz/pom.xml @@ -21,6 +21,7 @@ org.quartz-scheduler quartz + 2.3.2 com.mchange @@ -37,4 +38,4 @@ - \ No newline at end of file + diff --git a/ruoyi-quartz/target/classes/mapper/quartz/SysJobLogMapper.xml b/ruoyi-quartz/target/classes/mapper/quartz/SysJobLogMapper.xml new file mode 100644 index 0000000..ba1b683 --- /dev/null +++ b/ruoyi-quartz/target/classes/mapper/quartz/SysJobLogMapper.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + select job_log_id, job_name, job_group, invoke_target, job_message, status, exception_info, create_time + from sys_job_log + + + + + + + + + + delete from sys_job_log where job_log_id = #{jobLogId} + + + + delete from sys_job_log where job_log_id in + + #{jobLogId} + + + + + truncate table sys_job_log + + + + insert into sys_job_log( + job_log_id, + job_name, + job_group, + invoke_target, + job_message, + status, + exception_info, + create_time + )values( + #{jobLogId}, + #{jobName}, + #{jobGroup}, + #{invokeTarget}, + #{jobMessage}, + #{status}, + #{exceptionInfo}, + sysdate() + ) + + + \ No newline at end of file diff --git a/ruoyi-quartz/target/classes/mapper/quartz/SysJobMapper.xml b/ruoyi-quartz/target/classes/mapper/quartz/SysJobMapper.xml new file mode 100644 index 0000000..5605c44 --- /dev/null +++ b/ruoyi-quartz/target/classes/mapper/quartz/SysJobMapper.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + select job_id, job_name, job_group, invoke_target, cron_expression, misfire_policy, concurrent, status, create_by, create_time, remark + from sys_job + + + + + + + + + + delete from sys_job where job_id = #{jobId} + + + + delete from sys_job where job_id in + + #{jobId} + + + + + update sys_job + + job_name = #{jobName}, + job_group = #{jobGroup}, + invoke_target = #{invokeTarget}, + cron_expression = #{cronExpression}, + misfire_policy = #{misfirePolicy}, + concurrent = #{concurrent}, + status = #{status}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where job_id = #{jobId} + + + + insert into sys_job( + job_id, + job_name, + job_group, + invoke_target, + cron_expression, + misfire_policy, + concurrent, + status, + remark, + create_by, + create_time + )values( + #{jobId}, + #{jobName}, + #{jobGroup}, + #{invokeTarget}, + #{cronExpression}, + #{misfirePolicy}, + #{concurrent}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + + + \ No newline at end of file diff --git a/ruoyi-quartz/target/maven-archiver/pom.properties b/ruoyi-quartz/target/maven-archiver/pom.properties new file mode 100644 index 0000000..080f146 --- /dev/null +++ b/ruoyi-quartz/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=ruoyi-quartz +groupId=com.ruoyi +version=3.8.8 diff --git a/ruoyi-quartz/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/ruoyi-quartz/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..9fb6b30 --- /dev/null +++ b/ruoyi-quartz/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,17 @@ +com\ruoyi\quartz\util\QuartzDisallowConcurrentExecution.class +com\ruoyi\quartz\util\CronUtils.class +com\ruoyi\quartz\service\impl\SysJobLogServiceImpl.class +com\ruoyi\quartz\controller\SysJobController.class +com\ruoyi\quartz\util\ScheduleUtils.class +com\ruoyi\quartz\service\ISysJobLogService.class +com\ruoyi\quartz\mapper\SysJobMapper.class +com\ruoyi\quartz\mapper\SysJobLogMapper.class +com\ruoyi\quartz\domain\SysJob.class +com\ruoyi\quartz\domain\SysJobLog.class +com\ruoyi\quartz\controller\SysJobLogController.class +com\ruoyi\quartz\task\RyTask.class +com\ruoyi\quartz\util\AbstractQuartzJob.class +com\ruoyi\quartz\util\JobInvokeUtil.class +com\ruoyi\quartz\service\impl\SysJobServiceImpl.class +com\ruoyi\quartz\service\ISysJobService.class +com\ruoyi\quartz\util\QuartzJobExecution.class diff --git a/ruoyi-quartz/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/ruoyi-quartz/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..e9839d1 --- /dev/null +++ b/ruoyi-quartz/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,18 @@ +D:\code\pasd_V1.0\pasd_java\ruoyi-quartz\src\main\java\com\ruoyi\quartz\controller\SysJobController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-quartz\src\main\java\com\ruoyi\quartz\util\AbstractQuartzJob.java +D:\code\pasd_V1.0\pasd_java\ruoyi-quartz\src\main\java\com\ruoyi\quartz\util\CronUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-quartz\src\main\java\com\ruoyi\quartz\service\ISysJobService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-quartz\src\main\java\com\ruoyi\quartz\domain\SysJobLog.java +D:\code\pasd_V1.0\pasd_java\ruoyi-quartz\src\main\java\com\ruoyi\quartz\util\QuartzDisallowConcurrentExecution.java +D:\code\pasd_V1.0\pasd_java\ruoyi-quartz\src\main\java\com\ruoyi\quartz\util\ScheduleUtils.java +D:\code\pasd_V1.0\pasd_java\ruoyi-quartz\src\main\java\com\ruoyi\quartz\task\RyTask.java +D:\code\pasd_V1.0\pasd_java\ruoyi-quartz\src\main\java\com\ruoyi\quartz\service\impl\SysJobLogServiceImpl.java +D:\code\pasd_V1.0\pasd_java\ruoyi-quartz\src\main\java\com\ruoyi\quartz\domain\SysJob.java +D:\code\pasd_V1.0\pasd_java\ruoyi-quartz\src\main\java\com\ruoyi\quartz\service\ISysJobLogService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-quartz\src\main\java\com\ruoyi\quartz\mapper\SysJobLogMapper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-quartz\src\main\java\com\ruoyi\quartz\controller\SysJobLogController.java +D:\code\pasd_V1.0\pasd_java\ruoyi-quartz\src\main\java\com\ruoyi\quartz\config\ScheduleConfig.java +D:\code\pasd_V1.0\pasd_java\ruoyi-quartz\src\main\java\com\ruoyi\quartz\service\impl\SysJobServiceImpl.java +D:\code\pasd_V1.0\pasd_java\ruoyi-quartz\src\main\java\com\ruoyi\quartz\util\JobInvokeUtil.java +D:\code\pasd_V1.0\pasd_java\ruoyi-quartz\src\main\java\com\ruoyi\quartz\util\QuartzJobExecution.java +D:\code\pasd_V1.0\pasd_java\ruoyi-quartz\src\main\java\com\ruoyi\quartz\mapper\SysJobMapper.java diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java index fced569..c3744a8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java @@ -1,16 +1,17 @@ package com.ruoyi.system.service.impl; import java.util.List; + +import com.ruoyi.common.core.domain.entity.SysDictData; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.utils.DictUtils; import com.ruoyi.system.mapper.SysDictDataMapper; import com.ruoyi.system.service.ISysDictDataService; /** * 字典 业务层处理 - * + * * @author ruoyi */ @Service @@ -21,7 +22,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService /** * 根据条件分页查询字典数据 - * + * * @param dictData 字典数据信息 * @return 字典数据集合信息 */ @@ -33,7 +34,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService /** * 根据字典类型和字典键值查询字典数据信息 - * + * * @param dictType 字典类型 * @param dictValue 字典键值 * @return 字典标签 @@ -46,7 +47,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService /** * 根据字典数据ID查询信息 - * + * * @param dictCode 字典数据ID * @return 字典数据 */ @@ -58,7 +59,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService /** * 批量删除字典数据信息 - * + * * @param dictCodes 需要删除的字典数据ID */ @Override @@ -75,7 +76,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService /** * 新增保存字典数据信息 - * + * * @param data 字典数据信息 * @return 结果 */ @@ -93,7 +94,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService /** * 修改保存字典数据信息 - * + * * @param data 字典数据信息 * @return 结果 */ diff --git a/ruoyi-system/target/classes/mapper/system/SysConfigMapper.xml b/ruoyi-system/target/classes/mapper/system/SysConfigMapper.xml new file mode 100644 index 0000000..a5ff114 --- /dev/null +++ b/ruoyi-system/target/classes/mapper/system/SysConfigMapper.xml @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark + from sys_config + + + + + + + and config_id = #{configId} + + + and config_key = #{configKey} + + + + + + + + + + + + + + insert into sys_config ( + config_name, + config_key, + config_value, + config_type, + create_by, + remark, + create_time + )values( + #{configName}, + #{configKey}, + #{configValue}, + #{configType}, + #{createBy}, + #{remark}, + sysdate() + ) + + + + update sys_config + + config_name = #{configName}, + config_key = #{configKey}, + config_value = #{configValue}, + config_type = #{configType}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = sysdate() + + where config_id = #{configId} + + + + delete from sys_config where config_id = #{configId} + + + + delete from sys_config where config_id in + + #{configId} + + + + \ No newline at end of file diff --git a/ruoyi-system/target/classes/mapper/system/SysDeptMapper.xml b/ruoyi-system/target/classes/mapper/system/SysDeptMapper.xml new file mode 100644 index 0000000..cf439f6 --- /dev/null +++ b/ruoyi-system/target/classes/mapper/system/SysDeptMapper.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time + from sys_dept d + + + + + + + + + + + + + + + + + + + + insert into sys_dept( + dept_id, + parent_id, + dept_name, + ancestors, + order_num, + leader, + phone, + email, + status, + create_by, + create_time + )values( + #{deptId}, + #{parentId}, + #{deptName}, + #{ancestors}, + #{orderNum}, + #{leader}, + #{phone}, + #{email}, + #{status}, + #{createBy}, + sysdate() + ) + + + + update sys_dept + + parent_id = #{parentId}, + dept_name = #{deptName}, + ancestors = #{ancestors}, + order_num = #{orderNum}, + leader = #{leader}, + phone = #{phone}, + email = #{email}, + status = #{status}, + update_by = #{updateBy}, + update_time = sysdate() + + where dept_id = #{deptId} + + + + update sys_dept set ancestors = + + when #{item.deptId} then #{item.ancestors} + + where dept_id in + + #{item.deptId} + + + + + update sys_dept set status = '0' where dept_id in + + #{deptId} + + + + + update sys_dept set del_flag = '2' where dept_id = #{deptId} + + + \ No newline at end of file diff --git a/ruoyi-system/target/classes/mapper/system/SysDictDataMapper.xml b/ruoyi-system/target/classes/mapper/system/SysDictDataMapper.xml new file mode 100644 index 0000000..d696e67 --- /dev/null +++ b/ruoyi-system/target/classes/mapper/system/SysDictDataMapper.xml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark + from sys_dict_data + + + + + + + + + + + + + + + + + delete from sys_dict_data where dict_code = #{dictCode} + + + + delete from sys_dict_data where dict_code in + + #{dictCode} + + + + + update sys_dict_data + + dict_sort = #{dictSort}, + dict_label = #{dictLabel}, + dict_value = #{dictValue}, + dict_type = #{dictType}, + css_class = #{cssClass}, + list_class = #{listClass}, + is_default = #{isDefault}, + status = #{status}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where dict_code = #{dictCode} + + + + update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType} + + + + insert into sys_dict_data( + dict_sort, + dict_label, + dict_value, + dict_type, + css_class, + list_class, + is_default, + status, + remark, + create_by, + create_time + )values( + #{dictSort}, + #{dictLabel}, + #{dictValue}, + #{dictType}, + #{cssClass}, + #{listClass}, + #{isDefault}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + + + \ No newline at end of file diff --git a/ruoyi-system/target/classes/mapper/system/SysDictTypeMapper.xml b/ruoyi-system/target/classes/mapper/system/SysDictTypeMapper.xml new file mode 100644 index 0000000..438d484 --- /dev/null +++ b/ruoyi-system/target/classes/mapper/system/SysDictTypeMapper.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + select dict_id, dict_name, dict_type, status, create_by, create_time, remark + from sys_dict_type + + + + + + + + + + + + + + delete from sys_dict_type where dict_id = #{dictId} + + + + delete from sys_dict_type where dict_id in + + #{dictId} + + + + + update sys_dict_type + + dict_name = #{dictName}, + dict_type = #{dictType}, + status = #{status}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where dict_id = #{dictId} + + + + insert into sys_dict_type( + dict_name, + dict_type, + status, + remark, + create_by, + create_time + )values( + #{dictName}, + #{dictType}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + + + \ No newline at end of file diff --git a/ruoyi-system/target/classes/mapper/system/SysLogininforMapper.xml b/ruoyi-system/target/classes/mapper/system/SysLogininforMapper.xml new file mode 100644 index 0000000..822d665 --- /dev/null +++ b/ruoyi-system/target/classes/mapper/system/SysLogininforMapper.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time) + values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate()) + + + + + + delete from sys_logininfor where info_id in + + #{infoId} + + + + + truncate table sys_logininfor + + + \ No newline at end of file diff --git a/ruoyi-system/target/classes/mapper/system/SysMenuMapper.xml b/ruoyi-system/target/classes/mapper/system/SysMenuMapper.xml new file mode 100644 index 0000000..84e87c9 --- /dev/null +++ b/ruoyi-system/target/classes/mapper/system/SysMenuMapper.xml @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select menu_id, menu_name, parent_id, order_num, path, component, `query`, route_name, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time + from sys_menu + + + + + + + + + + + + + + + + + + + + + + + + + + update sys_menu + + menu_name = #{menuName}, + parent_id = #{parentId}, + order_num = #{orderNum}, + path = #{path}, + component = #{component}, + `query` = #{query}, + route_name = #{routeName}, + is_frame = #{isFrame}, + is_cache = #{isCache}, + menu_type = #{menuType}, + visible = #{visible}, + status = #{status}, + perms = #{perms}, + icon = #{icon}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where menu_id = #{menuId} + + + + insert into sys_menu( + menu_id, + parent_id, + menu_name, + order_num, + path, + component, + `query`, + route_name, + is_frame, + is_cache, + menu_type, + visible, + status, + perms, + icon, + remark, + create_by, + create_time + )values( + #{menuId}, + #{parentId}, + #{menuName}, + #{orderNum}, + #{path}, + #{component}, + #{query}, + #{routeName}, + #{isFrame}, + #{isCache}, + #{menuType}, + #{visible}, + #{status}, + #{perms}, + #{icon}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + delete from sys_menu where menu_id = #{menuId} + + + \ No newline at end of file diff --git a/ruoyi-system/target/classes/mapper/system/SysNoticeMapper.xml b/ruoyi-system/target/classes/mapper/system/SysNoticeMapper.xml new file mode 100644 index 0000000..65d3079 --- /dev/null +++ b/ruoyi-system/target/classes/mapper/system/SysNoticeMapper.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark + from sys_notice + + + + + + + + insert into sys_notice ( + notice_title, + notice_type, + notice_content, + status, + remark, + create_by, + create_time + )values( + #{noticeTitle}, + #{noticeType}, + #{noticeContent}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + update sys_notice + + notice_title = #{noticeTitle}, + notice_type = #{noticeType}, + notice_content = #{noticeContent}, + status = #{status}, + update_by = #{updateBy}, + update_time = sysdate() + + where notice_id = #{noticeId} + + + + delete from sys_notice where notice_id = #{noticeId} + + + + delete from sys_notice where notice_id in + + #{noticeId} + + + + \ No newline at end of file diff --git a/ruoyi-system/target/classes/mapper/system/SysOperLogMapper.xml b/ruoyi-system/target/classes/mapper/system/SysOperLogMapper.xml new file mode 100644 index 0000000..201db07 --- /dev/null +++ b/ruoyi-system/target/classes/mapper/system/SysOperLogMapper.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time, cost_time + from sys_oper_log + + + + insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, cost_time, oper_time) + values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate()) + + + + + + delete from sys_oper_log where oper_id in + + #{operId} + + + + + + + truncate table sys_oper_log + + + \ No newline at end of file diff --git a/ruoyi-system/target/classes/mapper/system/SysPostMapper.xml b/ruoyi-system/target/classes/mapper/system/SysPostMapper.xml new file mode 100644 index 0000000..227c459 --- /dev/null +++ b/ruoyi-system/target/classes/mapper/system/SysPostMapper.xml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark + from sys_post + + + + + + + + + + + + + + + + + + update sys_post + + post_code = #{postCode}, + post_name = #{postName}, + post_sort = #{postSort}, + status = #{status}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where post_id = #{postId} + + + + insert into sys_post( + post_id, + post_code, + post_name, + post_sort, + status, + remark, + create_by, + create_time + )values( + #{postId}, + #{postCode}, + #{postName}, + #{postSort}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + delete from sys_post where post_id = #{postId} + + + + delete from sys_post where post_id in + + #{postId} + + + + \ No newline at end of file diff --git a/ruoyi-system/target/classes/mapper/system/SysRoleDeptMapper.xml b/ruoyi-system/target/classes/mapper/system/SysRoleDeptMapper.xml new file mode 100644 index 0000000..7c4139b --- /dev/null +++ b/ruoyi-system/target/classes/mapper/system/SysRoleDeptMapper.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + delete from sys_role_dept where role_id=#{roleId} + + + + + + delete from sys_role_dept where role_id in + + #{roleId} + + + + + insert into sys_role_dept(role_id, dept_id) values + + (#{item.roleId},#{item.deptId}) + + + + \ No newline at end of file diff --git a/ruoyi-system/target/classes/mapper/system/SysRoleMapper.xml b/ruoyi-system/target/classes/mapper/system/SysRoleMapper.xml new file mode 100644 index 0000000..955d4ee --- /dev/null +++ b/ruoyi-system/target/classes/mapper/system/SysRoleMapper.xml @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly, + r.status, r.del_flag, r.create_time, r.remark + from sys_role r + left join sys_user_role ur on ur.role_id = r.role_id + left join sys_user u on u.user_id = ur.user_id + left join sys_dept d on u.dept_id = d.dept_id + + + + + + + + + + + + + + + + + + + + insert into sys_role( + role_id, + role_name, + role_key, + role_sort, + data_scope, + menu_check_strictly, + dept_check_strictly, + status, + remark, + create_by, + create_time + )values( + #{roleId}, + #{roleName}, + #{roleKey}, + #{roleSort}, + #{dataScope}, + #{menuCheckStrictly}, + #{deptCheckStrictly}, + #{status}, + #{remark}, + #{createBy}, + sysdate() + ) + + + + update sys_role + + role_name = #{roleName}, + role_key = #{roleKey}, + role_sort = #{roleSort}, + data_scope = #{dataScope}, + menu_check_strictly = #{menuCheckStrictly}, + dept_check_strictly = #{deptCheckStrictly}, + status = #{status}, + remark = #{remark}, + update_by = #{updateBy}, + update_time = sysdate() + + where role_id = #{roleId} + + + + update sys_role set del_flag = '2' where role_id = #{roleId} + + + + update sys_role set del_flag = '2' where role_id in + + #{roleId} + + + + \ No newline at end of file diff --git a/ruoyi-system/target/classes/mapper/system/SysRoleMenuMapper.xml b/ruoyi-system/target/classes/mapper/system/SysRoleMenuMapper.xml new file mode 100644 index 0000000..cb60a85 --- /dev/null +++ b/ruoyi-system/target/classes/mapper/system/SysRoleMenuMapper.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + delete from sys_role_menu where role_id=#{roleId} + + + + delete from sys_role_menu where role_id in + + #{roleId} + + + + + insert into sys_role_menu(role_id, menu_id) values + + (#{item.roleId},#{item.menuId}) + + + + \ No newline at end of file diff --git a/ruoyi-system/target/classes/mapper/system/SysUserMapper.xml b/ruoyi-system/target/classes/mapper/system/SysUserMapper.xml new file mode 100644 index 0000000..0856cb2 --- /dev/null +++ b/ruoyi-system/target/classes/mapper/system/SysUserMapper.xml @@ -0,0 +1,221 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, + d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, + r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status + from sys_user u + left join sys_dept d on u.dept_id = d.dept_id + left join sys_user_role ur on u.user_id = ur.user_id + left join sys_role r on r.role_id = ur.role_id + + + + + + + + + + + + + + + + + + + + insert into sys_user( + user_id, + dept_id, + user_name, + nick_name, + email, + avatar, + phonenumber, + sex, + password, + status, + create_by, + remark, + create_time + )values( + #{userId}, + #{deptId}, + #{userName}, + #{nickName}, + #{email}, + #{avatar}, + #{phonenumber}, + #{sex}, + #{password}, + #{status}, + #{createBy}, + #{remark}, + sysdate() + ) + + + + update sys_user + + dept_id = #{deptId}, + user_name = #{userName}, + nick_name = #{nickName}, + email = #{email}, + phonenumber = #{phonenumber}, + sex = #{sex}, + avatar = #{avatar}, + password = #{password}, + status = #{status}, + login_ip = #{loginIp}, + login_date = #{loginDate}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = sysdate() + + where user_id = #{userId} + + + + update sys_user set status = #{status} where user_id = #{userId} + + + + update sys_user set avatar = #{avatar} where user_name = #{userName} + + + + update sys_user set password = #{password} where user_name = #{userName} + + + + update sys_user set del_flag = '2' where user_id = #{userId} + + + + update sys_user set del_flag = '2' where user_id in + + #{userId} + + + + \ No newline at end of file diff --git a/ruoyi-system/target/classes/mapper/system/SysUserPostMapper.xml b/ruoyi-system/target/classes/mapper/system/SysUserPostMapper.xml new file mode 100644 index 0000000..2b90bc4 --- /dev/null +++ b/ruoyi-system/target/classes/mapper/system/SysUserPostMapper.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + delete from sys_user_post where user_id=#{userId} + + + + + + delete from sys_user_post where user_id in + + #{userId} + + + + + insert into sys_user_post(user_id, post_id) values + + (#{item.userId},#{item.postId}) + + + + \ No newline at end of file diff --git a/ruoyi-system/target/classes/mapper/system/SysUserRoleMapper.xml b/ruoyi-system/target/classes/mapper/system/SysUserRoleMapper.xml new file mode 100644 index 0000000..dd72689 --- /dev/null +++ b/ruoyi-system/target/classes/mapper/system/SysUserRoleMapper.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + delete from sys_user_role where user_id=#{userId} + + + + + + delete from sys_user_role where user_id in + + #{userId} + + + + + insert into sys_user_role(user_id, role_id) values + + (#{item.userId},#{item.roleId}) + + + + + delete from sys_user_role where user_id=#{userId} and role_id=#{roleId} + + + + delete from sys_user_role where role_id=#{roleId} and user_id in + + #{userId} + + + \ No newline at end of file diff --git a/ruoyi-system/target/maven-archiver/pom.properties b/ruoyi-system/target/maven-archiver/pom.properties new file mode 100644 index 0000000..ec86289 --- /dev/null +++ b/ruoyi-system/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=ruoyi-system +groupId=com.ruoyi +version=3.8.8 diff --git a/ruoyi-system/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/ruoyi-system/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..08624f9 --- /dev/null +++ b/ruoyi-system/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,53 @@ +com\ruoyi\system\mapper\SysOperLogMapper.class +com\ruoyi\system\domain\SysUserRole.class +com\ruoyi\system\mapper\SysRoleMapper.class +com\ruoyi\system\service\ISysDeptService.class +com\ruoyi\system\service\ISysDictTypeService.class +com\ruoyi\system\domain\SysOperLog.class +com\ruoyi\system\domain\SysRoleDept.class +com\ruoyi\system\mapper\SysConfigMapper.class +com\ruoyi\system\domain\SysUserPost.class +com\ruoyi\system\service\impl\SysDictDataServiceImpl.class +com\ruoyi\system\domain\SysRoleMenu.class +com\ruoyi\system\service\ISysConfigService.class +com\ruoyi\system\service\ISysUserService.class +com\ruoyi\system\service\QRCodeGenerationService.class +com\ruoyi\system\domain\vo\MetaVo.class +com\ruoyi\system\mapper\SysNoticeMapper.class +com\ruoyi\system\domain\SysConfig.class +com\ruoyi\system\service\ISysUserOnlineService.class +com\ruoyi\system\service\ISysPostService.class +com\ruoyi\system\domain\SysCache.class +com\ruoyi\system\mapper\SysPostMapper.class +com\ruoyi\system\service\impl\SysMenuServiceImpl.class +com\ruoyi\system\service\ISysMenuService.class +com\ruoyi\system\domain\SysPost.class +com\ruoyi\system\service\impl\SysUserServiceImpl.class +com\ruoyi\system\mapper\SysDictTypeMapper.class +com\ruoyi\system\service\ISysLogininforService.class +com\ruoyi\system\domain\SysLogininfor.class +com\ruoyi\system\service\impl\SysConfigServiceImpl.class +com\ruoyi\system\service\impl\SysLogininforServiceImpl.class +com\ruoyi\system\mapper\SysDeptMapper.class +com\ruoyi\system\mapper\SysUserPostMapper.class +com\ruoyi\system\domain\SysUserOnline.class +com\ruoyi\system\mapper\SysUserRoleMapper.class +com\ruoyi\system\service\impl\SysRoleServiceImpl.class +com\ruoyi\system\service\impl\SysDictTypeServiceImpl.class +com\ruoyi\system\domain\vo\RouterVo.class +com\ruoyi\system\service\ISysNoticeService.class +com\ruoyi\system\mapper\SysUserMapper.class +com\ruoyi\system\mapper\SysLogininforMapper.class +com\ruoyi\system\service\impl\SysOperLogServiceImpl.class +com\ruoyi\system\service\ISysDictDataService.class +com\ruoyi\system\mapper\SysMenuMapper.class +com\ruoyi\system\service\ISysRoleService.class +com\ruoyi\system\service\impl\SysNoticeServiceImpl.class +com\ruoyi\system\mapper\SysDictDataMapper.class +com\ruoyi\system\service\ISysOperLogService.class +com\ruoyi\system\service\impl\SysUserOnlineServiceImpl.class +com\ruoyi\system\service\impl\SysDeptServiceImpl.class +com\ruoyi\system\service\impl\SysPostServiceImpl.class +com\ruoyi\system\mapper\SysRoleMenuMapper.class +com\ruoyi\system\domain\SysNotice.class +com\ruoyi\system\mapper\SysRoleDeptMapper.class diff --git a/ruoyi-system/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/ruoyi-system/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..2682a94 --- /dev/null +++ b/ruoyi-system/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,53 @@ +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\mapper\SysMenuMapper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\domain\SysUserRole.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\impl\SysNoticeServiceImpl.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\ISysDictDataService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\mapper\SysPostMapper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\mapper\SysDictDataMapper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\mapper\SysConfigMapper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\mapper\SysNoticeMapper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\impl\SysOperLogServiceImpl.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\mapper\SysDictTypeMapper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\impl\SysDictTypeServiceImpl.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\ISysNoticeService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\mapper\SysLogininforMapper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\mapper\SysUserRoleMapper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\ISysLogininforService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\mapper\SysRoleDeptMapper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\mapper\SysUserMapper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\ISysMenuService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\ISysRoleService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\domain\SysRoleDept.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\mapper\SysRoleMenuMapper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\domain\vo\MetaVo.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\domain\SysOperLog.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\impl\SysDictDataServiceImpl.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\mapper\SysRoleMapper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\impl\SysConfigServiceImpl.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\ISysDeptService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\impl\SysRoleServiceImpl.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\ISysDictTypeService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\impl\SysPostServiceImpl.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\mapper\SysUserPostMapper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\impl\SysMenuServiceImpl.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\domain\SysConfig.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\domain\SysUserPost.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\mapper\SysDeptMapper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\domain\SysPost.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\domain\SysRoleMenu.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\ISysConfigService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\impl\SysUserOnlineServiceImpl.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\ISysUserService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\impl\SysUserServiceImpl.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\mapper\SysOperLogMapper.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\ISysUserOnlineService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\ISysPostService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\QRCodeGenerationService.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\domain\SysLogininfor.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\domain\SysUserOnline.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\domain\SysNotice.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\domain\SysCache.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\impl\SysLogininforServiceImpl.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\impl\SysDeptServiceImpl.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\domain\vo\RouterVo.java +D:\code\pasd_V1.0\pasd_java\ruoyi-system\src\main\java\com\ruoyi\system\service\ISysOperLogService.java