| | |
| | | /** |
| | | * 转运记录详情 |
| | | * |
| | | * @param departmentId |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "转运记录详情") |
| | | @GetMapping("/hospital/detail/{departmentId}") |
| | | public R<MwCheckoutRecordVO> hospitalDetail(@ApiParam(name = "id", value = "医院id", required = true) @PathVariable("departmentId") Long departmentId) { |
| | | return R.ok(mwCheckoutRecordService.hospitalDetail(departmentId)); |
| | | @GetMapping("/hospital/detail/{id}") |
| | | public R<MwCheckoutRecordVO> hospitalDetail(@ApiParam(name = "id", value = "医院id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(mwCheckoutRecordService.hospitalDetail(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 删除字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "字典类型", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictCodes}") |
| | | public AjaxResult remove(@PathVariable Long[] dictCodes) |
| | | { |
| | | dictDataService.deleteDictDataByIds(dictCodes); |
| | | return success(); |
| | | } |
| | | //@PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | //@Log(title = "字典类型", businessType = BusinessType.DELETE) |
| | | //@DeleteMapping("/{dictCodes}") |
| | | //public AjaxResult remove(@PathVariable Long[] dictCodes) |
| | | //{ |
| | | // dictDataService.deleteDictDataByIds(dictCodes); |
| | | // return success(); |
| | | //} |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | |
| | | if (CollectionUtils.isEmpty(roles)) { |
| | | return AjaxResult.error("请关联角色!"); |
| | | } |
| | | |
| | | Optional<SysRole> any = roles.stream().filter(role -> role.getAppletFlag().equals(1)).findAny(); |
| | | if (any.isPresent()) { |
| | | return AjaxResult.error("小程序用户不能登录管理后台!"); |
| | | } |
| | | List<SysMenu> menus = roleService.roleInfoFromUserId(loginUser.getUserId()); |
| | | |
| | | Set<Long> permissions = roleService.getMenuIdSets(loginUser.getUserId()); |
| | | ajax.put("menus", menus); |
| | | ajax.put("userInfo", loginUser); |
| | | ajax.put("permissions", permissions); |
| | | return ajax; |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation("批量删除") |
| | | @PostMapping("/delBatch") |
| | | @DeleteMapping("/delBatch") |
| | | @ApiImplicitParam(name = "userIdStr", value = "用户id字符串列表", required = true) |
| | | public R<?> delBatch(@RequestParam String userIdStr) { |
| | | List<Long> userIds = Arrays.stream(userIdStr.split(",")).map(Long::valueOf).collect(Collectors.toList()); |
| | |
| | | |
| | | import com.sinata.common.core.domain.R; |
| | | import com.sinata.system.domain.MedicalWasteStaticsVO; |
| | | import com.sinata.system.domain.vo.CarDistributionVO; |
| | | import com.sinata.system.domain.vo.DepartmentTagInfoVO; |
| | | import com.sinata.system.domain.vo.MedicalInstitutionCollectListVO; |
| | | import com.sinata.system.domain.vo.MwWarningRecordStaticsVO; |
| | | import com.sinata.system.domain.vo.MwWarningRecordVO; |
| | | import com.sinata.system.domain.vo.ScreenDepartmentVO; |
| | | import com.sinata.system.domain.vo.TodayMedicalWastePieVO; |
| | | import com.sinata.system.domain.vo.TotalCollectWeightByTypeVO; |
| | |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/backend/screen") |
| | | public class ScreenController { |
| | | |
| | | private final ScreenService screenService; |
| | | |
| | | |
| | | /** |
| | | * 获取单位列表 |
| | |
| | | */ |
| | | @ApiOperation("医疗机构收集情况") |
| | | @GetMapping("/medicalInstitutionCollectList") |
| | | public R<List<MedicalInstitutionCollectListVO>> |
| | | public R<List<MedicalInstitutionCollectListVO>> medicalInstitutionCollectList() { |
| | | return R.ok(screenService.medicalInstitutionCollectList()); |
| | | } |
| | | |
| | | /** |
| | | * 预警记录统计 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation("预警记录统计") |
| | | @GetMapping("/warningRecordStaticsList") |
| | | public R<List<MwWarningRecordStaticsVO>> warningRecordStaticsList() { |
| | | return R.ok(screenService.warningRecordStaticsList()); |
| | | } |
| | | |
| | | /** |
| | | * 根据预警类型查询预警详情 |
| | | * |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @ApiOperation("根据预警类型查询预警详情") |
| | | @GetMapping("/warningRecordDetailByType/{type}") |
| | | public R<List<MwWarningRecordVO>> queryWarningRecordDetailByType(@ApiParam(name = "type", value = "预警类型", required = true) @PathVariable("type") Integer type) { |
| | | return R.ok(screenService.queryWarningRecordDetailByType(type)); |
| | | } |
| | | |
| | | /** |
| | | * 车辆分布 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation("车辆分布") |
| | | @GetMapping("/carDistribution") |
| | | public R<List<CarDistributionVO>> queryCarDistribution() { |
| | | return R.ok(screenService.queryCarDistribution()); |
| | | } |
| | | |
| | | /** |
| | | * 车辆分布详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation("车辆分布详情") |
| | | @GetMapping("/carDistributionDetail/{id}") |
| | | public R<CarDistributionVO> queryCarDistributionDetail(@ApiParam(name = "id", value = "车辆id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(screenService.queryCarDistributionDetail(id)); |
| | | } |
| | | } |
| | | |
| | |
| | | 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.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.sinata.common.entity.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | |
| | | @Setter |
| | | @TableName("MW_CONTRACT") |
| | | @ApiModel(value = "MwContract对象", description = "合同") |
| | | public class MwContract extends BaseModel { |
| | | public class MwContract implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | @ApiModelProperty("层级关系") |
| | | @TableField("RELATION") |
| | | private String relation; |
| | | |
| | | /** |
| | | * 创建者 |
| | | */ |
| | | @ApiModelProperty(value = "记录创建人,前端忽略") |
| | | @TableField(value = "create_by", fill = FieldFill.INSERT) |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "记录创建时间,前端忽略") |
| | | @TableField(value = "create_time", fill = FieldFill.INSERT) |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 更新者 |
| | | */ |
| | | @ApiModelProperty(value = "记录修改人,前端忽略") |
| | | @TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE) |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty(value = "记录修改时间,前端忽略") |
| | | @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE) |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 是否删除 0未删除 1已删除 |
| | | */ |
| | | @TableField("del_flag") |
| | | @ApiModelProperty(value = "是否删除 0未删除 1已删除") |
| | | @TableLogic(value = "0", delval = "NULL") |
| | | private Integer delFlag; |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.excel; |
| | | |
| | | import cn.idev.excel.annotation.ExcelIgnore; |
| | | import cn.idev.excel.annotation.ExcelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.net.URL; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2025/1/2 |
| | | */ |
| | | @Data |
| | | public class MwCheckoutRecordExcel { |
| | | |
| | | @ApiModelProperty("出库时间") |
| | | @ExcelProperty(value = "出库时间", index = 1) |
| | | private Date checkoutTime; |
| | | |
| | | @ExcelProperty(value = "医院", index = 2) |
| | | private String hospitalName; |
| | | |
| | | @ExcelProperty(value = "暂存间", index = 3) |
| | | private String roomName; |
| | | |
| | | @ExcelProperty(value = "箱数", index = 4) |
| | | private Integer boxNum; |
| | | |
| | | @ExcelProperty(value = "袋数", index = 5) |
| | | private Integer bagNum; |
| | | |
| | | @ExcelProperty(value = "总重量", index = 6) |
| | | private BigDecimal totalWeight; |
| | | |
| | | @ExcelProperty(value = "医院签名", index = 7) |
| | | private URL hospitalSignature; |
| | | |
| | | @ExcelProperty(value = "司机姓名", index = 8) |
| | | private String driverName; |
| | | |
| | | @ExcelProperty(value = "车牌号", index = 9) |
| | | private String licensePlateNumber; |
| | | |
| | | @ApiModelProperty("记录id") |
| | | @ExcelIgnore |
| | | private Long id; |
| | | } |
| | |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author mitao |
| | |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel("运输记录查询数据传输对象") |
| | | public class MwTransitRecordQuery extends BasePage { |
| | | |
| | | private static final long serialVersionUID = 3585169031300259198L; |
| | | |
| | | @ApiModelProperty("路线id") |
| | |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("运输开始时间") |
| | | private Date startTime; |
| | | private List<String> startTime; |
| | | |
| | | @ApiModelProperty("运输结束时间") |
| | | private Date endTime; |
| | | private List<String> endTime; |
| | | |
| | | private Date startTimeStart; |
| | | private Date startTimeEnd; |
| | | private Date endTimeStart; |
| | | private Date endTimeEnd; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("姓名") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty("用户名") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty("角色id") |
| | | private Long roleId; |
New file |
| | |
| | | package com.sinata.system.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2025/1/2 |
| | | */ |
| | | @Data |
| | | @ApiModel("车辆分布视图对象") |
| | | public class CarDistributionVO { |
| | | |
| | | @ApiModelProperty("车辆id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("车牌号") |
| | | private String licensePlateNumber; |
| | | |
| | | @ApiModelProperty("已装载") |
| | | private BigDecimal currentLoad; |
| | | |
| | | @ApiModelProperty("当前所在位置-经度") |
| | | private Double longitude; |
| | | |
| | | @ApiModelProperty("当前所在位置-纬度") |
| | | private Double latitude; |
| | | |
| | | @ApiModelProperty("车辆图片") |
| | | private String imageUrl; |
| | | |
| | | @ApiModelProperty("所属单位") |
| | | private String departmentName; |
| | | |
| | | @ApiModelProperty("负责人") |
| | | private String personInCharge; |
| | | |
| | | @ApiModelProperty("负责人联系方式") |
| | | private String phoneNumber; |
| | | |
| | | @ApiModelProperty("最大载重") |
| | | private BigDecimal maximumLoad; |
| | | /** |
| | | * 单位列表 |
| | | */ |
| | | private String pointList; |
| | | |
| | | @ApiModelProperty("线路轨迹经纬度列表") |
| | | private Set<CarTrackVO> lineSet; |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2025/1/2 |
| | | */ |
| | | @Data |
| | | @ApiModel("车辆轨迹经纬度视图对象") |
| | | public class CarTrackVO { |
| | | @ApiModelProperty("经度") |
| | | private Double longitude; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | private Double latitude; |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2025/1/2 |
| | | */ |
| | | @Data |
| | | @ApiModel("医疗机构收集情况视图对象") |
| | | public class MedicalInstitutionCollectListVO { |
| | | |
| | | @ApiModelProperty("医院名称") |
| | | private String hospitalName; |
| | | |
| | | @ApiModelProperty("医废列表") |
| | | private List<MedicalWasteCollectVO> medicalWasteList; |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2025/1/2 |
| | | */ |
| | | @Data |
| | | @ApiModel("医废收集统计视图对象") |
| | | public class MedicalWasteCollectVO { |
| | | |
| | | @ApiModelProperty("医废类型") |
| | | private String wasteTypeStr; |
| | | |
| | | @ApiModelProperty("袋数") |
| | | private Integer bagNum; |
| | | |
| | | @ApiModelProperty("重量") |
| | | private BigDecimal weight; |
| | | } |
| | |
| | | |
| | | import cn.idev.excel.annotation.ExcelIgnore; |
| | | import cn.idev.excel.annotation.ExcelProperty; |
| | | import cn.idev.excel.converters.string.StringImageConverter; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | private BigDecimal totalWeight; |
| | | |
| | | @ApiModelProperty("医院签名") |
| | | @ExcelProperty(value = "医院签名", index = 7) |
| | | @ExcelProperty(value = "医院签名", index = 7, converter = StringImageConverter.class) |
| | | private String hospitalSignature; |
| | | |
| | | @ApiModelProperty("司机姓名") |
| | |
| | | @ApiModelProperty("设备名称") |
| | | private String equipmentName; |
| | | |
| | | @ApiModelProperty("设备id") |
| | | private Long equipmentId; |
| | | |
| | | @ApiModelProperty("使用时间") |
| | | private Date useTime; |
| | | |
New file |
| | |
| | | package com.sinata.system.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2025/1/2 |
| | | */ |
| | | @Data |
| | | @ApiModel("预警记录统计视图对象") |
| | | public class MwWarningRecordStaticsVO { |
| | | |
| | | @ApiModelProperty("预警类型 1:出库超时预警;2:暂存间使用率预警;3:合同到期预警;4:健康记录预警;5:疫苗记录预警;6:防护用品使用预警;7:医疗机构产废日预警;8:医疗机构产废月预警;9:医疗机构存储量预警;10:车辆转运异常预警;11:处置单位存储量预警") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("预警类型名称") |
| | | private String typeName; |
| | | |
| | | @ApiModelProperty("预警数量") |
| | | private Long count; |
| | | } |
| | |
| | | /** |
| | | * 转运记录详情 |
| | | * |
| | | * @param departmentId |
| | | * @param id |
| | | * @return |
| | | */ |
| | | MwCheckoutRecordVO hospitalDetail(Long departmentId); |
| | | MwCheckoutRecordVO hospitalDetail(Long id); |
| | | |
| | | /** |
| | | * 转运记录医废详情分页列表 |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Page<MwMedicalWasteBoxVO> transitDetailPageList(Page<MwMedicalWasteBoxVO> objectPage, Long id); |
| | | Page<MwMedicalWasteBoxVO> transitDetailPageList(Page<MwMedicalWasteBoxVO> page, @Param("id") Long id); |
| | | |
| | | /** |
| | | * 转运记录导出 |
| | |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Page<MwStorageRecordVO> temporarilyStoredMedicalWaste(StorageRecordQuery query); |
| | | Page<MwStorageRecordVO> temporarilyStoredMedicalWaste(Page<MwStorageRecordVO> page, @Param("query") StorageRecordQuery query); |
| | | |
| | | /** |
| | | * 根据医废查询使用列表 |
| | |
| | | |
| | | import com.sinata.system.domain.MwTransitCarCollectPoint; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.sinata.system.domain.vo.CarDistributionVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Mapper |
| | | public interface MwTransitCarCollectPointMapper extends BaseMapper<MwTransitCarCollectPoint> { |
| | | /** |
| | | * 查询车辆分布列表 |
| | | * |
| | | * @param treeCode |
| | | * @return |
| | | */ |
| | | List<CarDistributionVO> queryCarListByTreeCode(String treeCode); |
| | | |
| | | /** |
| | | * @param id |
| | | * @return |
| | | */ |
| | | CarDistributionVO queryCarDistributionDetail(Long id); |
| | | } |
| | |
| | | * @param sysUserVOPage |
| | | * @param nickName |
| | | * @param roleId |
| | | * @param userName |
| | | * @return |
| | | */ |
| | | Page<SysUserVO> pageList(Page<SysUserVO> sysUserVOPage, @Param("nickName") String nickName, @Param("roleId") Long roleId, @Param("treeCode") String treeCode); |
| | | Page<SysUserVO> pageList(Page<SysUserVO> sysUserVOPage, @Param("nickName") String nickName, @Param("roleId") Long roleId, @Param("userName") String userName, @Param("treeCode") String treeCode); |
| | | } |
| | |
| | | UPDATE_TIME, |
| | | ID, CAR_ID, ROUTE_ID, POINT_LIST, TRANSIT_DATE |
| | | </sql> |
| | | <select id="queryCarListByTreeCode" resultType="com.sinata.system.domain.vo.CarDistributionVO" |
| | | parameterType="java.lang.String"> |
| | | SELECT MTC.ID, |
| | | MTC.LICENSE_PLATE_NUMBER, |
| | | SD.DEPARTMENT_NAME, |
| | | SUM(MCR.TOTAL_WEIGHT) AS currentLoad |
| | | FROM MW_TRANSIT_CAR_COLLECT_POINT MTCCP |
| | | LEFT JOIN MW_TRANSIT_CAR MTC ON MTC.ID = MTCCP.CAR_ID |
| | | LEFT JOIN SYS_DEPARTMENT SD ON MTC.DEPARTMENT_ID |
| | | LEFT JOIN MW_CHECKOUT_RECORD MCR ON MCR.CAR_ID = MTCCP.CAR_ID |
| | | <where> |
| | | SD.ORG_TYPE = 3 AND MTCCP.TRANSIT_DATE = CURDATE() AND SD.TREE_CODE LIKE CONCAT(#{treeCode}, '%') AND |
| | | MCR.DEL_FLAG = 0 |
| | | </where> |
| | | ORDER BY MTC.ID |
| | | </select> |
| | | <select id="queryCarDistributionDetail" resultType="com.sinata.system.domain.vo.CarDistributionVO" |
| | | parameterType="java.lang.Long"> |
| | | SELECT MTC.ID, |
| | | SD.DEPARTMENT_NAME, |
| | | MTC.LICENSE_PLATE_NUMBER,MTC.PERSON_IN_CHARGE,MTC.PHONE_NUMBER,MTC.MAXIMUM_LOAD, |
| | | SUM(MCR.TOTAL_WEIGHT) AS currentLoad, |
| | | MTCCP.POINT_LIST |
| | | FROM MW_TRANSIT_CAR_COLLECT_POINT MTCCP |
| | | LEFT JOIN MW_TRANSIT_CAR MTC ON MTC.ID = MTCCP.CAR_ID |
| | | LEFT JOIN SYS_DEPARTMENT SD ON MTC.DEPARTMENT_ID |
| | | LEFT JOIN MW_CHECKOUT_RECORD MCR ON MCR.CAR_ID = MTCCP.CAR_ID |
| | | <where> |
| | | SD.ORG_TYPE = 3 AND MTCCP.TRANSIT_DATE = CURDATE() AND |
| | | MCR.DEL_FLAG = 0 AND MTCCP.CAR_ID = #{carId} |
| | | </where> |
| | | ORDER BY MTC.ID |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | List<SysRoleVO> queryList(); |
| | | |
| | | /** |
| | | * 用户菜单权限集合 |
| | | * |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | Set<Long> getMenuIdSets(Long userId); |
| | | } |
| | |
| | | /** |
| | | * 转运记录详情 |
| | | * |
| | | * @param departmentId |
| | | * @param id |
| | | * @return |
| | | */ |
| | | MwCheckoutRecordVO hospitalDetail(Long departmentId); |
| | | MwCheckoutRecordVO hospitalDetail(Long id); |
| | | |
| | | /** |
| | | * 转运记录医废详情分页列表 |
| | |
| | | |
| | | import com.sinata.system.domain.MwTransitCarCollectPoint; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.sinata.system.domain.vo.CarDistributionVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface MwTransitCarCollectPointService extends IService<MwTransitCarCollectPoint> { |
| | | |
| | | /** |
| | | * 查询车辆分布列表 |
| | | * |
| | | * @param treeCode |
| | | * @return |
| | | */ |
| | | List<CarDistributionVO> queryCarListByTreeCode(String treeCode); |
| | | |
| | | /** |
| | | * 车辆分布详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | CarDistributionVO queryCarDistributionDetail(Long id); |
| | | } |
| | |
| | | import com.sinata.common.utils.DateUtils; |
| | | import com.sinata.system.domain.MedicalWasteStaticsVO; |
| | | import com.sinata.system.domain.MwCollectRecord; |
| | | import com.sinata.system.domain.MwWarningRecord; |
| | | import com.sinata.system.domain.SysDepartment; |
| | | import com.sinata.system.domain.vo.CarDistributionVO; |
| | | import com.sinata.system.domain.vo.DepartmentTagInfoVO; |
| | | import com.sinata.system.domain.vo.MedicalInstitutionCollectListVO; |
| | | import com.sinata.system.domain.vo.MedicalWasteCollectVO; |
| | | import com.sinata.system.domain.vo.MwWarningRecordStaticsVO; |
| | | import com.sinata.system.domain.vo.MwWarningRecordVO; |
| | | import com.sinata.system.domain.vo.ScreenDepartmentVO; |
| | | import com.sinata.system.domain.vo.SysDictDataVO; |
| | | import com.sinata.system.domain.vo.TodayMedicalWastePieVO; |
| | | import com.sinata.system.domain.vo.TotalCollectWeightByTypeVO; |
| | | import com.sinata.system.enums.DepartmentEnum; |
| | | import com.sinata.system.enums.WarningTypeEnum; |
| | | import com.sinata.system.service.ISysDictDataService; |
| | | import com.sinata.system.service.MwCollectRecordService; |
| | | import com.sinata.system.service.MwDisposalRecordService; |
| | | import com.sinata.system.service.MwTransitCarCollectPointService; |
| | | import com.sinata.system.service.MwWarningRecordService; |
| | | import com.sinata.system.service.SysDepartmentService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.jetbrains.annotations.NotNull; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | private final MwCollectRecordService mwCollectRecordService; |
| | | private final ISysDictDataService sysDictDataService; |
| | | private final MwDisposalRecordService mwDisposalRecordService; |
| | | private final MwWarningRecordService mwWarningRecordService; |
| | | private final MwTransitCarCollectPointService mwTransitCarCollectPointService; |
| | | |
| | | /** |
| | | * 机构分布-获取机构列表 |
| | |
| | | * @return |
| | | */ |
| | | public List<TodayMedicalWastePieVO> todayMedicalWastePie() { |
| | | SysDepartment nanNingDepartment = getNanNingDepartment(); |
| | | //查询南宁市下面的医疗机构 |
| | | List<SysDepartment> list = sysDepartmentService.lambdaQuery().likeRight(SysDepartment::getTreeCode, nanNingDepartment.getTreeCode()).eq(SysDepartment::getOrgType, DepartmentEnum.MEDICAL_INSTITUTION.getCode()).list(); |
| | | List<Long> departmentIdList = list.stream().map(SysDepartment::getId).collect(Collectors.toList()); |
| | | List<TodayMedicalWastePieVO> todayMedicalWastePieVOList = new ArrayList<>(); |
| | | List<Long> departmentIdList = getNanNingMedicalInsitutionIdList(); |
| | | if (CollUtils.isEmpty(departmentIdList)) { |
| | | return todayMedicalWastePieVOList; |
| | | } |
| | |
| | | return todayMedicalWastePieVOList; |
| | | } |
| | | |
| | | /** |
| | | * 南宁市医疗单位id列表 |
| | | * |
| | | * @return |
| | | */ |
| | | public List<Long> getNanNingMedicalInsitutionIdList() { |
| | | SysDepartment nanNingDepartment = getNanNingDepartment(); |
| | | List<SysDepartment> list = sysDepartmentService.lambdaQuery().likeRight(SysDepartment::getTreeCode, nanNingDepartment.getTreeCode()).eq(SysDepartment::getOrgType, DepartmentEnum.MEDICAL_INSTITUTION.getCode()).list(); |
| | | return list.stream().map(SysDepartment::getId).collect(Collectors.toList()); |
| | | } |
| | | /** |
| | | * 各类型医废收集总量 |
| | | * |
| | |
| | | return vo; |
| | | } |
| | | |
| | | /** |
| | | * 医疗机构收集情况 |
| | | * |
| | | * @return |
| | | */ |
| | | public List<MedicalInstitutionCollectListVO> medicalInstitutionCollectList() { |
| | | // 获取南宁市医疗机构ID列表 |
| | | List<Long> nanNingMedicalInstitutionIdList = getNanNingMedicalInsitutionIdList(); |
| | | if (CollUtils.isEmpty(nanNingMedicalInstitutionIdList)) { |
| | | return CollUtils.emptyList(); |
| | | } |
| | | |
| | | // 查询收集记录 |
| | | List<MwCollectRecord> collectRecordList = mwCollectRecordService.lambdaQuery() |
| | | .in(MwCollectRecord::getDepartmentId, nanNingMedicalInstitutionIdList) |
| | | .list(); |
| | | if (CollUtils.isEmpty(collectRecordList)) { |
| | | return CollUtils.emptyList(); |
| | | } |
| | | |
| | | // 查询医废类型 |
| | | List<SysDictDataVO> medicalWasteTypeList = sysDictDataService.medicalWasteTypeList(); |
| | | |
| | | // 根据医院分组 |
| | | Map<String, List<MwCollectRecord>> recordGroupByDepartment = collectRecordList.stream() |
| | | .collect(Collectors.groupingBy(MwCollectRecord::getHospitalName)); |
| | | |
| | | // 构建结果列表 |
| | | return recordGroupByDepartment.entrySet().stream() |
| | | .map(entry -> buildMedicalInstitutionCollectVO(entry.getKey(), entry.getValue(), medicalWasteTypeList)) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | /** |
| | | * 构建医疗机构收集情况视图对象 |
| | | * |
| | | * @param hospitalName |
| | | * @param records |
| | | * @param medicalWasteTypeList |
| | | * @return |
| | | */ |
| | | private MedicalInstitutionCollectListVO buildMedicalInstitutionCollectVO(String hospitalName, List<MwCollectRecord> records, List<SysDictDataVO> medicalWasteTypeList) { |
| | | // 医院基础信息 |
| | | MedicalInstitutionCollectListVO vo = new MedicalInstitutionCollectListVO(); |
| | | vo.setHospitalName(hospitalName); |
| | | |
| | | // 根据医废类型分组 |
| | | Map<Long, List<MwCollectRecord>> collectRecordGroupByWasteType = records.stream() |
| | | .collect(Collectors.groupingBy(MwCollectRecord::getWasteType)); |
| | | |
| | | // 构建医废类型统计信息 |
| | | List<MedicalWasteCollectVO> medicalWasteList = medicalWasteTypeList.stream() |
| | | .map(sysDictDataVO -> buildMedicalWasteCollectVO(sysDictDataVO, collectRecordGroupByWasteType)) |
| | | .collect(Collectors.toList()); |
| | | vo.setMedicalWasteList(medicalWasteList); |
| | | |
| | | return vo; |
| | | } |
| | | |
| | | /** |
| | | * 封装医废类型统计信息 |
| | | * |
| | | * @param sysDictDataVO |
| | | * @param collectRecordGroupByWasteType |
| | | * @return |
| | | */ |
| | | private MedicalWasteCollectVO buildMedicalWasteCollectVO(SysDictDataVO sysDictDataVO, Map<Long, List<MwCollectRecord>> collectRecordGroupByWasteType) { |
| | | MedicalWasteCollectVO medicalWasteCollectVO = new MedicalWasteCollectVO(); |
| | | medicalWasteCollectVO.setWasteTypeStr(sysDictDataVO.getDictLabel()); |
| | | |
| | | // 获取当前类型的医废记录 |
| | | List<MwCollectRecord> mwCollectRecords = collectRecordGroupByWasteType.get(sysDictDataVO.getDictCode()); |
| | | if (CollUtils.isNotEmpty(mwCollectRecords)) { |
| | | medicalWasteCollectVO.setBagNum(mwCollectRecords.size()); |
| | | medicalWasteCollectVO.setWeight(mwCollectRecords.stream() |
| | | .map(MwCollectRecord::getWeight) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | } else { |
| | | medicalWasteCollectVO.setBagNum(0); |
| | | medicalWasteCollectVO.setWeight(BigDecimal.ZERO); |
| | | } |
| | | return medicalWasteCollectVO; |
| | | } |
| | | |
| | | /** |
| | | * 预警记录统计 |
| | | * |
| | | * @return |
| | | */ |
| | | public List<MwWarningRecordStaticsVO> warningRecordStaticsList() { |
| | | SysDepartment nanNingDepartment = getNanNingDepartment(); |
| | | List<MwWarningRecord> warningRecordList = mwWarningRecordService.lambdaQuery().eq(MwWarningRecord::getDepartmentId, nanNingDepartment.getId()).list(); |
| | | if (CollUtils.isEmpty(warningRecordList)) { |
| | | return CollUtils.emptyList(); |
| | | } |
| | | return Arrays.stream(WarningTypeEnum.values()).map(item -> buildWarningRecordStaticsVO(item, warningRecordList)).collect(Collectors.toList()); |
| | | } |
| | | |
| | | /** |
| | | * 构建预警记录统计视图对象 |
| | | * |
| | | * @param item |
| | | * @param warningRecordList |
| | | * @return |
| | | */ |
| | | private MwWarningRecordStaticsVO buildWarningRecordStaticsVO(WarningTypeEnum item, List<MwWarningRecord> warningRecordList) { |
| | | MwWarningRecordStaticsVO vo = new MwWarningRecordStaticsVO(); |
| | | vo.setType(item.getCode()); |
| | | vo.setTypeName(item.getDesc()); |
| | | vo.setCount(warningRecordList.stream().filter(record -> record.getType().equals(item.getCode())).count()); |
| | | return vo; |
| | | } |
| | | |
| | | /** |
| | | * 根据预警类型查询预警详情 |
| | | * |
| | | * @param type |
| | | * @return |
| | | */ |
| | | public List<MwWarningRecordVO> queryWarningRecordDetailByType(Integer type) { |
| | | SysDepartment nanNingDepartment = getNanNingDepartment(); |
| | | List<MwWarningRecord> warningRecordList = mwWarningRecordService.lambdaQuery().eq(MwWarningRecord::getDepartmentId, nanNingDepartment.getId()).eq(MwWarningRecord::getType, type).list(); |
| | | return BeanUtils.copyToList(warningRecordList, MwWarningRecordVO.class); |
| | | } |
| | | |
| | | /** |
| | | * 车辆分布 |
| | | * |
| | | * @return |
| | | */ |
| | | public List<CarDistributionVO> queryCarDistribution() { |
| | | SysDepartment nanNingDepartment = getNanNingDepartment(); |
| | | //查询车辆分布列表 |
| | | return mwTransitCarCollectPointService.queryCarListByTreeCode(nanNingDepartment.getTreeCode()); |
| | | } |
| | | |
| | | /** |
| | | * 车辆分布详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public CarDistributionVO queryCarDistributionDetail(Long id) { |
| | | return mwTransitCarCollectPointService.queryCarDistributionDetail(id); |
| | | } |
| | | } |
| | |
| | | import com.sinata.common.core.domain.entity.SysDictData; |
| | | import com.sinata.common.utils.CollUtils; |
| | | import com.sinata.common.utils.DateUtils; |
| | | import com.sinata.system.domain.MedicalWasteStaticsVO; |
| | | import com.sinata.system.domain.MwCollectRecord; |
| | | import com.sinata.system.domain.MwWarningRecord; |
| | | import com.sinata.system.domain.SysDepartment; |
| | |
| | | if (CollUtils.isNotEmpty(wasteTypeList)) { |
| | | vo.setLegend(wasteTypeList.stream().map(SysDictData::getDictLabel).collect(Collectors.toList())); |
| | | vo.getLegend().add("小计"); |
| | | List<DepartmentReportItemVO> list = new ArrayList<>(); |
| | | for (TransformVO transformVO : checkoutRecordVOList) { |
| | | BigDecimal totalCount = BigDecimal.ZERO; |
| | | BigDecimal totalWeight = BigDecimal.ZERO; |
| | |
| | | } |
| | | departmentReportItemVO.getData().add(totalCount); |
| | | departmentReportItemVO.getData().add(totalWeight); |
| | | list.add(departmentReportItemVO); |
| | | } |
| | | vo.setList(list); |
| | | } |
| | | } |
| | | } |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void add(String boxNumberStart, String boxNumberEnd) { |
| | | String regx = "\\d+"; |
| | | if (boxNumberStart.length() != 11 || boxNumberEnd.length() != 11 || !boxNumberStart.matches(regx) || !boxNumberEnd.matches(regx)) { |
| | | throw new ServiceException("请输入有效的11位数字编号!"); |
| | | } |
| | | //String regx = "\\d+"; |
| | | //if (boxNumberStart.length() != 11 || boxNumberEnd.length() != 11 || !boxNumberStart.matches(regx) || !boxNumberEnd.matches(regx)) { |
| | | // throw new ServiceException("请输入有效的11位数字编号!"); |
| | | //} |
| | | BigDecimal start = new BigDecimal(boxNumberStart); |
| | | BigDecimal end = new BigDecimal(boxNumberEnd); |
| | | if (start.compareTo(end) > 0) { |
| | |
| | | List<MwBox> boxList = new ArrayList<>(); |
| | | for (BigDecimal i = start; i.compareTo(end) <= 0; i = i.add(BigDecimal.ONE)) { |
| | | MwBox mwBox = new MwBox(); |
| | | mwBox.setBoxNumber(i.toString()); |
| | | // 每次生成编号时,确保其为11位 |
| | | String formattedBoxNumber = String.format("%011d", i.longValue()); |
| | | mwBox.setBoxNumber(formattedBoxNumber); |
| | | mwBox.setStatus(BoxStatusEnum.NORMAL.getCode()); |
| | | boxList.add(mwBox); |
| | | } |
| | |
| | | List<Long> idList = dto.getIdList(); |
| | | List<MwBox> boxList = idList.stream().map(id -> { |
| | | MwBox mwBox = new MwBox(); |
| | | mwBox.setId(id); |
| | | mwBox.setStatus(dto.getStatus()); |
| | | mwBox.setRemark(dto.getRemark()); |
| | | return mwBox; |
| | |
| | | package com.sinata.system.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.idev.excel.FastExcel; |
| | | 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.utils.BeanUtils; |
| | | import com.sinata.common.utils.CollUtils; |
| | | import com.sinata.common.utils.DateUtils; |
| | | import com.sinata.common.utils.StringUtils; |
| | | import com.sinata.system.domain.MwCheckoutRecord; |
| | | import com.sinata.system.domain.query.CheckoutRecordQuery; |
| | |
| | | /** |
| | | * 转运记录详情 |
| | | * |
| | | * @param departmentId |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public MwCheckoutRecordVO hospitalDetail(Long departmentId) { |
| | | return baseMapper.hospitalDetail(departmentId); |
| | | public MwCheckoutRecordVO hospitalDetail(Long id) { |
| | | return baseMapper.hospitalDetail(id); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (StringUtils.isBlank(treeCode)) { |
| | | return PageDTO.empty(0L, 0L); |
| | | } |
| | | if (CollUtils.isNotEmpty(query.getStartTime())) { |
| | | query.setStartTimeStart(DateUtil.parse(query.getStartTime().get(0), DateUtils.YYYY_MM_DD_HH_MM_SS)); |
| | | query.setStartTimeEnd(DateUtil.parse(query.getStartTime().get(1), DateUtils.YYYY_MM_DD_HH_MM_SS)); |
| | | } |
| | | if (CollUtils.isNotEmpty(query.getEndTime())) { |
| | | query.setEndTimeStart(DateUtil.parse(query.getEndTime().get(0), DateUtils.YYYY_MM_DD_HH_MM_SS)); |
| | | query.setEndTimeEnd(DateUtil.parse(query.getEndTime().get(1), DateUtils.YYYY_MM_DD_HH_MM_SS)); |
| | | } |
| | | Page<MwTransitRecordVO> page = baseMapper.transitPageList(new Page<>(query.getPageCurr(), query.getPageSize()), query, treeCode); |
| | | return PageDTO.of(page); |
| | | } |
| | |
| | | import com.sinata.system.service.MwContractService; |
| | | import com.sinata.system.service.SysDepartmentService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.dao.DuplicateKeyException; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void add(MwContractDTO dto) { |
| | | MwContract mwContract = BeanUtils.copyBean(dto, MwContract.class); |
| | | save(mwContract); |
| | | try { |
| | | save(mwContract); |
| | | } catch (DuplicateKeyException e) { |
| | | throw new ServiceException("合同编号重复"); |
| | | } |
| | | |
| | | if (CollUtils.isNotEmpty(dto.getAttachmentList())) { |
| | | List<MwAttachment> mwAttachments = BeanUtils.copyToList(dto.getAttachmentList(), MwAttachment.class); |
| | | mwAttachments.forEach(attachment -> { |
| | |
| | | throw new ServiceException("合同id不能为空"); |
| | | } |
| | | MwContract mwContract = BeanUtils.copyBean(dto, MwContract.class); |
| | | updateById(mwContract); |
| | | |
| | | try { |
| | | updateById(mwContract); |
| | | } catch (DuplicateKeyException e) { |
| | | throw new ServiceException("合同编号重复"); |
| | | } |
| | | if (CollUtils.isNotEmpty(dto.getAttachmentList())) { |
| | | //删除原来的附件 |
| | | mwAttachmentService.lambdaUpdate().eq(MwAttachment::getType, AttachmentTypeEnum.CONTRACT.getCode()).eq(MwAttachment::getTargetId, dto.getId()).remove(); |
| | |
| | | import com.sinata.common.utils.StringUtils; |
| | | import com.sinata.system.domain.MwStagingRoom; |
| | | import com.sinata.system.domain.dto.MwStagingRoomDTO; |
| | | import com.sinata.system.domain.excel.MwCheckoutRecordExcel; |
| | | import com.sinata.system.domain.query.CheckoutRecordQuery; |
| | | import com.sinata.system.domain.query.MwStagingRoomQuery; |
| | | import com.sinata.system.domain.query.StorageRecordQuery; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URL; |
| | | import java.net.URLEncoder; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | |
| | | return; |
| | | } |
| | | List<MwCheckoutRecordVO> list = baseMapper.checkoutRecordList(query, treeCode); |
| | | // 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman |
| | | List<MwCheckoutRecordExcel> mwCheckoutRecordExcels = BeanUtils.copyToList(list, MwCheckoutRecordExcel.class); |
| | | for (MwCheckoutRecordExcel mwCheckoutRecordExcel : mwCheckoutRecordExcels) { |
| | | for (MwCheckoutRecordVO mwCheckoutRecordVO : list) { |
| | | if (mwCheckoutRecordVO.getId().equals(mwCheckoutRecordExcel.getId())) { |
| | | mwCheckoutRecordExcel.setHospitalSignature(new URL(mwCheckoutRecordVO.getHospitalSignature())); |
| | | } |
| | | } |
| | | } |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系 |
| | | String fileName = URLEncoder.encode("暂存间出库记录", "UTF-8").replaceAll("\\+", "%20"); |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | FastExcel.write(response.getOutputStream(), MwCheckoutRecordVO.class).sheet("暂存间出库记录").doWrite(list); |
| | | FastExcel.write(response.getOutputStream(), MwCheckoutRecordExcel.class).sheet("暂存间出库记录").doWrite(mwCheckoutRecordExcels); |
| | | } |
| | | |
| | | @Override |
| | |
| | | */ |
| | | @Override |
| | | public PageDTO<MwStorageRecordVO> temporarilyStoredMedicalWaste(StorageRecordQuery query) { |
| | | return PageDTO.of(baseMapper.temporarilyStoredMedicalWaste(query)); |
| | | return PageDTO.of(baseMapper.temporarilyStoredMedicalWaste(new Page<MwStorageRecordVO>(query.getPageCurr(), query.getPageSize()), query)); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.sinata.system.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.sinata.common.utils.StringUtils; |
| | | import com.sinata.system.domain.MwTransitCarCollectPoint; |
| | | import com.sinata.system.domain.SysDepartment; |
| | | import com.sinata.system.domain.vo.CarDistributionVO; |
| | | import com.sinata.system.domain.vo.CarTrackVO; |
| | | import com.sinata.system.mapper.MwTransitCarCollectPointMapper; |
| | | import com.sinata.system.service.MwTransitCarCollectPointService; |
| | | 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.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2025-01-01 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class MwTransitCarCollectPointServiceImpl extends ServiceImpl<MwTransitCarCollectPointMapper, MwTransitCarCollectPoint> implements MwTransitCarCollectPointService { |
| | | |
| | | private final SysDepartmentService sysDepartmentService; |
| | | |
| | | /** |
| | | * 查询车辆分布列表 |
| | | * |
| | | * @param treeCode |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<CarDistributionVO> queryCarListByTreeCode(String treeCode) { |
| | | return baseMapper.queryCarListByTreeCode(treeCode); |
| | | } |
| | | |
| | | /** |
| | | * 车辆分布详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public CarDistributionVO queryCarDistributionDetail(Long id) { |
| | | CarDistributionVO carDistributionVO = baseMapper.queryCarDistributionDetail(id); |
| | | String pointList = carDistributionVO.getPointList(); |
| | | if (StringUtils.isNotBlank(pointList)) { |
| | | List<Long> departmentIdList = JSONArray.parseArray(pointList, Long.class); |
| | | // 查询部门数据 |
| | | List<SysDepartment> list = sysDepartmentService.lambdaQuery() |
| | | .in(SysDepartment::getId, departmentIdList) |
| | | .list(); |
| | | // 重新排序 |
| | | Map<Long, SysDepartment> departmentMap = list.stream() |
| | | .collect(Collectors.toMap(SysDepartment::getId, dept -> dept)); |
| | | List<SysDepartment> sortedList = departmentIdList.stream() |
| | | .map(departmentMap::get) |
| | | .collect(Collectors.toList()); |
| | | Set<CarTrackVO> carTrackVOSet = sortedList.stream().map(item -> { |
| | | CarTrackVO vo = new CarTrackVO(); |
| | | vo.setLatitude(item.getLatitude()); |
| | | vo.setLongitude(item.getLongitude()); |
| | | return vo; |
| | | }).collect(Collectors.toSet()); |
| | | carDistributionVO.setLineSet(carTrackVOSet); |
| | | } |
| | | return carDistributionVO; |
| | | } |
| | | } |
| | |
| | | childrenMap = getChildrenDepartmentByOrgType(myDepartment, null); |
| | | } |
| | | SysDepartmentVO sysDepartmentVO = fillChildrenTreeModel(myDepartment, childrenMap); |
| | | switch (type) { |
| | | case 2: |
| | | case 3: |
| | | case 4: |
| | | filterEmptyChildren(sysDepartmentVO.getChildren()); |
| | | break; |
| | | } |
| | | root.add(sysDepartmentVO); |
| | | return root; |
| | | } |
| | | |
| | | /** |
| | | * 移除子节点为空的区域 |
| | | * |
| | | * @param departments |
| | | */ |
| | | private void filterEmptyChildren(List<SysDepartmentVO> departments) { |
| | | if (departments == null) { |
| | | return; |
| | | } |
| | | |
| | | Iterator<SysDepartmentVO> iterator = departments.iterator(); |
| | | while (iterator.hasNext()) { |
| | | SysDepartmentVO department = iterator.next(); |
| | | |
| | | // 递归过滤子节点 |
| | | filterEmptyChildren(department.getChildren()); |
| | | |
| | | // 如果 orgType == 1 且 children 为空,则移除当前节点 |
| | | if (department.getOrgType() == 1 && department.getChildren().isEmpty()) { |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @param myDepartment |
| | | * @param orgTypes 查询区域类型列表 |
| | | * @return |
| | |
| | | package com.sinata.system.service.impl; |
| | | |
| | | import cn.idev.excel.util.StringUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.sinata.common.core.domain.entity.SysDictData; |
| | |
| | | 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.common.utils.DictUtils; |
| | | import com.sinata.system.domain.dto.SysDictDataDTO; |
| | | import com.sinata.system.domain.query.KeyWordQuery; |
| | |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 字典 业务层处理 |
| | |
| | | @Override |
| | | public PageDTO<SysDictDataVO> pageList(KeyWordQuery query) { |
| | | Page<SysDictData> result = this.lambdaQuery().like(StringUtils.isNotBlank(query.getKeyword()), SysDictData::getDictLabel, query.getKeyword()).page(new Page<>(query.getPageCurr(), query.getPageSize())); |
| | | List<String> dictTypeList = result.getRecords().stream().map(SysDictData::getDictType).distinct().collect(Collectors.toList()); |
| | | if (CollUtils.isNotEmpty(dictTypeList)) { |
| | | List<SysDictType> sysDictTypes = dictTypeMapper.selectList(new LambdaQueryWrapper<SysDictType>().in(SysDictType::getDictType, dictTypeList)); |
| | | result.getRecords().forEach(sysDictData -> { |
| | | sysDictTypes.forEach(sysDictType -> { |
| | | if (sysDictType.getDictType().equals(sysDictData.getDictType())) { |
| | | sysDictData.setDictType(sysDictType.getDictName()); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | return PageDTO.of(result, SysDictDataVO.class); |
| | | } |
| | | |
| | |
| | | import java.util.Arrays; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | |
| | | return res; |
| | | } |
| | | |
| | | @Override |
| | | /*@Override |
| | | public List<SysMenu> getMenuLevelList(List<Long> menusId) { |
| | | //获取当前的权限菜单 |
| | | List<SysMenu> all = menuMapper.getAllInIds(menusId); |
| | |
| | | menu.setChildren(collect); |
| | | } |
| | | return s1; |
| | | }*/ |
| | | @Override |
| | | public List<SysMenu> getMenuLevelList(List<Long> menusId) { |
| | | //获取当前的权限菜单 |
| | | List<SysMenu> all = menuMapper.getAllInIds(menusId); |
| | | |
| | | // 第一级 |
| | | List<SysMenu> s1 = all.stream().filter(e -> e.getMenuType().equals("M")) |
| | | .collect(Collectors.toList()); |
| | | // 构建以 parentId 为键的 Map |
| | | Map<Long, List<SysMenu>> menuMap = all.stream() |
| | | .collect(Collectors.groupingBy(SysMenu::getParentId)); |
| | | //封装树形层级 |
| | | buildMenuTree(menuMap, s1); |
| | | return s1; |
| | | } |
| | | |
| | | /** |
| | | * 封装树形层级 |
| | | * |
| | | * @param menuMap |
| | | * @param s1 |
| | | */ |
| | | public void buildMenuTree(Map<Long, List<SysMenu>> menuMap, List<SysMenu> s1) { |
| | | for (SysMenu sysMenu : s1) { |
| | | // 获取当前菜单的子级 |
| | | List<SysMenu> children = menuMap.getOrDefault(sysMenu.getMenuId(), new ArrayList<>()); |
| | | sysMenu.setChildren(children); |
| | | //移除当前菜单 |
| | | menuMap.remove(sysMenu.getMenuId()); |
| | | // 递归设置子级菜单 |
| | | buildMenuTree(menuMap, children); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | List<SysRole> list = list(); |
| | | return BeanUtils.copyToList(list, SysRoleVO.class); |
| | | } |
| | | |
| | | /** |
| | | * 用户菜单权限集合 |
| | | * |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Set<Long> getMenuIdSets(Long userId) { |
| | | SysRole sysRole = roleMapper.selectRoleByUserId(userId); |
| | | // 获取当前角色的菜单列表 |
| | | List<SysMenu> menus = menuMapper.selectListByRoleId(sysRole.getRoleId()); |
| | | return menus.stream().map(SysMenu::getMenuId).collect(Collectors.toSet()); |
| | | } |
| | | } |
| | |
| | | if (StringUtils.isBlank(treeCode)) { |
| | | return PageDTO.empty(0L, 0L); |
| | | } |
| | | Page<SysUserVO> page = baseMapper.pageList(new Page<>(query.getPageCurr(), query.getPageSize()), query.getNickName(), query.getRoleId(), treeCode); |
| | | Page<SysUserVO> page = baseMapper.pageList(new Page<>(query.getPageCurr(), query.getPageSize()), query.getNickName(), query.getRoleId(), query.getUserName(), treeCode); |
| | | return PageDTO.of(page); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public SysUserVO getDetailInfo(Long userId) { |
| | | System.out.println("-------------------------------"); |
| | | System.out.println(SecurityUtils.getLoginUser().getUser()); |
| | | SysUser sysUser = this.getById(userId); |
| | | SysUserVO sysUserVO = null; |
| | | if (Objects.nonNull(sysUser)) { |
| | |
| | | AND MBD.DEVICE_NUMBER LIKE CONCAT('%',#{query.deviceNumber},'%') |
| | | </if> |
| | | <if test="query.deviceName != null and query.deviceName != ''"> |
| | | AND MBD.DEVICE_NAME LIKECONCAT('%',#{query.deviceName},'%') |
| | | AND MBD.DEVICE_NAME LIKE CONCAT('%',#{query.deviceName},'%') |
| | | </if> |
| | | <if test="query.deviceStatus != null"> |
| | | AND MBD.DEVICE_STATUS = #{query.deviceStatus} |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | LEFT JOIN SYS_DEPARTMENT sd |
| | | ON mcr.DEPARTMENT_ID = sd.ID |
| | | <where> |
| | | mcr.DEPARTMENT_ID = #{id} |
| | | mcr.ID = #{id} |
| | | </where> |
| | | </select> |
| | | <select id="hospitalDetailPage" resultType="com.sinata.system.domain.vo.MwMedicalWasteBoxVO"> |
| | |
| | | <select id="transitPageList" resultType="com.sinata.system.domain.vo.MwTransitRecordVO"> |
| | | SELECT |
| | | MTRC.ROUTE_ID AS id, |
| | | MDR.DISPOSAL_UNIT_NAME, |
| | | SD.DEPARTMENT_NAME, |
| | | MTC.LICENSE_PLATE_NUMBER, |
| | | SU.NICK_NAME, |
| | | SUM(MCR.BOX_NUM) AS boxNum, |
| | |
| | | <if test="query.status != null"> |
| | | AND MCR2.STATUS = #{query.status} |
| | | </if> |
| | | <if test="query.startTime != null and query.endTime != null"> |
| | | AND MDR.RECEIVE_TIME BETWEEN #{query.startTime} AND #{query.endTime} |
| | | <if test="query.startTimeStart != null and query.startTimeEnd != null"> |
| | | AND MCR2.BOX_TIME BETWEEN #{query.startTimeStart} AND #{query.startTimeEnd} |
| | | </if> |
| | | <if test="query.endTimeStart != null and query.endTimeEnd != null"> |
| | | AND MDR.RECEIVE_TIME BETWEEN #{query.endTimeStart} AND #{query.endTimeEnd} |
| | | </if> |
| | | </where> |
| | | GROUP BY MTRC.ROUTE_ID |
| | |
| | | LEFT JOIN MW_CHECKOUT_RECORD_ITEM MCRI on MCR.ID = MCRI.CHECKOUT_RECORD_ID |
| | | LEFT JOIN MW_COLLECT_RECORD MCR2 ON MCR2.ID = MCRI.COLLECT_RECORD_ID |
| | | <where> |
| | | MTRC.DEL_FLAG = 0 AND MTRC.ROUTE_ID = #{id} |
| | | MTRC.ROUTE_ID = #{id} |
| | | </where> |
| | | GROUP BY MCR2.BOX_ID |
| | | ORDER BY latestCheckoutTime DESC |
| | |
| | | LEFT JOIN MW_COLLECT_RECORD MCR2 ON MCR2.ID = MCRI.COLLECT_RECORD_ID |
| | | LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MCR.DEPARTMENT_ID |
| | | LEFT JOIN SYS_USER SU ON SU.USER_ID = MCR.DRIVER_ID |
| | | LEFT JOIN MW_DISPOSAL_RECORD_ITEM MDRI ON MDRI.COLLECT_RECORD_ID = MCR.ID |
| | | LEFT JOIN MW_DISPOSAL_RECORD MDR ON MDR.ID = MDRI.DISPOSAL_RECORD_ID |
| | | <where> |
| | | <if test="treeCode != null and treeCode != ''"> |
| | | AND SD.TREE_CODE LIKE CONCAT(#{treeCode},'%') |
| | | <if test="query.departmentId != null"> |
| | | AND MDR.DEPARTMENT_ID = #{query.departmentId} |
| | | </if> |
| | | <if test="query.startTime != null and query.endTime != null"> |
| | | AND MCR.CHECKOUT_TIME BETWEEN #{query.startTime} AND #{query.endTime} |
| | | </if> |
| | | <if test="query.wasteTypeList != null and query.wasteTypeList.size()>0"> |
| | | <if test="query.wasteTypeCodeList != null and query.wasteTypeCodeList.size()>0"> |
| | | AND MCR2.WASTE_TYPE IN |
| | | <foreach collection="query.wasteTypeList" item="wasteType" separator="," open="(" close=")"> |
| | | <foreach collection="query.wasteTypeCodeList" item="wasteType" separator="," open="(" close=")"> |
| | | #{wasteType} |
| | | </foreach> |
| | | </if> |
| | |
| | | ID, DEPARTMENT_ID, DISPOSAL_UNIT_NAME, RECEIVE_QUANTITY, RECEIVE_TIME, RECEIVE_WEIGHT, RECEIVER_ID, UNLOAD_QUANTITY, UNLOAD_WEIGHT, TOTAL_HANDLED_QUANTITY, DISPOSAL_FLAG, TOTAL_HANDLED_WEIGHT, DISPOSAL_TIME, DISPOSAL_USER_ID |
| | | </sql> |
| | | <select id="getStaticsData" resultType="com.sinata.system.domain.vo.DisposalRecordStaticsVO"> |
| | | SELECT SUM(MDR.RECEIVE_QUANTITY) AS receivedQuantity, |
| | | SUM(MDR.RECEIVE_WEIGHT) AS receivedWeight, |
| | | SUM(MDR.RECEIVE_QUANTITY) AS unloadQuantity, |
| | | SUM(MDR.RECEIVE_WEIGHT) AS unloadWeight, |
| | | SUM(MCR.WEIGHT) AS totalHandledWeight, |
| | | COUNT(DISTINCT MCR.BOX_NUMBER) AS totalHandledQuantity |
| | | SELECT COALESCE(SUM(MDR.RECEIVE_QUANTITY),0) AS receivedQuantity, |
| | | COALESCE(SUM(MDR.RECEIVE_WEIGHT),0) AS receivedWeight, |
| | | COALESCE(SUM(MDR.RECEIVE_QUANTITY),0) AS unloadQuantity, |
| | | COALESCE(SUM(MDR.RECEIVE_WEIGHT),0) AS unloadWeight, |
| | | COALESCE(SUM(MCR.WEIGHT),0) AS totalHandledWeight, |
| | | COALESCE(COUNT(DISTINCT MCR.BOX_NUMBER),0) AS totalHandledQuantity |
| | | FROM MW_DISPOSAL_RECORD MDR |
| | | LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MDR.DEPARTMENT_ID |
| | | LEFT JOIN MW_DISPOSAL_HANDLE_RECORD MDHR ON MDHR.DISPOSAL_RECORD_ID = MDR.ID |
| | | LEFT JOIN MW_COLLECT_RECORD MCR ON MCR.DISPOSAL_HANDLE_RECORD_ID = MDHR.ID |
| | | LEFT JOIN MW_DISPOSAL_HANDLE_RECORD_ITEM MDHRI ON MDHRI.DISPOSAL_RECORD_ID = MDR.ID |
| | | LEFT JOIN MW_COLLECT_RECORD MCR ON MCR.DISPOSAL_HANDLE_RECORD_ID = MDHRI.DISPOSAL_HANDLE_RECORD_ID |
| | | <where> |
| | | MDR.DEL_FLAG = 0 |
| | | <if test="treeCode != null and treeCode !=''"> |
| | |
| | | FROM MW_DISPOSAL_RECORD MDR |
| | | LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MDR.DEPARTMENT_ID |
| | | LEFT JOIN MW_DISPOSAL_HANDLE_RECORD_ITEM MDHRI ON MDHRI.DISPOSAL_RECORD_ID = MDR.ID |
| | | LEFT JOIN MW_COLLECT_RECORD MCR ON MCR.ID = MDHRI.COLLECT_RECORD_ID |
| | | <where> |
| | | MDR.DEL_FLAG = 0 |
| | | <if test="treeCode != null and treeCode !=''"> |
| | |
| | | AND MDR.RECEIVE_TIME BETWEEN #{query.receiveTimeStart} AND #{query.receiveTimeEnd} |
| | | </if> |
| | | </where> |
| | | GROUP BY MDR.ID |
| | | ORDER BY MDR.RECEIVE_TIME DESC |
| | | </select> |
| | | <select id="pageDetail" resultType="com.sinata.system.domain.vo.MwDisposalRecordItemVO"> |
| | | SELECT MCR.BOX_NUMBER, |
| | | COUNT(MCR.ID) AS bagNum, |
| | | IFNULL(SUM(MCR.WEIGHT), 0) AS weight, |
| | | IFNULL(SUM(MCR.WEIGHT),0) AS weight, |
| | | MDHR.DISPOSAL_TIME |
| | | FROM MW_DISPOSAL_HANDLE_RECORD_ITEM MDHRI |
| | | LEFT JOIN MW_COLLECT_RECORD MCR ON MCR.ID = MDHRI.COLLECT_RECORD_ID |
| | | LEFT JOIN MW_DISPOSAL_HANDLE_RECORD MDHR ON MDHR.ID= MDHRI.DISPOSAL_HANDLE_RECORD_ID |
| | | <where> |
| | | <if test="disposalRecordId != null"> |
| | | AND MDHR.DISPOSAL_RECORD_ID = #{disposalRecordId} |
| | | AND MDHRI.DISPOSAL_RECORD_ID = #{disposalRecordId} |
| | | </if> |
| | | </where> |
| | | GROUP BY MCR.BOX_NUMBER |
| | | GROUP BY MCR.BOX_NUMBER,MDHRI.DISPOSAL_RECORD_ID |
| | | </select> |
| | | <select id="disposalReceiveReport" resultType="com.sinata.system.domain.vo.MwDisposalRecordReportVO"> |
| | | SELECT MCR.ID, MDR.RECEIVE_TIME, MDR.DISPOSAL_TIME, MCR.WASTE_TYPE, MCR.WEIGHT, MCR.STATUS |
| | |
| | | LEFT JOIN SYS_DEPARTMENT sd ON sd.ID = mme.DEPARTMENT_ID |
| | | <where> |
| | | mmer.DEL_FLAG = 0 |
| | | <if test="treeCode != null and treeCode != ''"> |
| | | AND sd.TREE_CODE like concat(#{treeCode},'%') |
| | | </if> |
| | | <if test="query.equipmentId != null"> |
| | | AND mmer.EQUIPMENT_ID = #{query.equipmentId} |
| | | </if> |
| | |
| | | AND mmer.USE_TIME BETWEEN #{query.startTime} AND #{query.endTime} |
| | | </if> |
| | | </where> |
| | | GROUP BY mmer.ID |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <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"> |
| | | <if test="query.healthCertificateFlag != null and query.healthCertificateFlag == 0"> |
| | | 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"> |
| | | <if test="query.vaccineCertificateFlag != null and query.vaccineCertificateFlag == 0"> |
| | | AND MS.VACCINE_CERTIFICATE IS NULL |
| | | </if> |
| | | </where> |
| | |
| | | (msr.MAX_CAPACITY - COUNT(mr.ID)) AS unUsedNum, |
| | | sd.DEPARTMENT_NAME AS hospitalName |
| | | FROM MW_STAGING_ROOM msr |
| | | LEFT JOIN (SELECT ID, BOX_ID, STAGING_ROOM_ID FROM MW_COLLECT_RECORD WHERE STATUS = 1 GROUP BY BOX_ID) mr |
| | | ON msr.ID = mr.STAGING_ROOM_ID |
| | | LEFT JOIN (SELECT MAX(ID) AS ID, BOX_ID, STAGING_ROOM_ID |
| | | FROM MW_COLLECT_RECORD WHERE STATUS = 1 GROUP BY BOX_ID, STAGING_ROOM_ID ) mr ON msr.ID = mr.STAGING_ROOM_ID |
| | | LEFT JOIN SYS_DEPARTMENT sd ON msr.DEPARTMENT_ID = sd.ID |
| | | <where> |
| | | msr.DEL_FLAG = 0 |
| | |
| | | AND sd.TREE_CODE LIKE CONCAT(#{treeCode}, '%') |
| | | </if> |
| | | </where> |
| | | GROUP BY msr.ID |
| | | ORDER BY msr.CREATE_TIME DESC |
| | | </select> |
| | | <select id="storageRecordPage" resultType="com.sinata.system.domain.vo.MwStorageRecordVO"> |
| | |
| | | FROM MW_COLLECT_RECORD mcr |
| | | LEFT JOIN SYS_USER su |
| | | ON mcr.COLLECT_USER_ID = su.USER_ID |
| | | LEFT JOIN SYS_DEPARTMENT sd ON su.DEPARTMENT_ID = sd.ID |
| | | LEFT JOIN SYS_DEPARTMENT sd ON mcr.DEPARTMENT_ID = sd.ID |
| | | LEFT JOIN MW_STAGING_ROOM msr ON msr.ID = mcr.STAGING_ROOM_ID |
| | | <where> |
| | | mcr.DEL_FLAG = 0 |
| | |
| | | <result property="roleSort" column="role_sort" /> |
| | | <result property="dataScope" column="data_scope" /> |
| | | <result property="status" column="role_status" /> |
| | | <result property="appletFlag" column="applet_flag"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectUserVo"> |
| | | 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 |
| | | r.role_id, |
| | | r.role_name, |
| | | r.role_key, |
| | | r.role_sort, |
| | | r.data_scope, |
| | | r.status as role_status, |
| | | r.applet_flag |
| | | 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 |
| | |
| | | <if test="nickName != null and nickName != ''"> |
| | | AND su.NICK_NAME LIKE CONCAT('%',#{nickName},'%') |
| | | </if> |
| | | <if test="userName != null and userName != ''"> |
| | | AND su.USER_NAME LIKE CONCAT('%',#{userName},'%') |
| | | </if> |
| | | <if test="roleId != null and roleId != ''"> |
| | | AND sur.ROLE_ID = #{roleId} |
| | | </if> |
| | |
| | | AND sd.TREE_CODE LIKE CONCAT(#{treeCode},'%') |
| | | </if> |
| | | </where> |
| | | ORDER BY su.CREATE_TIME DESC |
| | | </select> |
| | | |
| | | <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> |