Commit 82770fb4 authored by dqq's avatar dqq

安装告知页面sql修改,修改代码位置

parent 6e22f7de
......@@ -4,7 +4,7 @@
<!-- 查询安装告知申请页面-->
<select id="installNoticePage" resultType="com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto">
SELECT a.* ,u2.biz_org_name,u1.biz_org_name
SELECT a.* ,u2.biz_org_name AS inspectionUnit,u1.biz_org_name AS superviseDept
FROM (SELECT
tz_ugp_install_notice.sequence_nbr,
tz_ugp_project.`NAME`,
......
......@@ -195,23 +195,9 @@ 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 installNoticeDto = installNoticeServiceImpl.saveInstallNotice(object, noticeStatus);
installNoticeDto.setLicenseAttch(JSON.toJSONString(licenseAttch));
installNoticeDto.setContractAttch(JSON.toJSONString(contractAttch));
// projectInitiationServiceImpl.execute(projectDto.getInstanceId(),installNoticeDto,"1");
return ResponseHelper.buildResponse(installNoticeServiceImpl.createWithModel(installNoticeDto));
}
......@@ -225,17 +211,7 @@ public class InstallNoticeController extends BaseController {
@GetMapping(value = "/message/{sequenceNbr}")
@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()));
return ResponseHelper.buildResponse(jsonObject);
return ResponseHelper.buildResponse(installNoticeServiceImpl.selectOneBySeq(sequenceNbr));
}
/**
......@@ -281,7 +257,7 @@ public class InstallNoticeController extends BaseController {
if (noticeStatus.equals("已提交")||noticeStatus.equals("已保存")){
return ResponseHelper.buildResponse(installNoticeServiceImpl.removeById(sequenceNbr));
}
return null;
return ResponseHelper.buildResponse(false);
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
......
package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.InstallNotice;
import com.yeejoin.amos.boot.module.ugp.api.mapper.InstallNoticeMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IInstallNoticeService;
import com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.sql.Wrapper;
import java.util.Date;
import java.util.List;
/**
......@@ -27,6 +36,8 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
@Autowired
InstallNoticeMapper installNoticeMapper;
@Autowired
ProjectServiceImpl projectServiceImpl;
/**
* 分页查询
*/
......@@ -56,4 +67,47 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
public InstallNoticeDto selectOneById(Long sequenceNbr){
return installNoticeMapper.selectoneById(sequenceNbr);
}
/**
* 新增安装告知申请,保存/提交
*
* @return
*/
public InstallNoticeDto saveInstallNotice(JSONObject object, 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");
return installNoticeDto;
}
/**
* 根据sequenceNbr查询安装告知信息及附件
*
* @param sequenceNbr 主键
* @return
*/
public JSONObject selectOneBySeq(Long sequenceNbr) {
final InstallNoticeDto installNoticeDto = 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()));
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