Commit a866e632 authored by dqq's avatar dqq

修改安装告知申请的新增,查看,修改

parent 661830c3
......@@ -54,4 +54,7 @@ public class InstallNoticeDto extends BaseDto {
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "安装负责人")
private String installPri;
}
......@@ -3,8 +3,10 @@ package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
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.dto.*;
import com.yeejoin.amos.boot.module.ugp.api.entity.InstallNotice;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
......@@ -20,12 +22,10 @@ import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.InstallNoticeServiceImpl;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -195,23 +195,7 @@ public class InstallNoticeController extends BaseController {
@PostMapping (value = "/saveInstallNotice")
@ApiOperation(httpMethod = "Post", value = "新增安装告知申请", notes = "新增安装告知申请")
public ResponseModel<InstallNoticeDto> saveInstallNotice(@RequestBody JSONObject object,@RequestParam(required = false) String noticeStatus ) {
InstallNoticeDto installNoticeDto = new InstallNoticeDto();
final ProjectDto projectDto = projectServiceImpl.queryBySeq(object.getLong("name"));
installNoticeDto.setProjectId(object.getLong("name"));
installNoticeDto.setNoticeStatus(noticeStatus);
installNoticeDto.setNoticeDate(new Date());
installNoticeDto.setApproved(false);
installNoticeDto.setOrganizationCode(orgServiceImpl.getOrgUsr().getBizOrgCode());
installNoticeDto.setLicenseNum(object.getString("licenseNum"));
installNoticeDto.setLicenseCompany(object.getString("licenseCompany"));
final JSONArray licenseAttch = object.getJSONArray("licenseAttch");
final JSONArray contractAttch = object.getJSONArray("contractAttch");
installNoticeDto.setLicenseAttch(JSON.toJSONString(licenseAttch));
installNoticeDto.setContractAttch(JSON.toJSONString(contractAttch));
projectInitiationServiceImpl.execute(projectDto.getInstanceId(),installNoticeDto,"1");
InstallNoticeDto installNoticeDto = installNoticeServiceImpl.saveInstallNotice(object, noticeStatus);
return ResponseHelper.buildResponse(installNoticeServiceImpl.createWithModel(installNoticeDto));
}
......@@ -226,15 +210,7 @@ public class InstallNoticeController extends BaseController {
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr安装告知信息", notes = "根据sequenceNbr安装告知信息")
public ResponseModel<JSONObject> selectOneBySeq(@PathVariable Long sequenceNbr) {
final InstallNoticeDto installNoticeDto = installNoticeServiceImpl.selectOneById(sequenceNbr);
final ProjectDto projectDto = projectServiceImpl.queryBySeq(installNoticeDto.getProjectId());
JSONObject jsonObject = new JSONObject();
jsonObject.put("name",projectDto.getSequenceNbr());
jsonObject.put("installRegion",projectDto.getInstallRegion());
jsonObject.put("licenseNum",installNoticeDto.getLicenseNum());
jsonObject.put("licenseCompany",installNoticeDto.getLicenseCompany());
jsonObject.put("licenseAttch",JSON.parseArray(installNoticeDto.getLicenseAttch()));
jsonObject.put("contractAttch",JSON.parseArray(installNoticeDto.getContractAttch()));
JSONObject jsonObject = installNoticeServiceImpl.selectOneBySeq(sequenceNbr);
return ResponseHelper.buildResponse(jsonObject);
}
......@@ -259,6 +235,7 @@ public class InstallNoticeController extends BaseController {
installNoticeDto.setLicenseCompany(object.getString("licenseCompany"));
final JSONArray licenseAttch = object.getJSONArray("licenseAttch");
final JSONArray contractAttch = object.getJSONArray("contractAttch");
installNoticeDto.setInstallPri(object.getString("installPri"));
installNoticeDto.setLicenseAttch(JSON.toJSONString(licenseAttch));
installNoticeDto.setContractAttch(JSON.toJSONString(contractAttch));
......@@ -286,6 +263,27 @@ public class InstallNoticeController extends BaseController {
}
/**
* 查询当前登陆人所在单位下的可选告知申请的所有项目列表
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "查询当前登陆人所在单位下的所以项目列表", notes = "查询当前登陆人所在单位下的所以项目列表")
@GetMapping(value = "/getProjects")
public ResponseModel<List<Project>> getCompanyProjects(){
Long companyId = null;
//获取当前登陆人所在单位id
companyId = orgServiceImpl.getCompanyId();
if(ValidationUtil.isEmpty(companyId)){
return ResponseHelper.buildResponse(new ArrayList<>());
}
LambdaQueryWrapper<Project> wrapper = new LambdaQueryWrapper<Project>();
if (!ValidationUtil.isEmpty(companyId)) {
wrapper.eq(Project::getInstallationUnitId,companyId).eq(Project::getStatus,ProjectInitiationEnum.告知申请.getName());
}
return ResponseHelper.buildResponse(projectServiceImpl.list(wrapper));
}
/**
* 监察部门接受安装告知
* @param sequenceNbr
* @return
......
......@@ -39,6 +39,10 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
InstallNoticeMapper installNoticeMapper;
@Autowired
ProjectServiceImpl projectServiceImpl;
@Autowired
ProjectInitiationServiceImpl projectInitiationServiceImpl;
@Autowired
OrgServiceImpl orgServiceImpl;
/**
* 分页查询
*/
......@@ -88,19 +92,20 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
public InstallNoticeDto saveInstallNotice(JSONObject object, String noticeStatus ) {
InstallNoticeDto installNoticeDto = new InstallNoticeDto();
// final ProjectDto projectDto = projectServiceImpl.queryBySeq(object.getLong("name"));
final ProjectDto projectDto = projectServiceImpl.queryBySeq(object.getLong("name"));
installNoticeDto.setProjectId(object.getLong("name"));
installNoticeDto.setNoticeStatus(noticeStatus);
installNoticeDto.setNoticeDate(new Date());
installNoticeDto.setApproved(false);
// installNoticeDto.setOrganizationCode(orgServiceImpl.getOrgUsr().getBizOrgCode());
installNoticeDto.setInstallPri(object.getString("installPri"));
installNoticeDto.setOrganizationCode(orgServiceImpl.getOrgUsr().getBizOrgCode());
installNoticeDto.setLicenseNum(object.getString("licenseNum"));
installNoticeDto.setLicenseCompany(object.getString("licenseCompany"));
final JSONArray licenseAttch = object.getJSONArray("licenseAttch");
final JSONArray contractAttch = object.getJSONArray("contractAttch");
installNoticeDto.setLicenseAttch(JSON.toJSONString(licenseAttch));
installNoticeDto.setContractAttch(JSON.toJSONString(contractAttch));
// projectInitiationServiceImpl.execute(projectDto.getInstanceId(),installNoticeDto,"1");
projectInitiationServiceImpl.execute(projectDto.getInstanceId(),installNoticeDto,"1");
return installNoticeDto;
}
......@@ -120,6 +125,7 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
jsonObject.put("licenseCompany",installNoticeDto.getLicenseCompany());
jsonObject.put("licenseAttch",JSON.parseArray(installNoticeDto.getLicenseAttch()));
jsonObject.put("contractAttch",JSON.parseArray(installNoticeDto.getContractAttch()));
jsonObject.put("installPri",installNoticeDto.getInstallPri());
return jsonObject;
}
}
\ 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