luodangjia
2024-12-24 bd6d42818da5b2551eba1884744f28a42720987d
Merge remote-tracking branch 'origin/master'
1 文件已重命名
34个文件已修改
19个文件已添加
1628 ■■■■■ 已修改文件
medicalWaste-admin/src/main/java/com/sinata/web/controller/backend/MwApplicationController.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-admin/src/main/java/com/sinata/web/controller/backend/MwBoxController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-admin/src/main/java/com/sinata/web/controller/backend/MwRegulatoryRecordController.java 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-admin/src/main/java/com/sinata/web/controller/backend/MwStaffController.java 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-admin/src/main/java/com/sinata/web/controller/backend/system/FileController.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-admin/src/main/java/com/sinata/web/controller/backend/system/SysAgreementController.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-admin/src/test/java/MybatisPlusGeneraotr.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-common/pom.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/config/OssConfig.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/domain/MwApplication.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/domain/MwRegulatoryRecord.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/domain/SysAgreement.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/domain/dto/MwApplicationDTO.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/domain/dto/MwRegulatoryRecordDTO.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/domain/dto/MwStaffDTO.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/domain/dto/SysAgreementDTO.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/domain/query/MwApplicationQuery.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/domain/query/MwRegulatoryRecordQuery.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/domain/query/MwStaffQuery.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/domain/vo/MwApplicationVO.java 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/domain/vo/MwMonitorDeviceVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/domain/vo/MwRegulatoryRecordVO.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/domain/vo/MwStaffVO.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/mapper/MwApplicationMapper.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/mapper/MwRegulatoryRecordMapper.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/mapper/MwStaffMapper.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/mapper/SysAgreementMapper.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/mapper/xml/SysAgreementMapper.xml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/MwApplicationService.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/MwAttachmentService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/MwRegulatoryRecordService.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/MwStaffService.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/OssService.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/SysAgreementService.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/SysDepartmentService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwApplicationServiceImpl.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwBusinessDeviceServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwCheckoutRecordServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwContractServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwDisposalRecordServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwMonitorDeviceServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwProtectionEquipmentServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwProtectionRegulationServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwProtectionTaskServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwRegulatoryRecordServiceImpl.java 125 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwStaffServiceImpl.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwTransitCarServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/impl/OssServiceImpl.java 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/impl/SysAgreementServiceImpl.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/java/com/sinata/system/service/impl/SysDepartmentServiceImpl.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/resources/mapper/system/MwApplicationMapper.xml 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/resources/mapper/system/MwRegulatoryRecordMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-system/src/main/resources/mapper/system/MwStaffMapper.xml 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
medicalWaste-admin/src/main/java/com/sinata/web/controller/backend/MwApplicationController.java
@@ -1,7 +1,25 @@
package com.sinata.web.controller.backend;
import com.sinata.common.core.domain.R;
import com.sinata.common.entity.PageDTO;
import com.sinata.system.domain.dto.MwApplicationDTO;
import com.sinata.system.domain.query.MwApplicationQuery;
import com.sinata.system.domain.vo.MwApplicationVO;
import com.sinata.system.service.MwApplicationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
/**
 * <p>
@@ -11,8 +29,61 @@
 * @author mitao
 * @since 2024-12-02
 */
@Validated
@RestController
@RequiredArgsConstructor
@Api(tags = {"单位入驻审核相关接口"})
@RequestMapping("/backend/mwApplication")
public class MwApplicationController {
    private final MwApplicationService mwApplicationService;
    /**
     * 分页列表
     *
     * @param query
     * @return
     */
    @ApiOperation("分页列表")
    @PostMapping("/page")
    public R<PageDTO<MwApplicationVO>> pageList(@Valid @RequestBody MwApplicationQuery query) {
        return R.ok(mwApplicationService.pageList(query));
    }
    /**
     * 详情
     *
     * @param id
     * @return
     */
    @ApiOperation("详情")
    @GetMapping("/{id}")
    public R<MwApplicationVO> detail(@ApiParam(name = "id", value = "入驻申请id", required = true) @PathVariable("id") Long id) {
        return R.ok(mwApplicationService.detail(id));
    }
    /**
     * 审核
     *
     * @param dto
     * @return
     */
    @ApiOperation("审核")
    @PostMapping("/audit")
    public R<?> audit(@Valid @RequestBody MwApplicationDTO dto) {
        mwApplicationService.audit(dto);
        return R.ok();
    }
    /**
     * 删除
     *
     * @param id
     * @return
     */
    @ApiOperation("删除")
    @DeleteMapping("/{id}")
    public R<?> delete(@ApiParam(name = "id", value = "申请记录id", required = true) @PathVariable("id") Long id) {
        mwApplicationService.removeById(id);
        return R.ok();
    }
}
medicalWaste-admin/src/main/java/com/sinata/web/controller/backend/MwBoxController.java
@@ -58,8 +58,8 @@
     * @param query
     * @return
     */
    @PostMapping("/page")
    @ApiOperation("转运箱分页列表")
    @PostMapping("/page")
    public R<PageDTO<MwBoxVO>> pageList(@Valid @RequestBody MwBoxPageQuery query) {
        return R.ok(boxService.pageList(query));
    }
