|
|
@ -43,6 +43,7 @@ import com.yxt.anrui.flowable.api.flow.FlowableFeign; |
|
|
|
import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowTaskVo; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo; |
|
|
|
import com.yxt.anrui.flowable.api.utils.ProcDefEnum; |
|
|
|
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; |
|
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; |
|
|
@ -59,6 +60,9 @@ import com.yxt.common.base.utils.PagerUtil; |
|
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
import com.yxt.messagecenter.api.message.MessageFeign; |
|
|
|
import com.yxt.messagecenter.api.message.MessageFlowVo; |
|
|
|
import com.yxt.messagecenter.api.message.MessageFlowableQuery; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -99,6 +103,8 @@ public class FinCostapplyService extends MybatisBaseService<FinCostapplyMapper, |
|
|
|
private SysStaffPostFeign sysStaffPostFeign; |
|
|
|
@Autowired |
|
|
|
private SysUserRoleFeign sysUserRoleFeign; |
|
|
|
@Autowired |
|
|
|
private MessageFeign messageFeign; |
|
|
|
|
|
|
|
public PagerVo<FinCostapplyVo> listPageVo(PagerQuery<FinCostapplyQuery> pq) { |
|
|
|
FinCostapplyQuery query = pq.getParams(); |
|
|
@ -259,9 +265,9 @@ public class FinCostapplyService extends MybatisBaseService<FinCostapplyMapper, |
|
|
|
//创建BusinessVariables实体对象
|
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
Map<String,Object> appMap = new HashMap<>(); |
|
|
|
appMap.put("sid",businessSid); |
|
|
|
variables.put("app",appMap); |
|
|
|
Map<String, Object> appMap = new HashMap<>(); |
|
|
|
appMap.put("sid", businessSid); |
|
|
|
variables.put("app", appMap); |
|
|
|
//用户的部门全路径sid
|
|
|
|
bv.setOrgSidPath(orgSidPath); |
|
|
|
//业务sid
|
|
|
@ -317,6 +323,18 @@ public class FinCostapplyService extends MybatisBaseService<FinCostapplyMapper, |
|
|
|
} |
|
|
|
UpdateFlowFieldVo ufVo = voResultBean.getData(); |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(ufVo)); |
|
|
|
//极光推送
|
|
|
|
finCostapply = fetchBySid(businessSid); |
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
messageFlowableQuery.setAppMap(appMap); |
|
|
|
messageFlowableQuery.setBusinessSid(businessSid); |
|
|
|
messageFlowableQuery.setModuleName("费用申请"); |
|
|
|
messageFlowableQuery.setMsgContent(finCostapply.getName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle("费用申请"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
return voResultBean; |
|
|
|
} |
|
|
|
if (r == 2) { |
|
|
@ -382,15 +400,33 @@ public class FinCostapplyService extends MybatisBaseService<FinCostapplyMapper, |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
FinCostapply finCostapply = fetchBySid(bv.getBusinessSid()); |
|
|
|
if (bv.getTaskId().equals(finCostapply.getTaskId())) { |
|
|
|
Map<String, Object> vaributes = new HashMap<>(); |
|
|
|
Map<String, Object> appMap = new HashMap<>(); |
|
|
|
appMap.put("sid", bv.getBusinessSid()); |
|
|
|
vaributes.put("app", appMap); |
|
|
|
bv.setFormVariables(vaributes); |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.handleProsess(bv); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
|
/* //ToDo:出纳付款记录
|
|
|
|
if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { |
|
|
|
|
|
|
|
}*/ |
|
|
|
if (!"Event_end".equals(resultBean.getData().getTaskDefKey())){ |
|
|
|
//极光推送
|
|
|
|
UpdateFlowFieldVo ufVo = resultBean.getData(); |
|
|
|
finCostapply = fetchBySid(bv.getBusinessSid()); |
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
|
|
|
ufVo.setProcDefId(finCostapply.getProcDefId()); |
|
|
|
ufVo.setProcInsId(finCostapply.getProcInstId()); |
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
messageFlowableQuery.setAppMap(appMap); |
|
|
|
messageFlowableQuery.setBusinessSid(bv.getBusinessSid()); |
|
|
|
messageFlowableQuery.setModuleName("费用申请"); |
|
|
|
messageFlowableQuery.setMsgContent(finCostapply.getName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle("费用申请"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
} |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} else { |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
@ -443,6 +479,7 @@ public class FinCostapplyService extends MybatisBaseService<FinCostapplyMapper, |
|
|
|
if (finCostapply == null) { |
|
|
|
return rb.setMsg("该申请不存在"); |
|
|
|
} |
|
|
|
String businessSid = query.getBusinessSid(); |
|
|
|
String businessTaskId = finCostapply.getTaskId(); |
|
|
|
if (StringUtils.isNotBlank(businessTaskId)) { |
|
|
|
if (businessTaskId.equals(query.getTaskId())) { |
|
|
@ -454,6 +491,11 @@ public class FinCostapplyService extends MybatisBaseService<FinCostapplyMapper, |
|
|
|
} |
|
|
|
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|
|
|
BeanUtil.copyProperties(query, flowTaskVo); |
|
|
|
Map<String, Object> vaributes = new HashMap<>(); |
|
|
|
Map<String, Object> appMap = new HashMap<>(); |
|
|
|
appMap.put("sid", query.getBusinessSid()); |
|
|
|
vaributes.put("app", appMap); |
|
|
|
flowTaskVo.setValues(vaributes); |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.taskReject(flowTaskVo); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
@ -461,6 +503,30 @@ public class FinCostapplyService extends MybatisBaseService<FinCostapplyMapper, |
|
|
|
Map<String, Object> map = BeanUtil.beanToMap(resultBean.getData()); |
|
|
|
//更新业务中的流程相关的参数
|
|
|
|
updateFlowFiled(map); |
|
|
|
//极光推送
|
|
|
|
UpdateFlowFieldVo ufVo = resultBean.getData(); |
|
|
|
finCostapply = fetchBySid(businessSid); |
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
|
|
|
String procId = finCostapply.getProcInstId(); |
|
|
|
ufVo.setProcInsId(procId); |
|
|
|
ufVo.setProcDefId(finCostapply.getProcDefId()); |
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
messageFlowableQuery.setAppMap(appMap); |
|
|
|
messageFlowableQuery.setBusinessSid(businessSid); |
|
|
|
messageFlowableQuery.setModuleName("费用申请"); |
|
|
|
ResultBean<List<LatestTaskVo>> listResultBean = flowTaskFeign.getLatestTasks(procId); |
|
|
|
String nextNodeUserSids = listResultBean.getData().get(0).getASSIGNEE_(); |
|
|
|
List<String> receiveSidList = Arrays.asList(nextNodeUserSids.split(",")); |
|
|
|
if (receiveSidList.size() == 1 && receiveSidList.get(0).equals(finCostapply.getCreateBySid())) { |
|
|
|
messageFlowableQuery.setMsgContent("您提交的" + messageFlowableQuery.getModuleName() + "已被驳回,请重新提交"); |
|
|
|
} else { |
|
|
|
messageFlowableQuery.setMsgContent(finCostapply.getName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
} |
|
|
|
|
|
|
|
messageFlowableQuery.setMsgTitle("费用申请"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
} |
|
|
@ -544,7 +610,7 @@ public class FinCostapplyService extends MybatisBaseService<FinCostapplyMapper, |
|
|
|
public ResultBean<AppFinCostApplyVo> appDetails(String sid) { |
|
|
|
ResultBean<AppFinCostApplyVo> rb = ResultBean.fireFail(); |
|
|
|
AppFinCostApplyVo appFinCostApplyVo = baseMapper.appDetails(sid); |
|
|
|
if ('1'.equals(appFinCostApplyVo.getIsVehKey())) {//涉及车辆
|
|
|
|
if ("1".equals(appFinCostApplyVo.getIsVehKey())) {//涉及车辆
|
|
|
|
List<String> vinNoList = finCostapplyVehicleService.selectByApplySid(sid); |
|
|
|
String vins = StringUtils.join(vinNoList.toArray(), "\n"); |
|
|
|
appFinCostApplyVo.setVins(vins); |
|
|
|