Commit 7988ef72 authored by neo's avatar neo

[DEV] translate listAllProjectList api logic

parent 18a0e9cf
......@@ -7,6 +7,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
......@@ -20,7 +21,9 @@ import pwc.taxtech.atms.service.ProjectService;
@RequestMapping("/api/v1/project")
public class ProjectController {
/** @see PwC.Tax.Tech.Atms.WebApi\Controllers\ProjectController.cs */
/**
* @see PwC.Tax.Tech.Atms.WebApi\Controllers\ProjectController.cs
*/
private static Logger logger = LoggerFactory.getLogger(ProjectController.class);
......@@ -29,23 +32,32 @@ public class ProjectController {
@ApiOperation(value = "listService", notes = "Get service list")
@RequestMapping(value = "listService", method = RequestMethod.GET)
public @ResponseBody List<ServiceTypeDto> getServiceList() {
public @ResponseBody
List<ServiceTypeDto> getServiceList() {
logger.info("/api/v1/project/listService");
return projectService.getServiceList();
}
@ApiOperation(value = "getProjectClientList", notes = "Get project Client list")
@RequestMapping(value = "getProjectClientList", method = RequestMethod.GET)
public @ResponseBody List<ProjectClientDto> getProjectClientList() {
public @ResponseBody
List<ProjectClientDto> getProjectClientList() {
logger.info("/api/v1/project/getProjectClientList");
return projectService.getProjectClientList();
}
@ApiOperation(value = "getProject" ,notes = "Get Project")
@ApiOperation(value = "getProject", notes = "Get Project")
@RequestMapping(value = "getProject", method = RequestMethod.GET)
public @ResponseBody List<ProjectDisplayDto> GetProjectByID(String projectID)
{
public @ResponseBody
List<ProjectDisplayDto> GetProjectByID(String projectID) {
return projectService.getProjectByID(projectID);
}
@ApiOperation(value = "getAllProjectList", notes = "Get All List")
@RequestMapping(value = "getAllProjectList", method = RequestMethod.GET)
public @ResponseBody
List<ProjectDisplayDto> getAllProjectList( String orgID, String serviceID, Integer projectYear) {
logger.info("/api/v1/project/getAllProjectList with orgID {} serviceID {}", orgID, serviceID);
return projectService.getAllProjectList(orgID, serviceID == null ? "" : serviceID, projectYear);
}
}
......@@ -226,7 +226,7 @@ public class UserController {
@SuppressWarnings("rawtypes")
@ApiOperation(value = "查询用户信息", notes = "税务运营管理平台>增值税申报")
@RequestMapping(value = "getUserByName", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody OperationResultDto getUserByName(
public @ResponseBody UserDto getUserByName(
@RequestBody UserDto userParam) {
return userRoleService.GetUserByUserName(userParam);
}
......
package pwc.taxtech.atms.dao;
import java.util.Dictionary;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -161,4 +162,63 @@ public interface ProjectMapper extends MyMapper {
"</script>")
List<ProjectDisplayDto> getProjectList(@Param("orgID") String orgID, @Param("serverID") String serviceID,
@Param("projectYear") Integer projectYear);
@Select("SELECT " +
" p.PeriodId, p.Status " +
"FROM " +
" ProjectStatusManage p " +
"WHERE " +
" p.DbName = #{dbName} " +
"ORDER BY PeriodId , Status")
Dictionary<Integer,Integer> getProjectSatusListByDbName(String dbName);
@Select("<script>" +
"SELECT " +
" now() AS CreateTime, " +
" TRUE AS IsActive, " +
" org.ID AS OrganizationID, " +
" org.Name AS Name, " +
" org.Code AS Code, " +
" UUID() AS ID, " +
" org.IndustryID AS IndustryID, " +
" 0 AS Year, " +
" org.RegionID AS RegionID, " +
" 0 AS RuleType, " +
" st.ID AS ServiceTypeID, " +
" reg.ShortName AS RegionName, " +
" now() AS UpdateTime, " +
" st.Name AS ServiceTypeName, " +
" org.Name AS OrganizationName, " +
" ind.Name AS IndustryName, " +
" ostg.TemplateGroupID AS TemplateGroupID, " +
" '' AS TemplateGroupName, " +
" org.ClientCode AS ClientCode, " +
" '' AS DbName, " +
" FALSE AS HaveCreateProject, " +
" ea.EnterpriseAccountSetID AS EnterpriseAccountSetID, " +
" 1 AS StartPeriod, " +
" 12 AS EndPeriod, " +
" ea.EffectiveDate AS EffectiveDate, " +
" ea.ExpiredDate AS ExpiredDate " +
"FROM " +
" Organization org " +
" JOIN " +
" EnterpriseAccountSetOrg ea ON org.ID = ea.OrganizationID " +
" JOIN " +
" OrganizationServiceTemplateGroup ostg ON org.ID = ostg.OrganizationID " +
" JOIN " +
" ServiceType st ON ostg.ServiceTypeID = st.ID " +
" JOIN " +
" Industry ind ON org.IndustryID = ind.ID " +
" JOIN " +
" Region reg ON org.RegionID = reg.ID " +
"WHERE " +
" 1=1" +
" <if test=\"orgID != null and orgID !='' \">AND org.ID=#{orgID}</if>" +
" AND org.IsActive = 1 " +
" AND st.IsActive = 1 " +
" <if test=\"serviceID != null and serviceID !='' \">AND ostg.ServiceTypeID=#{serviceID}</if>" +
"ORDER BY ea.EffectiveDate,org.Code" +
"</script>")
List<ProjectDisplayDto> getProjectFromEnterpriseAccountSetOrg(@Param("orgID") String orgID, @Param("serviceID") String serviceID);
}
\ No newline at end of file
package pwc.taxtech.atms.dto.taxadmin;
public class ProjectYearParam {
public int endMonth;
public int startMonth;
public int year;
}
......@@ -36,6 +36,8 @@ public interface ProjectService {
List<ProjectDisplayDto> getProjectByID(String projectID);
List<ProjectDisplayDto> getAllProjectList(String orgID, String s, Integer projectYear);
// Map<Integer, Integer> getProjectAllStatus(String dbName);
}
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