Commit 715ead06 authored by zhangsen's avatar zhangsen

资料审核相关业务修改

parent 53e505df
package com.yeejoin.amos.boot.module.ugp.api.dto;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Data;
import java.util.List;
import java.util.Map;
@Data
public class FileDto {
......@@ -13,4 +17,7 @@ public class FileDto {
private JSONArray installSubForm;
private JSONArray designSubForm;
// 前端定制组件格式 文件
Page<Map<String, Object>> mapPage;
}
package com.yeejoin.amos.boot.module.ugp.api.service;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.ugp.api.dto.OverProjectDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
public interface IProjectInitiationService {
/**
......
......@@ -24,6 +24,7 @@ import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import io.swagger.models.Model;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.BeanUtilsBean;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -457,10 +458,11 @@ public class ProjectController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "POST", value = "资料提交/保存", notes = "资料提交/保存")
@PostMapping(value = "/informationSaveOrUpdate")
public ResponseModel<Object> informationSaveOrUpdate(@RequestBody JSONObject object) {
public ResponseModel<Object> informationSaveOrUpdate(@RequestBody JSONObject jsonObject) {
Map<String, Object> map = (Map<String, Object>) jsonObject.get(TabLogoEnum.项目资料信息.getLogo());
InformationDto dto = new InformationDto();
dto.setProjectId(Long.valueOf(String.valueOf(object.get("projectId"))));
Map<String, Object> map = JSON.parseObject(object.toString());
Long projectId = Long.valueOf(String.valueOf(jsonObject.get("projectId")));
String type = String.valueOf(jsonObject.get("type"));
List<Map<String, Object>> welderList = (List<Map<String, Object>>) map.get("welderList");
if (!ObjectUtils.isEmpty(welderList)) {
dto.setWelderList(welderList);
......@@ -476,25 +478,21 @@ public class ProjectController extends BaseController {
dto.setEquipmentList(equipmentList);
}
List<Map<String, Object>> fileList = (List<Map<String, Object>>) map.get("fileList");
if (!ObjectUtils.isEmpty(fileList)) {
dto.setFileList(fileList);
}
dto.setType(String.valueOf(object.get("type")));
JSONObject jsonObject = new JSONObject();
jsonObject.put("designSubForm", object.get("designSubForm"));
jsonObject.put("installSubForm", object.get("installSubForm"));
projectServiceImpl.informationSaveOrUpdate(dto.getEquipmentList(), dto.getWelderList(), dto.getMaterialList(), jsonObject, dto.getProjectId(), dto.getType());
dto.setType(String.valueOf(jsonObject.get("type")));
JSONObject jsonObject2 = new JSONObject();
jsonObject2.put("designSubForm", map.get("designSubForm"));
jsonObject2.put("installSubForm", map.get("installSubForm"));
projectServiceImpl.informationSaveOrUpdate(dto.getEquipmentList(), dto.getWelderList(), dto.getMaterialList(), jsonObject2, projectId, type);
return ResponseHelper.buildResponse("ok");
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "POST", value = "资料保存、审核", notes = "资料保存、审核")
@PostMapping(value = "/informationAudit")
public ResponseModel<Object> informationAudit(@RequestBody JSONObject object) {
public ResponseModel<Object> informationAudit(@RequestBody JSONObject jsonObject) {
Map<String, Object> map = (Map<String, Object>) jsonObject.get(TabLogoEnum.项目资料信息.getLogo());
InformationDto dto = new InformationDto();
dto.setProjectId(Long.valueOf(String.valueOf(object.get("projectId"))));
Map<String, Object> map = JSON.parseObject(object.toString());
dto.setProjectId(Long.valueOf(String.valueOf(jsonObject.get("projectId"))));
List<Map<String, Object>> welderList = (List<Map<String, Object>>) map.get("welderList");
if (!ObjectUtils.isEmpty(welderList)) {
dto.setWelderList(welderList);
......@@ -511,7 +509,7 @@ public class ProjectController extends BaseController {
if (!ObjectUtils.isEmpty(fileList)) {
dto.setFileList(fileList);
}
projectServiceImpl.informationAudit(dto.getEquipmentList(), dto.getWelderList(), dto.getMaterialList(), dto.getFileList(), dto.getProjectId(), dto.getType());
projectServiceImpl.informationAudit(dto.getEquipmentList(), dto.getWelderList(), dto.getMaterialList(), dto.getFileList(), dto.getProjectId(), String.valueOf(jsonObject.get("type")));
return ResponseHelper.buildResponse("ok");
}
......
package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.ugp.api.Enum.ProcessTypeEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.WhetherItPassEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.TabLogoEnum;
import com.yeejoin.amos.boot.module.ugp.api.dto.OverProjectDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.yeejoin.amos.boot.module.ugp.api.entity.ProjectInitiation;
import com.yeejoin.amos.boot.module.ugp.api.service.IProjectInitiationService;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectInitiationServiceImpl;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectOverFlowServiceImpl;
......@@ -53,12 +48,13 @@ public class ProjectOverFlowController extends BaseController {
/**
* 项目结项流程启动API
*
* @param dto 项目结项信息
* @param jsonObject 表单信息: 项目结项信息 key为:{@link TabLogoEnum}
*/
@PostMapping(value = "/flowStart")
@ApiOperation(value = "项目竣工结项(竣工结项确认)- 结项项目结项流程启动API", notes = "项目竣工结项(竣工结项确认)- 项目结项流程启动API")
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
public ResponseModel<Object> overProjectFlowStart(@RequestBody OverProjectDto dto) {
public ResponseModel<Object> overProjectFlowStart(@RequestBody JSONObject jsonObject) {
OverProjectDto dto = JSON.parseObject(JSON.toJSONString(jsonObject.get(TabLogoEnum.项目竣工信息.getLogo())), OverProjectDto.class);
String token = RequestContext.getToken();
String appKey = RequestContext.getAppKey();
String product = RequestContext.getProduct();
......@@ -76,12 +72,13 @@ public class ProjectOverFlowController extends BaseController {
/**
* 项目结项执行流程
*
* @param dto 项目结项信息
* @param jsonObject @param jsonObject 表单信息: 项目结项信息 key为:{@link TabLogoEnum}
*/
@PostMapping(value = "/flowExecute")
@ApiOperation(value = "项目结项流程执行通用API", notes = "项目结项流程执行通用API")
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
public ResponseModel<Object> overProjectFlowExecute(@RequestBody OverProjectDto dto) {
public ResponseModel<Object> overProjectFlowExecute(@RequestBody JSONObject jsonObject) {
OverProjectDto dto = JSON.parseObject(JSON.toJSONString(jsonObject.get(TabLogoEnum.项目竣工信息.getLogo())), OverProjectDto.class);
iProjectInitiationService.overProjectFlowExecute(dto);
return ResponseHelper.buildResponse(null);
}
......
......@@ -6,16 +6,10 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.yeejoin.amos.boot.module.ugp.api.Enum.ProcessTypeEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.WhetherItPassEnum;
import com.yeejoin.amos.boot.module.ugp.api.dto.OverProjectDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectResourceDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.yeejoin.amos.boot.module.ugp.api.entity.ProjectInitiation;
import com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource;
import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IProjectResourceService;
import org.kie.internal.runtime.cdi.Activate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
@Service
public class ProjectOverFlowServiceImpl {
......
......@@ -31,6 +31,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
......@@ -776,7 +777,7 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
equipmentList.forEach(item -> {
ProjectResource projectResource = new ProjectResource();
projectResource.setProjectId(projectId);
projectResource.setResourceId(Long.valueOf(String.valueOf(item.get("sequenceNbr"))));
projectResource.setResourceId(Long.valueOf(String.valueOf(item.get("sequence_nbr"))));
projectResource.setType("equipment");
projectResource.setName(String.valueOf(item.get("name")));
projectResource.setStatus(ObjectUtils.isEmpty(item.get(status)) ? "0" : String.valueOf(item.get(status)));
......@@ -809,8 +810,10 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
}
LambdaQueryWrapper<ProjectResource> lambda = new QueryWrapper<ProjectResource>().lambda();
lambda.eq(ProjectResource::getProjectId, projectId);
projectResourceMapper.delete(lambda);
projectResourceService.saveBatch(projectResources);
if (!CollectionUtils.isEmpty(projectResources)) {
projectResourceMapper.delete(lambda);
projectResourceService.saveBatch(projectResources);
}
}
@Transactional
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment