|
|
@ -10,14 +10,11 @@ import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
|
|
|
import com.yxt.anrui.terminal.api.autoservice.contract.CommonContractInitVo; |
|
|
|
import com.yxt.anrui.terminal.api.autoservice.contract.CrmCustomerFileDto; |
|
|
|
import com.yxt.anrui.terminal.api.autoservice.contract.flowable.ContractDto; |
|
|
|
import com.yxt.anrui.terminal.api.autoservice.contract.flowable.ContractQuery; |
|
|
|
import com.yxt.anrui.terminal.api.autoservice.contract.flowable.ContractTaskQuery; |
|
|
|
import com.yxt.anrui.terminal.api.autoservice.contract.flowable.SubmitContractInfoDto; |
|
|
|
import com.yxt.anrui.terminal.api.autoservice.contract.flowable.*; |
|
|
|
import com.yxt.common.base.utils.StringUtils; |
|
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
import lombok.Data; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -182,4 +179,73 @@ public class AppCommonContractService { |
|
|
|
} |
|
|
|
return rb.success().setData(data); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<ContractFlowListVo> getFlowOperateTitleBy(ContractQuery query) { |
|
|
|
ResultBean<ContractFlowListVo> rb = ResultBean.fireFail(); |
|
|
|
ContractFlowListVo contractFlowListVo = new ContractFlowListVo(); |
|
|
|
//0 上一环节 1下一环节
|
|
|
|
int next = query.getNext(); |
|
|
|
CommonContractNodeQuery getNodeQuery = new CommonContractNodeQuery(); |
|
|
|
BeanUtil.copyProperties(query, getNodeQuery); |
|
|
|
String data = ""; |
|
|
|
if (next == 0) { |
|
|
|
ResultBean<List<CommonContractNodeVo>> getPreviousNodesForReject = commonContractFeign.getPreviousNodesForReject(getNodeQuery); |
|
|
|
if (getPreviousNodesForReject.getSuccess()) { |
|
|
|
getPreviousNodesForReject.getData().removeAll(Collections.singleton(null)); |
|
|
|
data = getPreviousNodesForReject.getData().get(0).getName(); |
|
|
|
} else { |
|
|
|
return rb.setMsg(getPreviousNodesForReject.getMsg()); |
|
|
|
} |
|
|
|
} else if (next == 1) { |
|
|
|
ResultBean<List<CommonContractNodeVo>> getNextNodesForSubmit = commonContractFeign.getNextNodesForSubmit(getNodeQuery); |
|
|
|
if (getNextNodesForSubmit.getSuccess()) { |
|
|
|
getNextNodesForSubmit.getData().removeAll(Collections.singleton(null)); |
|
|
|
data = getNextNodesForSubmit.getData().get(0).getName(); |
|
|
|
} else { |
|
|
|
return rb.setMsg(getNextNodesForSubmit.getMsg()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
return rb.setMsg("参数错误:next"); |
|
|
|
} |
|
|
|
contractFlowListVo.setTitle(data); |
|
|
|
ResultBean<AppCommonContractInitVo> resultBean = commonContractFeign.getContractInfo(query.getBusinessSid(), ""); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
AppCommonContractInitVo appCommonContractInitVo = resultBean.getData(); |
|
|
|
if(appCommonContractInitVo != null){ |
|
|
|
contractFlowListVo.setContractImages(appCommonContractInitVo.getContractImages()); |
|
|
|
contractFlowListVo.setSiteSigImages(appCommonContractInitVo.getSiteSigImages()); |
|
|
|
} |
|
|
|
return rb.success().setData(contractFlowListVo); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean agreeContractInfoBy(ContractDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String orgSidPath = ""; |
|
|
|
if(StringUtils.isNotBlank(dto.getOrgPath())){ |
|
|
|
orgSidPath = dto.getOrgPath(); |
|
|
|
}else{ |
|
|
|
//根据用户sid获取staffSid
|
|
|
|
ResultBean<SysUserVo> userVoResultBean = sysUserFeign.fetchBySid(dto.getUserSid()); |
|
|
|
if (!userVoResultBean.getSuccess()) { |
|
|
|
return rb.setMsg(userVoResultBean.getMsg()); |
|
|
|
} |
|
|
|
//根据staffSid获取用户的组织全路径
|
|
|
|
ResultBean<SysStaffOrg> staffOrgResultBean = sysStaffOrgFeign.getOrgByStaffSid(userVoResultBean.getData().getStaffSid()); |
|
|
|
if (!staffOrgResultBean.getSuccess()) { |
|
|
|
return rb.setMsg(staffOrgResultBean.getMsg()); |
|
|
|
} |
|
|
|
//用户的组织全路径
|
|
|
|
orgSidPath = staffOrgResultBean.getData().getOrgSidPath(); |
|
|
|
} |
|
|
|
CommonContractCompleteDto commonContractCompleteDto = new CommonContractCompleteDto(); |
|
|
|
BeanUtil.copyProperties(dto, commonContractCompleteDto); |
|
|
|
commonContractCompleteDto.setOrgSidPath(orgSidPath); |
|
|
|
ResultBean resultBean = commonContractFeign.completeBy(commonContractCompleteDto); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} |
|
|
|
} |