@@ -71,8 +71,8 @@
     * @param boxNumberEnd
     * @return
     */
    @PostMapping("/add")
    @ApiOperation("新增转运箱")
    @PostMapping("/add")
    @ApiImplicitParams({@ApiImplicitParam(name = "boxNumberStart", value = "转运箱编号开始", required = true),
            @ApiImplicitParam(name = "boxNumberEnd", value = "转运箱编号结束", required = true)})
    public R<?> add(@RequestParam String boxNumberStart, @RequestParam String boxNumberEnd) {
@@ -86,8 +86,8 @@
     * @param dtoList
     * @return
     */
    @PostMapping("/editBatch")
    @ApiOperation("批量修改转运箱状态")
    @PostMapping("/editBatch")
    public R<?> editBatch(@Valid @RequestBody List<MwBoxDTO> dtoList) {
        boxService.editBatch(dtoList);
        return R.ok();
@@ -99,8 +99,8 @@
     * @param idList
     * @return
     */
    @PostMapping("/delBatch")
    @ApiOperation("批量删除")
    @PostMapping("/delBatch")
    public R<?> delBatch(@ApiParam(name = "idList", value = "转运箱id列表", required = true, allowMultiple = true) @NotEmpty(message = "转运箱列表不能为空") @RequestBody List<Long> idList) {
        boxService.removeByIds(idList);
        return R.ok();
medicalWaste-admin/src/main/java/com/sinata/web/controller/backend/MwRegulatoryRecordController.java
@@ -1,7 +1,25 @@
package com.sinata.web.controller.backend;
import com.sinata.common.core.domain.R;
import com.sinata.common.entity.PageDTO;
import com.sinata.system.domain.dto.MwRegulatoryRecordDTO;
import com.sinata.system.domain.query.MwRegulatoryRecordQuery;
import com.sinata.system.domain.vo.MwRegulatoryRecordVO;
import com.sinata.system.service.MwRegulatoryRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
/**
 * <p>
@@ -11,8 +29,74 @@
 * @author mitao
 * @since 2024-12-02
 */
@Validated
@RestController
@RequiredArgsConstructor
@Api(tags = {"红黄码监管相关接口"})
@RequestMapping("/backend/mwRegulatoryRecord")
public class MwRegulatoryRecordController {
    private final MwRegulatoryRecordService mwRegulatoryRecordService;
    /**
     * 分页列表
     *
     * @param query
     * @return
     */
    @ApiOperation("分页列表")
    @PostMapping("/page")
    public R<PageDTO<MwRegulatoryRecordVO>> pageList(@Valid @RequestBody MwRegulatoryRecordQuery query) {
        return R.ok(mwRegulatoryRecordService.pageList(query));
    }
    /**
     * 详情
     *
     * @param id
     * @return
     */
    @ApiOperation("详情")
    @GetMapping("/{id}")
    public R<MwRegulatoryRecordVO> detail(@ApiParam(name = "id", value = "检查记录id", required = true) @PathVariable("id") Long id) {
        return R.ok(mwRegulatoryRecordService.detail(id));
    }
    /**
     * 新增检查记录
     *
     * @param dto
     * @return
     */
    @ApiOperation("新增检查记录")
    @PostMapping("/add")
    public R<?> add(@Valid @RequestBody MwRegulatoryRecordDTO dto) {
        mwRegulatoryRecordService.add(dto);
        return R.ok();
    }
    /**
     * 编辑检查记录
     *
     * @param dto
     * @return
     */
    @ApiOperation("编辑检查记录")
    @PostMapping("/edit")
    public R<?> edit(@Valid @RequestBody MwRegulatoryRecordDTO dto) {
        mwRegulatoryRecordService.edit(dto);
        return R.ok();
    }
    /**
     * 删除
     *
     * @param id
     * @return
     */
    @ApiOperation("删除")
    @DeleteMapping("/{id}")
    public R<?> delete(@ApiParam(name = "id", value = "检查记录id", required = true) @PathVariable("id") Long id) {
        mwRegulatoryRecordService.delete(id);
        return R.ok();
    }
}
medicalWaste-admin/src/main/java/com/sinata/web/controller/backend/MwStaffController.java
@@ -1,7 +1,25 @@
package com.sinata.web.controller.backend;
import com.sinata.common.core.domain.R;
import com.sinata.common.entity.PageDTO;
import com.sinata.system.domain.dto.MwStaffDTO;
import com.sinata.system.domain.query.MwStaffQuery;
import com.sinata.system.domain.vo.MwStaffVO;
import com.sinata.system.service.MwStaffService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
/**
 * <p>
@@ -11,8 +29,74 @@
 * @author mitao
 * @since 2024-12-02
 */
@Validated
@RestController
@RequiredArgsConstructor
@Api(tags = {"职工管理相关接口"})
@RequestMapping("/backend/mwStaff")
public class MwStaffController {
    private final MwStaffService mwStaffService;
    /**
     * 分页列表
     *
     * @param query
     * @return
     */
    @ApiOperation("分页列表")
    @PostMapping("/page")
    public R<PageDTO<MwStaffVO>> pageList(@Valid @RequestBody MwStaffQuery query) {
        return R.ok(mwStaffService.pageList(query));
    }
    /**
     * 详情
     *
     * @param id
     * @return
     */
    @ApiOperation("详情")
    @GetMapping("/{id}")
    public R<MwStaffVO> detail(@ApiParam(name = "id", value = "职工id", required = true) @PathVariable("id") Long id) {
        return R.ok(mwStaffService.detail(id));
    }
    /**
     * 新增
     *
     * @param dto
     * @return
     */
    @ApiOperation("新增")
    @PostMapping("/add")
    public R<?> add(@Valid @RequestBody MwStaffDTO dto) {
        mwStaffService.add(dto);
        return R.ok();
    }
    /**
     * 编辑
     *
     * @param dto
     * @return
     */
    @ApiOperation("编辑")
    @PostMapping("/edit")
    public R<?> edit(@Valid @RequestBody MwStaffDTO dto) {
        mwStaffService.edit(dto);
        return R.ok();
    }
    /**
     * 删除
     *
     * @param id
     * @return
     */
    @ApiOperation("删除")
    @DeleteMapping("/{id}")
    public R<?> delete(@ApiParam(name = "id", value = "职工id", required = true) @PathVariable("id") Long id) {
        mwStaffService.removeById(id);
        return R.ok();
    }
}
medicalWaste-admin/src/main/java/com/sinata/web/controller/backend/system/FileController.java
New file
@@ -0,0 +1,50 @@
package com.sinata.web.controller.backend.system;
import com.sinata.common.core.domain.R;
import com.sinata.common.exception.ServiceException;
import com.sinata.system.service.OssService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.Objects;
/**
 * @author mitao
 * @date 2024/12/23
 */
@Api(tags = {"文件上传接口"})
@RestController
@RequiredArgsConstructor
@RequestMapping("/backend/file")
public class FileController {
    private final OssService ossService;
    /**
     * 上传文件
     *
     * @param file
     * @return
     */
    @ApiOperation(value = "上传文件")
    @PostMapping("/upload")
    public R<String> upload(@RequestPart("file") MultipartFile file) {
        if (Objects.isNull(file)) {
            throw new ServiceException("文件不能为空");
        }
        String fileUrl;
        try {
            fileUrl = ossService.uploadFile(file);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return R.ok(fileUrl);
    }
}
medicalWaste-admin/src/main/java/com/sinata/web/controller/backend/system/SysAgreementController.java
New file
@@ -0,0 +1,42 @@
package com.sinata.web.controller.backend.system;
import com.sinata.common.core.domain.R;
import com.sinata.system.domain.dto.SysAgreementDTO;
import com.sinata.system.service.SysAgreementService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
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.RestController;
import javax.validation.Valid;
/**
 * <p>
 * 协议 前端控制器
 * </p>
 *
 * @author mitao
 * @since 2024-12-23
 */
@Api(tags = {"协议管理相关接口"})
@RestController
@RequiredArgsConstructor
@RequestMapping("/backend/sysAgreement")
public class SysAgreementController {
    private SysAgreementService sysAgreementService;
    /**
     * 保存用户注册协议
     * @param dto
     * @return
     */
    @ApiOperation("保存用户注册协议")
    @PostMapping("/save")
    public R<?> save(@Valid @RequestBody SysAgreementDTO dto){
        sysAgreementService.saveAgreement(dto);
        return R.ok();
    }
}
medicalWaste-admin/src/test/java/MybatisPlusGeneraotr.java
@@ -47,7 +47,7 @@
                            builder
                                    // 在这里添加数据库表名
                                    //.addInclude("MW_BOX")
                                    .addInclude("MW_ATTACHMENT")// 设置需要生成的表名,多个表之间可以用逗号隔开
                                    .addInclude("SYS_AGREEMENT")// 设置需要生成的表名,多个表之间可以用逗号隔开
                                    // .addExclude("BBZQ_USER","BBZQ_USER_LOG")
                                    .controllerBuilder().enableRestStyle()         // controller配置策略
                                    .serviceBuilder().formatServiceFileName("%sService")            // service配置策略
medicalWaste-common/pom.xml
@@ -142,13 +142,16 @@
            <groupId>cn.hutool</groupId>
            <artifactId>hutool-all</artifactId>
        </dependency>
        <!--fastexcel-->
        <dependency>
            <groupId>cn.idev.excel</groupId>
            <artifactId>fastexcel</artifactId>
            <version>1.0.0</version>
        </dependency>
        <!--aliyun-oss-->
        <dependency>
            <groupId>com.aliyun.oss</groupId>
            <artifactId>aliyun-sdk-oss</artifactId>
        </dependency>
    </dependencies>
medicalWaste-system/src/main/java/com/sinata/system/config/OssConfig.java
File was renamed from medicalWaste-admin/src/main/java/com/sinata/web/core/config/OssConfig.java
@@ -1,4 +1,4 @@
package com.sinata.web.core.config;
package com.sinata.system.config;
import com.alibaba.fastjson2.JSONObject;
import lombok.Data;
@@ -31,12 +31,24 @@
    private String bucketName;
    private long downloadUrlExpiration;
    public static String FOLDER;
    public static String ACCESS_KEY_ID;
    public static String ACCESS_KEY_SECRET;
    public static String UPLOAD_ENDPOINT;
    public static String DOWNLOAD_ENDPOINT;
    public static String BUCKET_NAME;
    @PostConstruct
    public void init() {
        log.debug("OSS配置信息:" + JSONObject.toJSONString(this));
        FOLDER = folder;
        ACCESS_KEY_ID = accessKeyId;
        ACCESS_KEY_SECRET = accessKeySecret;
        UPLOAD_ENDPOINT = uploadEndpoint;
        DOWNLOAD_ENDPOINT = downloadEndpoint;
        BUCKET_NAME = bucketName;
    }
    public String getStoreFolder() {
medicalWaste-system/src/main/java/com/sinata/system/domain/MwApplication.java
@@ -30,6 +30,10 @@
    @TableId(value = "ID", type = IdType.AUTO)
    private Long id;
    @ApiModelProperty("所属区域")
    @TableField("REGION")
    private String region;
    @ApiModelProperty("区域id")
    @TableField("DEPARTMENT_ID")
    private Long departmentId;
medicalWaste-system/src/main/java/com/sinata/system/domain/MwRegulatoryRecord.java
@@ -55,10 +55,5 @@
    @ApiModelProperty("现场图片")
    @TableField("IMAGE_URL")
    private String imageUrl;
    @ApiModelProperty("检查附件,多个附件使用英文逗号拼接")
    @TableField("ATTACHMENT")
    private String attachment;
}
medicalWaste-system/src/main/java/com/sinata/system/domain/SysAgreement.java
New file
@@ -0,0 +1,53 @@
package com.sinata.system.domain;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.util.Date;
/**
 * <p>
 * 协议
 * </p>
 *
 * @author mitao
 * @since 2024-12-23
 */
@Getter
@Setter
@TableName("SYS_AGREEMENT")
@ApiModel(value = "SysAgreement对象", description = "协议")
public class SysAgreement implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty("主键")
    @TableId(value = "ID", type = IdType.AUTO)
    private Long id;
    @ApiModelProperty("内容")
    @TableField("CONTENT")
    private String content;
    @ApiModelProperty("协议类型(1:注册协议)")
    @TableField("TYPE")
    private Integer type;
    @ApiModelProperty("创建时间")
    @TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
    private Date createTime;
    @ApiModelProperty("更新时间")
    @TableField(value = "UPDATE_TIME", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
}
medicalWaste-system/src/main/java/com/sinata/system/domain/dto/MwApplicationDTO.java
New file
@@ -0,0 +1,27 @@
package com.sinata.system.domain.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
 * @author mitao
 * @date 2024/12/23
 */
@Data
@ApiModel("入驻申请数据传输对象")
public class MwApplicationDTO {
    @ApiModelProperty("单位入驻申请id")
    @NotNull(message = "id不能为空")
    private Long id;
    @ApiModelProperty("审核结果 1:通过 0:驳回")
    @NotNull(message = "审核结果不能为空")
    private Integer auditStatus;
    @ApiModelProperty("审核意见")
    private String auditOpinion;
}
medicalWaste-system/src/main/java/com/sinata/system/domain/dto/MwRegulatoryRecordDTO.java
New file
@@ -0,0 +1,42 @@
package com.sinata.system.domain.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
 * @author mitao
 * @date 2024/12/23
 */
@Data
@ApiModel("红黄码监管数据传输对象")
public class MwRegulatoryRecordDTO {
    @ApiModelProperty("红黄码监管id")
    private Long id;
    @ApiModelProperty("区域id(医疗机构id、处置单位id、监管单位id)")
    private Long departmentId;
    @ApiModelProperty("检查日期")
    private Date checkDate;
    @ApiModelProperty("检查人员")
    private String checkBy;
    @ApiModelProperty("码类型 1:红码 2:绿码 3:黄码")
    private Integer codeType;
    @ApiModelProperty("检查结果")
    private String checkResults;
    @ApiModelProperty("现场图片")
    private String imageUrl;
    @ApiModelProperty("附件列表")
    private List<MwAttachmentDTO> attachmentList;
}
medicalWaste-system/src/main/java/com/sinata/system/domain/dto/MwStaffDTO.java
New file
@@ -0,0 +1,37 @@
package com.sinata.system.domain.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
 * @author mitao
 * @date 2024/12/23
 */
@Data
@ApiModel("职工数据传输对象")
public class MwStaffDTO {
    @ApiModelProperty("职工id")
    private Long id;
    @ApiModelProperty("区域id")
    @NotNull(message = "区域id不能为空")
    private Long departmentId;
    @ApiModelProperty("姓名")
    @NotNull(message = "姓名不能为空")
    private String staffName;
    @ApiModelProperty("手机号")
    @NotNull(message = "手机号不能为空")
    private String phone;
    @ApiModelProperty("健康证明")
    private String healthCertificate;
    @ApiModelProperty("疫苗记录证明")
    private String vaccineCertificate;
}
medicalWaste-system/src/main/java/com/sinata/system/domain/dto/SysAgreementDTO.java
New file
@@ -0,0 +1,21 @@
package com.sinata.system.domain.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @author mitao
 * @date 2024/12/23
 */
@Data
@ApiModel("协议数据传输对象")
public class SysAgreementDTO {
    @ApiModelProperty("主键")
    private Long id;
    @ApiModelProperty("内容")
    private String content;
}
medicalWaste-system/src/main/java/com/sinata/system/domain/query/MwApplicationQuery.java
New file
@@ -0,0 +1,34 @@
package com.sinata.system.domain.query;
/**
 * @author mitao
 * @date 2024/12/23
 */
import com.sinata.common.entity.BasePage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("单位入住查询数据传输对象")
public class MwApplicationQuery extends BasePage {
    private static final long serialVersionUID = 3104308275785288155L;
    @ApiModelProperty("区域id")
    private Long departmentId;
    @ApiModelProperty("单位类型 1:医疗机构 2:处置单位")
    private Integer unitType;
    @ApiModelProperty("单位名称")
    private String unitName;
    @ApiModelProperty("联系人")
    private String concat;
    @ApiModelProperty("手机号")
    private String phone;
}
medicalWaste-system/src/main/java/com/sinata/system/domain/query/MwRegulatoryRecordQuery.java
New file
@@ -0,0 +1,34 @@
package com.sinata.system.domain.query;
import com.sinata.common.entity.BasePage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
 * @author mitao
 * @date 2024/12/23
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("红黄码监管查询数据传输对象")
public class MwRegulatoryRecordQuery extends BasePage {
    private static final long serialVersionUID = 1708907715288858454L;
    @ApiModelProperty("区域id(医疗机构id、处置单位id、监管单位id)")
    private Long departmentId;
    @ApiModelProperty("码类型 1:红码 2:绿码 3:黄码")
    private Integer codeType;
    @ApiModelProperty("检查时间-开始")
    private Date startTime;
    @ApiModelProperty("检查时间-结束")
    private Date endTime;
}
medicalWaste-system/src/main/java/com/sinata/system/domain/query/MwStaffQuery.java
New file
@@ -0,0 +1,35 @@
package com.sinata.system.domain.query;
import com.sinata.common.entity.BasePage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * @author mitao
 * @date 2024/12/23
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("职工查询对象")
public class MwStaffQuery extends BasePage {
    private static final long serialVersionUID = -212943129399009161L;
    @ApiModelProperty("区域id")
    private Long departmentId;
    @ApiModelProperty("姓名")
    private String staffName;
    @ApiModelProperty("手机号")
    private String phone;
    @ApiModelProperty("健康证明 1:是 0:否")
    private Integer healthCertificateFlag;
    @ApiModelProperty("疫苗记录证明1:是 0:否")
    private Integer vaccineCertificateFlag;
}
medicalWaste-system/src/main/java/com/sinata/system/domain/vo/MwApplicationVO.java
New file
@@ -0,0 +1,58 @@
package com.sinata.system.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
 * @author mitao
 * @date 2024/12/23
 */
@Data
@ApiModel("单位入驻审核视图对象")
public class MwApplicationVO {
    @ApiModelProperty("单位入驻申请id")
    private Long id;
    @ApiModelProperty("区域id")
    private Long departmentId;
    @ApiModelProperty("所属区域")
    private String region;
    @ApiModelProperty("单位类型 1:医疗机构 2:处置单位")
    private Integer unitType;
    @ApiModelProperty("单位名称")
    private String unitName;
    @ApiModelProperty("联系人")
    private String concat;
    @ApiModelProperty("手机号")
    private String phone;
    @ApiModelProperty("申请描述")
    private String description;
    @ApiModelProperty("法人身份证正面")
    private String legalPersonCardFront;
    @ApiModelProperty("法人身份证反面")
    private String legalPersonCardBack;
    @ApiModelProperty("机构资质证明")
    private String certificateImageUrl;
    @ApiModelProperty("状态 1:待审核 2:已通过 3:已驳回")
    private Integer auditStatus;
    @ApiModelProperty("审核意见")
    private String auditOpinion;
    @ApiModelProperty(value = "申请时间")
    private Date createTime;
}
medicalWaste-system/src/main/java/com/sinata/system/domain/vo/MwMonitorDeviceVO.java
@@ -36,4 +36,7 @@
    @ApiModelProperty("备注信息")
    private String remark;
    @ApiModelProperty("在线状态 1:在线 0:离线")
    public Integer onlineStatus = 0;
}
medicalWaste-system/src/main/java/com/sinata/system/domain/vo/MwRegulatoryRecordVO.java
New file
@@ -0,0 +1,44 @@
package com.sinata.system.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
 * @author mitao
 * @date 2024/12/23
 */
@Data
@ApiModel("红黄码监管视图对象")
public class MwRegulatoryRecordVO {
    @ApiModelProperty("红黄码监管id")
    private Long id;
    @ApiModelProperty("区域id(医疗机构id、处置单位id、监管单位id)")
    private Long departmentId;
    @ApiModelProperty("单位名称")
    private String departmentName;
    @ApiModelProperty("检查日期")
    private Date checkDate;
    @ApiModelProperty("检查人员")
    private String checkBy;
    @ApiModelProperty("码类型 1:红码 2:绿码 3:黄码")
    private Integer codeType;
    @ApiModelProperty("检查结果")
    private String checkResults;
    @ApiModelProperty("现场图片")
    private String imageUrl;
    @ApiModelProperty("附件列表")
    private List<MwAttachmentVO> attachmentList;
}
medicalWaste-system/src/main/java/com/sinata/system/domain/vo/MwStaffVO.java
New file
@@ -0,0 +1,35 @@
package com.sinata.system.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @author mitao
 * @date 2024/12/23
 */
@Data
@ApiModel("职工视图对象")
public class MwStaffVO {
    @ApiModelProperty("职工id")
    private Long id;
    @ApiModelProperty("区域id")
    private Long departmentId;
    @ApiModelProperty("单位名称")
    private String departmentName;
    @ApiModelProperty("姓名")
    private String staffName;
    @ApiModelProperty("手机号")
    private String phone;
    @ApiModelProperty("健康证明")
    private String healthCertificate;
    @ApiModelProperty("疫苗记录证明")
    private String vaccineCertificate;
}
medicalWaste-system/src/main/java/com/sinata/system/mapper/MwApplicationMapper.java
@@ -1,8 +1,12 @@
package com.sinata.system.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sinata.system.domain.MwApplication;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sinata.system.domain.query.MwApplicationQuery;
import com.sinata.system.domain.vo.MwApplicationVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
 * <p>
@@ -14,5 +18,21 @@
 */
@Mapper
public interface MwApplicationMapper extends BaseMapper<MwApplication> {
    /**
     * 分页列表
     *
     * @param page
     * @param query
     * @param treeCode
     * @return
     */
    Page<MwApplicationVO> pageList(Page<MwApplicationVO> page, @Param("query") MwApplicationQuery query, @Param("treeCode") String treeCode);
    /**
     * 详情
     *
     * @param id
     * @return
     */
    MwApplicationVO detail(@Param("id") Long id);
}
medicalWaste-system/src/main/java/com/sinata/system/mapper/MwRegulatoryRecordMapper.java
@@ -1,8 +1,12 @@
package com.sinata.system.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sinata.system.domain.MwRegulatoryRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sinata.system.domain.query.MwRegulatoryRecordQuery;
import com.sinata.system.domain.vo.MwRegulatoryRecordVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
 * <p>
@@ -14,5 +18,13 @@
 */
@Mapper
public interface MwRegulatoryRecordMapper extends BaseMapper<MwRegulatoryRecord> {
    /**
     * 分页列表
     *
     * @param mwRegulatoryRecordVOPage
     * @param query
     * @param treeCode
     * @return
     */
    Page<MwRegulatoryRecordVO> pageList(Page<MwRegulatoryRecordVO> mwRegulatoryRecordVOPage, @Param("query") MwRegulatoryRecordQuery query, @Param("treeCode") String treeCode);
}
medicalWaste-system/src/main/java/com/sinata/system/mapper/MwStaffMapper.java
@@ -1,8 +1,12 @@
package com.sinata.system.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sinata.system.domain.MwStaff;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sinata.system.domain.query.MwStaffQuery;
import com.sinata.system.domain.vo.MwStaffVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
 * <p>
@@ -14,5 +18,13 @@
 */
@Mapper
public interface MwStaffMapper extends BaseMapper<MwStaff> {
    /**
     * 分页列表
     *
     * @param page
     * @param query
     * @param treeCode
     * @return
     */
    Page<MwStaffVO> pageList(Page<MwStaffVO> page, @Param("query") MwStaffQuery query, @Param("treeCode") String treeCode);
}
medicalWaste-system/src/main/java/com/sinata/system/mapper/SysAgreementMapper.java
New file
@@ -0,0 +1,18 @@
package com.sinata.system.mapper;
import com.sinata.system.domain.SysAgreement;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
 * <p>
 * 协议 Mapper 接口
 * </p>
 *
 * @author mitao
 * @since 2024-12-23
 */
@Mapper
public interface SysAgreementMapper extends BaseMapper<SysAgreement> {
}
medicalWaste-system/src/main/java/com/sinata/system/mapper/xml/SysAgreementMapper.xml
New file
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sinata.system.mapper.SysAgreementMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.sinata.system.domain.SysAgreement">
        <id column="ID" property="id" />
        <result column="CONTENT" property="content" />
        <result column="TYPE" property="type" />
        <result column="CREATE_TIME" property="createTime" />
        <result column="UPDATE_TIME" property="updateTime" />
    </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        ID, CONTENT, TYPE, CREATE_TIME, UPDATE_TIME
    </sql>
</mapper>
medicalWaste-system/src/main/java/com/sinata/system/service/MwApplicationService.java
@@ -1,7 +1,11 @@
package com.sinata.system.service;
import com.sinata.common.entity.PageDTO;
import com.sinata.system.domain.MwApplication;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sinata.system.domain.dto.MwApplicationDTO;
import com.sinata.system.domain.query.MwApplicationQuery;
import com.sinata.system.domain.vo.MwApplicationVO;
/**
 * <p>
@@ -12,5 +16,27 @@
 * @since 2024-12-02
 */
public interface MwApplicationService extends IService<MwApplication> {
    /**
     * 分页列表
     *
     * @param query
     * @return
     */
    PageDTO<MwApplicationVO> pageList(MwApplicationQuery query);
    /**
     * 详情
     *
     * @param id
     * @return
     */
    MwApplicationVO detail(Long id);
    /**
     * 审核
     *
     * @param dto
     * @return
     */
    void audit(MwApplicationDTO dto);
}
medicalWaste-system/src/main/java/com/sinata/system/service/MwAttachmentService.java
@@ -1,7 +1,7 @@
package com.sinata.system.service;
import com.sinata.system.domain.MwAttachment;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sinata.system.domain.MwAttachment;
/**
 * <p>
medicalWaste-system/src/main/java/com/sinata/system/service/MwRegulatoryRecordService.java
@@ -1,7 +1,11 @@
package com.sinata.system.service;
import com.sinata.common.entity.PageDTO;
import com.sinata.system.domain.MwRegulatoryRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sinata.system.domain.dto.MwRegulatoryRecordDTO;
import com.sinata.system.domain.query.MwRegulatoryRecordQuery;
import com.sinata.system.domain.vo.MwRegulatoryRecordVO;
/**
 * <p>
@@ -12,5 +16,46 @@
 * @since 2024-12-02
 */
public interface MwRegulatoryRecordService extends IService<MwRegulatoryRecord> {
    /**
     * 分页列表
     *
     * @param query
     * @return
     */
    PageDTO<MwRegulatoryRecordVO> pageList(MwRegulatoryRecordQuery query);
    /**
     * 详情
     *
     * @param id
     * @return
     */
    MwRegulatoryRecordVO detail(Long id);
    /**
     * 新增检查记录
     *
     * @param dto
     * @return
     */
    void add(MwRegulatoryRecordDTO dto);
    /**
     * 编辑检查记录
     *
     * @param dto
     * @return
     */
    void edit(MwRegulatoryRecordDTO dto);
    /**
     * 删除
     *
     * @param id
     * @return
     */
    void delete(Long id);
}
medicalWaste-system/src/main/java/com/sinata/system/service/MwStaffService.java
@@ -1,7 +1,11 @@
package com.sinata.system.service;
import com.sinata.common.entity.PageDTO;
import com.sinata.system.domain.MwStaff;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sinata.system.domain.dto.MwStaffDTO;
import com.sinata.system.domain.query.MwStaffQuery;
import com.sinata.system.domain.vo.MwStaffVO;
/**
 * <p>
@@ -13,4 +17,35 @@
 */
public interface MwStaffService extends IService<MwStaff> {
    /**
     * 分页列表
     *
     * @param query
     * @return
     */
    PageDTO<MwStaffVO> pageList(MwStaffQuery query);
    /**
     * 详情
     *
     * @param id
     * @return
     */
    MwStaffVO detail(Long id);
    /**
     * 新增
     *
     * @param dto
     * @return
     */
    void add(MwStaffDTO dto);
    /**
     * 编辑
     *
     * @param dto
     * @return
     */
    void edit(MwStaffDTO dto);
}
medicalWaste-system/src/main/java/com/sinata/system/service/OssService.java
New file
@@ -0,0 +1,28 @@
package com.sinata.system.service;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
/**
 * @author mitao
 * @date 2024/12/23
 */
public interface OssService {
    /**
     * 文件上传
     *
     * @param file
     * @return
     */
    String uploadFile(MultipartFile file) throws IOException;
    /**
     * 文件上传,指定上传路径
     *
     * @param storagePath
     * @param file
     * @return
     */
    String upload(String storagePath, MultipartFile file) throws IOException;
}
medicalWaste-system/src/main/java/com/sinata/system/service/SysAgreementService.java
New file
@@ -0,0 +1,21 @@
package com.sinata.system.service;
import com.sinata.system.domain.SysAgreement;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sinata.system.domain.dto.SysAgreementDTO;
/**
 * <p>
 * 协议 服务类
 * </p>
 *
 * @author mitao
 * @since 2024-12-23
 */
public interface SysAgreementService extends IService<SysAgreement> {
    /**
     * 保存用户注册协议
     * @param dto
     */
    void saveAgreement(SysAgreementDTO dto);
}
medicalWaste-system/src/main/java/com/sinata/system/service/SysDepartmentService.java
@@ -75,7 +75,7 @@
     * @param parentId
     * @return
     */
    String getTreeCode(Long parentId);
    String generateTreeCode(Long parentId);
    /**
     * 生成组织编码
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwApplicationServiceImpl.java
@@ -1,10 +1,20 @@
package com.sinata.system.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sinata.common.entity.PageDTO;
import com.sinata.common.exception.ServiceException;
import com.sinata.system.domain.MwApplication;
import com.sinata.system.domain.dto.MwApplicationDTO;
import com.sinata.system.domain.query.MwApplicationQuery;
import com.sinata.system.domain.vo.MwApplicationVO;
import com.sinata.system.mapper.MwApplicationMapper;
import com.sinata.system.service.MwApplicationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sinata.system.service.SysDepartmentService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.Objects;
/**
 * <p>
@@ -15,6 +25,49 @@
 * @since 2024-12-02
 */
@Service
@RequiredArgsConstructor
public class MwApplicationServiceImpl extends ServiceImpl<MwApplicationMapper, MwApplication> implements MwApplicationService {
    private final SysDepartmentService sysDepartmentService;
    /**
     * 分页列表
     *
     * @param query
     * @return
     */
    @Override
    public PageDTO<MwApplicationVO> pageList(MwApplicationQuery query) {
        String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId());
        Page<MwApplicationVO> page = baseMapper.pageList(new Page<>(query.getPageCurr(), query.getPageSize()), query, treeCode);
        return PageDTO.of(page);
    }
    /**
     * 详情
     *
     * @param id
     * @return
     */
    @Override
    public MwApplicationVO detail(Long id) {
        return baseMapper.detail(id);
    }
    /**
     * 审核
     *
     * @param dto
     * @return
     */
    @Override
    public void audit(MwApplicationDTO dto) {
        MwApplication mwApplication = getById(dto.getId());
        if (Objects.isNull(mwApplication)) {
            throw new ServiceException("该申请记录不存在");
        }
        mwApplication.setAuditStatus(dto.getAuditStatus() == 1 ? 2 : 3);
        mwApplication.setAuditOpinion(dto.getAuditOpinion());
        updateById(mwApplication);
        //TODO 发送短信通知
    }
}
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwBusinessDeviceServiceImpl.java
@@ -38,7 +38,7 @@
     */
    @Override
    public PageDTO<MwBusinessDeviceVO> pageList(MwBusinessDeviceQuery query) {
        String treeCode = sysDepartmentService.getTreeCode(query.getDepartmentId());
        String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId());
        Page<MwBusinessDeviceVO> page = baseMapper.pageList(new Page<>(query.getPageCurr(), query.getPageSize()), query, treeCode);
        return PageDTO.of(page);
    }
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwCheckoutRecordServiceImpl.java
@@ -46,7 +46,7 @@
     */
    @Override
    public PageDTO<MwCheckoutRecordVO> pageHospitalTransitList(CheckoutRecordQuery query) {
        String treeCode = sysDepartmentService.getTreeCode(query.getDepartmentId());
        String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId());
        if (StringUtils.isBlank(treeCode)) {
            return PageDTO.empty(0L, 0L);
        }
@@ -62,7 +62,7 @@
     */
    @Override
    public void checkoutRecordExport(CheckoutRecordQuery query, HttpServletResponse response) throws IOException {
        String treeCode = sysDepartmentService.getTreeCode(query.getDepartmentId());
        String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId());
        if (StringUtils.isBlank(treeCode)) {
            return;
        }
@@ -108,7 +108,7 @@
     */
    @Override
    public PageDTO<MwTransitRecordVO> transitPageList(MwTransitRecordQuery query) {
        String treeCode = sysDepartmentService.getTreeCode(query.getDepartmentId());
        String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId());
        Page<MwTransitRecordVO> page = baseMapper.transitPageList(new Page<>(query.getPageCurr(), query.getPageSize()), query, treeCode);
        return PageDTO.of(page);
    }
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwContractServiceImpl.java
@@ -67,8 +67,10 @@
    @Override
    public MwContractVO detail(Long id) {
        MwContractVO mwContractVO = BeanUtils.copyBean(getById(id), MwContractVO.class);
        List<MwAttachment> list = mwAttachmentService.lambdaQuery().eq(MwAttachment::getType, AttachmentTypeEnum.CONTRACT.getCode()).eq(MwAttachment::getTargetId, id).list();
        mwContractVO.setAttachmentList(BeanUtils.copyToList(list, MwAttachmentVO.class));
        if (Objects.nonNull(mwContractVO)) {
            List<MwAttachment> list = mwAttachmentService.lambdaQuery().eq(MwAttachment::getType, AttachmentTypeEnum.CONTRACT.getCode()).eq(MwAttachment::getTargetId, id).list();
            mwContractVO.setAttachmentList(BeanUtils.copyToList(list, MwAttachmentVO.class));
        }
        return mwContractVO;
    }
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwDisposalRecordServiceImpl.java
@@ -41,7 +41,7 @@
     */
    @Override
    public DisposalRecordStaticsVO statics(MwDisposalRecordQuery query) {
        String treeCode = sysDepartmentService.getTreeCode(query.getDepartmentId());
        String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId());
        if (StringUtils.isNotBlank(treeCode)) {
            List<MwDisposalRecordVO> disposalRecordVOList = baseMapper.getStaticsData(query, treeCode);
            if (CollUtils.isNotEmpty(disposalRecordVOList)) {
@@ -65,7 +65,7 @@
     */
    @Override
    public PageDTO<MwDisposalRecordVO> pageList(MwDisposalRecordQuery query) {
        String treeCode = sysDepartmentService.getTreeCode(query.getDepartmentId());
        String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId());
        if (StringUtils.isBlank(treeCode)) {
            return PageDTO.empty(0L, 0L);
        }
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwMonitorDeviceServiceImpl.java
@@ -39,7 +39,7 @@
     */
    @Override
    public PageDTO<MwMonitorDeviceVO> pageList(MwMonitorDeviceQuery query) {
        String treeCode = sysDepartmentService.getTreeCode(query.getDepartmentId());
        String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId());
        Page<MwMonitorDeviceVO> page = baseMapper.pageList(new Page<>(query.getPageCurr(), query.getPageSize()), query, treeCode);
        return PageDTO.of(page);
    }
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwProtectionEquipmentServiceImpl.java
@@ -55,7 +55,7 @@
     */
    @Override
    public PageDTO<MwProtectionEquipmentVO> pageList(MwProtectionEquipmentQuery query) {
        String treeCode = sysDepartmentService.getTreeCode(query.getDepartmentId());
        String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId());
        Page<MwProtectionEquipmentVO> page = baseMapper.pageList(new Page<>(query.getPageCurr(), query.getPageSize()), query, treeCode);
        return PageDTO.of(page);
    }
