Commit 33d528dd authored by eddie.woo's avatar eddie.woo

Merge branch 'dev' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_eddie

parents 0c5c5fa1 38a66442
......@@ -395,5 +395,9 @@
<columnOverride column="IsManualChange" javaType="Boolean"/>
<columnOverride column="Instructions" javaType="java.lang.String" jdbcType="VARCHAR"/>
</table>
<table tableName="Project" domainObjectName="Project">
<property name="useActualColumnNames" value="true"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
</context>
</generatorConfiguration>
\ No newline at end of file
package pwc.taxtech.atms.constant.enums;
public enum KeyValueConfigType {
SystemFundation (1),
Customize (2);
private Integer code;
KeyValueConfigType(Integer code) {
this.code = code;
}
public Integer getCode() {
return code;
}
}
......@@ -22,7 +22,7 @@ public class CellTemplateController {
@RequestMapping(value = "configList/{templateID}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody
OperationResultDto<List<CellTemplateConfigDto>> GetConfigList(@PathVariable String templateID) {
OperationResultDto<List<CellTemplateConfigDto>> getConfigList(@PathVariable String templateID) {
OperationResultDto<List<CellTemplateConfigDto>> result = new OperationResultDto<>();
if (StringUtils.isEmpty(templateID)) {
......@@ -40,7 +40,7 @@ public class CellTemplateController {
@RequestMapping(value = "config/{cellTemplateID}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody
OperationResultDto<CellTemplateConfigDto> GetConfig(@PathVariable String cellTemplateID) {
OperationResultDto<CellTemplateConfigDto> getConfig(@PathVariable String cellTemplateID) {
if (StringUtils.isEmpty(cellTemplateID)) {
return new OperationResultDto<>();
}
......@@ -56,7 +56,7 @@ public class CellTemplateController {
@RequestMapping(value = "config",method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody
OperationResultDto PostConfig(@RequestBody CellTemplateConfigDto cellTemplateConfigDto){
OperationResultDto postConfig(@RequestBody CellTemplateConfigDto cellTemplateConfigDto){
return cellTemplateService.saveOrEdit(cellTemplateConfigDto);
}
}
......@@ -20,7 +20,7 @@ public class IndustryController {
ProjectIndustryService projectIndustryService;
@RequestMapping(value = "getAllAvailableIndustry", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody List<Industry> GetAllAvailableIndustry() {
return projectIndustryService.GetAllAvailableIndustry();
public @ResponseBody List<Industry> getAllAvailableIndustry() {
return projectIndustryService.getAllAvailableIndustry();
}
}
......@@ -2,29 +2,106 @@ package pwc.taxtech.atms.controller;
import java.util.List;
import javassist.tools.web.BadHttpRequest;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.ApiOperation;
import pwc.taxtech.atms.dto.KeyValueConfigDisplayDto;
import pwc.taxtech.atms.dto.*;
import pwc.taxtech.atms.dto.Common.RemoteValidationRetDto;
import pwc.taxtech.atms.dto.formula.FormulaConfigDto;
import pwc.taxtech.atms.service.KeyValueConfigService;
@RestController
@RequestMapping("/api/v1/keyValueConfig")
public class KeyValueConfigController {
private static final Logger logger = LoggerFactory.getLogger(EnterpriseAccountManagerController.class);
@Autowired
private KeyValueConfigService keyValueConfigService;
@ApiOperation(value="get keyValueConfig")
@RequestMapping(value="",method=RequestMethod.GET)
public @ResponseBody List<KeyValueConfigDisplayDto> Get(){
return keyValueConfigService.Get();
@ApiOperation(value = "get keyValueConfig")
@RequestMapping(value = "", method = RequestMethod.GET)
public @ResponseBody
List<KeyValueConfigDisplayDto> get() {
return keyValueConfigService.get();
}
@RequestMapping(value = "dataSource", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody
OperationResultDto<List<FormulaConfigDto>> getDataSource() {
return keyValueConfigService.getAllFormulaList();
}
@RequestMapping(value = "getFinacialReference/{keyValueID}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody
List<FinancialStatementDetail> getFinacialStatementReference(@PathVariable String keyValueID) throws BadHttpRequest {
if (StringUtils.isBlank(keyValueID)) {
throw new BadHttpRequest(new Exception("keyValueID is null"));
}
return keyValueConfigService.getFinacialStatement(keyValueID);
}
@RequestMapping(value = "getTaxReference/{keyValueID}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody
List<TaxReturnDetail> getTaxReturnReference(@PathVariable String keyValueID) throws BadHttpRequest {
if (StringUtils.isBlank(keyValueID)) {
throw new BadHttpRequest(new Exception("keyValueID is null"));
}
return keyValueConfigService.getTaxReturn(keyValueID);
}
@RequestMapping(value = "getModelReference/{keyValueID}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody
List<AnalyticsModelDetail> getAnalyticsModelReference(@PathVariable String keyValueID) throws BadHttpRequest {
if (StringUtils.isBlank(keyValueID)) {
throw new BadHttpRequest(new Exception("keyValueID is null"));
}
return keyValueConfigService.getAnalyticsModel(keyValueID);
}
@RequestMapping(value = "add", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void addKeyValueConfiguration(@RequestBody AddKeyValueConfigDto addKeyValueConfigDto) {
//todo: add userName @ here
addKeyValueConfigDto.setUserName("");
keyValueConfigService.addKeyValueConfiguration(addKeyValueConfigDto);
}
@RequestMapping(value = "update", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void updateKeyValueConfiguration(@RequestBody UpdateKeyValueConfigDto updateKeyValueConfigDto) {
//todo: add userName @ here
updateKeyValueConfigDto.setUserName("");
keyValueConfigService.updateKeyValueConfiguration(updateKeyValueConfigDto);
}
@RequestMapping(method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody
int delelte(@RequestParam String keyValueID) throws BadHttpRequest {
if (StringUtils.isBlank(keyValueID)) {
throw new BadHttpRequest(new Exception("keyValueID is null"));
}
return keyValueConfigService.deleteKeyValueConfiguration(keyValueID);
}
@RequestMapping(value = "getByOrgID/{orgID}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody
List<KeyValueConfigDisplayDto> getByOrgID(@PathVariable String orgID) {
return keyValueConfigService.getByOrgID(orgID);
}
@RequestMapping(value = "isDuplicated", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody
RemoteValidationRetDto isDuplicated(@RequestParam String value) {
boolean isDuplicated = keyValueConfigService.isKeyValueDuplicated(value);
RemoteValidationRetDto result = new RemoteValidationRetDto();
result.setValid(!isDuplicated);
result.setValue(value);
return result;
}
}
......@@ -17,8 +17,8 @@ public class ModelConfigurationController {
ModelConfigurationService modelConfigurationService;
@RequestMapping(value = "/model/byIndustry/{serviceTypeID}/{industryID}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody List<ModelProfileDto> GetModelListByIndustry(@PathVariable String industryID,
public @ResponseBody List<ModelProfileDto> getModelListByIndustry(@PathVariable String industryID,
@PathVariable String serviceTypeID) {
return modelConfigurationService.GetModelListByIndustry(serviceTypeID, industryID);
return modelConfigurationService.getModelListByIndustry(serviceTypeID, industryID);
}
}
......@@ -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);
}
}
......@@ -132,8 +132,8 @@ public class RoleController {
public @ResponseBody Map addRole(@RequestBody RoleDisplayDto roleDisplayDto) {
Map result = new HashMap<>();
if (roleService.addRole(roleDisplayDto).equals("-1")) {
result.put("data", Integer.valueOf(-1));
if ("-1".equals(roleService.addRole(roleDisplayDto))) {
result.put("data", -1);
} else {
result.put("data", roleService.getRoleList());
}
......
......@@ -29,22 +29,22 @@ public class RuleEngineeConfigController {
@ApiOperation(value = "Get TaxPayerReportMapping", notes = "Return TaxPayerReportMapping")
@RequestMapping(value = "taxPayerReportMapping", method = RequestMethod.GET)
public @ResponseBody List<TaxPayerReportRuleDto> GetTaxPayerReportMapping() {
public @ResponseBody List<TaxPayerReportRuleDto> getTaxPayerReportMapping() {
logger.debug("RuleEngineeConfigController GetTaxPayerReportMapping");
return ruleEngineeConfigService.getTaxPayerReportMapping();
}
@ApiOperation(value="Get TaxRuleSetting",notes="Return TaxRuleSetting")
@RequestMapping(value="taxRuleSetting",method= RequestMethod.GET)
public @ResponseBody List<TaxRuleSettingDto> GetTaxRuleSetting()
public @ResponseBody List<TaxRuleSettingDto> getTaxRuleSetting()
{
logger.debug("RuleEngineeConfigController GetTaxRuleSetting");
return ruleEngineeConfigService.getTaxRuleSetting();
}
@ApiOperation(value="",notes="")
@ApiOperation(value="",notes="saveTaxRuleSettings")
@RequestMapping(value="taxRuleSetting/Save",method = RequestMethod.POST)
public void SaveTaxRuleSettings(@RequestBody BatchUpdateTaxRuleDto batchUpdateTaxRule) {
public void saveTaxRuleSettings(@RequestBody BatchUpdateTaxRuleDto batchUpdateTaxRule) {
logger.debug("RuleEngineeConfigController SaveTaxRuleSettings");
ruleEngineeConfigService.savetaxrulesettings(batchUpdateTaxRule);
}
......
......@@ -32,7 +32,7 @@ public class ServiceTypeController {
@ResponseBody
@RequestMapping(value = "getlist", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public List<ServiceType> GetServiceTypes() {
return serviceTypeService.GetServiceTypes();
public List<ServiceType> getServiceTypes() {
return serviceTypeService.getServiceTypes();
}
}
......@@ -54,13 +54,13 @@ public class StdAccountController extends BaseController {
@ApiOperation(value = "根据行业查找科目")
@RequestMapping(value = "stdAccount/byIndustry/{industryID}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody
List<StandardAccountDto> GetStdAccountByIndustry(@PathVariable String industryID) {
List<StandardAccountDto> getStdAccountByIndustry(@PathVariable String industryID) {
if (StringUtils.isAnyBlank(industryID)) {
return Collections.emptyList();
}
try {
return stdAccountService.GetStdAccountByIndustry(industryID);
return stdAccountService.getStdAccountByIndustry(industryID);
} catch (Exception e) {
logger.error("GetStdAccountByIndustry error.", e);
}
......
......@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
public class TempStorageController {
//TODO: only for index running ,should be query from db (neo)
@RequestMapping(value = "storage/{userID}/{name}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public String GetTempStorage(String userId, String name) {//TODO:only for running,should be query from db (neo)
public String getTempStorage(String userId, String name) {//TODO:only for running,should be query from db (neo)
return "";
}
}
......@@ -29,13 +29,6 @@ public class TemplateController {
@Autowired
FTPClientPool ftpClientPool;
//todo:
//[Route("getTemplateJson")]
// [HttpGet]
// public IHttpActionResult GetTemplateJson(string templateID)
// {
// return this.Ok(templateService.GetTemplateJson(templateID));
// }
@RequestMapping(value = "get", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody
......@@ -45,7 +38,7 @@ public class TemplateController {
}
try {
return templateService.get(templateGroupID, (reportType != null && !reportType.equals("null")) ? Integer.parseInt(reportType) : null);
return templateService.get(templateGroupID, (reportType != null && !"null".equals(reportType)) ? Integer.parseInt(reportType) : null);
} catch (Exception e) {
logger.error("GetCellConfigList", e);
}
......@@ -59,7 +52,7 @@ public class TemplateController {
File templateFile;
InputStream inputStream = null;
Template template = templateService.getTemplateByID(templateID);
String templatePath = template.getPath();
String templatePath = templateService.getTemplatePath(templateID);
if (StringUtils.isBlank(templateID)) {
return;
}
......@@ -133,4 +126,10 @@ public class TemplateController {
}
return result;
}
@RequestMapping(value = "rowColName/{id}", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody
OperationResultDto setRowColName(@PathVariable String id, @RequestBody List<CellBriefDto> cellInfo) {
return templateService.setRowColName(id, cellInfo);
}
}
......@@ -17,9 +17,9 @@ public class TemplateFormulaController {
private static final Logger logger = LoggerFactory.getLogger(TemplateFormulaController.class);
@RequestMapping(value = "validate", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody OperationResultDto Validate(@RequestBody(required = false) String fromula) {
public @ResponseBody OperationResultDto validate(@RequestBody(required = false) String fromula) {
try {
return templateFormulaService.Validate(fromula);
return templateFormulaService.validate(fromula);
} catch (Exception e) {
logger.error("TemplateFormulaController Valdate", e);
OperationResultDto result = new OperationResultDto();
......
......@@ -52,7 +52,7 @@ public class TemplateGroupController {
@RequestMapping(value = "deleteTemplateGroup", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody
OperationResultDto<Object> DeleteTemplateGroup(@RequestBody TemplateGroupDto templateGroupDto) {
OperationResultDto<Object> deleteTemplateGroup(@RequestBody TemplateGroupDto templateGroupDto) {
OperationResultDto<Object> result = templateGroupService.deleteTemplateGroup(templateGroupDto);
if (result.getResult()) {
List<String> pathList = (List<String>) result.getData();
......
......@@ -223,4 +223,12 @@ public class UserController {
return userRoleService.updateUserRoleForOrg(userRoleList);
}
@SuppressWarnings("rawtypes")
@ApiOperation(value = "查询用户信息", notes = "税务运营管理平台>增值税申报")
@RequestMapping(value = "getUserByName", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody UserDto getUserByName(
@RequestBody UserDto userParam) {
return userRoleService.GetUserByUserName(userParam);
}
}
......@@ -106,5 +106,5 @@ public interface IndustryMapper extends MyMapper {
*/
int updateByPrimaryKey(Industry record);
List<Industry> GetAllAvailableIndustry();
List<Industry> getAllAvailableIndustry();
}
\ No newline at end of file
......@@ -106,5 +106,5 @@ public interface KeyValueConfigMapper extends MyMapper {
*/
int updateByPrimaryKey(KeyValueConfig record);
List<KeyValueConfig> SelectKeyValueConfigsByOrderByCreateTime();
List<KeyValueConfig> selectKeyValueConfigsByOrderByCreateTime();
}
\ No newline at end of file
......@@ -6,6 +6,9 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import org.springframework.security.access.method.P;
import pwc.taxtech.atms.MyMapper;
import pwc.taxtech.atms.dto.AnalyticsModelDetail;
import pwc.taxtech.atms.dto.FinancialStatementDetail;
import pwc.taxtech.atms.dto.TaxReturnDetail;
import pwc.taxtech.atms.entitiy.KeyValueReference;
import pwc.taxtech.atms.entitiy.KeyValueReferenceExample;
......@@ -108,4 +111,10 @@ public interface KeyValueReferenceMapper extends MyMapper {
int updateByPrimaryKey(KeyValueReference record);
int deleteKeyValueReferenceByCellTemplate(@Param("templateDbID") String templateDbID);
List<FinancialStatementDetail> getFinancialStatementDetails(@Param("configurationID") String configurationID);
List<TaxReturnDetail> getTaxReturnDetails(@Param("configurationID") String configurationID);
List<AnalyticsModelDetail> getAnalyticsModelDetails(@Param("configurationID") String configurationID);
}
\ No newline at end of file
......@@ -109,5 +109,5 @@ public interface ModelConfigMapper extends MyMapper {
*/
int updateByPrimaryKey(ModelConfig record);
List<ModelProfileDto> GetModelListByIndustry(Map<String,Object> map);
List<ModelProfileDto> getModelListByIndustry(Map<String,Object> map);
}
\ No newline at end of file
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;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyMapper;
import pwc.taxtech.atms.dto.taxadmin.ProjectDisplayDto;
import pwc.taxtech.atms.entitiy.Project;
import pwc.taxtech.atms.entitiy.ProjectExample;
@Mapper
public interface ProjectMapper extends MyMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Project
*
* @mbg.generated
*/
long countByExample(ProjectExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Project
*
* @mbg.generated
*/
int deleteByExample(ProjectExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Project
*
* @mbg.generated
*/
int deleteByPrimaryKey(String ID);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Project
*
* @mbg.generated
*/
int insert(Project record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Project
*
* @mbg.generated
*/
int insertSelective(Project record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Project
*
* @mbg.generated
*/
List<Project> selectByExampleWithRowbounds(ProjectExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Project
*
* @mbg.generated
*/
List<Project> selectByExample(ProjectExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Project
*
* @mbg.generated
*/
Project selectByPrimaryKey(String ID);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Project
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") Project record, @Param("example") ProjectExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Project
*
* @mbg.generated
*/
int updateByExample(@Param("record") Project record, @Param("example") ProjectExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Project
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(Project record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table Project
*
* @mbg.generated
*/
int updateByPrimaryKey(Project record);
@Select("<script>" +
"SELECT " +
" p.CreateTime AS CreateTime, " +
" p.IsActive AS IsActive, " +
" p.OrganizationID AS OrganizationID, " +
" p.Name AS Name, " +
" p.Code AS Code, " +
" p.ID AS ID, " +
" p.IndustryID AS IndustryID, " +
" p.Year AS Year, " +
" p.RegionID AS RegionID, " +
" region.ShortName AS RegionName, " +
" p.RuleType AS RuleType, " +
" projectServiceType.ServiceTypeID AS ServiceTypeID, " +
" p.UpdateTime AS UpdateTime, " +
" serviceType.Name AS ServiceTypeName, " +
" organization.Name AS OrganizationName, " +
" industry.Name AS IndustryName, " +
" projectServiceType.TemplateGroupID AS TemplateGroupID, " +
" templateGroup.Name AS TemplateGroupName, " +
" p.ClientCode AS ClientCode, " +
" p.DbName AS DbName, " +
" TRUE AS HaveCreateProject, " +
" p.EnterpriseAccountSetID AS EnterpriseAccountSetID, " +
" p.StartPeriod AS StartPeriod, " +
" p.EndPeriod AS EndPeriod " +
"FROM " +
" Project p " +
" JOIN " +
" Organization org ON p.OrganizationID = org.ID " +
" JOIN " +
" ProjectServiceType projectServiceType ON p.ID = projectServiceType.ProjectID " +
" JOIN " +
" Organization organization ON p.OrganizationID = organization.ID " +
" JOIN " +
" ServiceType serviceType ON projectServiceType.ServiceTypeID = serviceType.ID " +
" JOIN " +
" Industry industry ON p.IndustryID = industry.ID " +
" JOIN " +
" TemplateGroup templateGroup ON projectServiceType.TemplateGroupID = templateGroup.ID " +
" JOIN " +
" Region region ON p.RegionID = region.ID " +
" JOIN " +
" EnterpriseAccountSetOrg enterOrg ON p.EnterpriseAccountSetID = enterOrg.EnterpriseAccountSetID " +
" <where>" +
" p.IsActive=1 and serviceType.isActive=1 and p.OrganizationID = enterOrg.OrganizationID" +
" <if test=\"orgID != null and orgID !='' \">AND org.ID=#{orgID}</if>" +
" <if test=\"serverID != null and serverID !='' \">AND p.serviceType=#{serverID}</if>" +
" <if test=\"projectYear != null\">AND p.Year=#{projectYear}</if>" +
" </where>" +
"</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;
import java.util.List;
public class AddKeyValueConfigDto {
private String keyCode ;
private String name ;
private String formula ;
private String description ;
private String dataSource ;
private List<Integer> serviceTypeIds ;
private List<Integer> industryIds ;
private String userName ;
public String getKeyCode() {
return keyCode;
}
public void setKeyCode(String keyCode) {
this.keyCode = keyCode;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getFormula() {
return formula;
}
public void setFormula(String formula) {
this.formula = formula;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getDataSource() {
return dataSource;
}
public void setDataSource(String dataSource) {
this.dataSource = dataSource;
}
public List<Integer> getServiceTypeIds() {
return serviceTypeIds;
}
public void setServiceTypeIds(List<Integer> serviceTypeIds) {
this.serviceTypeIds = serviceTypeIds;
}
public List<Integer> getIndustryIds() {
return industryIds;
}
public void setIndustryIds(List<Integer> industryIds) {
this.industryIds = industryIds;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
}
package pwc.taxtech.atms.dto;
public class AnalyticsModelDetail {
private String modelID;
private String code;
private String name;
private int type;
private String industry;
private String entityName;
/**
* 机构ID
*/
private String entityID;
public String getModelID() {
return modelID;
}
public void setModelID(String modelID) {
this.modelID = modelID;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getEntityName() {
return entityName;
}
public void setEntityName(String entityName) {
this.entityName = entityName;
}
public String getIndustry() {
return industry;
}
public void setIndustry(String industry) {
this.industry = industry;
}
public String getEntityID() {
return entityID;
}
public void setEntityID(String entityID) {
this.entityID = entityID;
}
}
package pwc.taxtech.atms.dto;
public class CellBriefDto {
private int rowIndex;
private int columnIndex;
private String value;
public int getRowIndex() {
return rowIndex;
}
public void setRowIndex(int rowIndex) {
this.rowIndex = rowIndex;
}
public int getColumnIndex() {
return columnIndex;
}
public void setColumnIndex(int columnIndex) {
this.columnIndex = columnIndex;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
package pwc.taxtech.atms.dto.Common;
public class RemoteValidationRetDto {
private boolean isValid;
private String value;
public boolean isValid() {
return isValid;
}
public void setValid(boolean valid) {
isValid = valid;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
package pwc.taxtech.atms.dto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.reflect.Field;
public class FieldsMapper {
private static Logger LOGGER = LoggerFactory.getLogger(FieldsMapper.class);
/**
* 将source对象的属性填充到destination对象对应属性中
*
* @param source 原始对象
* @param destination 目标对象
*/
public static <S,D>void map(S source, D destination) throws ClassNotFoundException, IllegalAccessException {
Class clsDestination = Class.forName(destination.getClass().getName());
Class clsSource = Class.forName(source.getClass().getName());
Field[] declaredFields = clsDestination.getDeclaredFields();
for (Field field : declaredFields) {
field.setAccessible(true);
String fieldName = field.getName();
try {
if ("serialVersionUID".equals(fieldName)) {
continue;
}
Field sourceField = clsSource.getDeclaredField(fieldName);
sourceField.setAccessible(true);
field.set(destination, sourceField.get(source));
} catch (NoSuchFieldException e) {
LOGGER.warn("NoSuchFieldException {}",fieldName);
}
}
}
}
package pwc.taxtech.atms.dto;
public class FinancialStatementDetail {
private String name;
private String industry;
private int row;
private int column;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getIndustry() {
return industry;
}
public void setIndustry(String industry) {
industry = industry;
}
public int getRow() {
return row;
}
public void setRow(int row) {
this.row = row;
}
public int getColumn() {
return column;
}
public void setColumn(int column) {
this.column = column;
}
}
package pwc.taxtech.atms.dto;
public class TaxReturnDetail {
private String cellTemplateID;
private String templateID;
private String templateGroupID;
private String category;
private Integer payTaxType;
private String templateGroupName;
private String name;
private String industry;
private int row;
private int column;
public String getCellTemplateID() {
return cellTemplateID;
}
public void setCellTemplateID(String cellTemplateID) {
this.cellTemplateID = cellTemplateID;
}
public String getTemplateID() {
return templateID;
}
public void setTemplateID(String templateID) {
this.templateID = templateID;
}
public String getTemplateGroupID() {
return templateGroupID;
}
public void setTemplateGroupID(String templateGroupID) {
this.templateGroupID = templateGroupID;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public Integer getPayTaxType() {
return payTaxType;
}
public void setPayTaxType(Integer payTaxType) {
this.payTaxType = payTaxType;
}
public String getTemplateGroupName() {
return templateGroupName;
}
public void setTemplateGroupName(String templateGroupName) {
this.templateGroupName = templateGroupName;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getIndustry() {
return industry;
}
public void setIndustry(String industry) {
this.industry = industry;
}
public int getRow() {
return row;
}
public void setRow(int row) {
this.row = row;
}
public int getColumn() {
return column;
}
public void setColumn(int column) {
this.column = column;
}
}
package pwc.taxtech.atms.dto;
import java.util.List;
public class UpdateKeyValueConfigDto {
private String ID ;
private String name ;
private String formula ;
private String dataSource ;
private String description ;
private List<Integer> serviceTypeIDs ;
private List<Integer> industryIDs ;
private String userName ;
public String getID() {
return ID;
}
public void setID(String ID) {
this.ID = ID;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getFormula() {
return formula;
}
public void setFormula(String formula) {
this.formula = formula;
}
public String getDataSource() {
return dataSource;
}
public void setDataSource(String dataSource) {
this.dataSource = dataSource;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public List<Integer> getServiceTypeIDs() {
return serviceTypeIDs;
}
public void setServiceTypeIDs(List<Integer> serviceTypeIDs) {
this.serviceTypeIDs = serviceTypeIDs;
}
public List<Integer> getIndustryIDs() {
return industryIDs;
}
public void setIndustryIDs(List<Integer> industryIDs) {
this.industryIDs = industryIDs;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
}
package pwc.taxtech.atms.dto.formula;
public class FormulaConfigDto {
private String ID;
private String formulaName;
private String description;
private int calculateStatus;
private Integer dataSourceType;
private String dataSourceName;
private String chineseName;
private String englishName;
private String serviceType;
private String industry;
private Integer requiredParamNum;
public String getID() {
return ID;
}
public void setID(String ID) {
this.ID = ID;
}
public String getFormulaName() {
return formulaName;
}
public void setFormulaName(String formulaName) {
this.formulaName = formulaName;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public int getCalculateStatus() {
return calculateStatus;
}
public void setCalculateStatus(int calculateStatus) {
this.calculateStatus = calculateStatus;
}
public Integer getDataSourceType() {
return dataSourceType;
}
public void setDataSourceType(Integer dataSourceType) {
this.dataSourceType = dataSourceType;
}
public String getDataSourceName() {
return dataSourceName;
}
public void setDataSourceName(String dataSourceName) {
this.dataSourceName = dataSourceName;
}
public String getChineseName() {
return chineseName;
}
public void setChineseName(String chineseName) {
this.chineseName = chineseName;
}
public String getEnglishName() {
return englishName;
}
public void setEnglishName(String englishName) {
this.englishName = englishName;
}
public String getServiceType() {
return serviceType;
}
public void setServiceType(String serviceType) {
this.serviceType = serviceType;
}
public String getIndustry() {
return industry;
}
public void setIndustry(String industry) {
this.industry = industry;
}
public Integer getRequiredParamNum() {
return requiredParamNum;
}
public void setRequiredParamNum(Integer requiredParamNum) {
this.requiredParamNum = requiredParamNum;
}
}
package pwc.taxtech.atms.dto.taxadmin;
public class ProjectYearParam {
public int endMonth;
public int startMonth;
public int year;
}
This diff is collapsed.
......@@ -2,8 +2,27 @@ package pwc.taxtech.atms.service;
import java.util.List;
import pwc.taxtech.atms.dto.KeyValueConfigDisplayDto;
import pwc.taxtech.atms.dto.*;
import pwc.taxtech.atms.dto.formula.FormulaConfigDto;
public interface KeyValueConfigService {
List<KeyValueConfigDisplayDto> Get();
List<KeyValueConfigDisplayDto> get();
OperationResultDto<List<FormulaConfigDto>> getAllFormulaList();
List<FinancialStatementDetail> getFinacialStatement(String configurationID);
List<TaxReturnDetail> getTaxReturn(String configurationID);
List<AnalyticsModelDetail> getAnalyticsModel(String configurationID);
int deleteKeyValueConfiguration(String keyID);
void addKeyValueConfiguration(AddKeyValueConfigDto addKeyValueConfigDto);
void updateKeyValueConfiguration(UpdateKeyValueConfigDto updateKeyValueConfigDto);
boolean isKeyValueDuplicated(String name);
List<KeyValueConfigDisplayDto> getByOrgID(String orgID);
}
......@@ -5,5 +5,5 @@ import java.util.List;
import pwc.taxtech.atms.dto.ModelProfileDto;
public interface ModelConfigurationService {
List<ModelProfileDto> GetModelListByIndustry(String serviceTypeID, String industryID);
List<ModelProfileDto> getModelListByIndustry(String serviceTypeID, String industryID);
}
......@@ -41,9 +41,12 @@ public interface OperationLogService {
*/
void addOrDeleteDataAddLog(UpdateLogParams updateLogParams);
void AddDataAddLog(Object newObj, OperationModule operationModule, String userName, String operationDesc, String operationContent, String OperationObject, OperateLogType logType);
void addDataAddLog(Object newObj, OperationModule operationModule, String userName, String operationDesc
, String operationContent, String OperationObject, OperateLogType logType);
void UpdateDataAddLog(Object originalObj,Object updateObj,OperationModule operationModule,String userName,String comment,String operationObject,String operationContent,OperateLogType logType);
void updateDataAddLog(Object originalObj, Object updateObj, OperationModule operationModule, String userName
, String comment, String operationObject, String operationContent, OperateLogType logType);
void DeleteDataAddLog(Object deleteObj, OperationModule operationModule, String userName, String comment, String operationContent, String OperationObject, OperateLogType logType);
void deleteDataAddLog(Object deleteObj, OperationModule operationModule, String userName, String comment
, String operationContent, String OperationObject, OperateLogType logType);
}
......@@ -5,5 +5,5 @@ import java.util.List;
import pwc.taxtech.atms.entitiy.Industry;
public interface ProjectIndustryService {
List<Industry> GetAllAvailableIndustry();
List<Industry> getAllAvailableIndustry();
}
......@@ -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);
}
......@@ -6,5 +6,5 @@ import pwc.taxtech.atms.entitiy.ServiceType;
public interface ServiceTypeService {
List<ServiceType> GetServiceTypes();
List<ServiceType> getServiceTypes();
}
......@@ -11,5 +11,5 @@ public interface StdAccountService {
List<StandardAccountDto> GetStdAccountLinkEtsAccount(String orgID, String accountSetID);
List<StandardAccountDto> GetStdAccountByIndustry(String industryID);
List<StandardAccountDto> getStdAccountByIndustry(String industryID);
}
......@@ -3,5 +3,5 @@ package pwc.taxtech.atms.service;
import pwc.taxtech.atms.dto.OperationResultDto;
public interface TemplateFormulaService {
OperationResultDto Validate(String formula);
OperationResultDto validate(String formula);
}
......@@ -23,4 +23,5 @@ public interface TemplateService {
OperationResultDto<String> deleteTemplate(DeleteTemplateParam param);
OperationResultDto setRowColName(String id,List<CellBriefDto> cellInfo);
}
......@@ -67,4 +67,6 @@ public interface UserRoleService {
@SuppressWarnings("rawtypes")
OperationResultDto deleteUserRoleByOrgID(UserOrgDto userDto);
UserDto GetUserByUserName(UserDto userParam);
}
......@@ -48,4 +48,5 @@ public interface UserService {
List<UserOrganization> findUserOrganizationByUserIDAndOrganizationID(String userID, String organizationID);
UserDto getUserByDto(UserDto userParam);
}
......@@ -52,6 +52,7 @@ public class AreaRegionServiceImpl implements pwc.taxtech.atms.service.AreaRegio
@Autowired
private RegionMapper regionMapper;
@Override
public List<AreaRegion> findAreaRegionsByArea(String areaId) {
return areaRegionMapper.selectAreaRegionByAreaId(areaId);
......
......@@ -54,6 +54,7 @@ public class AreaServiceImpl implements AreaService {
*
* @see pwc.taxtech.atms.service.AreaService#findTopAreas()
*/
@Override
public List<Area> findTopAreas() {
AreaExample areaExample = new AreaExample();
......
......@@ -14,19 +14,17 @@ import java.util.Optional;
public final class CellConfigTranslater {
public static CellTemplateConfigDto GetConfigDto(CellTemplate template, List<CellTemplateConfig> configList) {
public static CellTemplateConfigDto getConfigDto(CellTemplate template, List<CellTemplateConfig> configList) {
if (template == null) {
return null;
}
CellTemplateConfigDto cellTemplateConfigDto = GetConfigDto(template.getID(), template.getReportTemplateID(), template.getRowIndex(), template.getRowName(), template.getColumnIndex(),
return getConfigDto(template.getID(), template.getReportTemplateID(), template.getRowIndex(), template.getRowName(), template.getColumnIndex(),
template.getColumnName(), template.getDataType(), template.getIsReadOnly(), template.getComment(), configList);
return cellTemplateConfigDto;
}
public static CellTemplateConfigDto GetConfigDto(String configID, String templateID, int rowIndex, String rowName, int columnIndex,
String columnName, Integer dataType, Integer isReadOnly, String description, List<CellTemplateConfig> configList) {
private static CellTemplateConfigDto getConfigDto(String configID, String templateID, int rowIndex, String rowName, int columnIndex,
String columnName, Integer dataType, Integer isReadOnly, String description, List<CellTemplateConfig> configList) {
if (configList == null) {
return null;
}
......@@ -59,7 +57,7 @@ public final class CellConfigTranslater {
cellTemplateConfigDto.setHasVoucher(true);
cellTemplateConfigDto.setVoucherKeyword(voucherItem.get().getVoucherKeyword() == null ? "" : voucherItem.get().getVoucherKeyword());
if (!StringUtils.isEmpty(voucherItem.get().getAccountCodes())) {
cellTemplateConfigDto.setAccountCodes(GetList(voucherItem.get().getAccountCodes()));
cellTemplateConfigDto.setAccountCodes(getList(voucherItem.get().getAccountCodes()));
}
}
......@@ -69,12 +67,14 @@ public final class CellConfigTranslater {
cellTemplateConfigDto.setInvoiceType(invoiceItem.get().getInvoiceType());
cellTemplateConfigDto.setInvoiceAmountType(invoiceItem.get().getInvoiceAmountType());
if (!StringUtils.isEmpty(invoiceItem.get().getTaxRate())) {
cellTemplateConfigDto.setTaxRate(GetList(invoiceItem.get().getTaxRate()));
cellTemplateConfigDto.setTaxRate(getList(invoiceItem.get().getTaxRate()));
}
if (!StringUtils.isEmpty(invoiceItem.get().getInvoiceCategory())) {
List<String> invoiceCategoryStrs = GetList(invoiceItem.get().getInvoiceCategory());
List<String> invoiceCategoryStrs;
invoiceCategoryStrs = getList(invoiceItem.get().getInvoiceCategory());
List<Integer> ints = new ArrayList<>();
assert invoiceCategoryStrs != null;
for (String categoryStr : invoiceCategoryStrs) {
int categoryVal;
categoryVal = Integer.parseInt(categoryStr);
......@@ -92,7 +92,7 @@ public final class CellConfigTranslater {
Optional<CellTemplateConfig> modelItem = configList.stream().filter(x -> x.getDataSourceType().equals(CellDataSourceType.RelatedModel.getCode())).findFirst();
if (modelItem.isPresent()) {
cellTemplateConfigDto.setHasModel(true);
cellTemplateConfigDto.setModelIDs(GetList(modelItem.get().getModelIDs()));
cellTemplateConfigDto.setModelIDs(getList(modelItem.get().getModelIDs()));
}
Optional<CellTemplateConfig> validationItem = configList.stream().filter(x -> x.getDataSourceType().equals(CellDataSourceType.Validation.getCode())).findFirst();
......@@ -105,7 +105,7 @@ public final class CellConfigTranslater {
return cellTemplateConfigDto;
}
private static List<String> GetList(String joinString) {
private static List<String> getList(String joinString) {
if (StringUtils.isEmpty(joinString)) {
return null;
}
......
......@@ -2,6 +2,7 @@ package pwc.taxtech.atms.service.impl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import pwc.taxtech.atms.common.ApplyScope;
import pwc.taxtech.atms.common.CommonUtils;
......@@ -34,7 +35,7 @@ public class CellTemplateServiceImpl extends AbstractService implements CellTemp
List<CellTemplateConfigDto> rData = new ArrayList<>();
for (CellTemplate x : cellTemplateList) {
rData.add(GetConfigDto(x, configList.stream().filter(a -> a.getCellTemplateID().equalsIgnoreCase(x.getID())).collect(Collectors.toList())));
rData.add(getConfigDto(x, configList.stream().filter(a -> a.getCellTemplateID().equalsIgnoreCase(x.getID())).collect(Collectors.toList())));
}
if (rData.size() > 0) {
......@@ -59,7 +60,7 @@ public class CellTemplateServiceImpl extends AbstractService implements CellTemp
CellTemplateConfigExample example = new CellTemplateConfigExample();
example.createCriteria().andCellTemplateIDEqualTo(cellTemplateID);
List<CellTemplateConfig> configList = cellTemplateConfigMapper.selectByExample(example);
result.setData(GetConfigDto(config, configList));
result.setData(getConfigDto(config, configList));
if (result.getData() == null) {
result.setResultMsg("NoData");
......@@ -71,7 +72,7 @@ public class CellTemplateServiceImpl extends AbstractService implements CellTemp
}
@Override
@Transactional
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
public OperationResultDto saveOrEdit(CellTemplateConfigDto cellTemplateConfig) {
OperationResultDto result = new OperationResultDto();
CellTemplate cellTemplate = cellTemplateMapper.selectByPrimaryKey(cellTemplateConfig.getCellTemplateID());
......@@ -93,12 +94,12 @@ public class CellTemplateServiceImpl extends AbstractService implements CellTemp
}
List<String> keyValues = new ArrayList<>();
OperationResultDto<List<CellTemplateConfig>> configResult = GetConfigList(cellTemplateConfig, keyValues);
OperationResultDto<List<CellTemplateConfig>> configResult = getConfigList(cellTemplateConfig, keyValues);
if (configResult.getResult()) {
configResult.getData().forEach(a -> cellTemplateConfigMapper.insert(a));
}
if (keyValues != null && keyValues.size() > 0) {
if (keyValues.size() > 0) {
keyValues.forEach(a -> {
KeyValueReference keyValueReferenceData = new KeyValueReference();
keyValueReferenceData.setID(CommonUtils.getUUID());
......@@ -113,12 +114,12 @@ public class CellTemplateServiceImpl extends AbstractService implements CellTemp
return result;
}
private OperationResultDto<List<CellTemplateConfig>> GetConfigList(CellTemplateConfigDto cellTemplateConfigDto, List<String> keyValueIds) {
private OperationResultDto<List<CellTemplateConfig>> getConfigList(CellTemplateConfigDto cellTemplateConfigDto, List<String> keyValueIds) {
OperationResultDto<List<CellTemplateConfig>> operationResultDto = new OperationResultDto<>();
List<CellTemplateConfig> cellTemplateConfigList = new ArrayList<>();
if (cellTemplateConfigDto.getHasFormula()) {
operationResultDto.setResultMsg(GetFormulaDataSource(cellTemplateConfigDto.getFormula(), keyValueIds));
operationResultDto.setResultMsg(getFormulaDataSource(cellTemplateConfigDto.getFormula(), keyValueIds));
CellTemplateConfig cellTemplateConfig = new CellTemplateConfig();
cellTemplateConfig.setID(CommonUtils.getUUID());
cellTemplateConfig.setCellTemplateID(cellTemplateConfigDto.getCellTemplateID());
......@@ -145,7 +146,7 @@ public class CellTemplateServiceImpl extends AbstractService implements CellTemp
cellTemplateConfig.setCreateTime(new Date());
cellTemplateConfig.setDataSourceType(CellDataSourceType.Voucher.getCode());
cellTemplateConfig.setVoucherKeyword(cellTemplateConfigDto.getVoucherKeyword());
cellTemplateConfig.setAccountCodes(GetJoinString(cellTemplateConfigDto.getAccountCodes()));
cellTemplateConfig.setAccountCodes(getJoinString(cellTemplateConfigDto.getAccountCodes()));
cellTemplateConfigList.add(cellTemplateConfig);
}
......@@ -161,8 +162,8 @@ public class CellTemplateServiceImpl extends AbstractService implements CellTemp
cellTemplateConfig.setDataSourceType(getInvoiceType(cellTemplateConfigDto.getInvoiceType()).getCode());
cellTemplateConfig.setInvoiceType(cellTemplateConfigDto.getInvoiceType());
cellTemplateConfig.setInvoiceAmountType(cellTemplateConfigDto.getInvoiceAmountType());
cellTemplateConfig.setTaxRate(GetJoinString(cellTemplateConfigDto.getTaxRate()));
cellTemplateConfig.setInvoiceCategory(GetJoinString(cellTemplateConfigDto.getInvoiceCategory().stream().map(String::valueOf).collect(Collectors.toList())));
cellTemplateConfig.setTaxRate(getJoinString(cellTemplateConfigDto.getTaxRate()));
cellTemplateConfig.setInvoiceCategory(getJoinString(cellTemplateConfigDto.getInvoiceCategory().stream().map(String::valueOf).collect(Collectors.toList())));
cellTemplateConfigList.add(cellTemplateConfig);
}
......@@ -189,7 +190,7 @@ public class CellTemplateServiceImpl extends AbstractService implements CellTemp
cellTemplateConfig.setUpdateTime(new Date());
cellTemplateConfig.setCreateTime(new Date());
cellTemplateConfig.setDataSourceType(CellDataSourceType.RelatedModel.getCode());
cellTemplateConfig.setModelIDs(GetJoinString(cellTemplateConfigDto.getModelIDs()));
cellTemplateConfig.setModelIDs(getJoinString(cellTemplateConfigDto.getModelIDs()));
cellTemplateConfigList.add(cellTemplateConfig);
}
......@@ -217,22 +218,22 @@ public class CellTemplateServiceImpl extends AbstractService implements CellTemp
return CellDataSourceType.InputInvoice;
}
if (invoiceType.intValue() == 1) {
if (invoiceType == 1) {
return CellDataSourceType.InputInvoice;
} else if (invoiceType.intValue() == 2) {
} else if (invoiceType == 2) {
return CellDataSourceType.OutputInvoice;
} else if (invoiceType.intValue() == 3) {
} else if (invoiceType == 3) {
return CellDataSourceType.CustomInvoice;
}
return CellDataSourceType.InputInvoice;
}
private String GetJoinString(List<String> array) {
private String getJoinString(List<String> array) {
if (array != null && array.size() > 0) {
StringBuilder sb = new StringBuilder();
for (String s : array) {
sb.append(s + ",");
sb.append(s).append(",");
}
String tempStr = sb.toString();
return tempStr.substring(0, tempStr.length() - 2);
......@@ -241,13 +242,13 @@ public class CellTemplateServiceImpl extends AbstractService implements CellTemp
return null;
}
private String GetFormulaDataSource(String formula, List<String> keyValueConfigIDs) {
private String getFormulaDataSource(String formula, List<String> keyValueConfigIDs) {
FormulaConfigExample example = new FormulaConfigExample();
example.setOrderByClause("LENGTH(FormulaName) desc");
List<FormulaConfig> dataSourceList = formulaConfigMapper.selectByExample(example);
List<String> nameList = new ArrayList<>();
FormulaHelper formulaHelper = new FormulaHelper();
String tmpFormula = formulaHelper.FormatFormula(formula).toUpperCase();
String tmpFormula = formulaHelper.formatFormula(formula).toUpperCase();
for (FormulaConfig dataSource : dataSourceList) {
if (tmpFormula.contains(dataSource.getFormulaName().toUpperCase() + "(") && !nameList.contains(dataSource.getDataSourceName())) {
......@@ -283,8 +284,8 @@ public class CellTemplateServiceImpl extends AbstractService implements CellTemp
}
}
private CellTemplateConfigDto GetConfigDto(CellTemplate cellTemplate, List<CellTemplateConfig> configList) {
CellTemplateConfigDto cellTemplateConfigDto = CellConfigTranslater.GetConfigDto(cellTemplate, configList);
private CellTemplateConfigDto getConfigDto(CellTemplate cellTemplate, List<CellTemplateConfig> configList) {
CellTemplateConfigDto cellTemplateConfigDto = CellConfigTranslater.getConfigDto(cellTemplate, configList);
cellTemplateConfigDto.setCellTemplateID(cellTemplate.getID());
cellTemplateConfigDto.setTemplateID(cellTemplate.getReportTemplateID());
cellTemplateConfigDto.setRowIndex(cellTemplate.getRowIndex());
......
......@@ -52,6 +52,7 @@ public class EnterpriseAccountSetServiceImpl implements EnterpriseAccountSetServ
* @see pwc.taxtech.atms.service.EnterpriseAccountSetService#
* getEnterpriseAccountSetList()
*/
@Override
public List<EnterpriseAccountSetDto> getEnterpriseAccountSetList() {
EnterpriseAccountSetExample example = new EnterpriseAccountSetExample();
......@@ -169,6 +170,7 @@ public class EnterpriseAccountSetServiceImpl implements EnterpriseAccountSetServ
/* (non-Javadoc)
* @see pwc.taxtech.atms.service.EnterpriseAccountService#enterpriseAccountSetNameValidate(pwc.taxtech.atms.service.dto.EnterpriseAccountSetDto)
*/
@Override
public OperationResultDto<?> enterpriseAccountSetNameValidate(EnterpriseAccountSetDto enterpriseAccountSetDto) {
EnterpriseAccountSetExample example = new EnterpriseAccountSetExample();
......@@ -188,6 +190,7 @@ public class EnterpriseAccountSetServiceImpl implements EnterpriseAccountSetServ
/* (non-Javadoc)
* @see pwc.taxtech.atms.service.EnterpriseAccountService#enterpriseAccountSetCodeValidate(pwc.taxtech.atms.service.dto.EnterpriseAccountSetDto)
*/
@Override
public OperationResultDto<?> enterpriseAccountSetCodeValidate(EnterpriseAccountSetDto enterpriseAccountSetDto) {
EnterpriseAccountSetExample example = new EnterpriseAccountSetExample();
......
......@@ -21,7 +21,7 @@ public final class FormulaHelper {
keyValuePattern = Pattern.compile(strKeyValuePattern);
}
public String FormatFormula(String formula) {
public String formatFormula(String formula) {
Matcher equalMatchResult = equalPattern.matcher(formula);
Stack<RegexMatchObject> equalMatchObjectStack = new Stack<>();
while (equalMatchResult.find()) {
......
......@@ -13,11 +13,11 @@ import pwc.taxtech.atms.service.ModelConfigurationService;
public class ModelConfigurationServiceImpl extends AbstractService implements ModelConfigurationService {
@Override
public List<ModelProfileDto> GetModelListByIndustry(String serviceTypeID, String industryID) {
Map<String,Object> map = new HashMap<>();
public List<ModelProfileDto> getModelListByIndustry(String serviceTypeID, String industryID) {
Map<String,Object> map = new HashMap<>(2);
map.put("serviceTypeID",serviceTypeID);
map.put("industryID",industryID);
return modelConfigMapper.GetModelListByIndustry(map);
return modelConfigMapper.getModelListByIndustry(map);
}
}
......@@ -450,8 +450,8 @@ public class OperationLogServiceImpl extends AbstractService implements Operatio
}
@Override
public void AddDataAddLog(Object newObj, OperationModule operationModule, String userName, String operationDesc,
String operationContent, String OperationObject, OperateLogType logType) {
public void addDataAddLog(Object newObj, OperationModule operationModule, String userName, String operationDesc,
String operationContent, String OperationObject, OperateLogType logType) {
OperationLogDto addLog = new OperationLogDto();
addLog.setID(CommonUtils.getUUID());
......@@ -470,8 +470,8 @@ public class OperationLogServiceImpl extends AbstractService implements Operatio
}
@Override
public void UpdateDataAddLog(Object originalObj, Object updateObj, OperationModule operationModule, String userName,
String comment, String operationObject, String operationContent, OperateLogType logType) {
public void updateDataAddLog(Object originalObj, Object updateObj, OperationModule operationModule, String userName,
String comment, String operationObject, String operationContent, OperateLogType logType) {
UpdateLogParams params = new UpdateLogParams();
params.setOriginalState(originalObj);
params.setOperationContent(operationContent);
......@@ -486,8 +486,8 @@ public class OperationLogServiceImpl extends AbstractService implements Operatio
}
@Override
public void DeleteDataAddLog(Object deleteObj, OperationModule operationModule, String userName, String comment,
String operationContent, String OperationObject, OperateLogType logType) {
public void deleteDataAddLog(Object deleteObj, OperationModule operationModule, String userName, String comment,
String operationContent, String OperationObject, OperateLogType logType) {
OperationLogDto addLog = new OperationLogDto();
addLog.setID(CommonUtils.getUUID());
addLog.setOperationContent(operationContent);
......
......@@ -11,7 +11,7 @@ import pwc.taxtech.atms.service.ProjectIndustryService;
public class ProjectIndustryServiceImpl extends AbstractService implements ProjectIndustryService {
@Override
public List<Industry> GetAllAvailableIndustry() {
return industryMapper.GetAllAvailableIndustry();
public List<Industry> getAllAvailableIndustry() {
return industryMapper.getAllAvailableIndustry();
}
}
......@@ -92,10 +92,10 @@ public class RuleEngineeConfigServiceImpl extends AbstractService implements Rul
taxRuleSetting.setCreateTime(new Date());
taxRuleSetting.setUpdateTime(new Date());
if (trso.getAction().equals("Add")) {
if ("Add".equals(trso.getAction())) {
SaveTaxRuleSettingOrg(trso, taxRuleSetting, authUserHelper.getCurrentUserID(), null);
taxRuleSettingMapper.insert(taxRuleSetting);
} else if (trso.getAction().equals("Update")) {
} else if ("Update".equals(trso.getAction())) {
TaxRuleSettingOrganizationExample trsoExample = new TaxRuleSettingOrganizationExample();
trsoExample.createCriteria().andOrganizationIDEqualTo(taxRuleSetting.getID());
taxRuleSettingOrganizationMapper.deleteByExample(trsoExample);
......@@ -109,13 +109,13 @@ public class RuleEngineeConfigServiceImpl extends AbstractService implements Rul
old.setCreateTime(taxRuleSetting.getCreateTime());
old.setUpdateTime(taxRuleSetting.getUpdateTime());
taxRuleSettingMapper.updateByPrimaryKey(old);
} else if (trso.getAction().equals("Delete")) {
} else if ("Delete".equals(trso.getAction())) {
TaxRuleSettingOrganizationExample trsoExample = new TaxRuleSettingOrganizationExample();
trsoExample.createCriteria().andOrganizationIDEqualTo(taxRuleSetting.getID());
taxRuleSettingOrganizationMapper.deleteByExample(trsoExample);
taxRuleSettingMapper.deleteByPrimaryKey(taxRuleSetting.getID());
operationService.DeleteDataAddLog(taxRuleSetting, OperationModule.RuleEngineConfig, authUserHelper.getCurrentUserID(),
operationService.deleteDataAddLog(taxRuleSetting, OperationModule.RuleEngineConfig, authUserHelper.getCurrentUserID(),
"DeleteRuleEngineConfiguration", "", taxRuleSetting.getName(),
OperateLogType.OperationLogRuleEngine);
}
......@@ -127,19 +127,19 @@ public class RuleEngineeConfigServiceImpl extends AbstractService implements Rul
CommonUtils.copyProperties(reportDto, taxPayerReportRule);
StringBuilder sb = new StringBuilder();
for(String s: reportDto.getOrgs()){
sb.append(s+",");
sb.append(s).append(",");
}
String tempStr = sb.toString();
taxPayerReportRule.setOrganizationID(tempStr.substring(0,tempStr.length()-2));
taxPayerReportRule.setCreateTime(new Date());
taxPayerReportRule.setUpdateTime(new Date());
SaveOrganizationServiceTemplateGroup(taxPayerReportRule,tprrdo.getAction());
if(tprrdo.getAction().equals("Add")) {
if("Add".equals(tprrdo.getAction())) {
taxPayerReportRuleMapper.insert(taxPayerReportRule);
operationService.AddDataAddLog(taxPayerReportRule, OperationModule.RuleEngineConfig, authUserHelper.getCurrentUserID(),
operationService.addDataAddLog(taxPayerReportRule, OperationModule.RuleEngineConfig, authUserHelper.getCurrentUserID(),
"AddRuleEngineConfiguration", "纳税类型", "纳税类型添加特殊机构", OperateLogType.OperationLogRuleEngine);
}
else if(tprrdo.getAction().equals("Update")) {
else if("Update".equals(tprrdo.getAction())) {
TaxPayerReportRule old = taxPayerReportRuleMapper.selectByPrimaryKey(reportDto.getID());
TaxPayerReportRule original = new TaxPayerReportRule();
CommonUtils.copyProperties(old, original);
......@@ -152,13 +152,13 @@ public class RuleEngineeConfigServiceImpl extends AbstractService implements Rul
old.setUpdateTime(taxPayerReportRule.getUpdateTime());
taxPayerReportRuleMapper.updateByPrimaryKey(old);
operationService.UpdateDataAddLog(original, taxPayerReportRule, OperationModule.RuleEngineConfig, authUserHelper.getCurrentUserID(),
operationService.updateDataAddLog(original, taxPayerReportRule, OperationModule.RuleEngineConfig, authUserHelper.getCurrentUserID(),
"UpdateRuleEngineConfiguration", "纳税类型", taxPayerReportRule.getIsDefault() ? "默认纳税类型或默认纳税报表" : "纳税类型更新特殊机构", OperateLogType.OperationLogRuleEngine);
}
else if(tprrdo.getAction().equals("Delete")) {
else if("Delete".equals(tprrdo.getAction())) {
taxPayerReportRuleMapper.deleteByPrimaryKey(taxPayerReportRule.getID());
operationService.DeleteDataAddLog(reportDto, OperationModule.RuleEngineConfig, authUserHelper.getCurrentUserID(),
operationService.deleteDataAddLog(reportDto, OperationModule.RuleEngineConfig, authUserHelper.getCurrentUserID(),
"DeleteRuleEngineConfiguration", "纳税类型", "纳税类型删除特殊机构", OperateLogType.OperationLogRuleEngine);
}
}
......@@ -173,14 +173,14 @@ public class RuleEngineeConfigServiceImpl extends AbstractService implements Rul
trso.setTaxSettingID(taxRuleSetting.getID());
trso.setUpdateTime(new Date());
trso.setCreateTime(new Date());
if (taxRuleSettingOperation.getAction().equals("Add")) {
operationLogService.AddDataAddLog(taxRuleSetting, OperationModule.RuleEngineConfig, userName,
if ("Add".equals(taxRuleSettingOperation.getAction())) {
operationLogService.addDataAddLog(taxRuleSetting, OperationModule.RuleEngineConfig, userName,
"AddRuleEngineConfiguration", taxRuleSetting.getName() + org, taxRuleSetting.getName(),
OperateLogType.OperationLogRuleEngine);
} else {
TaxRuleSetting original = new TaxRuleSetting();
CommonUtils.copyProperties(old, original);
operationService.UpdateDataAddLog(original, taxRuleSetting, OperationModule.RuleEngineConfig, userName,
operationService.updateDataAddLog(original, taxRuleSetting, OperationModule.RuleEngineConfig, userName,
"UpdateRuleEngineConfiguration", taxRuleSetting.getName(),
taxRuleSetting.getIsDefault() ? "默认税基或默认税率" : taxRuleSetting.getName(),
OperateLogType.OperationLogRuleEngine);
......@@ -193,10 +193,8 @@ public class RuleEngineeConfigServiceImpl extends AbstractService implements Rul
example.createCriteria().andOrganizationIDEqualTo(taxPayerReportRule.getOrganizationID()).andServiceTypeIDEqualTo("2");
Optional<OrganizationServiceTemplateGroup> thisOrgTemplate = organizationServiceTemplateGroupMapper.selectByExample(example).stream().findFirst();
if(action.equals("Delete")) {
if(thisOrgTemplate.isPresent()) {
organizationServiceTemplateGroupMapper.deleteByPrimaryKey(thisOrgTemplate.get().getID());
}
if("Delete".equals(action)) {
thisOrgTemplate.ifPresent(organizationServiceTemplateGroup -> organizationServiceTemplateGroupMapper.deleteByPrimaryKey(organizationServiceTemplateGroup.getID()));
}
else
{
......
......@@ -12,7 +12,7 @@ import pwc.taxtech.atms.service.ServiceTypeService;
public class ServiceTypeServiceImpl extends AbstractService implements ServiceTypeService {
@Override
public List<ServiceType> GetServiceTypes() {
public List<ServiceType> getServiceTypes() {
return serviceTypeMapper.selectByExample(new ServiceTypeExample());
}
......
......@@ -102,7 +102,7 @@ public class StdAccountServiceImpl extends BaseService implements StdAccountServ
}
@Override
public List<StandardAccountDto> GetStdAccountByIndustry(String industryID) {
public List<StandardAccountDto> getStdAccountByIndustry(String industryID) {
StandardAccountExample example = new StandardAccountExample();
example.createCriteria().andRuleTypeEqualTo((int)StandAccountConstant.TWO).andIsActiveEqualTo(ActiveStatus.Active).andIndustryIDEqualTo(industryID);
......
......@@ -8,12 +8,12 @@ import pwc.taxtech.atms.service.TemplateFormulaService;
@Service
public class TemplateFormulaServiceImpl extends AbstractService implements TemplateFormulaService {
private FormulaHelper _formulaHelper = new FormulaHelper();
private FormulaHelper formulaHelper = new FormulaHelper();
//private static ScriptEngine m_engine = Python.CreateEngine();
@Override
public OperationResultDto Validate(String formula) {
public OperationResultDto validate(String formula) {
OperationResultDto result = new OperationResultDto();
if (StringUtils.isBlank(formula)) {
......@@ -22,7 +22,7 @@ public class TemplateFormulaServiceImpl extends AbstractService implements Templ
}
try {
String tidyFormula = _formulaHelper.FormatFormula(formula);
String tidyFormula = formulaHelper.formatFormula(formula);
/*todo: find the replace solution for here to check formual is correct or not
//var sourceCode = m_engine.CreateScriptSourceFromString(tidyFormula, SourceCodeKind.AutoDetect);
......
......@@ -6,6 +6,7 @@ import org.springframework.transaction.annotation.Transactional;
import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.dto.*;
import pwc.taxtech.atms.entitiy.CellTemplate;
import pwc.taxtech.atms.entitiy.CellTemplateExample;
import pwc.taxtech.atms.entitiy.Template;
import pwc.taxtech.atms.entitiy.TemplateExample;
......@@ -18,7 +19,6 @@ import static java.util.stream.Collectors.groupingBy;
@Service
public class TemplateServiceImpl extends AbstractService implements TemplateService {
private final String PREFIX_VALUE = "~";
@Override
public List<TemplateDto> get(String templateGroupID, Integer reportType) {
......@@ -49,6 +49,7 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
Template template = templateMapper.selectByPrimaryKey(templateID);
if (template != null) {
String PREFIX_VALUE = "~";
if (template.getPath().startsWith(PREFIX_VALUE)) {
result = template.getPath().substring(1, template.getPath().length());
} else {
......@@ -188,6 +189,37 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
return result;
}
@Override
public OperationResultDto setRowColName(String id, List<CellBriefDto> cellInfo) {
OperationResultDto result = new OperationResultDto();
CellTemplateExample example = new CellTemplateExample();
example.createCriteria().andReportTemplateIDEqualTo(id);
example.setOrderByClause("ColumnIndex,RowIndex");
List<CellTemplate> cellTemplates = cellTemplateMapper.selectByExample(example);
for (CellTemplate cellTemplate : cellTemplates) {
boolean isUpdate = false;
Optional<CellBriefDto> rowNameCell = cellInfo.stream().filter(a -> a.getRowIndex() == cellTemplate.getRowIndex()).findFirst();
if (rowNameCell.isPresent()) {
cellTemplate.setRowName(rowNameCell.get().getValue());
isUpdate = true;
}
Optional<CellBriefDto> colNameCell = cellInfo.stream().filter(a -> a.getColumnIndex() == cellTemplate.getColumnIndex()).findFirst();
if (colNameCell.isPresent()) {
cellTemplate.setColumnName(colNameCell.get().getValue());
isUpdate = true;
}
if (isUpdate) {
cellTemplateMapper.updateByPrimaryKey(cellTemplate);
}
}
result.setResult(true);
return result;
}
private void logicDeleteIsActiveAssociation(Template templateDb) {
templateDb.setIsActiveAssociation(false);
templateMapper.updateByPrimaryKeySelective(templateDb);
......
package pwc.taxtech.atms.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import org.apache.commons.lang3.BooleanUtils;
import org.nutz.lang.Strings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.util.StringUtils;
import pwc.taxtech.atms.common.ApplicationException;
import pwc.taxtech.atms.common.CommonConstants;
import pwc.taxtech.atms.common.CommonUtils;
......@@ -36,42 +28,21 @@ import pwc.taxtech.atms.dto.organization.OrgRoleDtoList;
import pwc.taxtech.atms.dto.organization.OrganizationDto;
import pwc.taxtech.atms.dto.organization.SimpleRoleDto;
import pwc.taxtech.atms.dto.role.RoleDto;
import pwc.taxtech.atms.dto.user.DimensionUser;
import pwc.taxtech.atms.dto.user.NameDto;
import pwc.taxtech.atms.dto.user.OrganizationRoleInfo;
import pwc.taxtech.atms.dto.user.RoleInfo;
import pwc.taxtech.atms.dto.user.UpdateParam;
import pwc.taxtech.atms.dto.user.UserAndUserRoleSaveDto;
import pwc.taxtech.atms.dto.user.UserDto;
import pwc.taxtech.atms.dto.user.UserOrgDto;
import pwc.taxtech.atms.dto.user.UserOrgRoleDto;
import pwc.taxtech.atms.dto.user.UserOrganizationDto;
import pwc.taxtech.atms.dto.user.UserRoleDimensionValueDto;
import pwc.taxtech.atms.dto.user.UserRoleDisplayInfo;
import pwc.taxtech.atms.dto.user.UserRoleQuery;
import pwc.taxtech.atms.dto.user.UserRoleQueryDto;
import pwc.taxtech.atms.entitiy.Organization;
import pwc.taxtech.atms.entitiy.Role;
import pwc.taxtech.atms.entitiy.User;
import pwc.taxtech.atms.entitiy.UserDimensionValue;
import pwc.taxtech.atms.entitiy.UserDimensionValueExample;
import pwc.taxtech.atms.entitiy.UserDimensionValueOrg;
import pwc.taxtech.atms.entitiy.UserDimensionValueOrgExample;
import pwc.taxtech.atms.entitiy.UserDimensionValueRole;
import pwc.taxtech.atms.entitiy.UserDimensionValueRoleExample;
import pwc.taxtech.atms.entitiy.UserExample;
import pwc.taxtech.atms.entitiy.UserOrganization;
import pwc.taxtech.atms.entitiy.UserOrganizationExample;
import pwc.taxtech.atms.entitiy.UserOrganizationRole;
import pwc.taxtech.atms.entitiy.UserOrganizationRoleExample;
import pwc.taxtech.atms.entitiy.UserRole;
import pwc.taxtech.atms.entitiy.UserRoleExample;
import pwc.taxtech.atms.dto.user.*;
import pwc.taxtech.atms.entitiy.*;
import pwc.taxtech.atms.entitiy.UserRoleExample.Criteria;
import pwc.taxtech.atms.service.OrganizationService;
import pwc.taxtech.atms.service.PermissionService;
import pwc.taxtech.atms.service.UserRoleService;
import pwc.taxtech.atms.service.UserService;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
@Service
public class UserRoleServiceImpl extends AbstractService implements UserRoleService {
......@@ -1679,4 +1650,9 @@ public class UserRoleServiceImpl extends AbstractService implements UserRoleServ
result.setResult(true);
return result;
}
@Override
public UserDto GetUserByUserName(UserDto userParam) {
return userService.getUserByDto(userParam);
}
}
package pwc.taxtech.atms.service.impl;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import org.apache.commons.lang3.BooleanUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -15,84 +8,35 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import com.alibaba.fastjson.JSON;
import pwc.taxtech.atms.common.ApplicationException;
import pwc.taxtech.atms.common.AuthUserHelper;
import pwc.taxtech.atms.common.CheckState;
import pwc.taxtech.atms.common.CommonConstants;
import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.OperateLogType;
import pwc.taxtech.atms.common.OperationAction;
import pwc.taxtech.atms.common.OperationModule;
import pwc.taxtech.atms.common.UserLoginType;
import pwc.taxtech.atms.common.UserStatus;
import pwc.taxtech.atms.common.*;
import pwc.taxtech.atms.common.message.UserMessage;
import pwc.taxtech.atms.constant.DimensionConstant;
import pwc.taxtech.atms.constant.PermissionCode;
import pwc.taxtech.atms.constant.PermissionUrl;
import pwc.taxtech.atms.dao.PermissionMapper;
import pwc.taxtech.atms.dao.RoleMapper;
import pwc.taxtech.atms.dao.RolePermissionMapper;
import pwc.taxtech.atms.dao.UserMapper;
import pwc.taxtech.atms.dao.UserOrganizationMapper;
import pwc.taxtech.atms.dao.UserRoleMapper;
import pwc.taxtech.atms.dto.AtmsTokenDto;
import pwc.taxtech.atms.dto.LogOnDto;
import pwc.taxtech.atms.dto.LoginInputDto;
import pwc.taxtech.atms.dto.LoginOutputDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.UpdateLogParams;
import pwc.taxtech.atms.dao.*;
import pwc.taxtech.atms.dto.*;
import pwc.taxtech.atms.dto.organization.DimensionRoleDto;
import pwc.taxtech.atms.dto.organization.OrgCustomDto;
import pwc.taxtech.atms.dto.organization.SimpleRoleDto;
import pwc.taxtech.atms.dto.permission.OrganizationPermissionDto;
import pwc.taxtech.atms.dto.permission.OrganizationPermissionKeyDto;
import pwc.taxtech.atms.dto.permission.PermissionDto;
import pwc.taxtech.atms.dto.permission.PermissionKeyDto;
import pwc.taxtech.atms.dto.permission.UserPermissionDto;
import pwc.taxtech.atms.dto.permission.UserPermissionKeyDto;
import pwc.taxtech.atms.dto.user.RoleInfo;
import pwc.taxtech.atms.dto.user.UserAndUserRoleSaveDto;
import pwc.taxtech.atms.dto.user.UserDto;
import pwc.taxtech.atms.dto.user.UserPasswordDto;
import pwc.taxtech.atms.dto.user.UserRoleDimensionValueDto;
import pwc.taxtech.atms.dto.user.UserRoleInfo;
import pwc.taxtech.atms.dto.user.VMUser;
import pwc.taxtech.atms.dto.user.WebUserDto;
import pwc.taxtech.atms.entitiy.Menu;
import pwc.taxtech.atms.entitiy.Permission;
import pwc.taxtech.atms.entitiy.PermissionExample;
import pwc.taxtech.atms.entitiy.Role;
import pwc.taxtech.atms.entitiy.RoleExample;
import pwc.taxtech.atms.entitiy.RolePermission;
import pwc.taxtech.atms.entitiy.RolePermissionExample;
import pwc.taxtech.atms.entitiy.User;
import pwc.taxtech.atms.entitiy.UserDimensionValue;
import pwc.taxtech.atms.entitiy.UserDimensionValueExample;
import pwc.taxtech.atms.entitiy.UserDimensionValueRole;
import pwc.taxtech.atms.entitiy.UserDimensionValueRoleExample;
import pwc.taxtech.atms.entitiy.UserExample;
import pwc.taxtech.atms.entitiy.UserOrganization;
import pwc.taxtech.atms.entitiy.UserOrganizationExample;
import pwc.taxtech.atms.entitiy.UserOrganizationRole;
import pwc.taxtech.atms.entitiy.UserOrganizationRoleExample;
import pwc.taxtech.atms.entitiy.UserRole;
import pwc.taxtech.atms.entitiy.UserRoleExample;
import pwc.taxtech.atms.dto.permission.*;
import pwc.taxtech.atms.dto.user.*;
import pwc.taxtech.atms.entitiy.*;
import pwc.taxtech.atms.entitiy.UserRoleExample.Criteria;
import pwc.taxtech.atms.security.AtmsPasswordEncoder;
import pwc.taxtech.atms.security.JwtUtil;
import pwc.taxtech.atms.security.LdapAuthenticationProvider;
import pwc.taxtech.atms.service.MenuService;
import pwc.taxtech.atms.service.OperationLogService;
import pwc.taxtech.atms.service.OrganizationService;
import pwc.taxtech.atms.service.RoleService;
import pwc.taxtech.atms.service.UserAccountService;
import pwc.taxtech.atms.service.UserRoleService;
import pwc.taxtech.atms.service.UserService;
/** @see PwC.Tax.Tech.Atms..Admin.Application\Services\Impl\UserService.cs */
import pwc.taxtech.atms.service.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import static java.util.stream.Collectors.toList;
/**
* @see PwC.Tax.Tech.Atms..Admin.Application\Services\Impl\UserService.cs
*/
@Service
public class UserServiceImpl extends AbstractService implements UserService {
private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);
......@@ -275,7 +219,7 @@ public class UserServiceImpl extends AbstractService implements UserService {
}
private List<OrganizationPermissionDto> getOrganizationPermissionList(User user,
List<RolePermission> rolePermissionList, List<Permission> permissionList) {
List<RolePermission> rolePermissionList, List<Permission> permissionList) {
VMUser vmUser = new VMUser();
vmUser.setID(user.getID());
vmUser.setEmail(user.getEmail());
......@@ -324,7 +268,7 @@ public class UserServiceImpl extends AbstractService implements UserService {
}
private List<OrganizationPermissionKeyDto> getOrganizationPermissionKeyList(User user,
List<RolePermission> rolePermissionList, List<Permission> permissionList) {
List<RolePermission> rolePermissionList, List<Permission> permissionList) {
VMUser vmUser = new VMUser();
vmUser.setID(user.getID());
vmUser.setEmail(user.getEmail());
......@@ -809,7 +753,7 @@ public class UserServiceImpl extends AbstractService implements UserService {
}
private UpdateLogParams generateUpdateLogParams(Integer logType, String operationContent, String operationObject,
Integer action, Integer module) {
Integer action, Integer module) {
UpdateLogParams updateLogParams = new UpdateLogParams();
updateLogParams.setOperateLogType(logType);
updateLogParams.setOperationContent(operationContent);
......@@ -828,6 +772,21 @@ public class UserServiceImpl extends AbstractService implements UserService {
return userOrganizationMapper.selectByExample(userOrganizationExample);
}
@Override
public UserDto getUserByDto(UserDto userParam) {
User user = userMapper.selectByUserName(userParam.getUserName());
UserDto dto = null;
if (user != null) {
dto = new UserDto();
try {
FieldsMapper.map(user, dto);
} catch (Exception e) {
throw new ApplicationException("server internal error");
}
}
return dto;
}
private List<UserRole> findUserRoleByUserIDWithoutProjectID(String userID) {
UserRoleExample userRoleExample = new UserRoleExample();
Criteria criteria = userRoleExample.createCriteria();
......
......@@ -250,7 +250,7 @@
</if>
</select>
<select id="GetAllAvailableIndustry" resultMap="BaseResultMap">
<select id="getAllAvailableIndustry" resultMap="BaseResultMap">
SELECT
*
FROM
......
......@@ -478,7 +478,7 @@
order by ${orderByClause}
</if>
</select>
<select id="SelectKeyValueConfigsByOrderByCreateTime" resultMap="BaseResultMap">
<select id="selectKeyValueConfigsByOrderByCreateTime" resultMap="BaseResultMap">
SELECT KeyValueConfig.ID,
KeyValueConfig.KeyCode,
KeyValueConfig.Name,
......
......@@ -274,7 +274,7 @@
order by ${orderByClause}
</if>
</select>
<resultMap id="GetModelListByIndustryResult" type="pwc.taxtech.atms.dto.ModelProfileDto">
<resultMap id="getModelListByIndustryResult" type="pwc.taxtech.atms.dto.ModelProfileDto">
<id column="ID" jdbcType="VARCHAR" property="ID" />
<result column="Name" jdbcType="VARCHAR" property="name" />
<result column="CategoryID" jdbcType="VARCHAR" property="categoryID" />
......@@ -293,7 +293,7 @@
<result column="ServiceTypeID" jdbcType="VARCHAR" property="serviceTypeID" />
<result column="ServiceTypeName" jdbcType="VARCHAR" property="serviceTypeName" />
</resultMap>
<select id="GetModelListByIndustry" parameterType="map" resultMap="GetModelListByIndustryResult">
<select id="getModelListByIndustry" parameterType="map" resultMap="getModelListByIndustryResult">
SELECT
m.ID,
m.Name,
......
......@@ -449,6 +449,7 @@
<select id="getCountOfTemplateAndGroupByTemplateName" parameterType="map" resultType="java.lang.Long">
SELECT COUNT(1) FROM Template p join TemplateGroup q on p.TemplateGroupID=q.ID
<where>
1=1
<if test="templateGroupID!=null">
AND q.ID = #{templateGroupID,jdbcType=VARCHAR}
</if>
......
......@@ -217,7 +217,7 @@ function ($rootScope, $log, $uibModal, $translate) {
IconsCellType.prototype = new GC.Spread.Sheets.CellTypes.Base();
IconsCellType.prototype.paint = function (ctx, value, x, y, w, h, style, context) {
GC.Spread.Sheets.CellTypes.Base.paint.call(this, ctx, value, x, y, w, h, style, context);
GC.Spread.Sheets.CellTypes.Base.prototype.paint.call(this, ctx, value, x, y, w, h, style, context);
for (var i = 1; i <= this.count; i++) {
//距离当前单元格左侧距离,距离顶部距离 , ICON宽度,ICON高度
ctx.drawImage(this.Icons[i-1], x + w - (h - 3) * i + (h - 6 - 18) * i, y + 3 + (h / 2 - 3 - 9), 18, 18);
......
......@@ -14,7 +14,7 @@ webservices.factory('projectService', ['$http', 'apiConfig', function ($http, ap
getAllProjectList: function (orgID, serviceID, projectYear) {
return $http.get('/project/getAllProjectList?orgID=' + orgID + '&serviceID=' + serviceID + '&projectYear=' + projectYear, apiConfig.create());
return $http.get('/project/getAllProjectList?orgID=' + orgID + '&serviceID=' + serviceID + (projectYear==null?'':'&projectYear=' + projectYear), apiConfig.create());
},
getProjectByID: function (projectID) {
return $http.get('/project/getProject?projectID=' + projectID, apiConfig.create());
......
// registration web service proxy
webservices.factory('serviceLogService', ['$http', 'apiConfig', function ($http, apiConfig) {
'use strict';
return {
addEnterProjectLog: function (userName, logContent) {
var config = { ignoreLoadingBar: true };
return $http.post('/operationlog/addEnterProjectLog/' + userName, angular.toJson(logContent), apiConfig.create(config));
}
};
}]);
\ No newline at end of file
......@@ -19,31 +19,31 @@ webservices.factory('templateService', ['$log', '$http', '$q', 'apiConfig', 'htt
var promise = deferred.promise;
var spread = new GC.Spread.Sheets.Workbook(document.getElementById(id));
spread.suspendPaint();
spread.fromJSON(ssjsondata);
spread.options.showVerticalScrollbar = true;
spread.options.showHorizontalScrollbar = true;
spread.options.scrollbarMaxAlign = true;
spread.options.scrollbarShowMax = true;
spread.options.tabNavigationVisible = true;
spread.options.newTabVisible = false;
spread.options.tabEditable = false;
spread.options.tabStripVisible = false;
spread.options.newTabVisible = false;
//spread.options.tabEditable = false;
//spread.options.tabStripVisible = false;
//spread.options.newTabVisible = false;
spread.options.allowUndo = false;
spread.options.allowUserResize = false;
spread.options.allowUserDragDrop = false;
spread.options.allowUserDragFill = false;
spread.options.allowUserEditFormula = false;
spread.suspendPaint();
spread.fromJSON(ssjsondata);
spread.options.allowContextMenu = false;
spread.resumePaint();
var sheet = spread.getActiveSheet();
var sheet = spread.getSheet(1);
if (sheet != null) {
sheet.options.rowHeaderVisible = true;
sheet.options.colHeaderVisible = true;
sheet.options.gridline.showVerticalGridline = false;
sheet.options.gridline.showHorizontalGridline = false;
sheet.options.isProtected = true;
}
deferred.resolve(spread);
......
frameworkModule.controller('appOverviewController', ['$rootScope', '$scope', '$timeout', '$q', '$log', '$translate', '$state', '$interval',
'uiGridConstants', 'projectService', 'vatSessionService', 'orgService', 'serviceTypeService', 'userService', 'loginContext', 'enums',
'citSessionService', 'region', 'SweetAlert', 'productService', 'localStorageService', 'assetsManageSessionService', 'serviceLogService',
'citSessionService', 'region', 'SweetAlert', 'productService', 'localStorageService', 'assetsManageSessionService',
'ackUibModal', 'Upload', 'apiInterceptor',
function ($rootScope, $scope, $timeout, $q, $log, $translate, $state, $interval, uiGridConstants, projectService, vatSessionService,
orgService, serviceTypeService, userService, loginContext, enums, citSessionService, region, SweetAlert, productService,
localStorageService, assetsManageSessionService, serviceLogService, ackUibModal, Upload, apiInterceptor) {
localStorageService, assetsManageSessionService, ackUibModal, Upload, apiInterceptor) {
'use strict';
$log.debug('appOverviewController.ctor()...');
var uploadUrl = apiInterceptor.webApiHostUrl + '/product/NewFile';
......
......@@ -556,8 +556,7 @@ var webservices = angular.module('app.webservices', ['app.common'])
}]);
// register framework module for application framework
var frameworkModule = angular.module('app.framework', ['app.webservices', 'app.common', 'app.vatDashboard',
'ui.dashboard' ])
var frameworkModule = angular.module('app.framework', ['app.webservices', 'app.common', 'app.vatDashboard', 'ui.dashboard'])
.run(['$log', function ($log) {
$log.debug('app.framework.run()...');
}])
......
This diff is collapsed.
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