企标计划批量走流程
This commit is contained in:
@@ -28,6 +28,7 @@ import com.adc.da.workFlow.dao.ExportExcelMapper;
|
||||
import com.adc.da.workFlow.entity.*;
|
||||
import com.adc.da.workFlow.service.WorkFlowService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import oracle.ucp.proxy.annotation.Post;
|
||||
@@ -39,6 +40,7 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.spring.web.json.Json;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -48,6 +50,7 @@ import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -1002,4 +1005,94 @@ public class WorkFlowController {
|
||||
return workFlowFeignClient.selectWenDan(taskId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量发送待办任务(正常走流程)")
|
||||
@GetMapping("/batchToDoTasks")
|
||||
public ResponseMessage<Object> batchToDoTasks(String json){
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
//获取所有数据
|
||||
JSONObject jsonObject = JSONObject.parseObject(json);
|
||||
List<EsRevisePlan> esRevisePlans = iEsRevisePlanService.batchToDoTasks(json);
|
||||
String userId = "";
|
||||
String userName = "";
|
||||
Object userIdObject = jsonObject.get("prcCreateUser");
|
||||
if(userIdObject!=null){
|
||||
userId = userIdObject.toString();
|
||||
userName = userService.userIdByName(userId);
|
||||
}
|
||||
|
||||
//循环数据
|
||||
for (EsRevisePlan data : esRevisePlans){
|
||||
//数据拼接
|
||||
ProcessRollBackEO processRollBackEO = new ProcessRollBackEO();
|
||||
processRollBackEO.setUserId(userId);
|
||||
processRollBackEO.setType("25");
|
||||
//拼接json
|
||||
HashMap<String, Object> qbfsForm = new HashMap<>();
|
||||
HashMap<String, Object> qbfsFormInfo = new HashMap<>();
|
||||
qbfsForm.put("bussSort",data.getBussSort());
|
||||
qbfsForm.put("esMatingRelations",data.getEsMatingRelations());
|
||||
qbfsForm.put("technologic",data.getTechnologic());
|
||||
qbfsForm.put("useLevel",data.getUseLevel());
|
||||
qbfsForm.put("isRelate",data.getIsRelate());
|
||||
qbfsForm.put("esStandRelations",data.getEsStandRelations());
|
||||
//数组格式
|
||||
String[] split = data.getArea().split(",");
|
||||
qbfsForm.put("area",split);
|
||||
qbfsForm.put("tsJson",data.getTsJson());
|
||||
qbfsForm.put("tsJsonName",data.getTsJsonName());
|
||||
qbfsForm.put("rqbJson",data.getRqbJson());
|
||||
qbfsForm.put("rqbName",data.getRqbName());
|
||||
qbfsForm.put("unit",data.getUnit());
|
||||
qbfsForm.put("unitName",data.getUnitName());
|
||||
qbfsForm.put("esName",data.getEsName());
|
||||
qbfsForm.put("planStatus",data.getPlanStatus());
|
||||
qbfsForm.put("reviseStatus",data.getReviseStatus());
|
||||
qbfsForm.put("resPerson",data.getResPerson());
|
||||
qbfsForm.put("resPersonName",data.getResPersonName());
|
||||
|
||||
String wgLeaderStr = data.getWgLeader();
|
||||
if(wgLeaderStr!=null){
|
||||
if(wgLeaderStr.endsWith(",")){
|
||||
wgLeaderStr = wgLeaderStr.substring(0,wgLeaderStr.length()-1);
|
||||
}
|
||||
}
|
||||
qbfsForm.put("wgLeader",wgLeaderStr);
|
||||
qbfsForm.put("wgLeaderName",data.getWgLeaderName());
|
||||
qbfsForm.put("draftTime",simpleDateFormat.format(data.getDraftTime()));
|
||||
qbfsForm.put("releaseTime",simpleDateFormat.format(data.getReleaseTime()));
|
||||
qbfsForm.put("drafter",data.getDrafter());
|
||||
qbfsForm.put("drafterName",data.getDrafterName());
|
||||
qbfsForm.put("LXD",data.getLxd());
|
||||
qbfsForm.put("LXDName","");
|
||||
//争议
|
||||
qbfsForm.put("lxd","");
|
||||
//争议
|
||||
qbfsForm.put("lxdName","立项单");
|
||||
qbfsForm.put("addFlag","1");
|
||||
if(jsonObject.get("prcCreateUser")!=null){
|
||||
qbfsForm.put("prcCreateUser",jsonObject.get("prcCreateUser").toString());
|
||||
qbfsForm.put("prcCreateUserName",userName);
|
||||
}
|
||||
qbfsForm.put("nowEsId","操作成功");
|
||||
qbfsForm.put("type","5");
|
||||
String jsonMap = JSONObject.toJSONString(qbfsForm);
|
||||
qbfsFormInfo.put("qbfsForm",qbfsForm);
|
||||
processRollBackEO.setJson(JSONObject.toJSONString(qbfsFormInfo));
|
||||
ResponseMessage responseMessage = startProcessRollBack(processRollBackEO);
|
||||
if(responseMessage!=null){
|
||||
String taskId = responseMessage.getData().toString();
|
||||
BusMes busMes = new BusMes();
|
||||
busMes.setPrcType("25");
|
||||
busMes.setTaskIds(taskId);
|
||||
busMes.setCreateUserName(userName);
|
||||
if(jsonObject.get("prcCreateUser")!=null){
|
||||
busMes.setUserId(jsonObject.get("prcCreateUser").toString());
|
||||
}
|
||||
busMes.setJson(jsonMap);
|
||||
Wrapper<String> stringWrapper = completeTaskByUserId(busMes);
|
||||
}
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
@@ -2,6 +2,7 @@ package com.adc.da.slrs.esRevisePlan.service;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -34,4 +35,6 @@ public interface IEsRevisePlanService extends IService<EsRevisePlan> {
|
||||
|
||||
List<EsRevisePlan> getAllPlansByWkInfo();
|
||||
|
||||
List<EsRevisePlan> batchToDoTasks(String json);
|
||||
|
||||
}
|
||||
|
||||
+16
-2
@@ -53,11 +53,9 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
|
||||
private ISarBussionessStandService iSarBussionessStandService;
|
||||
@Autowired
|
||||
private EsRevisePlanLogDao esRevisePlanLogDao;
|
||||
|
||||
@Autowired
|
||||
private IEsRevisePlanLogService esRevisePlanLogService;
|
||||
|
||||
|
||||
@Override
|
||||
public List<EsRevisePlan> getAllPlans(EsRevisePlan esRevisePlan) {
|
||||
Integer count = esRevisePlanDao.getTotal();
|
||||
@@ -248,4 +246,20 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
|
||||
queryWrapper.lambda().in(EsRevisePlan::getPlanStatus, planStatus);
|
||||
return esRevisePlanDao.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EsRevisePlan> batchToDoTasks(String json) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(json);
|
||||
Object ids = jsonObject.get("ids");
|
||||
List<EsRevisePlan> esRevisePlans = new ArrayList();
|
||||
if(ids!=null){
|
||||
String[] split = ids.toString().split(",");
|
||||
List<String> idsList = Arrays.asList(split);
|
||||
for (String id : idsList){
|
||||
EsRevisePlan esRevisePlan = this.baseMapper.selectById(id);
|
||||
esRevisePlans.add(esRevisePlan);
|
||||
}
|
||||
}
|
||||
return esRevisePlans;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user