@@ -69,9 +69,11 @@
    @Override
    public MwProtectionEquipmentVO detail(Long id) {
        MwProtectionEquipmentVO mwProtectionEquipmentVO = BeanUtils.copyBean(this.getById(id), MwProtectionEquipmentVO.class);
        //查询附件列表
        List<MwAttachment> list = mwAttachmentService.lambdaQuery().eq(MwAttachment::getType, AttachmentTypeEnum.PROTECTION_EQUIPMENT.getCode()).eq(MwAttachment::getTargetId, id).list();
        mwProtectionEquipmentVO.setAttachmentList(BeanUtils.copyToList(list, MwAttachmentVO.class));
        if (Objects.nonNull(mwProtectionEquipmentVO)) {
            //查询附件列表
            List<MwAttachment> list = mwAttachmentService.lambdaQuery().eq(MwAttachment::getType, AttachmentTypeEnum.PROTECTION_EQUIPMENT.getCode()).eq(MwAttachment::getTargetId, id).list();
            mwProtectionEquipmentVO.setAttachmentList(BeanUtils.copyToList(list, MwAttachmentVO.class));
        }
        return mwProtectionEquipmentVO;
    }
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwProtectionRegulationServiceImpl.java
@@ -49,7 +49,7 @@
     */
    @Override
    public PageDTO<MwProtectionRegulationVO> pageList(MwProtectionRegulationQuery query) {
        String treeCode = sysDepartmentService.getTreeCode(query.getDepartmentId());
        String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId());
        Page<MwProtectionRegulationVO> page = baseMapper.pageList(new Page<>(query.getPageCurr(), query.getPageSize()), query, treeCode);
        return PageDTO.of(page);
    }
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwProtectionTaskServiceImpl.java
@@ -53,7 +53,7 @@
     */
    @Override
    public PageDTO<MwProtectionTaskVO> pageList(MwProtectionTaskQuery query) {
        String treeCode = sysDepartmentService.getTreeCode(query.getDepartmentId());
        String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId());
        Page<MwProtectionTaskVO> page = baseMapper.pageList(new Page<>(query.getPageCurr(), query.getPageSize()), query, treeCode);
        return PageDTO.of(page);
    }
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwRegulatoryRecordServiceImpl.java
@@ -1,10 +1,29 @@
package com.sinata.system.service.impl;
import com.sinata.system.domain.MwRegulatoryRecord;
import com.sinata.system.mapper.MwRegulatoryRecordMapper;
import com.sinata.system.service.MwRegulatoryRecordService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sinata.common.entity.PageDTO;
import com.sinata.common.exception.ServiceException;
import com.sinata.common.utils.BeanUtils;
import com.sinata.common.utils.CollUtils;
import com.sinata.system.domain.MwAttachment;
import com.sinata.system.domain.MwRegulatoryRecord;
import com.sinata.system.domain.SysDepartment;
import com.sinata.system.domain.dto.MwRegulatoryRecordDTO;
import com.sinata.system.domain.query.MwRegulatoryRecordQuery;
import com.sinata.system.domain.vo.MwAttachmentVO;
import com.sinata.system.domain.vo.MwRegulatoryRecordVO;
import com.sinata.system.enums.AttachmentTypeEnum;
import com.sinata.system.mapper.MwRegulatoryRecordMapper;
import com.sinata.system.service.MwAttachmentService;
import com.sinata.system.service.MwRegulatoryRecordService;
import com.sinata.system.service.SysDepartmentService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Objects;
/**
 * <p>
@@ -15,6 +34,106 @@
 * @since 2024-12-02
 */
