|
@@ -11,15 +11,21 @@ import com.jeeplus.core.web.BaseController;
|
|
|
import com.jeeplus.modules.act.entity.Act;
|
|
|
import com.jeeplus.modules.act.service.ActProcessService;
|
|
|
import com.jeeplus.modules.act.service.ActTaskService;
|
|
|
+import com.jeeplus.modules.sg.managementcenter.activiti.entity.Construction;
|
|
|
import com.jeeplus.modules.sg.managementcenter.activiti.service.ConstructionService;
|
|
|
import com.jeeplus.modules.sg.managementcenter.activiti.utils.MyActiviUtils;
|
|
|
import com.jeeplus.modules.sg.managementcenter.materialInventory.entity.MaterialInventory;
|
|
|
import com.jeeplus.modules.sg.managementcenter.materialProvided.entity.MaterialProvided;
|
|
|
import com.jeeplus.modules.sg.managementcenter.materialProvided.service.MaterialProvidedService;
|
|
|
+import com.jeeplus.modules.sg.managementcenter.materialinfo.entity.MaterialInfo;
|
|
|
+import com.jeeplus.modules.sg.managementcenter.project.entity.Project;
|
|
|
import com.jeeplus.modules.sg.managementcenter.project.service.ProjectService;
|
|
|
+import com.jeeplus.modules.sg.materialmodule.activiti.entity.MaterialModule;
|
|
|
+import com.jeeplus.modules.sg.materialmodule.activiti.service.MaterialModuleService;
|
|
|
import com.jeeplus.modules.sg.picking.activiti.entity.*;
|
|
|
import com.jeeplus.modules.sg.picking.activiti.service.PickIngService;
|
|
|
import com.jeeplus.modules.sg.picking.activiti.service.ShowListService;
|
|
|
+import com.jeeplus.modules.sys.entity.DictValue;
|
|
|
import com.jeeplus.modules.sys.utils.UserUtils;
|
|
|
import org.activiti.engine.repository.ProcessDefinition;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
@@ -54,6 +60,8 @@ public class PickIngController extends BaseController {
|
|
|
private ProjectService projectService;
|
|
|
@Autowired
|
|
|
private MaterialProvidedService materialProvidedService;
|
|
|
+ @Autowired
|
|
|
+ private MaterialModuleService materialModuleService;
|
|
|
|
|
|
/**
|
|
|
* 填写项目表
|
|
@@ -209,22 +217,22 @@ public class PickIngController extends BaseController {
|
|
|
Page<PickIng> page = showListService.findNewImgPage(new Page<PickIng>(request, response), pickIng);
|
|
|
//当判定系统为linux的时候
|
|
|
if (Global.SYS_TYPE.equals("2")) {
|
|
|
- List<PickIng> list = page.getList();
|
|
|
- for (PickIng upload :
|
|
|
- list) {
|
|
|
- String mdImg = upload.getMdImg();
|
|
|
- String newMdImg = "";
|
|
|
- String[] split = mdImg.split("\\|");
|
|
|
+ List<PickIng> list = page.getList();
|
|
|
+ for (PickIng upload :
|
|
|
+ list) {
|
|
|
+ String mdImg = upload.getMdImg();
|
|
|
+ String newMdImg = "";
|
|
|
+ String[] split = mdImg.split("\\|");
|
|
|
// String reg = "(?i).+?\\.(jpg|gif|bmp)";
|
|
|
- for (int i = 0; i < split.length; i++) {
|
|
|
+ for (int i = 0; i < split.length; i++) {
|
|
|
/* if (split[i].matches(reg)) {
|
|
|
newMdImg += split[i] + "|";
|
|
|
continue;
|
|
|
}*/
|
|
|
- newMdImg += "http://" + request.getServerName() + split[i] + "|";
|
|
|
+ newMdImg += "http://" + request.getServerName() + split[i] + "|";
|
|
|
+ }
|
|
|
+ upload.setMdImg(newMdImg);
|
|
|
}
|
|
|
- upload.setMdImg(newMdImg);
|
|
|
- }
|
|
|
}
|
|
|
return getBootstrapData(page);
|
|
|
}
|
|
@@ -325,7 +333,7 @@ public class PickIngController extends BaseController {
|
|
|
|
|
|
//先查出所有在物资专职的节点的信息
|
|
|
List<String> activity = MyActiviUtils.findMdActivity("领料:配网物资专职审核领料单");
|
|
|
- if (activity.size()>=0) {
|
|
|
+ if (activity.size() >= 0) {
|
|
|
activity.add("错误提示");
|
|
|
Page<ShowList> page = showListService.inventoryComparisonData(new Page<ShowList>(request, response), showList, activity);
|
|
|
return getBootstrapData(page);
|
|
@@ -366,7 +374,7 @@ public class PickIngController extends BaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 提前施工流程发起
|
|
|
+ * 物资领料流程发起
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "save")
|
|
@@ -390,9 +398,18 @@ public class PickIngController extends BaseController {
|
|
|
/**
|
|
|
* 流程审批
|
|
|
*/
|
|
|
- /*if (StringUtils.isBlank(showList.getId())) {
|
|
|
- String number = showListService.findNumber(showList.getProjectId());
|
|
|
+ Project byName = projectService.findByName(showList.getProjectName());
|
|
|
+ projectId = byName.getProjectId();
|
|
|
+ String projectName = byName.getProjectName();
|
|
|
+ String reserveProjectName = byName.getReserveProjectName();
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(showList.getId())) {
|
|
|
+ String number = showListService.findNumber(projectId);
|
|
|
if (number == null || "".equals(number)) {
|
|
|
+ showList.setsVersion(MyActiviUtils.findDic().getValue());
|
|
|
+ showList.setProjectName(projectName);
|
|
|
+ showList.setProjectId(projectId);
|
|
|
+ showList.setReserveProjectName(reserveProjectName);
|
|
|
showList.setTheNumber("1");
|
|
|
} else {
|
|
|
int i = Integer.parseInt(number);
|
|
@@ -401,30 +418,33 @@ public class PickIngController extends BaseController {
|
|
|
DictValue dic = MyActiviUtils.findDic();
|
|
|
String value = dic.getValue();
|
|
|
showList.setsVersion(value);
|
|
|
+ showList.setProjectName(projectName);
|
|
|
+ showList.setProjectId(projectId);
|
|
|
+ showList.setReserveProjectName(reserveProjectName);
|
|
|
+ showList.setsVersion(MyActiviUtils.findDic().getValue());
|
|
|
}
|
|
|
//新增或编辑表单保存
|
|
|
showListService.save(showList);//保存
|
|
|
- //查询项目的领料状态是否不为0
|
|
|
- String acqStatus = showListService.findAcqStatus(showList);
|
|
|
- if ("0".equals(acqStatus)) {
|
|
|
- showListService.updateAcqStatus(showList);
|
|
|
+ //变更项目领料状态,0未发起变更1发起
|
|
|
+ if ("0".equals(byName.getAcquisitionStatus())) {
|
|
|
+ showListService.updateAcqStatus(reserveProjectName);
|
|
|
}
|
|
|
//修改项目的状态
|
|
|
// 启动流程
|
|
|
Map<String, Object> vars = Maps.newHashMap();
|
|
|
- vars.put("manager", UserUtils.getUser().getLoginName());
|
|
|
+ vars.put("manager", UserUtils.getByUserName(byName.getAssignment().getConstructionManage()).getLoginName());
|
|
|
ProcessDefinition p = actProcessService.getProcessDefinition(showList.getAct().getProcDefId());
|
|
|
String title = showList.getCurrentUser().getName() + "在" + DateUtils.getDateTime() + "发起" + p.getName();
|
|
|
actTaskService.startProcess(p.getKey(), "md_acquisition_process", showList.getId(), title, vars);
|
|
|
j.setMsg("发起领料流程成功!");
|
|
|
j.getBody().put("targetUrl", "/act/task/process/");
|
|
|
|
|
|
- }*/
|
|
|
+ }
|
|
|
return j;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 领料申请流程发起
|
|
|
+ * 领料申请流程发起|
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "pickSave")
|
|
@@ -456,7 +476,7 @@ public class PickIngController extends BaseController {
|
|
|
//配网政策处理专职
|
|
|
List<String> strings = constructionService.nameFindOffice(loginName);
|
|
|
boolean flag = false;
|
|
|
- for (String a :strings) {
|
|
|
+ for (String a : strings) {
|
|
|
if ("配网政策处理专职".equals(a)) {
|
|
|
flag = true;
|
|
|
}
|
|
@@ -647,7 +667,7 @@ public class PickIngController extends BaseController {
|
|
|
//备注
|
|
|
showList.setMdText("");
|
|
|
|
|
|
- List<ShowList> insertList = new ArrayList<>();
|
|
|
+ List<ShowList> insertList = new ArrayList<>();
|
|
|
insertList.add(showList);
|
|
|
//将信息和数量存入对应表
|
|
|
pickIngService.processTemList(insertList);
|
|
@@ -665,10 +685,10 @@ public class PickIngController extends BaseController {
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "exportErpData")
|
|
|
- public AjaxJson exportErpData(String id, String projectId, HttpServletRequest request, HttpServletResponse response) {
|
|
|
+ public AjaxJson exportErpData(String id, String projectName, HttpServletRequest request, HttpServletResponse response) {
|
|
|
AjaxJson j = new AjaxJson();
|
|
|
try {
|
|
|
- projectId = URLDecoder.decode(projectId, "UTF-8");
|
|
|
+ projectName = URLDecoder.decode(projectName, "UTF-8");
|
|
|
} catch (UnsupportedEncodingException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -688,15 +708,131 @@ public class PickIngController extends BaseController {
|
|
|
//循环数据,根据类型分组
|
|
|
for (Acquisition acquisition : erpType) {
|
|
|
String itemType = acquisition.getProType();
|
|
|
- if ("配网成本".equals(itemType)) {
|
|
|
+ if (itemType.contains("成本")) {
|
|
|
cbList.add(acquisition);
|
|
|
}
|
|
|
}
|
|
|
if (cbList.size() > 0) {
|
|
|
try {
|
|
|
String fileName = "导出成本ERP" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
|
|
|
- List<CapitalExport> capitalExports = pickIngService.cbList(cbList, projectId);
|
|
|
+ List<CapitalExport> capitalExports = pickIngService.cbList(cbList, projectName);
|
|
|
new ExportExcel("导出成本ERP", CapitalExport.class).setDataList(capitalExports).write(response, fileName).dispose();
|
|
|
+ List<Acquisition> updateList = new ArrayList<>();
|
|
|
+ List<String> selectList = new ArrayList<>();
|
|
|
+ //修改项目状态可以进场
|
|
|
+ for (Acquisition acquisition : cbList
|
|
|
+ ) {
|
|
|
+ //获取可以进场的项目信息
|
|
|
+ if ("1".equals(acquisition.getCanEnter())) {
|
|
|
+ updateList.add(acquisition);
|
|
|
+ selectList.add(acquisition.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //变更状态
|
|
|
+ if (updateList.size() > 0) {
|
|
|
+ pickIngService.updateEnterList(updateList);
|
|
|
+ }
|
|
|
+ if (selectList.size() > 0) {
|
|
|
+ //根据变更的id,查询改同储备项目名称下的领料单,判断是否已经都可进场,若可以进场,修改对应项目的项目状态
|
|
|
+ List<Acquisition> erpType1 = pickIngService.findErpAll(selectList);
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ for (Acquisition acquisition : erpType1
|
|
|
+ ) {
|
|
|
+ if (map.containsKey(acquisition.getReserveProjectName())) {
|
|
|
+ //获得key值对应的value值,如果是1-未完成领料,不修改值,如果是2-完成领料,判断该项目下的其它领料单状态,修改状态
|
|
|
+ String keyValue = map.get(acquisition.getReserveProjectName());
|
|
|
+ if ("2".equals(keyValue)) {
|
|
|
+ if ("2".equals(acquisition.getCanEnter())) {
|
|
|
+ map.put(acquisition.getReserveProjectName(), "2");
|
|
|
+ } else {
|
|
|
+ map.put(acquisition.getReserveProjectName(), "1");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if ("2".equals(acquisition.getCanEnter())) {
|
|
|
+ map.put(acquisition.getReserveProjectName(), "2");
|
|
|
+ } else {
|
|
|
+ map.put(acquisition.getReserveProjectName(), "1");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<String> updateProjectList = new ArrayList<>();
|
|
|
+ Iterator<Map.Entry<String, String>> iterator = map.entrySet().iterator();
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ Map.Entry<String, String> next = iterator.next();
|
|
|
+ String key = next.getKey();
|
|
|
+ String value = next.getValue();
|
|
|
+ if ("2".equals(value)) {
|
|
|
+ updateProjectList.add(key);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (updateProjectList.size() > 0) {
|
|
|
+ pickIngService.updateProjectEnter(updateProjectList);
|
|
|
+ for (String name :
|
|
|
+ updateProjectList) {
|
|
|
+ //查询出所有更改项目状态的信息,判断是否完成土建流程,发送施工流程
|
|
|
+ Project byName = projectService.findByName(name);
|
|
|
+ if ("2".equals(byName.getAcquisitionStatus())) {
|
|
|
+ //判断是否包含土建
|
|
|
+ boolean electric = false;
|
|
|
+ //判单钢管杠,水泥杠,存在电气,判断是否包含
|
|
|
+ List<MaterialInfo> allInfo = projectService.findAllInfo(byName.getId());
|
|
|
+ if (allInfo.size() > 0) {
|
|
|
+ for (MaterialInfo mi : allInfo
|
|
|
+ ) {
|
|
|
+ String materialName = mi.getMaterialName();
|
|
|
+ if (null != materialName && !"".equals(materialName)) {
|
|
|
+ //判断项目是否包含描述为钢管杆或水泥杠的物料,存在步入电气流程
|
|
|
+ if (materialName.contains("钢管杆") || materialName.contains("水泥杆")) {
|
|
|
+ electric = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //查询出项目的基础信息,停电线路(如果纯在),人员流转信息
|
|
|
+ Construction blockAss = projectService.findBlockAss(byName.getId());
|
|
|
+ Map<String, Object> vars = Maps.newHashMap();
|
|
|
+ //没用电气及涉电 运行条件
|
|
|
+ vars.put("no", false);
|
|
|
+ //没有电气,有涉电 运行条件
|
|
|
+ vars.put("notContain", false);
|
|
|
+ //包含电气/涉电-优先电气 运行条件
|
|
|
+ vars.put("electrical", false);
|
|
|
+ if (electric) {
|
|
|
+ //发送开始电气流程
|
|
|
+ vars.put("electrical", true);
|
|
|
+ } else {
|
|
|
+ //没用电气进行涉电
|
|
|
+ //获取项目的领料单,查询停电线路
|
|
|
+ String blackoutLine = blockAss.getQuantity().getBlackoutLine();
|
|
|
+ if (null != blackoutLine && !"".equals(blackoutLine) && !"不涉电".equals(blackoutLine)) {
|
|
|
+ //填写停电线路,不为空,-步入发起涉电流程
|
|
|
+ vars.put("notContain", true);
|
|
|
+ } else {
|
|
|
+ vars.put("no", true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ MaterialModule materialModule = new MaterialModule();
|
|
|
+ if (StringUtils.isBlank(materialModule.getId())) {
|
|
|
+ vars.put("manager", UserUtils.getByUserName(blockAss.getAssignment().getConstructionManage()).getLoginName());
|
|
|
+ materialModule.setProjectId(blockAss.getProjectId());
|
|
|
+ materialModule.setProjectName(blockAss.getProjectName());
|
|
|
+ materialModule.setReserveProjectName(blockAss.getReserveProjectName());
|
|
|
+ //保存项目储备项目名称,项目定义号,项目名称
|
|
|
+ materialModuleService.save(materialModule);
|
|
|
+ //修改项目状态
|
|
|
+ materialModuleService.updateConstructionStatus("1", blockAss.getReserveProjectName());
|
|
|
+ String procDefId = projectService.findDefId("sgys");
|
|
|
+ // 启动流程
|
|
|
+ ProcessDefinition p = actProcessService.getProcessDefinition(materialModule.getAct().getProcDefId());
|
|
|
+ String title = materialModule.getCurrentUser().getName() + "在" + DateUtils.getDateTime() + "发起" + p.getName();
|
|
|
+ actTaskService.startProcess(p.getKey(), "sg_construction_process", materialModule.getId(), title, vars);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
j.setSuccess(true);
|
|
|
j.setMsg("导出成功!");
|
|
|
} catch (IOException e) {
|
|
@@ -706,7 +842,7 @@ public class PickIngController extends BaseController {
|
|
|
try {
|
|
|
String fileName = "没有对应的项目信息" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
|
|
|
List<CapitalExport> nullExports = new ArrayList<>();
|
|
|
- new ExportExcel("没有对应的项目信息", CapitalExport.class).setDataList(nullExports).write(response,fileName ).dispose();
|
|
|
+ new ExportExcel("没有对应的项目信息", CapitalExport.class).setDataList(nullExports).write(response, fileName).dispose();
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -744,7 +880,7 @@ public class PickIngController extends BaseController {
|
|
|
//循环数据,根据类型分组
|
|
|
for (Acquisition acquisition : erpType) {
|
|
|
String itemType = acquisition.getProType();
|
|
|
- if ("配网资本".equals(itemType)) {
|
|
|
+ if (itemType.contains("资本")) {
|
|
|
zbList.add(acquisition);
|
|
|
}
|
|
|
}
|
|
@@ -754,16 +890,133 @@ public class PickIngController extends BaseController {
|
|
|
String fileName = "导出资本ERP" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
|
|
|
List<CapitalExport> capitalExports = pickIngService.zbList(zbList, projectId);
|
|
|
new ExportExcel("导出资本ERP", CapitalExport.class).setDataList(capitalExports).write(response, fileName).dispose();
|
|
|
+ List<Acquisition> updateList = new ArrayList<>();
|
|
|
+ List<String> selectList = new ArrayList<>();
|
|
|
+ //修改项目状态可以进场
|
|
|
+ for (Acquisition acquisition : zbList
|
|
|
+ ) {
|
|
|
+ //获取可以进场的项目信息
|
|
|
+ if ("1".equals(acquisition.getCanEnter())) {
|
|
|
+ updateList.add(acquisition);
|
|
|
+ selectList.add(acquisition.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //变更状态
|
|
|
+ if (updateList.size() > 0) {
|
|
|
+ pickIngService.updateEnterList(updateList);
|
|
|
+ }
|
|
|
+ if (selectList.size() > 0) {
|
|
|
+ //根据变更的id,查询改同储备项目名称下的领料单,判断是否已经都可进场,若可以进场,修改对应项目的项目状态
|
|
|
+ List<Acquisition> erpType1 = pickIngService.findErpAll(selectList);
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ for (Acquisition acquisition : erpType1
|
|
|
+ ) {
|
|
|
+ if (map.containsKey(acquisition.getReserveProjectName())) {
|
|
|
+ //获得key值对应的value值,如果是1-未完成领料,不修改值,如果是2-完成领料,判断该项目下的其它领料单状态,修改状态
|
|
|
+ String keyValue = map.get(acquisition.getReserveProjectName());
|
|
|
+ if ("2".equals(keyValue)) {
|
|
|
+ if ("2".equals(acquisition.getCanEnter())) {
|
|
|
+ map.put(acquisition.getReserveProjectName(), "2");
|
|
|
+ } else {
|
|
|
+ map.put(acquisition.getReserveProjectName(), "1");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if ("2".equals(acquisition.getCanEnter())) {
|
|
|
+ map.put(acquisition.getReserveProjectName(), "2");
|
|
|
+ } else {
|
|
|
+ map.put(acquisition.getReserveProjectName(), "1");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<String> updateProjectList = new ArrayList<>();
|
|
|
+ Iterator<Map.Entry<String, String>> iterator = map.entrySet().iterator();
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ Map.Entry<String, String> next = iterator.next();
|
|
|
+ String key = next.getKey();
|
|
|
+ String value = next.getValue();
|
|
|
+ if ("2".equals(value)) {
|
|
|
+ updateProjectList.add(key);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (updateProjectList.size() > 0) {
|
|
|
+ pickIngService.updateProjectEnter(updateProjectList);
|
|
|
+ for (String name :
|
|
|
+ updateProjectList) {
|
|
|
+ //查询出所有更改项目状态的信息,判断是否完成土建流程,发送施工流程
|
|
|
+ Project byName = projectService.findByName(name);
|
|
|
+ if ("2".equals(byName.getAcquisitionStatus())) {
|
|
|
+ //判断是否包含电气
|
|
|
+
|
|
|
+ boolean electric = false;
|
|
|
+ //判单钢管杠,水泥杠,存在电气,判断是否包含
|
|
|
+ List<MaterialInfo> allInfo = projectService.findAllInfo(byName.getId());
|
|
|
+ if (allInfo.size() > 0) {
|
|
|
+ for (MaterialInfo mi : allInfo
|
|
|
+ ) {
|
|
|
+ String materialName = mi.getMaterialName();
|
|
|
+ if (null != materialName && !"".equals(materialName)) {
|
|
|
+ //判断项目是否包含描述为钢管杆或水泥杠的物料,存在步入电气流程
|
|
|
+ if (materialName.contains("钢管杆") || materialName.contains("水泥杆")) {
|
|
|
+ electric = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //查询出项目的基础信息,停电线路(如果纯在),人员流转信息
|
|
|
+ Construction blockAss = projectService.findBlockAss(byName.getId());
|
|
|
+ Map<String, Object> vars = Maps.newHashMap();
|
|
|
+ //没用电气及涉电 运行条件
|
|
|
+ vars.put("no", false);
|
|
|
+ //没有电气,有涉电 运行条件
|
|
|
+ vars.put("notContain", false);
|
|
|
+ //包含电气/涉电-优先电气 运行条件
|
|
|
+ vars.put("electrical", false);
|
|
|
+ if (electric) {
|
|
|
+ //发送开始电气流程
|
|
|
+ vars.put("electrical", true);
|
|
|
+ } else {
|
|
|
+ //没用电气进行涉电
|
|
|
+ //获取项目的领料单,查询停电线路
|
|
|
+ String blackoutLine = blockAss.getQuantity().getBlackoutLine();
|
|
|
+ if (null != blackoutLine && !"".equals(blackoutLine) && !"不涉电".equals(blackoutLine)) {
|
|
|
+ //填写停电线路,不为空,-步入发起涉电流程
|
|
|
+ vars.put("notContain", true);
|
|
|
+ } else {
|
|
|
+ vars.put("no", true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ MaterialModule materialModule = new MaterialModule();
|
|
|
+ if (StringUtils.isBlank(materialModule.getId())) {
|
|
|
+ vars.put("manager", UserUtils.getByUserName(blockAss.getAssignment().getConstructionManage()).getLoginName());
|
|
|
+ materialModule.setProjectId(blockAss.getProjectId());
|
|
|
+ materialModule.setProjectName(blockAss.getProjectName());
|
|
|
+ materialModule.setReserveProjectName(blockAss.getReserveProjectName());
|
|
|
+ //保存项目储备项目名称,项目定义号,项目名称
|
|
|
+ materialModuleService.save(materialModule);
|
|
|
+ //修改项目状态
|
|
|
+ materialModuleService.updateConstructionStatus("1", blockAss.getReserveProjectName());
|
|
|
+ String procDefId = projectService.findDefId("sgys");
|
|
|
+ // 启动流程
|
|
|
+ ProcessDefinition p = actProcessService.getProcessDefinition(procDefId);
|
|
|
+ String title = materialModule.getCurrentUser().getName() + "在" + DateUtils.getDateTime() + "发起" + p.getName();
|
|
|
+ actTaskService.startProcess(p.getKey(), "sg_construction_process", materialModule.getId(), title, vars);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
j.setSuccess(true);
|
|
|
j.setMsg("导出成功!");
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
try {
|
|
|
String fileName = "没有对应的项目信息" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
|
|
|
List<CapitalExport> nullExports = new ArrayList<>();
|
|
|
- new ExportExcel("没有对应的项目信息", CapitalExport.class).setDataList(nullExports).write(response,fileName ).dispose();
|
|
|
+ new ExportExcel("没有对应的项目信息", CapitalExport.class).setDataList(nullExports).write(response, fileName).dispose();
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -873,6 +1126,20 @@ public class PickIngController extends BaseController {
|
|
|
return j;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 修改项目的是否可以经常状态
|
|
|
+ */
|
|
|
+ @ResponseBody
|
|
|
+ @RequestMapping(value = "updateCanEnter")
|
|
|
+ public AjaxJson updateCanEnter(Act act) {
|
|
|
+ AjaxJson j = new AjaxJson();
|
|
|
+ //获取流程定义号,更具定义号获取项目的储备项目名称
|
|
|
+ String procInsId = act.getProcInsId();
|
|
|
+ //修改项目信息中的是否可以进场
|
|
|
+ pickIngService.updateEnter(procInsId);
|
|
|
+ j.setMsg("进场成功!");
|
|
|
+ return j;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|