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); |
| | | } |
| | | } |
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.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.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) { |
| | | return R.ok(sysDepartmentService.getRegionTree(keyword)); |
| | | } |
| | | |
| | | /** |
| | | * 获取区域树 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取全部/区域/医疗机构/处置单位/监管单位树-搜索框用", notes = "0:全部 1:区域 2:医疗机构 3:处置单位 4:监管单位") |
| | | @PostMapping("/departmentSearchTree") |
| | | @ApiImplicitParam(name = "type", value = "查询类型", required = true) |
| | | public R<List<SysDepartmentVO>> getDepartmentSearchTree(@RequestParam(value = "type", required = true) @NotNull(message = "类型不能为空") Integer type) { |
| | | return R.ok(sysDepartmentService.listByType(type)); |
| | | } |
| | | |
| | | @ApiOperation("获取医院监管列表") |
| | | @PostMapping("/hospita/list") |
| | | public R<List<SysDepartment>> list(String name) { |
| | | List<SysDepartment> list = sysDepartmentService.lambdaQuery().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()).eq(MwCollectRecord::getStatus, 3).groupBy(MwCollectRecord::getBoxNumber).count(); |
| | | //获取接收数量 |
| | | Long count2 = collectRecordService.lambdaQuery().eq(MwCollectRecord::getReceiveTime,now).eq(MwCollectRecord::getReceiveDepartmentId, sysDepartment.getId()).eq(MwCollectRecord::getStatus, 3).groupBy(MwCollectRecord::getBoxNumber).count(); |
| | | //获取处置数量 |
| | | Long count3 = collectRecordService.lambdaQuery().eq(MwCollectRecord::getReceiveTime,now).eq(MwCollectRecord::getReceiveDepartmentId, sysDepartment.getId()).eq(MwCollectRecord::getStatus, 4).groupBy(MwCollectRecord::getBoxNumber).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(value = "医院转运记录") |
| | | @PostMapping("/trans") |
| | | public R<List<CheckOutDto>> trans(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") |
| | | public R<List<CollectTotalUpDto>> outtotal1(@ApiParam("处置机构id")@RequestParam Long departmentId) { |
| | | return R.ok(mwCheckoutRecordService.totalUp5(departmentId)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | 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.sinata.common.constant.Constants; |
| | | import com.sinata.common.core.domain.AjaxResult; |
| | | import com.sinata.common.core.domain.R; |
| | |
| | | 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.service.ISysMenuService; |
| | | import com.sinata.system.service.ISysRoleService; |
| | | 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.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; |
| | | |
| | | /** |
| | |
| | | |
| | | @Resource |
| | | private SysDepartmentService departmentService; |
| | | @Resource |
| | | private AliSmsService aliSmsService; |
| | | |
| | | |
| | | @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); |
| | | |
| | | } |
| | | /** |
| | | * 登录方法 |
| | | * |
| | |
| | | public R<UserInfoDTO> user() |
| | | { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | Set<String> roles = permissionService.getRolePermission(user); |
| | | SysDepartment byId2 = departmentService.getById(user.getDepartmentId()); |
| | | UserInfoDTO userInfoDTO = new UserInfoDTO(); |
| | | userInfoDTO.setNickName(user.getNickName()); |
| | | userInfoDTO.setRoles(roles); |
| | | userInfoDTO.setDepartment(byId2); |
| | | return R.ok(userInfoDTO); |
| | | } |
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.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<PageDTO<MwMonitorDeviceVO>> monitorPageList(@Valid @RequestBody MwMonitorDeviceQuery query) { |
| | | return R.ok(mwMonitorDeviceService.pageMonitorPage(query)); |
| | | } |
| | | |
| | | /** |
| | | * 获取视频服务器设备播放路径 |
| | | * |
| | | * @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)); |
| | | } |
| | | } |
| | |
| | | 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.vo.MwCheckoutRecordVO; |
| | | import com.sinata.system.domain.vo.MwMedicalWasteBoxVO; |
| | | import com.sinata.system.domain.vo.MwTransitRecordVO; |
| | | import com.sinata.system.service.ISysUserService; |
| | | import com.sinata.system.service.MwCheckoutRecordService; |
| | | import com.sinata.system.service.MwTransitCarService; |
| | | import com.sinata.system.service.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | |
| | | private final MwCheckoutRecordService mwCheckoutRecordService; |
| | | private final ISysUserService userService; |
| | | private final MwTransitCarService carService; |
| | | private final MwDisposalRecordService disposalRecordService; |
| | | private final MwDisposalHandleRecordService handleRecordService; |
| | | |
| | | |
| | | @ApiOperation(value = "出库统计上") |
| | |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | return R.ok(mwCheckoutRecordService.totalUp(date,sysUser.getDepartmentId())); |
| | | } |
| | | |
| | | @ApiOperation(value = "接收统计上",tags = "处置人员") |
| | | @PostMapping("/out/total") |
| | | public R<List<CollectTotalUpDto>> outtotal(@ApiParam("日期1") LocalDate date1,@ApiParam("日期2")LocalDate date2) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | return R.ok(mwCheckoutRecordService.totalUp2(date1,date2,sysUser.getUserId())); |
| | | } |
| | | @ApiOperation(value = "接收统计下",tags = "处置人员") |
| | | @PostMapping("/out/record") |
| | | public R<List<CheckOutDto>> record1(@ApiParam("日期1") LocalDate date1,@ApiParam("日期2")LocalDate date2) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | LocalDate now = LocalDate.now(); |
| | | List<MwDisposalRecord> list = disposalRecordService.lambdaQuery().ge(date1!=null,MwDisposalRecord::getReceiveTime, date1).le(date2!=null,MwDisposalRecord::getReceiveTime,date2).eq(MwDisposalRecord::getDepartmentId, sysUser.getDepartmentId()).orderByDesc(MwDisposalRecord::getReceiveTime).list(); |
| | | 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.totalUp1(mwCheckoutRecord.getId()); |
| | | checkOutDto.setRecords(records); |
| | | backList.add(checkOutDto); |
| | | } |
| | | return R.ok(backList); |
| | | } |
| | | |
| | | @ApiOperation(value = "处置统计上",tags = "处置人员") |
| | | @PostMapping("/end/total") |
| | | public R<List<CollectTotalUpDto>> outtotal1(@ApiParam("日期1") LocalDate date1,@ApiParam("日期2")LocalDate date2) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | return R.ok(mwCheckoutRecordService.totalUp2(date1,date2,sysUser.getUserId())); |
| | | } |
| | | |
| | | @ApiOperation(value = "接收统计下",tags = "处置人员") |
| | | @PostMapping("/end/record") |
| | | public R<List<CheckOutDto>> record2(@ApiParam("日期1") LocalDate date1,@ApiParam("日期2")LocalDate date2) { |
| | | 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() { |
| | |
| | | private final SysDepartmentService departmentService; |
| | | private final MwDisposalRecordService disposalRecordService; |
| | | private final MwDisposalRecordItemService disposalRecordItemService; |
| | | private final MwDisposalHandleRecordService disposalHandleRecordService; |
| | | private final MwDisposalHandleRecordItemService disposalHandleRecordItemService; |
| | | |
| | | |
| | | @ApiOperation("新增医废记录") |
| | |
| | | for (MwCollectRecord mwCollectRecord : list) { |
| | | mwCollectRecord.setStatus(2); |
| | | mwCollectRecord.setCheckoutUserId(sysUser.getUserId()); |
| | | mwCollectRecord.setDriverId(sysUser.getUserId()); |
| | | mwCollectRecord.setCarId(sysUser.getCarId()); |
| | | boxes.add(mwCollectRecord.getBoxNumber()); |
| | | sum= sum.add(mwCollectRecord.getWeight()); |
| | | } |
| | |
| | | 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.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<>(); |
| | |
| | | public R<List<CollectDto>> list2(String boxNumber) { |
| | | SysUser sysUser = SecurityUtils.getLoginUser().getUser(); |
| | | SysDepartment byId = departmentService.getById(sysUser.getDepartmentId()); |
| | | List<MwCollectRecord> list = collectRecordService.lambdaQuery().eq(MwCollectRecord::getStatus, 3).eq(MwCollectRecord::getBoxNumber, boxNumber).list(); |
| | | |
| | | //新增处置记录 |
| | | 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); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | @AllArgsConstructor |
| | | public class AppMwWarningRecordController { |
| | | private final MwWarningRecordService mwWarningRecordService; |
| | | private final SysDepartmentService sysDepartmentService; |
| | | |
| | | @ApiOperation("预警记录") |
| | | @PostMapping("/record") |
| | |
| | | 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); |
| | | } |
| | | |
| | | } |
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.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; |
| | | } |
| | | } |
| | |
| | | |
| | | 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; |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 登录验证 |
| | |
| | | LoginUser loginUser = new LoginUser(); |
| | | loginUser.setUserId(one.getUserId()); |
| | | loginUser.setUser(one); |
| | | |
| | | // 生成token |
| | | return loginUser; |
| | | } |
| | |
| | | @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("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; |
| | | |
| | | |
| | | |
| | |
| | | @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") |
| | |
| | | @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; |
| | | } |
| | |
| | | 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; |
| | |
| | | |
| | | @ApiModelProperty("运输人员姓名") |
| | | private String driverName; |
| | | @ApiModelProperty("出库时间") |
| | | @ApiModelProperty("出库时间/接收时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date checkoutTime; |
| | | @ApiModelProperty("车牌号") |
| | | private String licensePlateNumber; |
| | |
| | | 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> 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); |
| | |
| | | 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); |
| | | } |
| | |
| | | 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); |
| | |
| | | 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); |
| | | } |
| | |
| | | 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); |
| | | } |
| | |
| | | </where> |
| | | GROUP BY WASTE_TYPE |
| | | </select> |
| | | |
| | | <select id="totalUp4" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | SELECT WASTE_TYPE as wasteType,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | <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,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | <where> |
| | | RECEIVE_USER_ID is not null AND RECEIVE_USER_ID = #{departmentId} |
| | | <if test="date1 != null"> |
| | | DATE(RECEIVE_TIME) >= #{date1} |
| | | </if> |
| | | <if test="date2 != null"> |
| | | DATE(RECEIVE_TIME) <= #{date2} |
| | | </if> |
| | | |
| | | </where> |
| | | GROUP BY WASTE_TYPE |
| | | </select> |
| | | |
| | | <select id="totalUp5" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | SELECT WASTE_TYPE as wasteType,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | <where> |
| | | RECEIVE_DEPARTMENT_ID is not null AND RECEIVE_DEPARTMENT_ID = #{departmentId} |
| | | </where> |
| | | GROUP BY WASTE_TYPE |
| | | </select> |
| | | <select id="totalUp3" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | SELECT WASTE_TYPE as wasteType,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | <where> |
| | | DISPOSAL_USER_ID is not null AND DISPOSAL_USER_ID = #{departmentId} |
| | | <if test="date1 != null"> |
| | | DATE(DISPOSAL_TIME) >= #{date1} |
| | | </if> |
| | | <if test="date2 != null"> |
| | | DATE(DISPOSAL_TIME) <= #{date2} |
| | | </if> |
| | | |
| | | </where> |
| | | GROUP BY WASTE_TYPE |
| | | </select> |
| | | |
| | | <select id="totalUp1" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | SELECT t2.WASTE_TYPE as wasteType,COUNT(DISTINCT t2.BOX_NUMBER ) as boxNum ,COUNT(t2.ID)as num,sum(t2.WEIGHT) as weight |
| | | from MEDICAL_WASTE.MW_CHECKOUT_RECORD_ITEM t1 |
| | |
| | | </where> |
| | | GROUP BY WASTE_TYPE |
| | | </select> |
| | | <select id="collectTotal3" resultType="com.sinata.system.domain.dto.CollectTotalUpDto"> |
| | | SELECT WASTE_TYPE as wasteType,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |
| | | <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,COUNT(DISTINCT BOX_NUMBER ) as boxNum ,COUNT(1)as num,sum(WEIGHT) as weight from MEDICAL_WASTE.MW_COLLECT_RECORD |