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

update

上级 50050838
File mode changed from 100644 to 100755
...@@ -11,6 +11,7 @@ import org.rcisoft.common.BaseStationStatus; ...@@ -11,6 +11,7 @@ import org.rcisoft.common.BaseStationStatus;
import org.rcisoft.business.userwarning.service.UserWarningService; import org.rcisoft.business.userwarning.service.UserWarningService;
import org.rcisoft.common.ProcessMapBpmn; import org.rcisoft.common.ProcessMapBpmn;
import org.rcisoft.core.component.CyApplicationContextHolder; import org.rcisoft.core.component.CyApplicationContextHolder;
import org.rcisoft.core.util.CyUserUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -32,6 +33,10 @@ public class StartProcessHelper { ...@@ -32,6 +33,10 @@ public class StartProcessHelper {
public static final String CHOOSE = "choose";//选择流程 public static final String CHOOSE = "choose";//选择流程
public static final String RID = "rid";//角色
public static final String DID = "did";//部门
//流程状态 //流程状态
public static final String UNCOMMITTED = "0";//未提交 public static final String UNCOMMITTED = "0";//未提交
...@@ -126,6 +131,8 @@ public class StartProcessHelper { ...@@ -126,6 +131,8 @@ public class StartProcessHelper {
log.debug("全局点击信息:" + jzMessage.getTransition()); log.debug("全局点击信息:" + jzMessage.getTransition());
variables.put(CyWfConstants.PROCESS_TASK_TRANSITION, jzMessage.getTransition()); variables.put(CyWfConstants.PROCESS_TASK_TRANSITION, jzMessage.getTransition());
variables.put(PARAM, jzMessage.getTransition()); variables.put(PARAM, jzMessage.getTransition());
variables.put(RID, CyUserUtil.getAuthenRoleStr());
variables.put(DID,CyUserUtil.getAuthenDept());
if (jzMessage.getSelect() != null) { if (jzMessage.getSelect() != null) {
variables.put(CHOOSE, jzMessage.getSelect()); variables.put(CHOOSE, jzMessage.getSelect());
} }
...@@ -156,7 +163,6 @@ public class StartProcessHelper { ...@@ -156,7 +163,6 @@ public class StartProcessHelper {
if (!qdSpecialProcess().contains(jzMessage.getSelect())){ if (!qdSpecialProcess().contains(jzMessage.getSelect())){
jzMessageRepository.updateJzMessage(jzMessage); jzMessageRepository.updateJzMessage(jzMessage);
} }
//通过流程图id创建流程实例 //通过流程图id创建流程实例
return cyWfServiceImpl.startProcessByKey(processKey, jzMessage.getBusinessId(), jzMessage.getVariables(), true, jzMessage.getVariablesLocal()); return cyWfServiceImpl.startProcessByKey(processKey, jzMessage.getBusinessId(), jzMessage.getVariables(), true, jzMessage.getVariablesLocal());
} }
......
...@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder; 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.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
...@@ -334,5 +335,16 @@ public class JzMessageController extends CyPaginationController<JzMessage> { ...@@ -334,5 +335,16 @@ public class JzMessageController extends CyPaginationController<JzMessage> {
CyMessCons.MESSAGE_ALERT_ERROR, CyMessCons.MESSAGE_ALERT_ERROR,
jzMessageServiceImpl.cancelNeed(jzMessage)); 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; ...@@ -6,6 +6,7 @@ import org.rcisoft.business.userwarning.entity.UserWarning;
import org.rcisoft.core.base.CyBaseMapper; import org.rcisoft.core.base.CyBaseMapper;
import org.rcisoft.business.jzmessage.entity.JzMessage; import org.rcisoft.business.jzmessage.entity.JzMessage;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List; import java.util.List;
...@@ -487,6 +488,14 @@ public interface JzMessageRepository extends CyBaseMapper<JzMessage> { ...@@ -487,6 +488,14 @@ public interface JzMessageRepository extends CyBaseMapper<JzMessage> {
" AND jz_message.business_id !=#{businessId} </script>") " AND jz_message.business_id !=#{businessId} </script>")
List<String> queryprojectCodeByBusinessId(JzMessage jzMessage); 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 * @param
...@@ -548,18 +557,71 @@ public interface JzMessageRepository extends CyBaseMapper<JzMessage> { ...@@ -548,18 +557,71 @@ public interface JzMessageRepository extends CyBaseMapper<JzMessage> {
@Select("<script>select * from jz_message where king_number = #{KingNumber}</script>") @Select("<script>select * from jz_message where king_number = #{KingNumber}</script>")
@ResultMap(value = "BaseResultMap") @ResultMap(value = "BaseResultMap")
List<JzMessage> selectJztypeByKingNumber(@Param("KingNumber") String KingNumber); List<JzMessage> selectJztypeByKingNumber(@Param("KingNumber") String KingNumber);
/*
/** */
/**
* 查询可以自动走流程的基站 * 查询可以自动走流程的基站
*/ *//*
@Select("<script>select * from jz_message where 1 = 1" + @Select("<script>select * from jz_message where 1 = 1" +
"<if test=\"delflag != null and delflag != ''\">AND del_flag = #{delFlag}</if>" + "<if test=\"delflag != null and delflag != ''\">AND del_flag = #{delFlag}</if>" +
"<if test=\"flag != null and flag != ''\">AND flag = #{flag}</if>" + "<if test=\"flag != null and flag != ''\">AND flag = #{flag}</if>" +
"AND is_can_run_process = #{isCanRunProcess}" + "AND is_can_run_process = #{isCanRunProcess}" +
"AND is_can_run_process IS NOT NULL" + "AND is_can_run_process IS NOT NULL" +
"AND jz_type IN ('1','2')" + "AND jz_type IN ('1','2')" +
"ORDER BY update_date</script>") "ORDER BY update_date" +
"LIMIT 100</script>")
@ResultMap(value = "BaseResultMap") @ResultMap(value = "BaseResultMap")
List<JzMessage> queryIsCanRunProcessJzMessage(JzMessage jzMessage); 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> { ...@@ -988,6 +988,10 @@ public class JzMessage extends CyIdEntity<JzMessage> {
//金蝶单据编号 //金蝶单据编号
private String originalProState; private String originalProState;
/* //是否可以执行流程
private String isCanRunProcess;*/
/* //金蝶项目编号是否可以导入 /* //金蝶项目编号是否可以导入
private Integer project_code_import; private Integer project_code_import;
......
...@@ -143,4 +143,13 @@ public interface JzMessageService { ...@@ -143,4 +143,13 @@ public interface JzMessageService {
* @return * @return
*/ */
CyResult cancelNeed(JzMessage jzMessage); 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 ...@@ -312,11 +312,11 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ
break; break;
} }
} }
/* *//*如果是金蝶跑流程*//* /*如果是金蝶跑流程*/
if (StringUtils.isNotEmpty(jzMessage.getProjectCode())) { if (StringUtils.isNotEmpty(jzMessage.getProjectCode())&&StringUtils.isEmpty(jzMessage.getBusinessId())) {
String businessId = this.selectBusinessIdByProjectCode(jzMessage); String businessId = this.selectBusinessIdByProjectCode(jzMessage);
jzMessage.setBusinessId(businessId); jzMessage.setBusinessId(businessId);
}*/ }
log.debug("当前登录人id:" + userBid); log.debug("当前登录人id:" + userBid);
JzMessage myJzMessage = jzMessageRepository.selectByPrimaryKey(jzMessage.getBusinessId()); JzMessage myJzMessage = jzMessageRepository.selectByPrimaryKey(jzMessage.getBusinessId());
if ("0".equals(myJzMessage.getJzType())) { if ("0".equals(myJzMessage.getJzType())) {
...@@ -351,10 +351,10 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ ...@@ -351,10 +351,10 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ
//是否当前登录人启动自己的业务 //是否当前登录人启动自己的业务
throw new CyServiceException(ResultServiceExceptionEnums.NOT_CUR_USER); 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); throw new CyServiceException(ResultServiceExceptionEnums.START_PROCESS_ERROR);
}*/ }
//判断项目编号是否重复 //判断项目编号是否重复
this.isRepeatProjectCode(jzMessage); this.isRepeatProjectCode(jzMessage);
//启动流程实例 //启动流程实例
...@@ -367,7 +367,10 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ ...@@ -367,7 +367,10 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ
jzMessage.setTaskId(taskModel.getTask().getId()); jzMessage.setTaskId(taskModel.getTask().getId());
jzMessage.setProcessId(taskModel.getProcessInstance().getId()); jzMessage.setProcessId(taskModel.getProcessInstance().getId());
jzMessage.setCreateDate(jzMessage1.getCreateDate()); jzMessage.setCreateDate(jzMessage1.getCreateDate());
messsageService.uploadJzMes(jzMessage); CyPersistModel cyPersistModel = messsageService.uploadJzMes(jzMessage);
if (cyPersistModel.getInfluence()<1){
return cyPersistModel;
}
} else { } else {
WorkflowTaskDateMes dateMes = new WorkflowTaskDateMes(); WorkflowTaskDateMes dateMes = new WorkflowTaskDateMes();
dateMes.setTaskId(taskModel.getTask().getId());//获取任务id dateMes.setTaskId(taskModel.getTask().getId());//获取任务id
...@@ -376,7 +379,10 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ ...@@ -376,7 +379,10 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ
dateMes.setRemarks(jzMessage.getMsgRemarks());//备注 dateMes.setRemarks(jzMessage.getMsgRemarks());//备注
dateMes.setTransition(jzMessage.getTransition());//提交信息 dateMes.setTransition(jzMessage.getTransition());//提交信息
dateMes.setProcessId(taskModel.getProcessInstance().getId()); dateMes.setProcessId(taskModel.getProcessInstance().getId());
taskServiceImpl.insertDataMesByTaskId(dateMes); CyPersistModel cyPersistModel = taskServiceImpl.insertDataMesByTaskId(dateMes);
if (cyPersistModel.getInfluence()<1){
return cyPersistModel;
}
} }
//插入中间表数据 //插入中间表数据
ProcessMid processMid = new ProcessMid(); ProcessMid processMid = new ProcessMid();
...@@ -402,14 +408,17 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ ...@@ -402,14 +408,17 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ
} else { } else {
processMid.setVersion(String.valueOf(Integer.valueOf(version) + 1)); 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); return new CyPersistModel(1);
} }
/* *//** /**
* 根据项目编号查询基站是否存在 * 根据项目编号查询基站是否存在
* *
*//* */
public String selectBusinessIdByProjectCode(JzMessage jzMessage){ public String selectBusinessIdByProjectCode(JzMessage jzMessage){
List<String> businessId = jzMessageRepository.selectPorjectCodeByBusinessId(jzMessage); List<String> businessId = jzMessageRepository.selectPorjectCodeByBusinessId(jzMessage);
if (businessId.size()>1) { if (businessId.size()>1) {
...@@ -420,7 +429,7 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ ...@@ -420,7 +429,7 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ
return businessId.get(0); return businessId.get(0);
} }
};*/ };
/** /**
* 完成任务 * 完成任务
* *
...@@ -431,10 +440,10 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ ...@@ -431,10 +440,10 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ
@Override @Override
public CyPersistModel completeTask(JzMessage jzMessage) { public CyPersistModel completeTask(JzMessage jzMessage) {
/*如果是金蝶跑流程*/ /*如果是金蝶跑流程*/
/* if (StringUtils.isNotEmpty(jzMessage.getProjectCode())) { if (StringUtils.isNotEmpty(jzMessage.getProjectCode())&&StringUtils.isEmpty(jzMessage.getBusinessId())) {
String businessId = this.selectBusinessIdByProjectCode(jzMessage); String businessId = this.selectBusinessIdByProjectCode(jzMessage);
jzMessage.setBusinessId(businessId); jzMessage.setBusinessId(businessId);
}*/ }
//设置完成任务变量 //设置完成任务变量
JzMessage myJzmessage = helper.setVariables(jzMessage); JzMessage myJzmessage = helper.setVariables(jzMessage);
String taskId = jzMessage.getTaskId(); String taskId = jzMessage.getTaskId();
...@@ -1183,12 +1192,12 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ ...@@ -1183,12 +1192,12 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ
return new CyPersistModel(1); return new CyPersistModel(1);
} }
/* *//** /**
* 判断当前流程是否结束 * 判断当前流程是否结束
* @param templateType * @param templateType
* @param projectCode * @param projectCode
* @return * @return
*//* */
@Override @Override
public Boolean processIsEnd(String templateType, String projectCode) { public Boolean processIsEnd(String templateType, String projectCode) {
boolean i = true; boolean i = true;
...@@ -1197,5 +1206,5 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ ...@@ -1197,5 +1206,5 @@ public class JzMessageServiceImpl extends CyBaseService implements JzMessageServ
i =false; i =false;
} }
return i; return i;
}*/ }
} }
\ No newline at end of file
...@@ -9,6 +9,7 @@ package org.rcisoft.business.kingdee.timeTask; ...@@ -9,6 +9,7 @@ package org.rcisoft.business.kingdee.timeTask;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.rcisoft.business.jzmessage.dao.JzMessageRepository; import org.rcisoft.business.jzmessage.dao.JzMessageRepository;
import org.rcisoft.business.jzmessage.entity.JzMessage; import org.rcisoft.business.jzmessage.entity.JzMessage;
import org.rcisoft.business.kingdee.commom.K3CloundConfig; import org.rcisoft.business.kingdee.commom.K3CloundConfig;
...@@ -20,6 +21,7 @@ import org.rcisoft.business.kingdee.service.KingdeeService; ...@@ -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.KingDeeMyselfProCodeServiceImpl;
import org.rcisoft.business.kingdee.service.impl.KingdeeMyselfServiceImpl; import org.rcisoft.business.kingdee.service.impl.KingdeeMyselfServiceImpl;
import org.rcisoft.business.kingdee.until.BaseUtil; 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.result.CyResult;
import org.rcisoft.core.service.CyBaseService; import org.rcisoft.core.service.CyBaseService;
import org.rcisoft.core.util.CyUserUtil; import org.rcisoft.core.util.CyUserUtil;
...@@ -55,12 +57,15 @@ public class TimerTask extends CyBaseService { ...@@ -55,12 +57,15 @@ public class TimerTask extends CyBaseService {
private KingdeeMyselfServiceImpl kingdeeMyselfService; private KingdeeMyselfServiceImpl kingdeeMyselfService;
@Autowired @Autowired
private KingDeeMyselfProCodeServiceImpl kingDeeMyselfProCodeService; private KingDeeMyselfProCodeServiceImpl kingDeeMyselfProCodeService;
@Autowired
private ProcessServiceImpl processService;
private static final String POST_K3CloudUR = ""; private static final String POST_K3CloudUR = "";
@Scheduled(cron = "0 0/5 * * * ?") // @Scheduled(cron = "0 0/1 * * * ?")
// @Scheduled(cron = "0 0/15 * * * ?") @Scheduled(cron = "0 0/15 * * * ?")
@Async("executor1") @Async("executor1")
public void login() throws IOException { public void login() throws IOException {
//登录金蝶系统 //登录金蝶系统
...@@ -68,7 +73,7 @@ public class TimerTask extends CyBaseService { ...@@ -68,7 +73,7 @@ public class TimerTask extends CyBaseService {
String loginParam = BaseUtil.buildLogin(k3CloundConfig.getDBid(), k3CloundConfig.getUsername(), k3CloundConfig.getPassword(), k3CloundConfig.getIcon()); String loginParam = BaseUtil.buildLogin(k3CloundConfig.getDBid(), k3CloundConfig.getUsername(), k3CloundConfig.getPassword(), k3CloundConfig.getIcon());
CyResult login = kingdeeService.login(k3CloundConfig.getUrl() + k3CloundConfig.getLogin(), loginParam); CyResult login = kingdeeService.login(k3CloundConfig.getUrl() + k3CloundConfig.getLogin(), loginParam);
if (login.getCode() == 400) { if (login.getCode() == 400) {
// this.dbError("登录金蝶系统失败" +login.getMessage()); // this.dbError("登录金蝶系统失败" +login.getMessage());
log.info("【登录金蝶系统失败】:{}", login.getMessage()); log.info("【登录金蝶系统失败】:{}", login.getMessage());
return; return;
} }
...@@ -85,4 +90,35 @@ public class TimerTask extends CyBaseService { ...@@ -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 { ...@@ -78,7 +78,6 @@ public class BaseUtil {
//获取区域 //获取区域
Map f_area = (Map) model.get("F_Area"); Map f_area = (Map) model.get("F_Area");
f_area.put("FNUMBER", jzMessage.getJzQy()); f_area.put("FNUMBER", jzMessage.getJzQy());
log.error("111111111111111111111111111111111"+f_area);
for (String s : SDictionaryServiceImpl.kingDeeDeptMap.keySet()) { for (String s : SDictionaryServiceImpl.kingDeeDeptMap.keySet()) {
if (s.equals(jzMessage.getJzCurDept())) { if (s.equals(jzMessage.getJzCurDept())) {
//获取业务组织必填 //获取业务组织必填
...@@ -132,6 +131,7 @@ public class BaseUtil { ...@@ -132,6 +131,7 @@ public class BaseUtil {
//获取修改时间 //获取修改时间
model.put("FModifyDate", PropertiesUtils.kingDeeTime(jzMessage.getUpdateDate())); model.put("FModifyDate", PropertiesUtils.kingDeeTime(jzMessage.getUpdateDate()));
basic.put("Model", model); basic.put("Model", model);
log.info("-----------------------------------"+model);
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("formid", formid); jsonObject.put("formid", formid);
jsonObject.put("data", JSON.toJSONString(basic)); jsonObject.put("data", JSON.toJSONString(basic));
......
...@@ -107,6 +107,11 @@ public class HttpUtil { ...@@ -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请求 * 发送Get请求
......
...@@ -43,6 +43,6 @@ public interface WorkflowTaskDataHiRepository extends CyBaseMapper<WorkflowTaskD ...@@ -43,6 +43,6 @@ public interface WorkflowTaskDataHiRepository extends CyBaseMapper<WorkflowTaskD
"#{item.fieldValue}, " + "#{item.fieldValue}, " +
"#{item.taskDataMesId})</foreach>" + "#{item.taskDataMesId})</foreach>" +
"</script>") "</script>")
void insertList(@Param("datahi") List<WorkflowTaskDataHi> datahi); int insertList(@Param("datahi") List<WorkflowTaskDataHi> datahi);
} }
package org.rcisoft.business.processDesign.service.impl; package org.rcisoft.business.processDesign.service.impl;
import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.TaskService;
import org.activiti.engine.task.Task;
import org.activiti.model.CyPIAndTaskModel;
import org.activiti.service.impl.CyWfServiceImpl;
import org.rcisoft.business.jzmessage.common.StartProcessHelper;
import org.rcisoft.business.jzmessage.common.TypeEnum; import org.rcisoft.business.jzmessage.common.TypeEnum;
import org.rcisoft.business.jzmessage.dao.JzMessageRepository; import org.rcisoft.business.jzmessage.dao.JzMessageRepository;
import org.rcisoft.business.jzmessage.entity.JzMessage; import org.rcisoft.business.jzmessage.entity.JzMessage;
import org.rcisoft.business.processDesign.dao.WorkflowTemplateApproveHiRepository; import org.rcisoft.business.processDesign.dao.*;
import org.rcisoft.business.processDesign.dao.WorkflowTemplateFormFieldHiRepository;
import org.rcisoft.business.processDesign.dao.WorkflowTemplateHiRepository;
import org.rcisoft.business.processDesign.dao.WorkflowTemplatePermissionHiRepository;
import org.rcisoft.business.processDesign.dto.TemplateMsgDTO;
import org.rcisoft.business.processDesign.dto.WorkTemplateResDTO;
import org.rcisoft.business.processDesign.entity.*; import org.rcisoft.business.processDesign.entity.*;
import org.rcisoft.business.processDesign.service.ProcessService; import org.rcisoft.business.processDesign.service.ProcessService;
import org.rcisoft.common.BaseStationStatus; import org.rcisoft.common.BaseStationStatus;
import org.rcisoft.common.ProcessMapBpmn; import org.rcisoft.common.ProcessMapBpmn;
import org.rcisoft.common.StateTypeTemplateMD;
import org.rcisoft.common.StateTypeTemplateTT;
import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.util.CyIdGenUtil;
import org.rcisoft.core.util.CyUserUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.*;
import static org.rcisoft.business.jzmessage.common.StartProcessHelper.APPROVALPENDING;
/** /**
...@@ -27,9 +35,9 @@ import java.util.List; ...@@ -27,9 +35,9 @@ import java.util.List;
* @Date: Created in 13:36 2019/7/29 * @Date: Created in 13:36 2019/7/29
* @Modified By: * @Modified By:
*/ */
@Slf4j
@Service @Service
@Transactional
public class ProcessServiceImpl implements ProcessService { public class ProcessServiceImpl implements ProcessService {
@Autowired @Autowired
WorkflowTemplateHiRepository workflowTemplateHiRepository; WorkflowTemplateHiRepository workflowTemplateHiRepository;
...@@ -41,14 +49,34 @@ public class ProcessServiceImpl implements ProcessService { ...@@ -41,14 +49,34 @@ public class ProcessServiceImpl implements ProcessService {
WorkflowTemplateApproveHiRepository workflowTemplateApproveHiRepository; WorkflowTemplateApproveHiRepository workflowTemplateApproveHiRepository;
@Autowired @Autowired
JzMessageRepository jzMessageRepository; JzMessageRepository jzMessageRepository;
@Autowired
StartProcessHelper helper;
@Autowired
CyWfServiceImpl cyWfServiceImpl;
@Autowired
TaskService taskService;
@Autowired
ProcessMidRepository processMidRepository;
@Autowired
WorkflowTaskDateMesRepository workflowTaskDateMesRepository;
@Autowired
WorkflowTaskDataHiRepository workflowTaskDataHiRepository;
@Autowired
WorkflowTaskDataRepository workflowTaskDataRepository;
private static final String value = null;
private static final String message = "通过";
private static final List<String> taskIdS = new ArrayList<>();
//开始流程返回页面信息 //开始流程返回页面信息
@Transactional
@Override @Override
public List<WorkflowTemplateFormFieldHi> startProcess(String typeTemplate) { public List<WorkflowTemplateFormFieldHi> startProcess(String typeTemplate) {
List<WorkflowTemplateFormFieldHi> getFieldMes = workflowTemplateFormFieldHiRepository.getFieldMes(typeTemplate); List<WorkflowTemplateFormFieldHi> getFieldMes = workflowTemplateFormFieldHiRepository.getFieldMes(typeTemplate);
return getFieldMes; return getFieldMes;
} }
//拆站流程返回信息交维前或交维后 //拆站流程返回信息交维前或交维后
@Transactional
@Override @Override
public List<WorkflowTemplateFormFieldHi> czStartProcess(String jzMessageId) { public List<WorkflowTemplateFormFieldHi> czStartProcess(String jzMessageId) {
JzMessage jzMessage = jzMessageRepository.jzmessageByBusinessId(jzMessageId); JzMessage jzMessage = jzMessageRepository.jzmessageByBusinessId(jzMessageId);
...@@ -59,11 +87,158 @@ public class ProcessServiceImpl implements ProcessService { ...@@ -59,11 +87,158 @@ public class ProcessServiceImpl implements ProcessService {
return startProcess(ProcessMapBpmn.BS_MAINTANCE_DOWN.getTypeTemplate()); return startProcess(ProcessMapBpmn.BS_MAINTANCE_DOWN.getTypeTemplate());
} }
} else if (jzMessage.getJzType().equals(TypeEnum.YD.getkey())) { } else if (jzMessage.getJzType().equals(TypeEnum.YD.getkey())) {
if (Integer.parseInt(jzMessage.getJzState())>Integer.parseInt(BaseStationStatus.MC_WAIT_MAINTAIN.getCode())) { if (Integer.parseInt(jzMessage.getJzState()) > Integer.parseInt(BaseStationStatus.MC_WAIT_MAINTAIN.getCode())) {
return startProcess(ProcessMapBpmn.BS_MAINTANCE_DOWN.getTypeTemplate()); return startProcess(ProcessMapBpmn.BS_MAINTANCE_DOWN.getTypeTemplate());
} }
} }
return startProcess(ProcessMapBpmn.BS_STAND_DOWN.getTypeTemplate()); return startProcess(ProcessMapBpmn.BS_STAND_DOWN.getTypeTemplate());
} }
/**
* 金蝶自动走流程
*//*
public void runProcess(JzMessage jzMessage) {
//判断如果基站是移动执行移动流程
if (jzMessage.getJzType().equals(TypeEnum.YD.getkey())) {
//遍历移动流程
StateTypeTemplateMD[] MDvalues = StateTypeTemplateMD.values();
for (int i = 0; i < MDvalues.length; i++) {
//根据流程状态判断当前属于哪个流程
if (jzMessage.getJzState().equals(MDvalues[i]) && !jzMessage.getJzState().equals(StateTypeTemplateMD.MC_WAIT_MAINTAIN.getState())) {
//如果存在当前状态执行流程接口
this.processRun(jzMessage, MDvalues[i].getKey(), MDvalues[i].getTemplate(), MDvalues[i].getState());
//设置流程状态为下一节点状态
jzMessage.setJzState(MDvalues[i + 1].getState());
} else {
log.debug("移动该状态不能执行流程");
//设置流程进行标志位为 1
jzMessage.setIsCanRunProcess("1");
jzMessageRepository.updateByPrimaryKeySelective(jzMessage);
return;
}
}
} else if (jzMessage.getJzType().equals(TypeEnum.TT.getkey())) {
//遍历铁塔
StateTypeTemplateTT[] TTvalues = StateTypeTemplateTT.values();
for (int i = 0; i < TTvalues.length; i++) {
//根据流程状态判断当前属于哪个流程
if (jzMessage.getJzState().equals(TTvalues[i]) && !jzMessage.getJzState().equals(StateTypeTemplateMD.MC_WAIT_MAINTAIN.getState())) {
//如果存在当前状态执行流程接口
this.processRun(jzMessage, TTvalues[i].getKey(), TTvalues[i].getTemplate(), TTvalues[i].getState());
//设置流程状态为下一节点状态
jzMessage.setJzState(TTvalues[i + 1].getState());
} else {
log.debug("铁塔该状态不能执行流程");
//设置流程进行标志位为 1
jzMessage.setIsCanRunProcess("1");
jzMessageRepository.updateByPrimaryKeySelective(jzMessage);
return;
}
}
}
}
*/
/* *//**
* 重复完成任务
*//*
public List<String> complateTasks(String processInstanceId, HashMap variables, HashMap variablesLocal) {
//完成任务
Task task = taskService.createTaskQuery().processInstanceId(processInstanceId).singleResult();
taskIdS.add(task.getId());
//如果当前流程不存在正在执行的任务结束方法
if (task == null) {
return taskIdS;
}
cyWfServiceImpl.completeTask(task.getId(), variables, variablesLocal);
return complateTasks(processInstanceId, variables, variablesLocal);
}
*/
/* ;
*//**
* 实现流程接口
*//*
@Transactional
public void processRun(JzMessage jzMessage, String businessKey, String templateType, String state) {
//通过基站类型获取模板
List<WorkflowTemplateFormFieldHi> workflowTemplateFormFieldHis = this.startProcess(templateType);
//设置流程变量
jzMessage.setTransition(message);
//设置类型
jzMessage.setTypeTemplate(templateType);
JzMessage jzMessage1 = helper.setVariables(jzMessage);
//设置状态为待审批
jzMessage1.setJzProState(APPROVALPENDING);
//修改状态为待审批
jzMessageRepository.updateJzMessage(jzMessage1);
CyPIAndTaskModel cyPIAndTaskModel = cyWfServiceImpl.startProcessByKey(businessKey, jzMessage1.getBusinessId(), jzMessage1.getVariables(), true, jzMessage.getVariablesLocal());
//重复完成任务
List<String> tasks = this.complateTasks(cyPIAndTaskModel.getProcessInstance().getId(), jzMessage1.getVariables(), jzMessage1.getVariablesLocal());
//插入到中间表
ProcessMid processMid = new ProcessMid();
processMid.setTypeProcess(state);
processMid.setTemplateid(workflowTemplateFormFieldHis.get(0).getTemplateId());
processMid.setBusinessId(CyIdGenUtil.uuid());
processMid.setProcessid(cyPIAndTaskModel.getProcessInstance().getId());
processMid.setJzMessageId(jzMessage.getBusinessId());
processMid.setVersion("1");
processMid.setTypeTemplate(templateType);
processMidRepository.insertSelective(processMid);
//插入mes表
List<WorkflowTaskDateMes> WorkflowTaskDateMess = new ArrayList<>();
WorkflowTaskDateMes workflowTaskDateMes = new WorkflowTaskDateMes();
workflowTaskDateMes.setTransition("通过");
workflowTaskDateMes.setCreateTime(new Date());
workflowTaskDateMes.setRemarks(value);
workflowTaskDateMes.setCreatePerson(value);
workflowTaskDateMes.setRegionStr(value);
workflowTaskDateMes.setJsonStr(value);
workflowTaskDateMes.setProcessId(cyPIAndTaskModel.getProcessInstance().getId());
for (String task :tasks){
workflowTaskDateMes.setTaskId(task);
workflowTaskDateMes.setId(CyIdGenUtil.uuid());
WorkflowTaskDateMess.add(workflowTaskDateMes);
workflowTaskDateMesRepository.insertSelective(workflowTaskDateMes);
}
//插入到data_hi
List<WorkflowTaskDataHi> WorkflowTaskDataHis=new ArrayList<>();
//遍历mes数据获取mes表businessid
for (WorkflowTaskDateMes workflowTaskDateMes1 : WorkflowTaskDateMess) {
WorkflowTaskDataHi workflowTaskDataHi = new WorkflowTaskDataHi();
workflowTaskDataHi.setId(CyIdGenUtil.uuid());
workflowTaskDataHi.setTaskDataMesId(workflowTaskDateMes1.getId());
for (WorkflowTemplateFormFieldHi workflowTemplateFormFieldHi:workflowTemplateFormFieldHis){
workflowTaskDataHi.setFieldId(workflowTemplateFormFieldHi.getId());
workflowTaskDataHi.setFieldValue(value);
WorkflowTaskDataHis.add(workflowTaskDataHi);
}
}
if (WorkflowTaskDataHis.size()>0){
workflowTaskDataHiRepository.insertList(WorkflowTaskDataHis);
}
//插入到data
List<WorkflowTaskData> workflowTaskDatas = new ArrayList<>();
for (WorkflowTemplateFormFieldHi workflowTemplateFormFieldHi:workflowTemplateFormFieldHis){
WorkflowTaskData workflowTaskData = new WorkflowTaskData();
workflowTaskData.setId(CyIdGenUtil.uuid());
workflowTaskData.setFieldId(workflowTemplateFormFieldHi.getId());
workflowTaskData.setIsFirst("0");
workflowTaskData.setFieldValue(value);
workflowTaskData.setProcessId(cyPIAndTaskModel.getProcessInstance().getId());
workflowTaskDatas.add(workflowTaskData);
}
if (workflowTaskDatas.size()>0){
workflowTaskDataRepository.insertList(workflowTaskDatas);
}
}*/
} }
...@@ -89,7 +89,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -89,7 +89,7 @@ public class TaskServiceImpl implements TaskService {
ComplateTaskResDto complateTaskResDto = new ComplateTaskResDto(); ComplateTaskResDto complateTaskResDto = new ComplateTaskResDto();
List<WorkflowTemplateFormFieldHi> fieldMesByTaskId = workflowTemplateFormFieldHiRepository.getFieldMesByTaskId(taskId); List<WorkflowTemplateFormFieldHi> fieldMesByTaskId = workflowTemplateFormFieldHiRepository.getFieldMesByTaskId(taskId);
List<WorkflowTaskDateMes> regionStrBytaskId = workflowTaskDateMesRepository.getRegionStrBytaskId(taskId); List<WorkflowTaskDateMes> regionStrBytaskId = workflowTaskDateMesRepository.getRegionStrBytaskId(taskId);
if (regionStrBytaskId == null && fieldMesByTaskId == null) { if (regionStrBytaskId.size()<0 && fieldMesByTaskId.size()<0) {
return complateTaskResDto; return complateTaskResDto;
} }
complateTaskResDto.setWorkflowTemplateFormFieldHis(fieldMesByTaskId); complateTaskResDto.setWorkflowTemplateFormFieldHis(fieldMesByTaskId);
...@@ -123,7 +123,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -123,7 +123,7 @@ public class TaskServiceImpl implements TaskService {
try { try {
JSONArray.parseArray(regionStr); JSONArray.parseArray(regionStr);
} catch (Exception e1) { } catch (Exception e1) {
workflowTaskDateMes.setRegionStr(null); return new CyPersistModel(0);
} }
} }
...@@ -136,12 +136,16 @@ public class TaskServiceImpl implements TaskService { ...@@ -136,12 +136,16 @@ public class TaskServiceImpl implements TaskService {
try { try {
JSONArray.parseArray(jsonStrV); JSONArray.parseArray(jsonStrV);
} catch (Exception e1) { } catch (Exception e1) {
workflowTaskDateMes.setJsonStr(null); return new CyPersistModel(0);
} }
} }
} }
workflowTaskDateMesRepository.insert(workflowTaskDateMes); int insert = workflowTaskDateMesRepository.insert(workflowTaskDateMes);
if (insert==0){
return new CyPersistModel(-1);
}
//-----------------2-------date_hi----------------------------- //-----------------2-------date_hi-----------------------------
List<WorkflowTaskDataHi> datahi = new ArrayList<>(); List<WorkflowTaskDataHi> datahi = new ArrayList<>();
//{"1":"23232","2":"32323232"} //{"1":"23232","2":"32323232"}
...@@ -164,8 +168,12 @@ public class TaskServiceImpl implements TaskService { ...@@ -164,8 +168,12 @@ public class TaskServiceImpl implements TaskService {
} }
} }
if (!CollectionUtils.isEmpty(datahi)) if (!CollectionUtils.isEmpty(datahi)) {
workflowTaskDataHiRepository.insertList(datahi); int i = workflowTaskDataHiRepository.insertList(datahi);
if (i==0){
return new CyPersistModel(-1);
}
}
//-----------------3-------data----------------------------- //-----------------3-------data-----------------------------
for (WorkflowTaskDataHi work : datahi) { for (WorkflowTaskDataHi work : datahi) {
work.setProcessId(workflowTaskDateMes.getProcessId()); work.setProcessId(workflowTaskDateMes.getProcessId());
...@@ -178,12 +186,18 @@ public class TaskServiceImpl implements TaskService { ...@@ -178,12 +186,18 @@ public class TaskServiceImpl implements TaskService {
workflowTaskData.setFieldValue(work.getFieldValue()); workflowTaskData.setFieldValue(work.getFieldValue());
workflowTaskData.setIsFirst("0"); workflowTaskData.setIsFirst("0");
workflowTaskData.setProcessId(workflowTaskDateMes.getProcessId()); workflowTaskData.setProcessId(workflowTaskDateMes.getProcessId());
workflowTaskDataRepository.insert(workflowTaskData); int insert1 = workflowTaskDataRepository.insert(workflowTaskData);
if (insert1==0){
return new CyPersistModel(-1);
}
} else { } else {
//修改 //修改
workflowTaskData.setFieldValue(work.getFieldValue()); workflowTaskData.setFieldValue(work.getFieldValue());
workflowTaskData.setIsFirst("1"); workflowTaskData.setIsFirst("1");
workflowTaskDataRepository.updateByPrimaryKeySelective(workflowTaskData); int i = workflowTaskDataRepository.updateByPrimaryKeySelective(workflowTaskData);
if (i==0){
return new CyPersistModel(-1);
}
} }
} }
return new CyPersistModel(1); return new CyPersistModel(1);
......
File mode changed from 100644 to 100755
...@@ -36,79 +36,81 @@ public class SUserController extends CyPaginationController<SUser> { ...@@ -36,79 +36,81 @@ public class SUserController extends CyPaginationController<SUser> {
private SUserService sUserServiceImpl; private SUserService sUserServiceImpl;
@ApiOperation(value="添加用户表", notes="添加用户表") @ApiOperation(value = "添加用户表", notes = "添加用户表")
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")}) //@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PostMapping(value = "/add") @PostMapping(value = "/add")
public CyResult add(@Valid SUser sUser, BindingResult bindingResult) { public CyResult add(@Valid SUser sUser, BindingResult bindingResult) {
CyPersistModel data = sUserServiceImpl.save(sUser); CyPersistModel data = sUserServiceImpl.save(sUser);
return CyResultGenUtil.builder(data, return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS, CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR, CyMessCons.MESSAGE_ALERT_ERROR,
sUser); sUser);
} }
@ApiOperation(value="逻辑删除用户表", notes="逻辑删除用户表")
@ApiOperation(value = "逻辑删除用户表", notes = "逻辑删除用户表")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")}) @ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")})
@DeleteMapping("/deleteLogical/{businessId:\\w+}") @DeleteMapping("/deleteLogical/{businessId:\\w+}")
public CyResult deleteLogical(@PathVariable String businessId,SUser sUser) { public CyResult deleteLogical(@PathVariable String businessId, SUser sUser) {
sUser.setBusinessId(businessId); sUser.setBusinessId(businessId);
CyPersistModel data = sUserServiceImpl.removeLogical(sUser); CyPersistModel data = sUserServiceImpl.removeLogical(sUser);
return CyResultGenUtil.builder(data, return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS, CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR, CyMessCons.MESSAGE_ALERT_ERROR,
businessId); businessId);
} }
@ApiOperation(value="删除用户表", notes="删除用户表") @ApiOperation(value = "删除用户表", notes = "删除用户表")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")}) @ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")})
@DeleteMapping("/delete/{businessId:\\w+}") @DeleteMapping("/delete/{businessId:\\w+}")
public CyResult delete(@PathVariable String businessId,SUser sUser) { public CyResult delete(@PathVariable String businessId, SUser sUser) {
sUser.setBusinessId(businessId); sUser.setBusinessId(businessId);
CyPersistModel data = sUserServiceImpl.remove(sUser); CyPersistModel data = sUserServiceImpl.remove(sUser);
return CyResultGenUtil.builder(data, return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS, CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR, CyMessCons.MESSAGE_ALERT_ERROR,
businessId); businessId);
} }
@ApiOperation(value="修改用户表", notes="修改用户表") @ApiOperation(value = "修改用户表", notes = "修改用户表")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")}) @ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PutMapping("/update/{businessId:\\w+}") @PutMapping("/update/{businessId:\\w+}")
public CyResult update(@PathVariable String businessId, @Valid SUser sUser, BindingResult bindingResult) { public CyResult update(@PathVariable String businessId, @Valid SUser sUser, BindingResult bindingResult) {
sUser.setBusinessId(businessId); sUser.setBusinessId(businessId);
CyPersistModel data = sUserServiceImpl.merge(sUser); CyPersistModel data = sUserServiceImpl.merge(sUser);
return CyResultGenUtil.builder(data, return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS, CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR, CyMessCons.MESSAGE_ALERT_ERROR,
sUser); sUser);
} }
@ApiOperation(value="查询单一用户表", notes="查询单一用户表") @ApiOperation(value = "查询单一用户表", notes = "查询单一用户表")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")}) @ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")})
@GetMapping("/detail/{businessId:\\w+}") @GetMapping("/detail/{businessId:\\w+}")
public CyResult detail(@PathVariable String businessId) { public CyResult detail(@PathVariable String businessId) {
return CyResultGenUtil.builder(new CyPersistModel(1), return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS, CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR, CyMessCons.MESSAGE_ALERT_ERROR,
sUserServiceImpl.findById(businessId)); sUserServiceImpl.findById(businessId));
} }
@ApiOperation(value="查询用户表集合", notes="查询用户表集合") @ApiOperation(value = "查询用户表集合", notes = "查询用户表集合")
@GetMapping(value = "/querySUsers") @GetMapping(value = "/querySUsers")
public CyResult querySUsers(SUser sUser) { public CyResult querySUsers(SUser sUser) {
return CyResultGenUtil.builder(new CyPersistModel(1), return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS, CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR, CyMessCons.MESSAGE_ALERT_ERROR,
sUserServiceImpl.findAll(sUser)); sUserServiceImpl.findAll(sUser));
} }
@ApiOperation(value="分页查询用户表集合", notes="分页查询用户表集合") @ApiOperation(value = "分页查询用户表集合", notes = "分页查询用户表集合")
@GetMapping(value = "/querySUserByPagination") @GetMapping(value = "/querySUserByPagination")
public CyGridModel listByPagination(SUser sUser) { public CyGridModel listByPagination(SUser sUser) {
sUserServiceImpl.findAllByPagination(getPaginationUtility(), sUser); sUserServiceImpl.findAllByPagination(getPaginationUtility(), sUser);
return getGridModelResponse(); return getGridModelResponse();
} }
@ApiOperation(value="查询用户表集合", notes="查询用户表集合")
@ApiOperation(value = "查询用户表集合", notes = "查询用户表集合")
@GetMapping(value = "/queryAllUsers") @GetMapping(value = "/queryAllUsers")
public CyResult querySUsersInfo(String deptId) { public CyResult querySUsersInfo(String deptId) {
return CyResultGenUtil.builder(new CyPersistModel(1), return CyResultGenUtil.builder(new CyPersistModel(1),
...@@ -117,6 +119,7 @@ public class SUserController extends CyPaginationController<SUser> { ...@@ -117,6 +119,7 @@ public class SUserController extends CyPaginationController<SUser> {
sUserServiceImpl.findAllUser(deptId)); sUserServiceImpl.findAllUser(deptId));
} }
@ApiOperation(value = "返回维护部人员", notes = "返回维护部人员") @ApiOperation(value = "返回维护部人员", notes = "返回维护部人员")
@GetMapping(value = "/getMaintainPerson") @GetMapping(value = "/getMaintainPerson")
public CyResult getMaintainPerson() { public CyResult getMaintainPerson() {
...@@ -135,7 +138,7 @@ public class SUserController extends CyPaginationController<SUser> { ...@@ -135,7 +138,7 @@ public class SUserController extends CyPaginationController<SUser> {
sUserServiceImpl.getMyMaintainPersonList()); sUserServiceImpl.getMyMaintainPersonList());
}*/ }*/
@ApiOperation(value="查询单一用户姓名", notes="查询单一用户姓名") @ApiOperation(value = "查询单一用户姓名", notes = "查询单一用户姓名")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")}) @ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")})
@GetMapping("/userName/{businessId:\\w+}") @GetMapping("/userName/{businessId:\\w+}")
public CyResult userName(@PathVariable String businessId) { public CyResult userName(@PathVariable String businessId) {
...@@ -154,5 +157,38 @@ public class SUserController extends CyPaginationController<SUser> { ...@@ -154,5 +157,38 @@ public class SUserController extends CyPaginationController<SUser> {
sUserServiceImpl.isSpecialIdentity()); sUserServiceImpl.isSpecialIdentity());
} }
/**
* 金蝶走流程
*
* @param projectCode
* @return
*/
@ApiOperation(value = "根据项目编号获取阶段负责人", notes = "根据项目编号获取阶段负责人")
@GetMapping(value = "/selectUserByProjectCode")
public CyResult selectUserByProjectCode(@RequestParam("projectCode") String projectCode) {
if(sUserServiceImpl.selectUserByProjectCode(projectCode)==null){
return CyResultGenUtil.builder(new CyPersistModel(-1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
sUserServiceImpl.selectUserByProjectCode(projectCode));
}
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
sUserServiceImpl.selectUserByProjectCode(projectCode));
}
} /**
* 根据项目编号和类型获取审批人和当前任务id
*/
@ApiOperation(value = "根据项目编号和类型获取当前审批人", notes = "根据项目编号和类型获取当前审批人")
@GetMapping(value = "/toDOTaskUser")
public CyResult toDOTaskUser(@RequestParam("projectCode")String projectCode,@RequestParam("templateType") String templateType){
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
sUserServiceImpl.toDOTaskUser(projectCode,templateType));
}
}
\ No newline at end of file
package org.rcisoft.business.suser.dao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.rcisoft.business.suser.entity.KingdeeUserDto;
import org.rcisoft.business.suser.entity.SUser;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @Author: jiangpengpeng
* @Description:
* @Date: Created in 14:47 2019/10/28
* @Modified By:
*/
@Repository
public interface KingdeeUserRepository {
/**
* 查询当前阶段负责人和任务id
*/
@Select("<script>SELECT " +
"s_user.BUSINESS_ID, " +
"s_user.LOGIN_NAME, " +
"s_user.DEPT_ID, " +
"s_user_role.ROLE_ID, " +
"ACT_RU_IDENTITYLINK.TASK_ID_ AS TASK_ID_, " +
"( " +
"SELECT " +
"jz_message.jz_cur_dept " +
"FROM " +
"jz_message " +
"WHERE " +
"jz_message.project_code = #{projectCode} " +
"AND jz_message.del_flag = '0' " +
"AND jz_message.flag = '1' " +
") AS JZ_DEPT_ID " +
"FROM " +
"s_user " +
"LEFT JOIN s_user_role ON s_user.BUSINESS_ID = s_user_role.USER_ID " +
"LEFT JOIN ACT_RU_IDENTITYLINK ON s_user_role.ROLE_ID = ACT_RU_IDENTITYLINK.GROUP_ID_ " +
"WHERE " +
"1 = 1 " +
"AND s_user.DEL_FLAG = '0' " +
"AND s_user.FLAG = '1' " +
"AND ACT_RU_IDENTITYLINK.TASK_ID_ = ( " +
"SELECT " +
"ACT_RU_TASK.ID_ " +
"FROM " +
"ACT_RU_TASK " +
"WHERE " +
"PROC_INST_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>")
@ResultMap(value = "BaseResultMap")
List<KingdeeUserDto> toDOTaskUser(@Param("projectCode")String projectCode, @Param("templateType")String templateType);
}
...@@ -33,7 +33,7 @@ public interface SUserRepository extends CyBaseMapper<SUser> { ...@@ -33,7 +33,7 @@ public interface SUserRepository extends CyBaseMapper<SUser> {
@Select("<script> SELECT su.*, sr.code as roleCode FROM s_user su " + @Select("<script> SELECT su.*, sr.code as roleCode FROM s_user su " +
"left join s_user_role sur on su.business_id = sur.user_id " + "left join s_user_role sur on su.business_id = sur.user_id " +
"left join s_role sr on sur.role_id = sr.business_id " + "left join s_role sr on sur.role_id = sr.business_id " +
"AND sr.del_flag = 0 and sr.flag = 1 " + "AND sr.del_flag = 0 and sr.flag = 1 " +
"WHERE 1=1 " + "WHERE 1=1 " +
"AND su.del_flag = 0 and su.flag = 1 " + "AND su.del_flag = 0 and su.flag = 1 " +
"AND dept_id = #{deptId} " + "AND dept_id = #{deptId} " +
...@@ -173,5 +173,19 @@ public interface SUserRepository extends CyBaseMapper<SUser> { ...@@ -173,5 +173,19 @@ public interface SUserRepository extends CyBaseMapper<SUser> {
"</script>") "</script>")
@ResultMap(value = "BaseResultMap") @ResultMap(value = "BaseResultMap")
List<SUser> queryRoleById(String businessId); List<SUser> queryRoleById(String businessId);
/**
* 根据项目编号查询当前阶段负责人信息
*/
@Select("<script>SELECT s_user.* " +
"FROM s_user " +
"LEFT JOIN jz_message " +
"ON s_user.BUSINESS_ID = jz_message.jz_cur_user " +
"WHERE jz_message.project_code = #{projectCode}</script>")
@ResultMap(value = "BaseResultMap")
List<SUser> selectUserByProjectCode(@Param("projectCode")String projectCode);
} }
package org.rcisoft.business.suser.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
* @Author: jiangpengpeng
* @Description:
* @Date: Created in 14:28 2019/10/28
* @Modified By:
*/
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "s_user")
public class KingdeeUserDto {
/**
*用户名
*/
private String loginName;
/**
* 角色id
*/
@Transient
private String roleId;
/**
* 任务id
*/
@Transient
private String taskId;
/**
* 当前基站部门
*
*/
@Transient
private String jzDeptId;
/**
* 当前角色所属部门
*
*/
private String deptId;
/**
*
* 当前角色主键
*/
private String businessId;
}
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
...@@ -107,5 +107,14 @@ public class SUser extends CyIdEntity<SUser> { ...@@ -107,5 +107,14 @@ public class SUser extends CyIdEntity<SUser> {
@Transient @Transient
private String selectTab; private String selectTab;
/**
* 任务id
*/
@Transient
private String taskId;
@Transient
private String roleId;
@Transient
private String jzdeptId;
} }
File mode changed from 100644 to 100755
package org.rcisoft.business.suser.service; package org.rcisoft.business.suser.service;
import org.rcisoft.business.suser.entity.JudgmentIdentity; import org.rcisoft.business.suser.entity.JudgmentIdentity;
import org.rcisoft.business.suser.entity.KingdeeUserDto;
import org.rcisoft.business.suser.entity.SUser; import org.rcisoft.business.suser.entity.SUser;
import org.rcisoft.business.suser.entity.SUserSYN;
import org.rcisoft.core.model.CyPersistModel; import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.aop.CyPageUtil; import org.rcisoft.core.aop.CyPageUtil;
import org.rcisoft.sys.dept.entity.SysDept;
import java.util.List; import java.util.List;
...@@ -101,5 +100,16 @@ public interface SUserService { ...@@ -101,5 +100,16 @@ public interface SUserService {
*/ */
List<SUser> queryRoleById(String businessId); List<SUser> queryRoleById(String businessId);
/**
*根据项目编号查询阶段负责人信息
*/
SUser selectUserByProjectCode(String projectCode);
/**
*根据项目编号和类型查询当前审批人和任务
*/
List<KingdeeUserDto> toDOTaskUser(String projectCode, String templateType);
} }
...@@ -8,14 +8,13 @@ import org.rcisoft.business.jzmessage.util.FindSon; ...@@ -8,14 +8,13 @@ import org.rcisoft.business.jzmessage.util.FindSon;
import org.rcisoft.business.sdictionary.entity.SDictionary; import org.rcisoft.business.sdictionary.entity.SDictionary;
import org.rcisoft.business.sdictionary.service.SDictionaryService; import org.rcisoft.business.sdictionary.service.SDictionaryService;
import org.rcisoft.business.sdictionary.service.impl.SDictionaryServiceImpl; import org.rcisoft.business.sdictionary.service.impl.SDictionaryServiceImpl;
import org.rcisoft.business.suser.entity.JudgmentIdentity; import org.rcisoft.business.suser.dao.KingdeeUserRepository;
import org.rcisoft.business.suser.entity.SUserSYN; import org.rcisoft.business.suser.entity.*;
import org.rcisoft.core.result.CyResult; import org.rcisoft.core.result.CyResult;
import org.rcisoft.core.util.CyUserUtil; import org.rcisoft.core.util.CyUserUtil;
import org.rcisoft.core.aop.CyPageUtil; import org.rcisoft.core.aop.CyPageUtil;
import org.rcisoft.core.model.CyPersistModel; import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.business.suser.dao.SUserRepository; import org.rcisoft.business.suser.dao.SUserRepository;
import org.rcisoft.business.suser.entity.SUser;
import org.rcisoft.business.suser.service.SUserService; import org.rcisoft.business.suser.service.SUserService;
import org.rcisoft.core.service.CyBaseService; import org.rcisoft.core.service.CyBaseService;
...@@ -52,6 +51,8 @@ public class SUserServiceImpl extends CyBaseService implements SUserService { ...@@ -52,6 +51,8 @@ public class SUserServiceImpl extends CyBaseService implements SUserService {
@Autowired @Autowired
private SDictionaryService sDictionaryServiceImpl; private SDictionaryService sDictionaryServiceImpl;
@Autowired
private KingdeeUserRepository kingdeeUserRepository;
/** /**
* 保存 用户表 * 保存 用户表
...@@ -146,7 +147,7 @@ public class SUserServiceImpl extends CyBaseService implements SUserService { ...@@ -146,7 +147,7 @@ public class SUserServiceImpl extends CyBaseService implements SUserService {
*/ */
@Override @Override
public List<SUser> findAllByPagination(CyPageUtil<SUser> paginationUtility, public List<SUser> findAllByPagination(CyPageUtil<SUser> paginationUtility,
SUser sUser) { SUser sUser) {
sUser.setNormal(); sUser.setNormal();
return sUserRepository.querySUsers(sUser); return sUserRepository.querySUsers(sUser);
} }
...@@ -175,7 +176,7 @@ public class SUserServiceImpl extends CyBaseService implements SUserService { ...@@ -175,7 +176,7 @@ public class SUserServiceImpl extends CyBaseService implements SUserService {
if (StringUtils.isEmpty(deptId)) { if (StringUtils.isEmpty(deptId)) {
deptId = CyUserUtil.getAuthenDept(); deptId = CyUserUtil.getAuthenDept();
} }
log.debug("当前登录人id"+CyUserUtil.getAuthenBusinessId()); log.debug("当前登录人id" + CyUserUtil.getAuthenBusinessId());
//查询本部门下的所有人 //查询本部门下的所有人
List<SUser> sUserLIst = sUserRepository.queryAllUserInfoByDept(deptId); List<SUser> sUserLIst = sUserRepository.queryAllUserInfoByDept(deptId);
List<SUser> sUsers = new ArrayList<>(); List<SUser> sUsers = new ArrayList<>();
...@@ -215,9 +216,9 @@ public class SUserServiceImpl extends CyBaseService implements SUserService { ...@@ -215,9 +216,9 @@ public class SUserServiceImpl extends CyBaseService implements SUserService {
else if (CyUserUtil.getAuthenBusinessId().equals(user.getBusinessId())) { else if (CyUserUtil.getAuthenBusinessId().equals(user.getBusinessId())) {
user.setSelectTab("0"); user.setSelectTab("0");
} }
if (SDictionaryServiceImpl.manager.containsValue(user.getRoleCode())&& if (SDictionaryServiceImpl.manager.containsValue(user.getRoleCode()) &&
CyUserUtil.getAuthenBusinessId().equals(user.getBusinessId())){ CyUserUtil.getAuthenBusinessId().equals(user.getBusinessId())) {
user.setSelectTab("1"+",0"); user.setSelectTab("1" + ",0");
} }
userIds.add(user.getBusinessId()); userIds.add(user.getBusinessId());
sUsers.add(user); sUsers.add(user);
...@@ -263,6 +264,7 @@ public class SUserServiceImpl extends CyBaseService implements SUserService { ...@@ -263,6 +264,7 @@ public class SUserServiceImpl extends CyBaseService implements SUserService {
/** /**
* 获取当前登录人员的公司下所有维护部门人员 * 获取当前登录人员的公司下所有维护部门人员
*
* @return * @return
*/ */
@Override @Override
...@@ -276,34 +278,34 @@ public class SUserServiceImpl extends CyBaseService implements SUserService { ...@@ -276,34 +278,34 @@ public class SUserServiceImpl extends CyBaseService implements SUserService {
String id = null; //当前部门id String id = null; //当前部门id
String parentsId = null; //当前父节点id String parentsId = null; //当前父节点id
//获得当前部门的上级部门id和自己的id //获得当前部门的上级部门id和自己的id
for(SysDept item : sysDepts){ //遍历部门列表 for (SysDept item : sysDepts) { //遍历部门列表
if(item.getCode().equals(deptCode)){//查询当前部门信息 if (item.getCode().equals(deptCode)) {//查询当前部门信息
parentsId = item.getParentId();//上级部门id parentsId = item.getParentId();//上级部门id
id = item.getBusinessId();//当前部门id id = item.getBusinessId();//当前部门id
break; break;
} }
} }
//获取当前部门的分公司id //获取当前部门的分公司id
String companyId = FindSon.FindCompany(id,id,sysDepts); String companyId = FindSon.FindCompany(id, id, sysDepts);
//2.从数据字典获取所有维护部门(包括二级三级) //2.从数据字典获取所有维护部门(包括二级三级)
List<String> gswlList = new ArrayList<>(); List<String> gswlList = new ArrayList<>();
List<String> maintainList = new ArrayList<>(); List<String> maintainList = new ArrayList<>();
HashMap<String ,String> AllMaintenanceDept = SDictionaryServiceImpl.whb; HashMap<String, String> AllMaintenanceDept = SDictionaryServiceImpl.whb;
//如果公司id包含在广厦股份公司部门内,说明其分公司为广厦 //如果公司id包含在广厦股份公司部门内,说明其分公司为广厦
if (SDictionaryServiceImpl.deptForGswl.containsValue(companyId)){ if (SDictionaryServiceImpl.deptForGswl.containsValue(companyId)) {
//获取所有广厦公司部门 //获取所有广厦公司部门
for (String s : SDictionaryServiceImpl.deptForGswl.values()) { for (String s : SDictionaryServiceImpl.deptForGswl.values()) {
gswlList.addAll(FindSon.FindSons(s, sysDepts)); gswlList.addAll(FindSon.FindSons(s, sysDepts));
gswlList.add(s); gswlList.add(s);
} }
}else{ } else {
gswlList.addAll(FindSon.FindSons(companyId, sysDepts)); gswlList.addAll(FindSon.FindSons(companyId, sysDepts));
gswlList.add(companyId); gswlList.add(companyId);
} }
//获得属于广厦网络的维护部 //获得属于广厦网络的维护部
for (String value : AllMaintenanceDept.values()) { for (String value : AllMaintenanceDept.values()) {
for (String s : gswlList) { for (String s : gswlList) {
if (s.equals(value)){ if (s.equals(value)) {
maintainList.add(value); maintainList.add(value);
} }
} }
...@@ -365,4 +367,73 @@ public class SUserServiceImpl extends CyBaseService implements SUserService { ...@@ -365,4 +367,73 @@ public class SUserServiceImpl extends CyBaseService implements SUserService {
public List<SUser> queryRoleById(String businessId) { public List<SUser> queryRoleById(String businessId) {
return sUserRepository.queryRoleById(businessId); return sUserRepository.queryRoleById(businessId);
} }
//根据项目编号查询当前阶段负责人
@Override
public SUser selectUserByProjectCode(String projectCode) {
if (sUserRepository.selectUserByProjectCode(projectCode).size() == 0) {
return null;
}
SUser sUser = sUserRepository.selectUserByProjectCode(projectCode).get(0);
return sUser;
}
@Override
public List<KingdeeUserDto> toDOTaskUser(String projectCode, String templateType) {
List<KingdeeUserDto> kingdeeUserDtos = kingdeeUserRepository.toDOTaskUser(projectCode, templateType);
List<KingdeeUserDto> kingdeeUserResult = new ArrayList<>();
SysDept sysDept = new SysDept();
sysDept.setNormal();
List<SysDept> sysDepts = sysDeptServiceImpl.findAll(sysDept);//查询所有部门信息
List<String> deptIds = new ArrayList<>();//存放要查询部门的businessId
//筛选 数据权限
for (KingdeeUserDto dto: kingdeeUserDtos) {
//部门空
if(StringUtils.isAnyEmpty(dto.getDeptId()) || StringUtils.isEmpty(dto.getJzDeptId()))
continue;
//维护部
if(SDictionaryServiceImpl.whb.containsValue(dto.getDeptId())){
//属于广厦有限股份公司的维护部
String companyId = FindSon.FindCompany(dto.getDeptId(),dto.getDeptId(),sysDepts);
if (SDictionaryServiceImpl.deptForGswl.containsValue(companyId)){
for (String s : SDictionaryServiceImpl.deptForGswl.keySet()) {
deptIds.addAll(FindSon.FindSons(SDictionaryServiceImpl.deptForGswl.get(s), sysDepts));
deptIds.add(SDictionaryServiceImpl.deptForGswl.get(s));
}
}else{
deptIds = FindSon.FindSons(companyId,sysDepts);
//放入当前部门
deptIds.add(companyId);
}
//判断是否包含
if(deptIds.contains(dto.getJzDeptId()))
kingdeeUserResult.add(dto);
}
//合规部
else if(SDictionaryServiceImpl.hgb.containsValue(dto.getDeptId())){
//合规部
String parentsId = null; //当前父节点id
//这个循环用来获得当前部门的上级部门id和自己的id
for(SysDept item : sysDepts){ //遍历部门列表
if(item.getBusinessId().equals(dto.getDeptId())){//查询当前部门信息
parentsId = item.getParentId();//上级部门id
break;
}
}
deptIds = FindSon.FindSons(parentsId,sysDepts);
//判断是否包含
if(deptIds.contains(dto.getJzDeptId()))
kingdeeUserResult.add(dto);
}
//其他
else {
if(dto.getDeptId().equals(dto.getJzDeptId()))
kingdeeUserResult.add(dto);
}
}
return kingdeeUserResult;
}
} }
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
package org.rcisoft.common;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.List;
/**
* @Author: jiangpengpeng
* @Description:
* @Date: Created in 10:04 2019/10/17
* @Modified By:
*/
@Component
public class GatewayUtil implements ExecutionListener{
public Boolean containRole(DelegateExecution execution,String... rid){
boolean flag = false;
if (rid.length > 0 ) {
//1,2,
String[] roles = execution.getVariable("rid").toString().split(",");
List<String> role = Arrays.asList(roles) ;
if(role.size() == 0)
return false;
for(int i = 0 ; i < rid.length ; i++) {
if (role.contains(rid[i])) {
flag = true;
break;
}
}
}
return flag;
}
public Boolean notContainRole(DelegateExecution execution,String... rid){
return !this.containRole(execution, rid);
}
@Override
public void notify(DelegateExecution delegateExecution) throws Exception {
}
}
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
package org.rcisoft.common;
/**
* @Author: jiangpengpeng
* @Description:
* @Date: Created in 11:17 2019/10/23
* @Modified By:
*/
public enum StateTypeTemplateMD {
MC_WAIT_LOCATION("3","1","M01","M001"),//2 选址
MC_WAIT_PROSPECT("4","1","M03","M003"),//3 勘察
MC_WAIT_TRIAGE("5","1","M04","M004"),//5 会审
MC_WAIT_DISCLOSURE("6","1","M05","M005"),//6 交底
MC_WAIT_PACKING("8","1","M06","M006"),//8 领料
MC_WAIT_EXECUTION("9","1","M07","M007"),//9 施工
MC_WAIT_OPEN("11","1","M08","M008"),//11 开通
MC_WAIT_CAPITAL("13","1","M10","M010"),// 13 交资
MC_WAIT_MAINTAIN("16","1","M11","M011");//16 交维
private String state;
private String type;
private String template;
private String key;
StateTypeTemplateMD(String state, String type, String template, String key) {
this.state = state;
this.type = type;
this.template = template;
this.key = key;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getTemplate() {
return template;
}
public void setTemplate(String template) {
this.template = template;
}
}
package org.rcisoft.common;
/**
* @Author: jiangpengpeng
* @Description:
* @Date: Created in 11:17 2019/10/23
* @Modified By:
*/
public enum StateTypeTemplateTT {
IT_WAIT_LOCATION("3","2","T01","T001"),//3 待选址
IT_WAIT_PROSPECT("4","2","T03","T003"),//4 待勘察
IT_WAIT_TRIAGE("5","2","T04","T004"),//5 会审
IT_WAIT_APPROVAL("7","2","T05","T005"),//7立项
IT_WAIT_PACKING("8","2","T06","T006"),//8 领料
IT_WAIT_EXECUTION("10","2","T07","T007"),//10 施工
IT_WAIT_COMPLETION("12","2","T08","T008"),//12 完工
IT_WAIT_DELIVERY("14","2","T09","T009"),//14 交付
IT_WAIT_ONHIRE("15","2","T10","T010"),//15 起租
IT_WAIT_MAINTAIN("16","2","T12","T012");//16交维
private String state;
private String type;
private String template;
private String key;
StateTypeTemplateTT(String state, String type, String template, String key) {
this.state = state;
this.type = type;
this.template = template;
this.key = key;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getTemplate() {
return template;
}
public void setTemplate(String template) {
this.template = template;
}
}
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
server: server:
port: 8081 port: 8084
tomcat: tomcat:
max-threads: 300 max-threads: 300
basedir: d:/working/resource/temp basedir: d:/working/resource/temp.
servlet: servlet:
context-path: / context-path: /
session: session:
...@@ -22,12 +22,12 @@ server: ...@@ -22,12 +22,12 @@ server:
druid: druid:
# url: jdbc:mysql://10.96.129.36:13339/test?useUnicode=true&characterEncoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true # url: jdbc:mysql://10.96.129.36:13339/test?useUnicode=true&characterEncoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
url: jdbc:mysql://127.0.0.1:10036/jzdb?useUnicode=true&characterEncoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true url: jdbc:mysql://39.155.253.71:23339/jzdb?useUnicode=true&characterEncoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
#url: jdbc:mysql://103.249.252.109:13339/jzdb?useUnicode=true&characterEncoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true #url: jdbc:mysql://103.249.252.109:13339/jzdb?useUnicode=true&characterEncoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
# url: jdbc:mysql://127.0.0.1:3306/mall?useUnicode=true&characterEncoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true # url: jdbc:mysql://127.0.0.1:3306/gsjz?useUnicode=true&characterEncoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
username: root username: root
# password: 123456 # password: 123456
password: pvv5718J0CwhNfn4B^8^H3igPj#oiQkX password: cy123456
initial-size: 1 initial-size: 1
min-idle: 1 min-idle: 1
max-active: 20 max-active: 20
...@@ -84,7 +84,7 @@ spring: ...@@ -84,7 +84,7 @@ spring:
suffix: .ftl suffix: .ftl
template-loader-path: classpath:/templates/ template-loader-path: classpath:/templates/
redis: redis:
host: 127.0.0.1 host: 10.96.129.36
port: 7482 port: 7482
jedis: jedis:
pool: pool:
...@@ -152,7 +152,7 @@ global: ...@@ -152,7 +152,7 @@ global:
path: path:
app_id: b617866c20482d133d5de66fceb37da3 app_id: b617866c20482d133d5de66fceb37da3
#user_synchronized: http://39.155.253.70:10037/v1 #user_synchronized: http://39.155.253.70:10037/v1
user_synchronized: http://39.155.253.71:10037/v1 user_synchronized: http://39.155.253.71:10038/v1
base_upload_location: d:/working/resource/eduServer base_upload_location: d:/working/resource/eduServer
code_generate_location: /code code_generate_location: /code
video_location: /video video_location: /video
...@@ -171,6 +171,7 @@ cron: 0 0/5 * * * ? ...@@ -171,6 +171,7 @@ cron: 0 0/5 * * * ?
kingdee: kingdee:
url: http://36.110.39.211/k3cloud/ url: http://36.110.39.211/k3cloud/
# url: https://erp.gonn.com.cn/
login: Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser.common.kdsvc login: Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser.common.kdsvc
view: Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.View.common.kdsvc view: Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.View.common.kdsvc
save: Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save.common.kdsvc save: Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save.common.kdsvc
...@@ -179,5 +180,5 @@ kingdee: ...@@ -179,5 +180,5 @@ kingdee:
statusConver: Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.StatusConvert.common.kdsvc statusConver: Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.StatusConvert.common.kdsvc
user: Administrator user: Administrator
password: kJyGjIQ5DW0tpd@B password: kJyGjIQ5DW0tpd@B
DBid: 5d8acc5a26042d DBid: 5865e29cb51ecf
Icon: 2052 Icon: 2052
\ No newline at end of file
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
...@@ -87,6 +87,7 @@ spring: ...@@ -87,6 +87,7 @@ spring:
redis: redis:
host: 192.168.1.71 host: 192.168.1.71
# host: 172.17.0.1 # host: 172.17.0.1
# host: 127.0.0.1
#host: jz_redis #host: jz_redis
port: 6379 port: 6379
jedis: jedis:
......
File mode changed from 100644 to 100755
...@@ -59,14 +59,14 @@ ...@@ -59,14 +59,14 @@
<!-- <url>jdbc:mysql://10.96.129.36:55555/test?useUnicode=true&amp;characterEncoding=UTF-8&amp;useSSL=false&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true</url>--> <!-- <url>jdbc:mysql://10.96.129.36:55555/test?useUnicode=true&amp;characterEncoding=UTF-8&amp;useSSL=false&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true</url>-->
<url>jdbc:mysql://192.168.1.71:3306/jzdb?useUnicode=true&amp;characterEncoding=UTF-8&amp;useSSL=false&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true</url> <!--<url>jdbc:mysql://39.155.253.71:23339/jzdb?useUnicode=true&amp;characterEncoding=UTF-8&amp;useSSL=false&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true</url>-->
<!--<url>jdbc:mysql://10.96.129.36:13339/test?useUnicode=true&amp;characterEncoding=UTF-8&amp;useSSL=false&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true</url>--> <!--<url>jdbc:mysql://10.96.129.36:13339/test?useUnicode=true&amp;characterEncoding=UTF-8&amp;useSSL=false&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true</url>-->
<!-- <url>jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&amp;characterEncoding=UTF-8&amp;useSSL=false&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true</url>--> <!--<url>jdbc:mysql://127.0.0.1:3306/gsjz?useUnicode=true&amp;characterEncoding=UTF-8&amp;useSSL=false&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true</url>-->
<!-- <url>jdbc:mysql://127.0.0.1:23339/jzdb?useUnicode=true&amp;characterEncoding=UTF-8&amp;useSSL=false&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true</url> &lt;!&ndash;测试中测试&ndash;&gt;--> <!--<url>jdbc:mysql://39.155.253.71:23339/jzdb?useUnicode=true&amp;characterEncoding=UTF-8&amp;useSSL=false&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true</url> &lt;!&ndash;测试中测试&ndash;&gt;-->
<!-- <url>jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&amp;characterEncoding=UTF-8&amp;useSSL=false&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true</url> &lt;!&ndash;测试&ndash;&gt;--> <!-- <url>jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&amp;characterEncoding=UTF-8&amp;useSSL=false&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true</url> &lt;!&ndash;测试&ndash;&gt;-->
<!-- <url>jdbc:mysql://127.0.0.1:3306/loca_test?useUnicode=true&amp;characterEncoding=UTF-8&amp;useSSL=false&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true</url> &lt;!&ndash;测试&ndash;&gt;--> <!-- <url>jdbc:mysql://127.0.0.1:3306/loca_test?useUnicode=true&amp;characterEncoding=UTF-8&amp;useSSL=false&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true</url> &lt;!&ndash;测试&ndash;&gt;-->
<!--<url>jdbc:mysql://jz_mysql:3306/jzdb?useUnicode=true&amp;characterEncoding=UTF-8&amp;useSSL=false&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true</url> &lt;!&ndash;测试&ndash;&gt;--> <!--<url>jdbc:mysql://jz_mysql:3306/jzdb?useUnicode=true&amp;characterEncoding=UTF-8&amp;useSSL=false&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true</url> &lt;!&ndash;测试&ndash;&gt;-->
<!--<url>jdbc:mysql://jz_mysql_cs:3306/jzdb?useUnicode=true&amp;characterEncoding=UTF-8&amp;useSSL=false&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true</url> &lt;!&ndash;测试&ndash;&gt;--> <url>jdbc:mysql://192.168.1.71:3306/jzdb?useUnicode=true&amp;characterEncoding=UTF-8&amp;useSSL=false&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true</url> <!--测试-->
<username>root</username> <username>root</username>
<password>aLN%4Jx7ZsmsoMlOB0XEd7</password> <password>aLN%4Jx7ZsmsoMlOB0XEd7</password>
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
</springProfile> </springProfile>
<springProfile name="test"> <springProfile name="test">
<root level="info"> <root level="debug">
<appender-ref ref="consoleLog"/> <appender-ref ref="consoleLog"/>
<appender-ref ref="fileInfoLog"/> <appender-ref ref="fileInfoLog"/>
<appender-ref ref="fileErrorLog"/> <appender-ref ref="fileErrorLog"/>
......
File mode changed from 100644 to 100755
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.rcisoft.business.suser.dao.KingdeeUserRepository">
<resultMap id="BaseResultMap" type="org.rcisoft.business.suser.entity.KingdeeUserDto">
<id column="BUSINESS_ID" jdbcType="VARCHAR" property="businessId"/>
<result column="LOGIN_NAME" jdbcType="VARCHAR" property="loginName"/>
<result column="DEPT_ID" jdbcType="VARCHAR" property="deptId"/>
<result column="ROLE_ID" jdbcType="VARCHAR" property="roleId"/>
<result column="TASK_ID_" jdbcType="VARCHAR" property="taskId"/>
<result column="JZ_DEPT_ID" jdbcType="VARCHAR" property="jzDeptId"/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
</mapper>
\ No newline at end of file
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
...@@ -93,6 +93,7 @@ ...@@ -93,6 +93,7 @@
<result column="project_code_number" jdbcType="INTEGER" property="projectCodeNumber"/> <result column="project_code_number" jdbcType="INTEGER" property="projectCodeNumber"/>
<result column="project_code_status" jdbcType="INTEGER" property="projectCodeStatus"/> <result column="project_code_status" jdbcType="INTEGER" property="projectCodeStatus"/>
</resultMap> </resultMap>
<!-- <cache type="${corePackag!}.util.RedisCache"/> --> <!-- <cache type="${corePackag!}.util.RedisCache"/> -->
......
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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论