| | |
| | | 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) { |
| | |
| | | } |
| | | |
| | | //将分享里的该数据删除 |
| | | serviceReimbursementSharedService.delResharedInfoById(serviceReimbursementShared.getId()); |
| | | |
| | | Boolean aBoolean = serviceReimbursementSharedService.delResharedInfoById(serviceReimbursementShared.getId()); |
| | | log.info("将分享里的该数据删除: {}",aBoolean); |
| | | //将Flowlevel 设置为0; |
| | | ServiceReimbursement serviceReimbursement = new ServiceReimbursement(); |
| | | serviceReimbursement.setId(serviceReimbursementShared.getReimid()); |
| | |
| | | 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(); |
| | |
| | | ServiceFund serviceFund2 = new ServiceFund(); |
| | | serviceFund2.setId(serviceFund1.getId()); |
| | | serviceFund2.setUploadStates(2); |
| | | serviceFund2.setUpdateTime(new Date()); |
| | | 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); |