Merge remote-tracking branch 'gitee/master'
# Conflicts:
# medicalWaste-admin/src/main/java/com/sinata/web/controller/screen/ScreenController.java
New file |
| | |
| | | package com.sinata.web.controller.applet; |
| | | |
| | | import com.sinata.common.core.domain.R; |
| | | import com.sinata.system.domain.SysAgreement; |
| | | 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("/applet/sysAgreement") |
| | | public class AppAgreementController { |
| | | private final SysAgreementService sysAgreementService; |
| | | |
| | | /** |
| | | * 保存用户注册协议 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取用户注册协议") |
| | | @PostMapping("/get") |
| | | public R<SysAgreement> save(){ |
| | | 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); |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.web.controller.applet; |
| | | |
| | | import com.sinata.common.core.domain.R; |
| | | import com.sinata.common.core.domain.entity.SysUser; |
| | | import com.sinata.common.utils.SecurityUtils; |
| | | 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; |
| | | import com.sinata.system.service.*; |
| | | import com.sinata.web.controller.tool.CapacityUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | 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.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.time.LocalDate; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 区域表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-12-02 |
| | | */ |
| | | @Api(tags = {"监管人员"}) |
| | | @RestController |
| | | @Validated |
| | | @RequestMapping("/applet/sysDepartment") |
| | | @RequiredArgsConstructor |
| | | public class AppDepartmentController { |
| | | private final SysDepartmentService sysDepartmentService; |
| | | private final MwStagingRoomService roomService; |
| | | private final MwCollectRecordService collectRecordService; |
| | | private final MwCheckoutRecordService mwCheckoutRecordService; |
| | | private final ISysUserService userService; |
| | | private final MwTransitCarService carService; |
| | | |
| | | /** |
| | | * 获取区域树 |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取区域树") |
| | | @PostMapping("/regionTree") |
| | | @ApiImplicitParam(name = "keyword", value = "关键字", required = false) |
| | | public R<List<SysDepartmentVO>> getRegionTree(@RequestParam(required = false) String keyword) { |
| | | List<SysDepartmentVO> regionTree1 = sysDepartmentService.getRegionTree2(keyword); |
| | | return R.ok(regionTree1); |
| | | } |
| | | |
| | | @ApiOperation("获取区域树") |
| | | @PostMapping("/pub/regionTree") |
| | | @ApiImplicitParam(name = "keyword", value = "关键字", required = false) |
| | | public R<List<SysDepartmentVO>> getRegionTree1(@RequestParam(required = false) String keyword) { |
| | | List<SysDepartmentVO> regionTree1 = sysDepartmentService.getRegionTree2(keyword); |
| | | return R.ok(regionTree1); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation("获取单位详情") |
| | | @PostMapping("/detail") |
| | | public R<SysDepartment> getRegionTree(@RequestParam(required = true) Long id) { |
| | | return R.ok(sysDepartmentService.getById(id)); |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取区域树 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取全部/区域/医疗机构/处置单位/监管单位树-搜索框用", notes = "0:全部 1:区域 2:医疗机构 3:处置单位 4:监管单位") |
| | | @PostMapping("/departmentSearchTree") |
| | | @ApiImplicitParam(name = "type", value = "查询类型", required = true) |
| | | public R<List<SysDepartmentVO>> getDepartmentSearchTree() { |
| | | return R.ok(sysDepartmentService.getRegionTree2(null)); |
| | | } |
| | | |
| | | @ApiOperation("获取医院监管列表") |
| | | @PostMapping("/hospita/list") |
| | | public R<List<SysDepartment>> list(String name,Long areaId) { |
| | | List<SysDepartment> list = sysDepartmentService.lambdaQuery().eq(areaId!=null,SysDepartment::getParentId,areaId).like(name!=null,SysDepartment::getDepartmentName,name).eq(SysDepartment::getOrgType, 2).list(); |
| | | for (SysDepartment sysDepartment : list) { |
| | | //获取医院暂存间信息 |
| | | MwStagingRoom one = roomService.lambdaQuery().eq(MwStagingRoom::getDepartmentId, sysDepartment.getId()).one(); |
| | | if (one == null) { |
| | | continue; |
| | | } |
| | | //获取存了多少数量 |
| | | Long count = collectRecordService.lambdaQuery().eq(MwCollectRecord::getDepartmentId, sysDepartment.getId()).eq(MwCollectRecord::getStatus, 1).count(); |
| | | //计算百分率 |
| | | Integer maxCapacity = one.getMaxCapacity(); |
| | | String percentage = CapacityUtil.calculatePercentage(count, maxCapacity); |
| | | sysDepartment.setMaxCapacity(one.getMaxCapacity()); |
| | | sysDepartment.setNowCapacity(count.intValue()); |
| | | sysDepartment.setPercentage(percentage); |
| | | |
| | | } |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("获取处置监管列表") |
| | | @PostMapping("/end/list") |
| | | public R<List<SysDepartment>> list2(String name) { |
| | | List<SysDepartment> list = sysDepartmentService.lambdaQuery().like(name!=null,SysDepartment::getDepartmentName,name).eq(SysDepartment::getOrgType, 3).list(); |
| | | LocalDate now = LocalDate.now(); |
| | | for (SysDepartment sysDepartment : list) { |
| | | //获取库存总量 |
| | | Long count1 = collectRecordService.lambdaQuery().eq(MwCollectRecord::getReceiveDepartmentId, sysDepartment.getId()).count(); |
| | | //获取接收数量 |
| | | Long count2 = collectRecordService.lambdaQuery().isNotNull(MwCollectRecord::getReceiveTime).eq(MwCollectRecord::getReceiveDepartmentId, sysDepartment.getId()).count(); |
| | | //获取处置数量 |
| | | Long count3 = collectRecordService.lambdaQuery().isNotNull(MwCollectRecord::getDisposalTime).eq(MwCollectRecord::getReceiveDepartmentId, sysDepartment.getId()).count(); |
| | | sysDepartment.setCont1(count1); |
| | | sysDepartment.setCont2(count2); |
| | | sysDepartment.setCont3(count3); |
| | | } |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("医院暂存间情况") |
| | | @PostMapping("/room") |
| | | public R<List<CollectTotalUpDto>> collecttotal1(@ApiParam("医院id")@RequestParam Long departmentId) { |
| | | 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(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date, @ApiParam("医院id")@RequestParam Long departmentId) { |
| | | LocalDate now = LocalDate.now().minusDays(7); |
| | | if (date!=null){ |
| | | now = LocalDate.now(); |
| | | } |
| | | List<MwCheckoutRecord> list = mwCheckoutRecordService.lambdaQuery().ge(date ==null,MwCheckoutRecord::getCheckoutTime, now).eq(MwCheckoutRecord::getDepartmentId, departmentId).orderByDesc(MwCheckoutRecord::getCheckoutTime).list(); |
| | | List<CheckOutDto> backList = new ArrayList<>(); |
| | | for (MwCheckoutRecord mwCheckoutRecord : list) { |
| | | CheckOutDto checkOutDto = new CheckOutDto(); |
| | | SysUser byId = userService.getById(mwCheckoutRecord.getDriverId()); |
| | | checkOutDto.setDriverName(byId.getNickName()); |
| | | MwTransitCar byId1 = carService.getById(mwCheckoutRecord.getCarId()); |
| | | checkOutDto.setLicensePlateNumber(byId1.getLicensePlateNumber()); |
| | | checkOutDto.setCheckoutTime(mwCheckoutRecord.getCheckoutTime()); |
| | | List<CollectTotalUpDto> records = mwCheckoutRecordService.totalUp1(mwCheckoutRecord.getId()); |
| | | checkOutDto.setRecords(records); |
| | | backList.add(checkOutDto); |
| | | } |
| | | 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) { |
| | | return R.ok(mwCheckoutRecordService.totalUp5(departmentId)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.web.controller.applet; |
| | | |
| | | 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("/applet/file") |
| | | public class AppFileController { |
| | | 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); |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.web.controller.applet; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.sinata.common.constant.Constants; |
| | | import com.sinata.common.core.domain.AjaxResult; |
| | | import com.sinata.common.core.domain.R; |
| | | import com.sinata.common.core.domain.entity.SysMenu; |
| | | import com.sinata.common.core.domain.entity.SysRole; |
| | | import com.sinata.common.core.domain.entity.SysUser; |
| | | import com.sinata.common.core.domain.model.LoginBody; |
| | | import com.sinata.common.core.domain.model.LoginUser; |
| | | import com.sinata.common.utils.SecurityUtils; |
| | | import com.sinata.common.utils.StringUtils; |
| | | import com.sinata.framework.web.service.SysLoginService; |
| | | import com.sinata.framework.web.service.SysPermissionService; |
| | | import com.sinata.framework.web.service.TokenService; |
| | | import com.sinata.system.domain.SysDepartment; |
| | | import com.sinata.system.domain.SysUserRole; |
| | | import com.sinata.system.domain.dto.UserInfoDTO; |
| | | import com.sinata.system.mapper.SysUserRoleMapper; |
| | | import com.sinata.system.service.ISysMenuService; |
| | | import com.sinata.system.service.ISysRoleService; |
| | | import com.sinata.system.service.ISysUserService; |
| | | import com.sinata.system.service.SysDepartmentService; |
| | | import com.sinata.system.service.biz.AliSmsService; |
| | | import com.sinata.web.controller.tool.weChat.WXCore; |
| | | import com.sinata.web.controller.tool.weChat.WeChatUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Random; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * 登录验证 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Api(tags = {"登录"}) |
| | | @RestController |
| | | @RequestMapping("/applet") |
| | | public class AppLoginController |
| | | { |
| | | @Autowired |
| | | private SysLoginService loginService; |
| | | |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | |
| | | @Autowired |
| | | private SysPermissionService permissionService; |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | @Autowired |
| | | private ISysRoleService roleService; |
| | | |
| | | @Resource |
| | | private SysDepartmentService departmentService; |
| | | @Resource |
| | | private AliSmsService aliSmsService; |
| | | @Resource |
| | | private ISysUserService userService; |
| | | |
| | | |
| | | @PostMapping("/getCode") |
| | | @ApiOperation("获取验证码") |
| | | public AjaxResult getCode(String phone) |
| | | { |
| | | Random random = new Random(); |
| | | |
| | | int i = 100000 + random.nextInt(900000); |
| | | aliSmsService.sendLoginCode(phone, String.valueOf(i)); |
| | | return AjaxResult.success(); |
| | | } |
| | | @Resource |
| | | private WeChatUtil weChatUtil; |
| | | |
| | | |
| | | @PostMapping("/getPhone") |
| | | @ApiOperation("获取手机号") |
| | | public R getPhone(String jscoe, String EncryptedData_phone,String Iv_phone) |
| | | { |
| | | //使用jscode获取微信openid |
| | | Map<String, Object> map = weChatUtil.code2Session(jscoe); |
| | | Integer errcode = Integer.valueOf(map.get("errcode").toString()); |
| | | if(0 != errcode){ |
| | | return R.fail(map.get("msg").toString()); |
| | | } |
| | | String openid = map.get("openid").toString(); |
| | | String sessionKey = map.get("sessionKey").toString(); |
| | | |
| | | |
| | | String decrypt = WXCore.decrypt(EncryptedData_phone, sessionKey, Iv_phone); |
| | | if (StringUtils.isEmpty(decrypt)) { |
| | | return R.fail("获取手机信息失败"); |
| | | } |
| | | JSONObject phone = JSON.parseObject(decrypt); |
| | | String purePhoneNumber = phone.getString("purePhoneNumber"); |
| | | return R.ok(purePhoneNumber); |
| | | |
| | | } |
| | | /** |
| | | * 登录方法 |
| | | * |
| | | * @param loginBody 登录信息 |
| | | * @return 结果 |
| | | */ |
| | | @PostMapping("/login") |
| | | @ApiOperation("验证码登录") |
| | | public AjaxResult login(@RequestBody LoginBody loginBody) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | // 生成令牌 |
| | | LoginUser loginUser = loginService.login1(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), |
| | | loginBody.getUuid()); |
| | | ajax.put(Constants.TOKEN, tokenService.createToken(loginUser)); |
| | | // List<SysRole> roles = loginUser.getUser().getRoles(); |
| | | // if (CollectionUtils.isEmpty(roles)) { |
| | | // return AjaxResult.error("请关联角色!"); |
| | | // } |
| | | |
| | | List<SysMenu> menus = roleService.roleInfoFromUserId(loginUser.getUserId()); |
| | | |
| | | // ajax.put("menus", menus); |
| | | ajax.put("userInfo", loginUser); |
| | | return ajax; |
| | | } |
| | | |
| | | @PostMapping("/get/department") |
| | | @ApiOperation("登录后获取部门") |
| | | public R<SysDepartment> department() |
| | | { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | SysDepartment byId = departmentService.getById(user.getDepartmentId()); |
| | | return R.ok(byId); |
| | | } |
| | | @Resource |
| | | private SysUserRoleMapper sysUserRoleMapper; |
| | | @PostMapping("/get/user") |
| | | @ApiOperation("获取个人信息") |
| | | public R<UserInfoDTO> user() |
| | | { |
| | | SysUser user1 = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser user = userService.getById(user1.getUserId()); |
| | | 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); |
| | | SysUserRole sysUserRole = sysUserRoleMapper.selectOne(Wrappers.<SysUserRole>lambdaQuery().eq(SysUserRole::getUserId, user.getUserId())); |
| | | if (sysUserRole != null) { |
| | | SysRole byId = roleService.getById(sysUserRole.getRoleId()); |
| | | userInfoDTO.setRole(byId); |
| | | } |
| | | return R.ok(userInfoDTO); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取用户信息 |
| | | * |
| | | * @return 用户信息 |
| | | */ |
| | | @GetMapping("getInfo") |
| | | public AjaxResult getInfo() |
| | | { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | // 角色集合 |
| | | Set<String> roles = permissionService.getRolePermission(user); |
| | | // 权限集合 |
| | | Set<String> permissions = permissionService.getMenuPermission(user); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("user", user); |
| | | ajax.put("roles", roles); |
| | | ajax.put("permissions", permissions); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 获取路由信息 |
| | | * |
| | | * @return 路由信息 |
| | | */ |
| | | @GetMapping("getRouters") |
| | | public AjaxResult getRouters() |
| | | { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId); |
| | | return AjaxResult.success(menuService.buildMenus(menus)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.web.controller.applet; |
| | | |
| | | import com.sinata.common.core.domain.R; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.system.domain.dto.MwMonitorDeviceDTO; |
| | | import com.sinata.system.domain.query.MwMonitorDeviceQuery; |
| | | import com.sinata.system.domain.vo.MwMonitorDeviceVO; |
| | | import com.sinata.system.service.MwMonitorDeviceService; |
| | | import com.sinata.system.service.biz.MonitorDeviceApiNewService; |
| | | import io.swagger.annotations.*; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 监控设备 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-12-02 |
| | | */ |
| | | @Validated |
| | | @RestController |
| | | @Api(tags = {"监控设备"}) |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/applet/mwMonitorDevice") |
| | | public class AppMonitorDeviceController { |
| | | private final MwMonitorDeviceService mwMonitorDeviceService; |
| | | private final MonitorDeviceApiNewService monitorDeviceApiNewService; |
| | | |
| | | /** |
| | | * 监控设备分页列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @ApiOperation("监控设备分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<MwMonitorDeviceVO>> pageList(@Valid @RequestBody MwMonitorDeviceQuery query) { |
| | | return R.ok(mwMonitorDeviceService.pageList(query)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 实时监控列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @ApiOperation("实时监控列表") |
| | | @PostMapping("/monitor/page") |
| | | public R<List<MwMonitorDeviceVO>> monitorPageList(@Valid @RequestBody MwMonitorDeviceQuery query) { |
| | | return R.ok(mwMonitorDeviceService.pageMonitorPage1(query).getList()); |
| | | } |
| | | |
| | | /** |
| | | * 获取视频服务器设备播放路径 |
| | | * |
| | | * @param id |
| | | * @param channelNum |
| | | * @return |
| | | */ |
| | | @ApiOperation("获取视频服务器设备播放路径") |
| | | @GetMapping("/getDeviceUrl") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "deviceNumber", value = "设备编号"), |
| | | @ApiImplicitParam(name = "channelNum", value = "通道号") |
| | | }) |
| | | public R<Map<String, Object>> getDeviceUrl(String deviceNumber, Integer channelNum) { |
| | | return R.ok(monitorDeviceApiNewService.getDeviceUrl(deviceNumber, channelNum)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.web.controller.applet; |
| | | |
| | | import com.sinata.common.core.domain.R; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.system.domain.MwApplication; |
| | | import com.sinata.system.domain.query.MwCollectRecordQuery; |
| | | import com.sinata.system.domain.vo.MwCollectRecordVO; |
| | | import com.sinata.system.service.MwApplicationService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | 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-02 |
| | | */ |
| | | @Validated |
| | | @RestController |
| | | @Api(tags = {"入驻申请"}) |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/applet/mwApplication") |
| | | public class AppMwApplicationController { |
| | | private final MwApplicationService mwApplicationService; |
| | | |
| | | @ApiOperation("提交入驻申请") |
| | | @PostMapping("/set") |
| | | public R pageList(@Valid @RequestBody MwApplication mwApplication) { |
| | | mwApplication.setAuditStatus(1); |
| | | mwApplicationService.save(mwApplication); |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.web.controller.applet; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.google.common.collect.Lists; |
| | | import java.util.Date; |
| | | |
| | | import com.sinata.common.core.domain.R; |
| | | import com.sinata.common.core.domain.entity.SysUser; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.common.utils.SecurityUtils; |
| | | import com.sinata.system.domain.MwCheckoutRecord; |
| | | import com.sinata.system.domain.MwDisposalHandleRecord; |
| | | import com.sinata.system.domain.MwDisposalRecord; |
| | | import com.sinata.system.domain.MwTransitCar; |
| | | import com.sinata.system.domain.dto.CheckOutDto; |
| | | import com.sinata.system.domain.dto.CollectTotalUpDto; |
| | | import com.sinata.system.domain.query.CheckoutRecordQuery; |
| | | import com.sinata.system.domain.query.MwCheckoutRecordItemQuery; |
| | | import com.sinata.system.domain.query.MwTransitRecordQuery; |
| | | import com.sinata.system.domain.vo.MwCheckoutRecordVO; |
| | | import com.sinata.system.domain.vo.MwMedicalWasteBoxVO; |
| | | import com.sinata.system.domain.vo.MwTransitRecordVO; |
| | | import com.sinata.system.service.*; |
| | | import io.swagger.annotations.Api; |
| | | 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.*; |
| | | |
| | | import javax.naming.ldap.PagedResultsControl; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.io.IOException; |
| | | import java.time.LocalDate; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 暂存间出库记录 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-12-02 |
| | | */ |
| | | @Api(tags = {"医院工作人员"}) |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/applet/mwCheckoutRecord") |
| | | public class AppMwCheckoutRecordController { |
| | | private final MwCheckoutRecordService mwCheckoutRecordService; |
| | | private final ISysUserService userService; |
| | | private final MwTransitCarService carService; |
| | | private final MwDisposalRecordService disposalRecordService; |
| | | private final MwDisposalHandleRecordService handleRecordService; |
| | | |
| | | |
| | | @ApiOperation(value = "出库统计上") |
| | | @PostMapping("/total") |
| | | public R<List<CollectTotalUpDto>> total(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser byId = userService.getById(sysUser.getUserId()); |
| | | return R.ok(mwCheckoutRecordService.totalUp(date,byId.getDepartmentId())); |
| | | } |
| | | |
| | | @ApiOperation(value = "接收统计上",tags = "处置人员") |
| | | @PostMapping("/out/total") |
| | | 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(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date1,@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date2) { |
| | | SysUser sysUser1 = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser sysUser = userService.getById(sysUser1.getUserId()); |
| | | 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(); |
| | | List<CheckOutDto> backList = new ArrayList<>(); |
| | | for (MwDisposalRecord mwCheckoutRecord : list) { |
| | | CheckOutDto checkOutDto = new CheckOutDto(); |
| | | SysUser byId = userService.getById(mwCheckoutRecord.getDriverId()); |
| | | checkOutDto.setDriverName(byId.getNickName()); |
| | | MwTransitCar byId1 = carService.getById(mwCheckoutRecord.getCarId()); |
| | | checkOutDto.setLicensePlateNumber(byId1.getLicensePlateNumber()); |
| | | checkOutDto.setCheckoutTime(mwCheckoutRecord.getReceiveTime()); |
| | | List<CollectTotalUpDto> records = mwCheckoutRecordService.totalUp6(mwCheckoutRecord.getId()); |
| | | checkOutDto.setRecords(records); |
| | | backList.add(checkOutDto); |
| | | } |
| | | return R.ok(backList); |
| | | } |
| | | |
| | | @ApiOperation(value = "处置统计上",tags = "处置人员") |
| | | @PostMapping("/end/total") |
| | | 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(@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(); |
| | | List<CheckOutDto> backList = new ArrayList<>(); |
| | | for (MwDisposalHandleRecord mwCheckoutRecord : list) { |
| | | CheckOutDto checkOutDto = new CheckOutDto(); |
| | | SysUser byId = userService.getById(mwCheckoutRecord.getDriverId()); |
| | | checkOutDto.setDriverName(byId.getNickName()); |
| | | MwTransitCar byId1 = carService.getById(mwCheckoutRecord.getCarId()); |
| | | checkOutDto.setLicensePlateNumber(byId1.getLicensePlateNumber()); |
| | | checkOutDto.setCheckoutTime(mwCheckoutRecord.getDisposalTime()); |
| | | List<CollectTotalUpDto> records = mwCheckoutRecordService.totalUp1(mwCheckoutRecord.getId()); |
| | | checkOutDto.setRecords(records); |
| | | backList.add(checkOutDto); |
| | | } |
| | | return R.ok(backList); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "出库统计下") |
| | | @PostMapping("/record") |
| | | public R<List<CheckOutDto>> record() { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser byId2 = userService.getById(sysUser.getUserId()); |
| | | LocalDate now = LocalDate.now(); |
| | | List<MwCheckoutRecord> list = mwCheckoutRecordService.lambdaQuery().eq(MwCheckoutRecord::getDepartmentId, byId2.getDepartmentId()).orderByDesc(MwCheckoutRecord::getCheckoutTime).list(); |
| | | List<CheckOutDto> backList = new ArrayList<>(); |
| | | for (MwCheckoutRecord mwCheckoutRecord : list) { |
| | | CheckOutDto checkOutDto = new CheckOutDto(); |
| | | SysUser byId = userService.getById(mwCheckoutRecord.getDriverId()); |
| | | checkOutDto.setDriverName(byId.getNickName()); |
| | | MwTransitCar byId1 = carService.getById(mwCheckoutRecord.getCarId()); |
| | | checkOutDto.setLicensePlateNumber(byId1.getLicensePlateNumber()); |
| | | checkOutDto.setCheckoutTime(mwCheckoutRecord.getCheckoutTime()); |
| | | List<CollectTotalUpDto> records = mwCheckoutRecordService.totalUp1(mwCheckoutRecord.getId()); |
| | | checkOutDto.setRecords(records); |
| | | backList.add(checkOutDto); |
| | | } |
| | | return R.ok(backList); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.web.controller.applet; |
| | | import java.util.Date; |
| | | import java.math.BigDecimal; |
| | | 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 com.sinata.system.domain.*; |
| | | import com.sinata.system.domain.dto.*; |
| | | import com.sinata.system.domain.query.MwCollectRecordQuery; |
| | | import com.sinata.system.domain.vo.MedicalWasteProcessVO; |
| | | import com.sinata.system.domain.vo.MwCollectRecordVO; |
| | | import com.sinata.system.service.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.io.IOException; |
| | | import java.time.LocalDate; |
| | | |
| | | /** |
| | | * <p> |
| | | * 暂存间入库记录 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-12-02 |
| | | */ |
| | | @Validated |
| | | @RestController |
| | | @Api(tags = {"医院工作人员"}) |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/applet/mwCollectRecord") |
| | | |
| | | public class AppMwCollectRecordController { |
| | | private final MwCollectRecordService collectRecordService; |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | private final MwBoxService boxService; |
| | | private final MwCheckoutRecordService checkoutRecordService; |
| | | private final MwCheckoutRecordItemService checkoutRecordItemService; |
| | | private final SysDepartmentService departmentService; |
| | | private final MwDisposalRecordService disposalRecordService; |
| | | private final MwDisposalRecordItemService disposalRecordItemService; |
| | | private final MwDisposalHandleRecordService disposalHandleRecordService; |
| | | private final MwDisposalHandleRecordItemService disposalHandleRecordItemService; |
| | | private final MwStagingRoomService roomService; |
| | | private final ISysDictDataService dictDataService; |
| | | private final MwTransitCarService carService; |
| | | |
| | | |
| | | @ApiOperation(value = "新增医废记录") |
| | | @PostMapping("/add") |
| | | public R<?> add(@Valid @RequestBody MwCollectRecord mwCollectRecord) { |
| | | SysUser sysUser1 = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser sysUser = userService.getById(sysUser1.getUserId()); |
| | | |
| | | MwBox one = boxService.lambdaQuery().eq(MwBox::getBoxNumber, mwCollectRecord.getBoxNumber()).one(); |
| | | if (one==null){ |
| | | return R.fail("当前转运箱不存在"); |
| | | } |
| | | one.setLink(1); |
| | | one.setLastUseTime(new Date()); |
| | | boxService.updateById(one); |
| | | mwCollectRecord.setBoxId(one.getId()); |
| | | MwStagingRoom one1 = roomService.lambdaQuery().eq(MwStagingRoom::getDepartmentId, sysUser.getDepartmentId()).one(); |
| | | if (one1==null){ |
| | | return R.fail("当前单位没有暂存间"); |
| | | } |
| | | 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("/box/list") |
| | | public R<List<CollectDto>> boxlist(@RequestParam String boxNumber) { |
| | | List<MwCollectRecord> list = collectRecordService.lambdaQuery().eq(MwCollectRecord::getStatus,1).eq(MwCollectRecord::getBoxNumber, boxNumber).list(); |
| | | if (list.isEmpty()){ |
| | | return R.ok(); |
| | | } |
| | | Long departmentId = list.get(0).getDepartmentId(); |
| | | List<CollectDto> collectDtos = collectRecordService.getGroup1(boxNumber,departmentId); |
| | | for (CollectDto collectDto : collectDtos) { |
| | | collectDto.setDepartmentName(departmentService.getById(departmentId).getDepartmentName()); |
| | | } |
| | | return R.ok(collectDtos); |
| | | } |
| | | |
| | | @ApiOperation(value = "装车",tags = "运输人员") |
| | | @PostMapping("/box/collect") |
| | | public R<List<CollectDto>> collect(@RequestBody SignCollectDto signCollectDto) { |
| | | SysUser sysUser1 = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser sysUser = userService.getById(sysUser1.getUserId()); |
| | | //将收集记录的状态改变 |
| | | List<MwCollectRecord> list = collectRecordService.lambdaQuery().eq(MwCollectRecord::getStatus,1).in(MwCollectRecord::getBoxNumber, signCollectDto.getBoxNumbers()).list(); |
| | | if (list.isEmpty()){ |
| | | return R.ok(); |
| | | } |
| | | Set<String> boxes = new HashSet<>(); |
| | | BigDecimal sum = new BigDecimal(0); |
| | | for (MwCollectRecord mwCollectRecord : list) { |
| | | mwCollectRecord.setStatus(2); |
| | | mwCollectRecord.setCheckoutUserId(sysUser.getUserId()); |
| | | mwCollectRecord.setCheckoutTime(new Date()); |
| | | mwCollectRecord.setDriverId(sysUser.getUserId()); |
| | | mwCollectRecord.setCarId(sysUser.getCarId()); |
| | | boxes.add(mwCollectRecord.getBoxNumber()); |
| | | sum= sum.add(mwCollectRecord.getWeight()); |
| | | } |
| | | //插入入库记录以及中间表数据 |
| | | MwCheckoutRecord mwCheckoutRecord = new MwCheckoutRecord(); |
| | | mwCheckoutRecord.setCheckoutTime(new Date()); |
| | | mwCheckoutRecord.setDepartmentId(list.get(0).getDepartmentId()); |
| | | mwCheckoutRecord.setHospitalName(list.get(0).getHospitalName()); |
| | | mwCheckoutRecord.setStagingRoomId(list.get(0).getStagingRoomId()); |
| | | mwCheckoutRecord.setHospitalSignature(signCollectDto.getSignUrl()); |
| | | mwCheckoutRecord.setDriverId(sysUser.getUserId()); |
| | | mwCheckoutRecord.setCarId(sysUser.getCarId()); |
| | | mwCheckoutRecord.setBoxNum(boxes.size()); |
| | | mwCheckoutRecord.setBagNum(list.size()); |
| | | mwCheckoutRecord.setTotalWeight(sum); |
| | | checkoutRecordService.save(mwCheckoutRecord); |
| | | //插入中间表数据 |
| | | List<MwCheckoutRecordItem> recordItems = new ArrayList<>(); |
| | | for (MwCollectRecord mwCollectRecord : list) { |
| | | MwCheckoutRecordItem mwCheckoutRecordItem = new MwCheckoutRecordItem(); |
| | | mwCheckoutRecordItem.setCollectRecordId(mwCollectRecord.getId()); |
| | | mwCheckoutRecordItem.setCheckoutRecordId(mwCheckoutRecord.getId()); |
| | | recordItems.add(mwCheckoutRecordItem); |
| | | } |
| | | checkoutRecordItemService.saveBatch(recordItems); |
| | | collectRecordService.updateBatchById(list); |
| | | MwBox byId = boxService.getById(list.get(0).getStagingRoomId()); |
| | | byId.setLink(2); |
| | | boxService.updateById(byId); |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "运输统计上",tags = "运输人员") |
| | | @PostMapping("/trans/collect/total") |
| | | public R<List<CollectTotalUpDto>> tanscollecttotal1(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | return R.ok(collectRecordService.collectTotal1(date,sysUser.getUserId(),null)); |
| | | } |
| | | |
| | | @ApiOperation(value = "运输统计上(医院数量)",tags = "运输人员") |
| | | @PostMapping("/trans/collect/hospital/count") |
| | | public R<Long> tanscollecttotal12(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | Long count = collectRecordService.lambdaQuery().eq(date!=null,MwCollectRecord::getCheckoutTime,date).eq(MwCollectRecord::getCheckoutUserId, sysUser.getUserId()).groupBy(MwCollectRecord::getDepartmentId).count(); |
| | | return R.ok(count); |
| | | } |
| | | |
| | | @ApiOperation(value = "运输统计下",tags = "运输人员") |
| | | @PostMapping("/trans/down/collect/total") |
| | | public R<List<HospitalCollectTotalUpDto>> tanscollecttotal2(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | //先获取医院ids |
| | | List<MwCollectRecord> list = collectRecordService.lambdaQuery().eq(date!=null,MwCollectRecord::getCheckoutTime,date).eq(MwCollectRecord::getCheckoutUserId, sysUser.getUserId()).groupBy(MwCollectRecord::getDepartmentId).list(); |
| | | //循环医院,然后放入 |
| | | List<HospitalCollectTotalUpDto> list1 = new ArrayList<>(); |
| | | for (MwCollectRecord mwCollectRecord : list) { |
| | | List<CollectTotalUpDto> collectTotalUpDtos = collectRecordService.collectTotal1(date, sysUser.getUserId(), mwCollectRecord.getDepartmentId()); |
| | | HospitalCollectTotalUpDto hospitalCollectTotalUpDto = new HospitalCollectTotalUpDto(); |
| | | hospitalCollectTotalUpDto.setHospitalName(mwCollectRecord.getHospitalName()); |
| | | hospitalCollectTotalUpDto.setCollectTotalUpDtos(collectTotalUpDtos); |
| | | list1.add(hospitalCollectTotalUpDto); |
| | | } |
| | | return R.ok(list1); |
| | | } |
| | | |
| | | @ApiOperation(value = "扫码接收列表",tags = "处置人员") |
| | | @PostMapping("/end/down/collect/total") |
| | | 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){ |
| | | return R.ok(); |
| | | } |
| | | //先获取医院ids |
| | | List<MwCollectRecord> list = collectRecordService.lambdaQuery().eq(MwCollectRecord::getStatus,2).eq(MwCollectRecord::getCheckoutUserId, one.getCheckoutUserId()).groupBy(MwCollectRecord::getDepartmentId).list(); |
| | | //循环医院,然后放入 |
| | | List<HospitalCollectTotalUp1Dto> list1 = new ArrayList<>(); |
| | | for (MwCollectRecord mwCollectRecord : list) { |
| | | List<CollectDto> collectTotalUpDtos = collectRecordService.getGroup2(null, mwCollectRecord.getDepartmentId()); |
| | | HospitalCollectTotalUp1Dto hospitalCollectTotalUpDto = new HospitalCollectTotalUp1Dto(); |
| | | hospitalCollectTotalUpDto.setHospitalName(mwCollectRecord.getHospitalName()); |
| | | hospitalCollectTotalUpDto.setCollectTotalUpDtos(collectTotalUpDtos); |
| | | list1.add(hospitalCollectTotalUpDto); |
| | | } |
| | | return R.ok(list1); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取车辆",tags = "处置人员") |
| | | @PostMapping("/end/down/collect/car") |
| | | public R<CarDto> tanscollecttotal7(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) { |
| | | return R.ok(); |
| | | } |
| | | MwTransitCar byId = carService.getById(one.getCarId()); |
| | | SysUser one1 = userService.lambdaQuery().eq(SysUser::getCarId, byId.getId()).one(); |
| | | CarDto carDto = new CarDto(); |
| | | carDto.setLicensePlateNumber(byId.getLicensePlateNumber()); |
| | | carDto.setUserName(one1.getUserName()); |
| | | return R.ok(carDto); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "扫码接收列表上获取医院",tags = "处置人员") |
| | | @PostMapping("/end/down/collect/up") |
| | | public R<SysDepartment> tanscollecttotal4(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) { |
| | | return R.ok(); |
| | | } |
| | | SysDepartment byId = departmentService.getById(one.getDepartmentId()); |
| | | return R.ok(byId); |
| | | } |
| | | |
| | | @ApiOperation(value = "确认接受",tags = "处置人员") |
| | | @PostMapping("/end/down/collect/confirm") |
| | | public R tanscollecttotal4(@RequestBody BoxListDto boxListDto) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | SysDepartment byId = departmentService.getById(sysUser.getDepartmentId()); |
| | | //将record变为已接受 |
| | | List<MwCollectRecord> list = collectRecordService.lambdaQuery().eq(MwCollectRecord::getStatus,2).in(MwCollectRecord::getBoxNumber, boxListDto.getBoxNum()).list(); |
| | | if (list.isEmpty()){ |
| | | return R.ok(); |
| | | } |
| | | |
| | | Set<String> boxes = new HashSet<>(); |
| | | BigDecimal receiveQuantity = BigDecimal.ZERO; |
| | | for (MwCollectRecord mwCollectRecord : list) { |
| | | mwCollectRecord.setStatus(3); |
| | | boxes.add(mwCollectRecord.getBoxNumber()); |
| | | mwCollectRecord.setReceiveUserId(sysUser.getUserId()); |
| | | mwCollectRecord.setReceiveTime(new Date()); |
| | | mwCollectRecord.setReceiveDepartmentId(sysUser.getDepartmentId()); |
| | | receiveQuantity = receiveQuantity.add(mwCollectRecord.getWeight()); |
| | | } |
| | | collectRecordService.updateBatchById(list); |
| | | //插入接收记录以及子表 |
| | | MwDisposalRecord mwDisposalRecord = new MwDisposalRecord(); |
| | | mwDisposalRecord.setDepartmentId(sysUser.getDepartmentId()); |
| | | mwDisposalRecord.setDisposalUnitName(byId.getDepartmentName()); |
| | | mwDisposalRecord.setReceiveQuantity(boxes.size()); |
| | | mwDisposalRecord.setReceiveTime(new Date()); |
| | | mwDisposalRecord.setReceiveWeight(receiveQuantity); |
| | | mwDisposalRecord.setReceiverId(sysUser.getUserId()); |
| | | mwDisposalRecord.setUnloadQuantity(boxes.size()); |
| | | mwDisposalRecord.setUnloadWeight(receiveQuantity); |
| | | mwDisposalRecord.setTotalHandledQuantity(list.size()); |
| | | mwDisposalRecord.setDisposalFlag(0); |
| | | mwDisposalRecord.setTotalHandledWeight(receiveQuantity); |
| | | mwDisposalRecord.setDriverId(list.get(0).getDriverId()); |
| | | mwDisposalRecord.setCarId(list.get(0).getCarId()); |
| | | disposalRecordService.save(mwDisposalRecord); |
| | | //插入子表 |
| | | List<MwDisposalRecordItem> items = new ArrayList<>(); |
| | | for (MwCollectRecord mwCollectRecord : list) { |
| | | MwDisposalRecordItem mwDisposalRecordItem = new MwDisposalRecordItem(); |
| | | mwDisposalRecordItem.setCollectRecordId(mwCollectRecord.getId()); |
| | | mwDisposalRecordItem.setDisposalRecordId(mwDisposalRecord.getId()); |
| | | items.add(mwDisposalRecordItem); |
| | | } |
| | | |
| | | |
| | | |
| | | disposalRecordItemService.saveBatch(items); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "待处置列表",tags = "处置人员") |
| | | @PostMapping("/wait/list") |
| | | public R<List<CollectDto>> list1(String boxNumber) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser byId = userService.getById(sysUser.getUserId()); |
| | | List<CollectDto> collectDtos = collectRecordService.getGroupWithStatus(boxNumber,byId.getDepartmentId(),3); |
| | | return R.ok(collectDtos); |
| | | } |
| | | @ApiOperation(value = "处置操作",tags = "处置人员") |
| | | @PostMapping("/wait/out") |
| | | public R<List<CollectDto>> list2(@RequestBody BoxListDto boxListDto) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | SysDepartment byId = departmentService.getById(sysUser.getDepartmentId()); |
| | | List<MwCollectRecord> list = collectRecordService.lambdaQuery().eq(MwCollectRecord::getStatus, 3).in(MwCollectRecord::getBoxNumber, boxListDto.getBoxNum()).list(); |
| | | if (list.isEmpty()){ |
| | | return R.ok(); |
| | | } |
| | | //新增处置记录 |
| | | MwDisposalHandleRecord mwDisposalHandleRecord = new MwDisposalHandleRecord(); |
| | | mwDisposalHandleRecord.setDepartmentId(byId.getId()); |
| | | mwDisposalHandleRecord.setDisposalUnitName(byId.getDepartmentName()); |
| | | mwDisposalHandleRecord.setDisposalTime(new Date()); |
| | | mwDisposalHandleRecord.setDisposalUserId(sysUser.getUserId()); |
| | | mwDisposalHandleRecord.setDriverId(list.get(0).getDriverId()); |
| | | mwDisposalHandleRecord.setCarId(list.get(0).getCarId()); |
| | | disposalHandleRecordService.save(mwDisposalHandleRecord); |
| | | //将收集记录以及子表改变为已处置 |
| | | if (!list.isEmpty()) { |
| | | List<Long> ids = new ArrayList<>(); |
| | | List<MwDisposalHandleRecordItem> mwDisposalHandleRecordItems = new ArrayList<>(); |
| | | for (MwCollectRecord mwCollectRecord : list) { |
| | | ids.add(mwCollectRecord.getId()); |
| | | mwCollectRecord.setStatus(4); |
| | | mwCollectRecord.setDisposalUserId(sysUser.getUserId()); |
| | | mwCollectRecord.setDisposalTime(new Date()); |
| | | MwDisposalHandleRecordItem mwDisposalHandleRecordItem = new MwDisposalHandleRecordItem(); |
| | | mwDisposalHandleRecordItem.setCollectRecordId(mwCollectRecord.getId()); |
| | | mwDisposalHandleRecordItem.setDisposalRecordId(mwDisposalHandleRecord.getId()); |
| | | mwDisposalHandleRecordItems.add(mwDisposalHandleRecordItem); |
| | | } |
| | | // disposalHandleRecordItemService.saveBatch(mwDisposalHandleRecordItems); |
| | | collectRecordService.updateBatchById(list); |
| | | } |
| | | // //将接收记录以及子表变为已处置 |
| | | // List<MwDisposalRecordItem> list1 = disposalRecordItemService.lambdaQuery().in(MwDisposalRecordItem::getCollectRecordId, ids).list(); |
| | | // if (!list1.isEmpty()){ |
| | | // List<Long> ids2 = new ArrayList<>(); |
| | | // for (MwDisposalRecordItem mwDisposalRecordItem : list1) { |
| | | // mwDisposalRecordItem.setDisposalFlag(1); |
| | | // mwDisposalRecordItem.setDisposalUserId(sysUser.getUserId()); |
| | | // mwDisposalRecordItem.setDisposalTime(new Date()); |
| | | // ids2.add(mwDisposalRecordItem.getId()); |
| | | // } |
| | | // disposalRecordItemService.updateBatchById(list1); |
| | | // List<MwDisposalRecord> list2 = disposalRecordService.lambdaQuery().in(MwDisposalRecord::getId, ids2).list(); |
| | | // for (MwDisposalRecord mwDisposalRecord : list2) { |
| | | // mwDisposalRecord.setDisposalFlag(1); |
| | | // mwDisposalRecord.setDisposalTime(new Date()); |
| | | // mwDisposalRecord.setDisposalUserId(sysUser.getUserId()); |
| | | // } |
| | | // disposalRecordService.updateBatchById(list2); |
| | | // } |
| | | // } |
| | | // MwBox byId1 = boxService.getById(list.get(0).getStagingRoomId()); |
| | | // byId1.setLink(4); |
| | | // boxService.updateById(byId1); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "已装车列表",tags = "运输人员") |
| | | @PostMapping("/box/has/collect") |
| | | public R<List<CollectCarTotalUpDto>> hascollect(String name) { |
| | | //获取车辆id |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser byId = userService.getById(sysUser.getUserId()); |
| | | //通过车辆id查询列表 |
| | | List<CollectCarTotalUpDto> list = collectRecordService.carGroup(byId.getCarId(),name); |
| | | return R.ok(list); |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "已装车列表详情",tags = "运输人员") |
| | | @PostMapping("/box/has/collect/detail") |
| | | public R<List<CollectDto>> hascollectdetail(@RequestParam Long hospitalId) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser byId = userService.getById(sysUser.getUserId()); |
| | | List<CollectDto> collectDtos = collectRecordService.getGroup3(null,hospitalId,byId.getCarId()); |
| | | return R.ok(collectDtos); |
| | | } |
| | | |
| | | @ApiOperation("库存信息") |
| | | @PostMapping("/list") |
| | | public R<List<CollectDto>> list(String boxNumber) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | List<CollectDto> collectDtos = collectRecordService.getGroup(boxNumber,sysUser.getDepartmentId()); |
| | | return R.ok(collectDtos); |
| | | } |
| | | @ApiOperation("收集详情") |
| | | @PostMapping("/record") |
| | | public R<List<MwCollectRecord>> record(@RequestParam String boxNumber) { |
| | | List<MwCollectRecord> list = collectRecordService.lambdaQuery().eq(MwCollectRecord::getBoxNumber, boxNumber).orderByDesc(MwCollectRecord::getCollectTime).list(); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @ApiOperation("收集统计上") |
| | | @PostMapping("/collect/total") |
| | | public R<List<CollectTotalUpDto>> collecttotal1(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser byId = userService.getById(sysUser.getUserId()); |
| | | return R.ok(collectRecordService.collectTotal(date,byId.getDepartmentId())); |
| | | } |
| | | @ApiOperation("收集统计下") |
| | | @PostMapping("/collect/down/total") |
| | | public R<Page<MwCollectRecord>> collecttotal2(@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)LocalDate date,@RequestParam Integer pageNum, @RequestParam Integer pageSize) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser byId = userService.getById(sysUser.getUserId()); |
| | | |
| | | Page<MwCollectRecord> page = collectRecordService.lambdaQuery().eq(date!=null,MwCollectRecord::getCollectTime,date).eq(MwCollectRecord::getDepartmentId, byId.getDepartmentId()).orderByDesc(MwCollectRecord::getCollectTime).page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("库存信息底部统计") |
| | | @PostMapping("/total") |
| | | public R<CollectTotalDto> total(String boxNumber) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser byId = userService.getById(sysUser.getUserId()); |
| | | CollectTotalDto collectTotalDto = new CollectTotalDto(); |
| | | List<CollectDto> collectDtos = collectRecordService.getGroup(boxNumber,byId.getDepartmentId()); |
| | | for (CollectDto collectDto : collectDtos) { |
| | | collectTotalDto.setBoxNum(collectTotalDto.getBoxNum()+1); |
| | | collectTotalDto.setCarNum(collectTotalDto.getCarNum()+collectDto.getNum()); |
| | | collectTotalDto.setWeight(collectTotalDto.getWeight().add(collectDto.getWeight())); |
| | | } |
| | | return R.ok(collectTotalDto); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.web.controller.applet; |
| | | |
| | | import com.sinata.common.core.domain.R; |
| | | import com.sinata.common.core.domain.entity.SysUser; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.common.utils.SecurityUtils; |
| | | import com.sinata.system.domain.MwTransitRoute; |
| | | import com.sinata.system.domain.MwTransitRouteCar; |
| | | import com.sinata.system.domain.MwTransitRoutePoints; |
| | | import com.sinata.system.domain.SysDepartment; |
| | | import com.sinata.system.domain.dto.MwTransitRouteDTO; |
| | | import com.sinata.system.domain.query.MwTransitRouteQuery; |
| | | import com.sinata.system.domain.vo.MwTransitRouteVO; |
| | | import com.sinata.system.service.*; |
| | | 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.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 转运线路 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-12-02 |
| | | */ |
| | | @Validated |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @Api(tags = {"运输路线"}) |
| | | @RequestMapping("/applet/mwTransitRoute") |
| | | public class AppMwTransitRouteController { |
| | | private final MwTransitRouteService mwTransitRouteService; |
| | | private final MwTransitRouteCarService transitRouteCarService; |
| | | private final MwTransitRoutePointsService pointsService; |
| | | private final SysDepartmentService departmentService; |
| | | private final ISysUserService userService; |
| | | |
| | | /** |
| | | * 分页列表 |
| | | * |
| | | * @param query |
| | | * @return |
| | | */ |
| | | |
| | | @ApiOperation("线路列表") |
| | | @PostMapping("/line") |
| | | public R<List<MwTransitRoute>> line() { |
| | | //获取当前用户的车辆 |
| | | SysUser sysUser1 = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser sysUser = userService.getById(sysUser1.getUserId()); |
| | | Long carId = sysUser.getCarId(); |
| | | //根据车辆获取线路列表 |
| | | List<MwTransitRouteCar> list = transitRouteCarService.lambdaQuery().eq(MwTransitRouteCar::getCarId, carId).list(); |
| | | List<Long> routeIds = new ArrayList<>(); |
| | | for (MwTransitRouteCar mwTransitRouteCar : list) { |
| | | routeIds.add(mwTransitRouteCar.getRouteId()); |
| | | } |
| | | if (routeIds.isEmpty()){ |
| | | return R.ok(); |
| | | } |
| | | |
| | | List<MwTransitRoute> list1 = mwTransitRouteService.lambdaQuery().in(MwTransitRoute::getId, routeIds).list(); |
| | | for (MwTransitRoute mwTransitRoute : list1) { |
| | | SysDepartment byId = departmentService.getById(mwTransitRoute.getDepartmentId()); |
| | | if (byId != null) { |
| | | mwTransitRoute.setHospitalName(byId.getDepartmentName()); |
| | | } |
| | | } |
| | | return R.ok(list1); |
| | | } |
| | | @ApiOperation("获取途径点") |
| | | @PostMapping("/get") |
| | | public R<List<MwTransitRoutePoints>> pageList(@RequestParam Long routeId) { |
| | | List<MwTransitRoutePoints> list1 = pointsService.lambdaQuery().eq(MwTransitRoutePoints::getRouteId, routeId).orderByAsc(MwTransitRoutePoints::getSortOrder).list(); |
| | | for (MwTransitRoutePoints mwTransitRoutePoints : list1) { |
| | | SysDepartment byId = departmentService.getById(mwTransitRoutePoints.getDepartmentId()); |
| | | mwTransitRoutePoints.setDepartmentName(byId.getDepartmentName()); |
| | | } |
| | | return R.ok(list1); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.web.controller.applet; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.sinata.common.core.domain.R; |
| | | import com.sinata.common.core.domain.entity.SysUser; |
| | | import com.sinata.common.utils.SecurityUtils; |
| | | import com.sinata.system.domain.MwWarningRecord; |
| | | import com.sinata.system.domain.SysDepartment; |
| | | import com.sinata.system.domain.dto.CollectTotalUpDto; |
| | | import com.sinata.system.service.MwWarningRecordService; |
| | | import com.sinata.system.service.SysDepartmentService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 预警记录表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-12-02 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/applet/mwWarningRecord") |
| | | @Api(tags = {"医院工作人员"}) |
| | | @AllArgsConstructor |
| | | public class AppMwWarningRecordController { |
| | | private final MwWarningRecordService mwWarningRecordService; |
| | | private final SysDepartmentService sysDepartmentService; |
| | | |
| | | @ApiOperation("预警记录") |
| | | @PostMapping("/record") |
| | | public R<Page<MwWarningRecord>> record(@RequestParam Integer pageNum,@RequestParam Integer pageSize) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | Page<MwWarningRecord> page = mwWarningRecordService.lambdaQuery().eq(MwWarningRecord::getDepartmentId, sysUser.getDepartmentId()).page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @ApiOperation(value = "预警统计",tags = "监管人员") |
| | | @PostMapping("/danger") |
| | | public R<List<SysDepartment>> danger(String name) { |
| | | // |
| | | List<SysDepartment> list = sysDepartmentService.lambdaQuery().like(name!=null,SysDepartment::getDepartmentName,name).eq(SysDepartment::getOrgType, 2).list(); |
| | | for (SysDepartment sysDepartment : list) { |
| | | sysDepartment.setDangerCount(mwWarningRecordService.lambdaQuery().eq(MwWarningRecord::getDepartmentId,sysDepartment.getId()).count()); |
| | | } |
| | | 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); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.web.controller.applet; |
| | | |
| | | 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.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * <p> |
| | | * 红黄码监管记录 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-12-02 |
| | | */ |
| | | @Validated |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @Api(tags = {"监管人员执法记录"}) |
| | | @RequestMapping("/applet/mwRegulatoryRecord") |
| | | public class AppRegulatoryRecordController { |
| | | 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(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.web.controller.applet; |
| | | |
| | | import com.sinata.common.annotation.Log; |
| | | import com.sinata.common.core.controller.BaseController; |
| | | import com.sinata.common.core.domain.AjaxResult; |
| | | import com.sinata.common.core.domain.R; |
| | | import com.sinata.common.core.domain.entity.SysDept; |
| | | import com.sinata.common.core.domain.entity.SysRole; |
| | | import com.sinata.common.core.domain.entity.SysUser; |
| | | import com.sinata.common.core.page.TableDataInfo; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.common.enums.BusinessType; |
| | | import com.sinata.common.utils.SecurityUtils; |
| | | import com.sinata.common.utils.StringUtils; |
| | | import com.sinata.common.utils.poi.ExcelUtil; |
| | | import com.sinata.system.domain.MwApplication; |
| | | import com.sinata.system.domain.MwTransitCar; |
| | | import com.sinata.system.domain.dto.SysUserDTO; |
| | | import com.sinata.system.domain.dto.SysUserStatusDTO; |
| | | import com.sinata.system.domain.query.SysUserQuery; |
| | | import com.sinata.system.domain.vo.SysUserVO; |
| | | import com.sinata.system.service.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 用户信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping("/applet/user") |
| | | @AllArgsConstructor |
| | | public class AppUserController extends BaseController |
| | | { |
| | | private final MwTransitCarService carService; |
| | | private final ISysUserService userService; |
| | | @ApiOperation(value = "获取绑定车辆",tags = "运输人员") |
| | | @PostMapping("/car") |
| | | public R<MwTransitCar> car() { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | SysUser sysUser = userService.getById(user.getUserId()); |
| | | |
| | | if (sysUser.getCarId()==null){ |
| | | return R.fail("当前暂无绑定车辆,请绑定后操作"); |
| | | } |
| | | MwTransitCar byId = carService.getById(sysUser.getCarId()); |
| | | 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(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "取消绑定",tags = "运输人员") |
| | | @PostMapping("/cancel") |
| | | public R<SysUser> cancel() { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | sysUser.setCarId(-1L); |
| | | userService.updateById(sysUser); |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.web.controller.applet; |
| | | |
| | | import com.sinata.common.annotation.Log; |
| | | import com.sinata.common.core.controller.BaseController; |
| | | import com.sinata.common.core.domain.AjaxResult; |
| | | import com.sinata.common.core.domain.R; |
| | | import com.sinata.common.core.domain.entity.SysDictData; |
| | | import com.sinata.common.core.page.TableDataInfo; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.common.enums.BusinessType; |
| | | import com.sinata.common.utils.StringUtils; |
| | | import com.sinata.common.utils.poi.ExcelUtil; |
| | | import com.sinata.system.domain.dto.SysDictDataDTO; |
| | | import com.sinata.system.domain.query.KeyWordQuery; |
| | | import com.sinata.system.domain.vo.SysDictDataVO; |
| | | import com.sinata.system.service.ISysDictDataService; |
| | | import com.sinata.system.service.ISysDictTypeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 数据字典信息 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Api(tags = {"数据字典相关接口"}) |
| | | @RestController |
| | | @Validated |
| | | @RequestMapping("/applet/system/dict/data") |
| | | public class AppletDictDataController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysDictDataService dictDataService; |
| | | |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | /** |
| | | * 数据字典分页列表 |
| | | * |
| | | * @param page |
| | | * @return |
| | | */ |
| | | @ApiOperation("数据字典分页列表") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<SysDictDataVO>> page(@Valid @RequestBody KeyWordQuery query) { |
| | | return R.ok(dictDataService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据字典 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation("保存数据字典信息") |
| | | @PostMapping("/save") |
| | | public R<?> add(@Valid @RequestBody SysDictDataDTO dto) { |
| | | dictDataService.save(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param dictCode |
| | | * @return |
| | | */ |
| | | @ApiOperation("删除") |
| | | @DeleteMapping("/{dictCode}") |
| | | public R<?> remove(@ApiParam(name = "dictCode", value = "数据字典主键", required = true) @PathVariable("dictCode") Long dictCode) { |
| | | dictDataService.removeById(dictCode); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 医废类型列表 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation("医废类型列表") |
| | | @GetMapping("/medicalWasteTypeList") |
| | | public R<List<SysDictDataVO>> medicalWasteTypeList() { |
| | | return R.ok(dictDataService.medicalWasteTypeList()); |
| | | } |
| | | |
| | | /** |
| | | * 器具类型列表 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation("器具类型列表") |
| | | @GetMapping("/equipmentTypeList") |
| | | public R<List<SysDictDataVO>> equipmentTypeList() { |
| | | return R.ok(dictDataService.equipmentTypeList()); |
| | | } |
| | | |
| | | /** |
| | | * 规章制度类型列表 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation("规章制度类型列表") |
| | | @GetMapping("/regulationsTypeList") |
| | | public R<List<SysDictDataVO>> regulationsTypeList() { |
| | | return R.ok(dictDataService.regulationsTypeList()); |
| | | } |
| | | |
| | | /** |
| | | * 作业类型 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation("作业类型") |
| | | @GetMapping("/workTypeList") |
| | | public R<List<SysDictDataVO>> workTypeList() { |
| | | return R.ok(dictDataService.workTypeList()); |
| | | } |
| | | |
| | | /** |
| | | * 医疗机构级别 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation("医疗机构级别") |
| | | @GetMapping("/institutionLevelList") |
| | | public R<List<SysDictDataVO>> institutionLevelList() { |
| | | return R.ok(dictDataService.institutionLevelList()); |
| | | } |
| | | |
| | | /** |
| | | * 医疗机构性质 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation("医疗机构性质") |
| | | @GetMapping("/institutionTypeList") |
| | | public R<List<SysDictDataVO>> institutionTypeList() { |
| | | return R.ok(dictDataService.institutionTypeList()); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:dict:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysDictData dictData) |
| | | { |
| | | startPage(); |
| | | List<SysDictData> list = dictDataService.selectDictDataList(dictData); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "字典数据", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:dict:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysDictData dictData) |
| | | { |
| | | List<SysDictData> list = dictDataService.selectDictDataList(dictData); |
| | | ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class); |
| | | util.exportExcel(response, list, "字典数据"); |
| | | } |
| | | |
| | | /** |
| | | * 查询字典数据详细 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:query')") |
| | | @GetMapping(value = "/{dictCode}") |
| | | public AjaxResult getInfo(@PathVariable Long dictCode) |
| | | { |
| | | return success(dictDataService.selectDictDataById(dictCode)); |
| | | } |
| | | |
| | | /** |
| | | * 根据字典类型查询字典数据信息 |
| | | */ |
| | | @GetMapping(value = "/type/{dictType}") |
| | | public AjaxResult dictType(@PathVariable String dictType) |
| | | { |
| | | List<SysDictData> data = dictTypeService.selectDictDataByType(dictType); |
| | | if (StringUtils.isNull(data)) |
| | | { |
| | | data = new ArrayList<SysDictData>(); |
| | | } |
| | | return success(data); |
| | | } |
| | | |
| | | /** |
| | | * 新增字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:add')") |
| | | @Log(title = "字典数据", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDictData dict) |
| | | { |
| | | dict.setCreateBy(getUsername()); |
| | | return toAjax(dictDataService.insertDictData(dict)); |
| | | } |
| | | |
| | | /** |
| | | * 修改保存字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:edit')") |
| | | @Log(title = "字典数据", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDictData dict) |
| | | { |
| | | dict.setUpdateBy(getUsername()); |
| | | return toAjax(dictDataService.updateDictData(dict)); |
| | | } |
| | | |
| | | /** |
| | | * 删除字典类型 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "字典类型", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictCodes}") |
| | | public AjaxResult remove(@PathVariable Long[] dictCodes) |
| | | { |
| | | dictDataService.deleteDictDataByIds(dictCodes); |
| | | return success(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.web.controller.tool; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | |
| | | public class CapacityUtil { |
| | | |
| | | /** |
| | | * 计算已存数量占最大容量的百分比,并保留两位小数 |
| | | * |
| | | * @param count 已存数量 |
| | | * @param maxCapacity 最大容量 |
| | | * @return 百分比(保留两位小数) |
| | | */ |
| | | public static String calculatePercentage(Long count, Integer maxCapacity) { |
| | | if (maxCapacity == null || maxCapacity <= 0) { |
| | | throw new IllegalArgumentException("Max capacity must be greater than 0."); |
| | | } |
| | | |
| | | // 使用 BigDecimal 进行精确计算 |
| | | BigDecimal countBD = new BigDecimal(count); |
| | | BigDecimal maxCapacityBD = new BigDecimal(maxCapacity); |
| | | BigDecimal percentage = countBD.divide(maxCapacityBD, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); |
| | | |
| | | // 保留两位小数 |
| | | return percentage.setScale(2, RoundingMode.HALF_UP).toString() + "%"; |
| | | } |
| | | |
| | | // 示例用法 |
| | | public static void main(String[] args) { |
| | | Long count = 75L; // 示例已存数量 |
| | | Integer maxCapacity = 100; // 示例最大容量 |
| | | |
| | | // 计算并打印百分比 |
| | | System.out.println(calculatePercentage(count, maxCapacity)); // 输出 "75.00%" |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.web.controller.tool.weChat; |
| | | |
| | | import org.bouncycastle.jce.provider.BouncyCastleProvider; |
| | | |
| | | import javax.crypto.BadPaddingException; |
| | | import javax.crypto.Cipher; |
| | | import javax.crypto.IllegalBlockSizeException; |
| | | import javax.crypto.NoSuchPaddingException; |
| | | import javax.crypto.spec.IvParameterSpec; |
| | | import javax.crypto.spec.SecretKeySpec; |
| | | import java.security.*; |
| | | |
| | | /** |
| | | * AES加密 |
| | | * @author pzb |
| | | * @Date 2021/12/3 15:43 |
| | | */ |
| | | public class AES { |
| | | |
| | | public static boolean initialized = false; |
| | | |
| | | /** |
| | | * AES解密 |
| | | * |
| | | * @param content |
| | | * 密文 |
| | | * @return |
| | | * @throws InvalidAlgorithmParameterException |
| | | * @throws NoSuchProviderException |
| | | */ |
| | | public byte[] decrypt(byte[] content, byte[] keyByte, byte[] ivByte) throws InvalidAlgorithmParameterException { |
| | | initialize(); |
| | | try { |
| | | Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding"); |
| | | Key sKeySpec = new SecretKeySpec(keyByte, "AES"); |
| | | cipher.init(Cipher.DECRYPT_MODE, sKeySpec, generateIV(ivByte));// 初始化 |
| | | byte[] result = cipher.doFinal(content); |
| | | return result; |
| | | } catch (NoSuchAlgorithmException e) { |
| | | e.printStackTrace(); |
| | | } catch (NoSuchPaddingException e) { |
| | | e.printStackTrace(); |
| | | } catch (InvalidKeyException e) { |
| | | e.printStackTrace(); |
| | | } catch (IllegalBlockSizeException e) { |
| | | e.printStackTrace(); |
| | | } catch (BadPaddingException e) { |
| | | e.printStackTrace(); |
| | | } catch (NoSuchProviderException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } catch (Exception e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static void initialize() { |
| | | if (initialized) |
| | | return; |
| | | Security.addProvider(new BouncyCastleProvider()); |
| | | initialized = true; |
| | | } |
| | | |
| | | // 生成iv |
| | | public static AlgorithmParameters generateIV(byte[] iv) throws Exception { |
| | | AlgorithmParameters params = AlgorithmParameters.getInstance("AES"); |
| | | params.init(new IvParameterSpec(iv)); |
| | | return params; |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.web.controller.tool.weChat; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/12/10 15:56 |
| | | */ |
| | | public enum EnvVersion { |
| | | /** |
| | | * 开发版 |
| | | */ |
| | | DEVELOP("develop"), |
| | | /** |
| | | * 体验版 |
| | | */ |
| | | TRIAL("trial"), |
| | | /** |
| | | * 线上版本 |
| | | */ |
| | | RELEASE("release"); |
| | | |
| | | |
| | | EnvVersion(String version) { |
| | | this.version = version; |
| | | } |
| | | |
| | | private String version; |
| | | |
| | | public String getVersion() { |
| | | return version; |
| | | } |
| | | |
| | | public void setVersion(String version) { |
| | | this.version = version; |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.web.controller.tool.weChat; |
| | | |
| | | import org.apache.commons.codec.binary.Base64; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | |
| | | public class WXCore { |
| | | |
| | | private static final String WATERMARK = "watermark"; |
| | | |
| | | @Value("${wx.appletsAppid}") |
| | | private static String appid ; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 解密数据 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String decrypt(String encryptedData, String sessionKey, String iv){ |
| | | String result = ""; |
| | | try { |
| | | AES aes = new AES(); |
| | | byte[] resultByte = aes.decrypt(Base64.decodeBase64(encryptedData), Base64.decodeBase64(sessionKey), Base64.decodeBase64(iv)); |
| | | if(null != resultByte && resultByte.length > 0){ |
| | | result = new String(WxPKCS7Encoder.decode(resultByte), "UTF-8"); |
| | | // JSONObject jsonObject = JSON.parseObject(result); |
| | | // String decryptAppid = jsonObject.getJSONObject(WATERMARK).getString("appid"); |
| | | // if(!appid.equals(decryptAppid)){ |
| | | // result = ""; |
| | | // } |
| | | } |
| | | } catch (Exception e) { |
| | | result = ""; |
| | | e.printStackTrace(); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) throws Exception{ |
| | | String appId = "wx4f4bc4dec97d474b"; |
| | | String encryptedData = "CiyLU1Aw2KjvrjMdj8YKliAjtP4gsMZMQmRzooG2xrDcvSnxIMXFufNstNGTyaGS9uT5geRa0W4oTOb1WT7fJlAC+oNPdbB+3hVbJSRgv+4lGOETKUQz6OYStslQ142dNCuabNPGBzlooOmB231qMM85d2/fV6ChevvXvQP8Hkue1poOFtnEtpyxVLW1zAo6/1Xx1COxFvrc2d7UL/lmHInNlxuacJXwu0fjpXfz/YqYzBIBzD6WUfTIF9GRHpOn/Hz7saL8xz+W//FRAUid1OksQaQx4CMs8LOddcQhULW4ucetDf96JcR3g0gfRK4PC7E/r7Z6xNrXd2UIeorGj5Ef7b1pJAYB6Y5anaHqZ9J6nKEBvB4DnNLIVWSgARns/8wR2SiRS7MNACwTyrGvt9ts8p12PKFdlqYTopNHR1Vf7XjfhQlVsAJdNiKdYmYVoKlaRv85IfVunYzO0IKXsyl7JCUjCpoG20f0a04COwfneQAGGwd5oa+T8yO5hzuyDb/XcxxmK01EpqOyuxINew=="; |
| | | String sessionKey = "tiihtNczf5v6AKRyjwEUhQ=="; |
| | | String iv = "r7BXXKkLb8qrSNn05n0qiA=="; |
| | | System.out.println(decrypt(encryptedData, sessionKey, iv)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.web.controller.tool.weChat; |
| | | |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import cn.hutool.http.HttpUtil; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 微信工具类 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class WeChatUtil { |
| | | |
| | | @Value("456") |
| | | private String wxAppletsAppid; |
| | | |
| | | @Value("123") |
| | | private String wxAppletsAppSecret; |
| | | |
| | | // @Value("${wx.appid}") |
| | | private String webAppId; |
| | | |
| | | // @Value("${wx.appSecret}") |
| | | private String webAppSecret; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 小程序使用jscode获取openid |
| | | * @param jscode |
| | | * @return |
| | | */ |
| | | public Map<String, Object> code2Session(String jscode) { |
| | | String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + wxAppletsAppid + "&secret=" + wxAppletsAppSecret |
| | | + "&js_code=" + jscode + "&grant_type=authorization_code"; |
| | | HttpRequest get = HttpUtil.createGet(url); |
| | | HttpResponse response = get.execute(); |
| | | int status = response.getStatus(); |
| | | if(200 != status){ |
| | | throw new RuntimeException(response.body()); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(response.body()); |
| | | int errcode = jsonObject.getIntValue("errcode"); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("errcode", errcode); |
| | | if(errcode == 0){//成功 |
| | | map.put("openid", jsonObject.getString("openid")); |
| | | map.put("sessionKey", jsonObject.getString("session_key")); |
| | | map.put("unionid", jsonObject.getString("unionid")); |
| | | return map; |
| | | } |
| | | if(errcode == -1){//系统繁忙,此时请开发者稍候再试 |
| | | map.put("msg", jsonObject.getString("errmsg")); |
| | | return map; |
| | | } |
| | | if(errcode == 40029){//code 无效 |
| | | map.put("msg", jsonObject.getString("errmsg")); |
| | | return map; |
| | | } |
| | | if(errcode == 45011){//频率限制,每个用户每分钟100次 |
| | | map.put("msg", jsonObject.getString("errmsg")); |
| | | return map; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.web.controller.tool.weChat; |
| | | |
| | | import java.nio.charset.Charset; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * 微信小程序加解密 |
| | | * @author pzb |
| | | * @Date 2021/12/3 15:43 |
| | | */ |
| | | public class WxPKCS7Encoder { |
| | | private static final Charset CHARSET = Charset.forName("utf-8"); |
| | | private static final int BLOCK_SIZE = 32; |
| | | |
| | | /** |
| | | * 获得对明文进行补位填充的字节. |
| | | * |
| | | * @param count |
| | | * 需要进行填充补位操作的明文字节个数 |
| | | * @return 补齐用的字节数组 |
| | | */ |
| | | public static byte[] encode(int count) { |
| | | // 计算需要填充的位数 |
| | | int amountToPad = BLOCK_SIZE - (count % BLOCK_SIZE); |
| | | if (amountToPad == 0) { |
| | | amountToPad = BLOCK_SIZE; |
| | | } |
| | | // 获得补位所用的字符 |
| | | char padChr = chr(amountToPad); |
| | | String tmp = new String(); |
| | | for (int index = 0; index < amountToPad; index++) { |
| | | tmp += padChr; |
| | | } |
| | | return tmp.getBytes(CHARSET); |
| | | } |
| | | |
| | | /** |
| | | * 删除解密后明文的补位字符 |
| | | * |
| | | * @param decrypted |
| | | * 解密后的明文 |
| | | * @return 删除补位字符后的明文 |
| | | */ |
| | | public static byte[] decode(byte[] decrypted) { |
| | | int pad = decrypted[decrypted.length - 1]; |
| | | if (pad < 1 || pad > 32) { |
| | | pad = 0; |
| | | } |
| | | return Arrays.copyOfRange(decrypted, 0, decrypted.length - pad); |
| | | } |
| | | |
| | | /** |
| | | * 将数字转化成ASCII码对应的字符,用于对明文进行补码 |
| | | * |
| | | * @param a |
| | | * 需要转化的数字 |
| | | * @return 转化得到的字符 |
| | | */ |
| | | public static char chr(int a) { |
| | | byte target = (byte) (a & 0xFF); |
| | | return (char) target; |
| | | } |
| | | } |
| | |
| | | # 主库数据源 |
| | | master: |
| | | # url: jdbc:mysql://localhost:3306/medical_waste?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | url: jdbc:dm://127.0.0.1:5236/MEDICAL_WASTE?schema=MEDICAL_WASTE |
| | | url: jdbc:dm://192.168.110.188:5236/MEDICAL_WASTE?schema=MEDICAL_WASTE |
| | | username: SYSDBA |
| | | password: SYSDBA |
| | | # 从库数据源 |
| | |
| | | # 主库数据源 |
| | | master: |
| | | # url: jdbc:mysql://localhost:3306/medical_waste?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | url: jdbc:dm://127.0.0.1:5236/MEDICAL_WASTE?schema=MEDICAL_WASTE |
| | | url: jdbc:dm://192.168.110.188:5236/MEDICAL_WASTE?schema=MEDICAL_WASTE |
| | | username: SYSDBA |
| | | password: SYSDBA |
| | | # 从库数据源 |
| | |
| | | spring: |
| | | profiles: |
| | | active: prod |
| | | active: dev |
| | |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.sinata.common.core.domain.entity.SysUser; |
| | | import lombok.Data; |
| | | import org.springframework.security.core.GrantedAuthority; |
| | | import org.springframework.security.core.userdetails.UserDetails; |
| | | import java.util.Collection; |
| | |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Data |
| | | public class LoginUser implements UserDetails |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | .authorizeHttpRequests((requests) -> { |
| | | permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll()); |
| | | // 对于登录login 注册register 验证码captchaImage 允许匿名访问 |
| | | requests.antMatchers("/backend/login", "/register", "/captchaImage").permitAll() |
| | | requests.antMatchers("/backend/login","/applet/mwApplication/set","/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.sinata.common.constant.CacheConstants; |
| | | import com.sinata.common.constant.Constants; |
| | | import com.sinata.common.constant.UserConstants; |
| | | import com.sinata.common.core.domain.AjaxResult; |
| | | import com.sinata.common.core.domain.entity.SysUser; |
| | | import com.sinata.common.core.domain.model.LoginUser; |
| | | import com.sinata.common.core.redis.RedisCache; |
| | |
| | | import com.sinata.framework.manager.AsyncManager; |
| | | import com.sinata.framework.manager.factory.AsyncFactory; |
| | | import com.sinata.framework.security.context.AuthenticationContextHolder; |
| | | import com.sinata.system.domain.SysDepartment; |
| | | import com.sinata.system.service.ISysConfigService; |
| | | import com.sinata.system.service.ISysUserService; |
| | | import com.sinata.system.service.SysDepartmentService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.authentication.AuthenticationManager; |
| | | import org.springframework.security.authentication.BadCredentialsException; |
| | |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | @Resource |
| | | private SysDepartmentService departmentService; |
| | | |
| | | /** |
| | | * 登录验证 |
| | |
| | | public LoginUser login(String username, String password, String code, String uuid) |
| | | { |
| | | // 验证码校验 |
| | | validateCaptcha(username, code, uuid); |
| | | // validateCaptcha(username, code, uuid); |
| | | // 登录前置校验 |
| | | loginPreCheck(username, password); |
| | | // loginPreCheck(username, password); |
| | | // 用户验证 |
| | | Authentication authentication = null; |
| | | try |
| | |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"))); |
| | | LoginUser loginUser = (LoginUser) authentication.getPrincipal(); |
| | | recordLoginInfo(loginUser.getUserId()); |
| | | // 生成token |
| | | return loginUser; |
| | | } |
| | | |
| | | public LoginUser login1(String username, String password, String code, String uuid) |
| | | { |
| | | // // 验证码校验 |
| | | // validateCaptcha(username, code, uuid); |
| | | // // 登录前置校验 |
| | | // loginPreCheck(username, password); |
| | | // // 用户验证 |
| | | // Authentication authentication = null; |
| | | // try |
| | | // { |
| | | // UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, null); |
| | | // AuthenticationContextHolder.setContext(authenticationToken); |
| | | // // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername |
| | | // authentication = authenticationManager.authenticate(authenticationToken); |
| | | // } |
| | | // catch (Exception e) |
| | | // { |
| | | // if (e instanceof BadCredentialsException) |
| | | // { |
| | | // AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"))); |
| | | // throw new UserPasswordNotMatchException(); |
| | | // } |
| | | // else |
| | | // { |
| | | // AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage())); |
| | | // throw new ServiceException(e.getMessage()); |
| | | // } |
| | | // } |
| | | // finally |
| | | // { |
| | | // AuthenticationContextHolder.clearContext(); |
| | | // } |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success"))); |
| | | SysUser one = userService.lambdaQuery().eq(SysUser::getUserName, username).one(); |
| | | if (one.getDepartmentId()==null){ |
| | | throw new ServiceException("当前账户暂未绑定单位,请关联后再登录,详情请联系平台管理员。"); |
| | | } |
| | | recordLoginInfo(one.getUserId()); |
| | | LoginUser loginUser = new LoginUser(); |
| | | loginUser.setUserId(one.getUserId()); |
| | | loginUser.setUser(one); |
| | | |
| | | // 生成token |
| | | return loginUser; |
| | | } |
| | |
| | | public void loginPreCheck(String username, String password) |
| | | { |
| | | // 用户名或密码为空 错误 |
| | | if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) |
| | | if ((StringUtils.isEmpty(username) || StringUtils.isEmpty(password))&&!password.equals("-1")) |
| | | { |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("not.null"))); |
| | | throw new UserNotExistsException(); |
| | | } |
| | | // 密码如果不在指定范围内 错误 |
| | | if (password.length() < UserConstants.PASSWORD_MIN_LENGTH |
| | | || password.length() > UserConstants.PASSWORD_MAX_LENGTH) |
| | | { |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"))); |
| | | throw new UserPasswordNotMatchException(); |
| | | } |
| | | // 用户名不在指定范围内 错误 |
| | | if (username.length() < UserConstants.USERNAME_MIN_LENGTH |
| | | || username.length() > UserConstants.USERNAME_MAX_LENGTH) |
| | | { |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"))); |
| | | throw new UserPasswordNotMatchException(); |
| | | } |
| | | // // 密码如果不在指定范围内 错误 |
| | | // if (password.length() < UserConstants.PASSWORD_MIN_LENGTH |
| | | // || password.length() > UserConstants.PASSWORD_MAX_LENGTH) |
| | | // { |
| | | // AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"))); |
| | | // throw new UserPasswordNotMatchException(); |
| | | // } |
| | | // // 用户名不在指定范围内 错误 |
| | | // if (username.length() < UserConstants.USERNAME_MIN_LENGTH |
| | | // || username.length() > UserConstants.USERNAME_MAX_LENGTH) |
| | | // { |
| | | // AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match"))); |
| | | // throw new UserPasswordNotMatchException(); |
| | | // } |
| | | // IP黑名单校验 |
| | | String blackStr = configService.selectConfigByKey("sys.login.blackIPList"); |
| | | if (IpUtils.isMatchedIp(blackStr, IpUtils.getIpAddr())) |
| | |
| | | throw new UserPasswordRetryLimitExceedException(maxRetryCount, lockTime); |
| | | } |
| | | |
| | | if (!matches(user, password)) |
| | | if (!matches(user, password)&&!password.equals("-1")) |
| | | { |
| | | retryCount = retryCount + 1; |
| | | redisCache.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES); |
| | |
| | | @ApiModelProperty("审核意见") |
| | | @TableField("AUDIT_OPINION") |
| | | private String auditOpinion; |
| | | @TableField(exist = false) |
| | | private String code; |
| | | |
| | | |
| | | } |
| | |
| | | @TableField("BOX_TIME") |
| | | private Date boxTime; |
| | | |
| | | @ApiModelProperty("接收人id") |
| | | @TableField("RECEIVE_USER_ID") |
| | | private Long receiveUserId; |
| | | |
| | | @ApiModelProperty("收集人id") |
| | | @TableField("COLLECT_USER_ID") |
| | | private Long collectUserId; |
| | |
| | | @ApiModelProperty("收集时间") |
| | | @TableField("COLLECT_TIME") |
| | | private Date collectTime; |
| | | |
| | | |
| | | @ApiModelProperty("接收时间") |
| | | @TableField("RECEIVE_TIME") |
| | | private Date receiveTime; |
| | | @ApiModelProperty("司机用户id") |
| | | @TableField("DRIVER_ID") |
| | | private Long driverId; |
| | | @ApiModelProperty("车辆id") |
| | | @TableField("CAR_ID") |
| | | private Long carId; |
| | | @ApiModelProperty("处置时间") |
| | | @TableField("DISPOSAL_TIME") |
| | | private Date disposalTime; |
| | | |
| | | @ApiModelProperty("处置用户ID") |
| | | @TableField("DISPOSAL_USER_ID") |
| | | private Long disposalUserId; |
| | | |
| | | @ApiModelProperty("接收部门id") |
| | | @TableField("RECEIVE_DEPARTMENT_ID") |
| | | private Long receiveDepartmentId; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("处置用户ID") |
| | | @TableField("DISPOSAL_USER_ID") |
| | | private Long disposalUserId; |
| | | @ApiModelProperty("司机用户id") |
| | | @TableField("DRIVER_ID") |
| | | private Long driverId; |
| | | @ApiModelProperty("车辆id") |
| | | @TableField("CAR_ID") |
| | | private Long carId; |
| | | |
| | | |
| | | |
| | |
| | | @Setter |
| | | @TableName("MW_DISPOSAL_HANDLE_RECORD_ITEM") |
| | | @ApiModel(value = "MwDisposalHandleRecordItem对象", description = "处置记录项") |
| | | public class MwDisposalHandleRecordItem extends BaseModel { |
| | | public class MwDisposalHandleRecordItem { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | @TableId(value = "ID", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("处置接收记录ID") |
| | | @ApiModelProperty("处置记录ID") |
| | | @TableField("DISPOSAL_RECORD_ID") |
| | | private Long disposalRecordId; |
| | | |
| | |
| | | @Getter |
| | | @Setter |
| | | @TableName("MW_DISPOSAL_RECORD") |
| | | @ApiModel(value = "MwDisposalRecord对象", description = "处置接收记录") |
| | | @ApiModel(value = "MwDisposalRecord对象", description = "接收记录") |
| | | public class MwDisposalRecord extends BaseModel { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty("处置接收记录id") |
| | | @ApiModelProperty("接收记录id") |
| | | @TableId(value = "ID", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | |
| | | @TableField("DEPARTMENT_ID") |
| | | private Long departmentId; |
| | | |
| | | @ApiModelProperty("处置单位名称") |
| | | @ApiModelProperty("接收单位名称") |
| | | @TableField("DISPOSAL_UNIT_NAME") |
| | | private String disposalUnitName; |
| | | |
| | |
| | | @ApiModelProperty("处置人id") |
| | | @TableField("DISPOSAL_USER_ID") |
| | | private Long disposalUserId; |
| | | @ApiModelProperty("司机用户id") |
| | | @TableField("DRIVER_ID") |
| | | private Long driverId; |
| | | @ApiModelProperty("车辆id") |
| | | @TableField("CAR_ID") |
| | | private Long carId; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @Getter |
| | | @Setter |
| | | @TableName("MW_DISPOSAL_RECORD_ITEM") |
| | | @ApiModel(value = "MwDisposalRecordItem对象", description = "处置接收记录项") |
| | | @ApiModel(value = "MwDisposalRecordItem对象", description = "接收记录项") |
| | | public class MwDisposalRecordItem { |
| | | |
| | | @ApiModelProperty("处置接收记录项id") |
| | |
| | | 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("线路名称") |
| | | @TableField("ROUTE_NAME") |
| | | private String routeName; |
| | | @ApiModelProperty("医院名称") |
| | | @TableField(exist = false) |
| | | private String hospitalName; |
| | | |
| | | @ApiModelProperty("医院数量") |
| | | @TableField("HOSPITAL_QUANTITY") |
| | |
| | | @ApiModelProperty("区域id(医院id)") |
| | | @TableField("DEPARTMENT_ID") |
| | | private Long departmentId; |
| | | @TableField(exist = false) |
| | | private String departmentName; |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("是否标红1是") |
| | | private Integer isRed; |
| | | |
| | | @ApiModelProperty("排序") |
| | | @TableField("SORT_ORDER") |
| | |
| | | @ApiModelProperty("区域") |
| | | @TableField("REGION") |
| | | private String region; |
| | | |
| | | @ApiModelProperty("医院-暂存间最大数量") |
| | | @TableField(exist = false) |
| | | private Integer maxCapacity; |
| | | |
| | | @ApiModelProperty("医院-现在存入数量") |
| | | @TableField(exist = false) |
| | | private Integer nowCapacity; |
| | | @ApiModelProperty("医院-百分比") |
| | | @TableField(exist = false) |
| | | private String percentage; |
| | | @ApiModelProperty("处置-库存总") |
| | | @TableField(exist = false) |
| | | private Long cont1; |
| | | @ApiModelProperty("处置-今日接收") |
| | | @TableField(exist = false) |
| | | private Long cont2; |
| | | @ApiModelProperty("处置-今日处置") |
| | | @TableField(exist = false) |
| | | private Long cont3; |
| | | @ApiModelProperty("当前预警量") |
| | | @TableField(exist = false) |
| | | private Long dangerCount; |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class BoxListDto { |
| | | List<String> boxNum; |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CarDto { |
| | | private String licensePlateNumber; |
| | | private String userName; |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.sinata.system.domain.MwCheckoutRecord; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class CheckOutDto { |
| | | |
| | | @ApiModelProperty("运输人员姓名") |
| | | private String driverName; |
| | | @ApiModelProperty("出库时间/接收时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date checkoutTime; |
| | | @ApiModelProperty("车牌号") |
| | | private String licensePlateNumber; |
| | | private List<CollectTotalUpDto> records; |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class CollectCarTotalUpDto { |
| | | @ApiModelProperty("医院名称") |
| | | private String hospitalName; |
| | | @ApiModelProperty("医院id") |
| | | private Long hospitalId; |
| | | @ApiModelProperty("出库id") |
| | | private Long checkOutId; |
| | | @ApiModelProperty("总箱数") |
| | | private Integer boxNum; |
| | | @ApiModelProperty("总袋数") |
| | | private Integer num; |
| | | @ApiModelProperty("总重量") |
| | | private BigDecimal weight; |
| | | private String wasteTypeStr; |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class CollectDto { |
| | | @ApiModelProperty("箱子编号") |
| | | private String boxNumber; |
| | | @ApiModelProperty("医废类型(数据字典id)") |
| | | private Integer wasteType; |
| | | @ApiModelProperty("总袋数") |
| | | private Integer num; |
| | | @ApiModelProperty("总重量") |
| | | private BigDecimal weight; |
| | | @ApiModelProperty("封箱时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime lastTime; |
| | | @ApiModelProperty("接收时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date receiveTime; |
| | | private String wasteTypeStr; |
| | | private String departmentName; |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | @Data |
| | | public class CollectTotalDto { |
| | | |
| | | @ApiModelProperty("箱") |
| | | private Integer boxNum = 0; |
| | | @ApiModelProperty("袋") |
| | | private Integer carNum = 0; |
| | | @ApiModelProperty("总重量") |
| | | private BigDecimal weight = BigDecimal.ZERO; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class CollectTotalUpDto { |
| | | @ApiModelProperty("医废类型(数据字典id)") |
| | | private Integer wasteType; |
| | | @ApiModelProperty("总箱数") |
| | | private Integer boxNum; |
| | | @ApiModelProperty("总袋数") |
| | | 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; |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import jdk.internal.dynalink.linker.LinkerServices; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class HospitalCollectTotalUpDto { |
| | | @ApiModelProperty("医院名称") |
| | | private String hospitalName; |
| | | @ApiModelProperty("列表") |
| | | private List<CollectTotalUpDto> collectTotalUpDtos; |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | @Data |
| | | public class SignCollectDto { |
| | | @ApiModelProperty("签名图片地址") |
| | | private String signUrl; |
| | | @ApiModelProperty("选中的箱号") |
| | | private List<String> boxNumbers; |
| | | } |
New file |
| | |
| | | package com.sinata.system.domain.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.sinata.common.annotation.Excel; |
| | | import com.sinata.common.core.domain.entity.SysRole; |
| | | import com.sinata.system.domain.SysDepartment; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Set; |
| | | |
| | | @Data |
| | | public class UserInfoDTO { |
| | | @ApiModelProperty("用户名称") |
| | | private String nickName; |
| | | @ApiModelProperty("角色名称") |
| | | private Set<String> roles; |
| | | @ApiModelProperty("单位名称") |
| | | private SysDepartment department; |
| | | private SysRole role; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.sinata.system.domain.MwCheckoutRecord; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.sinata.system.domain.dto.CollectTotalUpDto; |
| | | import com.sinata.system.domain.query.CheckoutRecordQuery; |
| | | import com.sinata.system.domain.query.DisposalReportQuery; |
| | | import com.sinata.system.domain.query.MwTransitRecordQuery; |
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | List<MwCheckoutRecordVO> hospitalTransitList(@Param("query") CheckoutRecordQuery query, @Param("treeCode") String treeCode); |
| | | |
| | | List<CollectTotalUpDto> totalUp(@Param("date") LocalDate date, @Param("departmentId")Long departmentId); |
| | | List<CollectTotalUpDto> totalUp4(@Param("departmentId")Long departmentId); |
| | | List<CollectTotalUpDto> totalUp2(@Param("date1") LocalDate date1, @Param("date2") LocalDate date2,@Param("departmentId")Long departmentId); |
| | | List<CollectTotalUpDto> totalUp5(@Param("departmentId")Long departmentId); |
| | | List<CollectTotalUpDto> totalUp3(@Param("date1") LocalDate date1, @Param("date2") LocalDate date2,@Param("departmentId")Long departmentId); |
| | | List<CollectTotalUpDto> totalUp1(@Param("outId")Long outId); |
| | | List<CollectTotalUpDto> totalUp6(@Param("outId")Long outId); |
| | | |
| | | /** |
| | | * 转移联单数据 |
| | | * |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.sinata.system.domain.MedicalWasteStaticsVO; |
| | | import com.sinata.system.domain.MwCollectRecord; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.sinata.system.domain.dto.CollectCarTotalUpDto; |
| | | import com.sinata.system.domain.dto.CollectDto; |
| | | import com.sinata.system.domain.dto.CollectTotalUpDto; |
| | | import com.sinata.system.domain.query.DisposalReportQuery; |
| | | import com.sinata.system.domain.query.MwCollectRecordQuery; |
| | | import com.sinata.system.domain.vo.DepartmentTagInfoVO; |
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | List<MwCollectRecordVO> getExportList(@Param("query") MwCollectRecordQuery query, @Param("treeCode") String treeCode); |
| | | |
| | | List<CollectDto> getGroup(@Param("boxNumber")String boxNumber,@Param("departmentId")Long departmentId); |
| | | List<CollectDto> getGroup1(@Param("boxNumber")String boxNumber,@Param("departmentId")Long departmentId); |
| | | List<CollectDto> getGroup2(@Param("boxNumber")String boxNumber,@Param("departmentId")Long departmentId); |
| | | List<CollectDto> getGroup3(@Param("boxNumber")String boxNumber,@Param("departmentId")Long departmentId,@Param("carId")Long carId); |
| | | List<CollectDto> getGroupWithStatus(@Param("boxNumber")String boxNumber, @Param("departmentId")Long departmentId, @Param("status")Integer status); |
| | | |
| | | |
| | | List<CollectTotalUpDto> collectTotal(@Param("date")LocalDate date,@Param("departmentId")Long departmentId); |
| | | List<CollectTotalUpDto> collectTotal3(@Param("departmentId")Long departmentId); |
| | | List<CollectTotalUpDto> collectTotal1(@Param("date")LocalDate date,@Param("checkOutUserId")Long checkOutUserId,@Param("id") Long id); |
| | | |
| | | List<CollectCarTotalUpDto> carGroup(@Param("carId")Long carId,@Param("name") String name); |
| | | |
| | | /** |
| | | * 监管报表医疗废物产生列表 |
| | | * |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.system.domain.MwCheckoutRecord; |
| | | import com.sinata.system.domain.dto.CollectTotalUpDto; |
| | | import com.sinata.system.domain.query.CheckoutRecordQuery; |
| | | import com.sinata.system.domain.query.DisposalReportQuery; |
| | | import com.sinata.system.domain.query.MwCheckoutRecordItemQuery; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | List<MwCollectRecordVO> getRegulationReportList(DisposalReportQuery query); |
| | | |
| | | List<CollectTotalUpDto> totalUp(LocalDate date, Long departmentId); |
| | | List<CollectTotalUpDto> totalUp4(Long departmentId); |
| | | List<CollectTotalUpDto> totalUp2(LocalDate date1,LocalDate date2, Long departmentId); |
| | | List<CollectTotalUpDto> totalUp5(Long departmentId); |
| | | List<CollectTotalUpDto> totalUp3(LocalDate date1,LocalDate date2, Long departmentId); |
| | | List<CollectTotalUpDto> totalUp1(Long outId); |
| | | List<CollectTotalUpDto> totalUp6(Long outId); |
| | | |
| | | /** |
| | | * 车辆转运异常预警 |
| | | * |
| | |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.system.domain.MedicalWasteStaticsVO; |
| | | import com.sinata.system.domain.MwCollectRecord; |
| | | import com.sinata.system.domain.dto.CollectCarTotalUpDto; |
| | | import com.sinata.system.domain.dto.CollectDto; |
| | | import com.sinata.system.domain.dto.CollectTotalUpDto; |
| | | import com.sinata.system.domain.dto.MwCollectRecordDTO; |
| | | import com.sinata.system.domain.query.DisposalReportQuery; |
| | | import com.sinata.system.domain.query.MwCollectRecordQuery; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @param dto |
| | | */ |
| | | void edit(MwCollectRecordDTO dto); |
| | | List<CollectDto> getGroup(String boxNumber,Long departmentId); |
| | | List<CollectDto> getGroupWithStatus(String boxNumber,Long departmentId,Integer status); |
| | | List<CollectDto> getGroup1(String boxNumber,Long departmentId); |
| | | List<CollectDto> getGroup2(String boxNumber,Long departmentId); |
| | | List<CollectDto> getGroup3(String boxNumber,Long departmentId,Long carId); |
| | | |
| | | /** |
| | | * 流转过程 |
| | |
| | | */ |
| | | void export(MwCollectRecordQuery query, HttpServletResponse response) throws IOException; |
| | | |
| | | List<CollectTotalUpDto> collectTotal(LocalDate date,Long departmentId); |
| | | List<CollectTotalUpDto> collectTotal3(Long departmentId); |
| | | List<CollectTotalUpDto> collectTotal1(LocalDate date,Long checkOutUserId,Long hospitalId); |
| | | |
| | | List<CollectCarTotalUpDto> carGroup(Long carId,String name); |
| | | |
| | | /** |
| | | * 监管报表医疗废物产生列表 |
| | | * |
| | |
| | | * @return |
| | | */ |
| | | PageDTO<MwMonitorDeviceVO> pageMonitorPage(MwMonitorDeviceQuery query); |
| | | PageDTO<MwMonitorDeviceVO> pageMonitorPage1(MwMonitorDeviceQuery query); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<SysDepartmentVO> getRegionTree(String keyword); |
| | | List<SysDepartmentVO> getRegionTree1(String keyword); |
| | | List<SysDepartmentVO> getRegionTree2(String keyword); |
| | | |
| | | /** |
| | | * 当前登录用户所在区域 |
| | |
| | | import com.sinata.common.utils.DateUtils; |
| | | import com.sinata.common.utils.StringUtils; |
| | | import com.sinata.system.domain.MwCheckoutRecord; |
| | | import com.sinata.system.domain.dto.CollectTotalUpDto; |
| | | import com.sinata.system.domain.query.CheckoutRecordQuery; |
| | | import com.sinata.system.domain.query.DisposalReportQuery; |
| | | import com.sinata.system.domain.query.MwCheckoutRecordItemQuery; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDate; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | FastExcel.write(response.getOutputStream(), MwCheckoutRecordExcelVO.class).sheet("转运记录").doWrite(mwCheckoutRecordExcelVOS); |
| | | } |
| | | |
| | | @Override |
| | | public List<CollectTotalUpDto> totalUp(LocalDate date, Long departmentId) { |
| | | return this.baseMapper.totalUp(date,departmentId); |
| | | } |
| | | @Override |
| | | public List<CollectTotalUpDto> totalUp4(Long departmentId) { |
| | | return this.baseMapper.totalUp4(departmentId); |
| | | } |
| | | @Override |
| | | public List<CollectTotalUpDto> totalUp2(LocalDate date1,LocalDate date2, Long departmentId) { |
| | | return this.baseMapper.totalUp2(date1,date2,departmentId); |
| | | } |
| | | @Override |
| | | public List<CollectTotalUpDto> totalUp5( Long departmentId) { |
| | | return this.baseMapper.totalUp5(departmentId); |
| | | } |
| | | @Override |
| | | public List<CollectTotalUpDto> totalUp3(LocalDate date1,LocalDate date2, Long departmentId) { |
| | | return this.baseMapper.totalUp3(date1,date2,departmentId); |
| | | } |
| | | @Override |
| | | public List<CollectTotalUpDto> totalUp1( Long outId) { |
| | | return this.baseMapper.totalUp1(outId); |
| | | } |
| | | |
| | | @Override |
| | | public List<CollectTotalUpDto> totalUp6( Long outId) { |
| | | return this.baseMapper.totalUp6(outId); |
| | | } |
| | | /** |
| | | * 转运记录详情 |
| | | * |
| | |
| | | import com.sinata.common.utils.StringUtils; |
| | | import com.sinata.system.domain.MedicalWasteStaticsVO; |
| | | import com.sinata.system.domain.MwCollectRecord; |
| | | import com.sinata.system.domain.dto.CollectCarTotalUpDto; |
| | | import com.sinata.system.domain.dto.CollectDto; |
| | | import com.sinata.system.domain.dto.CollectTotalUpDto; |
| | | import com.sinata.system.domain.dto.MwCollectRecordDTO; |
| | | import com.sinata.system.domain.query.DisposalReportQuery; |
| | | import com.sinata.system.domain.query.MwCollectRecordQuery; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDate; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<CollectDto> getGroup(String boxNumber,Long departmentId) { |
| | | return this.baseMapper.getGroup(boxNumber,departmentId); |
| | | } |
| | | @Override |
| | | public List<CollectDto> getGroupWithStatus(String boxNumber,Long departmentId,Integer status) { |
| | | return this.baseMapper.getGroupWithStatus(boxNumber,departmentId,status); |
| | | } |
| | | |
| | | @Override |
| | | public List<CollectDto> getGroup1(String boxNumber,Long departmentId) { |
| | | return this.baseMapper.getGroup1(boxNumber,departmentId); |
| | | } |
| | | @Override |
| | | public List<CollectDto> getGroup2(String boxNumber,Long departmentId) { |
| | | return this.baseMapper.getGroup2(boxNumber,departmentId); |
| | | } |
| | | @Override |
| | | public List<CollectDto> getGroup3(String boxNumber,Long departmentId,Long carId) { |
| | | return this.baseMapper.getGroup3(boxNumber,departmentId,carId); |
| | | } |
| | | /** |
| | | * 流转过程 |
| | | * |
| | |
| | | return baseMapper.getRegulationReportList(query, treeCode); |
| | | } |
| | | |
| | | @Override |
| | | public List<CollectTotalUpDto> collectTotal(LocalDate date,Long departmentId) { |
| | | return baseMapper.collectTotal(date,departmentId); |
| | | } |
| | | @Override |
| | | public List<CollectTotalUpDto> collectTotal3(Long departmentId) { |
| | | return baseMapper.collectTotal3(departmentId); |
| | | } |
| | | @Override |
| | | public List<CollectTotalUpDto> collectTotal1(LocalDate date,Long checkOutUserId,Long id ) { |
| | | return baseMapper.collectTotal1(date,checkOutUserId,id); |
| | | } |
| | | |
| | | @Override |
| | | public List<CollectCarTotalUpDto> carGroup(Long carId,String name) { |
| | | return this.baseMapper.carGroup(carId,name); |
| | | } |
| | | |
| | | /** |
| | | * 查询日产废记录 |
| | | * |
| | |
| | | }); |
| | | return PageDTO.of(page); |
| | | } |
| | | |
| | | @Override |
| | | public PageDTO<MwMonitorDeviceVO> pageMonitorPage1(MwMonitorDeviceQuery query) { |
| | | query.setPageCurr(1); |
| | | query.setPageSize(999999999); |
| | | //获取视频服务器中的在线设备列表 |
| | | List<String> deviceList = monitorDeviceApiNewService.getDeviceList(); |
| | | String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId()); |
| | | if (StringUtils.isBlank(treeCode)) { |
| | | return PageDTO.empty(0L, 0L); |
| | | } |
| | | Page<MwMonitorDeviceVO> page = baseMapper.pageMonitorPage(new Page<>(query.getPageCurr(), query.getPageSize()), query.getStatus(), treeCode, deviceList); |
| | | page.getRecords().stream().filter(item -> deviceList.contains(item.getDeviceNumber())).peek(item -> { |
| | | item.setStatus(1); |
| | | }); |
| | | return PageDTO.of(page); |
| | | } |
| | | } |
| | |
| | | package com.sinata.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.sinata.common.constant.CacheConstants; |
| | | import com.sinata.common.core.domain.entity.SysUser; |
| | | import com.sinata.common.entity.PageDTO; |
| | | import com.sinata.common.exception.ServiceException; |
| | | import com.sinata.common.utils.BeanUtils; |
| | |
| | | } |
| | | return root; |
| | | } |
| | | @Override |
| | | public List<SysDepartmentVO> getRegionTree1(String keyword) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | |
| | | List<SysDepartmentVO> root = new ArrayList<>(); |
| | | SysDepartment sysDepartment = this.baseMapper.selectById(sysUser.getDepartmentId()); |
| | | SysDepartment currentDepartment = this.baseMapper.selectById(sysDepartment.getParentId()); |
| | | 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; |
| | | } |
| | | 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; |
| | | } |
| | | |
| | | /** |
| | | * 获取当前登录用户所属区域 |
| | |
| | | </where> |
| | | GROUP BY mcr.DEPARTMENT_ID |
| | | </select> |
| | | <select id="totalUp" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | 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> |
| | | GROUP BY WASTE_TYPE |
| | | </select> |
| | | |
| | | <select id="totalUp4" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | 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> |
| | | GROUP BY WASTE_TYPE |
| | | </select> |
| | | |
| | | |
| | | <select id="totalUp2" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | 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"> |
| | | AND TRUNC(RECEIVE_TIME, 'DAY') >= TO_DATE(#{date1},'YYYY-MM-DD') |
| | | </if> |
| | | <if test="date2 != null"> |
| | | AND TRUNC(RECEIVE_TIME, 'DAY') < TO_DATE(#{date2},'YYYY-MM-DD') |
| | | </if> |
| | | |
| | | </where> |
| | | GROUP BY WASTE_TYPE |
| | | </select> |
| | | |
| | | <select id="totalUp5" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | 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,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"> |
| | | AND TRUNC(DISPOSAL_TIME, 'DAY') >= TO_DATE(#{date1},'YYYY-MM-DD') |
| | | </if> |
| | | <if test="date2 != null"> |
| | | AND TRUNC(DISPOSAL_TIME, 'DAY') < TO_DATE(#{date2},'YYYY-MM-DD') </if> |
| | | </where> |
| | | GROUP BY WASTE_TYPE |
| | | </select> |
| | | |
| | | <select id="totalUp1" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | 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 t1.CHECKOUT_RECORD_ID = #{outId} |
| | | GROUP BY t2.WASTE_TYPE |
| | | </select> |
| | | |
| | | <select id="totalUp6" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | 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_DISPOSAL_RECORD_ITEM t1 |
| | | left join MEDICAL_WASTE.MW_COLLECT_RECORD t2 on t1.COLLECT_RECORD_ID = t2.ID |
| | | where t1.DISPOSAL_RECORD_ID = #{outId} |
| | | GROUP BY t2.WASTE_TYPE |
| | | </select> |
| | | <select id="getCheckoutRecordList" resultMap="TransformVOMap"> |
| | | SELECT MCR.ID, |
| | | MCR.CHECKOUT_TIME, |
| | |
| | | </where> |
| | | ORDER BY mcr.CREATE_TIME DESC |
| | | </select> |
| | | <select id="getGroup" resultType="com.sinata.system.domain.dto.CollectDto"> |
| | | 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 != ''"> |
| | | and BOX_NUMBER like concat('%',#{boxNumber},'%') |
| | | </if> |
| | | |
| | | </where> |
| | | GROUP BY BOX_ID |
| | | </select> |
| | | |
| | | <select id="getGroup1" resultType="com.sinata.system.domain.dto.CollectDto"> |
| | | 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 != ''"> |
| | | and BOX_NUMBER like concat('%',#{boxNumber},'%') |
| | | </if> |
| | | </where> |
| | | GROUP BY BOX_ID |
| | | </select> |
| | | |
| | | <select id="getGroup2" resultType="com.sinata.system.domain.dto.CollectDto"> |
| | | 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} |
| | | <if test="boxNumber != null and boxNumber != ''"> |
| | | and BOX_NUMBER like concat('%',#{boxNumber},'%') |
| | | </if> |
| | | </where> |
| | | GROUP BY BOX_ID |
| | | </select> |
| | | |
| | | <select id="getGroup3" resultType="com.sinata.system.domain.dto.CollectDto"> |
| | | 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} and CAR_ID = #{carId} |
| | | <if test="boxNumber != null and boxNumber != ''"> |
| | | and BOX_NUMBER like concat('%',#{boxNumber},'%') |
| | | </if> |
| | | </where> |
| | | GROUP BY BOX_ID |
| | | </select> |
| | | |
| | | |
| | | <select id="getGroupWithStatus" resultType="com.sinata.system.domain.dto.CollectDto"> |
| | | SELECT BOX_NUMBER as boxNumber, |
| | | 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> |
| | | STATUS = #{status} AND RECEIVE_DEPARTMENT_ID = #{departmentId} |
| | | <if test="boxNumber != null and boxNumber != ''"> |
| | | and BOX_NUMBER like concat('%',#{boxNumber},'%') |
| | | </if> |
| | | </where> |
| | | GROUP BY BOX_ID |
| | | </select> |
| | | |
| | | <select id="collectTotal" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | 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> |
| | | DEPARTMENT_ID = #{departmentId} |
| | | </where> |
| | | GROUP BY WASTE_TYPE |
| | | </select> |
| | | <select id="collectTotal3" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | 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> |
| | | GROUP BY WASTE_TYPE |
| | | </select> |
| | | |
| | | |
| | | <select id="collectTotal1" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | 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"> |
| | | AND TRUNC(CHECKOUT_TIME, 'DAY') = TO_DATE(#{date},'YYYY-MM-DD') |
| | | </if> |
| | | <if test="id != null "> |
| | | and DEPARTMENT_ID = #{id} |
| | | </if> |
| | | </where> |
| | | GROUP BY WASTE_TYPE |
| | | </select> |
| | | |
| | | <select id="carGroup" resultType="com.sinata.system.domain.dto.CollectCarTotalUpDto"> |
| | | SELECT t3.DEPARTMENT_ID as hospitalId, |
| | | 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 |
| | | FROM MEDICAL_WASTE.MW_COLLECT_RECORD t3 |
| | | <where> |
| | | t3.CAR_ID = #{carId} |
| | | <if test="name != null and name != ''"> |
| | | AND t3.HOSPITAL_NAME LIKE CONCAT(#{name},'%') |
| | | </if> |
| | | </where> |
| | | GROUP BY t3.HOSPITAL_NAME |
| | | |
| | | </select> |
| | | <select id="getRegulationReportList" resultType="com.sinata.system.domain.vo.MwCollectRecordVO"> |
| | | SELECT MCR.ID, |
| | | MCR.DEPARTMENT_ID, |