Merge remote-tracking branch 'origin/master'
| | |
| | | import com.mchange.v2.beans.BeansUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.models.auth.In; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | platformJobService.signIn(signInDTO); |
| | | return ApiResponse.success("操作成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("手动完成作业") |
| | | @PostMapping("/dealJobFinish") |
| | | public ApiResponse dealJobFinish (@RequestBody List<Integer> list, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | platformJobService.dealJobFinish(list); |
| | | return ApiResponse.success("操作成功"); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 2025-3-25 14:14:34 加入取消预约 待审批、审批中、已审批 |
| | | * @param visitId |
| | | * @return |
| | | */ |
| | | @ApiOperation("取消预约") |
| | | @GetMapping("/visitsSelfCancel") |
| | | public ApiResponse visitsSelfCancel(@RequestParam Integer visitId,@RequestParam Integer memberId){ |
| | | if(Objects.isNull(memberId)){ |
| | | memberId = Constants.ZERO; |
| | | } |
| | | visitsService.visitsSelfCancel(visitId,memberId); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | |
| | | thing2.put("value",platformJob.getDriverName()); |
| | | //签到时间 |
| | | Map<String, Object> time5 = new HashMap<String,Object>(); |
| | | time5.put("value", DateUtil.getFomartDate(platformJob.getSignDate(),"yyyy年MM月dd日 HH:mm:ss")); |
| | | time5.put("value", DateUtil.getFomartDate(new Date(),"yyyy年MM月dd日 HH:mm:ss")); |
| | | |
| | | dataMap.put("car_number1",car_number1); |
| | | dataMap.put("thing2",thing2); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=90_8_a3QDclSc8HTcbgXhSVnijiQdRf4dG5wme29riDIyt3UIi7FpZ_HJyqyEIY-_e2A29jH2fLBKgtuBKtq-cy7DteFg5l9EawoxAwiRis8BMnEl-u01ITtCUVU90XCIjADASXD"; |
| | | //整体参数map |
| | | Map<String, Object> paramMap = new HashMap<String, Object>(); |
| | | //消息主题显示相关map |
| | | Map<String, Object> dataMap = new HashMap<String, Object>(); |
| | | //车牌号 |
| | | Map<String, Object> car_number1 = new HashMap<String,Object>(); |
| | | car_number1.put("value","皖A12345"); |
| | | //司机姓名 |
| | | Map<String, Object> thing2 = new HashMap<String,Object>(); |
| | | thing2.put("value","小阿武"); |
| | | //签到时间 |
| | | Map<String, Object> time5 = new HashMap<String,Object>(); |
| | | time5.put("value", DateUtil.getFomartDate(new Date(),"yyyy年MM月dd日 HH:mm:ss")); |
| | | |
| | | dataMap.put("car_number1",car_number1); |
| | | dataMap.put("thing2",thing2); |
| | | dataMap.put("time5",time5); |
| | | paramMap.clear(); |
| | | paramMap.put("template_id", "ZYhHg5eJJim0LR3FLVaqKcVqW3p8GQk8qrTO40ffHXI"); |
| | | paramMap.put("touser", "ovmre6RUJJZCDtCyLxWYKSMgt7u8"); |
| | | paramMap.put("data", dataMap); |
| | | String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(paramMap)); |
| | | log.error("·==++--·推送微信模板信息内容:{}", JSONObject.toJSONString(paramMap)); |
| | | if(StringUtils.isBlank(response)){ |
| | | log.error("·==++--·推送微信模板信息:{}·--++==·", "失败"); |
| | | }else{ |
| | | JSONObject json = JSONObject.parseObject(response); |
| | | log.error("·==++--·推送微信模板信息:{}·--++==·", Constants.equalsInteger(json.getInteger("errcode"),Constants.ZERO)?"成功":"失败"+json.getString("errmsg")); |
| | | } |
| | | } |
| | | |
| | | public void sendUnFinishNotice(WxNoticeConfigMapper wxNoticeConfigMapper,Integer unFinishNum,String objCode,String token, |
| | | List<String> openIds){ |
| | | try{ |
| | |
| | | */ |
| | | void sendUnFinishNotice(); |
| | | |
| | | void dealJobFinish(List<Integer> jobIdList); |
| | | } |
| | |
| | | * 处理待审核、审核中、已审核的数据取消业务 |
| | | * 2025年3月25日14:10:10 |
| | | */ |
| | | void visitsSelfCancel(Integer visitId,Integer memberId); |
| | | void visitsCancel(Integer visitId,LoginUserInfo loginUserInfo); |
| | | void resetPassword(ResetPasswordDTO resetPasswordDTO); |
| | | |
| | |
| | | savePlatformLog(Constants.PlatformJobLogType.SIGN.getKey(),oldPlatformJob,platformJob, |
| | | Constants.PlatformJobLogType.SIGN.getInfo()); |
| | | //签到微信通知 2025年3月26日14:25:00 |
| | | if(!Constants.equalsInteger(platformJob.getSingType(),Constants.TWO)&&StringUtils.isNotBlank(platformGroup.getSignInNoticeUsers())){ |
| | | logger.info("签到微信通知=========================>开始====签到类型=>"+signInDTO.getSignType()+"===>人员主键=>"+platformGroup.getSignInNoticeUsers()); |
| | | if(!Constants.equalsInteger(signInDTO.getSignType(),Constants.TWO)&& |
| | | StringUtils.isNotBlank(platformGroup.getSignInNoticeUsers())){ |
| | | logger.info("签到微信通知=========================>进入"); |
| | | List<SystemUser> systemUserList = systemUserMapper.selectList(new QueryWrapper<SystemUser>().lambda() |
| | | .eq(SystemUser::getDeleted,Constants.ZERO).eq(SystemUser::getStatus,Constants.ZERO).isNotNull(SystemUser::getOpenid) |
| | | .in(SystemUser::getId,Arrays.asList(platformGroup.getSignInNoticeUsers().split(","))) |
| | | .in(SystemUser::getMemberId,Arrays.asList(platformGroup.getSignInNoticeUsers().split(","))) |
| | | ); |
| | | if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(systemUserList)) { |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | |
| | | ); |
| | | } |
| | | } |
| | | logger.info("签到微信通知=========================>结束"); |
| | | } |
| | | |
| | | |
| | |
| | | if(Objects.nonNull(platformGroup)){ |
| | | List<SystemUser> systemUserList = systemUserMapper.selectList(new QueryWrapper<SystemUser>().lambda() |
| | | .eq(SystemUser::getDeleted,Constants.ZERO).eq(SystemUser::getStatus,Constants.ZERO).isNotNull(SystemUser::getOpenid) |
| | | .in(SystemUser::getId,Arrays.asList(platformGroup.getUnFinishNoticeUsers().split(","))) |
| | | .in(SystemUser::getMemberId,Arrays.asList(platformGroup.getUnFinishNoticeUsers().split(","))) |
| | | ); |
| | | if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(systemUserList)) { |
| | | WxPlatNotice wxPlatNotice = new WxPlatNotice(); |
| | |
| | | platformJob.setPlatformName(platform.getName()); |
| | | this.broadcastAndLEed(platformJob, |
| | | //Constants.PlatformLedContent.DONE.getInfo(), |
| | | Constants.PlatformLedContent.IDEL_CONTNET.getInfo(), |
| | | StringUtils.isBlank(platform.getLedContent())?Constants.PlatformLedContent.IDEL_CONTNET.getInfo():platform.getLedContent(), |
| | | Constants.PlatformBroadcastContent.DONE.getInfo()); |
| | | return platformJob; |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 手动完成作业 |
| | | * @param jobIdList |
| | | */ |
| | | @Override |
| | | public void dealJobFinish(List<Integer> jobIdList){ |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(jobIdList)){ |
| | | List<PlatformJob> platformJobList = platformJobMapper.selectList(new QueryWrapper<PlatformJob>().lambda() |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .in(PlatformJob::getStatus,Constants.PlatformJobStatus.WAIT_CONFIRM,Constants.PlatformJobStatus.WART_SIGN_IN) |
| | | .in(PlatformJob::getId,jobIdList) |
| | | ); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platformJobList)){ |
| | | |
| | | platformJobMapper.update(null,new UpdateWrapper<PlatformJob>().lambda() |
| | | .set(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey()) |
| | | .set(PlatformJob::getDoneDate,new Date()) |
| | | .in(PlatformJob::getStatus,Constants.PlatformJobStatus.WAIT_CONFIRM,Constants.PlatformJobStatus.WART_SIGN_IN) |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .in(PlatformJob::getId,platformJobList.stream().map(i->i.getId()).collect(Collectors.toList()))); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | public List<VisitReason> findList(VisitReason visitReason) { |
| | | QueryWrapper<VisitReason> wrapper = new QueryWrapper<>(visitReason); |
| | | wrapper.eq("isdeleted",Constants.ZERO); |
| | | wrapper.orderByAsc("sortnum"); |
| | | return visitReasonMapper.selectList(wrapper); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void visitsSelfCancel(Integer visitId,Integer memberId){ |
| | | Visits visits = visitsMapper.selectById(visitId); |
| | | if(Objects.isNull(visits)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!(Constants.equalsInteger(memberId,visits.getMemberId()))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"无此操作权限"); |
| | | } |
| | | this.visitsCancelBiz(visits); |
| | | } |
| | | |
| | | /** |
| | | * 处理待审核、审核中、已审核的数据取消业务 |
| | | * 2025年3月25日14:10:10 |
| | | */ |
| | | @Override |
| | | public void visitsCancel(Integer visitId,LoginUserInfo loginUserInfo){ |
| | | Visits visits = visitsMapper.selectById(visitId); |
| | | if(Objects.isNull(visits)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!(Constants.equalsInteger(loginUserInfo.getMemberId(),visits.getMemberId()) || |
| | | Constants.equalsInteger(loginUserInfo.getMemberId(),visits.getCreateMemberId()) || |
| | | ( CollectionUtils.isNotEmpty(loginUserInfo.getPermissions()) && |
| | | loginUserInfo.getPermissions().stream().filter(i->i.equals("business:visits:cancel")).collect(Collectors.toList()).size()>0))){ |
| | | if(!( |
| | | CollectionUtils.isNotEmpty(loginUserInfo.getPermissions()) && |
| | | loginUserInfo.getPermissions().stream().filter(i->i.equals("business:visits:cancel")).collect(Collectors.toList()).size()>0)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"无此操作权限"); |
| | | } |
| | | this.visitsCancelBiz(visits); |
| | | } |
| | | /** |
| | | * 处理待审核、审核中、已审核的数据取消业务 |
| | | * 2025年3月25日14:10:10 |
| | | */ |
| | | public void visitsCancelBiz(Visits visits){ |
| | | UpdateWrapper<Visits> updateWrapper = new UpdateWrapper(); |
| | | updateWrapper.lambda().set(Visits::getStatus,Constants.VisitStatus.cancel) |
| | | .set(Visits::getEditDate,DateUtil.getCurrDateTime()) |
| | | .set(Visits::getEditor,loginUserInfo.getId()) |
| | | .eq(Visits::getId,visitId); |
| | | .set(Visits::getEditor,visits.getEditor()) |
| | | .eq(Visits::getId,visits.getId()); |
| | | //访客报备 |
| | | if(Constants.equalsInteger(visits.getType(),Constants.TWO)){ |
| | | if(!(Constants.equalsInteger(visits.getStatus(),Constants.VisitStatus.waitCheck)||Constants.equalsInteger(visits.getStatus(),Constants.VisitStatus.submitCheck) |
| | |
| | | .set(Notices::getInfo,"手动取消") |
| | | // .set(Notices::getStatus,Constants.ONE) |
| | | .set(Notices::getParam2,Constants.FOUR)//已取消 |
| | | .eq(Notices::getIsdeleted,Constants.ZERO) |
| | | .eq(Notices::getStatus,Constants.ZERO) |
| | | .eq(Notices::getParam2,Constants.ZERO)//待处理 |
| | | .eq(Notices::getObjId,visits.getId()) |
| | |
| | | .set(Notices::getEditDate,new Date()) |
| | | .set(Notices::getInfo,info) |
| | | .set(Notices::getParam2,Constants.FOUR)//已取消 |
| | | .eq(Notices::getIsdeleted,Constants.ZERO) |
| | | .eq(Notices::getStatus,Constants.ZERO) |
| | | .eq(Notices::getParam2,Constants.ZERO)//待处理 |
| | | .eq(Notices::getObjId,objId) |
| | |
| | | List<PlatformJob> jobs = platformJobMapper.selectList (new MPJLambdaWrapper<PlatformJob>() |
| | | .select(PlatformJob::getTotalNum) |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .eq(PlatformJob::getOrigin,Constants.ZERO) |
| | | .apply(" ( origin = 0 or origin is null) ") |
| | | .eq(PlatformJob::getPlatformGroupId,platformGroupId) |
| | | .apply("to_days(done_date) = to_days(now())") |
| | | .in(PlatformJob::getStatus, Constants.PlatformJobStatus.DONE.getKey() |
| | |
| | | Constants.PlatformJobStatus.LEAVED.getKey(), |
| | | Constants.PlatformJobStatus.AUTHED_LEAVE.getKey()) |
| | | .apply("year(done_date) = year('"+DateUtil.getPlusTime2(month)+"') and month(done_date) = month('"+DateUtil.getPlusTime2(month)+"') ")); |
| | | |
| | | List<PlatformJob> yearNum = platformJobMapper.selectJoinList(PlatformJob.class, |
| | | new MPJLambdaWrapper<PlatformJob>() |
| | | .selectAs(PlatformJob::getId,PlatformJob::getId) |
| | | .selectAs(PlatformJob::getTotalNum,PlatformJob::getTotalNum) |
| | | .select(PlatformJob::getStatus,PlatformJob::getStatus) |
| | | .select(PlatformJob::getType,PlatformJob::getType) |
| | | // .selectCount(PlatformJob::getPlatformId,PlatformJob::getCountum) |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .in(PlatformJob::getType,Constants.ONE,Constants.THREE) |
| | | .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey(),Constants.PlatformJobStatus.LEAVED.getKey(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey()) |
| | | .apply("year(done_date) = year('"+DateUtil.getPlusTime2(year)+"') and done_date<= now() ")); |
| | | List<PlatformJob> monthLastNum = platformJobMapper.selectJoinList(PlatformJob.class, |
| | | new MPJLambdaWrapper<PlatformJob>() |
| | | .selectAs(PlatformJob::getId,PlatformJob::getId) |
| | |
| | | .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey(),Constants.PlatformJobStatus.LEAVED.getKey(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey()) |
| | | .apply("year(done_date) = year('"+DateUtil.getPlusTime2(lastMonth)+"') and month(done_date) = month('"+DateUtil.getPlusTime2(lastMonth)+"') and done_date<= '" |
| | | +DateUtil.getPlusTime2(lastMonth)+"'")); |
| | | List<PlatformJob> yearNum = platformJobMapper.selectJoinList(PlatformJob.class, |
| | | new MPJLambdaWrapper<PlatformJob>() |
| | | .selectAs(PlatformJob::getId,PlatformJob::getId) |
| | | .selectAs(PlatformJob::getTotalNum,PlatformJob::getTotalNum) |
| | | .select(PlatformJob::getStatus,PlatformJob::getStatus) |
| | | .select(PlatformJob::getType,PlatformJob::getType) |
| | | // .selectCount(PlatformJob::getPlatformId,PlatformJob::getCountum) |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .in(PlatformJob::getType,Constants.ONE,Constants.THREE) |
| | | .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey(),Constants.PlatformJobStatus.LEAVED.getKey(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey()) |
| | | .apply("year(done_date) = year('"+DateUtil.getPlusTime2(year)+"') and done_date<= '"+DateUtil.getPlusTime2(year)+"'")); |
| | | |
| | | List<PlatformJob> yearLastNum = platformJobMapper.selectJoinList(PlatformJob.class, |
| | | new MPJLambdaWrapper<PlatformJob>() |
| | | .selectAs(PlatformJob::getId,PlatformJob::getId) |
| | |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .in(PlatformJob::getType,Constants.ONE,Constants.THREE) |
| | | .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey(),Constants.PlatformJobStatus.LEAVED.getKey(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey()) |
| | | .apply("year(done_date) = year('"+DateUtil.getPlusTime2(lastYear)+"') and done_date<= '"+DateUtil.getPlusTime2(lastYear)+"'")); |
| | | .apply("year(done_date) = year('"+DateUtil.getPlusTime2(lastYear)+"') and done_date<= now() ")); |
| | | |
| | | data.setMonthOutTotal(getSumTotalByList(monthNum,0,null));//本月出库量 |
| | | data.setMonthLastOutTotal(getSumTotalByList(monthLastNum,null,null) );//上月出库量 |