Commit c54856ab authored by zhangyingbin's avatar zhangyingbin

修改测试问题

parent 8d4b5244
package com.yeejoin.amos.boot.module.ugp.api.mapper; package com.yeejoin.amos.boot.module.ugp.api.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto; import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto; import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment; import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment;
...@@ -26,5 +27,5 @@ public interface ProjectMapper extends BaseMapper<Project> { ...@@ -26,5 +27,5 @@ public interface ProjectMapper extends BaseMapper<Project> {
ProjectDto getDetail(Long sequenceNbr); ProjectDto getDetail(Long sequenceNbr);
//项目模糊筛选 //项目模糊筛选
IPage<ProjectDto> queryProjectPage(IPage<ProjectDto> page, Project project); Page<ProjectDto> queryProjectPage(IPage<ProjectDto> page, Project project);
} }
...@@ -16,5 +16,5 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.Project; ...@@ -16,5 +16,5 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
*/ */
public interface IProjectService { public interface IProjectService {
IPage<ProjectDto> queryProjectPage(IPage<ProjectDto> page, Project project); Page<ProjectDto> queryProjectPage(Page<ProjectDto> page, Project project);
} }
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
WHERE p.sequence_nbr = #{sequenceNbr} WHERE p.sequence_nbr = #{sequenceNbr}
</select> </select>
<select id="queryProjectPage" resultType="com.yeejoin.amos.boot.module.ugp.api.entity.Project"> <select id="queryProjectPage" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto">
select * from tz_ugp_project select * from tz_ugp_project
<where> <where>
<if test="project.name != '' and project.name != null"> <if test="project.name != '' and project.name != null">
......
...@@ -289,8 +289,8 @@ public class InstallNoticeController extends BaseController { ...@@ -289,8 +289,8 @@ public class InstallNoticeController extends BaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/acceptNotification") @GetMapping(value = "/acceptNotification")
@ApiOperation(httpMethod = "get", value = "监察部门接受安装告知", notes = "监察部门接受安装告知") @ApiOperation(httpMethod = "GET", value = "监察部门接受安装告知", notes = "监察部门接受安装告知")
public ResponseModel<Boolean> acceptNotification(Long sequenceNbr){ public ResponseModel<Boolean> acceptNotification(Long sequenceNbr){
InstallNotice installNotice = installNoticeServiceImpl.getById(sequenceNbr); InstallNotice installNotice = installNoticeServiceImpl.getById(sequenceNbr);
installNotice.setNoticeStatus(NoticeStatusEnum.已接收.getName()); installNotice.setNoticeStatus(NoticeStatusEnum.已接收.getName());
...@@ -305,13 +305,15 @@ public class InstallNoticeController extends BaseController { ...@@ -305,13 +305,15 @@ public class InstallNoticeController extends BaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/inspectNotification") @GetMapping(value = "/inspectNotification")
@ApiOperation(httpMethod = "get", value = "监检部门审查(通过/退回)安装告知", notes = "监检部门审查(通过/退回)安装告知") @ApiOperation(httpMethod = "GET", value = "监检部门审查(通过/退回)安装告知", notes = "监检部门审查(通过/退回)安装告知")
public ResponseModel<Boolean> inspectNotification(Long sequenceNbr,String option){ public ResponseModel<Boolean> inspectNotification(Long sequenceNbr,String option){
InstallNotice installNotice = installNoticeServiceImpl.getById(sequenceNbr); InstallNotice installNotice = installNoticeServiceImpl.getById(sequenceNbr);
installNotice.setApproved(true); installNotice.setApproved(true);
installNotice.setNoticeStatus(NoticeStatusEnum.已通过.getName());
if(NoticeStatusEnum.已退回.equals(option)){ if(NoticeStatusEnum.已退回.equals(option)){
installNotice.setApproved(false); installNotice.setApproved(false);
installNotice.setNoticeStatus(NoticeStatusEnum.已退回.getName());
} }
Project project = projectServiceImpl.getById(installNotice.getProjectId()); Project project = projectServiceImpl.getById(installNotice.getProjectId());
projectInitiationServiceImpl.execute(project.getInstanceId(),installNotice,option); projectInitiationServiceImpl.execute(project.getInstanceId(),installNotice,option);
......
...@@ -3,8 +3,10 @@ package com.yeejoin.amos.boot.module.ugp.biz.controller; ...@@ -3,8 +3,10 @@ package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.ugp.api.mapper.AttachmentMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.AttachmentMapper;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.AttachmentServiceImpl; import com.yeejoin.amos.boot.module.ugp.biz.service.impl.AttachmentServiceImpl;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.EquipmentServiceImpl; import com.yeejoin.amos.boot.module.ugp.biz.service.impl.EquipmentServiceImpl;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.OrgServiceImpl;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -39,6 +41,8 @@ public class MaterialController extends BaseController { ...@@ -39,6 +41,8 @@ public class MaterialController extends BaseController {
AttachmentServiceImpl attachmentServiceImpl; AttachmentServiceImpl attachmentServiceImpl;
@Autowired @Autowired
AttachmentMapper attachmentMapper; AttachmentMapper attachmentMapper;
@Autowired
OrgServiceImpl orgService;
/** /**
...@@ -104,6 +108,7 @@ public class MaterialController extends BaseController { ...@@ -104,6 +108,7 @@ public class MaterialController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/page") @GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "材料信息表分页查询", notes = "材料信息表分页查询") @ApiOperation(httpMethod = "GET",value = "材料信息表分页查询", notes = "材料信息表分页查询")
@BusinessIdentify
public ResponseModel<Page<MaterialDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam public ResponseModel<Page<MaterialDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size, (value = "size") int size,
@RequestParam(value = "name",required = false) String name, @RequestParam(value = "name",required = false) String name,
...@@ -111,7 +116,8 @@ public class MaterialController extends BaseController { ...@@ -111,7 +116,8 @@ public class MaterialController extends BaseController {
Page<MaterialDto> page = new Page<MaterialDto>(); Page<MaterialDto> page = new Page<MaterialDto>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(materialServiceImpl.queryForMaterialPage(page,name,code)); Long companyId = orgService.getReginParams().getBusinessInfo().getCompanySequenceNbr();
return ResponseHelper.buildResponse(materialServiceImpl.queryForMaterialPage(page,name,code,companyId));
} }
/** /**
......
...@@ -27,10 +27,7 @@ import io.swagger.annotations.Api; ...@@ -27,10 +27,7 @@ import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
...@@ -76,17 +73,16 @@ public class ProjectController extends BaseController { ...@@ -76,17 +73,16 @@ public class ProjectController extends BaseController {
@ApiOperation(httpMethod = "POST", value = "新增项目信息表", notes = "新增项目信息表") @ApiOperation(httpMethod = "POST", value = "新增项目信息表", notes = "新增项目信息表")
@BusinessIdentify @BusinessIdentify
public ResponseModel<ProjectDto> save(@RequestBody ProjectDto model) { public ResponseModel<ProjectDto> save(@RequestBody ProjectDto model) {
String regionName = ""; String regionName = "",regionCode = "";
String regionCode = ""; Map<String,String> map = getInfo(regionName,regionCode,Long.valueOf(model.getInstallRegionCode()));
getInfo(regionName,regionCode,Long.valueOf(model.getInstallRegionCode()));
model.setStartDate(new Date()); model.setStartDate(new Date());
model.setSubmitDate(new Date()); model.setSubmitDate(new Date());
model.setInstallationUnit(orgServiceImpl.getOrgUsrById(String.valueOf(model.getInstallationUnitId())).getBizOrgName()); model.setInstallationUnit(orgServiceImpl.getOrgUsrById(String.valueOf(model.getInstallationUnitId())).getBizOrgName());
model.setDesignUnit(orgServiceImpl.getOrgUsrById(String.valueOf(model.getDesignUnitId())).getBizOrgName()); model.setDesignUnit(orgServiceImpl.getOrgUsrById(String.valueOf(model.getDesignUnitId())).getBizOrgName());
model.setConstructionUnitId(Long.valueOf(orgServiceImpl.getOrgUsr().getBizOrgCode())); model.setConstructionUnitId(orgServiceImpl.getReginParams().getBusinessInfo().getCompanySequenceNbr());
model.setChargePerson(orgServiceImpl.getOrgUsrById(String.valueOf(model.getChargePersonId())).getBizOrgName()); model.setChargePerson(orgServiceImpl.getOrgUsrById(String.valueOf(model.getChargePersonId())).getBizOrgName());
model.setInstallRegion(regionName); model.setInstallRegion(map.get("regionName"));
model.setInstallRegionCode(regionName); model.setInstallRegionCode(map.get("regionCode"));
model = projectServiceImpl.createWithModel(model); model = projectServiceImpl.createWithModel(model);
Project project = new Project(); Project project = new Project();
BeanUtils.copyProperties(model, project); BeanUtils.copyProperties(model, project);
...@@ -94,7 +90,7 @@ public class ProjectController extends BaseController { ...@@ -94,7 +90,7 @@ public class ProjectController extends BaseController {
return ResponseHelper.buildResponse(model); return ResponseHelper.buildResponse(model);
} }
public void getInfo(String regionName,String regionCode,Long sequenceNbr){ public Map<String,String> getInfo(String regionName,String regionCode,Long sequenceNbr){
RegionModel region = Systemctl.regionClient.getRegion(sequenceNbr).getResult(); RegionModel region = Systemctl.regionClient.getRegion(sequenceNbr).getResult();
regionName = region.getRegionName() + regionName; regionName = region.getRegionName() + regionName;
if(ValidationUtil.isEmpty(regionCode)){ if(ValidationUtil.isEmpty(regionCode)){
...@@ -102,10 +98,14 @@ public class ProjectController extends BaseController { ...@@ -102,10 +98,14 @@ public class ProjectController extends BaseController {
} else { } else {
regionCode = region.getRegionCode() +"#" +regionCode; regionCode = region.getRegionCode() +"#" +regionCode;
} }
Map<String,String> map = new HashMap();
if(region.getParentId() != 0L){ if(region.getParentId() != 0L){
getInfo(regionName,regionCode,region.getParentId()); map = getInfo(regionName,regionCode,region.getParentId());
} else {
map.put("regionName",regionName);
} }
map.put("regionCode",regionCode);
return map;
} }
/** /**
...@@ -159,10 +159,10 @@ public class ProjectController extends BaseController { ...@@ -159,10 +159,10 @@ public class ProjectController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/page") @GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "项目信息表分页查询", notes = "项目信息表分页查询") @ApiOperation(httpMethod = "GET",value = "项目信息表分页查询", notes = "项目信息表分页查询")
public ResponseModel<IPage<ProjectDto>> queryForPage( public ResponseModel<Page<ProjectDto>> queryForPage(
@RequestParam(value = "current") int current, @RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, Project project) { @RequestParam(value = "size") int size, Project project) {
IPage<ProjectDto> page = new Page<>(); Page<ProjectDto> page = new Page<>();
page.setSize(size); page.setSize(size);
page.setCurrent(current); page.setCurrent(current);
return ResponseHelper.buildResponse(projectServiceImpl.queryProjectPage(page,project)); return ResponseHelper.buildResponse(projectServiceImpl.queryProjectPage(page,project));
......
...@@ -14,6 +14,7 @@ import com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper; ...@@ -14,6 +14,7 @@ import com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IEquipmentService; import com.yeejoin.amos.boot.module.ugp.api.service.IEquipmentService;
import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto; import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
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;
...@@ -39,6 +40,9 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E ...@@ -39,6 +40,9 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
@Autowired @Autowired
AttachmentServiceImpl attachmentServiceImpl; AttachmentServiceImpl attachmentServiceImpl;
@Autowired
OrgServiceImpl orgService;
/** /**
* 分页查询 * 分页查询
...@@ -119,6 +123,7 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E ...@@ -119,6 +123,7 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
@Override @Override
@BusinessIdentify
public EquipmentDto saveEI(JSONObject object) { public EquipmentDto saveEI(JSONObject object) {
EquipmentDto model = new EquipmentDto(); EquipmentDto model = new EquipmentDto();
model.setName(object.getString("name")); model.setName(object.getString("name"));
...@@ -130,6 +135,7 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E ...@@ -130,6 +135,7 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
model.setInspectionDate(object.getDate("inspectionDate")); model.setInspectionDate(object.getDate("inspectionDate"));
model.setUseStatus(object.getString("useStatus")); model.setUseStatus(object.getString("useStatus"));
model.setVerifyStatus(object.getString("verifyStatus")); model.setVerifyStatus(object.getString("verifyStatus"));
model.setCompanyId(orgService.getReginParams().getBusinessInfo().getCompanySequenceNbr());
EquipmentDto result = this.createWithModel(model); EquipmentDto result = this.createWithModel(model);
return result; return result;
......
...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -7,6 +7,7 @@ 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;
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.ProjectInitiationEnum;
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.EquipmentDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto; import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto;
...@@ -63,19 +64,22 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project ...@@ -63,19 +64,22 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
} }
private void getProjectState(ProjectDto project) { private void getProjectState(ProjectDto project) {
String state = "",insDep = "",insPerson = ""; String state = "待审核",insDep = "",insPerson = "";
LambdaQueryWrapper<ProjectInitiation> lambdaQueryWrap = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ProjectInitiation> lambdaQueryWrap = new LambdaQueryWrapper<>();
lambdaQueryWrap.eq(ProjectInitiation::getInstanceId,project.getInstanceId()) lambdaQueryWrap.eq(ProjectInitiation::getInstanceId,project.getInstanceId())
.eq(ProjectInitiation ::getTaskName, ProjectInitiationEnum.平台审核.getName())
.orderByDesc(ProjectInitiation::getSequenceNbr); .orderByDesc(ProjectInitiation::getSequenceNbr);
List<ProjectInitiation> projectInitiationList = projectInitiationService.list(lambdaQueryWrap); List<ProjectInitiation> projectInitiationList = projectInitiationService.list(lambdaQueryWrap);
if(!ValidationUtil.isEmpty(projectInitiationList)){ if(!ValidationUtil.isEmpty(projectInitiationList)){
ProjectInitiation projectInitiation = projectInitiationList.iterator().next(); ProjectInitiation projectInitiation = projectInitiationList.iterator().next();
JSONObject jsonObject = JSON.parseObject(projectInitiation.getContext()); JSONObject jsonObject = JSON.parseObject(projectInitiation.getContext());
if(!ValidationUtil.isEmpty(jsonObject)){
state = jsonObject.getString(XJConstant.PROCESS_PROJECT_STATE); state = jsonObject.getString(XJConstant.PROCESS_PROJECT_STATE);
insDep = jsonObject.getString(XJConstant.INS_DEP); insDep = jsonObject.getString(XJConstant.INS_DEP);
insPerson = jsonObject.getString(XJConstant.INS_PRESON); insPerson = jsonObject.getString(XJConstant.INS_PRESON);
} }
}
project.setExamineProjectState(state); project.setExamineProjectState(state);
project.setInsDep(insDep); project.setInsDep(insDep);
project.setInsPerson(insPerson); project.setInsPerson(insPerson);
...@@ -160,7 +164,7 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project ...@@ -160,7 +164,7 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
design=true; design=true;
} }
if (OrgEnum.安装单位.getKey().equals(type)){ if (OrgEnum.安装单位.getKey().equals(type)){
design=true; install=true;
} }
} }
...@@ -172,7 +176,13 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project ...@@ -172,7 +176,13 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
} }
//项目模糊筛选 //项目模糊筛选
public IPage<ProjectDto> queryProjectPage(IPage<ProjectDto> page, Project project) { @Override
return projectMapper.queryProjectPage(page,project); public Page<ProjectDto> queryProjectPage(Page<ProjectDto> page, Project project) {
Page<ProjectDto> projectDtoPage = projectMapper.queryProjectPage(page,project);
List<ProjectDto> projects = projectDtoPage.getRecords();
for(ProjectDto projectDto:projects){
getProjectState(projectDto);
}
return projectDtoPage;
} }
} }
\ No newline at end of file
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