@Service
@RequiredArgsConstructor
public class MwRegulatoryRecordServiceImpl extends ServiceImpl<MwRegulatoryRecordMapper, MwRegulatoryRecord> implements MwRegulatoryRecordService {
    private final SysDepartmentService sysDepartmentService;
    private final MwAttachmentService mwAttachmentService;
    /**
     * 分页列表
     *
     * @param query
     * @return
     */
    @Override
    public PageDTO<MwRegulatoryRecordVO> pageList(MwRegulatoryRecordQuery query) {
        String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId());
        Page<MwRegulatoryRecordVO> page = baseMapper.pageList(new Page<>(), query, treeCode);
        return PageDTO.of(page);
    }
    /**
     * 详情
     *
     * @param id
     * @return
     */
    @Override
    public MwRegulatoryRecordVO detail(Long id) {
        MwRegulatoryRecord regulatoryRecord = getById(id);
        MwRegulatoryRecordVO vo = BeanUtils.copyBean(regulatoryRecord, MwRegulatoryRecordVO.class);
        if (Objects.nonNull(vo)) {
            List<MwAttachment> list = mwAttachmentService.lambdaQuery().eq(MwAttachment::getType, AttachmentTypeEnum.REGULATORY.getCode()).eq(MwAttachment::getTargetId, id).list();
            vo.setAttachmentList(BeanUtils.copyToList(list, MwAttachmentVO.class));
            SysDepartment department = sysDepartmentService.getById(vo.getDepartmentId());
            if (Objects.nonNull(department)) {
                vo.setDepartmentName(department.getDepartmentName());
            }
        }
        return vo;
    }
    /**
     * 新增检查记录
     *
     * @param dto
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void add(MwRegulatoryRecordDTO dto) {
        MwRegulatoryRecord mwRegulatoryRecord = BeanUtils.copyBean(dto, MwRegulatoryRecord.class);
        save(mwRegulatoryRecord);
        //保存附件
        if (CollUtils.isNotEmpty(dto.getAttachmentList())) {
            List<MwAttachment> mwAttachments = BeanUtils.copyToList(dto.getAttachmentList(), MwAttachment.class);
            mwAttachments.forEach(attachment -> {
                attachment.setTargetId(mwRegulatoryRecord.getId());
                attachment.setType(AttachmentTypeEnum.REGULATORY.getCode());
            });
            mwAttachmentService.saveBatch(mwAttachments);
        }
    }
    /**
     * 编辑检查记录
     *
     * @param dto
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void edit(MwRegulatoryRecordDTO dto) {
        if (Objects.isNull(dto.getId())) {
            throw new ServiceException("检查记录id不能为空");
        }
        MwRegulatoryRecord mwRegulatoryRecord = BeanUtils.copyBean(dto, MwRegulatoryRecord.class);
        updateById(mwRegulatoryRecord);
        //删除原来的附件
        mwAttachmentService.lambdaUpdate().eq(MwAttachment::getType, AttachmentTypeEnum.REGULATORY.getCode()).eq(MwAttachment::getTargetId, dto.getId()).remove();
        //保存附件
        if (CollUtils.isNotEmpty(dto.getAttachmentList())) {
            List<MwAttachment> mwAttachments = BeanUtils.copyToList(dto.getAttachmentList(), MwAttachment.class);
            mwAttachments.forEach(attachment -> {
                attachment.setTargetId(mwRegulatoryRecord.getId());
                attachment.setType(AttachmentTypeEnum.REGULATORY.getCode());
            });
            mwAttachmentService.saveBatch(mwAttachments);
        }
    }
    /**
     * 删除
     *
     * @param id
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void delete(Long id) {
        //删除附件
        mwAttachmentService.lambdaUpdate().eq(MwAttachment::getType, AttachmentTypeEnum.REGULATORY.getCode()).eq(MwAttachment::getTargetId, id).remove();
        removeById(id);
    }
}
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwStaffServiceImpl.java
@@ -1,10 +1,22 @@
package com.sinata.system.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sinata.common.entity.PageDTO;
import com.sinata.common.exception.ServiceException;
import com.sinata.common.utils.BeanUtils;
import com.sinata.system.domain.MwStaff;
import com.sinata.system.domain.SysDepartment;
import com.sinata.system.domain.dto.MwStaffDTO;
import com.sinata.system.domain.query.MwStaffQuery;
import com.sinata.system.domain.vo.MwStaffVO;
import com.sinata.system.mapper.MwStaffMapper;
import com.sinata.system.service.MwStaffService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sinata.system.service.SysDepartmentService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.Objects;
/**
 * <p>
@@ -15,6 +27,74 @@
 * @since 2024-12-02
 */
