Commit 0c45a713 authored by frank.xa.zhang's avatar frank.xa.zhang

fixed backend issue

parent c6d3e83a
......@@ -258,16 +258,16 @@ public class EnterpriseAccountManagerController {
@ResponseBody
@ApiOperation(value = "按组织机构查找")
@RequestMapping(value = "getEnterpriseAccountSetListByOrgId", method = RequestMethod.GET)
public List<EnterpriseAccountSetDto> getEnterpriseAccountSetListByOrgId(@RequestParam String orgId) {
@RequestMapping(value = "getEnterpriseAccountSetListByOrgID", method = RequestMethod.GET)
public List<EnterpriseAccountSetDto> getEnterpriseAccountSetListByOrgId(@RequestParam(name="orgID") String orgId) {
return enterpriseAccountService.getEnterpriseAccountSetListByOrgId(orgId);
}
@ResponseBody
@ApiOperation(value = "科目对应列表")
@RequestMapping(value = "getEnterpriseAccountList", method = RequestMethod.GET)
public List<EnterpriseAccountDto> getEnterpriseAccountList(@RequestParam String espId,
@RequestParam String orgId,
public List<EnterpriseAccountDto> getEnterpriseAccountList(@RequestParam(name="espID") String espId,
@RequestParam(name="orgID") String orgId,
@RequestParam String filterType) {
return enterpriseAccountService.getList(espId, orgId, filterType);
}
......
......@@ -232,7 +232,7 @@ public class OrganizationController {
@ApiOperation(value = "获取机构树信息", notes = "科目对应>复制对应关系>弹出层")
@RequestMapping(value = "getOrgIvhTreeList", method = RequestMethod.GET)
public List<DevTreeDto> getOrgIvhTreeList(@RequestParam("useType") Integer useType,
@RequestParam("orgSetId") String orgSetId) {
@RequestParam("orgSetID") String orgSetId) {
return organizationService.getOrgIvhTreeList(useType, orgSetId);
}
......
......@@ -35,7 +35,7 @@ public class PermissionController {
}
@ApiOperation(value = "通过传入的角色Id列表获取树形结构权限")
@RequestMapping(value = "getIvhTreePermissionsByRoleIdList", method = RequestMethod.POST)
@RequestMapping(value = "getIvhTreePermissionsByRoleIDList", method = RequestMethod.POST)
public @ResponseBody List<DevTreeDto> getIvhTreePermissionsByRoleIdList(@RequestBody List<String> roleIdList,
@RequestParam String serviceType) {
return permissionService.getIvhTreePermissionsByRoleIdList(roleIdList, serviceType);
......
......@@ -22,7 +22,7 @@ public class StdAccountController extends BaseController {
@ResponseBody
@ApiOperation(value = "获取科目层级")
@RequestMapping(value = "stdAccountHierarchy", method = RequestMethod.GET)
public List<StdAccountFancyTreeDto> getStdAccountHierarchy(@RequestParam String orgId) {
public List<StdAccountFancyTreeDto> getStdAccountHierarchy(@RequestParam(name="orgID") String orgId) {
if (StringUtils.isBlank(orgId)) {
return Collections.emptyList();
}
......
......@@ -59,12 +59,12 @@ public class EnterpriseAccountDao {
public List<EnterpriseAccountDto> getAccountMappingResult(String accountSetId, int ruleId, String industryId) {
//amk.IndustryId倒序排列可以保证在结果集中,同一个COA,本行业的匹配结果在通用关键字匹配结果之前出现
String sql = "SELECT a.Code, a.IsLeaf, sa.Code StdCode,a.FullName as AccountFullName, amk.FullName as MappingFullName,amk.IndustryId"
+ " FROM (select * from AccountMappingKeyword where IndustryId=?) amk "
+ " INNER JOIN (select * from StandardAccount where IndustryId=?) sa ON amk.StandardCode = sa.Code"
+ " INNER JOIN EnterpriseAccount a on a.FullName like amk.FullName"
+ " WHERE amk.RuleType = ? AND sa.IsLeaf = 1 AND a.EnterpriseAccountSetId=?"
+ " ORDER BY a.Code,amk.IndustryId DESC";
String sql = "SELECT a.Code, a.Is_Leaf, sa.Code StdCode,a.Full_Name as AccountFullName, amk.Full_Name as MappingFullName,amk.Industry_Id"
+ " FROM (select * from Account_Mapping_Keyword where Industry_Id=?) amk "
+ " INNER JOIN (select * from Standard_Account where Industry_Id=?) sa ON amk.Standard_Code = sa.Code"
+ " INNER JOIN Enterprise_Account a on a.Full_Name like amk.Full_Name"
+ " WHERE amk.Rule_Type = ? AND sa.Is_Leaf = 1 AND a.Enterprise_Account_Set_Id=?"
+ " ORDER BY a.Code,amk.Industry_Id DESC";
List<Map<String, Object>> queryList = jdbcTemplate.queryForList(sql, industryId, industryId, ruleId, accountSetId);
List<EnterpriseAccountDto> list = Lists.newArrayList();
......@@ -94,35 +94,35 @@ public class EnterpriseAccountDao {
List<String> whereList = Lists.newArrayList();
String sql = "SELECT * FROM ( " +
"SELECT CASE IsLeaf WHEN 0 THEN '+' ELSE '' END IsEx,Code, Name, FullName, " +
"SELECT CASE Is_Leaf WHEN 0 THEN '+' ELSE '' END IsEx,Code, Name, Full_Name, " +
"CASE Direction WHEN 1 THEN N'借方' WHEN -1 THEN N'贷方' END Direction, " +
"CASE StdAccountCode WHEN '0000' THEN '-' ELSE StdAccountCode END StdCode," +
"CASE StdAccountCode WHEN '0000' THEN '-' ELSE StdName END StdName, " +
"CASE StdAccountCode WHEN '0000' THEN '-' ELSE StdAccountCode + '/' + StdFullName END StdCodeName, " +
"CASE StdAccountCode WHEN '0000' THEN '-' ELSE CASE StdDirection WHEN 1 THEN N'借方' WHEN -1 THEN N'贷方' END END StdDirection, " +
"CASE WHEN AcctProp<>StdAcctProp THEN 1 ELSE 0 END IsAcctPropDiff," +
"CASE WHEN StdAccountCode IS NULL THEN 0 ELSE 1 END MappingStatus, " +
"CASE WHEN StdAccountCode IS NULL THEN AcctProp ELSE StdAcctProp END AcctProp, ParentCode, AcctLevel, StdAccountCode AcctStdCode, IsLeaf " +
" FROM (SELECT id,Code,Name,FullName,Direction,AcctProp,ParentCode,AcctLevel,IsLeaf FROM EnterpriseAccount WHERE EnterpriseAccountSetId=?) ea " +
"LEFT JOIN (SELECT EnterpriseAccountCode ,StandardAccountCode FROM AccountMapping WHERE OrganizationId=? AND IndustryId=?) am ON ea.Code=am.EnterpriseAccountCode " +
"LEFT JOIN (SELECT id StdId, Code StdAccountCode, Name StdName, FullName StdFullName,Direction StdDirection,AcctProp StdAcctProp FROM StandardAccount WHERE IndustryId=?) sa ON am.StandardAccountCode=sa.StdAccountCode ) T";
"CASE Std_Account_Code WHEN '0000' THEN '-' ELSE Std_Account_Code END Std_Code," +
"CASE Std_Account_Code WHEN '0000' THEN '-' ELSE Std_Name END Std_Name, " +
"CASE Std_Account_Code WHEN '0000' THEN '-' ELSE CONCAT(CONCAT(STD_ACCOUNT_CODE,'/'), STD_FULL_NAME) END Std_Code_Name, " +
"CASE Std_Account_Code WHEN '0000' THEN '-' ELSE CASE Std_Direction WHEN 1 THEN '借方' WHEN -1 THEN '贷方' END END Std_Direction, " +
"CASE WHEN Acct_Prop<>Std_Acct_Prop THEN 1 ELSE 0 END Is_Acct_Prop_Diff," +
"CASE WHEN Std_Account_Code IS NULL THEN 0 ELSE 1 END Mapping_Status, " +
"CASE WHEN Std_Account_Code IS NULL THEN Acct_Prop ELSE Std_Acct_Prop END Acct_Prop, Parent_Code, Acct_Level, Std_Account_Code Acct_Std_Code, Is_Leaf " +
" FROM (SELECT id,Code,\"NAME\",Full_Name,Direction,Acct_Prop,Parent_Code,Acct_Level,Is_Leaf FROM Enterprise_Account WHERE Enterprise_Account_Set_Id=?) ea " +
"LEFT JOIN (SELECT Enterprise_Account_Code ,Standard_Account_Code FROM Account_Mapping WHERE Organization_Id=? AND Industry_Id=?) am ON ea.Code=am.Enterprise_Account_Code " +
"LEFT JOIN (SELECT id as Std_Id, Code as Std_Account_Code, \"NAME\" as Std_Name, Full_Name as Std_Full_Name,Direction Std_Direction,Acct_Prop Std_Acct_Prop FROM Standard_Account WHERE Industry_Id=?) sa ON am.Standard_Account_Code=sa.Std_Account_Code ) T";
List<Object> params = Lists.newArrayList(accountSetId, organizationId, industryId, industryId);
if (iAcctProp != EnterpriseAccountConstant.InvalidId) {
sql += "AcctProp = ?";
sql += "Acct_Prop = ?";
params.add(iAcctProp);
}
if (iIsMapped == AccountMappingConstant.Status.UNMAPPED.getCode()) {
sql += "StdCode IS NULL";
sql += "Std_Code IS NULL";
} else if (iIsMapped == AccountMappingConstant.Status.MAPPED.getCode()) {
sql += "StdCode IS NOT NULL";
sql += "Std_Code IS NOT NULL";
} else if (iIsMapped == AccountMappingConstant.Status.DIRECTION_DIFFERENT.getCode()) {
sql += "StdCode IS NOT NULL AND Direction<>StdDirection";
sql += "Std_Code IS NOT NULL AND Direction<>Std_Direction";
} else if (iIsMapped == AccountMappingConstant.Status.ACCOUNT_TYPE_DIFFERENT.getCode()) {
sql += "StdCode IS NOT NULL AND IsAcctPropDiff=1";
sql += "Std_Code IS NOT NULL AND Is_Acct_Prop_Diff=1";
}
if (iLevel != EnterpriseAccountConstant.InvalidId) {
sql += "AcctLevel = ?";
sql += "Acct_Level = ?";
params.add(iLevel);
}
......
......@@ -15,8 +15,8 @@ public class KeyValueConfigDisplayDto {
private String scopeSummary;
private String serviceTypes;
private String industrys;
private List<String> serviceTypeIds;
private List<String> industryIds;
private List<String> serviceTypeIDs;
private List<String> industryIDs;
private Integer keyValueType;
private String dataSource;
private Map<Integer, Integer> scopeCount;
......@@ -86,20 +86,20 @@ public class KeyValueConfigDisplayDto {
this.industrys = industrys;
}
public List<String> getServiceTypeIds() {
return serviceTypeIds;
public List<String> getServiceTypeIDs() {
return serviceTypeIDs;
}
public void setServiceTypeIds(List<String> serviceTypeIds) {
this.serviceTypeIds = serviceTypeIds;
public void setServiceTypeIDs(List<String> serviceTypeIDs) {
this.serviceTypeIDs = serviceTypeIDs;
}
public List<String> getIndustryIds() {
return industryIds;
public List<String> getIndustryIDs() {
return industryIDs;
}
public void setIndustryIds(List<String> industryIds) {
this.industryIds = industryIds;
public void setIndustryIDs(List<String> industryIDs) {
this.industryIDs = industryIDs;
}
public Integer getKeyValueType() {
......
......@@ -46,8 +46,8 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal
CommonUtils.copyProperties(keyValueConfig, dtoObj);
dtoObj.setServiceTypes(getNamesByIds(keyValueConfig.getServiceTypeIds(), serviceType));
dtoObj.setIndustrys(getNamesByIds(keyValueConfig.getIndustryIds(), industryList));
dtoObj.setIndustryIds(Arrays.asList(keyValueConfig.getIndustryIds().split(",")));
dtoObj.setServiceTypeIds(Arrays.asList(keyValueConfig.getServiceTypeIds().split(",")));
dtoObj.setIndustryIDs(Arrays.asList(keyValueConfig.getIndustryIds().split(",")));
dtoObj.setServiceTypeIDs(Arrays.asList(keyValueConfig.getServiceTypeIds().split(",")));
List<KeyValueReference> selectScopeList = scopes.stream().filter(item -> item.getKeyValueConfigId().equals(keyValueConfig.getId())).collect(Collectors.toList());
List<Integer> selectScopes = selectScopeList.stream().map(KeyValueReference::getScope).distinct().collect(Collectors.toList());
Map<Integer, Integer> scopeCount = new HashMap<>();
......@@ -208,7 +208,7 @@ public class KeyValueConfigServiceImpl extends AbstractService implements KeyVal
CommonUtils.copyProperties(item, dtoObj);
dtoObj.setServiceTypes(getNamesByIds(item.getServiceTypeIds(), serviceType));
dtoObj.setIndustrys(getNamesByIds(item.getIndustryIds(), industryList));
dtoObj.setIndustryIds(new ArrayList<>(Arrays.asList(item.getIndustryIds().split(","))));
dtoObj.setIndustryIDs(new ArrayList<>(Arrays.asList(item.getIndustryIds().split(","))));
List<Integer> selectScopes = scopes.stream().filter(a -> a.getKeyValueConfigId().equals(item.getId()))
.map(KeyValueReference::getScope).collect(Collectors.toList());
dtoObj.setScopeSummary(jointToString(selectScopes));
......
......@@ -1065,7 +1065,7 @@ public class OrganizationServiceImpl implements OrganizationService {
newDto.setClientCode(rawDto.getClientCode());
newDto.setCode(rawDto.getCode());
newDto.setParentId(rawDto.getParentId());
newDto.setpLevel(rawDto.getpLevel());
newDto.setPLevel(rawDto.getPLevel());
newDto.setTaxPayerNumber(rawDto.getTaxPayerNumber());
// OrganizationDto newDto = CommonUtils.copyProperties(rawDto, new
......@@ -1499,7 +1499,7 @@ public class OrganizationServiceImpl implements OrganizationService {
private OrgDisplayDto convertToOrgDisplayDto(OrganizationDto from) {
OrgDisplayDto to = copyProperties(from, new OrgDisplayDto());
to.setPLevel(from.getpLevel());
to.setPLevel(from.getPLevel());
to.setOrgName(from.getName());
to.setOrgId(from.getId());
to.setPLevel(Optional.ofNullable(to.getPLevel()).orElse(0));
......@@ -1892,14 +1892,14 @@ public class OrganizationServiceImpl implements OrganizationService {
}
if (Objects.equals(orgDto.getParentId(), OrganizationConstant.NoParentId)) {
orgDto.setParentId(null);
orgDto.setpLevel(0);
orgDto.setPLevel(0);
} else {
// 机构添加层级
Organization query = null;
query = orgDto.getParentId() != null ? organizationMapper.selectByPrimaryKey(orgDto.getParentId())
: null;
if (query != null) {
orgDto.setpLevel(query.getpLevel() + 1);
orgDto.setPLevel(query.getpLevel() + 1);
}
}
......@@ -1924,7 +1924,7 @@ public class OrganizationServiceImpl implements OrganizationService {
}
Organization org = copyProperties(orgDto, new Organization());
org.setpLevel(orgDto.getpLevel());
org.setpLevel(orgDto.getPLevel());
organizationMapper.insert(org);
OperationResultDto<Object> validateSetRet = validateEnterpriseAccountSetDateTimeOverlap(
orgDto.getEnterpriseAccountSetOrgList());
......
......@@ -6,6 +6,7 @@ import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -47,17 +48,19 @@ public class RuleEngineeConfigServiceImpl extends AbstractService implements Rul
List<TaxPayerReportRule> filterRules = new ArrayList<>();
for (TaxPayerReportRule rule : rules) {
String[] selectedOrgIds = rule.getOrganizationId().split(",");
boolean isAtLeastOrgExisted = false;
for (String selectedOrgId : selectedOrgIds) {
if (orgIds.contains(selectedOrgId)) {
isAtLeastOrgExisted = true;
if (StringUtils.isNotBlank(rule.getOrganizationId())) {
String[] selectedOrgIds = rule.getOrganizationId().split(",");
boolean isAtLeastOrgExisted = false;
for (String selectedOrgId : selectedOrgIds) {
if (orgIds.contains(selectedOrgId)) {
isAtLeastOrgExisted = true;
}
}
}
if (isAtLeastOrgExisted || rule.getIsDefault()) {
filterRules.add(rule);
if (isAtLeastOrgExisted || rule.getIsDefault()) {
filterRules.add(rule);
}
}
}
......
......@@ -108,6 +108,6 @@ public interface EnterpriseAccountMapper extends MyMapper {
*/
int updateByPrimaryKey(EnterpriseAccount record);
List<EnterpriseAccountDto> getDto(@Param("epAccountSetId") String epAccountSetId,
List<EnterpriseAccountDto> getDto(@Param("epAccountSetID") String epAccountSetId,
@Param("orgId") String orgId, @Param("industryId") String industryId);
}
\ No newline at end of file
......@@ -112,7 +112,7 @@ public interface OrganizationMapper extends MyMapper {
*/
int updateByPrimaryKey(Organization record);
@Select("SELECT id, ParentID from Organization")
@Select("SELECT id, Parent_ID from Organization")
List<OrganizationDto> selectOnlyIdAndParentId();
List<Organization> selectByExampleWithAssociation(OrganizationExample example);
......
......@@ -390,11 +390,11 @@ public class OrganizationDto {
this.level = level;
}
public Integer getpLevel() {
public Integer getPLevel() {
return pLevel;
}
public void setpLevel(Integer pLevel) {
public void setPLevel(Integer pLevel) {
this.pLevel = pLevel;
}
......
......@@ -14,7 +14,7 @@
<result column="IS_CONSTANT" jdbcType="DECIMAL" property="isConstant" />
<result column="CALCULATE_STATUS" jdbcType="DECIMAL" property="calculateStatus" />
<result column="RESULT_TYPE" jdbcType="DECIMAL" property="resultType" />
<result column="SERVICE_TYPE_IDS" jdbcType="VARCHAR" property="serviceTypeIds" />
<result column="SERVICE_TYPE_IDS" jdbcType="VARCHAR" property="serviceTypeIDs" />
<result column="INDUSTRY_IDS" jdbcType="VARCHAR" property="industryIds" />
<result column="DESCRIPTION" jdbcType="VARCHAR" property="description" />
<result column="CREATOR" jdbcType="VARCHAR" property="creator" />
......@@ -157,7 +157,7 @@
DATA_SOURCE)
values (#{id,jdbcType=VARCHAR}, #{keyCode,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{keyValueType,jdbcType=DECIMAL}, #{formula,jdbcType=VARCHAR}, #{isConstant,jdbcType=DECIMAL},
#{calculateStatus,jdbcType=DECIMAL}, #{resultType,jdbcType=DECIMAL}, #{serviceTypeIds,jdbcType=VARCHAR},
#{calculateStatus,jdbcType=DECIMAL}, #{resultType,jdbcType=DECIMAL}, #{serviceTypeIDs,jdbcType=VARCHAR},
#{industryIds,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updator,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{dataSource,jdbcType=VARCHAR})
......@@ -193,7 +193,7 @@
<if test="resultType != null">
RESULT_TYPE,
</if>
<if test="serviceTypeIds != null">
<if test="serviceTypeIDs != null">
SERVICE_TYPE_IDS,
</if>
<if test="industryIds != null">
......@@ -243,8 +243,8 @@
<if test="resultType != null">
#{resultType,jdbcType=DECIMAL},
</if>
<if test="serviceTypeIds != null">
#{serviceTypeIds,jdbcType=VARCHAR},
<if test="serviceTypeIDs != null">
#{serviceTypeIDs,jdbcType=VARCHAR},
</if>
<if test="industryIds != null">
#{industryIds,jdbcType=VARCHAR},
......@@ -310,8 +310,8 @@
<if test="record.resultType != null">
RESULT_TYPE = #{record.resultType,jdbcType=DECIMAL},
</if>
<if test="record.serviceTypeIds != null">
SERVICE_TYPE_IDS = #{record.serviceTypeIds,jdbcType=VARCHAR},
<if test="record.serviceTypeIDs != null">
SERVICE_TYPE_IDS = #{record.serviceTypeIDs,jdbcType=VARCHAR},
</if>
<if test="record.industryIds != null">
INDUSTRY_IDS = #{record.industryIds,jdbcType=VARCHAR},
......@@ -353,7 +353,7 @@
IS_CONSTANT = #{record.isConstant,jdbcType=DECIMAL},
CALCULATE_STATUS = #{record.calculateStatus,jdbcType=DECIMAL},
RESULT_TYPE = #{record.resultType,jdbcType=DECIMAL},
SERVICE_TYPE_IDS = #{record.serviceTypeIds,jdbcType=VARCHAR},
SERVICE_TYPE_IDS = #{record.serviceTypeIDs,jdbcType=VARCHAR},
INDUSTRY_IDS = #{record.industryIds,jdbcType=VARCHAR},
DESCRIPTION = #{record.description,jdbcType=VARCHAR},
CREATOR = #{record.creator,jdbcType=VARCHAR},
......@@ -393,8 +393,8 @@
<if test="resultType != null">
RESULT_TYPE = #{resultType,jdbcType=DECIMAL},
</if>
<if test="serviceTypeIds != null">
SERVICE_TYPE_IDS = #{serviceTypeIds,jdbcType=VARCHAR},
<if test="serviceTypeIDs != null">
SERVICE_TYPE_IDS = #{serviceTypeIDs,jdbcType=VARCHAR},
</if>
<if test="industryIds != null">
INDUSTRY_IDS = #{industryIds,jdbcType=VARCHAR},
......@@ -433,7 +433,7 @@
IS_CONSTANT = #{isConstant,jdbcType=DECIMAL},
CALCULATE_STATUS = #{calculateStatus,jdbcType=DECIMAL},
RESULT_TYPE = #{resultType,jdbcType=DECIMAL},
SERVICE_TYPE_IDS = #{serviceTypeIds,jdbcType=VARCHAR},
SERVICE_TYPE_IDS = #{serviceTypeIDs,jdbcType=VARCHAR},
INDUSTRY_IDS = #{industryIds,jdbcType=VARCHAR},
DESCRIPTION = #{description,jdbcType=VARCHAR},
CREATOR = #{creator,jdbcType=VARCHAR},
......
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