liusheng
2023-07-28 21bc49712f298f8c2619341279e7906dfb278944
将操作记录插入fundflow表
已修改9个文件
612 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceSystemmessageController.java 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceFundShared.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceFundflow.java 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursementShared.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundSharedServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementSharedServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-project/src/main/resources/mapper/project/ServiceFundflowMapper.xml 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java 433 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceSystemmessageController.java
@@ -6,6 +6,7 @@
import com.ruoyi.common.core.domain.model.LoginUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -28,15 +29,15 @@
/**
 * 系统消息Controller
 *
 *
 * @author ruoyi
 * @date 2022-06-02
 */
@Slf4j
@Api("系统消息")
@RestController
@RequestMapping("/project/systemmessage")
public class ServiceSystemmessageController extends BaseController
{
public class ServiceSystemmessageController extends BaseController {
    @Autowired
    private IServiceSystemmessageService serviceSystemmessageService;
@@ -45,8 +46,7 @@
     */
    @ApiOperation("查询系统消息列表")
    @GetMapping("/list")
    public TableDataInfo list(ServiceSystemmessage serviceSystemmessage)
    {
    public TableDataInfo list(ServiceSystemmessage serviceSystemmessage) {
        startPage();
        List<ServiceSystemmessage> list = serviceSystemmessageService.queryList(serviceSystemmessage);
        return getDataTable(list);
@@ -58,14 +58,15 @@
     */
    @ApiOperation("查询未读消息数量")
    @GetMapping("/noreadcount")
    public AjaxResult noreadcount()
    {
        LoginUser loginUser = getLoginUser();
        ServiceSystemmessage serviceSystemmessage=new ServiceSystemmessage();
        serviceSystemmessage.setReceiveuserno(loginUser.getUsername());
        serviceSystemmessage.setIsread(0);
        List<ServiceSystemmessage> list = serviceSystemmessageService.queryList(serviceSystemmessage);
        return AjaxResult.success(list.size());
    public AjaxResult noreadcount() {
//        LoginUser loginUser = getLoginUser();
//        ServiceSystemmessage serviceSystemmessage = new ServiceSystemmessage();
//        serviceSystemmessage.setReceiveuserno(loginUser.getUsername());
//        serviceSystemmessage.setIsread(0);
//        List<ServiceSystemmessage> list = serviceSystemmessageService.queryList(serviceSystemmessage);
//        return AjaxResult.success(list.size());
        //   log.info("不用管我,正在测试程序");
        return null;
    }
    /**
@@ -75,8 +76,7 @@
    @PreAuthorize("@ss.hasPermi('project:systemmessage:export')")
    @Log(title = "系统消息", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(ServiceSystemmessage serviceSystemmessage)
    {
    public AjaxResult export(ServiceSystemmessage serviceSystemmessage) {
        List<ServiceSystemmessage> list = serviceSystemmessageService.queryList(serviceSystemmessage);
        ExcelUtil<ServiceSystemmessage> util = new ExcelUtil<ServiceSystemmessage>(ServiceSystemmessage.class);
        return util.exportExcel(list, "系统消息数据");
@@ -87,8 +87,7 @@
     */
    @ApiOperation("获取系统消息详细信息")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return AjaxResult.success(serviceSystemmessageService.getById(id));
    }
@@ -100,8 +99,7 @@
    @Log(title = "系统消息", businessType = BusinessType.INSERT)
    @PostMapping
    @RepeatSubmit
    public AjaxResult add(@RequestBody ServiceSystemmessage serviceSystemmessage)
    {
    public AjaxResult add(@RequestBody ServiceSystemmessage serviceSystemmessage) {
        return toAjax(serviceSystemmessageService.save(serviceSystemmessage));
    }
@@ -111,9 +109,8 @@
    @ApiOperation("修改系统消息")
    @Log(title = "系统消息", businessType = BusinessType.UPDATE)
    @PutMapping
    @RepeatSubmit
    public AjaxResult edit(@RequestBody ServiceSystemmessage serviceSystemmessage)
    {
    @RepeatSubmit
    public AjaxResult edit(@RequestBody ServiceSystemmessage serviceSystemmessage) {
        return toAjax(serviceSystemmessageService.updateById(serviceSystemmessage));
    }
@@ -124,8 +121,7 @@
    @PreAuthorize("@ss.hasPermi('project:systemmessage:remove')")
    @Log(title = "系统消息", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(serviceSystemmessageService.removeByIds(Arrays.asList(ids)));
    }
}
ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceFundShared.java
@@ -267,5 +267,10 @@
    @Excel(name = "财务驳回信息:姓名+' '+时间+' '+意见")
    private String cxrjyj;
    /**
     * 审批结果(“中心签字” 为1,财务副院长签字为2,业务副院长签字为3)以“,”分开,如果1,2,3都有了,说明这个审批完成了
     */
    @ApiModelProperty("审批结果")
    private int spjg;
}
ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceFundflow.java
@@ -8,64 +8,88 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
 * 资金审批流程对象 service_fundflow
 *
 *
 * @author ruoyi
 * @date 2022-04-27
 */
@Data
@ApiModel("资金审批流程")
public class ServiceFundflow extends BaseEntity
{
public class ServiceFundflow extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /** $column.columnComment */
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    //数据库自增改成@TableId(type = IdType.AUTO)
    @TableId(type = IdType.AUTO)
    private Long id;
    /** 费用编号,差旅费关联表service_reimbursement ID; 费用关联费用表service_fund的ID */
    /**
     * 费用编号,差旅费关联表service_reimbursement ID; 费用关联费用表service_fund的ID
     */
    @ApiModelProperty("费用编号,差旅费关联表service_reimbursement ID; 费用关联费用表service_fund的ID")
    @Excel(name = "费用编号,差旅费关联表service_reimbursement ID; 费用关联费用表service_fund的ID")
    private Long fundid;
    /** 审核人编号 */
    /**
     * 审核人编号
     */
    @ApiModelProperty("审核人编号")
    @Excel(name = "审核人编号")
    private String checkuserno;
    /** 审核人姓名 */
    /**
     * 审核人姓名
     */
    @ApiModelProperty("审核人姓名")
    @Excel(name = "审核人姓名")
    private String checkusername;
    /** 流程内容,操作写意见建议 */
    /**
     * 流程内容,操作写意见建议
     */
    @ApiModelProperty("流程内容,操作写意见建议")
    @Excel(name = "流程内容,操作写意见建议")
    private String flowcontent;
    /** 流程结论 1:通过;2:驳回; */
    /**
     * 流程结论 1:通过;2:驳回;
     */
    @ApiModelProperty("流程结论 1:通过;2:驳回;")
    @Excel(name = "流程结论 1:通过;2:驳回;")
    private Integer flowconclusion;
    /** 费用类别  1:差旅费模块  2:费用申请模块 */
    /**
     * 费用类别  1:差旅费模块  2:费用申请模块
     */
    @ApiModelProperty("费用类别  1:差旅费模块  2:费用申请模块")
    @Excel(name = "费用类别  1:差旅费模块  2:费用申请模块")
    private Integer fundtype;
    /** 资金类别 见字典sys_ConsolationType */
    /**
     * 资金类别 见字典sys_ConsolationType
     */
    @ApiModelProperty("资金类别 见字典sys_ConsolationType")
    @Excel(name = "资金类别 见字典sys_ConsolationType")
    private String applytype;
    /** 审核阶段 0:申请;1:一级审核;2:二级审核;3:三级审核等 */
    /**
     * 审核阶段 0:申请;1:一级审核;2:二级审核;3:三级审核等 999:通过
     */
    @ApiModelProperty("审核阶段")
    @Excel(name = "审核阶段")
    private Integer flowlevel;
    @ApiModelProperty("校验时间")
    @Excel(name = "校验时间")
    private Date checkTime;
}
ruoyi-project/src/main/java/com/ruoyi/project/domain/ServiceReimbursementShared.java
@@ -358,5 +358,8 @@
    @ApiModelProperty("付款日期")
    private String riqi;
    @ApiModelProperty("审批结果")
    private Integer spjg;
}
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundServiceImpl.java
@@ -70,6 +70,9 @@
        if (StringUtils.isNotBlank(serviceFund.getDonorno())) {
            wrappers.eq(ServiceFund::getDonorno, serviceFund.getDonorno());
        }
        if (serviceFund.getId() != null) {
            wrappers.eq(ServiceFund::getId, serviceFund.getId());
        }
        if (StringUtils.isNotBlank(serviceFund.getUserno())) {
            wrappers.eq(ServiceFund::getUserno, serviceFund.getUserno());
        }
@@ -643,6 +646,7 @@
        return count;
    }
    int uploadOAFileAndUpdateDb(ServiceFundShared remShare) {
        //上传OA文件
        //String strUrl = "http://129.88.242.39:8899/seeyon/rest/token?userName=opo&password=127814f8-84e8-4304-84a5-a71573567efd&loginName=demo3";
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceFundSharedServiceImpl.java
@@ -175,7 +175,7 @@
    public List<ServiceFundShared> queryFundShareList() {
        LambdaQueryWrapper<ServiceFundShared> wrappers = Wrappers.lambdaQuery();
        wrappers.eq(ServiceFundShared::getDel_flag, 0);
        wrappers.isNotNull(ServiceFundShared::getCxrjyj);
      //  wrappers.isNotNull(ServiceFundShared::getCxrjyj);
        return this.list(wrappers);
    }
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/ServiceReimbursementSharedServiceImpl.java
@@ -165,7 +165,7 @@
    public List<ServiceReimbursementShared> queryReShareList() {
        LambdaQueryWrapper<ServiceReimbursementShared> wrappers = Wrappers.lambdaQuery();
        wrappers.eq(ServiceReimbursementShared::getDelFlag, 0);
        wrappers.isNotNull(ServiceReimbursementShared::getCxrjyj);
     //   wrappers.isNotNull(ServiceReimbursementShared::getCxrjyj);
        return this.list(wrappers);
    }
ruoyi-project/src/main/resources/mapper/project/ServiceFundflowMapper.xml
@@ -1,40 +1,59 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.project.mapper.ServiceFundflowMapper">
    <resultMap type="com.ruoyi.project.domain.ServiceFundflow" id="ServiceFundflowResult">
        <result property="id"    column="ID"    />
        <result property="fundid"    column="FundID"    />
        <result property="del_flag"    column="del_flag"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="checkuserno"    column="CheckUserNo"    />
        <result property="checkusername"    column="CheckUserName"    />
        <result property="flowcontent"    column="FlowContent"    />
        <result property="flowconclusion"    column="FlowConclusion"    />
        <result property="fundtype"    column="FundType"    />
        <result property="applytype"    column="ApplyType"    />
        <result property="flowlevel"    column="FlowLevel"    />
        <result property="id" column="ID"/>
        <result property="fundid" column="FundID"/>
        <result property="del_flag" column="del_flag"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="checkuserno" column="CheckUserNo"/>
        <result property="checkusername" column="CheckUserName"/>
        <result property="flowcontent" column="FlowContent"/>
        <result property="flowconclusion" column="FlowConclusion"/>
        <result property="fundtype" column="FundType"/>
        <result property="applytype" column="ApplyType"/>
        <result property="flowlevel" column="FlowLevel"/>
        <result property="checkTime" column="check_time"/>
    </resultMap>
    <sql id="selectServiceFundflowVo">
        select ID, FundID, del_flag, create_by, create_time, update_by, update_time, CheckUserNo, CheckUserName, FlowContent, FlowConclusion, FundType, ApplyType,FlowLevel from service_fundflow
        select ID,
               FundID,
               del_flag,
               create_by,
               create_time,
               update_by,
               update_time,
               CheckUserNo,
               CheckUserName,
               FlowContent,
               FlowConclusion,
               FundType,
               ApplyType,
               FlowLevel,
               checkTime
        from service_fundflow
    </sql>
    <select id="selectServiceFundflowList" parameterType="com.ruoyi.project.domain.ServiceFundflow" resultMap="ServiceFundflowResult">
    <select id="selectServiceFundflowList" parameterType="com.ruoyi.project.domain.ServiceFundflow"
            resultMap="ServiceFundflowResult">
        <include refid="selectServiceFundflowVo"/>
        <where>
            <if test="fundid != null "> and FundID = #{fundid}</if>
            <if test="checkuserno != null  and checkuserno != ''"> and CheckUserNo = #{checkuserno}</if>
            <if test="checkusername != null  and checkusername != ''"> and CheckUserName like concat('%', #{checkusername}, '%')</if>
            <if test="flowcontent != null  and flowcontent != ''"> and FlowContent = #{flowcontent}</if>
            <if test="flowconclusion != null "> and FlowConclusion = #{flowconclusion}</if>
            <if test="fundtype != null "> and FundType = #{fundtype}</if>
            <if test="applytype != null  and applytype != ''"> and ApplyType = #{applytype}</if>
            <if test="fundid != null ">and FundID = #{fundid}</if>
            <if test="checkuserno != null  and checkuserno != ''">and CheckUserNo = #{checkuserno}</if>
            <if test="checkusername != null  and checkusername != ''">and CheckUserName like concat('%',
                #{checkusername}, '%')
            </if>
            <if test="flowcontent != null  and flowcontent != ''">and FlowContent = #{flowcontent}</if>
            <if test="flowconclusion != null ">and FlowConclusion = #{flowconclusion}</if>
            <if test="fundtype != null ">and FundType = #{fundtype}</if>
            <if test="applytype != null  and applytype != ''">and ApplyType = #{applytype}</if>
        </where>
    </select>
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -4,12 +4,16 @@
import com.ruoyi.project.domain.vo.DingTalkReqVo;
import com.ruoyi.project.service.*;
import com.ruoyi.project.service.impl.DingTalkServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.util.CollectionUtils;
import java.lang.reflect.Array;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
@@ -19,6 +23,7 @@
 * @author ruoyi
 */
@Component("ryTask")
@Slf4j
public class RyTask {
    @Autowired
    private DingTalkService dingTalkService;
@@ -55,48 +60,418 @@
        //查出所有被医院退回的Fund数据
        List<ServiceFundShared> serviceFundShareds = serviceFundSharedService.queryFundShareList();
        for (ServiceFundShared serviceFundShared : serviceFundShareds) {
            String[] split = serviceFundShared.getCxrjyj().split("&");
            String phone = serviceFundShared.getPhone();
            //将分享里的该数据删除
            serviceFundSharedService.delfundsharedInfoById(serviceFundShared.getId());
            if (StringUtils.isNotBlank(serviceFundShared.getCxrjyj())) {
                //如果有财务驳回信息说明是退回的
                String[] split = serviceFundShared.getCxrjyj().split("&");
                String phone = serviceFundShared.getPhone();
                //将分享里的该数据删除
                serviceFundSharedService.delfundsharedInfoById(serviceFundShared.getId());
            ServiceFund serviceFund = new ServiceFund();
            serviceFund.setId(serviceFundShared.getSerfunid());
            List<ServiceFund> serviceFunds = serviceFundService.queryList(serviceFund);
            ServiceFund serviceFund1 = serviceFunds.get(0);
            serviceFund1.setFlowlevel(0);
            serviceFund1.setDel_flag(0);
            serviceFund1.setBackflowlevel(199);
            serviceFundService.updateById(serviceFund1);
            sendMeg(split, phone,serviceFundShared.getApplytype(),2,serviceFundShared.getSerfunid());
                ServiceFund serviceFund = new ServiceFund();
                serviceFund.setId(serviceFundShared.getSerfunid());
                List<ServiceFund> serviceFunds = serviceFundService.queryList(serviceFund);
                ServiceFund serviceFund1 = serviceFunds.get(0);
                serviceFund1.setFlowlevel(0);
                serviceFund1.setDel_flag(0);
                serviceFund1.setBackflowlevel(199);
                serviceFundService.updateById(serviceFund1);
                sendMeg(split, phone, serviceFundShared.getApplytype(), 2, serviceFundShared.getSerfunid());
            } else {
                //不是退回的操作
                if (StringUtils.isNotBlank(serviceFundShared.getZffs()) && serviceFundShared.getSpjg() == 0) {
                    //钱已经到帐,并且审批结果为0,说明审批结束,但数据还没有同步到fund表和fundflow表;对fund表和fundflow表进行更新,并将0改成1
                    ServiceFund serviceFund = new ServiceFund();
                    serviceFund.setId(serviceFundShared.getSerfunid());
                    serviceFund.setZffs(serviceFundShared.getZffs());
                    if (StringUtils.isNotBlank(serviceFundShared.getOpochecker())) {
                        serviceFund.setOpochecker(serviceFundShared.getOpochecker());
                    }
                    if (StringUtils.isNotBlank(serviceFundShared.getFinvicepresident())) {
                        serviceFund.setFinvicepresident(serviceFundShared.getFinvicepresident());
                    }
                    if (StringUtils.isNotBlank(serviceFundShared.getBusvicepresident())) {
                        serviceFund.setBusvicepresident(serviceFundShared.getBusvicepresident());
                    }
                    boolean b = serviceFundService.updateById(serviceFund);
                    log.info("更新serviceFund里的zffs表是否成功: {}", b);
                    ServiceFundflow serviceFundflow = new ServiceFundflow();
                    serviceFundflow.setCreateBy("admin");
                    serviceFundflow.setCreateTime(new Date());
                    serviceFundflow.setUpdateBy("admin");
                    serviceFundflow.setUpdateTime(new Date());
                    //用三个审批人,如果都为空,就为空
                    String spname = "";
                    if (StringUtils.isNotBlank(serviceFundShared.getOpochecker())) {
                        serviceFundflow.setCheckusername(serviceFundShared.getOpochecker().substring(0, serviceFundShared.getOpochecker().indexOf(" ")));
                        //更新校验时间
                        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
                        Date parse = new Date();
                        try {
                            parse = simpleDateFormat.parse(serviceFundShared.getOpochecker().substring(serviceFundShared.getOpochecker().indexOf(" ") + 1, serviceFundShared.getOpochecker().length()));
                        } catch (ParseException e) {
                            e.printStackTrace();
                        }
                        serviceFundflow.setCheckTime(parse);
                        spname = spname + serviceFundShared.getOpochecker() + "  ";
                    }
                    if (StringUtils.isNotBlank(serviceFundShared.getFinvicepresident())) {
                        serviceFundflow.setCheckusername(serviceFundShared.getFinvicepresident().substring(0, serviceFundShared.getFinvicepresident().indexOf(" ")));
                        //更新校验时间
                        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
                        Date parse = new Date();
                        try {
                            parse = simpleDateFormat.parse(serviceFundShared.getFinvicepresident().substring(serviceFundShared.getFinvicepresident().indexOf(" ") + 1, serviceFundShared.getFinvicepresident().length()));
                        } catch (ParseException e) {
                            e.printStackTrace();
                        }
                        serviceFundflow.setCheckTime(parse);
                        spname = spname + serviceFundShared.getFinvicepresident() + "  ";
                    }
                    if (StringUtils.isNotBlank(serviceFundShared.getBusvicepresident())) {
                        serviceFundflow.setCheckusername(serviceFundShared.getBusvicepresident().substring(0, serviceFundShared.getBusvicepresident().indexOf(" ")));
                        //更新校验时间
                        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
                        Date parse = new Date();
                        try {
                            parse = simpleDateFormat.parse(serviceFundShared.getBusvicepresident().substring(serviceFundShared.getBusvicepresident().indexOf(" ") + 1, serviceFundShared.getBusvicepresident().length()));
                        } catch (ParseException e) {
                            e.printStackTrace();
                        }
                        serviceFundflow.setCheckTime(parse);
                        spname = spname + serviceFundShared.getBusvicepresident() + "  ";
                    }
                    serviceFundflow.setFlowcontent(spname + "审批通过");
                    serviceFundflow.setFlowconclusion(1);
                    serviceFundflow.setFundtype(1);
                    // 999 通过
                    serviceFundflow.setFlowlevel(999);
                    serviceFundflow.setApplytype(null);
                    serviceFundflow.setFundid(serviceFundShared.getSerfunid());
                    serviceFundShared.setSpjg(1);
                    fundflowService.save(serviceFundflow);
                    //将审批状态改成1
                    serviceFundSharedService.updateById(serviceFundShared);
                } else if (StringUtils.isNotBlank(serviceFundShared.getZffs()) && serviceFundShared.getSpjg() == 1) {
                    //钱已经到帐,并且审批结果为1,审批结束,就不管那些领导是否签字了
                    continue;
                }
                ServiceFund serviceFund = new ServiceFund();
                serviceFund.setId(serviceFundShared.getSerfunid());
                List<ServiceFund> serviceFunds = serviceFundService.queryList(serviceFund);
                if (!CollectionUtils.isEmpty(serviceFunds)) {
                    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
                    Date parse = new Date();
                    if (StringUtils.isNotBlank(serviceFundShared.getOpochecker())) {
                        //先查询一下fund是否已经更新Opochecker,如果没有更新,则进行更新,并往fundflow表里插一条数据
                        if (StringUtils.isEmpty(serviceFunds.get(0).getOpochecker())) {
                            try {
                                parse = simpleDateFormat.parse(serviceFundShared.getOpochecker().substring(serviceFundShared.getOpochecker().indexOf(" ") + 1, serviceFundShared.getOpochecker().length()));
                            } catch (ParseException e) {
                                e.printStackTrace();
                            }
                            serviceFund.setOpochecker(serviceFundShared.getOpochecker());
                            serviceFundService.updateById(serviceFund);
                            //将操作保存到fundflow表中
                            ServiceFundflow serviceFundflow = new ServiceFundflow();
                            serviceFundflow.setCreateBy("admin");
                            serviceFundflow.setCreateTime(new Date());
                            serviceFundflow.setUpdateBy("admin");
                            serviceFundflow.setUpdateTime(new Date());
                            serviceFundflow.setCheckusername(serviceFundShared.getOpochecker().substring(0, serviceFundShared.getOpochecker().indexOf(" ")));
                            serviceFundflow.setFlowcontent(serviceFundShared.getOpochecker().substring(0, serviceFundShared.getOpochecker().indexOf(" ")) + "审批通过");
                            serviceFundflow.setFlowconclusion(1);
                            serviceFundflow.setFundtype(1);
                            serviceFundflow.setFlowlevel(999);
                            serviceFundflow.setApplytype(null);
                            serviceFundflow.setFundid(serviceFundShared.getSerfunid());
                            serviceFundflow.setCheckTime(parse);
                            fundflowService.save(serviceFundflow);
                        }
                        //如果已经更新则不在处理
                    }
                    if (StringUtils.isNotBlank(serviceFundShared.getFinvicepresident())) {
                        try {
                            parse = simpleDateFormat.parse(serviceFundShared.getFinvicepresident().substring(serviceFundShared.getFinvicepresident().indexOf(" ") + 1, serviceFundShared.getFinvicepresident().length()));
                        } catch (ParseException e) {
                            e.printStackTrace();
                        }
                        //先查询一下fund是否已经更新Finvicepresident,如果没有更新,则进行更新,并往fundflow表里插一条数据
                        if (StringUtils.isEmpty(serviceFunds.get(0).getFinvicepresident())) {
                            serviceFund.setFinvicepresident(serviceFundShared.getFinvicepresident());
                            serviceFundService.updateById(serviceFund);
                            //将操作保存到fundflow表中
                            ServiceFundflow serviceFundflow = new ServiceFundflow();
                            serviceFundflow.setCreateBy("admin");
                            serviceFundflow.setCreateTime(new Date());
                            serviceFundflow.setUpdateBy("admin");
                            serviceFundflow.setUpdateTime(new Date());
                            serviceFundflow.setCheckusername(serviceFundShared.getFinvicepresident().substring(0, serviceFundShared.getFinvicepresident().indexOf(" ")));
                            serviceFundflow.setFlowcontent(serviceFundShared.getFinvicepresident().substring(0, serviceFundShared.getFinvicepresident().indexOf(" ")) + "审批通过");
                            serviceFundflow.setFlowconclusion(1);
                            serviceFundflow.setFundtype(1);
                            serviceFundflow.setFlowlevel(999);
                            serviceFundflow.setApplytype(null);
                            serviceFundflow.setFundid(serviceFundShared.getSerfunid());
                            serviceFundflow.setCheckTime(parse);
                            fundflowService.save(serviceFundflow);
                        }
                        //如果已经更新则不在处理
                    }
                    if (StringUtils.isNotBlank(serviceFundShared.getBusvicepresident())) {
                        try {
                            parse = simpleDateFormat.parse(serviceFundShared.getBusvicepresident().substring(serviceFundShared.getBusvicepresident().indexOf(" ") + 1, serviceFundShared.getBusvicepresident().length()));
                        } catch (ParseException e) {
                            e.printStackTrace();
                        }
                        //先查询一下fund是否已经更新Busvicepresident,如果没有更新,则进行更新,并往fundflow表里插一条数据
                        if (StringUtils.isEmpty(serviceFunds.get(0).getBusvicepresident())) {
                            serviceFund.setBusvicepresident(serviceFundShared.getBusvicepresident());
                            serviceFundService.updateById(serviceFund);
                            //将操作保存到fundflow表中
                            ServiceFundflow serviceFundflow = new ServiceFundflow();
                            serviceFundflow.setCreateBy("admin");
                            serviceFundflow.setCreateTime(new Date());
                            serviceFundflow.setUpdateBy("admin");
                            serviceFundflow.setUpdateTime(new Date());
                            serviceFundflow.setCheckusername(serviceFundShared.getBusvicepresident().substring(0, serviceFundShared.getBusvicepresident().indexOf(" ")));
                            serviceFundflow.setFlowcontent(serviceFundShared.getBusvicepresident().substring(0, serviceFundShared.getBusvicepresident().indexOf(" ")) + "通过");
                            serviceFundflow.setFlowconclusion(1);
                            serviceFundflow.setFundtype(1);
                            serviceFundflow.setFlowlevel(999);
                            serviceFundflow.setApplytype(null);
                            serviceFundflow.setFundid(serviceFundShared.getSerfunid());
                            serviceFundflow.setCheckTime(parse);
                            fundflowService.save(serviceFundflow);
                        }
                        //如果已经更新则不在处理
                    }
                }
            }
        }
        //查出所有被医院退回的Reimbursement数据
        List<ServiceReimbursementShared> serviceReimbursementShareds = serviceReimbursementSharedService.queryReShareList();
        for (ServiceReimbursementShared serviceReimbursementShared : serviceReimbursementShareds) {
            String phone = serviceReimbursementShared.getPhone();
            String[] split = serviceReimbursementShared.getCxrjyj().split("&");
            if (StringUtils.isNotBlank(serviceReimbursementShared.getCxrjyj())) {
                String phone = serviceReimbursementShared.getPhone();
                String[] split = serviceReimbursementShared.getCxrjyj().split("&");
            //将分享里的该数据删除
            serviceReimbursementSharedService.delResharedInfoById(serviceReimbursementShared.getId());
                //将分享里的该数据删除
                serviceReimbursementSharedService.delResharedInfoById(serviceReimbursementShared.getId());
            //将Flowlevel 设置为0;
            ServiceReimbursement serviceReimbursement = new ServiceReimbursement();
            serviceReimbursement.setId(serviceReimbursementShared.getReimid());
            List<ServiceReimbursement> serviceReimbursementList = serviceReimbursementService.queryList(serviceReimbursement);
            ServiceReimbursement serviceReimbursement1 = serviceReimbursementList.get(0);
            serviceReimbursement1.setFlowlevel(0L);
            serviceReimbursement1.setDelFlag(0);
            serviceReimbursement1.setBackflowlevel(199L);
            serviceReimbursement1.setRecordstatus(-1);
            serviceReimbursementService.updateById(serviceReimbursement1);
            sendMeg(split, phone, "0", 1, serviceReimbursementShared.getReimid());
                //将Flowlevel 设置为0;
                ServiceReimbursement serviceReimbursement = new ServiceReimbursement();
                serviceReimbursement.setId(serviceReimbursementShared.getReimid());
                List<ServiceReimbursement> serviceReimbursementList = serviceReimbursementService.queryList(serviceReimbursement);
                ServiceReimbursement serviceReimbursement1 = serviceReimbursementList.get(0);
                serviceReimbursement1.setFlowlevel(0L);
                serviceReimbursement1.setDelFlag(0);
                serviceReimbursement1.setBackflowlevel(199L);
                serviceReimbursement1.setRecordstatus(-1);
                serviceReimbursementService.updateById(serviceReimbursement1);
                sendMeg(split, phone, "0", 1, serviceReimbursementShared.getReimid());
            } else {
                //不是退回的操作
                if (StringUtils.isNotBlank(serviceReimbursementShared.getZffs()) && serviceReimbursementShared.getSpjg() == 0) {
                    //钱已经到帐,并且审批结果为0,说明审批结束,但数据还没有同步到fund表和fundflow表;对fund表和fundflow表进行更新,并将0改成1
                    ServiceReimbursement serviceReimbursement = new ServiceReimbursement();
                    serviceReimbursement.setId(serviceReimbursementShared.getReimid());
                    serviceReimbursement.setZffs(serviceReimbursementShared.getZffs());
                    if (StringUtils.isNotBlank(serviceReimbursementShared.getOpochecker())) {
                        serviceReimbursement.setOpochecker(serviceReimbursementShared.getOpochecker());
                    }
                    if (StringUtils.isNotBlank(serviceReimbursementShared.getFinvicepresident())) {
                        serviceReimbursement.setFinvicepresident(serviceReimbursementShared.getFinvicepresident());
                    }
                    if (StringUtils.isNotBlank(serviceReimbursementShared.getBusvicepresident())) {
                        serviceReimbursement.setBusvicepresident(serviceReimbursementShared.getBusvicepresident());
                    }
                    boolean b = serviceReimbursementService.updateById(serviceReimbursement);
                    log.info("更新serviceReimbursement里的zffs表是否成功: {}", b);
                    ServiceFundflow serviceFundflow = new ServiceFundflow();
                    serviceFundflow.setCreateBy("admin");
                    serviceFundflow.setCreateTime(new Date());
                    serviceFundflow.setUpdateBy("admin");
                    serviceFundflow.setUpdateTime(new Date());
                    //用三个审批人,如果都为空,就为空
                    String spName = "";
                    if (StringUtils.isNotBlank(serviceReimbursementShared.getOpochecker())) {
                        serviceFundflow.setCheckusername(serviceReimbursementShared.getOpochecker().substring(0, serviceReimbursementShared.getOpochecker().indexOf(" ")));
                        //更新校验时间
                        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
                        Date parse = new Date();
                        try {
                            parse = simpleDateFormat.parse(serviceReimbursementShared.getOpochecker().substring(serviceReimbursementShared.getOpochecker().indexOf(" ") + 1, serviceReimbursementShared.getOpochecker().length()));
                        } catch (ParseException e) {
                            e.printStackTrace();
                        }
                        serviceFundflow.setCheckTime(parse);
                        spName = spName + serviceReimbursementShared.getOpochecker() + "  ";
                    }
                    if (StringUtils.isNotBlank(serviceReimbursementShared.getFinvicepresident())) {
                        serviceFundflow.setCheckusername(serviceReimbursementShared.getFinvicepresident().substring(0, serviceReimbursementShared.getFinvicepresident().indexOf(" ")));
                        //更新校验时间
                        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
                        Date parse = new Date();
                        try {
                            parse = simpleDateFormat.parse(serviceReimbursementShared.getFinvicepresident().substring(serviceReimbursementShared.getFinvicepresident().indexOf(" ") + 1, serviceReimbursementShared.getFinvicepresident().length()));
                        } catch (ParseException e) {
                            e.printStackTrace();
                        }
                        serviceFundflow.setCheckTime(parse);
                        spName = spName + serviceReimbursementShared.getFinvicepresident() + "  ";
                    }
                    if (StringUtils.isNotBlank(serviceReimbursementShared.getBusvicepresident())) {
                        serviceFundflow.setCheckusername(serviceReimbursementShared.getBusvicepresident().substring(0, serviceReimbursementShared.getBusvicepresident().indexOf(" ")));
                        //更新校验时间
                        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
                        Date parse = new Date();
                        try {
                            parse = simpleDateFormat.parse(serviceReimbursementShared.getBusvicepresident().substring(serviceReimbursementShared.getBusvicepresident().indexOf(" ") + 1, serviceReimbursementShared.getBusvicepresident().length()));
                        } catch (ParseException e) {
                            e.printStackTrace();
                        }
                        serviceFundflow.setCheckTime(parse);
                        spName = spName + serviceReimbursementShared.getBusvicepresident() + "  ";
                    }
                    serviceFundflow.setFlowcontent(spName + "审批通过");
                    serviceFundflow.setFlowconclusion(1);
                    serviceFundflow.setFundtype(1);
                    // 999 通过
                    serviceFundflow.setFlowlevel(999);
                    serviceFundflow.setApplytype(null);
                    serviceFundflow.setFundid(serviceReimbursementShared.getReimid());
                    serviceReimbursementShared.setSpjg(1);
                    fundflowService.save(serviceFundflow);
                    serviceReimbursementSharedService.updateById(serviceReimbursementShared);
                } else if (StringUtils.isNotBlank(serviceReimbursementShared.getZffs()) && serviceReimbursementShared.getSpjg().equals("1")) {
                    //钱已经到帐,并且审批结果为1,审批结束,就不管那些领导是否签字了
                    continue;
                }
                ServiceReimbursement reimbursement = new ServiceReimbursement();
                reimbursement.setId(serviceReimbursementShared.getReimid());
                List<ServiceReimbursement> serviceReimbursementList = serviceReimbursementService.queryList(reimbursement);
                if (!CollectionUtils.isEmpty(serviceReimbursementList)) {
                    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
                    Date parse = new Date();
                    if (StringUtils.isNotBlank(serviceReimbursementShared.getOpochecker())) {
                        try {
                            parse = simpleDateFormat.parse(serviceReimbursementShared.getOpochecker().substring(serviceReimbursementShared.getOpochecker().indexOf(" ") + 1, serviceReimbursementShared.getOpochecker().length()));
                        } catch (ParseException e) {
                            e.printStackTrace();
                        }
                        //先查询一下fund是否已经更新Opochecker,如果没有更新,则进行更新,并往fundflow表里插一条数据
                        if (StringUtils.isEmpty(serviceReimbursementList.get(0).getOpochecker())) {
                            reimbursement.setOpochecker(serviceReimbursementShared.getOpochecker());
                            serviceReimbursementService.updateById(reimbursement);
                            //将操作保存到fundflow表中
                            ServiceFundflow serviceFundflow = new ServiceFundflow();
                            serviceFundflow.setCreateBy("admin");
                            serviceFundflow.setCreateTime(new Date());
                            serviceFundflow.setUpdateBy("admin");
                            serviceFundflow.setUpdateTime(new Date());
                            serviceFundflow.setCheckusername(serviceReimbursementShared.getOpochecker().substring(0, serviceReimbursementShared.getOpochecker().indexOf(" ")));
                            serviceFundflow.setFlowcontent(serviceReimbursementShared.getOpochecker().substring(0, serviceReimbursementShared.getOpochecker().indexOf(" ")) + "审批通过");
                            serviceFundflow.setFlowconclusion(1);
                            serviceFundflow.setFundtype(1);
                            serviceFundflow.setFlowlevel(999);
                            serviceFundflow.setApplytype(null);
                            serviceFundflow.setFundid(serviceReimbursementShared.getReimid());
                            serviceFundflow.setCheckTime(parse);
                            fundflowService.save(serviceFundflow);
                        }
                        //如果已经更新则不在处理
                    }
                    if (StringUtils.isNotBlank(serviceReimbursementShared.getFinvicepresident())) {
                        try {
                            parse = simpleDateFormat.parse(serviceReimbursementShared.getFinvicepresident().substring(serviceReimbursementShared.getFinvicepresident().indexOf(" ") + 1, serviceReimbursementShared.getFinvicepresident().length()));
                        } catch (ParseException e) {
                            e.printStackTrace();
                        }
                        //先查询一下fund是否已经更新Finvicepresident,如果没有更新,则进行更新,并往fundflow表里插一条数据
                        if (StringUtils.isEmpty(serviceReimbursementList.get(0).getFinvicepresident())) {
                            reimbursement.setFinvicepresident(serviceReimbursementShared.getFinvicepresident());
                            serviceReimbursementService.updateById(reimbursement);
                            //将操作保存到fundflow表中
                            ServiceFundflow serviceFundflow = new ServiceFundflow();
                            serviceFundflow.setCreateBy("admin");
                            serviceFundflow.setCreateTime(new Date());
                            serviceFundflow.setUpdateBy("admin");
                            serviceFundflow.setUpdateTime(new Date());
                            serviceFundflow.setCheckusername(serviceReimbursementShared.getFinvicepresident().substring(0, serviceReimbursementShared.getFinvicepresident().indexOf(" ")));
                            serviceFundflow.setFlowcontent(serviceReimbursementShared.getFinvicepresident().substring(0, serviceReimbursementShared.getFinvicepresident().indexOf(" ")) + "审批通过");
                            serviceFundflow.setFlowconclusion(1);
                            serviceFundflow.setFundtype(1);
                            serviceFundflow.setFlowlevel(999);
                            serviceFundflow.setApplytype(null);
                            serviceFundflow.setCheckTime(parse);
                            serviceFundflow.setFundid(serviceReimbursementShared.getReimid());
                            fundflowService.save(serviceFundflow);
                        }
                        //如果已经更新则不在处理
                    }
                    if (StringUtils.isNotBlank(serviceReimbursementShared.getBusvicepresident())) {
                        try {
                            parse = simpleDateFormat.parse(serviceReimbursementShared.getBusvicepresident().substring(serviceReimbursementShared.getBusvicepresident().indexOf(" ") + 1, serviceReimbursementShared.getBusvicepresident().length()));
                        } catch (ParseException e) {
                            e.printStackTrace();
                        }
                        //先查询一下fund是否已经更新Busvicepresident,如果没有更新,则进行更新,并往fundflow表里插一条数据
                        if (StringUtils.isEmpty(serviceReimbursementList.get(0).getBusvicepresident())) {
                            reimbursement.setBusvicepresident(serviceReimbursementShared.getBusvicepresident());
                            serviceReimbursementService.updateById(reimbursement);
                            //将操作保存到fundflow表中
                            ServiceFundflow serviceFundflow = new ServiceFundflow();
                            serviceFundflow.setCreateBy("admin");
                            serviceFundflow.setCreateTime(new Date());
                            serviceFundflow.setUpdateBy("admin");
                            serviceFundflow.setUpdateTime(new Date());
                            serviceFundflow.setCheckusername(serviceReimbursementShared.getBusvicepresident().substring(0, serviceReimbursementShared.getBusvicepresident().indexOf(" ")));
                            serviceFundflow.setFlowcontent(serviceReimbursementShared.getBusvicepresident().substring(0, serviceReimbursementShared.getBusvicepresident().indexOf(" ")) + "审批通过");
                            serviceFundflow.setFlowconclusion(1);
                            serviceFundflow.setFundtype(1);
                            serviceFundflow.setFlowlevel(999);
                            serviceFundflow.setApplytype(null);
                            serviceFundflow.setCheckTime(parse);
                            serviceFundflow.setFundid(serviceReimbursementShared.getReimid());
                            serviceFundflow.setCheckTime(parse);
                            fundflowService.save(serviceFundflow);
                        }
                        //如果已经更新则不在处理
                    }
                }
            }
        }
    }
    public void sendMeg(String[] split, String phone, String applyType, Integer fundType, Long fundId) {
        //记录操作记录
        ServiceFundflow serviceFundflow = new ServiceFundflow();