@Service
@RequiredArgsConstructor
public class MwStaffServiceImpl extends ServiceImpl<MwStaffMapper, MwStaff> implements MwStaffService {
    private final SysDepartmentService sysDepartmentService;
    /**
     * 分页列表
     *
     * @param query
     * @return
     */
    @Override
    public PageDTO<MwStaffVO> pageList(MwStaffQuery query) {
        String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId());
        Page<MwStaffVO> page = baseMapper.pageList(new Page<>(query.getPageCurr(), query.getPageSize()), query, treeCode);
        return PageDTO.of(page);
    }
    /**
     * 详情
     *
     * @param id
     * @return
     */
    @Override
    public MwStaffVO detail(Long id) {
        MwStaff staff = getById(id);
        MwStaffVO mwStaffVO = BeanUtils.copyBean(staff, MwStaffVO.class);
        if (Objects.nonNull(mwStaffVO)) {
            SysDepartment department = sysDepartmentService.getById(mwStaffVO.getDepartmentId());
            if (Objects.nonNull(department)) {
                mwStaffVO.setDepartmentName(department.getDepartmentName());
            }
        }
        return mwStaffVO;
    }
    /**
     * 新增
     *
     * @param dto
     * @return
     */
    @Override
    public void add(MwStaffDTO dto) {
        MwStaff mwStaff = BeanUtils.copyBean(dto, MwStaff.class);
        Long count = this.lambdaQuery().eq(MwStaff::getPhone, mwStaff.getPhone()).count();
        if (count > 0) {
            throw new ServiceException("手机号码已存在");
        }
        save(mwStaff);
    }
    /**
     * 编辑
     *
     * @param dto
     * @return
     */
    @Override
    public void edit(MwStaffDTO dto) {
        if (Objects.isNull(dto.getId())) {
            throw new ServiceException("职工id不能为空");
        }
        MwStaff mwStaff = BeanUtils.copyBean(dto, MwStaff.class);
        Long count = this.lambdaQuery().eq(MwStaff::getPhone, mwStaff.getPhone()).ne(MwStaff::getId, dto.getId()).count();
        if (count > 0) {
            throw new ServiceException("手机号码已存在");
        }
        updateById(mwStaff);
    }
}
medicalWaste-system/src/main/java/com/sinata/system/service/impl/MwTransitCarServiceImpl.java
@@ -38,7 +38,7 @@
     */
    @Override
    public PageDTO<MwTransitCarVO> pageList(TransitCarQuery query) {
        String treeCode = sysDepartmentService.getTreeCode(query.getDepartmentId());
        String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId());
        Page<MwTransitCarVO> page = baseMapper.pageList(new Page<>(query.getPageCurr(), query.getPageSize()), query, treeCode);
        return PageDTO.of(page);
    }
medicalWaste-system/src/main/java/com/sinata/system/service/impl/OssServiceImpl.java
New file
@@ -0,0 +1,103 @@
package com.sinata.system.service.impl;
import com.aliyun.oss.ClientBuilderConfiguration;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.common.auth.CredentialsProvider;
import com.aliyun.oss.common.auth.DefaultCredentialProvider;
import com.aliyun.oss.common.comm.SignVersion;
import com.aliyun.oss.model.PutObjectRequest;
import com.aliyun.oss.model.PutObjectResult;
import com.sinata.common.utils.StringUtils;
import com.sinata.system.config.OssConfig;
import com.sinata.system.service.OssService;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
import java.util.Objects;
import java.util.UUID;
/**
 * @author mitao
 * @date 2024/12/23
 */
@Service
public class OssServiceImpl implements OssService {
    /**
     * 文件上传
     *
     * @param file
     * @return
     */
    @Override
    public String uploadFile(MultipartFile file) throws IOException {
        return upload(OssConfig.FOLDER, file);
    }
    /**
     * 文件上传,指定上传路径
     *
     * @param storagePath
     * @param file
     * @return
     */
    @Override
    public String upload(String storagePath, MultipartFile file) throws IOException {
        CredentialsProvider credentialsProvider = new DefaultCredentialProvider(OssConfig.ACCESS_KEY_ID, OssConfig.ACCESS_KEY_SECRET);
        String region = "cn-chengdu";
        // 创建OSSClient实例。
        ClientBuilderConfiguration clientBuilderConfiguration = new ClientBuilderConfiguration();
        clientBuilderConfiguration.setSignatureVersion(SignVersion.V4);
        OSS ossClient = OSSClientBuilder.create()
                .endpoint(OssConfig.UPLOAD_ENDPOINT)
                .credentialsProvider(credentialsProvider)
                .clientConfiguration(clientBuilderConfiguration)
                .region(region)
                .build();
        InputStream inputStream = file.getInputStream();
        String originFileName = file.getOriginalFilename();
        String fileExt = Objects.requireNonNull(originFileName).substring(originFileName.lastIndexOf(".") + 1);
        String fileName = originFileName.substring(0, originFileName.lastIndexOf("."));
        // 设置文件名
        String filePathName = generateRelativeStoragePath(storagePath, fileExt, fileName);
        // 创建PutObjectRequest对象。
        PutObjectRequest putObjectRequest = new PutObjectRequest(OssConfig.BUCKET_NAME, filePathName, inputStream);
        // 创建PutObject请求。
        PutObjectResult result = ossClient.putObject(putObjectRequest);
        return OssConfig.DOWNLOAD_ENDPOINT + filePathName;
    }
    /**
     * <pre>
     * 获取存储的相对路径
     * 规则path + / + yyyyMMddHH  + uuid
     * </pre>
     *
     * @param storagePath
     * @return
     */
    private static String generateRelativeStoragePath(String storagePath, String fileType, String fileName) {
        String time = DateFormatUtils.format(new Date(), "yyyyMMddHHmmss");
        String uuid = UUID.randomUUID().toString();
        StringBuilder sb = new StringBuilder();
        if (StringUtils.isNotBlank(storagePath)) {
            sb.append(storagePath).append("/");
        }
        if (fileName == null) {
            sb.append(time).append(uuid);
        } else {
            sb.append(fileName).append(time);
        }
        if (StringUtils.isNotBlank(fileType)) {
            sb.append(".").append(fileType);
        }
        return sb.toString();
    }
}
medicalWaste-system/src/main/java/com/sinata/system/service/impl/SysAgreementServiceImpl.java
New file
@@ -0,0 +1,29 @@
package com.sinata.system.service.impl;
import com.sinata.system.domain.SysAgreement;
import com.sinata.system.domain.dto.SysAgreementDTO;
import com.sinata.system.mapper.SysAgreementMapper;
import com.sinata.system.service.SysAgreementService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
 * <p>
 * 协议 服务实现类
 * </p>
 *
 * @author mitao
 * @since 2024-12-23
 */
@Service
public class SysAgreementServiceImpl extends ServiceImpl<SysAgreementMapper, SysAgreement> implements SysAgreementService {
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void saveAgreement(SysAgreementDTO dto) {
        SysAgreement sysAgreement = lambdaQuery().eq(SysAgreement::getType, 1).oneOpt().orElse(new SysAgreement());
        sysAgreement.setContent(dto.getContent());
        sysAgreement.setType(1);
        saveOrUpdate(sysAgreement);
    }
}
medicalWaste-system/src/main/java/com/sinata/system/service/impl/SysDepartmentServiceImpl.java
@@ -223,7 +223,7 @@
        SysDepartment department = BeanUtils.copyBean(dto, SysDepartment.class);
        //获取部门树编码
        department.setOrgType(DepartmentEnum.REGION.getCode());
        department.setTreeCode(getTreeCode(dto.getParentId()));
        department.setTreeCode(generateTreeCode(dto.getParentId()));
        department.setOrgCode(getOrgCode(dto.getParentId(), DepartmentEnum.REGION.getCode()));
        save(department);
    }
@@ -258,7 +258,7 @@
        SysDepartment sysDepartment = getById(dto.getId());
        if (!dto.getParentId().equals(sysDepartment.getParentId())) {
            //获取部门树编码
            department.setTreeCode(getTreeCode(dto.getParentId()));
            department.setTreeCode(generateTreeCode(dto.getParentId()));
        }
        updateById(department);
    }
