Commit 21c341ff authored by lisong's avatar lisong

更新

parent 20555cb8
...@@ -24,6 +24,11 @@ public class XJConstant { ...@@ -24,6 +24,11 @@ public class XJConstant {
//附件默认值 //附件默认值
public static final String INSTALL_SUB_FORM="[{\"Symbol_key\":\"B83A18D2-FF89-47D2-BEA2-BAA097E09783\",\"subFormInstall\":\"材质证明文件\",\"info\":\"\",\"type\":\"安装单位\"},{\"Symbol_key\":\"DB0306C1-3520-4BB4-93CE-44DA95AAD408\",\"subFormInstall\":\"焊接工艺评定报告\",\"info\":\"\",\"type\":\"安装单位\"}]"; public static final String INSTALL_SUB_FORM="[{\"Symbol_key\":\"B83A18D2-FF89-47D2-BEA2-BAA097E09783\",\"subFormInstall\":\"材质证明文件\",\"info\":\"\",\"type\":\"安装单位\"},{\"Symbol_key\":\"DB0306C1-3520-4BB4-93CE-44DA95AAD408\",\"subFormInstall\":\"焊接工艺评定报告\",\"info\":\"\",\"type\":\"安装单位\"}]";
public static final String DESIGN_SUB_FORM="[{\"Symbol_key\":\"314C727B-A6A7-40F1-9CFC-C354748657F7\",\"subFormAttachment\":\"设计文件\",\"info\":\"\",\"type\":\"设计单位\"},{\"Symbol_key\":\"5F3B660B-25A2-420C-919E-60F74CE1F36A\",\"subFormAttachment\":\"施工组织设计文件\",\"info\":\"\",\"type\":\"设计单位\"}]"; public static final String DESIGN_SUB_FORM="[{\"Symbol_key\":\"314C727B-A6A7-40F1-9CFC-C354748657F7\",\"subFormAttachment\":\"设计文件\",\"info\":\"\",\"type\":\"设计单位\"},{\"Symbol_key\":\"5F3B660B-25A2-420C-919E-60F74CE1F36A\",\"subFormAttachment\":\"施工组织设计文件\",\"info\":\"\",\"type\":\"设计单位\"}]";
// 安装单位
public static final String INSTALL_SUB_FORM_NEW = "[{\"Symbol_key\":\"B83A18D2-FF89-47D2-BEA2-BAA097E09783\",\"subFormInstall\":\"材质证明文件\",\"info\":\"\",\"type\":\"安装单位\"},{\"Symbol_key\":\"DB0306C1-3520-4BB4-93CE-44DA95AAD408\",\"subFormInstall\":\"焊接工艺评定报告\",\"info\":\"\",\"type\":\"安装单位\"},{\"Symbol_key\":\"DB0306C1-3520-4BB4-93CE-44DA95AAD408\",\"subFormInstall\":\"施工组织设计文件\",\"info\":\"\",\"type\":\"安装单位\"},{\"Symbol_key\":\"DB0306C1-3520-4BB4-93CE-44DA95AAD408\",\"subFormInstall\":\"合同文件\",\"info\":\"\",\"type\":\"安装单位\"}]";
// 设计单位
public static final String DESIGN_SUB_FORM_NEW = "[{\"Symbol_key\":\"314C727B-A6A7-40F1-9CFC-C354748657F7\",\"subFormAttachment\":\"设计文件\",\"info\":\"\",\"type\":\"设计单位\"},{\"Symbol_key\":\"5F3B660B-25A2-420C-919E-60F74CE1F36A\",\"subFormAttachment\":\"其他\",\"info\":\"\",\"type\":\"设计单位\"}]";
//人员org数值 //人员org数值
public static final int ORG_CODE=18; public static final int ORG_CODE=18;
public static final int ORG_CODE_USER=12; public static final int ORG_CODE_USER=12;
......
package com.yeejoin.amos.boot.module.ugp.api.dto;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import java.util.List;
import java.util.Map;
@Data
public class InformationDto {
private List<Map<String, Object>>equipmentList;
private List<Map<String, Object>>welderList;
private List<Map<String, Object>>materialList;
private List<Map<String, Object>> fileList;
private Long projectId;
}
...@@ -46,4 +46,9 @@ public class ProjectResource extends BaseEntity { ...@@ -46,4 +46,9 @@ public class ProjectResource extends BaseEntity {
@TableField("resource_id") @TableField("resource_id")
private Long resourceId; private Long resourceId;
/**
* 告知资料审核状态 1 合格 0 不合格(默认合格)
*/
@TableField("status")
private String status;
} }
...@@ -13,13 +13,8 @@ import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil; ...@@ -13,13 +13,8 @@ import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.WhetherItPassEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.WhetherItPassEnum;
import com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant; import com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant;
import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto; import com.yeejoin.amos.boot.module.ugp.api.dto.*;
import com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto; import com.yeejoin.amos.boot.module.ugp.api.entity.*;
import com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Attachment;
import com.yeejoin.amos.boot.module.ugp.api.entity.Company;
import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.yeejoin.amos.boot.module.ugp.api.mapper.CompanyMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.CompanyMapper;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify; import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.*; import com.yeejoin.amos.boot.module.ugp.biz.service.impl.*;
...@@ -52,7 +47,6 @@ import javax.crypto.spec.RC2ParameterSpec; ...@@ -52,7 +47,6 @@ import javax.crypto.spec.RC2ParameterSpec;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -421,5 +415,43 @@ public class ProjectController extends BaseController { ...@@ -421,5 +415,43 @@ public class ProjectController extends BaseController {
return ResponseHelper.buildResponse(projectServiceImpl.getProjectLocation()); return ResponseHelper.buildResponse(projectServiceImpl.getProjectLocation());
} }
/**
* 资料详情
* @param sequenceNbr
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "资料详情", notes = "资料详情")
@GetMapping(value = "/getInformationDetail")
public ResponseModel<Object> getInformationDetail(@RequestParam("sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(projectServiceImpl.getInformationDetail(sequenceNbr));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "POST", value = "资料提交保存", notes = "资料提交保存")
@PostMapping(value = "/informationSaveOrUpdate")
public ResponseModel<Object> informationSaveOrUpdate(@RequestBody InformationDto dto){
projectServiceImpl.informationSaveOrUpdate(dto.getEquipmentList(),dto.getWelderList(),dto.getMaterialList(),dto.getFileList(),dto.getProjectId());
return ResponseHelper.buildResponse("ok");
}
/**
* 审核资料详情
* @param projectId
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "审核资料详情", notes = "审核资料详情")
@GetMapping(value = "/getAuditInformationDetail")
public ResponseModel<Object> getAuditInformationDetail(@RequestParam("projectId") Long projectId){
// 前端定制组件格式
Page<Map<String, Object>> mapPage = new Page<>();
List<Map<String, Object>> auditInformationDetail = projectServiceImpl.getAuditInformationDetail(projectId);
mapPage.setRecords(auditInformationDetail);
return ResponseHelper.buildResponse(mapPage);
}
} }
...@@ -23,6 +23,7 @@ import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify; ...@@ -23,6 +23,7 @@ import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
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.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
...@@ -92,6 +93,9 @@ public class MaterialServiceImpl extends BaseService<MaterialDto, Material, Mate ...@@ -92,6 +93,9 @@ public class MaterialServiceImpl extends BaseService<MaterialDto, Material, Mate
for (ProjectResource projectResource: list) { for (ProjectResource projectResource: list) {
materialIds.add(projectResource.getResourceId()); materialIds.add(projectResource.getResourceId());
} }
if (ObjectUtils.isEmpty(list)){
return new Page<>();
}
wrapper.in(Material::getSequenceNbr,materialIds); wrapper.in(Material::getSequenceNbr,materialIds);
} }
......
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ugp.biz.service.impl; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -30,6 +31,8 @@ import com.yeejoin.amos.feign.systemctl.model.RegionModel; ...@@ -30,6 +31,8 @@ import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
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.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
...@@ -333,8 +336,8 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project ...@@ -333,8 +336,8 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
JSONArray installSubForm = JSON.parseArray(XJConstant.INSTALL_SUB_FORM); JSONArray installSubForm = JSON.parseArray(XJConstant.INSTALL_SUB_FORM);
JSONArray designSubForm = JSON.parseArray(XJConstant.DESIGN_SUB_FORM); JSONArray designSubForm = JSON.parseArray(XJConstant.DESIGN_SUB_FORM);
if(!ValidationUtil.isEmpty(jsonObject)){ if(!ValidationUtil.isEmpty(jsonObject)){
installSubForm = jsonObject.getJSONArray("installSubForm"); installSubForm = jsonObject.getJSONArray("installSubForm");
designSubForm = jsonObject.getJSONArray("designSubForm"); designSubForm = jsonObject.getJSONArray("designSubForm");
} }
...@@ -645,4 +648,97 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project ...@@ -645,4 +648,97 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
} }
return projectDtoList; return projectDtoList;
} }
public Map<String, Object> getInformationDetail(Long sequenceNbr){
LambdaQueryWrapper<Attachment> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Attachment::getSourceId,sequenceNbr);
Attachment attachment = attachmentService.getOne(wrapper);
JSONObject jsonObject = null;
if(!ObjectUtils.isEmpty(attachment) && !ObjectUtils.isEmpty(attachment.getInfo())){
jsonObject = JSON.parseObject(attachment.getInfo());
return jsonObject;
}else {
HashMap<String, Object> map = new HashMap<>();
map.put("installSubForm",XJConstant.INSTALL_SUB_FORM_NEW);
map.put("designSubForm",XJConstant.DESIGN_SUB_FORM_NEW);
return map;
}
}
public List<Map<String, Object>> getAuditInformationDetail(Long sequenceNbr){
ArrayList<Map<String, Object>> result = new ArrayList<>();
LambdaQueryWrapper<Attachment> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Attachment::getSourceId,sequenceNbr);
Attachment attachment = attachmentService.getOne(wrapper);
if(!ObjectUtils.isEmpty(attachment) && !ObjectUtils.isEmpty(attachment.getInfo())){
Map<String, Object> map = JSON.parseObject(attachment.getInfo());
List<Map<String, Object>> installSubForm = (List<Map<String, Object>>)map.get("installSubForm");
data("subFormInstall", installSubForm, result, attachment.getRecDate());
List<Map<String, Object>> designSubForm = (List<Map<String, Object>>)map.get("designSubForm");
data("designSubForm", designSubForm, result, attachment.getRecDate());
}
return result;
}
private List<Map<String, Object>> data(String type , List<Map<String, Object>> data, List<Map<String, Object>> result, Date date){
data.forEach(item -> {
HashMap<String, Object> messageData = new HashMap<>();
messageData.put("name", item.get(type));
messageData.put("date", date);
List<Map<String, Object>> infoList = (List<Map<String, Object>>)item.get("info");
infoList.forEach(itemInfo ->{
messageData.put("fileName", itemInfo.get("name"));
messageData.put("fileUrl", itemInfo.get("url"));
messageData.put("status", "1");
result.add(messageData);
} );
});
return result;
}
@Transactional
public String informationSaveOrUpdate(List<Map<String, Object>> equipmentList,
List<Map<String, Object>> welderList,
List<Map<String, Object>> materialList,
List<Map<String, Object>> fileList,
Long projectId) {
ArrayList<ProjectResource> projectResources = new ArrayList<>();
// 焊机信息
equipmentList.forEach(item ->{
ProjectResource projectResource = new ProjectResource();
projectResource.setProjectId(projectId);
projectResource.setResourceId(Long.valueOf(String.valueOf(item.get("sequenceNbr"))));
projectResource.setType("equipment");
projectResource.setName(String.valueOf(item.get("name")));
projectResources.add(projectResource);
});
// 焊工信息
welderList.forEach(item ->{
ProjectResource projectResource = new ProjectResource();
projectResource.setProjectId(projectId);
projectResource.setResourceId(Long.valueOf(String.valueOf(item.get("sequenceNbr"))));
projectResource.setType("welder");
projectResource.setName(String.valueOf(item.get("name")));
projectResources.add(projectResource);
});
// 管材信息
materialList.forEach(item ->{
ProjectResource projectResource = new ProjectResource();
projectResource.setProjectId(projectId);
projectResource.setResourceId(Long.valueOf(String.valueOf(item.get("sequenceNbr"))));
projectResource.setType("material");
projectResource.setName(String.valueOf(item.get("name")));
projectResources.add(projectResource);
});
projectResourceService.saveOrUpdateBatch(projectResources);
// 文件信息
Attachment attachment = new Attachment();
attachment.setSourceId(projectId);
// attachment.setInfo(fileList.toJSONString());
attachment.setType("project");
attachmentService.save(attachment);
return "ok";
}
} }
\ No newline at end of file
...@@ -236,6 +236,7 @@ public class WelderServiceImpl { ...@@ -236,6 +236,7 @@ public class WelderServiceImpl {
mapPage.setPages(page.getPages()); mapPage.setPages(page.getPages());
usrList.forEach(item -> { usrList.forEach(item -> {
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("status", "1");
map.put("sequenceNbr", item.getSequenceNbr()); map.put("sequenceNbr", item.getSequenceNbr());
List<Map<String, Object>> message = alertFormValueServiceImpl.getMessageMapByInstanceId(String.valueOf(item.getSequenceNbr())); List<Map<String, Object>> message = alertFormValueServiceImpl.getMessageMapByInstanceId(String.valueOf(item.getSequenceNbr()));
message.forEach(dataItem -> { message.forEach(dataItem -> {
......
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