Commit 3048dfb2 authored by neo.wang's avatar neo.wang

Merge branch 'dev_neo' into 'dev'

Dev neo add get project status api impl

See merge request root/atms!17
parents feedbc03 ff585ba2
......@@ -32,4 +32,14 @@ public class ProjectStatusManageController {
@PathVariable("status") Integer status) {
return projectStatusManageService.setProjectStatus(dbName, periodId, status, identityService.getIdentityUser().getID());
}
@ApiOperation(value = "getProjectStatus", notes = "")
@RequestMapping(value = {"getProjectStatus/{dbName}/{projectId}/{periodId}"}, method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
public OperationResultDto<ProjectStatusManageDto> getProjectStatus(@PathVariable String dbName, @PathVariable String projectId,
@PathVariable Integer periodId) {
return projectStatusManageService.getProjectStatus(dbName, projectId, periodId);
}
}
package pwc.taxtech.atms.dto.taxadmin;
public class AddProjectResult {
private String dBname;
private String dbName;
private String projectID;
private Boolean result;
private String resultMsg;
public String getdBname() {
return dBname;
public String getDbName() {
return dbName;
}
public void setdBname(String dBname) {
this.dBname = dBname;
public void setDbName(String dbName) {
this.dbName = dbName;
}
public String getProjectID() {
......
......@@ -5,4 +5,6 @@ import pwc.taxtech.atms.dto.taxadmin.ProjectStatusManageDto;
public interface ProjectStatusManageService {
OperationResultDto<ProjectStatusManageDto> setProjectStatus(String dbName, Integer periodId, Integer status, String id);
OperationResultDto<ProjectStatusManageDto> getProjectStatus(String dbName, String projectId, Integer periodId);
}
......@@ -206,7 +206,7 @@ public class ProjectServiceImpl implements ProjectService {
AddProjectResult addProjectResult = new AddProjectResult();
addProjectResult.setResult(true);
addProjectResult.setdBname(project.getDbName());
addProjectResult.setDbName(project.getDbName());
addProjectResult.setProjectID(project.getID());
return addProjectResult;
}catch (Exception e){
......
......@@ -7,6 +7,7 @@ import org.springframework.stereotype.Service;
import pwc.taxtech.atms.dao.ProjectStatusManageMapper;
import pwc.taxtech.atms.dto.FieldsMapper;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.taxadmin.ProjectImportSubStatusDto;
import pwc.taxtech.atms.dto.taxadmin.ProjectStatusManageDto;
import pwc.taxtech.atms.entitiy.ProjectStatusManage;
import pwc.taxtech.atms.entitiy.ProjectStatusManageExample;
......@@ -75,4 +76,55 @@ public class ProjectStatusManageServiceImpl implements ProjectStatusManageServic
return ord;
}
}
@Override
public OperationResultDto<ProjectStatusManageDto> getProjectStatus(String dbName, String projectId, Integer periodId) {
try {
ProjectStatusManageExample example = new ProjectStatusManageExample();
example.createCriteria().andDbNameEqualTo(dbName).andPeriodIdEqualTo(periodId);
List<ProjectStatusManage> psmList = projectStatusManageMapper.selectByExample(example);
if (psmList != null && !psmList.isEmpty()) {
ProjectStatusManage first = psmList.get(FIRST_OR_DFAULT);
ProjectStatusManageDto dto = new ProjectStatusManageDto();
try {
FieldsMapper.map(first, dto);
} catch (Exception e) {
e.printStackTrace();
LOGGER.warn("field map some error");
}
ProjectImportSubStatusDto ssd = new ProjectImportSubStatusDto();//TODO:should query status from db (neo)
ssd.setAdjustImport(false);
ssd.setCustomInvoiceImport(false);
ssd.setEntryImport(false);
ssd.setErpImport(false);
ssd.setInputInvoiceImport(false);
ssd.setOutputInvoiceImport(false);
ssd.setTbImport(false);
ssd.setVoucherMapImport(false);
dto.setImportSubStatus(ssd);
OperationResultDto resultDto = new OperationResultDto();
resultDto.setResult(true);
resultDto.setResultMsg("");
resultDto.setData(dto);
return resultDto;
}else {
throw new Exception("数据库"+dbName+"状态信息为NULL");
}
}catch (Exception e){
OperationResultDto resultDto = new OperationResultDto();
resultDto.setResult(false);
resultDto.setResultMsg(e.getMessage());
resultDto.setData(null);
return resultDto;
}
}
}
......@@ -1697,7 +1697,7 @@ frameworkModule.controller('appOverviewController', ['$rootScope', '$scope', '$t
projectService.addProject(project).success(function (rsp) {
if (rsp && rsp.result) {
project.haveCreateProject = true;
project.dbName = rsp.dBname;
project.dbName = rsp.dbName;
project.id = rsp.projectID;
if (_.isNull(project.projectStatusList)) { //如果当前期间还没有导入任何数据的话,就添加一条未开始状态的记录
......
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