Commit 0bac851e authored by sxwnfpwx@163.com's avatar sxwnfpwx@163.com

Merge remote-tracking branch 'origin/developer' into developer

parents e8f0a487 82b64ea0
......@@ -17,7 +17,8 @@
supervise_dept_id,
inspection_unit_id,
notice_status,
notice_date
notice_date,
approved
FROM
tz_ugp_install_notice
LEFT JOIN tz_ugp_project ON tz_ugp_install_notice.project_id = tz_ugp_project.sequence_nbr
......
......@@ -195,9 +195,23 @@ 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();
InstallNoticeDto installNoticeDto = installNoticeServiceImpl.saveInstallNotice(object, noticeStatus);
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 ResponseHelper.buildResponse(installNoticeServiceImpl.createWithModel(installNoticeDto));
}
......@@ -211,7 +225,17 @@ public class InstallNoticeController extends BaseController {
@GetMapping(value = "/message/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr安装告知信息", notes = "根据sequenceNbr安装告知信息")
public ResponseModel<JSONObject> selectOneBySeq(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(installNoticeServiceImpl.selectOneBySeq(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);
}
/**
......@@ -257,12 +281,18 @@ public class InstallNoticeController extends BaseController {
if (noticeStatus.equals("已提交")||noticeStatus.equals("已保存")){
return ResponseHelper.buildResponse(installNoticeServiceImpl.removeById(sequenceNbr));
}
return ResponseHelper.buildResponse(false);
return null;
}
/**
* 监察部门接受安装告知
* @param sequenceNbr
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/acceptNotification")
@ApiOperation(httpMethod = "get", value = "接受告知", notes = "接受告知")
@ApiOperation(httpMethod = "get", value = "监察部门接受安装告知", notes = "监察部门接受安装告知")
public ResponseModel<Boolean> acceptNotification(Long sequenceNbr){
InstallNotice installNotice = installNoticeServiceImpl.getById(sequenceNbr);
installNotice.setNoticeStatus(NoticeStatusEnum.已接收.getName());
......@@ -270,4 +300,23 @@ public class InstallNoticeController extends BaseController {
projectInitiationServiceImpl.execute(project.getInstanceId(),installNotice,NoticeStatusEnum.已接收.getStatusId());
return ResponseHelper.buildResponse(installNoticeServiceImpl.updateById(installNotice));
}
/**
* 监检部门审查(通过/退回)安装告知
* @param sequenceNbr
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/inspectNotification")
@ApiOperation(httpMethod = "get", value = "监检部门审查(通过/退回)安装告知", notes = "监检部门审查(通过/退回)安装告知")
public ResponseModel<Boolean> inspectNotification(Long sequenceNbr,String option){
InstallNotice installNotice = installNoticeServiceImpl.getById(sequenceNbr);
installNotice.setApproved(true);
if(NoticeStatusEnum.已退回.equals(option)){
installNotice.setApproved(false);
}
Project project = projectServiceImpl.getById(installNotice.getProjectId());
projectInitiationServiceImpl.execute(project.getInstanceId(),installNotice,option);
return ResponseHelper.buildResponse(installNoticeServiceImpl.updateById(installNotice));
}
}
......@@ -15,6 +15,7 @@ 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.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -56,7 +57,18 @@ public class InstallNoticeServiceImpl extends BaseService<InstallNoticeDto,Insta
* 安装告知申请分页查询
*/
public Page<InstallNoticePageDto> installNoticePage(Page<InstallNoticePageDto> page,String name,String constructionUnit) {
return installNoticeMapper.installNoticePage(page,name,constructionUnit);
Page<InstallNoticePageDto> installNoticePage = installNoticeMapper.installNoticePage(page,name,constructionUnit);
List<InstallNoticePageDto> installNoticePageDtos = installNoticePage.getRecords();
for(InstallNoticePageDto installNoticePageDto:installNoticePageDtos){
if(!ValidationUtil.isEmpty(installNoticePageDto.getApproved())){
if(installNoticePageDto.getApproved()){
installNoticePageDto.setApprovedName("通过");
}else{
installNoticePageDto.setApprovedName("不通过");
}
}
}
return installNoticePage;
}
/**
......
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