| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.doumee.service.common.EmailService; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.sun.corba.se.spi.orbutil.threadpool.Work; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.catalina.Manager; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | * @param csInfo æéä¿¡æ¯ |
| | | */ |
| | | public void sendQwMsg(Workorder workorder,String qwIds,Member member,String categoryName,Integer contentType,String csInfo){ |
| | | if(Constants.equalsInteger(workorder.getType(),Constants.TWO)){ |
| | | workorder = workorderMapper.selectById(workorder.getDcaRecordId()); |
| | | } |
| | | if(StringUtils.isEmpty(qwIds)){ |
| | | return; |
| | | } |
| | |
| | | QywxTextCardMsgRequest textCard = new QywxTextCardMsgRequest(); |
| | | String message = ""; |
| | | String url = jumpUrl.replace("{corpId}",systemDictDataBiz.queryByCode(Constants.QYWX,Constants.QYWX_CORPID).getCode()); |
| | | String jumpOurUrl = systemDictDataBiz.queryByCode(Constants.QYWX,Constants.JUMP_OUT_URL).getCode().replace("{status}",workorder.getType()+"_"+workorder.getId()); |
| | | String jumpOurUrl = systemDictDataBiz.queryByCode(Constants.QYWX,Constants.JUMP_OUT_URL).getCode().replace("{status}", |
| | | workorder.getType()+"_"+workorder.getId()); |
| | | textCard.setUrl(url.replace("{ourUrl}",jumpOurUrl)); |
| | | log.error("ä¼å¾®é¾æ¥å°å"+url); |
| | | if(Constants.equalsInteger(workorder.getType(),Constants.ZERO)){ |
| | | textCard.setTitle("ãSHEäºä»¶ä¸æ¥ã"); |
| | | if(Constants.equalsInteger(workorder.getMemberType(),Constants.ZERO)){ |
| | |
| | | workorderMapper.insert(dcaWorkOrder); |
| | | //å卿¥å¿ |
| | | this.dealLogData(dcaWorkOrder,workOrderStatus); |
| | | |
| | | //åå¨å¾
å人åä¿¡æ¯ |
| | | this.saveNotice(Arrays.asList(dcaWorkOrder.getQwnoticeMemberIds().split(",")),dcaWorkOrder.getId(),Constants.ZERO,Constants.ZERO); |
| | | |
| | | List<Multifile> multifileList = dcaNoProblemDTO.getMultifileList(); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){ |
| | | for (Multifile multifile:multifileList) { |
| | |
| | | * @param afterWorkorder |
| | | * @param objType æä½ç±»å 0ä»»å¡ä¸æ¥ 1ä»»å¡åé
ç©ä¸ä¸»ç®¡ 2ä»»å¡åé
å¤ç人 3ä»»å¡å¤çå
³é 4ä»»å¡å¬ä¿ |
| | | * @param memberId |
| | | * @param paramr2 å¤ç人 |
| | | * @param paramr2 转交ç»çå¤ç人 |
| | | */ |
| | | public Integer saveLog(String beforeJson,Workorder afterWorkorder,Integer objType,Integer memberId,String title,String content,String paramr2){ |
| | | WorkorderLog workorderLog = new WorkorderLog(); |
| | |
| | | } |
| | | |
| | | //æ¥è¯¢æ¥å¿ä¿¡æ¯ |
| | | workorder.setLogList(this.getLogList(workorder)); |
| | | workorder.setLogList(this.getLogList(workorder,member)); |
| | | if(Constants.equalsInteger(workorder.getType(),Constants.ONE)){ |
| | | //妿æ¯DCAæäº¤è®°å½ï¼æ¥è¯¢åå·¥åéå |
| | | Workorder param = new Workorder(); |
| | | param.setIsdeleted(Constants.ZERO); |
| | | param.setDcaRecordId(workorder.getId()); |
| | | workorder.setDcaChildList(findList(param)); |
| | | List<Workorder> dcaChildList = findList(param); |
| | | for (Workorder dcaChild:dcaChildList) { |
| | | this.dealButton(dcaChild,member); |
| | | } |
| | | |
| | | workorder.setDcaChildList(dcaChildList); |
| | | } |
| | | return workorder; |
| | | } |
| | |
| | | } |
| | | List<String> passOnUserList = new ArrayList<>(); |
| | | //å¾
åé
ç¶æ å¤ç转交æé® |
| | | if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitConfirm.getKey())&&Constants.equalsInteger(workorder.getStatus(),Constants.ZERO)){ |
| | | if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitConfirm.getKey()) |
| | | ){ |
| | | passOnUserList.addAll(Arrays.asList(workorder.getQwnoticeMemberIds().split(","))); |
| | | }else if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey())&&(Constants.equalsInteger(workorder.getStatus(),Constants.ONE) |
| | | || Constants.equalsInteger(workorder.getStatus(),Constants.TWO))){ |
| | | } |
| | | if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey()) |
| | | || Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitDeal.getKey()) |
| | | ){ |
| | | passOnUserList.add(workorder.getManagerId()); |
| | | } |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(passOnUserList)){ |
| | |
| | | } |
| | | |
| | | |
| | | public List<WorkorderLog> getLogList(Workorder workorder){ |
| | | public List<WorkorderLog> getLogList(Workorder workorder,Member loginMember){ |
| | | List<WorkorderLog> logList = workorderLogMapper.selectJoinList(WorkorderLog.class, |
| | | new MPJLambdaWrapper<WorkorderLog>() |
| | | .selectAll(WorkorderLog.class) |
| | |
| | | .eq(WorkorderLog::getObjId,workorder.getId()) |
| | | .orderByDesc(WorkorderLog::getId) |
| | | ); |
| | | |
| | | |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(logList)){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode() |
| | |
| | | if(Constants.equalsInteger(workorder.getStatus(),Constants.ONE)){ |
| | | Member member = memberMapper.selectById(workorderLog.getParam1()); |
| | | if(Objects.nonNull(member) && org.apache.commons.lang3.StringUtils.isNotBlank(member.getQwId()) |
| | | && Objects.nonNull(loginMember) && Constants.equalsInteger(member.getId(),loginMember.getId()) |
| | | && workorder.getQwnoticeMemberIds().indexOf(member.getQwId())>=Constants.ZERO){ |
| | | workorderLog.setUrgeButton(Constants.ONE); |
| | | } |
| | |
| | | if(Constants.equalsInteger(workorder.getStatus(),Constants.TWO)){ |
| | | Member member = memberMapper.selectById(workorderLog.getParam1()); |
| | | if(Objects.nonNull(member) && org.apache.commons.lang3.StringUtils.isNotBlank(member.getQwId()) |
| | | && member.getQwId().equals(workorder.getManagerId()) && canOpenUrgeButton){ |
| | | && canOpenUrgeButton |
| | | && (workorder.getQwnoticeMemberIds().indexOf(member.getQwId()) >= Constants.ZERO || member.getQwId().equals(workorder.getManagerId()) ) |
| | | ){ |
| | | workorderLog.setUrgeButton(Constants.ONE); |
| | | canOpenUrgeButton = false; |
| | | } |
| | |
| | | workorder.setStatus(Constants.WorkOrderStatus.waitDeal.getKey()); |
| | | } |
| | | workorder.setEditDate(new Date()); |
| | | workorder.setUrgeDate(DateUtil.afterHoursDate(new Date(),24)); |
| | | workorder.setUrgeDate(DateUtil.afterMinutesDate(new Date(),2)); |
| | | workorderMapper.updateById(workorder); |
| | | String paramr2 = member.getCompanyName()+"/"+member.getName(); |
| | | //å¤ç䏿¥æ¥å¿ |
| | |
| | | Category category = categoryMapper.selectById(workorder.getTypeId()); |
| | | if(Objects.nonNull(passOnDTO.getMember())&&Objects.nonNull(category)){ |
| | | // åéä¼å¾®éç¥ |
| | | this.sendQwMsg(workorder,member.getQwId(),passOnDTO.getMember(),category.getName(),Constants.ZERO,null); |
| | | this.sendQwMsg(workorder,passOnDTO.getPassOnUserId(),passOnDTO.getMember(),category.getName(),Constants.ZERO,null); |
| | | } |
| | | //åå¨å¾
å人åä¿¡æ¯ |
| | | this.saveNotice(Arrays.asList(passOnDTO.getMember().getQwId().split(",")),workorder.getId(),Constants.ZERO,Constants.TWO); |
| | | this.saveNotice(Arrays.asList(passOnDTO.getPassOnUserId().split(",")), |
| | | Constants.equalsInteger(workorder.getType(),Constants.TWO)?workorder.getDcaRecordId():workorder.getId(),Constants.ZERO,Constants.TWO); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | List<Member> memberList = memberMapper.selectList(new QueryWrapper<Member>().lambda().eq(Member::getIsdeleted, Constants.ZERO) |
| | | .isNotNull(Member::getQwId) |
| | | .in(Member::getId, sendCopyDTO.getUserIds().split(","))); |
| | | .in(Member::getQwId, sendCopyDTO.getUserIds().split(","))); |
| | | if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(memberList)) { |
| | | List<String> qwIdList = memberList.stream().map(i -> i.getQwId()).collect(Collectors.toList()); |
| | | Category category = categoryMapper.selectById(workorder.getTypeId()); |
| | | if (Objects.nonNull(category)) { |
| | | // åéä¼å¾®éç¥ |
| | | this.sendQwMsg(workorder, String.join(",", qwIdList), sendCopyDTO.getMember(), category.getName(), Constants.ONE, null); |
| | | this.sendQwMsg(workorder, String.join(",", qwIdList), sendCopyDTO.getMember(), category.getName(), Constants.TWO, sendCopyDTO.getInfo()); |
| | | } |
| | | //åå¨å¾
åä¿¡æ¯ |
| | | this.saveNotice(qwIdList, workorder.getId(), Constants.ONE, Constants.ONE); |
| | | this.saveNotice(qwIdList, Constants.equalsInteger(workorder.getType(),Constants.TWO)?workorder.getDcaRecordId():workorder.getId(), Constants.ONE, Constants.ONE); |
| | | } |
| | | |
| | | } |
| | |
| | | public void urge(Integer workorderId,Member member){ |
| | | Workorder workorder = workorderMapper.selectById(workorderId); |
| | | workorder.setEditDate(new Date()); |
| | | workorder.setUrgeDate(DateUtil.afterHoursDate(new Date(),24)); |
| | | workorder.setUrgeDate(DateUtil.afterMinutesDate(new Date(),2));//DateUtil.afterHoursDate(new Date(),24)); |
| | | workorderMapper.updateById(workorder); |
| | | if(Objects.isNull(workorder)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°å·¥åæ°æ®"); |
| | |
| | | //妿已åé
wts 忝å¬ä¿wts |
| | | if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey())){ |
| | | urgeUser = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getIsdeleted,Constants.ZERO).eq(Member::getQwId,workorder.getManagerId()).last("limit 1 ")); |
| | | }else if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey())){ |
| | | }else if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitDeal.getKey())){ |
| | | urgeUser = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getIsdeleted,Constants.ZERO).eq(Member::getQwId,workorder.getDealerId()).last("limit 1 ")); |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"ç¶æå·²æµè½¬æ æ³è¿è¡è¯¥æä½"); |
| | |
| | | Category category = categoryMapper.selectById(workorder.getTypeId()); |
| | | if(Objects.nonNull(category)){ |
| | | // åéä¼å¾®éç¥ |
| | | this.sendQwMsg(workorder,urgeUser.getQwId(),null,category.getName(),Constants.ONE,null); |
| | | this.sendQwMsg(workorder,urgeUser.getQwId(),member,category.getName(),Constants.ONE,null); |
| | | } |
| | | |
| | | } |
| | |
| | | for (Workorder workorder:workorderList) { |
| | | this.autoUrge(workorder); |
| | | workorder.setEditDate(new Date()); |
| | | workorder.setUrgeDate(DateUtil.afterHoursDate(new Date(),24)); |
| | | workorder.setUrgeDate(DateUtil.afterMinutesDate(new Date(),2));//DateUtil.afterHoursDate(new Date(),24)); |
| | | workorderMapper.updateById(workorder); |
| | | } |
| | | } |