| | |
| | | package com.ruoyi.quartz.task; |
| | | |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.bean.DtoConversionUtils; |
| | | import com.ruoyi.project.domain.*; |
| | | import com.ruoyi.project.domain.vo.DingTalkReqVo; |
| | | import com.ruoyi.project.service.*; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.taobao.api.ApiException; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | |
| | | @Autowired |
| | | private IServiceFundflowruleService iServiceFundflowruleService; |
| | | @Autowired |
| | | |
| | | @Autowired |
| | | private IServiceFundService serviceFundService; |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | |
| | | |
| | | @Autowired |
| | |
| | | System.out.println("执行无参方法"); |
| | | } |
| | | |
| | | public void checkReportInfo() { |
| | | public void checkReportInfo() throws ApiException { |
| | | //查出所有被医院退回的Fund数据 |
| | | List<ServiceFundShared> serviceFundShareds = serviceFundSharedService.queryFundShareList(); |
| | | for (ServiceFundShared serviceFundShared : serviceFundShareds) { |
| | |
| | | serviceFund1.setRecordstatus(-1); |
| | | serviceFund1.setBackflowlevel(199); |
| | | serviceFundService.updateById(serviceFund1); |
| | | sendMeg(split, phone, serviceFundShared.getApplytype(), 2, serviceFundShared.getSerfunid()); |
| | | |
| | | SysUser sysUser = sysUserService.selectUserByUserName(serviceFund1.getUserno()); |
| | | sendMeg(split, sysUser.getPhonenumber(), serviceFundShared.getApplytype(), 2, serviceFundShared.getSerfunid()); |
| | | } else { |
| | | //不是退回的操作 |
| | | if (StringUtils.isNotBlank(serviceFundShared.getZffs()) && serviceFundShared.getSpjg() == 0) { |
| | |
| | | serviceReimbursement1.setBackflowlevel(199L); |
| | | serviceReimbursement1.setRecordstatus(-1); |
| | | serviceReimbursementService.updateById(serviceReimbursement1); |
| | | sendMeg(split, phone, "0", 1, serviceReimbursementShared.getReimid()); |
| | | |
| | | SysUser sysUser = sysUserService.selectUserByUserName(serviceReimbursement1.getUserno()); |
| | | sendMeg(split, sysUser.getPhonenumber(), "0", 1, serviceReimbursementShared.getReimid()); |
| | | } else { |
| | | //不是退回的操作 |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | public void sendMeg(String[] split, String phone, String applyType, Integer fundType, Long fundId) { |
| | | public void sendMeg(String[] split, String phone, String applyType, Integer fundType, Long fundId) throws ApiException { |
| | | //记录操作记录 |
| | | ServiceFundflow serviceFundflow = new ServiceFundflow(); |
| | | serviceFundflow.setCreateBy("admin"); |
| | | serviceFundflow.setCreateBy(split[0]); |
| | | serviceFundflow.setCreateTime(new Date()); |
| | | serviceFundflow.setUpdateBy("admin"); |
| | | serviceFundflow.setUpdateBy(split[0]); |
| | | serviceFundflow.setUpdateTime(new Date()); |
| | | serviceFundflow.setCheckusername(split[0]); |
| | | serviceFundflow.setFlowcontent(split[2]); |
| | |
| | | serviceFundflow.setFundid(fundId); |
| | | fundflowService.save(serviceFundflow); |
| | | |
| | | // ArrayList<ConcurrentHashMap<String, String>> contentList = new ArrayList<>(); |
| | | // ConcurrentHashMap map = new ConcurrentHashMap(); |
| | | // map.put("审批人", split[0]); |
| | | // map.put("审批时间", split[1]); |
| | | // map.put("意见", split[2]); |
| | | // contentList.add(map); |
| | | // DingTalkReqVo dingTalkReqVo = new DingTalkReqVo(); |
| | | // dingTalkReqVo.setTitle("财务系统驳回信息"); |
| | | // dingTalkReqVo.setNumber(phone); |
| | | // dingTalkReqVo.setContents(contentList); |
| | | // dingTalkService.sendNotification(dingTalkReqVo); |
| | | ArrayList<ConcurrentHashMap<String, Object>> contentList = new ArrayList<>(); |
| | | ConcurrentHashMap map = new ConcurrentHashMap(); |
| | | map.put("审批人:", split[0]); |
| | | map.put("审批时间:", split[1]); |
| | | map.put("意见:", split[2]); |
| | | contentList.add(map); |
| | | DingTalkReqVo dingTalkReqVo = new DingTalkReqVo(); |
| | | dingTalkReqVo.setTitle("财务系统驳回信息"); |
| | | dingTalkReqVo.setNumber(phone); |
| | | dingTalkReqVo.setContents(contentList); |
| | | dingTalkService.sendNotification(dingTalkReqVo); |
| | | } |
| | | |
| | | private ReentrantLock lock = new ReentrantLock(); |
| | |
| | | log.info("差旅的最高等级:{}", serviceFundflowrules.get(0).getTotallevel()); |
| | | ServiceReimbursement serviceReimbursement = new ServiceReimbursement(); |
| | | serviceReimbursement.setFlowlevel(serviceFundflowrules.get(0).getTotallevel().longValue()); |
| | | serviceReimbursement.setUploadStates(0); |
| | | serviceReimbursement.setUploadStates(1); |
| | | serviceReimbursement.setDelFlag(0); |
| | | List<ServiceReimbursement> serviceReimbursementList = serviceReimbursementService.queryList(serviceReimbursement); |
| | | for (ServiceReimbursement serviceReimbursement1 : serviceReimbursementList) { |
| | |
| | | if (aBoolean) { |
| | | ServiceReimbursement serviceReimbursement3 = new ServiceReimbursement(); |
| | | serviceReimbursement3.setId(serviceReimbursement1.getId()); |
| | | serviceReimbursement3.setUploadStates(1); |
| | | serviceReimbursement3.setUploadStates(2); |
| | | boolean b = serviceReimbursementService.updateById(serviceReimbursement3); |
| | | log.info("serviceReimbursement是否插入成功{},{}", aBoolean, b); |
| | | } |
| | |
| | | private void addFunfShared(Long totallevel, String applyType) { |
| | | ServiceFund serviceFund = new ServiceFund(); |
| | | serviceFund.setFlowlevel(totallevel); |
| | | serviceFund.setUploadStates(0); |
| | | serviceFund.setUploadStates(1); |
| | | serviceFund.setDel_flag(0); |
| | | serviceFund.setApplytype(applyType); |
| | | List<ServiceFund> serviceFundList = serviceFundService.queryList(serviceFund); |
| | |
| | | if (aBoolean) { |
| | | ServiceFund serviceFund2 = new ServiceFund(); |
| | | serviceFund2.setId(serviceFund1.getId()); |
| | | serviceFund2.setUploadStates(1); |
| | | serviceFund2.setUploadStates(2); |
| | | boolean b = serviceFundService.updateById(serviceFund2); |
| | | log.info("serviceReimbursement是否插入成功{},{}", aBoolean, b); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | ServiceFund serviceFund2 = new ServiceFund(); |
| | | serviceFund2.setId(serviceFund1.getId()); |
| | | serviceFund2.setUploadStates(1); |
| | | serviceFund2.setNotes("插入fund分享表失败"); |
| | | serviceFundService.updateById(serviceFund2); |
| | | } |