提交 9a900571 authored 作者: wangkr's avatar wangkr

update

上级 50050838
File mode changed from 100644 to 100755
......@@ -11,6 +11,7 @@ import org.rcisoft.common.BaseStationStatus;
import org.rcisoft.business.userwarning.service.UserWarningService;
import org.rcisoft.common.ProcessMapBpmn;
import org.rcisoft.core.component.CyApplicationContextHolder;
import org.rcisoft.core.util.CyUserUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......@@ -32,6 +33,10 @@ public class StartProcessHelper {
public static final String CHOOSE = "choose";//选择流程
public static final String RID = "rid";//角色
public static final String DID = "did";//部门
//流程状态
public static final String UNCOMMITTED = "0";//未提交
......@@ -126,6 +131,8 @@ public class StartProcessHelper {
log.debug("全局点击信息:" + jzMessage.getTransition());
variables.put(CyWfConstants.PROCESS_TASK_TRANSITION, jzMessage.getTransition());
variables.put(PARAM, jzMessage.getTransition());
variables.put(RID, CyUserUtil.getAuthenRoleStr());
variables.put(DID,CyUserUtil.getAuthenDept());
if (jzMessage.getSelect() != null) {
variables.put(CHOOSE, jzMessage.getSelect());
}
......@@ -156,7 +163,6 @@ public class StartProcessHelper {
if (!qdSpecialProcess().contains(jzMessage.getSelect())){
jzMessageRepository.updateJzMessage(jzMessage);
}
//通过流程图id创建流程实例
return cyWfServiceImpl.startProcessByKey(processKey, jzMessage.getBusinessId(), jzMessage.getVariables(), true, jzMessage.getVariablesLocal());
}
......
......@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.parameters.P;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
......@@ -334,5 +335,16 @@ public class JzMessageController extends CyPaginationController<JzMessage> {
CyMessCons.MESSAGE_ALERT_ERROR,
jzMessageServiceImpl.cancelNeed(jzMessage));
}
/**
* 根据项目编号和模板类型判断当前流程是否结束
*/
@ApiOperation(value = "查询当前流程是否结束",notes = "查询当前流程是否结束")
@GetMapping(value = "/processIsEnd")
public CyResult processIsEnd(@RequestParam("projectCode") String projectCode,@RequestParam("templateType")String templateType){
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
jzMessageServiceImpl.processIsEnd(templateType,projectCode));
}
}
......@@ -6,6 +6,7 @@ import org.rcisoft.business.userwarning.entity.UserWarning;
import org.rcisoft.core.base.CyBaseMapper;
import org.rcisoft.business.jzmessage.entity.JzMessage;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
......@@ -487,6 +488,14 @@ public interface JzMessageRepository extends CyBaseMapper<JzMessage> {
" AND jz_message.business_id !=#{businessId} </script>")
List<String> queryprojectCodeByBusinessId(JzMessage jzMessage);
/*
* 根据code查询是基站id
* */
@Select("<script>SELECT jz_message.business_id FROM jz_message where 1=1 " +
"<if test=\"delFlag !=null and delFlag != '' \">and del_flag = #{delFlag} </if> " +
"<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if> " +
" AND jz_message.project_code =#{projectCode} </script>")
List<String> selectPorjectCodeByBusinessId(JzMessage jzMessage);
/**
* 查询所有项目编号
* @param
......@@ -548,18 +557,71 @@ public interface JzMessageRepository extends CyBaseMapper<JzMessage> {
@Select("<script>select * from jz_message where king_number = #{KingNumber}</script>")
@ResultMap(value = "BaseResultMap")
List<JzMessage> selectJztypeByKingNumber(@Param("KingNumber") String KingNumber);
/*
/**
* 查询可以自动走流程的基站
*/
/**
* 查询可以自动走流程的基站
*//*
@Select("<script>select * from jz_message where 1 = 1" +
"<if test=\"delflag != null and delflag != ''\">AND del_flag = #{delFlag}</if>" +
"<if test=\"flag != null and flag != ''\">AND flag = #{flag}</if>" +
"AND is_can_run_process = #{isCanRunProcess}" +
"AND is_can_run_process IS NOT NULL" +
"AND jz_type IN ('1','2')" +
"ORDER BY update_date</script>")
"ORDER BY update_date" +
"LIMIT 100</script>")
@ResultMap(value = "BaseResultMap")
List<JzMessage> queryIsCanRunProcessJzMessage(JzMessage jzMessage);
*/
/**
* 判断流程是否结束
* @param templateType
* @param projectCode
* @return
*/
@Select("<script>SELECT " +
"jz_message.* " +
"FROM " +
"jz_message " +
"LEFT JOIN process_mid ON jz_message.business_id = process_mid.jz_message_id " +
"LEFT JOIN ACT_HI_PROCINST ON process_mid.process_id = ACT_HI_PROCINST.ID_ " +
"WHERE " +
"ACT_HI_PROCINST.END_TIME_ IS NULL " +
"AND ACT_HI_PROCINST.ID_ = ( " +
"SELECT " +
"pd.process_id " +
"FROM " +
"process_mid pd " +
"WHERE " +
"pd.type_template = #{templateType} " +
"AND pd.jz_message_id = ( " +
"SELECT " +
"jm.business_id " +
"FROM " +
"jz_message jm " +
"WHERE " +
"jm.project_code = #{projectCode} " +
") " +
"AND pd.version = ( " +
"SELECT " +
"MAX(version) " +
"FROM " +
"process_mid pd1 " +
"WHERE " +
"pd1.type_template = #{templateType} " +
"AND pd1.jz_message_id = ( " +
"SELECT " +
"business_id " +
"FROM " +
"jz_message jm1 " +
"WHERE " +
"jm1.project_code = #{projectCode} " +
") " +
") " +
") </script>")
List<JzMessage> processIsEnd(@Param("templateType")String templateType,@Param("projectCode") String projectCode);
}
......@@ -988,6 +988,10 @@ public class JzMessage extends CyIdEntity<JzMessage> {
//金蝶单据编号
private String originalProState;
/* //是否可以执行流程
private String isCanRunProcess;*/
/* //金蝶项目编号是否可以导入
private Integer project_code_import;
......
......@@ -143,4 +143,13 @@ public interface JzMessageService {
* @return
*/
CyResult cancelNeed(JzMessage jzMessage);
/**
* 判断当前流程是否结束
* @param templateType
* @param projectCode
* @return
*/
Boolean processIsEnd(String templateType,String projectCode);
}
......@@ -312,11 +312,11 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ
break;
}
}
/* *//*如果是金蝶跑流程*//*
if (StringUtils.isNotEmpty(jzMessage.getProjectCode())) {
/*如果是金蝶跑流程*/
if (StringUtils.isNotEmpty(jzMessage.getProjectCode())&&StringUtils.isEmpty(jzMessage.getBusinessId())) {
String businessId = this.selectBusinessIdByProjectCode(jzMessage);
jzMessage.setBusinessId(businessId);
}*/
}
log.debug("当前登录人id:" + userBid);
JzMessage myJzMessage = jzMessageRepository.selectByPrimaryKey(jzMessage.getBusinessId());
if ("0".equals(myJzMessage.getJzType())) {
......@@ -351,10 +351,10 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ
//是否当前登录人启动自己的业务
throw new CyServiceException(ResultServiceExceptionEnums.NOT_CUR_USER);
}
/* if (!CollectionUtils.isEmpty(processMidRepository.queryCurProExist(myJzMessage))) {
if (!CollectionUtils.isEmpty(processMidRepository.queryCurProExist(myJzMessage))) {
//当前阶段 是否有未结束的流程
throw new CyServiceException(ResultServiceExceptionEnums.START_PROCESS_ERROR);
}*/
}
//判断项目编号是否重复
this.isRepeatProjectCode(jzMessage);
//启动流程实例
......@@ -367,7 +367,10 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ
jzMessage.setTaskId(taskModel.getTask().getId());
jzMessage.setProcessId(taskModel.getProcessInstance().getId());
jzMessage.setCreateDate(jzMessage1.getCreateDate());
messsageService.uploadJzMes(jzMessage);
CyPersistModel cyPersistModel = messsageService.uploadJzMes(jzMessage);
if (cyPersistModel.getInfluence()<1){
return cyPersistModel;
}
} else {
WorkflowTaskDateMes dateMes = new WorkflowTaskDateMes();
dateMes.setTaskId(taskModel.getTask().getId());//获取任务id
......@@ -376,7 +379,10 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ
dateMes.setRemarks(jzMessage.getMsgRemarks());//备注
dateMes.setTransition(jzMessage.getTransition());//提交信息
dateMes.setProcessId(taskModel.getProcessInstance().getId());
taskServiceImpl.insertDataMesByTaskId(dateMes);
CyPersistModel cyPersistModel = taskServiceImpl.insertDataMesByTaskId(dateMes);
if (cyPersistModel.getInfluence()<1){
return cyPersistModel;
}
}
//插入中间表数据
ProcessMid processMid = new ProcessMid();
......@@ -402,14 +408,17 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ
} else {
processMid.setVersion(String.valueOf(Integer.valueOf(version) + 1));
}
processMidServiceImpl.save(processMid);
CyPersistModel save = processMidServiceImpl.save(processMid);
if (save.getInfluence()<1){
return save;
}
return new CyPersistModel(1);
}
/* *//**
/**
* 根据项目编号查询基站是否存在
*
*//*
*/
public String selectBusinessIdByProjectCode(JzMessage jzMessage){
List<String> businessId = jzMessageRepository.selectPorjectCodeByBusinessId(jzMessage);
if (businessId.size()>1) {
......@@ -420,7 +429,7 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ
return businessId.get(0);
}
};*/
};
/**
* 完成任务
*
......@@ -431,10 +440,10 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ
@Override
public CyPersistModel completeTask(JzMessage jzMessage) {
/*如果是金蝶跑流程*/
/* if (StringUtils.isNotEmpty(jzMessage.getProjectCode())) {
if (StringUtils.isNotEmpty(jzMessage.getProjectCode())&&StringUtils.isEmpty(jzMessage.getBusinessId())) {
String businessId = this.selectBusinessIdByProjectCode(jzMessage);
jzMessage.setBusinessId(businessId);
}*/
}
//设置完成任务变量
JzMessage myJzmessage = helper.setVariables(jzMessage);
String taskId = jzMessage.getTaskId();
......@@ -1183,12 +1192,12 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ
return new CyPersistModel(1);
}
/* *//**
/**
* 判断当前流程是否结束
* @param templateType
* @param projectCode
* @return
*//*
*/
@Override
public Boolean processIsEnd(String templateType, String projectCode) {
boolean i = true;
......@@ -1197,5 +1206,5 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ
i =false;
}
return i;
}*/
}
}
\ No newline at end of file
......@@ -9,6 +9,7 @@ package org.rcisoft.business.kingdee.timeTask;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.rcisoft.business.jzmessage.dao.JzMessageRepository;
import org.rcisoft.business.jzmessage.entity.JzMessage;
import org.rcisoft.business.kingdee.commom.K3CloundConfig;
......@@ -20,6 +21,7 @@ import org.rcisoft.business.kingdee.service.KingdeeService;
import org.rcisoft.business.kingdee.service.impl.KingDeeMyselfProCodeServiceImpl;
import org.rcisoft.business.kingdee.service.impl.KingdeeMyselfServiceImpl;
import org.rcisoft.business.kingdee.until.BaseUtil;
import org.rcisoft.business.processDesign.service.impl.ProcessServiceImpl;
import org.rcisoft.core.result.CyResult;
import org.rcisoft.core.service.CyBaseService;
import org.rcisoft.core.util.CyUserUtil;
......@@ -55,11 +57,14 @@ public class TimerTask extends CyBaseService {
private KingdeeMyselfServiceImpl kingdeeMyselfService;
@Autowired
private KingDeeMyselfProCodeServiceImpl kingDeeMyselfProCodeService;
@Autowired
private ProcessServiceImpl processService;
private static final String POST_K3CloudUR = "";
@Scheduled(cron = "0 0/5 * * * ?")
// @Scheduled(cron = "0 0/15 * * * ?")
// @Scheduled(cron = "0 0/1 * * * ?")
@Scheduled(cron = "0 0/15 * * * ?")
@Async("executor1")
public void login() throws IOException {
......@@ -85,4 +90,35 @@ public class TimerTask extends CyBaseService {
}
/* *//**
* 是否允许自动走流程(0:可以,1:不可以)
*//*
public void runProcess() {
JzMessage jz = new JzMessage();
jz.setIsCanRunProcess("0");
jz.setNormal();
//通过标志位和判断启用和删除标志查询铁塔或移动数据按照修改时间查询前100条
List<JzMessage> jzMessages = jzMessageRepository.queryIsCanRunProcessJzMessage(jz);
if (jzMessages.size()==0){
//基站为空直接结束定时任务
log.debug("无数据可执行流程");
this.dbInfo("无数据可执行流程");
return;
}
for (JzMessage jzMessage : jzMessages) {
if (StringUtils.isNotEmpty(jzMessage.getJzState()) && StringUtils.isNotEmpty(jzMessage.getType())) {
processService.runProcess(jzMessage);
}else {
log.debug("此条基站状态或者类型为空,项目编号为"+jzMessage.getProjectCode()+"实体主键为"+jzMessage.getBusinessId());
this.dbError("此条基站状态或者类型为空,项目编号为"+jzMessage.getProjectCode()+"实体主键为"+jzMessage.getBusinessId());
continue;
}
}
}*/
}
......@@ -78,7 +78,6 @@ public class BaseUtil {
//获取区域
Map f_area = (Map) model.get("F_Area");
f_area.put("FNUMBER", jzMessage.getJzQy());
log.error("111111111111111111111111111111111"+f_area);
for (String s : SDictionaryServiceImpl.kingDeeDeptMap.keySet()) {
if (s.equals(jzMessage.getJzCurDept())) {
//获取业务组织必填
......@@ -132,6 +131,7 @@ public class BaseUtil {
//获取修改时间
model.put("FModifyDate", PropertiesUtils.kingDeeTime(jzMessage.getUpdateDate()));
basic.put("Model", model);
log.info("-----------------------------------"+model);
JSONObject jsonObject = new JSONObject();
jsonObject.put("formid", formid);
jsonObject.put("data", JSON.toJSONString(basic));
......
......@@ -107,6 +107,11 @@ public class HttpUtil {
}
/**
*
* http://36.110.39.213:8989/Home/Index/getProNumber?formid=PAEZ_ProjectNo&number=测试测试111
* http://36.110.39.213:8989/Home/Index/getContractNumber?formid=PAEZ_ProjectNo&projectCode=YTTT-4-LTBQ-19001
*/
/**
* 发送Get请求
......
......@@ -43,6 +43,6 @@ public interface WorkflowTaskDataHiRepository extends CyBaseMapper<WorkflowTaskD
"#{item.fieldValue}, " +
"#{item.taskDataMesId})</foreach>" +
"</script>")
void insertList(@Param("datahi") List<WorkflowTaskDataHi> datahi);
int insertList(@Param("datahi") List<WorkflowTaskDataHi> datahi);
}
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
差异被折叠。
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
差异被折叠。
File mode changed from 100644 to 100755
差异被折叠。
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论