Commit 0cffbb97 authored by gary's avatar gary

1、fixbug

parent 5c02c6ef
package pwc.taxtech.atms.common.util;
import java.math.BigDecimal;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class CommonUtil {
......@@ -16,4 +18,21 @@ public class CommonUtil {
v2 = null == v2 ? BigDecimal.ZERO : v2;
return v1.add(v2);
}
public static int getNum(String str){
String regEx="[^0-9]";
Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher(str);
return Integer.valueOf(m.replaceAll("").trim());
}
public static boolean hasDigit(String content) {
boolean flag = false;
Pattern p = Pattern.compile(".*\\d+.*");
Matcher m = p.matcher(content);
if (m.matches()) {
flag = true;
}
return flag;
}
}
package pwc.taxtech.atms.security.dd;
import org.apache.commons.codec.binary.Base64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.service.impl.ProjectServiceImpl;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
//import org.apache.tomcat.util.codec.binary.Base64;
import javax.crypto.Cipher;
import java.security.KeyFactory;
import java.security.PublicKey;
import java.security.spec.X509EncodedKeySpec;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
/**
* @Auther: Gary J Li
* @Date: 20/03/2019 20:41
* @Description:
*/
public class DtsTokenService {
private static final Logger logger = LoggerFactory.getLogger(ProjectServiceImpl.class);
private static String PUBKEY;
@Value("${dd_pubkey}")
public void setDriver(String pubkey) {
PUBKEY= pubkey;
}
public static final String KEY_ALGORITHM = "RSA";
private static final String PUBLIC_KEY = "RSAPublicKey";
private static final String PRIVATE_KEY = "RSAPrivateKey";
private static final int KEY_SIZE = 512;
/**
* 生成加密token
* @return
* @throws
*/
public String encryptInput(){
String pubKey = PUBKEY;
BASE64Encoder base64 = new BASE64Encoder();
BASE64Decoder base64Decoder = new BASE64Decoder();
byte[] encodeData;
try {
byte[] publicKey = base64Decoder.decodeBuffer(pubKey);
String nonce = generateNonce();
String sDate = generateDate();
long rNum = generateRandomNumber();
String inputStr1 = sDate + "@@" + "DTS" + "@@" + nonce+rNum;
byte[] data1 = inputStr1.getBytes();
logger.info("原文:" + inputStr1);
encodeData = encryptByPublicKey(data1, publicKey);
logger.info("公钥加密后:" + base64.encode(encodeData));
} catch (Exception ex) {
throw new ServiceException("cus" + ex);
}
return base64.encode(encodeData);
}
private String generateNonce() throws Exception {
String dateTimeString = Long.toString(System.currentTimeMillis());
byte[] nonceByte = dateTimeString.getBytes();
return Base64.encodeBase64String(nonceByte);
}
private String generateDate() throws Exception {
DateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd");
dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
Date today = Calendar.getInstance().getTime();
String created = dateFormatter.format(today);
return created;
}
private long generateRandomNumber() throws Exception {
final double d = Math.random();
final long num = (int)(d*100000000000000L);
return num;
}
private byte[] encryptByPublicKey(byte[] data, byte[] key) throws Exception {
X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(key);
KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
PublicKey publicKey = keyFactory.generatePublic(x509KeySpec);
Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
return cipher.doFinal(data);
}
}
......@@ -7,14 +7,14 @@ import pwc.taxtech.atms.common.OperateLogType;
import pwc.taxtech.atms.common.OperationAction;
import pwc.taxtech.atms.common.OperationModule;
import pwc.taxtech.atms.common.message.LogMessage;
import pwc.taxtech.atms.common.util.CommonUtil;
import pwc.taxtech.atms.dao.EquityInformationHistoryMapper;
import pwc.taxtech.atms.dao.EquityInformationMapper;
import pwc.taxtech.atms.dao.OrganizationMapper;
import pwc.taxtech.atms.dto.equity.EquityInfoDto;
import pwc.taxtech.atms.dto.OperationLogDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.entity.EquityInformation;
import pwc.taxtech.atms.entity.EquityInformationExample;
import pwc.taxtech.atms.entity.OperationLogBasicData;
import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.exception.ApplicationException;
import javax.annotation.Resource;
......@@ -31,9 +31,13 @@ public class EquityServiceImpl extends BaseService{
@Resource
private EquityInformationMapper equityInformationMapper;
@Resource
private EquityInformationHistoryMapper equityInformationHistoryMapper;
@Resource
private OrganizationMapper organizationMapper;
public List<EquityInfoDto> getEquityListByOrgId(String orgId) {
List<EquityInfoDto> equityInfoDtos = new ArrayList<>();
try {
......@@ -166,6 +170,9 @@ public class EquityServiceImpl extends BaseService{
// remark-1 无股权记录时,初始变更为新增
String orgId = equityInfoDtos.get(0).getOrganizationId();
Organization org = organizationMapper.selectByPrimaryKey(orgId);
List<EquityInformation> oldData = null;
if (null != oldId) {
// 1、根据id(原始)查出旧数据 equity_infomation
......@@ -187,6 +194,11 @@ public class EquityServiceImpl extends BaseService{
BeanUtils.copyProperties(equityInfoDto, newData);
newData.setId(newId);
newData.seteNum(i);
float investRadio = 0L;
if(CommonUtil.hasDigit(org.getRegistrationCapital())&&null!=newData.getInvestmentAmount()){
investRadio = (float)newData.getInvestmentAmount()/(float)CommonUtil.getNum(org.getRegistrationCapital());
}
newData.setInvestmentRadio(investRadio);
newData.setOrganizationId(orgId);
Date now = new Date();
newData.setCreateTime(now);
......
......@@ -56,6 +56,7 @@ cookie.maxAgeSeconds=${cookie.maxAgeSeconds}
api_white_list=${api_white_list}
org_sync_url=${org_sync_url}
org_sync_token=${org_sync_token}
dd_pubkey=${dd_pubkey}
ebs_call_url=${ebs_call_url}
......
......@@ -54,6 +54,7 @@ cookie.maxAgeSeconds=86400
api_white_list=/ebs/api/v1/dd;
org_sync_url=http://10.96.238.10/erp-main-data-test-v2/api/companies
org_sync_token=174af08f
dd_pubkey=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKUfMPRKV6I5num1dDWcxTrgTjXf5LctsVj0CpbwHE83mmjUO5CAlvA0Fwy30ajCX5sLmsyi+Eu/4uNmM6GQF3kCAwEAAQ==
ebs_call_url=http://172.20.201.201:8020/ebs-proxy-test/dts
......
......@@ -57,6 +57,8 @@ cookie.maxAgeSeconds=18000
api_white_list=/ebs/api/v1/dd;
org_sync_url=http://10.96.238.10/erp-main-data-test-v2/api/companies
org_sync_token=174af08f
dd_pubkey=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKUfMPRKV6I5num1dDWcxTrgTjXf5LctsVj0CpbwHE83mmjUO5CAlvA0Fwy30ajCX5sLmsyi+Eu/4uNmM6GQF3kCAwEAAQ==
ebs_call_url=http://172.20.201.201:8020/ebs-proxy-test/dts
......
......@@ -52,6 +52,8 @@ cookie.maxAgeSeconds=86400
api_white_list=/ebs/api/v1/dd;
org_sync_url=http://10.96.238.10/erp-main-data-test-v2/api/companies
org_sync_token=174af08f
dd_pubkey=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKUfMPRKV6I5num1dDWcxTrgTjXf5LctsVj0CpbwHE83mmjUO5CAlvA0Fwy30ajCX5sLmsyi+Eu/4uNmM6GQF3kCAwEAAQ==
ebs_call_url=http://172.20.201.201:8020/ebs-proxy-test/dts
......
......@@ -104,7 +104,7 @@
ON
U.organization_id = ORG.id
WHERE
U.is_super_admin = 0
U.user_name != 'admin'
ORDER BY
user_name
</select>
......
......@@ -89,12 +89,12 @@
"BusinessAllottedTimeTo": "营业期限截止",
"BusinessPromition": "业务宣传费",
"BusinessScope": "经营范围",
"RegStatus": "工商登记状态",
"BusinessUnit": "事业部",
"BusinessUnitDesc": "事业部",
"BusinessUnitID": "事业部",
"BusinessUnitLog": "日志-事业部",
"BusinessUnitPre": "事业部",
"RegStatus": "登记状态",
"BusinessUnit": "所属业务线",
"BusinessUnitDesc": "业务线",
"BusinessUnitID": "业务线",
"BusinessUnitLog": "日志-业务线",
"BusinessUnitPre": "业务线",
"ButtonCancel": "取消",
"ButtonClose": "关闭",
"ByYear": "By Year",
......@@ -361,7 +361,7 @@
"LandAppreciationTax": "土地增值税",
"LastMonth": "上月实际",
"LegalCode": "法人代码",
"LegalPersonName": "法定负责人名称",
"LegalPersonName": "法定代表人/负责人-英文",
"LegalPersonPhoneNumber": "法定负责人手机",
"LegalPersonLandlineNum": "法定负责人座机",
"LegalPersonEmailAddress": "法定负责人邮箱",
......@@ -505,15 +505,15 @@
"OrangizationStructureManageLog": "日志-机构层级",
"OrgCommonModel": "机构公共模型",
"OrgCustomModel": "机构自定义模型",
"OrgName": "机构名称",
"OrgName": "公司名称",
"Organization": "Entity",
"OrganizationColon": "适用机构:",
"OrganizationCount": "访问机构数",
"OrganizationDesc": "机构",
"OrganizationLevel": "公司层级",
"OrganizationName": "机构名称",
"OrganizationNameEn": "机构名称(英文)",
"Abbreviation": "机构缩写",
"OrganizationName": "公司名称",
"OrganizationNameEn": "公司名称(英文)",
"Abbreviation": "公司简称",
"OrganizationServiceTemplateGroup": "服务管理",
"OrganizationStructureDesc": "机构层级",
"Organize": "Organize",
......@@ -590,12 +590,12 @@
"RegionManageLog": "日志-区域管理",
"RegistrationAddress": "注册地址",
"RegistrationAddressEn": "注册地址(英文)",
"RegistrationCapital": "注册资本(万元)",
"PaidInCapital": "实缴资本(万元)",
"RegistrationCapital": "注册资本",
"PaidInCapital": "实缴资本",
"UpdateType": "更新方式",
"RegistrationDate": "注册日期",
"RegistrationLocation": "注册地",
"RegistrationLocationEn": "注册地(英文)",
"RegistrationLocation": "注册地址(住所)",
"RegistrationLocationEn": "注册地地址(住所)-英文",
"RegistrationType": "注册类型",
"ArchitectureType": "架构类型",
"RemarkColon": "备注:",
......
......@@ -213,7 +213,7 @@
"SequenceNo": "序号",
"TaskName": "任务名称",
"EnableStatus": "启用状态",
"EnglishName": "机构名称(英文)",
"EnglishName": "公司名称(英文)",
"SelectionStatus": "必选状态",
"PushMsgType": "推送消息类型",
"Configuration": "配置",
......@@ -245,8 +245,8 @@
"ShowAsCard": "显示卡片",
"ShowAsList": "显示列表",
"FilterText": "筛选",
"OrganizationName": "机构名称",
"OrganizationMsgNameRequired": "请输入机构名称",
"OrganizationName": "公司名称",
"OrganizationMsgNameRequired": "请输入公司名称",
"OrganizationExtraInfoEditSuccess": "修改成功",
"OrganizationParent": "上级公司",
"OrganizationLevelType": "层级",
......@@ -254,7 +254,7 @@
"OrganizationClientCode": "客户代码",
"RatePayer": "纳税人类型",
"OrganizationMsgClientCodeRequired": "请输入客户代码",
"OrganizationCode": "机构代码",
"OrganizationCode": "公司代码",
"UnifiedSocialCreditCode": "统一社会信用代码",
"RegistrationStatus": "登记状态",
"LogoutTime": "注销时间",
......@@ -342,9 +342,9 @@
"GeneralCorporateFinancialStatementFormat": "采用一般企业财务报表格式",
"SmallMeagerProfit": "小型微利企业",
"ListedCompany": "上市公司",
"OrganizationMsgCodeRequired": "请输入机构代码",
"OrganizationMsgCodeMaxLength": "机构代码长度不应超过20字",
"OrganizationMsgCodePattern": "机构代码只能包含数字与英文字母",
"OrganizationMsgCodeRequired": "请输入公司代码",
"OrganizationMsgCodeMaxLength": "公司代码长度不应超过20字",
"OrganizationMsgCodePattern": "公司代码只能包含数字与英文字母",
"OrganizationMsgCodeUnique": "该机构编码已存在,请重新输入",
"OrganizationTaxPayerNumber": "纳税人识别号",
"OrganizationMsgTaxPayerNumberUnique": "该纳税人识别号已存在,请重新输入",
......
......@@ -619,7 +619,7 @@
"Entity": "机构",
"EntityColon": "机构",
"EntityDetail": "机构详情",
"EntityName": "机构名称",
"EntityName": "公司名称",
"Enum_Accounting": "已记账",
"Enum_Billed": "已开票",
"Enum_DisplayIncoice": "页面显示发票信息",
......
......@@ -348,7 +348,6 @@
roleService.getAllUserRoleList().success(function (data) {
data = _.filter(data, function (row) {
return row.userName && row.userName.toLowerCase() !== "admin";
});
......@@ -616,9 +615,9 @@
} else {
// 用户状态筛选
// 只显示启用的
if ($scope.showActiveUser && user.status === enums.userStatus.disabled) {
/*if ($scope.showActiveUser && user.status === enums.userStatus.disabled) {
continue;
}
}*/
// 只显示禁用的用户
if (!$scope.showActiveUser && user.status != enums.userStatus.disabled) {
......
......@@ -45,6 +45,8 @@
<label for="comment" class="col-sm-4 control-label"><span class="must-input">*</span>{{'LogComments' | translate}}:</label>
<div class="col-sm-8" ng-class="{'has-error':equityControlForm.comment.$invalid && (equityControlForm.comment.$dirty || equityControlForm.$submitted)}">
<input class="form-control" name="comment" id="comment" ng-model="editOrgModel.comment" maxlength="300" required>
<p ng-show="equityControlForm.comment.$error.required"
class="has-error label">备注是必须的!</p>
</div>
</div>
</div>
......@@ -75,7 +77,8 @@
<div class="modal-footer" id="orgModalFooter" style="padding-left:139px;">
<button type="submit" class="btn btn-primary" ng-click="saveEquity()" data-dismiss="modal">
<button type="submit" class="btn btn-primary" ng-click="saveEquity()" data-dismiss="modal"
ng-disabled="equityControlForm.updateTime.$dirty && equityControlForm.updateTime.$invalid || equityControlForm.comment.$dirty && equityControlForm.comment.$invalid">
{{'Confirm' | translate}}
</button>
<button type="button" class="btn btn-third" ng-click="closeModal()" data-dismiss="modal">
......
......@@ -423,7 +423,7 @@
<div class="col-sm-6" style="padding-left: 0px;"
ng-class="{'has-error':orgControlForm.selectProvince.$invalid && (orgControlForm.selectProvince.$dirty || orgControlForm.$submitted)}">
<select class="form-control localRequired" name="selectProvince"
style="width: 120px; " ng-change="populateCities()"
style="width: 130px; " ng-change="populateCities()"
ng-model="selectProvince"
ng-options="x.regionName for x in ProvinceList" >
<option value="">{{pleaseSelect}}</option>
......
......@@ -15,7 +15,7 @@
}
.modal-dialog {
width: 850px;
width: 1100px;
height: 600px;
}
......
......@@ -1526,7 +1526,8 @@ constant.importFileType = {
invoiceData: 7,
certifiedInvoicesList: 8,
invoiceRecord: 9,
ExtractFinancialData: 10
ExtractFinancialData: 10,
ExtractInvoiceData: 11
};
constant.citImportFileType = {
......
......@@ -154,17 +154,17 @@
}, {
dataField: "companyName",
allowHeaderFiltering: false,
width: '27%',
width: '20%',
caption: $translate.instant('CompanyName')
}, {
dataField: "fileType",
allowHeaderFiltering: false,
width: '27%',
width: '15%',
caption: $translate.instant('ExtractFile')
}, {
dataField: "periodYear",
allowHeaderFiltering: false,
width: '5%',
width: '14%',
caption: $translate.instant('YearPeriod')
},
/*{
......@@ -176,22 +176,22 @@
{
dataField: "periodMonth",
allowHeaderFiltering: false,
width: '5%',
width: '8%',
caption: $translate.instant('Period')
}, {
dataField: "recordSize",
allowHeaderFiltering: false,
width: '8%',
width: '10%',
caption: $translate.instant('RecordSize')
}, {
dataField: "errorMsg",
allowHeaderFiltering: false,
width: '15%',
width: '20%',
caption: $translate.instant('Status')
}
],
onContentReady: function (e) {
$scope.accountingRateListInstance = e.component;
$scope.extractFinancialInstance = e.component;
var totalCount = e.component.totalCount();
if (totalCount > 0) {
$scope.totalCount = totalCount;
......@@ -228,11 +228,11 @@
var getFinancialDataStatus = function () {
vatImportService.displayImportLog($scope.pagingOptions,constant.importFileType.ExtractFinancialData).success(function (data) {
if (data) {
$scope.extractFinancialGridSource = data;
for (var i = 1; i <= $scope.extractFinancialGridSource.length; i++) {
$scope.extractFinancialGridSource[i - 1].index = i;
}
if (data && data.list) {
$scope.extractFinancialGridSource = data.list;
$scope.pagingOptions.totalItems = data.pageInfo.totalCount;
}else {
SweetAlert.error($translate.instant('SystemError'));
}
});
};
......
......@@ -216,11 +216,11 @@
var getInvoiceDataStatus = function () {
vatImportService.displayImportLog(constant.importFileType.ExtractInvoiceData).success(function (data) {
if (data) {
$scope.ImportFDStatusGridSource = data;
for (var i = 1; i <= $scope.ImportFDStatusGridSource.length; i++) {
$scope.ImportFDStatusGridSource[i - 1].index = i;
}
if (data && data.list) {
$scope.ImportFDStatusGridSource = data.list;
$scope.pagingOptions.totalItems = data.pageInfo.totalCount;
}else {
SweetAlert.error($translate.instant('SystemError'));
}
});
};
......
......@@ -30,7 +30,7 @@ function ($scope, $log, $translate, $location, loginContext, enums, vatSessionSe
},
{
name: 'offBalanceSheet', permission: constant.vatPermission.dataPreview.offBalanceSheet.queryCode,
text: $translate.inunreturned-taxstant('offBalanceSheetPRC'), icon: 'fa fa-file-text-o', show: true
text: $translate.instant('offBalanceSheetPRC'), icon: 'fa fa-file-text-o', show: true
},
{
name: 'journal', permission: constant.vatPermission.dataPreview.journal.queryCode,
......
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