|
|
@ -54,7 +54,6 @@ import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo; |
|
|
|
import com.yxt.anrui.flowable.api.sysprourl.SysProUrlFeign; |
|
|
|
import com.yxt.anrui.flowable.api.sysprourl.SysProUrlVo; |
|
|
|
import com.yxt.anrui.flowable.api.utils.ProcDefEnum; |
|
|
|
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; |
|
|
|
import com.yxt.anrui.portal.api.dictcommon.DictCommonFeign; |
|
|
@ -80,8 +79,8 @@ 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.MessageFlowableDto; |
|
|
|
import com.yxt.messagecenter.api.message.MessageJsonDto; |
|
|
|
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; |
|
|
@ -391,10 +390,20 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean1 = flowableFeign.startProcess(bv); |
|
|
|
UpdateFlowFieldVo uff = resultBean1.getData(); |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(uff)); |
|
|
|
BaseOutsourcingApplication baseOutsourcingApplication = fetchBySid(businessSid); |
|
|
|
//======================添加消息推送开始
|
|
|
|
BaseOutsourcingApplication baseOutsourcingApplication = fetchBySid(businessSid); |
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
BeanUtil.copyProperties(uff,messageFlowVo); |
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
messageFlowableQuery.setAppMap(appMap); |
|
|
|
messageFlowableQuery.setBusinessSid(businessSid); |
|
|
|
messageFlowableQuery.setModuleName("外采申请"); |
|
|
|
messageFlowableQuery.setMsgContent(baseOutsourcingApplication.getCreateByName()+"提交的"+messageFlowableQuery.getModuleName()+",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle("供应链"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
//极光推送
|
|
|
|
String msgSid = getMessage(uff, appMap, baseOutsourcingApplication); |
|
|
|
// String msgSid = getMessage(uff, appMap, baseOutsourcingApplication);
|
|
|
|
//======================添加消息推送结束
|
|
|
|
return resultBean1; |
|
|
|
} |
|
|
@ -429,8 +438,18 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(uff)); |
|
|
|
//======================添加消息推送开始
|
|
|
|
BaseOutsourcingApplication baseOutsourcingApplication = fetchBySid(businessSid); |
|
|
|
//极光推送
|
|
|
|
String msgSid = getMessage(uff, appMap, baseOutsourcingApplication); |
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
BeanUtil.copyProperties(uff,messageFlowVo); |
|
|
|
uff.setProcInsId(baseOutsourcingApplication.getProcInstSid()); |
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
messageFlowableQuery.setAppMap(appMap); |
|
|
|
messageFlowableQuery.setBusinessSid(businessSid); |
|
|
|
messageFlowableQuery.setModuleName("外采申请"); |
|
|
|
messageFlowableQuery.setMsgContent(baseOutsourcingApplication.getCreateByName()+"提交的"+messageFlowableQuery.getModuleName()+",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle("供应链"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
// String msgSid = getMessage(uff, appMap, baseOutsourcingApplication);
|
|
|
|
//======================添加消息推送结束
|
|
|
|
return resultBean1; |
|
|
|
} else if (StringUtils.isNotBlank(businessTaskid) && businessTaskid.equals(dto.getTaskId())) {//只有数据一致的时候才能进行下一步
|
|
|
@ -443,8 +462,18 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
updateFlowFiled(stringObjectMap); |
|
|
|
//======================添加消息推送开始
|
|
|
|
BaseOutsourcingApplication baseOutsourcingApplication = fetchBySid(businessSid); |
|
|
|
//极光推送
|
|
|
|
String msgSid = getMessage(uff, appMap, baseOutsourcingApplication); |
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
BeanUtil.copyProperties(uff,messageFlowVo); |
|
|
|
uff.setProcInsId(baseOutsourcingApplication.getProcInstSid()); |
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
messageFlowableQuery.setAppMap(appMap); |
|
|
|
messageFlowableQuery.setBusinessSid(businessSid); |
|
|
|
messageFlowableQuery.setModuleName("外采申请"); |
|
|
|
messageFlowableQuery.setMsgContent(baseOutsourcingApplication.getCreateByName()+"提交的"+messageFlowableQuery.getModuleName()+",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle("供应链"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
// String msgSid = getMessage(uff, appMap, baseOutsourcingApplication);
|
|
|
|
//======================添加消息推送结束
|
|
|
|
return rb; |
|
|
|
} else { |
|
|
@ -520,8 +549,18 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
//======================添加消息推送开始
|
|
|
|
UpdateFlowFieldVo uff = rb.getData(); |
|
|
|
BaseOutsourcingApplication baseOutsourcingApplication = fetchBySid(bv.getBusinessSid()); |
|
|
|
//极光推送
|
|
|
|
String msgSid = getMessage(uff, appMap, baseOutsourcingApplication); |
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
BeanUtil.copyProperties(uff,messageFlowVo); |
|
|
|
uff.setProcInsId(baseOutsourcingApplication.getProcInstSid()); |
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
messageFlowableQuery.setAppMap(appMap); |
|
|
|
messageFlowableQuery.setBusinessSid(bv.getBusinessSid()); |
|
|
|
messageFlowableQuery.setModuleName("外采申请"); |
|
|
|
messageFlowableQuery.setMsgContent(baseOutsourcingApplication.getCreateByName()+"提交的"+messageFlowableQuery.getModuleName()+",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle("供应链"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
// String msgSid = getMessage(uff, appMap, baseOutsourcingApplication);
|
|
|
|
//======================添加消息推送结束
|
|
|
|
} |
|
|
|
|
|
|
@ -701,8 +740,27 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
updateFlowFiled(stringObjectMap); |
|
|
|
//======================添加消息推送开始
|
|
|
|
BaseOutsourcingApplication baseOutsourcingApplication = fetchBySid(flowTaskVo.getBusinessSid()); |
|
|
|
//极光推送
|
|
|
|
String msgSid = getMessage(data, appMap, baseOutsourcingApplication); |
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
BeanUtil.copyProperties(data,messageFlowVo); |
|
|
|
String procId = baseOutsourcingApplication.getProcInstSid(); |
|
|
|
data.setProcInsId(procId); |
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
messageFlowableQuery.setAppMap(appMap); |
|
|
|
messageFlowableQuery.setBusinessSid(flowTaskVo.getBusinessSid()); |
|
|
|
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(baseOutsourcingApplication.getCreateBySid())){ |
|
|
|
messageFlowableQuery.setMsgContent("您提交的"+messageFlowableQuery.getModuleName()+"已被驳回,请重新提交"); |
|
|
|
}else{ |
|
|
|
messageFlowableQuery.setMsgContent(baseOutsourcingApplication.getCreateByName()+"提交的"+messageFlowableQuery.getModuleName()+",请审批"); |
|
|
|
} |
|
|
|
|
|
|
|
messageFlowableQuery.setMsgTitle("供应链"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
// String msgSid = getMessage(data, appMap, baseOutsourcingApplication);
|
|
|
|
//======================添加消息推送结束
|
|
|
|
return resultBean; |
|
|
|
} else { |
|
|
@ -800,55 +858,4 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
vo.setImages(stringList); |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 消息推送 |
|
|
|
* @param ufVo |
|
|
|
* @param appMap |
|
|
|
* @param baseOutsourcingApplication |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public String getMessage(UpdateFlowFieldVo ufVo, Map<String, Object> appMap, BaseOutsourcingApplication baseOutsourcingApplication) { |
|
|
|
//=====极光推送信息========================================参数组装
|
|
|
|
String procId = baseOutsourcingApplication.getProcInstSid(); |
|
|
|
ResultBean<List<LatestTaskVo>> resultBean = flowTaskFeign.getLatestTasks(procId); |
|
|
|
String nextNodeUserSids = resultBean.getData().get(0).getASSIGNEE_(); |
|
|
|
List<String> receiveSidList = Arrays.asList(nextNodeUserSids.split(",")); |
|
|
|
//根据用户的sid查询用户的id
|
|
|
|
ResultBean<String> stringList1 = sysUserFeign.selectIdBySid(receiveSidList); |
|
|
|
List<String> reveiveIdList = Arrays.asList(stringList1.getData().split(",")); |
|
|
|
MessageFlowableDto messageFlowableDto = new MessageFlowableDto(); |
|
|
|
MessageJsonDto messageJsonDto = new MessageJsonDto(); |
|
|
|
BeanUtil.copyProperties(ufVo, messageJsonDto); |
|
|
|
//查询流程审批的页面操作地址组装json的参数
|
|
|
|
//根据taskDef和移动端标识
|
|
|
|
ResultBean<SysProUrlVo> selectUrlByKey = sysProUrlFeign.selectUrlByKey(ProcDefEnum.BASEOUTSOURCINGAPPLICATION.getProDefId(), ufVo.getTaskDefKey(), "1", "2"); |
|
|
|
SysProUrlVo sysProUrlVo = selectUrlByKey.getData(); |
|
|
|
messageFlowableDto.setBusinessSid(baseOutsourcingApplication.getSid()); |
|
|
|
messageFlowableDto.setApp_type("2"); |
|
|
|
if (sysProUrlVo.getUrl().contains("#")) { |
|
|
|
messageFlowableDto.setModuleAction(Arrays.asList(sysProUrlVo.getUrl().split("#")).get(0)); |
|
|
|
List<Integer> codesInteger = Arrays.asList(Arrays.asList(sysProUrlVo.getUrl().split("#")).get(1).split(",")).stream().map(Integer::parseInt).collect(Collectors.toList()); |
|
|
|
int[] ints = codesInteger.stream().mapToInt(Integer::valueOf).toArray(); |
|
|
|
messageJsonDto.setButtons(ints); |
|
|
|
} else { |
|
|
|
messageFlowableDto.setModuleAction(sysProUrlVo.getUrl()); |
|
|
|
} |
|
|
|
messageFlowableDto.setModuleSid(Arrays.asList(sysProUrlVo.getModulePluginName().split("#")).get(0)); |
|
|
|
messageJsonDto.setTaskName(ufVo.getNodeState()); |
|
|
|
messageJsonDto.setProcInsId(ufVo.getProcInsId()); |
|
|
|
messageJsonDto.setAppMap(appMap); |
|
|
|
messageFlowableDto.setJson(messageJsonDto); |
|
|
|
messageFlowableDto.setList(receiveSidList); |
|
|
|
messageFlowableDto.setReceiveIdList(reveiveIdList); |
|
|
|
messageFlowableDto.setModuleName("外采申请"); |
|
|
|
messageFlowableDto.setMsgContent("外采申请"); |
|
|
|
messageFlowableDto.setMsgTitle("外采申请"); |
|
|
|
messageFlowableDto.setCreateName(baseOutsourcingApplication.getCreateByName()); |
|
|
|
messageFlowableDto.setTaskId(ufVo.getTaskId()); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.getMessage(messageFlowableDto); |
|
|
|
String msgSid = stringResultBean.getData(); |
|
|
|
return msgSid; |
|
|
|
|
|
|
|
} |
|
|
|
} |