Commit 13a0b5f1 authored by Eddie.Wu's avatar Eddie.Wu

Merge branch 'dev_wzk' into 'dev_mysql'

1、导入分发及数据抽取日期控件改成中英文都正确;2、开票记录与收入类型映射配置导入机构验证;3、修改机构基本信息时公司代码的disable属性去掉

See merge request root/atms!365
parents bce53a58 1121fbda
......@@ -95,7 +95,7 @@ public class AssetListController {
}
/**
*
* 获取资产类别
* @return
*/
@RequestMapping(value = "/getAssetGroupResultData", method = RequestMethod.GET)
......
......@@ -45,7 +45,7 @@ public class RevenueConfMappingController extends BaseController {
@PostMapping("upload")
public ApiResultDto upload(@RequestParam MultipartFile file, @RequestParam Integer type) throws Exception {
mappingService.upload(file, type);
return ApiResultDto.success();
List<String> unSuccessList = mappingService.upload(file, type);
return ApiResultDto.success(unSuccessList);
}
}
......@@ -131,12 +131,16 @@ public class AssetListServiceImpl extends BaseService {
}
/**
* 根据卡片获取之前映射好的资产类别
* @param projectId
* @return
* @throws Exception
*/
public List<CitAssetGroupResultDto> getAssetGroupResultData(String projectId) throws Exception {
logger.debug("根据projectId获取该资产类别相关数据");
CitAssetGroupResultExample assetGroupResultExample = new CitAssetGroupResultExample();
CitAssetGroupResultExample.Criteria criteria = assetGroupResultExample.createCriteria();
criteria.andProjectIdEqualTo(projectId);
List<CitAssetGroupResult> citAssetGroupResults = assetGroupResultMapper.selectByExample(assetGroupResultExample);
List<CitAssetGroupResult> citAssetGroupResults = assetGroupResultMapper.getAssetGroupResult(projectId);
List<CitAssetGroupResultDto> citAssetGroupResultDtos = new ArrayList<>();
for (CitAssetGroupResult citAssetGroupResult:citAssetGroupResults){
......@@ -271,7 +275,9 @@ public class AssetListServiceImpl extends BaseService {
deleteByExample(projectId);
}
//循环存储新的资产
if(citAssetsLists != null && citAssetsLists.size()>0){
int insertBatch = assetListMapper.insertBatch(citAssetsLists);
}
//处理资产类别
//1、根据projectId查询数据库中已有的资产类别,并和新导入的资产类别进行比较
// for (CitAssetGroupResult groupResult : citAssetGroupResults) {
......@@ -279,11 +285,15 @@ public class AssetListServiceImpl extends BaseService {
// }
Iterator<String> it = assetNameSet.iterator();
while (it.hasNext()) {
String next = it.next();
CitAssetGroupResultExample citAssetGroupResultExample = new CitAssetGroupResultExample();
citAssetGroupResultExample.createCriteria().andProjectIdEqualTo(projectId).andAssetNameEqualTo(next);
assetGroupResultMapper.deleteByExample(citAssetGroupResultExample);
CitAssetGroupResult citAssetGroupResult = new CitAssetGroupResult();
citAssetGroupResult.setId(idService.nextId());
citAssetGroupResult.setProjectId(projectId);
citAssetGroupResult.setPeriod(project.getYear());
citAssetGroupResult.setAssetName(it.next());
citAssetGroupResult.setAssetName(next);
assetGroupResultMapper.insertSelective(citAssetGroupResult);
}
importResult.setResult(true);
......
......@@ -190,6 +190,8 @@ public class CitPreviewDataServiceImpl extends BaseService {
public int exportDataSalaryAdvance(CitSalaryDataDto citSalaryDataDto , HttpServletResponse response) {
CitSalaryAdvanceExample example = new CitSalaryAdvanceExample();
CitSalaryAdvanceExample.Criteria criteria = example.createCriteria();
criteria.andProjectIdEqualTo(citSalaryDataDto.getProjectId());
criteria.andPeriodEqualTo(citSalaryDataDto.getPeriod());
if(!"".equals(citSalaryDataDto.getPoSubjectName()) && citSalaryDataDto.getPoSubjectName() != null){//根据PO主体名称进行查询
criteria.andPoSubjectNameEqualTo(citSalaryDataDto.getPoSubjectName());
}
......@@ -210,6 +212,7 @@ public class CitPreviewDataServiceImpl extends BaseService {
if(periodStart != null && periodEnd == null ){
criteria.andPeriodGreaterThanOrEqualTo(periodStart);
}
List<CitSalaryAdvance> list = citSalaryAdvanceMapper.selectByExample(example);
if(list.size()==0){
return 0;
......
......@@ -103,18 +103,23 @@ public class RevenueTypeMappingService extends BaseService {
}
}
public void upload(MultipartFile file, Integer type) throws Exception {
public List<String> upload(MultipartFile file, Integer type) throws Exception {
List<String> unSuccessList = new ArrayList<>();
InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream);
Sheet sheet = workbook.getSheetAt(0);
List<RevenueTypeMapping> list = new ArrayList<>();
List<OrgCodeIdDto> orgDtoList = organizationService.getMyOrgCodeList();
List<String> orgIds = new ArrayList<>();
String unSuccessMsg;
for (int r = sheet.getFirstRowNum()+1; r <= sheet.getLastRowNum(); r++) {
Row row = sheet.getRow(r);
unSuccessMsg = "第"+(r+1)+"行:";
String orgCode = String.valueOf(new BigDecimal(POIUtil.getCellFormulaString(row.getCell(0))).intValue());
Optional<OrgCodeIdDto> optional = orgDtoList.stream().filter(o -> StringUtils.equals(o.getCode(), orgCode)).findFirst();
if (!optional.isPresent()) {
unSuccessMsg +="|公司不存在|";
unSuccessList.add(unSuccessMsg);
continue;
}
RevenueTypeMapping mapping = new RevenueTypeMapping();
......@@ -143,7 +148,7 @@ public class RevenueTypeMappingService extends BaseService {
List<List<RevenueTypeMapping>> batchList = CommonUtils.subListWithLen(list, CommonUtils.BATCH_NUM_2000);
batchList.forEach(l -> typeMappingMapper.batchInsert(l));
}
return unSuccessList;
}
}
......@@ -581,7 +581,7 @@ public class ReportGeneratorImpl {
}else if(StringUtils.isNotBlank(cellData.getManualAmount())){
manualAmount = new BigDecimal(cellData.getManualAmount());
}
sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex()).setCellValue(amount.add(manualAmount).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex()).setCellValue(amount.add(manualAmount).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
}catch (NumberFormatException e){
//判断是否有手工数据源有得话以手工数据源为主
if(StringUtils.isNotBlank(cellData.getKeyinData())){
......@@ -657,10 +657,8 @@ public class ReportGeneratorImpl {
List<AnalysisSalesValueDto> dataList = periodCellDataMapper.selectReportData(a.getTemplateId(),a.getProjectId(),a.getPeriod());
for(AnalysisSalesValueDto cellData:dataList){
Sheet sheet = tWorkbook.getSheetAt(0);
Cell cell = sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex());
sheet.getRow(cellData.getRowIndex()).removeCell(cell);
sheet.getRow(cellData.getRowIndex()).createCell(cellData.getColumnIndex());
try{
sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex()).getCellTypeEnum();
BigDecimal amount = new BigDecimal(cellData.getData());
BigDecimal manualAmount = new BigDecimal("0");
if(StringUtils.isNotBlank(cellData.getKeyinData())){
......@@ -668,7 +666,8 @@ public class ReportGeneratorImpl {
}else if(StringUtils.isNotBlank(cellData.getManualAmount())){
manualAmount = new BigDecimal(cellData.getManualAmount());
}
sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex()).setCellValue(amount.add(manualAmount).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
sheet.getRow(cellData.getRowIndex()).getCell(cellData.getColumnIndex()).setCellValue(amount.add(manualAmount).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
}catch (NumberFormatException e){
//判断是否有手工数据源有得话以手工数据源为主
if(StringUtils.isNotBlank(cellData.getKeyinData())){
......
......@@ -105,4 +105,6 @@ public interface CitAssetGroupResultMapper extends MyMapper {
* @mbg.generated
*/
int updateByPrimaryKey(CitAssetGroupResult record);
List<CitAssetGroupResult> getAssetGroupResult(@Param("projectId") String projectId);
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.CitAssetGroupResultMapper">
<select id="getAssetGroupResult" resultMap="BaseResultMap">
select gr.* from asset_group_result gr
where gr.project_id=#{projectId,jdbcType=VARCHAR}
and gr.asset_name in
(SELECT DISTINCT(l.asset_group_name) from assets_list l where l.project_id=#{projectId,jdbcType=VARCHAR})
</select>
</mapper>
\ No newline at end of file
......@@ -869,5 +869,7 @@
"ConditionColumnNum": "Search Condition Column Num",
"Condition": "Search Condition",
"RevenueTypeConfiguration":"Revenue Type Config",
"FinancialStatementsType": "Financial Statements"
"FinancialStatementsType": "Financial Statements",
"Language": "en-US",
"yyyy-MM": "yyyy-mm"
}
......@@ -929,5 +929,7 @@
"Condition": "查询条件",
"Cancel": "取消",
"FinancialStatementsType": "财务报表",
"Language": "zh-CN",
"yyyy-MM": "yyyy-mm",
"~MustBeEndOneApp": "I Must be the End One, please!"
}
......@@ -43,16 +43,16 @@
{ caption: $translate.instant('item'), dataField: "item", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('standardMoney'), dataField: "standardMoney", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('currency'), dataField: "currency", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('orderAmount'), dataField: "orderAmount", allowEditing: false, fixed: true },
{ caption: $translate.instant('executedServiceSchedule'), dataField: "executedServiceSchedule", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('coupaTotalAccept'), dataField: "coupaTotalAccept", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('advance'), dataField: "advance", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('unexecutedServiceSchedule'), dataField: "unexecutedServiceSchedule", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('approvedStandardInvoiceAmount'), dataField: "approvedStandardInvoiceAmount", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('paidInvoiceAmount'), dataField: "paidInvoiceAmount", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('usableInvoiceAmount'), dataField: "usableInvoiceAmount", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('usableBalance'), dataField: "usableBalance", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('advanceWriteOff'), dataField: "advanceWriteOff", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('orderAmount'),format: {type: 'fixedPoint', precision: 2}, dataField: "orderAmount", allowEditing: false, fixed: true },
{ caption: $translate.instant('executedServiceSchedule'),format: {type: 'fixedPoint', precision: 2}, dataField: "executedServiceSchedule", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('coupaTotalAccept'),format: {type: 'fixedPoint', precision: 2}, dataField: "coupaTotalAccept", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('advance'), format: {type: 'fixedPoint', precision: 2}, dataField: "advance", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('unexecutedServiceSchedule'),format: {type: 'fixedPoint', precision: 2}, dataField: "unexecutedServiceSchedule", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('approvedStandardInvoiceAmount'),format: {type: 'fixedPoint', precision: 2}, dataField: "approvedStandardInvoiceAmount", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('paidInvoiceAmount'),format: {type: 'fixedPoint', precision: 2}, dataField: "paidInvoiceAmount", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('usableInvoiceAmount'),format: {type: 'fixedPoint', precision: 2}, dataField: "usableInvoiceAmount", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('usableBalance'),format: {type: 'fixedPoint', precision: 2}, dataField: "usableBalance", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('advanceWriteOff'),format: {type: 'fixedPoint', precision: 2}, dataField: "advanceWriteOff", allowEditing: false, fixed: true,width: 150 },
{ caption: $translate.instant('Account'), dataField: "subjectCode", allowEditing: false, fixed: true ,width: 150},
{ caption: $translate.instant('AccountDescription'), dataField: "subjectDescription", allowEditing: false, fixed: true ,width: 150},
......@@ -106,9 +106,6 @@
noDataText: $translate.instant('AccountVoucher_DataGrid_NoDataText'),
height: '99%',
width: '98%',
filterRow: {
visible: true
},
onRowUpdating: function (e) {
},
onToolbarPreparing: function (e) {
......
......@@ -265,7 +265,7 @@
translate}}:</label>
<div class="col-sm-9"
ng-class="{'has-error':orgControlForm.code.$invalid && (orgControlForm.code.$dirty || orgControlForm.$submitted)}">
<input class="form-control" name="code" ng-disabled="!isAdd" id="code"
<input class="form-control" name="code" id="code"
ng-model="editOrgModel.code"
placeholder="{{resources.OrganizationCode}}" maxlength="50"
ng-pattern="/^[A-Za-z0-9]+$/" code-unique>
......
......@@ -993,6 +993,7 @@
var initDatePicker = function () {
var ele1 = $("#periodDatepicker");
ele1.datepicker({
language: $translate.instant('Language'),
startDate: $scope.startDate,
endDate: $scope.endDate,
viewMode: $scope.viewMode,
......
......@@ -1162,6 +1162,7 @@
var initDatePicker = function () {
var ele1 = $("#periodDatepicker");
ele1.datepicker({
language: $translate.instant('Language'),
startDate: $scope.startDate,
endDate: $scope.endDate,
viewMode: $scope.viewMode,
......
......@@ -1032,6 +1032,7 @@
var initDatePicker = function () {
var ele1 = $("#periodDatepicker");
ele1.datepicker({
language: $translate.instant('Language'),
startDate: $scope.startDate,
endDate: $scope.endDate,
viewMode: $scope.viewMode,
......
......@@ -481,6 +481,7 @@
var initDatePicker = function () {
var ele1 = $("#periodDatepicker");
ele1.datepicker({
language: $translate.instant('Language'),
startDate: $scope.startDate,
endDate: $scope.endDate,
viewMode: $scope.viewMode,
......
......@@ -396,6 +396,7 @@
var initDatePicker = function () {
var ele1 = $("#periodDatepicker");
ele1.datepicker({
language: $translate.instant('Language'),
startDate: $scope.startDate,
endDate: $scope.endDate,
viewMode: $scope.viewMode,
......
......@@ -390,6 +390,7 @@
var initDatePicker = function () {
var ele1 = $("#periodDatepicker");
ele1.datepicker({
language: $translate.instant('Language'),
startDate: $scope.startDate,
endDate: $scope.endDate,
viewMode: $scope.viewMode,
......
......@@ -389,6 +389,7 @@
var initDatePicker = function () {
var ele1 = $("#periodDatepicker");
ele1.datepicker({
language: $translate.instant('Language'),
startDate: $scope.startDate,
endDate: $scope.endDate,
viewMode: $scope.viewMode,
......
......@@ -405,6 +405,7 @@
var initDatePicker = function () {
var ele1 = $("#periodDatepicker");
ele1.datepicker({
language: $translate.instant('Language'),
startDate: $scope.startDate,
endDate: $scope.endDate,
viewMode: $scope.viewMode,
......
......@@ -398,6 +398,7 @@
var initDatePicker = function () {
var ele1 = $("#periodDatepicker");
ele1.datepicker({
language: $translate.instant('Language'),
startDate: $scope.startDate,
endDate: $scope.endDate,
viewMode: $scope.viewMode,
......
......@@ -423,6 +423,7 @@
var initDatePicker = function () {
var ele1 = $("#periodDatepicker");
ele1.datepicker({
language: $translate.instant('Language'),
startDate: $scope.startDate,
endDate: $scope.endDate,
viewMode: $scope.viewMode,
......
......@@ -401,6 +401,7 @@
var initDatePicker = function () {
var ele1 = $("#periodDatepicker");
ele1.datepicker({
language: $translate.instant('Language'),
startDate: $scope.startDate,
endDate: $scope.endDate,
viewMode: $scope.viewMode,
......
......@@ -446,6 +446,7 @@
var initDatePicker = function () {
var ele1 = $("#periodDatepicker");
ele1.datepicker({
language: $translate.instant('Language'),
startDate: $scope.startDate,
endDate: $scope.endDate,
viewMode: $scope.viewMode,
......
......@@ -486,6 +486,7 @@
var initDatePicker = function () {
var ele1 = $("#periodDatepicker");
ele1.datepicker({
language: $translate.instant('Language'),
startDate: $scope.startDate,
endDate: $scope.endDate,
viewMode: $scope.viewMode,
......
......@@ -501,6 +501,7 @@
var initDatePicker = function () {
var ele1 = $("#periodDatepicker");
ele1.datepicker({
language: $translate.instant('Language'),
startDate: $scope.startDate,
endDate: $scope.endDate,
viewMode: $scope.viewMode,
......
......@@ -432,6 +432,7 @@
var initDatePicker = function () {
var ele1 = $("#periodDatepicker");
ele1.datepicker({
language: $translate.instant('Language'),
startDate: $scope.startDate,
endDate: $scope.endDate,
viewMode: $scope.viewMode,
......
......@@ -444,6 +444,7 @@
var initDatePicker = function () {
var ele1 = $("#periodDatepicker");
ele1.datepicker({
language: $translate.instant('Language'),
startDate: $scope.startDate,
endDate: $scope.endDate,
viewMode: $scope.viewMode,
......
......@@ -47,7 +47,7 @@
$scope.startDate = new Date(year - 20, 1, 1);
$scope.endDate = new Date(year + 20, 1, 1);
$scope.viewMode = 1;
$scope.dateFormat = $translate.instant('dateFormat4YearMonth');
$scope.dateFormat = $translate.instant('yyyy-MM');
$scope.importExcelFile = null;
$scope.UploadPeriodTime = null;
......@@ -367,17 +367,19 @@
};
//日期
$scope.dateBoxStart = {
width: '100%',
acceptCustomValue: false,
openOnFieldClick: true,
displayFormat: 'yyyy-MM',
maxZoomLevel: "year",
dateSerializationFormat: 'yyyy-MM',
bindingOptions: {
value: 'formParam.period'
}
};
var ele1 = $("#periodDatepicker");
ele1.datepicker({
language: $translate.instant('Language'),
startDate: $scope.startDate,
endDate: $scope.endDate,
viewMode: $scope.viewMode,
minViewMode: $scope.viewMode,
autoclose: true, //选中之后自动隐藏日期选择框
clearBtn: true, //清除按钮
todayBtn: false, //今日按钮
format: $scope.dateFormat //日期格式,详见 http://bootstrap-datepicker.readthedocs.org/en/release/options.html#format
});
ele1.datepicker("setDate", $scope.selectedDate);
initParam();
checkUserOrganizationPermissionList();
getUserPermission();
......
......@@ -17,7 +17,11 @@
</div>
<label class="col-sm-1 control-label">{{'InvoiceQJ' | translate}}:</label>
<div class="col-sm-2">
<div dx-date-box="dateBoxStart"></div>
<div class="period-picker" style="display: inline-block;width: 150px;">
<input type="text" id="periodDatepicker" class="datepicker form-control imp-subheader"
style="width:120px;display: inline-block" readonly="readonly" ng-model="formParam.period" />
<i class="fa fa-calendar imp-subheader red-color" style="width:20px;"></i>
</div>
</div>
<label class="col-sm-1 control-label">{{'SelectedDataType' | translate}}:</label>
<div class="col-sm-2">
......
......@@ -273,6 +273,7 @@
var initDatePicker = function () {
var ele1 = $("#periodDatepicker");
ele1.datepicker({
language: $translate.instant('Language'),
startDate: $scope.startDate,
endDate: $scope.endDate,
viewMode: $scope.viewMode,
......
......@@ -185,7 +185,15 @@
$('#busy-indicator-container').hide();
deferred.resolve();
if (res && res.data && 0 === res.data.code) {
if(res.data.data.length==0){
SweetAlert.success($translate.instant('ImportSuccess'));
}else{
var msg = '';
angular.forEach(res.data.data,function (item) {
msg += item +" \n ";
});
SweetAlert.success(msg);
}
$scope.refreshConfigGrid();
} else {
SweetAlert.error($translate.instant('SystemError'));
......
......@@ -177,7 +177,7 @@
.dt-init-wrapper {
margin: 30px 0;
max-width: 99%;
height: calc(~'100% - 25px');
height: calc(100% - 200px);
position: relative;
.dropdown {
......@@ -188,15 +188,8 @@
}
}
.importPLStatusGridContainer {
height: calc(~'100% - 30px');
overflow: hidden;
position: absolute;
top: 0;
bottom: 136px; /* 130 + 6 */
left: 0;
right: 0;
background-color: #FFF;
#revenueGridContainer{
height: 460px;
}
}
......
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