Commit a9a15a0c authored by zhangyingbin's avatar zhangyingbin

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents 59fe1185 7408439b
...@@ -124,10 +124,10 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -124,10 +124,10 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<OrgUsr> selectPersonListByCompanyIdList(@Param("companyIdList") List<String> companyIdList); List<OrgUsr> selectPersonListByCompanyIdList(@Param("companyIdList") List<String> companyIdList);
Page<OrgUsr> getWelderByProjectId(@Param("page") Page<OrgUsr> page, @Param("projectId") String projectId, @Param("companyId") Long companyId, @Param("name") String name); Page<Map<String, Object>> getWelderByProjectId(@Param("page") Page<Map<String, Object>> page, @Param("projectId") String projectId, @Param("companyId") Long companyId, @Param("name") String name, @Param("type") String type);
Page<OrgUsr> getAllListByProjectId(@Param("page") Page<OrgUsr> page, @Param("projectId") String projectId, @Param("companyId") Long companyId, @Param("name") String name); Page<Map<String, Object>> getAllListByProjectId(@Param("page") Page<Map<String, Object>> page, @Param("projectId") String projectId, @Param("companyId") Long companyId, @Param("name") String name);
List<OrgUsr> getWelderListByProjectId( @Param("projectId") String projectId, @Param("companyId") Long companyId, @Param("name") String name); List<Map<String, Object>> getWelderListByProjectId( @Param("projectId") String projectId, @Param("companyId") Long companyId, @Param("name") String name);
} }
...@@ -881,14 +881,16 @@ LEFT JOIN ( ...@@ -881,14 +881,16 @@ LEFT JOIN (
#{companyId} #{companyId}
</foreach>); </foreach>);
</select> </select>
<select id="getWelderByProjectId" resultType="com.yeejoin.amos.boot.module.common.api.entity.OrgUsr"> <select id="getWelderByProjectId" resultType="java.util.Map">
SELECT SELECT
cou.* cou.sequence_nbr as sequenceNbr,ifNUll(upr.status, 0) as suatus
FROM FROM
cb_org_usr cou cb_org_usr cou
LEFT JOIN tz_ugp_project_resource upr ON cou.sequence_nbr = upr.resource_id LEFT JOIN tz_ugp_project_resource upr ON cou.sequence_nbr = upr.resource_id
<where> <where>
upr.type = 'welder' AND upr.project_id = #{projectId} <if test="type != null and type != ''">
and upr.type = 'welder' AND upr.project_id = #{projectId}
</if>
AND cou.parent_id = #{companyId} AND cou.parent_id = #{companyId}
<if test="name != null and name != ''"> <if test="name != null and name != ''">
and cou.biz_org_name like concat('%', #{name}, '%') and cou.biz_org_name like concat('%', #{name}, '%')
...@@ -897,9 +899,9 @@ LEFT JOIN ( ...@@ -897,9 +899,9 @@ LEFT JOIN (
</select> </select>
<select id="getAllListByProjectId" resultType="com.yeejoin.amos.boot.module.common.api.entity.OrgUsr"> <select id="getAllListByProjectId" resultType="java.util.Map">
SELECT SELECT
cou.* cou.sequence_nbr as sequenceNbr,ifNUll(upr.status, 0) as suatus
FROM FROM
cb_org_usr cou cb_org_usr cou
LEFT JOIN tz_ugp_project_resource upr ON cou.sequence_nbr = upr.resource_id LEFT JOIN tz_ugp_project_resource upr ON cou.sequence_nbr = upr.resource_id
...@@ -912,9 +914,9 @@ LEFT JOIN ( ...@@ -912,9 +914,9 @@ LEFT JOIN (
</where> </where>
</select> </select>
<select id="getWelderListByProjectId" resultType="com.yeejoin.amos.boot.module.common.api.entity.OrgUsr"> <select id="getWelderListByProjectId" resultType="java.util.Map">
SELECT SELECT
cou.* cou.sequence_nbr as sequenceNbr,ifNUll(upr.status, 0) as suatus
FROM FROM
cb_org_usr cou cb_org_usr cou
LEFT JOIN tz_ugp_project_resource upr ON cou.sequence_nbr = upr.resource_id LEFT JOIN tz_ugp_project_resource upr ON cou.sequence_nbr = upr.resource_id
......
...@@ -2478,15 +2478,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -2478,15 +2478,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return this.baseMapper.selectList(wrapper).stream().collect(Collectors.toList()); return this.baseMapper.selectList(wrapper).stream().collect(Collectors.toList());
} }
public Page<OrgUsr> getWelderByProjectId(Page<OrgUsr> page, String projectId, Long companyId, String name) { public Page<Map<String, Object>> getWelderByProjectId(Page<Map<String, Object>> page, String projectId, Long companyId, String name, String type) {
return this.baseMapper.getWelderByProjectId(page, projectId, companyId, name); return this.baseMapper.getWelderByProjectId(page, projectId, companyId, name, type);
} }
public Page<OrgUsr> getAllListByProjectId(Page<OrgUsr> page, String projectId, Long companyId, String name) { public Page<Map<String, Object>> getAllListByProjectId(Page<Map<String, Object>> page, String projectId, Long companyId, String name) {
return this.baseMapper.getAllListByProjectId(page, projectId, companyId, name); return this.baseMapper.getAllListByProjectId(page, projectId, companyId, name);
} }
public List<OrgUsr> getWelderListByProjectId(String projectId, Long companyId, String name) { public List<Map<String, Object>> getWelderListByProjectId(String projectId, Long companyId, String name) {
return this.baseMapper.getWelderListByProjectId(projectId, companyId, name); return this.baseMapper.getWelderListByProjectId(projectId, companyId, name);
} }
......
spring.application.name=TZS-Cpp spring.application.name=TZS
server.servlet.context-path=/tzs server.servlet.context-path=/tzs
server.port=11002 server.port=11000
spring.profiles.active=dev3 spring.profiles.active=dev3
spring.jackson.time-zone=GMT+8 spring.jackson.time-zone=GMT+8
...@@ -51,6 +51,8 @@ supervision.feign.name = AMOS-SUPERVISION-API ...@@ -51,6 +51,8 @@ supervision.feign.name = AMOS-SUPERVISION-API
security.systemctl.name=AMOS-API-SYSTEMCTL security.systemctl.name=AMOS-API-SYSTEMCTL
privilege.fegin.name=AMOS-API-PRIVILEGE
jcs.company.topic.add=jcs/company/topic/add jcs.company.topic.add=jcs/company/topic/add
jcs.company.topic.delete=jcs/company/topic/delete jcs.company.topic.delete=jcs/company/topic/delete
## �豸�������񣨳����š��㲥�����壩 ## �豸�������񣨳����š��㲥�����壩
......
package com.yeejoin.amos.boot.module.ugp.api.dto; package com.yeejoin.amos.boot.module.ugp.api.dto;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.Data; import lombok.Data;
...@@ -8,11 +9,12 @@ import java.util.Map; ...@@ -8,11 +9,12 @@ import java.util.Map;
@Data @Data
public class InformationDto { public class InformationDto {
private List<Map<String, Object>>equipmentList; private List<Map<String, Object>> equipmentList;
private List<Map<String, Object>>welderList; private List<Map<String, Object>> welderList;
private List<Map<String, Object>>materialList; private List<Map<String, Object>> materialList;
private List<Map<String, Object>> fileList; private List<Map<String, Object>> fileList;
private JSONObject fileJson; private JSONArray subFormInstall;
private JSONArray subFormAttachment;
private Long projectId; private Long projectId;
private String type; private String type;
......
...@@ -24,10 +24,8 @@ public interface EquipmentMapper extends BaseMapper<Equipment> { ...@@ -24,10 +24,8 @@ public interface EquipmentMapper extends BaseMapper<Equipment> {
List<Map<String, Long>> informationStatistics(@Param("companyIds") Set<String> companyIds); List<Map<String, Long>> informationStatistics(@Param("companyIds") Set<String> companyIds);
Page<EquipmentDto> boundWelder(@Param("page" )IPage<EquipmentDto> page, @Param("projectId") String projectId, @Param("companyId") Long companyId, @Param("name") String name); Page<Map<String, Object>> boundWelder(@Param("page" )IPage<Map<String, Object>> page, @Param("projectId") String projectId, @Param("companyId") Long companyId, @Param("name") String name ,@Param("type")String type);
Page<EquipmentDto> allBoundWelder(@Param("page" )IPage<EquipmentDto> page, @Param("projectId") String projectId, @Param("companyId") Long companyId, @Param("name") String name); List<Map<String, Object>> boundWelderList(@Param("projectId") String projectId, @Param("companyId") Long companyId, @Param("name") String name);
List<EquipmentDto> boundWelderList(@Param("projectId") String projectId, @Param("companyId") Long companyId, @Param("name") String name);
} }
...@@ -37,40 +37,27 @@ ...@@ -37,40 +37,27 @@
</where> </where>
GROUP BY type GROUP BY type
</select> </select>
<select id="boundWelder" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto"> <select id="boundWelder" resultType="java.util.Map">
SELECT SELECT
ue.* ue.*, ifnull(upr.status, 1) as status
FROM FROM
tz_ugp_equipment ue tz_ugp_equipment ue
LEFT JOIN tz_ugp_project_resource upr ON ue.sequence_nbr = upr.resource_id LEFT JOIN tz_ugp_project_resource upr ON ue.sequence_nbr = upr.resource_id
<where> <where>
upr.type = 'equipment' AND upr.project_id = #{projectId} ue.company_id = #{companyId}
AND ue.company_id = #{companyId} <if test="type != null and type != ''">
<if test="name != null and name != ''"> and upr.type = 'equipment' AND upr.project_id = #{projectId}
and ue.name like concat('%', #{name}, '%')
</if> </if>
</where>
</select>
<select id="allBoundWelder" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto">
SELECT
ue.*
FROM
tz_ugp_equipment ue
LEFT JOIN tz_ugp_project_resource upr ON ue.sequence_nbr = upr.resource_id
<where>
( (upr.project_id = #{projectId} and upr.type = 'equipment' ) or upr.resource_id is null)
AND ue.company_id = #{companyId}
<if test="name != null and name != ''"> <if test="name != null and name != ''">
and ue.name like concat('%', #{name}, '%') and ue.name like concat('%', #{name}, '%')
</if> </if>
</where> </where>
</select> </select>
<select id="boundWelderList" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto">
<select id="boundWelderList" resultType="java.util.Map">
SELECT SELECT
ue.* ue.*, ifnull(upr.status, 1) as status
FROM FROM
tz_ugp_equipment ue tz_ugp_equipment ue
LEFT JOIN tz_ugp_project_resource upr ON ue.sequence_nbr = upr.resource_id LEFT JOIN tz_ugp_project_resource upr ON ue.sequence_nbr = upr.resource_id
......
...@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; ...@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FailureDetailsServiceImpl;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProblemCodeLibDto; import com.yeejoin.amos.boot.module.ugp.api.dto.ProblemCodeLibDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.ProblemCodeLib; import com.yeejoin.amos.boot.module.ugp.api.entity.ProblemCodeLib;
import com.yeejoin.amos.boot.module.ugp.api.service.IProblemCodeLibService; import com.yeejoin.amos.boot.module.ugp.api.service.IProblemCodeLibService;
...@@ -16,18 +18,26 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; ...@@ -16,18 +18,26 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.ApplicationModel; import com.yeejoin.amos.feign.privilege.model.ApplicationModel;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel; import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import feign.Response;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -48,6 +58,13 @@ public class ProblemCodeLibController extends BaseController { ...@@ -48,6 +58,13 @@ public class ProblemCodeLibController extends BaseController {
@Resource @Resource
private IProblemCodeLibService problemCodeLibService; private IProblemCodeLibService problemCodeLibService;
@Autowired
FailureDetailsServiceImpl failureDetailsServiceImpl;
@Autowired
WorkflowFeignService workflowFeignService;
/** /**
* 新增质量监检信息表 * 新增质量监检信息表
*/ */
...@@ -172,4 +189,23 @@ public class ProblemCodeLibController extends BaseController { ...@@ -172,4 +189,23 @@ public class ProblemCodeLibController extends BaseController {
List<DictionarieValueModel> result = adminCommonlyUsed.getResult(); List<DictionarieValueModel> result = adminCommonlyUsed.getResult();
return ResponseHelper.buildResponse(result); return ResponseHelper.buildResponse(result);
} }
/**
* 参考JCS服务流程图信息
* @param instanceId 流程实例ID
* @return 流程图
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getInstanceImage")
@ApiOperation(httpMethod = "GET", value = "流程图高亮图片", notes = "流程图高亮图片")
public ResponseEntity<String> downloadFile(@RequestParam String instanceId, HttpServletRequest request, HttpServletResponse response) {
Response feignResponse = workflowFeignService.thighLineImg(instanceId);
try {
Response.Body body = feignResponse.body();
return new ResponseEntity<>(IOUtils.toString(body.asInputStream()), HttpStatus.OK);
} catch (Exception e) {
throw new BaseException("Error exporting diagram", "500", instanceId);
}
}
} }
...@@ -453,16 +453,61 @@ public class ProjectController extends BaseController { ...@@ -453,16 +453,61 @@ public class ProjectController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "POST", value = "资料提交/保存", notes = "资料提交/保存") @ApiOperation(httpMethod = "POST", value = "资料提交/保存", notes = "资料提交/保存")
@PostMapping(value = "/informationSaveOrUpdate") @PostMapping(value = "/informationSaveOrUpdate")
public ResponseModel<Object> informationSaveOrUpdate(@RequestBody InformationDto dto){ public ResponseModel<Object> informationSaveOrUpdate(@RequestBody JSONObject object) {
projectServiceImpl.informationSaveOrUpdate(dto.getEquipmentList(),dto.getWelderList(),dto.getMaterialList(),dto.getFileJson(),dto.getProjectId(), dto.getType()); InformationDto dto = new InformationDto();
dto.setProjectId(Long.valueOf(String.valueOf(object.get("projectId"))));
Map<String, Object> map = JSON.parseObject(object.toString());
List<Map<String, Object>> welderList = (List<Map<String, Object>>) map.get("welderList");
if (!ObjectUtils.isEmpty(welderList)) {
dto.setWelderList(welderList);
}
List<Map<String, Object>> materialList = (List<Map<String, Object>>) map.get("materialList");
if (!ObjectUtils.isEmpty(materialList)) {
dto.setMaterialList(materialList);
}
List<Map<String, Object>> equipmentList = (List<Map<String, Object>>) map.get("equipmentList");
if (!ObjectUtils.isEmpty(equipmentList)) {
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());
return ResponseHelper.buildResponse("ok"); return ResponseHelper.buildResponse("ok");
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "POST", value = "资料保存、审核", notes = "资料保存、审核") @ApiOperation(httpMethod = "POST", value = "资料保存、审核", notes = "资料保存、审核")
@PostMapping(value = "/informationAudit") @PostMapping(value = "/informationAudit")
public ResponseModel<Object> informationAudit(@RequestBody InformationDto dto){ public ResponseModel<Object> informationAudit(@RequestBody JSONObject object) {
projectServiceImpl.informationAudit(dto.getEquipmentList(),dto.getWelderList(),dto.getMaterialList(),dto.getFileList(),dto.getProjectId(), dto.getType()); InformationDto dto = new InformationDto();
dto.setProjectId(Long.valueOf(String.valueOf(object.get("projectId"))));
Map<String, Object> map = JSON.parseObject(object.toString());
List<Map<String, Object>> welderList = (List<Map<String, Object>>) map.get("welderList");
if (!ObjectUtils.isEmpty(welderList)) {
dto.setWelderList(welderList);
}
List<Map<String, Object>> materialList = (List<Map<String, Object>>) map.get("materialList");
if (!ObjectUtils.isEmpty(materialList)) {
dto.setMaterialList(materialList);
}
List<Map<String, Object>> equipmentList = (List<Map<String, Object>>) map.get("equipmentList");
if (!ObjectUtils.isEmpty(equipmentList)) {
dto.setEquipmentList(equipmentList);
}
List<Map<String, Object>> fileList = (List<Map<String, Object>>) map.get("fileList");
if (!ObjectUtils.isEmpty(fileList)) {
dto.setFileList(fileList);
}
projectServiceImpl.informationAudit(dto.getEquipmentList(), dto.getWelderList(), dto.getMaterialList(), dto.getFileList(), dto.getProjectId(), dto.getType());
return ResponseHelper.buildResponse("ok"); return ResponseHelper.buildResponse("ok");
} }
......
...@@ -289,26 +289,26 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E ...@@ -289,26 +289,26 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
@BusinessIdentify @BusinessIdentify
public Page<EquipmentDto> boundWelder(String projectId, Integer current, Integer size, String name, String type) { public Page<Map<String, Object>> boundWelder(String projectId, Integer current, Integer size, String name, String type) {
ReginParams reginParams = orgService.getReginParams(); ReginParams reginParams = orgService.getReginParams();
Long companySequenceNbr = reginParams.getBusinessInfo().getCompanySequenceNbr(); Long companySequenceNbr = reginParams.getBusinessInfo().getCompanySequenceNbr();
if (!ObjectUtils.isEmpty(current) || !ObjectUtils.isEmpty(size)) { if (!ObjectUtils.isEmpty(current) || !ObjectUtils.isEmpty(size)) {
Page<EquipmentDto> result; Page<Map<String, Object>> result;
Page<EquipmentDto> page = new Page<>(current, size); Page<Map<String, Object>> page = new Page<>(current, size);
if (!ObjectUtils.isEmpty(type) && "all".equals(type)) { if (!ObjectUtils.isEmpty(type) && "all".equals(type)) {
result = equipmentMapper.allBoundWelder(page, projectId, companySequenceNbr, name); result = equipmentMapper.boundWelder(page, projectId, companySequenceNbr, name, null);
} else { } else {
result = equipmentMapper.boundWelder(page, projectId, companySequenceNbr, name); result = equipmentMapper.boundWelder(page, projectId, companySequenceNbr, name, "bound");
} }
result.getRecords().forEach(item -> { result.getRecords().forEach(item -> {
List<JSONObject> files = attachmentServiceImpl.getFilesBySourceId(item.getSequenceNbr()); List<JSONObject> files = attachmentServiceImpl.getFilesBySourceId(Long.valueOf(String.valueOf(item.get("sequence_nbr"))));
item.setFiles(files); item.put("files", files);
}); });
return result; return result;
} else { } else {
// 不分页时返回全部、定制组件格式统一 // 不分页时返回全部、定制组件格式统一
Page<EquipmentDto> listPage = new Page<>(); Page<Map<String, Object>> listPage = new Page<>();
List<EquipmentDto> equipmentDtos = equipmentMapper.boundWelderList(projectId, companySequenceNbr, name); List<Map<String, Object>> equipmentDtos = equipmentMapper.boundWelderList(projectId, companySequenceNbr, name);
listPage.setRecords(equipmentDtos); listPage.setRecords(equipmentDtos);
return listPage; return listPage;
} }
......
...@@ -513,6 +513,7 @@ public class ProblemInitiationServiceImpl { ...@@ -513,6 +513,7 @@ public class ProblemInitiationServiceImpl {
AjaxResult ajaxResult = Workflow.taskClient.completeByTask(taskId, dto1); AjaxResult ajaxResult = Workflow.taskClient.completeByTask(taskId, dto1);
dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data"))); dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data")));
} }
Workflow.activitiHistoryClient
// 更新问题状态 // 更新问题状态
if (!ObjectUtils.isEmpty(dataObject) && !ObjectUtils.isEmpty(dataObject.get("name"))){ if (!ObjectUtils.isEmpty(dataObject) && !ObjectUtils.isEmpty(dataObject.get("name"))){
if (ManualProcessingEnum.问题录入.getName().equals(dataObject.get("name")) || ManualProcessingEnum.问题自动录入.getName().equals(dataObject.get("name"))){ if (ManualProcessingEnum.问题录入.getName().equals(dataObject.get("name")) || ManualProcessingEnum.问题自动录入.getName().equals(dataObject.get("name"))){
......
...@@ -772,6 +772,7 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project ...@@ -772,6 +772,7 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
ArrayList<ProjectResource> projectResources = new ArrayList<>(); ArrayList<ProjectResource> projectResources = new ArrayList<>();
// 焊机信息 // 焊机信息
if (!ObjectUtils.isEmpty(equipmentList)) {
equipmentList.forEach(item -> { equipmentList.forEach(item -> {
ProjectResource projectResource = new ProjectResource(); ProjectResource projectResource = new ProjectResource();
projectResource.setProjectId(projectId); projectResource.setProjectId(projectId);
...@@ -781,7 +782,9 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project ...@@ -781,7 +782,9 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
projectResource.setStatus(ObjectUtils.isEmpty(item.get(status)) ? "0" : String.valueOf(item.get(status))); projectResource.setStatus(ObjectUtils.isEmpty(item.get(status)) ? "0" : String.valueOf(item.get(status)));
projectResources.add(projectResource); projectResources.add(projectResource);
}); });
}
// 焊工信息 // 焊工信息
if (!ObjectUtils.isEmpty(welderList)) {
welderList.forEach(item -> { welderList.forEach(item -> {
ProjectResource projectResource = new ProjectResource(); ProjectResource projectResource = new ProjectResource();
projectResource.setProjectId(projectId); projectResource.setProjectId(projectId);
...@@ -791,7 +794,9 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project ...@@ -791,7 +794,9 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
projectResource.setStatus(ObjectUtils.isEmpty(item.get(status)) ? "0" : String.valueOf(item.get(status))); projectResource.setStatus(ObjectUtils.isEmpty(item.get(status)) ? "0" : String.valueOf(item.get(status)));
projectResources.add(projectResource); projectResources.add(projectResource);
}); });
}
// 管材信息 // 管材信息
if (!ObjectUtils.isEmpty(materialList)) {
materialList.forEach(item -> { materialList.forEach(item -> {
ProjectResource projectResource = new ProjectResource(); ProjectResource projectResource = new ProjectResource();
projectResource.setProjectId(projectId); projectResource.setProjectId(projectId);
...@@ -801,6 +806,7 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project ...@@ -801,6 +806,7 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
projectResource.setStatus(ObjectUtils.isEmpty(item.get(status)) ? "0" : String.valueOf(item.get(status))); projectResource.setStatus(ObjectUtils.isEmpty(item.get(status)) ? "0" : String.valueOf(item.get(status)));
projectResources.add(projectResource); projectResources.add(projectResource);
}); });
}
LambdaQueryWrapper<ProjectResource> lambda = new QueryWrapper<ProjectResource>().lambda(); LambdaQueryWrapper<ProjectResource> lambda = new QueryWrapper<ProjectResource>().lambda();
lambda.eq(ProjectResource::getProjectId, projectId); lambda.eq(ProjectResource::getProjectId, projectId);
projectResourceMapper.delete(lambda); projectResourceMapper.delete(lambda);
......
...@@ -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.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
...@@ -220,33 +221,36 @@ public class WelderServiceImpl { ...@@ -220,33 +221,36 @@ public class WelderServiceImpl {
public Page<Map<String, Object>> getWelderByProjectId(String projectId, Integer current, Integer size, String name, String type) { public Page<Map<String, Object>> getWelderByProjectId(String projectId, Integer current, Integer size, String name, String type) {
String columnKey = "column"; String columnKey = "column";
String valueKey = "value"; String valueKey = "value";
String sequenceNbrKey = "sequenceNbr";
String statusKey = "status";
Page<Map<String, Object>> mapPage = new Page<>(); Page<Map<String, Object>> mapPage = new Page<>();
ArrayList<Map<String, Object>> maps = new ArrayList<>(); ArrayList<Map<String, Object>> maps = new ArrayList<>();
ReginParams reginParams = orgService.getReginParams(); ReginParams reginParams = orgService.getReginParams();
Long companySequenceNbr = reginParams.getBusinessInfo().getCompanySequenceNbr(); Long companySequenceNbr = reginParams.getBusinessInfo().getCompanySequenceNbr();
List<OrgUsr> usrList; List<Map<String, Object>> mapList;
// 分页参数为空时返回全部 // 分页参数为空时返回全部
if (!ObjectUtils.isEmpty(current) || !ObjectUtils.isEmpty(size)) { if (!ObjectUtils.isEmpty(current) || !ObjectUtils.isEmpty(size)) {
Page<OrgUsr> page = new Page<>(current, size); Page<Map<String, Object>> page = new Page<>(current, size);
if (!ObjectUtils.isEmpty(type) && "all".equals(type)) { if (!ObjectUtils.isEmpty(type) && "all".equals(type)) {
page = orgUsrService.getAllListByProjectId(page, projectId, companySequenceNbr, name); page = orgUsrService.getWelderByProjectId(page, projectId, companySequenceNbr, name, null);
} else { } else {
page = orgUsrService.getWelderByProjectId(page, projectId, companySequenceNbr, name); page = orgUsrService.getWelderByProjectId(page, projectId, companySequenceNbr, name, "bound");
} }
mapPage.setTotal(page.getTotal()); mapPage.setTotal(page.getTotal());
mapPage.setSize(page.getSize()); mapPage.setSize(page.getSize());
mapPage.setPages(page.getPages()); mapPage.setPages(page.getPages());
usrList = page.getRecords(); mapList = page.getRecords();
} else { } else {
usrList = orgUsrService.getWelderListByProjectId(projectId, companySequenceNbr, name); mapList = orgUsrService.getWelderListByProjectId(projectId, companySequenceNbr, name);
} }
usrList.forEach(item -> { mapList.forEach(item -> {
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("status", "1"); map.put(statusKey, item.getOrDefault(statusKey, 1));
map.put("sequenceNbr", item.getSequenceNbr()); if (!ObjectUtils.isEmpty(item.get(sequenceNbrKey))) {
List<Map<String, Object>> message = alertFormValueServiceImpl.getMessageMapByInstanceId(String.valueOf(item.getSequenceNbr())); map.put(sequenceNbrKey, item.get(sequenceNbrKey));
List<Map<String, Object>> message = alertFormValueServiceImpl.getMessageMapByInstanceId(String.valueOf(item.get(sequenceNbrKey)));
message.forEach(dataItem -> { message.forEach(dataItem -> {
if (String.valueOf(dataItem.get(columnKey)).equals("image") && !ObjectUtils.isEmpty(dataItem.get(columnKey)) && !ObjectUtils.isEmpty(dataItem.get(valueKey))) { if (String.valueOf(dataItem.get(columnKey)).equals("image") && !ObjectUtils.isEmpty(dataItem.get(columnKey)) && !ObjectUtils.isEmpty(dataItem.get(valueKey))) {
String value1 = String.valueOf(dataItem.get(valueKey)); String value1 = String.valueOf(dataItem.get(valueKey));
...@@ -258,7 +262,9 @@ public class WelderServiceImpl { ...@@ -258,7 +262,9 @@ public class WelderServiceImpl {
map.put(String.valueOf(dataItem.get(columnKey)), dataItem.get(valueKey)); map.put(String.valueOf(dataItem.get(columnKey)), dataItem.get(valueKey));
}); });
maps.add(map); maps.add(map);
}
}); });
mapPage.setRecords(maps); mapPage.setRecords(maps);
return mapPage; return mapPage;
} }
......
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