| | |
| | | SysAgreement one = sysAgreementService.lambdaQuery().eq(SysAgreement::getType, 1).one(); |
| | | return R.ok(one); |
| | | } |
| | | @ApiOperation("获取用户隐私协议") |
| | | @PostMapping("/primary/get") |
| | | public R<SysAgreement> save1(){ |
| | | SysAgreement one = sysAgreementService.lambdaQuery().eq(SysAgreement::getType, 2).one(); |
| | | return R.ok(one); |
| | | } |
| | | } |
| | |
| | | import com.sinata.system.domain.*; |
| | | import com.sinata.system.domain.dto.CheckOutDto; |
| | | import com.sinata.system.domain.dto.CollectTotalUpDto; |
| | | import com.sinata.system.domain.dto.CountTwoDto; |
| | | import com.sinata.system.domain.dto.SysDepartmentDTO; |
| | | import com.sinata.system.domain.vo.SysDepartmentVO; |
| | | import com.sinata.system.mapper.SysDepartmentMapper; |
| | |
| | | return R.ok(sysDepartmentService.getRegionTree1(keyword)); |
| | | } |
| | | |
| | | @ApiOperation("获取区域树") |
| | | @PostMapping("/pub/regionTree") |
| | | @ApiImplicitParam(name = "keyword", value = "关键字", required = false) |
| | | public R<List<SysDepartmentVO>> getRegionTree1(@RequestParam(required = false) String keyword) { |
| | | return R.ok(sysDepartmentService.getRegionTree1(keyword)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation("获取单位详情") |
| | | @PostMapping("/detail") |
| | | public R<SysDepartment> getRegionTree(@RequestParam(required = true) Long id) { |
| | | return R.ok(sysDepartmentService.getById(id)); |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取区域树 |
| | | * |
| | |
| | | @ApiOperation(value = "获取全部/区域/医疗机构/处置单位/监管单位树-搜索框用", notes = "0:全部 1:区域 2:医疗机构 3:处置单位 4:监管单位") |
| | | @PostMapping("/departmentSearchTree") |
| | | @ApiImplicitParam(name = "type", value = "查询类型", required = true) |
| | | public R<List<SysDepartmentVO>> getDepartmentSearchTree(@RequestParam(value = "type", required = true) @NotNull(message = "类型不能为空") Integer type) { |
| | | return R.ok(sysDepartmentService.listByType(type)); |
| | | public R<List<SysDepartmentVO>> getDepartmentSearchTree() { |
| | | return R.ok(sysDepartmentService.getRegionTree2(null)); |
| | | } |
| | | |
| | | @ApiOperation("获取医院监管列表") |
| | |
| | | return R.ok(collectRecordService.collectTotal3(departmentId)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("医院暂存间情况上") |
| | | @PostMapping("/up/room") |
| | | public R<MwStagingRoom> collecttotal2(@ApiParam("医院id")@RequestParam Long departmentId) { |
| | | MwStagingRoom one = roomService.lambdaQuery().eq(MwStagingRoom::getDepartmentId, departmentId).one(); |
| | | Long count = collectRecordService.lambdaQuery().eq(MwCollectRecord::getStagingRoomId, one.getId()).eq(MwCollectRecord::getStatus, 1).count(); |
| | | MwCollectRecord one1 = collectRecordService.lambdaQuery().eq(MwCollectRecord::getStagingRoomId, one.getId()).eq(MwCollectRecord::getStatus, 1).orderByDesc(MwCollectRecord::getBoxTime).last("limit 1").one(); |
| | | one.setCount(count); |
| | | one.setBoxTime(one1.getBoxTime()); |
| | | return R.ok(one); |
| | | } |
| | | |
| | | @ApiOperation(value = "医院转运记录") |
| | | @PostMapping("/trans") |
| | | public R<List<CheckOutDto>> trans(LocalDate date,@ApiParam("医院id")@RequestParam Long departmentId) { |
| | |
| | | return R.ok(backList); |
| | | } |
| | | |
| | | @ApiOperation(value = "处置详情上") |
| | | @PostMapping("/end/total/up") |
| | | public R<CountTwoDto> outtotal2(@ApiParam("处置机构id")@RequestParam Long departmentId) { |
| | | CountTwoDto countTwoDto = new CountTwoDto(); |
| | | LocalDate now = LocalDate.now(); |
| | | Long count = collectRecordService.lambdaQuery().eq(MwCollectRecord::getReceiveDepartmentId, departmentId).eq(MwCollectRecord::getReceiveTime, now).count(); |
| | | Long count1 = collectRecordService.lambdaQuery().eq(MwCollectRecord::getReceiveDepartmentId, departmentId).eq(MwCollectRecord::getDisposalTime, now).count(); |
| | | countTwoDto.setCount(count); |
| | | countTwoDto.setCount1(count1); |
| | | return R.ok(countTwoDto); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "处置详情") |
| | | @PostMapping("/end/total") |
| | | public R<List<CollectTotalUpDto>> outtotal1(@ApiParam("处置机构id")@RequestParam Long departmentId) { |
| | |
| | | public R<UserInfoDTO> user() |
| | | { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | Set<String> roles = permissionService.getRolePermission(user); |
| | | SysDepartment byId2 = departmentService.getById(user.getDepartmentId()); |
| | | UserInfoDTO userInfoDTO = new UserInfoDTO(); |
| | | userInfoDTO.setNickName(user.getNickName()); |
| | | userInfoDTO.setDepartment(byId2); |
| | | userInfoDTO.setRoles(roles); |
| | | return R.ok(userInfoDTO); |
| | | } |
| | | |
| | |
| | | package com.sinata.web.controller.applet; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.google.common.collect.Lists; |
| | | import java.util.Date; |
| | | |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | |
| | | @ApiOperation(value = "出库统计上") |
| | | @PostMapping("/total") |
| | | public R<List<CollectTotalUpDto>> total(LocalDate date) { |
| | | public R<List<CollectTotalUpDto>> total(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | return R.ok(mwCheckoutRecordService.totalUp(date,sysUser.getDepartmentId())); |
| | | } |
| | | |
| | | @ApiOperation(value = "接收统计上",tags = "处置人员") |
| | | @PostMapping("/out/total") |
| | | public R<List<CollectTotalUpDto>> outtotal(@ApiParam("日期1") LocalDate date1,@ApiParam("日期2")LocalDate date2) { |
| | | public R<List<CollectTotalUpDto>> outtotal(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date1,@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date2) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | return R.ok(mwCheckoutRecordService.totalUp2(date1,date2,sysUser.getUserId())); |
| | | } |
| | | @ApiOperation(value = "接收统计下",tags = "处置人员") |
| | | @PostMapping("/out/record") |
| | | public R<List<CheckOutDto>> record1(@ApiParam("日期1") LocalDate date1,@ApiParam("日期2")LocalDate date2) { |
| | | public R<List<CheckOutDto>> record1(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date1,@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date2) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | LocalDate now = LocalDate.now(); |
| | | List<MwDisposalRecord> list = disposalRecordService.lambdaQuery().ge(date1!=null,MwDisposalRecord::getReceiveTime, date1).le(date2!=null,MwDisposalRecord::getReceiveTime,date2).eq(MwDisposalRecord::getDepartmentId, sysUser.getDepartmentId()).orderByDesc(MwDisposalRecord::getReceiveTime).list(); |
| | |
| | | |
| | | @ApiOperation(value = "处置统计上",tags = "处置人员") |
| | | @PostMapping("/end/total") |
| | | public R<List<CollectTotalUpDto>> outtotal1(@ApiParam("日期1") LocalDate date1,@ApiParam("日期2")LocalDate date2) { |
| | | public R<List<CollectTotalUpDto>> outtotal1(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date1, @DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date2) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | return R.ok(mwCheckoutRecordService.totalUp2(date1,date2,sysUser.getUserId())); |
| | | } |
| | | |
| | | @ApiOperation(value = "处置统下",tags = "处置人员") |
| | | @PostMapping("/end/record") |
| | | public R<List<CheckOutDto>> record2(@ApiParam("日期1") LocalDate date1,@ApiParam("日期2")LocalDate date2) { |
| | | public R<List<CheckOutDto>> record2(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date1,@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date2) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | LocalDate now = LocalDate.now(); |
| | | List<MwDisposalHandleRecord> list = handleRecordService.lambdaQuery().ge(date1!=null,MwDisposalHandleRecord::getDisposalTime, date1).le(date2!=null,MwDisposalHandleRecord::getDisposalTime,date2).eq(MwDisposalHandleRecord::getDepartmentId, sysUser.getDepartmentId()).orderByDesc(MwDisposalHandleRecord::getDisposalTime).list(); |
| | |
| | | import java.util.*; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.sinata.common.core.domain.R; |
| | | import com.sinata.common.core.domain.entity.SysDictData; |
| | | import com.sinata.common.core.domain.entity.SysUser; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.common.utils.SecurityUtils; |
| | |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @Api(tags = {"医院工作人员"}) |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/applet/mwCollectRecord") |
| | | |
| | | public class AppMwCollectRecordController { |
| | | private final MwCollectRecordService collectRecordService; |
| | | @Autowired |
| | |
| | | private final MwDisposalHandleRecordService disposalHandleRecordService; |
| | | private final MwDisposalHandleRecordItemService disposalHandleRecordItemService; |
| | | private final MwStagingRoomService roomService; |
| | | private final ISysDictDataService dictDataService; |
| | | |
| | | |
| | | @ApiOperation("新增医废记录") |
| | | @ApiOperation(value = "新增医废记录") |
| | | @PostMapping("/add") |
| | | public R<?> add(@Valid @RequestBody MwCollectRecord mwCollectRecord) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | |
| | | } |
| | | mwCollectRecord.setStagingRoomId(one1.getId()); |
| | | mwCollectRecord.setDepartmentId(sysUser.getDepartmentId()); |
| | | mwCollectRecord.setBoxTime(new Date()); |
| | | |
| | | // 创建一个随机数生成器实例 |
| | | Random random = new Random(); |
| | |
| | | // 生成一个6位数范围内的随机整数(100000 到 999999) |
| | | int randomNumber = 10000000 + random.nextInt(90000000); |
| | | mwCollectRecord.setMedicalWasteNumber(String.valueOf(randomNumber)); |
| | | |
| | | SysDictData medicalWasteType = dictDataService.getById(mwCollectRecord.getWasteType()); |
| | | if (medicalWasteType!=null){ |
| | | mwCollectRecord.setWasteTypeStr(medicalWasteType.getDictLabel()); |
| | | } |
| | | collectRecordService.save(mwCollectRecord); |
| | | return R.ok(); |
| | | } |
| | |
| | | |
| | | @ApiOperation(value = "扫码接收列表",tags = "处置人员") |
| | | @PostMapping("/end/down/collect/total") |
| | | public R<List<HospitalCollectTotalUpDto>> tanscollecttotal3(String boxNum) { |
| | | public R<List<HospitalCollectTotalUp1Dto>> tanscollecttotal3(String boxNum) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | MwCollectRecord one = collectRecordService.lambdaQuery().eq(MwCollectRecord::getBoxNumber, boxNum).eq(MwCollectRecord::getStatus, 2).last("limit 1").one(); |
| | | if (one==null){ |
| | |
| | | //先获取医院ids |
| | | List<MwCollectRecord> list = collectRecordService.lambdaQuery().eq(MwCollectRecord::getStatus,2).eq(MwCollectRecord::getCheckoutUserId, one.getCheckoutUserId()).groupBy(MwCollectRecord::getDepartmentId).list(); |
| | | //循环医院,然后放入 |
| | | List<HospitalCollectTotalUpDto> list1 = new ArrayList<>(); |
| | | List<HospitalCollectTotalUp1Dto> list1 = new ArrayList<>(); |
| | | for (MwCollectRecord mwCollectRecord : list) { |
| | | List<CollectTotalUpDto> collectTotalUpDtos = collectRecordService.collectTotal1(null, sysUser.getUserId(), mwCollectRecord.getDepartmentId()); |
| | | HospitalCollectTotalUpDto hospitalCollectTotalUpDto = new HospitalCollectTotalUpDto(); |
| | | List<CollectDto> collectTotalUpDtos = collectRecordService.getGroup1(null, mwCollectRecord.getDepartmentId()); |
| | | HospitalCollectTotalUp1Dto hospitalCollectTotalUpDto = new HospitalCollectTotalUp1Dto(); |
| | | hospitalCollectTotalUpDto.setHospitalName(mwCollectRecord.getHospitalName()); |
| | | hospitalCollectTotalUpDto.setCollectTotalUpDtos(collectTotalUpDtos); |
| | | list1.add(hospitalCollectTotalUpDto); |
| | |
| | | |
| | | @ApiOperation("收集统计上") |
| | | @PostMapping("/collect/total") |
| | | public R<List<CollectTotalUpDto>> collecttotal1(LocalDate date) { |
| | | public R<List<CollectTotalUpDto>> collecttotal1(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | return R.ok(collectRecordService.collectTotal(date,sysUser.getDepartmentId())); |
| | | } |
| | | @ApiOperation("收集统计下") |
| | | @PostMapping("/collect/down/total") |
| | | public R<Page<MwCollectRecord>> collecttotal2(LocalDate date,@RequestParam Integer pageNum, @RequestParam Integer pageSize) { |
| | | public R<Page<MwCollectRecord>> collecttotal2(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date,@RequestParam Integer pageNum, @RequestParam Integer pageSize) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | Page<MwCollectRecord> page = collectRecordService.lambdaQuery().eq(date!=null,MwCollectRecord::getCollectTime,date).eq(MwCollectRecord::getDepartmentId, sysUser.getDepartmentId()).orderByDesc(MwCollectRecord::getCollectTime).page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | |
| | | mwTransitRoute.setHospitalName(byId.getDepartmentName()); |
| | | } |
| | | } |
| | | |
| | | return R.ok(list1); |
| | | |
| | | } |
| | | @ApiOperation("分页列表") |
| | | @ApiOperation("获取途径点") |
| | | @PostMapping("/get") |
| | | public R<List<MwTransitRoutePoints>> pageList(@RequestParam Long routeId) { |
| | | |
| | |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "预警统计详情",tags = "监管人员") |
| | | @PostMapping("/detail/record") |
| | | public R<Page<MwWarningRecord>> record1(@RequestParam Long id,@RequestParam Integer pageNum,@RequestParam Integer pageSize) { |
| | | Page<MwWarningRecord> page = mwWarningRecordService.lambdaQuery().eq(MwWarningRecord::getDepartmentId, id).page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | } |
| | |
| | | public class AppUserController extends BaseController |
| | | { |
| | | private final MwTransitCarService carService; |
| | | private final ISysUserService userService; |
| | | @ApiOperation(value = "获取绑定车辆",tags = "运输人员") |
| | | @PostMapping("/car") |
| | | public R<MwTransitCar> car() { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser sysUser = userService.getById(user.getUserId()); |
| | | |
| | | if (sysUser.getCarId()==null){ |
| | | return R.fail("当前暂无绑定车辆,请绑定后操作"); |
| | | } |
| | |
| | | return R.ok(byId); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取车辆列表",tags = "运输人员") |
| | | @PostMapping("/list") |
| | | public R<List<MwTransitCar>> list() { |
| | | List<MwTransitCar> list = carService.list(); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @ApiOperation(value = "更换绑定车辆",tags = "运输人员") |
| | | @PostMapping("/change") |
| | | public R<List<MwTransitCar>> change(@RequestParam Long carId) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | |
| | | SysUser byId = userService.getById(sysUser.getUserId()); |
| | | byId.setCarId(carId); |
| | | userService.updateById(byId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "绑定前校验",tags = "运输人员") |
| | | @PostMapping("/check") |
| | | public R<SysUser> check(@RequestParam Long carId) { |
| | | SysUser one = userService.lambdaQuery().eq(SysUser::getCarId, carId).one(); |
| | | if (one!=null){ |
| | | return R.fail(one); |
| | | }else { |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | .authorizeHttpRequests((requests) -> { |
| | | permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll()); |
| | | // 对于登录login 注册register 验证码captchaImage 允许匿名访问 |
| | | requests.antMatchers("/backend/login","/applet/file/upload","/applet/sysDepartment/regionTree","/applet/getCode","/applet/login", "/register", "/captchaImage").permitAll() |
| | | requests.antMatchers("/backend/login","/applet/file/upload","/applet/sysDepartment/departmentSearchTree","/applet/getCode","/applet/login", "/register", "/captchaImage").permitAll() |
| | | // 静态资源,可匿名访问 |
| | | .antMatchers(HttpMethod.GET, "/", "/msg", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() |
| | | .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.sinata.common.entity.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @TableField("RELATION") |
| | | private String relation; |
| | | |
| | | @TableField(exist = false) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty("最后装箱时间") |
| | | private Date boxTime; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("当前已装箱") |
| | | private Long count; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("区域id(医院id)") |
| | | @TableField("DEPARTMENT_ID") |
| | | private Long departmentId; |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("是否标红1是") |
| | | private Integer isRed; |
| | | |
| | | @ApiModelProperty("排序") |
| | | @TableField("SORT_ORDER") |
| | |
| | | private Integer num; |
| | | @ApiModelProperty("总重量") |
| | | private BigDecimal weight; |
| | | private String wasteTypeStr; |
| | | } |
| | |
| | | @ApiModelProperty("接收时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date receiveTime; |
| | | private String wasteTypeStr; |
| | | |
| | | } |
| | |
| | | private Integer num; |
| | | @ApiModelProperty("总重量") |
| | | private BigDecimal weight; |
| | | private String wasteTypeStr; |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CountTwoDto { |
| | | @ApiModelProperty("今日接收") |
| | | private Long count; |
| | | @ApiModelProperty("今日处置") |
| | | private Long count1; |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class HospitalCollectTotalUp1Dto { |
| | | @ApiModelProperty("医院名称") |
| | | private String hospitalName; |
| | | @ApiModelProperty("列表") |
| | | private List<CollectDto> collectTotalUpDtos; |
| | | |
| | | } |
| | |
| | | */ |
| | | List<SysDepartmentVO> getRegionTree(String keyword); |
| | | List<SysDepartmentVO> getRegionTree1(String keyword); |
| | | List<SysDepartmentVO> getRegionTree2(String keyword); |
| | | |
| | | /** |
| | | * 当前登录用户所在区域 |
| | |
| | | } |
| | | return root; |
| | | } |
| | | public List<SysDepartmentVO> getRegionTree2(String keyword) { |
| | | |
| | | List<SysDepartmentVO> root = new ArrayList<>(); |
| | | SysDepartment currentDepartment = this.baseMapper.selectById(-1); |
| | | if (Objects.isNull(currentDepartment)) { |
| | | return root; |
| | | } |
| | | if (!currentDepartment.getOrgType().equals(DepartmentEnum.REGION.getCode())) { |
| | | return root; |
| | | } |
| | | Map<Long, List<SysDepartment>> childrenMap = getChildrenDepartmentByOrgType(currentDepartment, Collections.singletonList(DepartmentEnum.REGION.getCode())); |
| | | SysDepartmentVO sysDepartmentVO = fillChildrenTreeModel(currentDepartment, childrenMap); |
| | | root.add(sysDepartmentVO); |
| | | if (StringUtils.isNotBlank(keyword)) { |
| | | treeMatch(root, keyword); |
| | | } |
| | | return root; |
| | | } |
| | | |
| | | /** |
| | | * 获取当前登录用户所属区域 |
| | |
| | | GROUP BY mcr.DEPARTMENT_ID |
| | | </select> |
| | | <select id="totalUp" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | SELECT WASTE_TYPE as wasteType,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | SELECT WASTE_TYPE as wasteType,WASTE_TYPE_STR as wasteTypeStr,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | <where> |
| | | CHECKOUT_TIME is not null AND DEPARTMENT_ID = #{departmentId} |
| | | </where> |
| | |
| | | </select> |
| | | |
| | | <select id="totalUp4" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | SELECT WASTE_TYPE as wasteType,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | SELECT WASTE_TYPE as wasteType,WASTE_TYPE_STR as wasteTypeStr,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | <where> |
| | | CHECKOUT_TIME is not null AND DEPARTMENT_ID = #{departmentId} |
| | | </where> |
| | |
| | | |
| | | |
| | | <select id="totalUp2" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | SELECT WASTE_TYPE as wasteType,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | SELECT WASTE_TYPE as wasteType,WASTE_TYPE_STR as wasteTypeStr,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | <where> |
| | | RECEIVE_USER_ID is not null AND RECEIVE_USER_ID = #{departmentId} |
| | | <if test="date1 != null"> |
| | | DATE(RECEIVE_TIME) >= #{date1} |
| | | and DATE(RECEIVE_TIME) >= #{date1} |
| | | </if> |
| | | <if test="date2 != null"> |
| | | DATE(RECEIVE_TIME) <= #{date2} |
| | | and DATE(RECEIVE_TIME) <= #{date2} |
| | | </if> |
| | | |
| | | </where> |
| | |
| | | </select> |
| | | |
| | | <select id="totalUp5" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | SELECT WASTE_TYPE as wasteType,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | SELECT WASTE_TYPE as wasteType,WASTE_TYPE_STR as wasteTypeStr,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | <where> |
| | | RECEIVE_DEPARTMENT_ID is not null AND RECEIVE_DEPARTMENT_ID = #{departmentId} |
| | | </where> |
| | | GROUP BY WASTE_TYPE |
| | | </select> |
| | | <select id="totalUp3" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | SELECT WASTE_TYPE as wasteType,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | SELECT WASTE_TYPE as wasteType,WASTE_TYPE_STR as wasteTypeStr,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | <where> |
| | | DISPOSAL_USER_ID is not null AND DISPOSAL_USER_ID = #{departmentId} |
| | | <if test="date1 != null"> |
| | | DATE(DISPOSAL_TIME) >= #{date1} |
| | | and DATE(DISPOSAL_TIME) >= #{date1} |
| | | </if> |
| | | <if test="date2 != null"> |
| | | DATE(DISPOSAL_TIME) <= #{date2} |
| | | and DATE(DISPOSAL_TIME) <= #{date2} |
| | | </if> |
| | | |
| | | </where> |
| | |
| | | </select> |
| | | |
| | | <select id="totalUp1" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | SELECT t2.WASTE_TYPE as wasteType,COUNT(DISTINCT t2.BOX_NUMBER ) as boxNum ,COUNT(t2.ID)as num,sum(t2.WEIGHT) as weight |
| | | SELECT t2.WASTE_TYPE as wasteType,WASTE_TYPE_STR as wasteTypeStr,COUNT(DISTINCT t2.BOX_NUMBER ) as boxNum ,COUNT(t2.ID)as num,sum(t2.WEIGHT) as weight |
| | | from MEDICAL_WASTE.MW_CHECKOUT_RECORD_ITEM t1 |
| | | left join MEDICAL_WASTE.MW_COLLECT_RECORD t2 on t1.COLLECT_RECORD_ID = t2.ID |
| | | where t2.CHECKOUT_RECORD_ID = #{outId} |
| | |
| | | ORDER BY mcr.CREATE_TIME DESC |
| | | </select> |
| | | <select id="getGroup" resultType="com.sinata.system.domain.dto.CollectDto"> |
| | | SELECT BOX_NUMBER as boxNumber,WASTE_TYPE as wasteType,COUNT(1) as num ,sum(WEIGHT) as weight,MAX(COLLECT_TIME) as lastTime from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | SELECT BOX_NUMBER as boxNumber,WASTE_TYPE_STR as wasteTypeStr,WASTE_TYPE as wasteType,COUNT(1) as num ,sum(WEIGHT) as weight,MAX(COLLECT_TIME) as lastTime from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | <where> |
| | | STATUS = 1 AND DEPARTMENT_ID = #{departmentId} |
| | | <if test="boxNumber != null and boxNumber != ''"> |
| | |
| | | </select> |
| | | |
| | | <select id="getGroup1" resultType="com.sinata.system.domain.dto.CollectDto"> |
| | | SELECT BOX_NUMBER as boxNumber,WASTE_TYPE as wasteType,COUNT(1) as num ,sum(WEIGHT) as weight,MAX(COLLECT_TIME) as lastTime from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | SELECT BOX_NUMBER as boxNumber,WASTE_TYPE_STR as wasteTypeStr,WASTE_TYPE as wasteType,COUNT(1) as num ,sum(WEIGHT) as weight,MAX(COLLECT_TIME) as lastTime from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | <where> |
| | | STATUS = 2 AND DEPARTMENT_ID = #{departmentId} |
| | | STATUS = 1 AND DEPARTMENT_ID = #{departmentId} |
| | | <if test="boxNumber != null and boxNumber != ''"> |
| | | and BOX_NUMBER like concat('%',#{boxNumber},'%') |
| | | </if> |
| | |
| | | WASTE_TYPE as wasteType,COUNT(1) as num , |
| | | sum(WEIGHT) as weight, |
| | | BOX_TIME as lastTime , |
| | | WASTE_TYPE_STR as wasteTypeStr, |
| | | RECEIVE_TIME as receiveTime |
| | | from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | <where> |
| | |
| | | </select> |
| | | |
| | | <select id="collectTotal" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | SELECT WASTE_TYPE as wasteType,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | SELECT WASTE_TYPE as wasteType,WASTE_TYPE_STR as wasteTypeStr,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | <where> |
| | | STATUS = 2 AND DEPARTMENT_ID = #{departmentId} |
| | | </where> |
| | | GROUP BY WASTE_TYPE |
| | | </select> |
| | | <select id="collectTotal3" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | SELECT WASTE_TYPE as wasteType,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | SELECT WASTE_TYPE as wasteType,WASTE_TYPE_STR as wasteTypeStr,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | <where> |
| | | STATUS = 1 AND DEPARTMENT_ID = #{departmentId} |
| | | </where> |
| | |
| | | |
| | | |
| | | <select id="collectTotal1" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | SELECT WASTE_TYPE as wasteType,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | SELECT WASTE_TYPE as wasteType,WASTE_TYPE_STR as wasteTypeStr,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | <where> |
| | | CHECKOUT_USER_ID = #{checkOutUserId} |
| | | <if test="date !=null"> |
| | |
| | | t3.HOSPITAL_NAME as hospitalName, |
| | | COUNT(DISTINCT t3.BOX_NUMBER ) as boxNum, |
| | | COUNT(t3.ID) as num , |
| | | WASTE_TYPE_STR as wasteTypeStr, |
| | | sum(T3.WEIGHT) as weight, |
| | | t1.ID as checkOutId |
| | | FROM MW_CHECKOUT_RECORD t1 |