Commit 3c60a3f0 authored by zhangsen's avatar zhangsen

资料审核相关业务修改

parent 16af784a
...@@ -4,47 +4,37 @@ import com.alibaba.fastjson.JSON; ...@@ -4,47 +4,37 @@ 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.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.ugp.api.Enum.NoticeStatusEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.NoticeStatusEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectInitiationEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectInitiationEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectResourceEnum;
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.*; import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.*; import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto;
import com.yeejoin.amos.boot.module.ugp.api.mapper.InstallNoticeMapper; import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto;
import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper; import com.yeejoin.amos.boot.module.ugp.api.entity.InstallNotice;
import com.yeejoin.amos.boot.module.ugp.api.service.IInstallNoticeService; import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.yeejoin.amos.boot.module.ugp.biz.fegin.TzsServiceFeignClient; import com.yeejoin.amos.boot.module.ugp.biz.fegin.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.*; import com.yeejoin.amos.boot.module.ugp.biz.service.impl.*;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController; import io.swagger.annotations.ApiOperation;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import java.text.ParseException; import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import java.util.*;
import java.util.stream.Collectors;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
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 org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*; import java.util.ArrayList;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import java.util.Date;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import java.util.List;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import java.util.Map;
import springfox.documentation.spring.web.json.Json;
/** /**
* 安装告知表 * 安装告知表
...@@ -382,8 +372,11 @@ public class InstallNoticeController extends BaseController { ...@@ -382,8 +372,11 @@ public class InstallNoticeController extends BaseController {
@PostMapping(value = "/saveOrUpdate") @PostMapping(value = "/saveOrUpdate")
@ApiOperation(value = "新增/修改安装告知表信息", notes = "新增/修改安装告知表信息") @ApiOperation(value = "新增/修改安装告知表信息", notes = "新增/修改安装告知表信息")
public ResponseModel<InstallNoticeDto> saveOrUpdate(@RequestBody JSONObject jsonObject) { public ResponseModel<InstallNoticeDto> saveOrUpdate(@RequestBody JSONObject jsonObject) {
InstallNoticeDto model = JSON.parseObject(JSON.toJSONString(jsonObject.get("installNoticeInfo")), InstallNoticeDto.class); InstallNoticeDto model = JSON.parseObject(JSON.toJSONString(jsonObject.get("noticeInfo")), InstallNoticeDto.class);
Project project = projectServiceImpl.getById(model.getProjectId()); Long projectId = Long.valueOf(String.valueOf(jsonObject.get("projectId")));
Project project = projectServiceImpl.getById(projectId);
model.setProjectId(projectId);
model.setNoticeStatus(String.valueOf(jsonObject.get("noticeStatus")));
LambdaQueryWrapper<InstallNotice> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<InstallNotice> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(InstallNotice::getProjectId, model.getProjectId()); lambdaQueryWrapper.eq(InstallNotice::getProjectId, model.getProjectId());
lambdaQueryWrapper.eq(InstallNotice::getIsDelete, Boolean.FALSE); lambdaQueryWrapper.eq(InstallNotice::getIsDelete, Boolean.FALSE);
...@@ -396,8 +389,8 @@ public class InstallNoticeController extends BaseController { ...@@ -396,8 +389,8 @@ public class InstallNoticeController extends BaseController {
installNotice.setNoticeDate(new Date()); installNotice.setNoticeDate(new Date());
installNotice.setOrganizationCode(orgServiceImpl.getOrgUsr().getBizOrgCode()); installNotice.setOrganizationCode(orgServiceImpl.getOrgUsr().getBizOrgCode());
iInstallNoticeService.saveOrUpdate(installNotice); iInstallNoticeService.saveOrUpdate(installNotice);
if (NoticeStatusEnum.已提交.getName().equals(model.getNoticeStatus())) { if (!WhetherItPassEnum.SAVE.getCode().equals(model.getNoticeStatus())) {
projectInitiationServiceImpl.execute(project.getInstanceId(), model, WhetherItPassEnum.PASS.getCode(), null); projectInitiationServiceImpl.execute(project.getInstanceId(), model, model.getNoticeStatus(), null);
} }
return ResponseHelper.buildResponse(model); return ResponseHelper.buildResponse(model);
} }
...@@ -415,7 +408,7 @@ public class InstallNoticeController extends BaseController { ...@@ -415,7 +408,7 @@ public class InstallNoticeController extends BaseController {
return null; return null;
} }
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("installNoticeInfo",iInstallNoticeService.getInfoByProjectId(projectId)); jsonObject.put("noticeInfo",iInstallNoticeService.getInfoByProjectId(projectId));
jsonObject.put("projectInfo",projectServiceImpl.selectById(projectId)); jsonObject.put("projectInfo",projectServiceImpl.selectById(projectId));
return ResponseHelper.buildResponse(jsonObject); return ResponseHelper.buildResponse(jsonObject);
} }
......
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