@@ -270,7 +270,7 @@
     * @return
     */
    @Override
    public String getTreeCode(Long parentId) {
    public String generateTreeCode(Long parentId) {
        String treeId;
        String preTreeCode = "";
@@ -397,7 +397,7 @@
            throw new ServiceException("医疗机构已存在");
        }
        SysDepartment department = BeanUtils.copyBean(dto, SysDepartment.class);
        department.setTreeCode(getTreeCode(parent.getId()));
        department.setTreeCode(generateTreeCode(parent.getId()));
        department.setOrgCode(getOrgCode(parent.getId(), DepartmentEnum.MEDICAL_INSTITUTION.getCode()));
        department.setOrgType(DepartmentEnum.MEDICAL_INSTITUTION.getCode());
        //查询父级完整区域
@@ -409,6 +409,12 @@
        sysDepartmentInfoService.save(sysDepartmentInfo);
    }
    /**
     * 根据父级区域id查询处置单位列表
     *
     * @param id
     * @return
     */
    @Override
    public List<DisposalUnitVO> getDisposalUnitListByParentId(Long id) {
        List<DisposalUnitVO> disposalUnitList = null;
@@ -421,7 +427,7 @@
    }
    /**
     * 获取完成区域
     * 获取完整区域
     *
     * @param department
     * @return
@@ -471,7 +477,7 @@
        }
        SysDepartment department = BeanUtils.copyBean(dto, SysDepartment.class);
        if (!department.getParentId().equals(sysDepartment.getParentId())) {
            department.setTreeCode(getTreeCode(parent.getId()));
            department.setTreeCode(generateTreeCode(parent.getId()));
            //查询父级完整区域
            String region = getRegionName(parent);
            department.setRegion(region);
@@ -554,7 +560,7 @@
            throw new ServiceException("处置单位已存在");
        }
        SysDepartment department = BeanUtils.copyBean(dto, SysDepartment.class);
        department.setTreeCode(getTreeCode(parent.getId()));
        department.setTreeCode(generateTreeCode(parent.getId()));
        department.setOrgCode(getOrgCode(parent.getId(), DepartmentEnum.DISPOSAL_UNIT.getCode()));
        department.setOrgType(DepartmentEnum.DISPOSAL_UNIT.getCode());
        //查询父级完整区域
@@ -601,7 +607,7 @@
        SysDepartment department = BeanUtils.copyBean(dto, SysDepartment.class);
        if (!department.getParentId().equals(sysDepartment.getParentId())) {
            department.setTreeCode(getTreeCode(parent.getId()));
            department.setTreeCode(generateTreeCode(parent.getId()));
            //查询父级完整区域
            String region = getRegionName(parent);
            department.setRegion(region);
@@ -680,7 +686,7 @@
            throw new ServiceException("监管单位已存在");
        }
        SysDepartment department = BeanUtils.copyBean(dto, SysDepartment.class);
        department.setTreeCode(getTreeCode(parent.getId()));
        department.setTreeCode(generateTreeCode(parent.getId()));
        department.setOrgCode(getOrgCode(parent.getId(), DepartmentEnum.REGULATORY_UNIT.getCode()));
        department.setOrgType(DepartmentEnum.REGULATORY_UNIT.getCode());
        //查询父级完整区域
@@ -724,7 +730,7 @@
        SysDepartment department = BeanUtils.copyBean(dto, SysDepartment.class);
        if (!department.getParentId().equals(sysDepartment.getParentId())) {
            department.setTreeCode(getTreeCode(parent.getId()));
            department.setTreeCode(generateTreeCode(parent.getId()));
            //查询父级完整区域
            String region = getRegionName(parent);
            department.setRegion(region);
medicalWaste-system/src/main/resources/mapper/system/MwApplicationMapper.xml
@@ -32,5 +32,64 @@
        UPDATE_TIME,
        ID, DEPARTMENT_ID, UNIT_TYPE, UNIT_NAME, CONCAT, PHONE, DESCRIPTION, LEGAL_PERSON_CARD_FRONT, LEGAL_PERSON_CARD_BACK, CERTIFICATE_IMAGE_URL, AUDIT_STATUS, AUDIT_OPINION
    </sql>
    <select id="pageList" resultType="com.sinata.system.domain.vo.MwApplicationVO">
        SELECT MA.ID,
        MA.DEPARTMENT_ID,
        MA.UNIT_TYPE,
        MA.UNIT_NAME,
        MA.CONCAT,
        MA.PHONE,
        MA.DESCRIPTION,
        MA.LEGAL_PERSON_CARD_FRONT,
        MA.LEGAL_PERSON_CARD_BACK,
        MA.CERTIFICATE_IMAGE_URL,
        MA.AUDIT_STATUS,
        MA.AUDIT_OPINION,
        MA.CREATE_TIME,
        MA.REGION,
        SD.DEPARTMENT_NAME
        FROM MW_APPLICATION MA
        LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MA.DEPARTMENT_ID
        <where>
            MA.DEL_FLAG = 0
            <if test="treeCode != null and treeCode !=''">
                AND SD.TREE_CODE LIKE CONCAT(#{treeCode}, '%')
            </if>
            <if test="query.unitType != null and query.unitType !=''">
                AND MA.UNIT_TYPE = #{query.unitType}
            </if>
            <if test="query.unitName != null and query.unitName !=''">
                AND MA.UNIT_NAME LIKE CONCAT('%',#{query.unitName},'%')
            </if>
            <if test="query.concat !=null and query.concat != ''">
                AND MA.CONCAT LIKE CONCAT('%',#{query.concat},'%')
            </if>
            <if test="query.phone != null and query.phone != ''">
                AND MA.PHONE LIKE CONCAT('%',#{query.phone},'%')
            </if>
        </where>
    </select>
    <select id="detail" resultType="com.sinata.system.domain.vo.MwApplicationVO">
        SELECT MA.ID,
        MA.DEPARTMENT_ID,
        MA.UNIT_TYPE,
        MA.UNIT_NAME,
        MA.CONCAT,
        MA.PHONE,
        MA.DESCRIPTION,
        MA.LEGAL_PERSON_CARD_FRONT,
        MA.LEGAL_PERSON_CARD_BACK,
        MA.CERTIFICATE_IMAGE_URL,
        MA.AUDIT_STATUS,
        MA.AUDIT_OPINION,
        MA.CREATE_TIME,
        MA.REGION,
        SD.DEPARTMENT_NAME
        FROM MW_APPLICATION MA
        LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MA.DEPARTMENT_ID
        <where>
            MA.ID = #{id}
        </where>
    </select>
</mapper>
medicalWaste-system/src/main/resources/mapper/system/MwRegulatoryRecordMapper.xml
@@ -28,5 +28,29 @@
        UPDATE_TIME,
        ID, DEPARTMENT_ID, CHECK_DATE, CHECK_BY, CODE_TYPE, CHECK_RESULTS, IMAGE_URL, ATTACHMENT
    </sql>
    <select id="pageList" resultType="com.sinata.system.domain.vo.MwRegulatoryRecordVO">
        SELECT MRR.ID,
        MRR.DEPARTMENT_ID,
        MRR.CHECK_DATE,
        MRR.CHECK_BY,
        MRR.CODE_TYPE,
        MRR.CHECK_RESULTS,
        MRR.IMAGE_URL,
        SD.DEPARTMENT_NAME
        FROM MW_REGULATORY_RECORD MRR
        LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MRR.DEPARTMENT_ID
        <where>
            MRR.DEL_FLAG = 0
            <if test="treeCode != null and treeCode != ''">
                AND SD.TREE_CODE LIKE CONCAT(#{treeCode},'%')
            </if>
            <if test="query.codeType != null">
                AND MRR.CODE_TYPE = #{query.codeType}
            </if>
            <if test="query.startTime != null and query.endTime != null">
                AND MRR.CHECK_DATE BETWEEN #{query.startTime} AND #{query.endTime}
            </if>
        </where>
    </select>
</mapper>
medicalWaste-system/src/main/resources/mapper/system/MwStaffMapper.xml
@@ -26,5 +26,40 @@
        UPDATE_TIME,
        ID, DEPARTMENT_ID, STAFF_NAME, PHONE, HEALTH_CERTIFICATE, VACCINE_CERTIFICATE
    </sql>
    <select id="pageList" resultType="com.sinata.system.domain.vo.MwStaffVO">
        SELECT MS.ID,
        MS.DEPARTMENT_ID,
        MS.STAFF_NAME,
        MS.PHONE,
        MS.HEALTH_CERTIFICATE,
        MS.VACCINE_CERTIFICATE,
        SD.DEPARTMENT_NAME
        FROM MW_STAFF MS
        LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MS.DEPARTMENT_ID
        <where>
            MS.DEL_FLAG = 0
            <if test="treeCode != null and treeCode != ''">
                AND SD.TREE_CODE LIKE CONCAT(#{treeCode}, '%')
            </if>
            <if test="query.staffName !=null and query.staffName != ''">
                AND MS.STAFF_NAME LIKE CONCAT('%',#{query.staffName},'%')
            </if>
            <if test="query.phone != null and query.phone != ''">
                AND MS.PHONE LIKE CONCAT('%',#{query.phone},'%')
            </if>
            <if test="query.healthCertificateFlag != null and query.healthCertificateFlag == 1">
                AND MS.HEALTH_CERTIFICATE IS NOT NULL
            </if>
            <if test="query.healthCertificateFlag != null and query.healthCertificateFlag != 1">
                AND MS.HEALTH_CERTIFICATE IS NULL
            </if>
            <if test="query.vaccineCertificateFlag != null and query.vaccineCertificateFlag == 1">
                AND MS.VACCINE_CERTIFICATE IS NOT NULL
            </if>
            <if test="query.vaccineCertificateFlag != null and query.vaccineCertificateFlag != 1">
                AND MS.VACCINE_CERTIFICATE IS NULL
            </if>
        </where>
    </select>
</mapper>
pom.xml
@@ -35,6 +35,7 @@
        <knife4j.version>3.0.3</knife4j.version>
        <hutool.version>5.7.17</hutool.version>
        <fastexcel.version>1.0.0</fastexcel.version>
        <aliyun-oss.version>3.17.4</aliyun-oss.version>
    </properties>
    <!-- 依赖声明 -->
@@ -208,13 +209,18 @@
                <artifactId>hutool-all</artifactId>
                <version>${hutool.version}</version>
            </dependency>
            <!--fastexcel-->
            <dependency>
                <groupId>cn.idev.excel</groupId>
                <artifactId>fastexcel</artifactId>
                <version>${fastexcel.version}</version>
            </dependency>
            <!--阿里云oss-->
            <dependency>
                <groupId>com.aliyun.oss</groupId>
                <artifactId>aliyun-sdk-oss</artifactId>
                <version>${aliyun-oss.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>