89 lines
3.1 KiB
Java
89 lines
3.1 KiB
Java
package com.zcloud.flow.xgf.YiBan;
|
|
|
|
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
|
import com.yomahub.liteflow.core.NodeComponent;
|
|
import com.zcloud.entity.PageData;
|
|
import com.zcloud.flow.xgf.util.XgfFlowDto;
|
|
import com.zcloud.flow.xgf.util.XgfUtil;
|
|
import com.zcloud.mapper.datasource.xgf.XgfFlowsMapper;
|
|
import com.zcloud.mapper.datasource.xgf.XgfUserDetailsMapper;
|
|
import com.zcloud.mapper.datasource.xgf.XgfUserMapper;
|
|
import com.zcloud.service.xgf.XgfUserService;
|
|
import com.zcloud.util.DateUtil;
|
|
import com.zcloud.util.HttpClientService;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import javax.annotation.Resource;
|
|
import java.util.Map;
|
|
|
|
@LiteflowComponent("YiBanCharge")
|
|
public class YiBanCharge extends NodeComponent {
|
|
|
|
@Resource
|
|
private XgfUserMapper xgfUserMapper;
|
|
|
|
@Resource
|
|
private XgfFlowsMapper xgfFlowsMapper;
|
|
|
|
@Resource
|
|
private XgfUserDetailsMapper xgfUserDetailsMapper;
|
|
|
|
@Value("${preventionxgf.api.url}")
|
|
private String prevention_xgf_url;
|
|
|
|
@Resource
|
|
private XgfUserService xgfUserService;
|
|
|
|
|
|
@Override
|
|
public void process() throws Exception {
|
|
System.out.println("YiBanCharge节点");
|
|
XgfFlowDto info = this.getRequestData();
|
|
PageData condition = new PageData();
|
|
// 如果指针没有数据,赋值后自动结束
|
|
if (StringUtils.isBlank(info.getIterator())) {
|
|
info.setIterator("0");
|
|
return;
|
|
}
|
|
// 如果不是当前流程,进入下一流程判断
|
|
if (!"0".equals(info.getIterator())) {
|
|
return;
|
|
}
|
|
condition.put("FLOWS_ID", info.getFLOWS_ID());
|
|
PageData flows = xgfFlowsMapper.findById(condition);
|
|
|
|
if (flows == null || flows.size() == 0) {
|
|
throw new RuntimeException("系统异常");
|
|
}
|
|
|
|
flows.put("APPOINT_ZERO_TIME", DateUtil.getTime());
|
|
flows.put("APPOINT_ZERO_STATUS", info.getSTATUS());
|
|
flows.put("APPOINT_ZERO_OPINION", info.getOPINION());
|
|
if ("0".equals(info.getSTATUS())) {
|
|
// 打回至相关方端
|
|
xgfUserService.repulse(flows);
|
|
} else {
|
|
xgfFlowsMapper.edit(flows);
|
|
condition.clear();
|
|
condition.put("XGF_USER_ID", flows.getString("FLOWS_ID"));
|
|
PageData user = xgfUserMapper.findById(condition);
|
|
user.put("CHECK_STEP", 1);
|
|
user.put("LIMIT_END_TIME", info.getLIMIT_END_TIME());
|
|
// created by liu jun 2024-02-26 如果有委托书则保存委托书
|
|
if (StringUtils.isNotBlank(info.getAPPOINT_ANNEX())) {
|
|
condition.clear();
|
|
condition.put("XGF_USER_DETAILS_ID", flows.getString("FLOWS_ID"));
|
|
PageData userInfo = xgfUserDetailsMapper.findById(condition);
|
|
userInfo.put("COMMITMENT_LETTER", info.getAPPOINT_ANNEX());
|
|
xgfUserDetailsMapper.edit(userInfo);
|
|
}
|
|
xgfUserMapper.edit(user);
|
|
// 将指针清空
|
|
info.setIterator("");
|
|
}
|
|
// 保存操作记录
|
|
xgfUserService.saveLog(info, info.getSTATUS(), "0");
|
|
}
|
|
}
|