|
@@ -2,18 +2,27 @@ package org.jeecg.modules.activiti.service.Impl;
|
|
|
|
|
|
import cn.hutool.core.map.MapUtil;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import org.activiti.engine.delegate.DelegateExecution;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
+import org.jeecg.common.util.oConvertUtils;
|
|
|
import org.jeecg.modules.activiti.entity.ActBusiness;
|
|
|
+import org.jeecg.modules.activiti.entity.ActZprocess;
|
|
|
+import org.jeecg.modules.activiti.entity.TbTableInfoPractice;
|
|
|
import org.jeecg.modules.activiti.mapper.ActBusinessMapper;
|
|
|
+import org.jeecg.modules.activiti.mapper.ActZprocessMapper;
|
|
|
+import org.jeecg.modules.activiti.mapper.TbTableInfoPracticeMapper;
|
|
|
import org.jeecg.modules.activiti.service.IActBusinessService;
|
|
|
+import org.jeecg.modules.activiti.service.IActZprocessService;
|
|
|
+import org.jeecg.modules.activiti.service.ITbTableInfoPracticeService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -34,6 +43,10 @@ import java.util.Map;
|
|
|
public class ActBusinessServiceImpl extends ServiceImpl<ActBusinessMapper, ActBusiness> implements IActBusinessService {
|
|
|
@Autowired
|
|
|
ActBusinessMapper actBusinessMapper;
|
|
|
+ @Autowired
|
|
|
+ ActZprocessMapper actZprocessMapper;
|
|
|
+ @Autowired
|
|
|
+ TbTableInfoPracticeMapper tbTableInfoPracticeMapper;
|
|
|
|
|
|
public List<ActBusiness> findByProcDefId(String id) {
|
|
|
return this.list(new LambdaQueryWrapper<ActBusiness>().eq(ActBusiness::getProcDefId,id));
|
|
@@ -51,6 +64,7 @@ public class ActBusinessServiceImpl extends ServiceImpl<ActBusinessMapper, ActBu
|
|
|
// String json = getRequestPostStr(request);
|
|
|
// JSONObject jsonObject = JSONObject.parseObject(json);
|
|
|
|
|
|
+
|
|
|
String tableName = request.getParameter("tableName");
|
|
|
String filedNames = request.getParameter("filedNames");
|
|
|
//子表
|
|
@@ -67,7 +81,7 @@ public class ActBusinessServiceImpl extends ServiceImpl<ActBusinessMapper, ActBu
|
|
|
Map<String, Object> busiData = this.baseMapper.getBusiData(tableId, tableName);
|
|
|
String[] fileds = filedNames.split(",");
|
|
|
|
|
|
- Date date = new Date();
|
|
|
+ Date date = new Date();
|
|
|
if (MapUtil.isEmpty(busiData)){ //没有,新增逻辑
|
|
|
StringBuilder filedsB = new StringBuilder("id");
|
|
|
StringBuilder filedsVB = new StringBuilder("'"+tableId+"'");
|
|
@@ -259,6 +273,80 @@ public class ActBusinessServiceImpl extends ServiceImpl<ActBusinessMapper, ActBu
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ StringBuilder sbExtraInfo = new StringBuilder();
|
|
|
+ if (MapUtil.isEmpty(busiData)) { //没有,新增逻辑
|
|
|
+
|
|
|
+ String procDefId = request.getParameter("procDefId");
|
|
|
+
|
|
|
+ ActZprocess actZprocess = actZprocessMapper.selectById(procDefId);
|
|
|
+ TbTableInfoPractice tableInfoPractice = null;
|
|
|
+
|
|
|
+ if (actZprocess != null) {
|
|
|
+
|
|
|
+ QueryWrapper<TbTableInfoPractice> practiceQueryWrapper = new QueryWrapper<>();
|
|
|
+ practiceQueryWrapper.eq("business_table_id", tableId);
|
|
|
+ tableInfoPractice = tbTableInfoPracticeMapper.selectOne(practiceQueryWrapper);
|
|
|
+
|
|
|
+ String pattern = oConvertUtils.getString(actZprocess.getDescription());
|
|
|
+ if (oConvertUtils.isNotEmpty(pattern) && pattern.startsWith("(") && pattern.endsWith(")") && tableInfoPractice != null){
|
|
|
+ pattern = pattern.replace("(","").replace(")","");
|
|
|
+ if (oConvertUtils.isNotEmpty(pattern)){
|
|
|
+ String[] arr = pattern.split(",");
|
|
|
+ for (String str : arr){
|
|
|
+ String par = request.getParameter(str);
|
|
|
+ if(StringUtils.isBlank(par)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ sbExtraInfo.append(par+" ");
|
|
|
+ }
|
|
|
+ if (sbExtraInfo.length()>0){
|
|
|
+ tableInfoPractice.setExtraInfo(sbExtraInfo.toString());
|
|
|
+ tbTableInfoPracticeMapper.updateById(tableInfoPractice);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+
|
|
|
+ String procDefId = request.getParameter("procDefId");
|
|
|
+ ActBusiness actBusiness = actBusinessMapper.selectById(procDefId);
|
|
|
+ if(actBusiness !=null ){
|
|
|
+ ActZprocess actZprocess = actZprocessMapper.selectById(actBusiness.getProcDefId());
|
|
|
+ TbTableInfoPractice tableInfoPractice = null;
|
|
|
+ if (actZprocess != null) {
|
|
|
+
|
|
|
+ QueryWrapper<TbTableInfoPractice> practiceQueryWrapper = new QueryWrapper<>();
|
|
|
+ practiceQueryWrapper.eq("business_table_id", actBusiness.getTableId());
|
|
|
+ tableInfoPractice = tbTableInfoPracticeMapper.selectOne(practiceQueryWrapper);
|
|
|
+
|
|
|
+ String pattern = oConvertUtils.getString(actZprocess.getDescription());
|
|
|
+
|
|
|
+ if (oConvertUtils.isNotEmpty(pattern) && pattern.startsWith("(") && pattern.endsWith(")") && tableInfoPractice != null){
|
|
|
+ pattern = pattern.replace("(","").replace(")","");
|
|
|
+ if (oConvertUtils.isNotEmpty(pattern)){
|
|
|
+ String[] arr = pattern.split(",");
|
|
|
+ for (String str : arr){
|
|
|
+ String par = request.getParameter(str);
|
|
|
+ if(StringUtils.isBlank(par)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ sbExtraInfo.append(par+" ");
|
|
|
+ }
|
|
|
+ if (sbExtraInfo.length()>0){
|
|
|
+ tableInfoPractice.setExtraInfo(sbExtraInfo.toString());
|
|
|
+ tbTableInfoPracticeMapper.updateById(tableInfoPractice);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public String getValueString(String valueString){
|