Commit 2c77ebfc authored by zhkwei's avatar zhkwei

CIT数据导入模块补充选择机构及期间功能

parent 68e3be21
package pwc.taxtech.atms.controller; package pwc.taxtech.atms.controller;
import com.alibaba.fastjson.JSONArray;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -7,9 +8,11 @@ import org.springframework.web.bind.annotation.*; ...@@ -7,9 +8,11 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.constant.enums.EnumCitImportType; import pwc.taxtech.atms.constant.enums.EnumCitImportType;
import pwc.taxtech.atms.dto.ApiResultDto; import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.service.impl.CitImportExcelServiceImpl; import pwc.taxtech.atms.service.impl.CitImportExcelServiceImpl;
import java.io.InputStream; import java.io.InputStream;
import java.util.List;
import static pwc.taxtech.atms.constant.enums.EnumCitImportType.JournalAdjust; import static pwc.taxtech.atms.constant.enums.EnumCitImportType.JournalAdjust;
...@@ -28,32 +31,29 @@ public class CitImportExcelController { ...@@ -28,32 +31,29 @@ public class CitImportExcelController {
@RequestMapping(value = "/citImportExcel", method = RequestMethod.POST) @RequestMapping(value = "/citImportExcel", method = RequestMethod.POST)
public @ResponseBody public @ResponseBody
ApiResultDto citImportExcel(@RequestParam MultipartFile file, OperationResultDto citImportExcel(@RequestParam MultipartFile file, @RequestParam String orgIds,
@RequestParam String periodDate, @RequestParam String periodDate,
@RequestParam Integer importType, @RequestParam Integer importType,
@RequestParam Integer importFileType){ @RequestParam Integer importFileType){
logger.info("CIT调整版日记账导入"); logger.info("CIT调整版日记账导入");
ApiResultDto apiResultDto = new ApiResultDto(); OperationResultDto opeResultDto = new OperationResultDto();
try{ try{
if (file == null || file.getSize() <= 0) { if (file == null || file.getSize() <= 0) {
apiResultDto.setCode(-1); opeResultDto.setResult(false);
apiResultDto.setMessage("没有获取到文件"); opeResultDto.setResultMsg("没有获取到文件");
logger.warn("没有获取到文件"); logger.warn("没有获取到文件");
return apiResultDto; return opeResultDto;
} }
logger.debug("file name: " + file.getOriginalFilename()); logger.debug("file name: " + file.getOriginalFilename());
List<String> orgList = (List<String>) JSONArray.parse(orgIds);
citImportExcelService.citImportExcel(file, file.getOriginalFilename(), periodDate, importType, importFileType); opeResultDto = citImportExcelService.citImportExcel(file, orgList, file.getOriginalFilename(), periodDate, importType, importFileType);
return opeResultDto;
apiResultDto.setCode(1);
apiResultDto.setMessage("资产导入成功");
return apiResultDto;
}catch (Exception e){ }catch (Exception e){
logger.error("资产导入失败,错误信息如下:"); logger.error("资产导入失败,错误信息如下:");
e.printStackTrace(); e.printStackTrace();
apiResultDto.setCode(0); opeResultDto.setResult(false);
apiResultDto.setMessage("资产导入失败"); opeResultDto.setResultMsg("资产导入失败");
return apiResultDto; return opeResultDto;
} }
} }
......
...@@ -14,18 +14,18 @@ import java.util.Date; ...@@ -14,18 +14,18 @@ import java.util.Date;
public class CitCommonUtil { public class CitCommonUtil {
/** /**
* 计算当前期间 * 计算当前系统时间期间,返回yyyy格式
* @return * @return
*/ */
public static Integer getPeriod(){ public static Integer getPeriod(){
//计算当前期间 //计算当前系统时间的期间
Calendar now = Calendar.getInstance(); Calendar now = Calendar.getInstance();
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(now.get(Calendar.YEAR)); sb.append(now.get(Calendar.YEAR));
if(now.get(Calendar.MONTH) + 1 < 10){ // if(now.get(Calendar.MONTH) + 1 < 10){
sb.append(0); // sb.append(0);
} // }
sb.append(now.get(Calendar.MONTH) + 1); // sb.append(now.get(Calendar.MONTH) + 1);
return Integer.valueOf(sb.toString()); return Integer.valueOf(sb.toString());
} }
...@@ -37,6 +37,7 @@ public class CitCommonUtil { ...@@ -37,6 +37,7 @@ public class CitCommonUtil {
*/ */
public static Object getValue(Cell cell) { public static Object getValue(Cell cell) {
Object obj = null; Object obj = null;
//判断单元格是否为null,若为null则直接返回,以防在获取枚举类型时报空指针异常
if(cell == null){ if(cell == null){
return obj; return obj;
} }
...@@ -48,6 +49,7 @@ public class CitCommonUtil { ...@@ -48,6 +49,7 @@ public class CitCommonUtil {
obj = cell.getErrorCellValue(); obj = cell.getErrorCellValue();
break; break;
case NUMERIC: case NUMERIC:
//日期格式在获取枚举类型时也为NUMERIC,此时要做日期和数据的区分,并对时间做统一的格式转换
if(HSSFDateUtil.isCellDateFormatted(cell)){ if(HSSFDateUtil.isCellDateFormatted(cell)){
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
obj = sdf.format(cell.getDateCellValue()); obj = sdf.format(cell.getDateCellValue());
......
...@@ -7,14 +7,16 @@ import org.apache.poi.ss.usermodel.*; ...@@ -7,14 +7,16 @@ import org.apache.poi.ss.usermodel.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.message.ErrorMessageCN;
import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.constant.enums.EnumCitImportType; import pwc.taxtech.atms.constant.enums.EnumCitImportType;
import pwc.taxtech.atms.constant.enums.EnumImportType; import pwc.taxtech.atms.constant.enums.EnumImportType;
import pwc.taxtech.atms.constant.enums.EnumTbImportType; import pwc.taxtech.atms.constant.enums.EnumTbImportType;
import pwc.taxtech.atms.dao.*; import pwc.taxtech.atms.dao.*;
import pwc.taxtech.atms.dto.CitDataImportLogDto; import pwc.taxtech.atms.dto.CitDataImportLogDto;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.vatdto.TrialBalanceDto;
import pwc.taxtech.atms.entity.*; import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.exception.ServiceException;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
...@@ -70,33 +72,41 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -70,33 +72,41 @@ public class CitImportExcelServiceImpl extends BaseService {
* @throws InvalidFormatException * @throws InvalidFormatException
* @throws ParseException * @throws ParseException
*/ */
public OperationResultDto citImportExcel(MultipartFile file, String fileName, String periodDate, Integer importType, Integer importFileType) throws IOException, InvalidFormatException, ParseException { public OperationResultDto citImportExcel(MultipartFile file,List<String> orgList, String fileName, String periodDate, Integer importType, Integer importFileType) throws IOException, InvalidFormatException, ParseException {
OperationResultDto operationResultDto = new OperationResultDto();
InputStream input = file.getInputStream(); InputStream input = file.getInputStream();
if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
}
Integer period = DateUtils.strToPeriod(periodDate);
//获取上传文件类型的枚举值
EnumCitImportType enumValue = EnumCitImportType.valueOf(importFileType); EnumCitImportType enumValue = EnumCitImportType.valueOf(importFileType);
switch (enumValue) { switch (enumValue) {
case JournalAdjust: case JournalAdjust:
importJournalAdjust(input, file.getOriginalFilename(), periodDate, importType); operationResultDto = importJournalAdjust(input, orgList, fileName, period, importType);
break; break;
case TrialBalance: case TrialBalance:
importTrialBalance(input, file.getOriginalFilename(), periodDate, importType); operationResultDto = importTrialBalance(input, orgList, fileName, period, importType);
break; break;
case DraftAccountMapping: case DraftAccountMapping:
importDraftAccountMapping(input, file.getOriginalFilename(), periodDate, importType); operationResultDto = importDraftAccountMapping(input, orgList, fileName, period, importType);
break; break;
case BalanceSheetPrcAdjust: case BalanceSheetPrcAdjust:
importBalanceSheetPrcAdjust(input, file.getOriginalFilename(), periodDate, importType); operationResultDto = importBalanceSheetPrcAdjust(input, orgList, fileName, period, importType);
break; break;
case ProfitPrcAdjust: case ProfitPrcAdjust:
importProfitPrcAdjust(input, file.getOriginalFilename(), periodDate, importType); operationResultDto = importProfitPrcAdjust(input, orgList, fileName, period, importType);
break; break;
case EAMAssetsDisposal: case EAMAssetsDisposal:
importEAMAssetsDisposal(input, file.getOriginalFilename(), periodDate, importType); operationResultDto = importEAMAssetsDisposal(input, orgList, fileName, period, importType);
break; break;
case SalaryAdvance: case SalaryAdvance:
importSalaryAdvance(input, file.getOriginalFilename(), periodDate, importType); operationResultDto = importSalaryAdvance(input, orgList, fileName, period, importType);
break; break;
} }
return null; return operationResultDto;
} }
/** /**
...@@ -110,7 +120,7 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -110,7 +120,7 @@ public class CitImportExcelServiceImpl extends BaseService {
* @throws InvalidFormatException * @throws InvalidFormatException
* @throws ParseException * @throws ParseException
*/ */
public OperationResultDto importJournalAdjust(InputStream inputStream, String fileName, String periodDate, Integer importType) throws IOException, InvalidFormatException, ParseException { public OperationResultDto importJournalAdjust(InputStream inputStream, List<String> orgList, String fileName, Integer period, Integer importType) throws IOException, InvalidFormatException, ParseException {
OperationResultDto<Object> saveResult = new OperationResultDto<>(); OperationResultDto<Object> saveResult = new OperationResultDto<>();
Workbook workbook = fileService.getWorkbook(inputStream, fileName, "citJournalAdjust"); Workbook workbook = fileService.getWorkbook(inputStream, fileName, "citJournalAdjust");
if (workbook == null) { if (workbook == null) {
...@@ -128,7 +138,7 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -128,7 +138,7 @@ public class CitImportExcelServiceImpl extends BaseService {
List<CitJournalEntryAdjust> journalAdjustList = new ArrayList<>(); List<CitJournalEntryAdjust> journalAdjustList = new ArrayList<>();
List<CitDataImportLog> citDataImportLogList = new ArrayList<>(); List<CitDataImportLog> citDataImportLogList = new ArrayList<>();
Integer period = new Integer(CitCommonUtil.getValue(sheet.getRow(1).getCell(2)).toString().replace("-", "")); // Integer period = CitCommonUtil.getPeriod();
String companyName = CitCommonUtil.getValue(sheet.getRow(1).getCell(19)).toString(); String companyName = CitCommonUtil.getValue(sheet.getRow(1).getCell(19)).toString();
String companyCode = CitCommonUtil.getValue(sheet.getRow(1).getCell(9)).toString(); String companyCode = CitCommonUtil.getValue(sheet.getRow(1).getCell(9)).toString();
; ;
...@@ -140,7 +150,18 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -140,7 +150,18 @@ public class CitImportExcelServiceImpl extends BaseService {
taxPayerId = StringUtils.isNotEmpty(organizations.get(0).getLegalCode()) ? taxPayerId = StringUtils.isNotEmpty(organizations.get(0).getLegalCode()) ?
organizations.get(0).getLegalCode() : organizations.get(0).getTaxPayerNumber(); organizations.get(0).getLegalCode() : organizations.get(0).getTaxPayerNumber();
if(!orgList.contains(orgId)){
saveResult.setResult(false);
saveResult.setResultMsg(ErrorMessageCN.DoNotSelectCompany);
return saveResult;
}
}else{
saveResult.setResult(false);
saveResult.setResultMsg(ErrorMessageCN.NoCompanyError);
return saveResult;
} }
//通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理 //通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理
for (int rowNum = sheet.getFirstRowNum() + 1; rowNum <= sheet.getLastRowNum(); rowNum++) { for (int rowNum = sheet.getFirstRowNum() + 1; rowNum <= sheet.getLastRowNum(); rowNum++) {
...@@ -153,6 +174,7 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -153,6 +174,7 @@ public class CitImportExcelServiceImpl extends BaseService {
citJournal.setPeriod(period); citJournal.setPeriod(period);
citJournal.setOrganizationId(orgId); citJournal.setOrganizationId(orgId);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
citJournal.setAccountPeriod(new Integer(CitCommonUtil.getValue(rowData.getCell(2)).toString().replace("-", "")));
citJournal.setAccountingDate(sdf.parse(CitCommonUtil.getValue(rowData.getCell(3)).toString())); citJournal.setAccountingDate(sdf.parse(CitCommonUtil.getValue(rowData.getCell(3)).toString()));
citJournal.setVoucherNum(CitCommonUtil.getValue(rowData.getCell(7)).toString()); citJournal.setVoucherNum(CitCommonUtil.getValue(rowData.getCell(7)).toString());
citJournal.setDescription(CitCommonUtil.getValue(rowData.getCell(8)).toString()); citJournal.setDescription(CitCommonUtil.getValue(rowData.getCell(8)).toString());
...@@ -160,16 +182,29 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -160,16 +182,29 @@ public class CitImportExcelServiceImpl extends BaseService {
citJournal.setSegment3(CitCommonUtil.getValue(rowData.getCell(11)).toString()); citJournal.setSegment3(CitCommonUtil.getValue(rowData.getCell(11)).toString());
citJournal.setSegment1Name(CitCommonUtil.getValue(rowData.getCell(19)).toString()); citJournal.setSegment1Name(CitCommonUtil.getValue(rowData.getCell(19)).toString());
citJournal.setSegment3Name(CitCommonUtil.getValue(rowData.getCell(21)).toString()); citJournal.setSegment3Name(CitCommonUtil.getValue(rowData.getCell(21)).toString());
citJournal.setAccountedDr(new BigDecimal(CitCommonUtil.getValue(rowData.getCell(31)).toString())); Object cellvalue = CitCommonUtil.getValue(rowData.getCell(31));
citJournal.setAccountedCr(new BigDecimal(CitCommonUtil.getValue(rowData.getCell(32)).toString())); if(cellvalue == null){
cellvalue = "0";
}
citJournal.setAccountedDr(new BigDecimal(cellvalue.toString()));
cellvalue = CitCommonUtil.getValue(rowData.getCell(32));
if(cellvalue == null){
cellvalue = "0";
}
citJournal.setAccountedCr(new BigDecimal(cellvalue.toString()));
journalAdjustList.add(citJournal); journalAdjustList.add(citJournal);
} }
String msg = "追加导入成功";
if (EnumTbImportType.CoverImport.getCode().equals(importType)) { if (EnumTbImportType.CoverImport.getCode().equals(importType)) {
msg = "覆盖导入成功";
CitJournalEntryAdjustExample example = new CitJournalEntryAdjustExample(); CitJournalEntryAdjustExample example = new CitJournalEntryAdjustExample();
CitJournalEntryAdjustExample.Criteria criteria = example.createCriteria(); CitJournalEntryAdjustExample.Criteria criteria = example.createCriteria();
// criteria.andOrganizationIdEqualTo(orgId); criteria.andCreatedByEqualTo(authUserHelper.getCurrentAuditor().get());
criteria.andPeriodEqualTo(period);
citJournalEntryAdjustMapper.deleteByExample(example); citJournalEntryAdjustMapper.deleteByExample(example);
updateImportLog(1);
} }
int insertBatchNum = citJournalEntryAdjustMapper.insertBatch(journalAdjustList); int insertBatchNum = citJournalEntryAdjustMapper.insertBatch(journalAdjustList);
CitDataImportLog citDataImportLog = generalCitDataImportLog(companyCode, orgId, taxPayerId, CitDataImportLog citDataImportLog = generalCitDataImportLog(companyCode, orgId, taxPayerId,
...@@ -177,14 +212,13 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -177,14 +212,13 @@ public class CitImportExcelServiceImpl extends BaseService {
0, period % 100, 0, period % 100,
companyName, "日记账调整",true); companyName, "日记账调整",true);
citDataImportLog.setRecordSize(insertBatchNum); citDataImportLog.setRecordSize(insertBatchNum);
citDataImportLog.setErrorMsg("追加导入成功"); citDataImportLog.setErrorMsg(msg);
if (EnumTbImportType.CoverImport.getCode().equals(importType)) {
citDataImportLog.setErrorMsg("覆盖导入成功");
updateImportLog(1);
}
citDataImportLogList.add(citDataImportLog); citDataImportLogList.add(citDataImportLog);
addDataImportLog(citDataImportLogList); addDataImportLog(citDataImportLogList);
return null; saveResult.setResult(true);
saveResult.setResultMsg("导入成功");
return saveResult;
} }
/** /**
...@@ -198,7 +232,7 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -198,7 +232,7 @@ public class CitImportExcelServiceImpl extends BaseService {
* @throws InvalidFormatException * @throws InvalidFormatException
* @throws ParseException * @throws ParseException
*/ */
public OperationResultDto importTrialBalance(InputStream inputStream, String fileName, String periodDate, Integer importType) throws IOException, InvalidFormatException, ParseException { public OperationResultDto importTrialBalance(InputStream inputStream, List<String> orgList, String fileName, Integer period, Integer importType) throws IOException, InvalidFormatException, ParseException {
OperationResultDto<Object> saveResult = new OperationResultDto<>(); OperationResultDto<Object> saveResult = new OperationResultDto<>();
Workbook workbook = fileService.getWorkbook(inputStream, fileName, "citTrialBalance"); Workbook workbook = fileService.getWorkbook(inputStream, fileName, "citTrialBalance");
if (workbook == null) { if (workbook == null) {
...@@ -216,9 +250,12 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -216,9 +250,12 @@ public class CitImportExcelServiceImpl extends BaseService {
List<CitTrialBalance> trialBalanceList = new ArrayList<>(); List<CitTrialBalance> trialBalanceList = new ArrayList<>();
List<CitDataImportLog> citDataImportLogList = new ArrayList<>(); List<CitDataImportLog> citDataImportLogList = new ArrayList<>();
Integer period = CitCommonUtil.getPeriod(); //获取当前期间
// Integer period = CitCommonUtil.getPeriod();
Map<String, Integer> companySuccessMap = new HashMap();
Map<String, Integer> companyFailMap = new HashMap();
Map<String, Integer> noCompanyMap = new HashMap();
//通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理 //通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理
for (int rowNum = sheet.getFirstRowNum() + 8; rowNum <= sheet.getLastRowNum(); rowNum++) { for (int rowNum = sheet.getFirstRowNum() + 8; rowNum <= sheet.getLastRowNum(); rowNum++) {
...@@ -229,17 +266,49 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -229,17 +266,49 @@ public class CitImportExcelServiceImpl extends BaseService {
trialBalance.setId(idService.nextId()); trialBalance.setId(idService.nextId());
trialBalance.setPeriod(period); trialBalance.setPeriod(period);
String companyCode = CitCommonUtil.getValue(rowData.getCell(5)).toString(); CitDataImportLog citDataImportLogError = generalCitDataImportLog("", "", "",
EnumCitImportType.TrialBalance.getCode(), 0,
0, 0,
"", "试算平衡表", false);
citDataImportLogError.setRecordSize(1);
Object cellValue = CitCommonUtil.getValue(rowData.getCell(5));
if(cellValue == null){
citDataImportLogError.setErrorMsg("数据错误,第"+(rowNum+1)+"行主体为空");
citDataImportLogList.add(citDataImportLogError);
continue;
}
String companyCode = String.valueOf((int)(double)CitCommonUtil.getValue(rowData.getCell(5)));
//根据code(主体)获取机构相关信息
List<Organization> organizations = getOrganizationByCode(companyCode); List<Organization> organizations = getOrganizationByCode(companyCode);
String companyName = ""; String companyName = "";
String orgId = ""; String orgId = "";
String taxPayerId = ""; String taxPayerId = "";
if (organizations != null && organizations.size() > 0) { if (organizations != null && organizations.size() > 0) {
orgId = organizations.get(0).getId(); orgId = organizations.get(0).getId();
companyName = organizations.get(0).getName();
taxPayerId = StringUtils.isNotEmpty(organizations.get(0).getLegalCode()) ? taxPayerId = StringUtils.isNotEmpty(organizations.get(0).getLegalCode()) ?
organizations.get(0).getLegalCode() : organizations.get(0).getTaxPayerNumber(); organizations.get(0).getLegalCode() : organizations.get(0).getTaxPayerNumber();
companyName = organizations.get(0).getName();
//拼接公司相关信息,作为键,其Excel出现的数量作为值
StringBuilder sb = new StringBuilder(companyCode);
sb.append(",");
sb.append(orgId);
sb.append(",");
sb.append(taxPayerId);
sb.append(",");
sb.append(companyName);
if(!orgList.contains(orgId)){
companyFailMap.put(sb.toString(),companyFailMap.get(sb.toString())==null?1:companyFailMap.get(sb.toString())+1);
continue;
}
companySuccessMap.put(sb.toString(),companySuccessMap.get(sb.toString())==null?1:companySuccessMap.get(sb.toString())+1);
}else{
noCompanyMap.put(companyCode,companySuccessMap.get(companyCode)==null?1:companySuccessMap.get(companyCode)+1);
continue;
} }
trialBalance.setOrganizationId(orgId); trialBalance.setOrganizationId(orgId);
...@@ -252,34 +321,69 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -252,34 +321,69 @@ public class CitImportExcelServiceImpl extends BaseService {
trialBalanceList.add(trialBalance); trialBalanceList.add(trialBalance);
} }
int insertBatchNum = citTrialBalanceMapper.insertBatch(trialBalanceList); //判断导入的方式
CitDataImportLog citDataImportLog = generalCitDataImportLog("", "", "", String msg = "追加导入成功";
EnumCitImportType.TrialBalance.getCode(), period / 100,
0, period % 100,
"", "试算平衡表", true);
citDataImportLog.setRecordSize(insertBatchNum);
citDataImportLog.setErrorMsg("追加导入成功");
if (EnumTbImportType.CoverImport.getCode().equals(importType)) { if (EnumTbImportType.CoverImport.getCode().equals(importType)) {
citDataImportLog.setErrorMsg("覆盖导入成功"); //覆盖导入要删除原有的该操作人在当前期间导入的数据,且更改之前导入的日志记录状态
msg = "覆盖导入成功";
CitTrialBalanceExample citTrialBalanceExample = new CitTrialBalanceExample();
CitTrialBalanceExample.Criteria criteria = citTrialBalanceExample.createCriteria();
criteria.andCreateByEqualTo(authUserHelper.getCurrentAuditor().get());
criteria.andPeriodEqualTo(period);
citTrialBalanceMapper.deleteByExample(citTrialBalanceExample);
updateImportLog(1); updateImportLog(1);
} }
citDataImportLogList.add(citDataImportLog); int insertBatchNum = citTrialBalanceMapper.insertBatch(trialBalanceList);
//循环遍历成功导入的数据,组装日志记录实体并放入集合
for (Map.Entry<String, Integer> entry : companySuccessMap.entrySet()) {
String[] split = entry.getKey().split(",");
CitDataImportLog citDataImportLog = generalCitDataImportLog(split[0], split[1], split[2],
EnumCitImportType.TrialBalance.getCode(), period / 100,
0, period % 100,
split[3], "试算平衡表", true);
citDataImportLog.setRecordSize(entry.getValue());
citDataImportLog.setErrorMsg(msg);
citDataImportLogList.add(citDataImportLog);
}
for (Map.Entry<String, Integer> entry : companyFailMap.entrySet()) {
String[] split = entry.getKey().split(",");
CitDataImportLog citDataImportLogError = generalCitDataImportLog(split[0], split[1], split[2],
EnumCitImportType.TrialBalance.getCode(), period / 100,
0, period % 100,
split[3], "试算平衡表", false);
citDataImportLogError.setRecordSize(entry.getValue());
citDataImportLogError.setErrorMsg(ErrorMessageCN.DoNotSelectCompany);
citDataImportLogList.add(citDataImportLogError);
}
for (Map.Entry<String, Integer> entry : noCompanyMap.entrySet()) {
CitDataImportLog citDataImportLogError = generalCitDataImportLog(entry.getKey(), "", "",
EnumCitImportType.TrialBalance.getCode(), 0,
0, 0,
"", "试算平衡表", false);
citDataImportLogError.setRecordSize(entry.getValue());
citDataImportLogError.setErrorMsg(ErrorMessageCN.NoCompanyError);
citDataImportLogList.add(citDataImportLogError);
}
addDataImportLog(citDataImportLogList); addDataImportLog(citDataImportLogList);
return null; saveResult.setResult(true);
saveResult.setResultMsg("导入成功");
return saveResult;
} }
/** /**
* 导入底稿&科目Mapping表 * 导入底稿&科目Mapping表
* @param inputStream * @param inputStream
* @param fileName * @param fileName
* @param periodDate * @param period
* @param importType * @param importType
* @return * @return
* @throws IOException * @throws IOException
* @throws InvalidFormatException * @throws InvalidFormatException
* @throws ParseException * @throws ParseException
*/ */
public OperationResultDto importDraftAccountMapping(InputStream inputStream, String fileName, String periodDate, Integer importType) throws IOException, InvalidFormatException, ParseException { public OperationResultDto importDraftAccountMapping(InputStream inputStream, List<String> orgList, String fileName, Integer period, Integer importType) throws IOException, InvalidFormatException, ParseException {
OperationResultDto<Object> saveResult = new OperationResultDto<>(); OperationResultDto<Object> saveResult = new OperationResultDto<>();
Workbook workbook = fileService.getWorkbook(inputStream, fileName, "citDraftAccountMapping"); Workbook workbook = fileService.getWorkbook(inputStream, fileName, "citDraftAccountMapping");
if (workbook == null) { if (workbook == null) {
...@@ -297,17 +401,7 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -297,17 +401,7 @@ public class CitImportExcelServiceImpl extends BaseService {
List<CitDraftAccountMapping> citDAMappings = new ArrayList<>(); List<CitDraftAccountMapping> citDAMappings = new ArrayList<>();
List<CitDataImportLog> citDataImportLogList = new ArrayList<>(); List<CitDataImportLog> citDataImportLogList = new ArrayList<>();
Integer period = CitCommonUtil.getPeriod(); // Integer period = CitCommonUtil.getPeriod();
// List<Organization> organizations = getOrganization(companyCode);
// String orgId = "";
// String taxPayerId = "";
// if (organizations != null && organizations.size() > 0) {
// orgId = organizations.get(0).getId();
// taxPayerId = StringUtils.isNotEmpty(organizations.get(0).getLegalCode()) ?
// organizations.get(0).getLegalCode() : organizations.get(0).getTaxPayerNumber();
//
// }
//通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理 //通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理
for (int rowNum = sheet.getFirstRowNum() + 1; rowNum <= sheet.getLastRowNum(); rowNum++) { for (int rowNum = sheet.getFirstRowNum() + 1; rowNum <= sheet.getLastRowNum(); rowNum++) {
...@@ -348,34 +442,44 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -348,34 +442,44 @@ public class CitImportExcelServiceImpl extends BaseService {
citDAMapping.setAttribute(cellValue.toString()); citDAMapping.setAttribute(cellValue.toString());
citDAMappings.add(citDAMapping); citDAMappings.add(citDAMapping);
} }
String msg = "追加导入成功";
if (EnumTbImportType.CoverImport.getCode().equals(importType)) {
msg = "覆盖导入成功";
CitDraftAccountMappingExample example = new CitDraftAccountMappingExample();
CitDraftAccountMappingExample.Criteria criteria = example.createCriteria();
criteria.andCreatedByEqualTo(authUserHelper.getCurrentAuditor().get());
criteria.andPeriodEqualTo(period);
citDAMappingMapper.deleteByExample(example);
updateImportLog(1);
}
int insertBatchNum = citDAMappingMapper.insertBatch(citDAMappings); int insertBatchNum = citDAMappingMapper.insertBatch(citDAMappings);
CitDataImportLog citDataImportLog = generalCitDataImportLog("", "", "", CitDataImportLog citDataImportLog = generalCitDataImportLog("", "", "",
EnumCitImportType.DraftAccountMapping.getCode(), period / 100, EnumCitImportType.DraftAccountMapping.getCode(), period / 100,
0, period % 100, 0, period % 100,
"", "底稿&科目Mapping表", true); "", "底稿&科目Mapping表", true);
citDataImportLog.setRecordSize(insertBatchNum); citDataImportLog.setRecordSize(insertBatchNum);
citDataImportLog.setErrorMsg("追加导入成功"); citDataImportLog.setErrorMsg(msg);
if (EnumTbImportType.CoverImport.getCode().equals(importType)) {
citDataImportLog.setErrorMsg("覆盖导入成功");
updateImportLog(1);
}
citDataImportLogList.add(citDataImportLog); citDataImportLogList.add(citDataImportLog);
addDataImportLog(citDataImportLogList); addDataImportLog(citDataImportLogList);
return null; saveResult.setResult(true);
saveResult.setResultMsg("导入成功");
return saveResult;
} }
/** /**
* 导入资产负债表(单家PRC) * 导入资产负债表(单家PRC)
* @param inputStream * @param inputStream
* @param fileName * @param fileName
* @param periodDate * @param period
* @param importType * @param importType
* @return * @return
* @throws IOException * @throws IOException
* @throws InvalidFormatException * @throws InvalidFormatException
* @throws ParseException * @throws ParseException
*/ */
public OperationResultDto importBalanceSheetPrcAdjust(InputStream inputStream, String fileName, String periodDate, Integer importType) throws IOException, InvalidFormatException, ParseException { public OperationResultDto importBalanceSheetPrcAdjust(InputStream inputStream, List<String> orgList, String fileName, Integer period, Integer importType) throws IOException, InvalidFormatException, ParseException {
OperationResultDto<Object> saveResult = new OperationResultDto<>(); OperationResultDto<Object> saveResult = new OperationResultDto<>();
Workbook workbook = fileService.getWorkbook(inputStream, fileName, "citTrialBalance"); Workbook workbook = fileService.getWorkbook(inputStream, fileName, "citTrialBalance");
if (workbook == null) { if (workbook == null) {
...@@ -393,7 +497,7 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -393,7 +497,7 @@ public class CitImportExcelServiceImpl extends BaseService {
List<CitBalanceSheetPrcAdjust> citBSPrcAdjustList = new ArrayList<>(); List<CitBalanceSheetPrcAdjust> citBSPrcAdjustList = new ArrayList<>();
List<CitDataImportLog> citDataImportLogList = new ArrayList<>(); List<CitDataImportLog> citDataImportLogList = new ArrayList<>();
Integer period = CitCommonUtil.getPeriod(); // Integer period = CitCommonUtil.getPeriod();
String companyName = CitCommonUtil.getValue(sheet.getRow(5).getCell(1)).toString(); String companyName = CitCommonUtil.getValue(sheet.getRow(5).getCell(1)).toString();
List<Organization> organizations = getOrganizationByName(companyName); List<Organization> organizations = getOrganizationByName(companyName);
String companyCode = ""; String companyCode = "";
...@@ -402,9 +506,20 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -402,9 +506,20 @@ public class CitImportExcelServiceImpl extends BaseService {
if (organizations != null && organizations.size() > 0) { if (organizations != null && organizations.size() > 0) {
companyCode = organizations.get(0).getCode(); companyCode = organizations.get(0).getCode();
orgId = organizations.get(0).getId(); orgId = organizations.get(0).getId();
if(!orgList.contains(orgId)){
saveResult.setResult(false);
saveResult.setResultMsg(ErrorMessageCN.DoNotSelectCompany);
return saveResult;
}
taxPayerId = StringUtils.isNotEmpty(organizations.get(0).getLegalCode()) ? taxPayerId = StringUtils.isNotEmpty(organizations.get(0).getLegalCode()) ?
organizations.get(0).getLegalCode() : organizations.get(0).getTaxPayerNumber(); organizations.get(0).getLegalCode() : organizations.get(0).getTaxPayerNumber();
}else{
saveResult.setResult(false);
saveResult.setResultMsg(ErrorMessageCN.NoCompanyError);
return saveResult;
} }
//通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理 //通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理
...@@ -451,17 +566,25 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -451,17 +566,25 @@ public class CitImportExcelServiceImpl extends BaseService {
citBSPrcAdjust.setEndBal(new BigDecimal(cellValue.toString().replace(",",""))); citBSPrcAdjust.setEndBal(new BigDecimal(cellValue.toString().replace(",","")));
citBSPrcAdjustList.add(citBSPrcAdjust); citBSPrcAdjustList.add(citBSPrcAdjust);
} }
String msg = "追加导入成功";
if (EnumTbImportType.CoverImport.getCode().equals(importType)) {
msg = "覆盖导入成功";
CitBalanceSheetPrcAdjustExample example = new CitBalanceSheetPrcAdjustExample();
CitBalanceSheetPrcAdjustExample.Criteria criteria = example.createCriteria();
criteria.andCreateByEqualTo(authUserHelper.getCurrentAuditor().get());
criteria.andPeriodEqualTo(period);
citBSPrcAdjustMapper.deleteByExample(example);
updateImportLog(1);
}
int insertBatchNum = citBSPrcAdjustMapper.insertBatch(citBSPrcAdjustList); int insertBatchNum = citBSPrcAdjustMapper.insertBatch(citBSPrcAdjustList);
CitDataImportLog citDataImportLog = generalCitDataImportLog(companyCode, orgId, taxPayerId, CitDataImportLog citDataImportLog = generalCitDataImportLog(companyCode, orgId, taxPayerId,
EnumCitImportType.BalanceSheetPrcAdjust.getCode(), period / 100, EnumCitImportType.BalanceSheetPrcAdjust.getCode(), period / 100,
0, period % 100, 0, period % 100,
companyName, "资产负债表(单家PRC)", true); companyName, "资产负债表(单家PRC)", true);
citDataImportLog.setRecordSize(insertBatchNum); citDataImportLog.setRecordSize(insertBatchNum);
citDataImportLog.setErrorMsg("追加导入成功"); citDataImportLog.setErrorMsg(msg);
if (EnumTbImportType.CoverImport.getCode().equals(importType)) {
citDataImportLog.setErrorMsg("覆盖导入成功");
updateImportLog(1);
}
citDataImportLogList.add(citDataImportLog); citDataImportLogList.add(citDataImportLog);
addDataImportLog(citDataImportLogList); addDataImportLog(citDataImportLogList);
return null; return null;
...@@ -471,14 +594,14 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -471,14 +594,14 @@ public class CitImportExcelServiceImpl extends BaseService {
* 导入利润表(单家PRC) * 导入利润表(单家PRC)
* @param inputStream * @param inputStream
* @param fileName * @param fileName
* @param periodDate * @param period
* @param importType * @param importType
* @return * @return
* @throws IOException * @throws IOException
* @throws InvalidFormatException * @throws InvalidFormatException
* @throws ParseException * @throws ParseException
*/ */
public OperationResultDto importProfitPrcAdjust(InputStream inputStream, String fileName, String periodDate, Integer importType) throws IOException, InvalidFormatException, ParseException { public OperationResultDto importProfitPrcAdjust(InputStream inputStream, List<String> orgList, String fileName, Integer period, Integer importType) throws IOException, InvalidFormatException, ParseException {
OperationResultDto<Object> saveResult = new OperationResultDto<>(); OperationResultDto<Object> saveResult = new OperationResultDto<>();
Workbook workbook = fileService.getWorkbook(inputStream, fileName, "citTrialBalance"); Workbook workbook = fileService.getWorkbook(inputStream, fileName, "citTrialBalance");
if (workbook == null) { if (workbook == null) {
...@@ -496,7 +619,7 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -496,7 +619,7 @@ public class CitImportExcelServiceImpl extends BaseService {
List<CitProfitPrcAdjust> citProfitPrcAdjustList = new ArrayList<>(); List<CitProfitPrcAdjust> citProfitPrcAdjustList = new ArrayList<>();
List<CitDataImportLog> citDataImportLogList = new ArrayList<>(); List<CitDataImportLog> citDataImportLogList = new ArrayList<>();
Integer period = CitCommonUtil.getPeriod(); // Integer period = CitCommonUtil.getPeriod();
String companyName = CitCommonUtil.getValue(sheet.getRow(4).getCell(1)).toString(); String companyName = CitCommonUtil.getValue(sheet.getRow(4).getCell(1)).toString();
String companyCode = CitCommonUtil.getValue(sheet.getRow(5).getCell(1)).toString(); String companyCode = CitCommonUtil.getValue(sheet.getRow(5).getCell(1)).toString();
List<Organization> organizations = getOrganizationByCode(companyCode); List<Organization> organizations = getOrganizationByCode(companyCode);
...@@ -504,9 +627,20 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -504,9 +627,20 @@ public class CitImportExcelServiceImpl extends BaseService {
String taxPayerId = ""; String taxPayerId = "";
if (organizations != null && organizations.size() > 0) { if (organizations != null && organizations.size() > 0) {
orgId = organizations.get(0).getId(); orgId = organizations.get(0).getId();
if(!orgList.contains(orgId)){
saveResult.setResult(false);
saveResult.setResultMsg(ErrorMessageCN.DoNotSelectCompany);
return saveResult;
}
taxPayerId = StringUtils.isNotEmpty(organizations.get(0).getLegalCode()) ? taxPayerId = StringUtils.isNotEmpty(organizations.get(0).getLegalCode()) ?
organizations.get(0).getLegalCode() : organizations.get(0).getTaxPayerNumber(); organizations.get(0).getLegalCode() : organizations.get(0).getTaxPayerNumber();
}else{
saveResult.setResult(false);
saveResult.setResultMsg(ErrorMessageCN.DoNotSelectCompany);
return saveResult;
} }
//通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理 //通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理
...@@ -550,17 +684,25 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -550,17 +684,25 @@ public class CitImportExcelServiceImpl extends BaseService {
citProfitPrcAdjust.setYtdAmt(new BigDecimal(cellValue.toString().replace(",",""))); citProfitPrcAdjust.setYtdAmt(new BigDecimal(cellValue.toString().replace(",","")));
citProfitPrcAdjustList.add(citProfitPrcAdjust); citProfitPrcAdjustList.add(citProfitPrcAdjust);
} }
String msg = "追加导入成功";
if (EnumTbImportType.CoverImport.getCode().equals(importType)) {
msg = "覆盖导入成功";
CitProfitPrcAdjustExample example = new CitProfitPrcAdjustExample();
CitProfitPrcAdjustExample.Criteria criteria = example.createCriteria();
criteria.andCreateByEqualTo(authUserHelper.getCurrentAuditor().get());
criteria.andPeriodEqualTo(period);
citProfitPrcAdjustMapper.deleteByExample(example);
updateImportLog(1);
}
int insertBatchNum = citProfitPrcAdjustMapper.insertBatch(citProfitPrcAdjustList); int insertBatchNum = citProfitPrcAdjustMapper.insertBatch(citProfitPrcAdjustList);
CitDataImportLog citDataImportLog = generalCitDataImportLog(companyCode, orgId, taxPayerId, CitDataImportLog citDataImportLog = generalCitDataImportLog(companyCode, orgId, taxPayerId,
EnumCitImportType.ProfitPrcAdjust.getCode(), period / 100, EnumCitImportType.ProfitPrcAdjust.getCode(), period / 100,
0, period % 100, 0, period % 100,
companyName, "利润表(单家PRC)", true); companyName, "利润表(单家PRC)", true);
citDataImportLog.setRecordSize(insertBatchNum); citDataImportLog.setRecordSize(insertBatchNum);
citDataImportLog.setErrorMsg("追加导入成功"); citDataImportLog.setErrorMsg(msg);
if (EnumTbImportType.CoverImport.getCode().equals(importType)) {
citDataImportLog.setErrorMsg("覆盖导入成功");
updateImportLog(1);
}
citDataImportLogList.add(citDataImportLog); citDataImportLogList.add(citDataImportLog);
addDataImportLog(citDataImportLogList); addDataImportLog(citDataImportLogList);
return null; return null;
...@@ -570,14 +712,14 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -570,14 +712,14 @@ public class CitImportExcelServiceImpl extends BaseService {
* 导入EAM资产处置金额记录表 * 导入EAM资产处置金额记录表
* @param inputStream * @param inputStream
* @param fileName * @param fileName
* @param periodDate * @param period
* @param importType * @param importType
* @return * @return
* @throws IOException * @throws IOException
* @throws InvalidFormatException * @throws InvalidFormatException
* @throws ParseException * @throws ParseException
*/ */
public OperationResultDto importEAMAssetsDisposal(InputStream inputStream, String fileName, String periodDate, Integer importType) throws IOException, InvalidFormatException, ParseException { public OperationResultDto importEAMAssetsDisposal(InputStream inputStream, List<String> orgList, String fileName, Integer period, Integer importType) throws IOException, InvalidFormatException, ParseException {
OperationResultDto<Object> saveResult = new OperationResultDto<>(); OperationResultDto<Object> saveResult = new OperationResultDto<>();
Workbook workbook = fileService.getWorkbook(inputStream, fileName, "citTrialBalance"); Workbook workbook = fileService.getWorkbook(inputStream, fileName, "citTrialBalance");
if (workbook == null) { if (workbook == null) {
...@@ -595,16 +737,7 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -595,16 +737,7 @@ public class CitImportExcelServiceImpl extends BaseService {
List<CitEAMAssetsDisposal> citEAMAssetsList = new ArrayList<>(); List<CitEAMAssetsDisposal> citEAMAssetsList = new ArrayList<>();
List<CitDataImportLog> citDataImportLogList = new ArrayList<>(); List<CitDataImportLog> citDataImportLogList = new ArrayList<>();
Integer period = CitCommonUtil.getPeriod(); // Integer period = CitCommonUtil.getPeriod();
// List<Organization> organizations = getOrganization(companyCode);
// String orgId = "";
// String taxPayerId = "";
// if (organizations != null && organizations.size() > 0) {
// orgId = organizations.get(0).getId();
// taxPayerId = StringUtils.isNotEmpty(organizations.get(0).getLegalCode()) ?
// organizations.get(0).getLegalCode() : organizations.get(0).getTaxPayerNumber();
//
// }
//通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理 //通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理
for (int rowNum = sheet.getFirstRowNum() + 3; rowNum <= sheet.getLastRowNum(); rowNum++) { for (int rowNum = sheet.getFirstRowNum() + 3; rowNum <= sheet.getLastRowNum(); rowNum++) {
...@@ -633,17 +766,25 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -633,17 +766,25 @@ public class CitImportExcelServiceImpl extends BaseService {
citEAMAssetsDisposal.setCompensationSaleAmount(new BigDecimal(CitCommonUtil.getValue(rowData.getCell(7)).toString())); citEAMAssetsDisposal.setCompensationSaleAmount(new BigDecimal(CitCommonUtil.getValue(rowData.getCell(7)).toString()));
citEAMAssetsList.add(citEAMAssetsDisposal); citEAMAssetsList.add(citEAMAssetsDisposal);
} }
String msg = "追加导入成功";
if (EnumTbImportType.CoverImport.getCode().equals(importType)) {
msg = "覆盖导入成功";
CitEAMAssetsDisposalExample example = new CitEAMAssetsDisposalExample();
CitEAMAssetsDisposalExample.Criteria criteria = example.createCriteria();
criteria.andCreatedByEqualTo(authUserHelper.getCurrentAuditor().get());
criteria.andPeriodEqualTo(period);
citEAMAssetsMapper.deleteByExample(example);
updateImportLog(1);
}
int insertBatchNum = citEAMAssetsMapper.insertBatch(citEAMAssetsList); int insertBatchNum = citEAMAssetsMapper.insertBatch(citEAMAssetsList);
CitDataImportLog citDataImportLog = generalCitDataImportLog("", "", "", CitDataImportLog citDataImportLog = generalCitDataImportLog("", "", "",
EnumCitImportType.EAMAssetsDisposal.getCode(), period / 100, EnumCitImportType.EAMAssetsDisposal.getCode(), period / 100,
0, period % 100, 0, period % 100,
"", "EAM资产处置金额记录表", true); "", "EAM资产处置金额记录表", true);
citDataImportLog.setRecordSize(insertBatchNum); citDataImportLog.setRecordSize(insertBatchNum);
citDataImportLog.setErrorMsg("追加导入成功"); citDataImportLog.setErrorMsg(msg);
if (EnumTbImportType.CoverImport.getCode().equals(importType)) {
citDataImportLog.setErrorMsg("覆盖导入成功");
updateImportLog(1);
}
citDataImportLogList.add(citDataImportLog); citDataImportLogList.add(citDataImportLog);
addDataImportLog(citDataImportLogList); addDataImportLog(citDataImportLogList);
return null; return null;
...@@ -653,14 +794,14 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -653,14 +794,14 @@ public class CitImportExcelServiceImpl extends BaseService {
* 导入预提重分类数据 * 导入预提重分类数据
* @param inputStream * @param inputStream
* @param fileName * @param fileName
* @param periodDate * @param period
* @param importType * @param importType
* @return * @return
* @throws IOException * @throws IOException
* @throws InvalidFormatException * @throws InvalidFormatException
* @throws ParseException * @throws ParseException
*/ */
public OperationResultDto importSalaryAdvance(InputStream inputStream, String fileName, String periodDate, Integer importType) throws IOException, InvalidFormatException, ParseException { public OperationResultDto importSalaryAdvance(InputStream inputStream, List<String> orgList, String fileName, Integer period, Integer importType) throws IOException, InvalidFormatException, ParseException {
OperationResultDto<Object> saveResult = new OperationResultDto<>(); OperationResultDto<Object> saveResult = new OperationResultDto<>();
Workbook workbook = fileService.getWorkbook(inputStream, fileName, "citTrialBalance"); Workbook workbook = fileService.getWorkbook(inputStream, fileName, "citTrialBalance");
if (workbook == null) { if (workbook == null) {
...@@ -678,20 +819,11 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -678,20 +819,11 @@ public class CitImportExcelServiceImpl extends BaseService {
List<CitSalaryAdvance> citSalaryAdvanceList = new ArrayList<>(); List<CitSalaryAdvance> citSalaryAdvanceList = new ArrayList<>();
List<CitDataImportLog> citDataImportLogList = new ArrayList<>(); List<CitDataImportLog> citDataImportLogList = new ArrayList<>();
Integer period = CitCommonUtil.getPeriod(); // Integer period = CitCommonUtil.getPeriod();
// String companyName = CitCommonUtil.getValue(sheet.getRow(1).getCell(19)).toString();
// String companyCode = CitCommonUtil.getValue(sheet.getRow(1).getCell(9)).toString();
// ;
// List<Organization> organizations = getOrganization(companyCode);
// String orgId = "";
// String taxPayerId = "";
// if (organizations != null && organizations.size() > 0) {
// orgId = organizations.get(0).getId();
// taxPayerId = StringUtils.isNotEmpty(organizations.get(0).getLegalCode()) ?
// organizations.get(0).getLegalCode() : organizations.get(0).getTaxPayerNumber();
//
// }
Map<String, Integer> companySuccessMap = new HashMap();
Map<String, Integer> companyFailMap = new HashMap();
Map<String, Integer> noCompanyMap = new HashMap();
//通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理 //通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理
for (int rowNum = sheet.getFirstRowNum() + 2; rowNum <= sheet.getLastRowNum(); rowNum++) { for (int rowNum = sheet.getFirstRowNum() + 2; rowNum <= sheet.getLastRowNum(); rowNum++) {
...@@ -704,6 +836,46 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -704,6 +836,46 @@ public class CitImportExcelServiceImpl extends BaseService {
"", "预提重分类数据源", false); "", "预提重分类数据源", false);
citDataImportLogError.setRecordSize(1); citDataImportLogError.setRecordSize(1);
Object cellValueCode = CitCommonUtil.getValue(rowData.getCell(5));
if(cellValueCode == null){
citDataImportLogError.setErrorMsg("第"+(rowNum+1)+"行PO主体CODE为空");
citDataImportLogList.add(citDataImportLogError);
continue;
}
String companyCode = cellValueCode.toString();
//根据code(主体)获取机构相关信息
List<Organization> organizations = getOrganizationByCode(companyCode);
String companyName = "";
String orgId = "";
String taxPayerId = "";
//判断是否查询到该机构,若数据库中不存在则不执行导入并记录日志
if (organizations != null && organizations.size() > 0) {
orgId = organizations.get(0).getId();
taxPayerId = StringUtils.isNotEmpty(organizations.get(0).getLegalCode()) ?
organizations.get(0).getLegalCode() : organizations.get(0).getTaxPayerNumber();
companyName = organizations.get(0).getName();
//拼接公司相关信息,作为键,其Excel出现的数量作为值
StringBuilder sb = new StringBuilder(companyCode);
sb.append(",");
sb.append(orgId);
sb.append(",");
sb.append(taxPayerId);
sb.append(",");
sb.append(companyName);
if(!orgList.contains(orgId)){
companyFailMap.put(sb.toString(),companyFailMap.get(sb.toString())==null?1:companyFailMap.get(sb.toString())+1);
continue;
}
companySuccessMap.put(sb.toString(),companySuccessMap.get(sb.toString())==null?1:companySuccessMap.get(sb.toString())+1);
}else{
noCompanyMap.put(companyCode,companySuccessMap.get(companyCode)==null?1:companySuccessMap.get(companyCode)+1);
continue;
}
CitSalaryAdvance citSalaryAdvance = new CitSalaryAdvance(); CitSalaryAdvance citSalaryAdvance = new CitSalaryAdvance();
citSalaryAdvance.setId(idService.nextId()); citSalaryAdvance.setId(idService.nextId());
citSalaryAdvance.setPeriod(Integer.valueOf(CitCommonUtil.getPeriod().toString())); citSalaryAdvance.setPeriod(Integer.valueOf(CitCommonUtil.getPeriod().toString()));
...@@ -716,13 +888,7 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -716,13 +888,7 @@ public class CitImportExcelServiceImpl extends BaseService {
} }
citSalaryAdvance.setPoNo(cellValue.toString()); citSalaryAdvance.setPoNo(cellValue.toString());
cellValue = CitCommonUtil.getValue(rowData.getCell(5)); citSalaryAdvance.setPoSubjectCode(cellValueCode.toString());
if(cellValue == null){
citDataImportLogError.setErrorMsg("第"+(rowNum+1)+"行PO主体CODE为空");
citDataImportLogList.add(citDataImportLogError);
continue;
}
citSalaryAdvance.setPoSubjectCode(CitCommonUtil.getValue(rowData.getCell(5)).toString());
cellValue = CitCommonUtil.getValue(rowData.getCell(6)); cellValue = CitCommonUtil.getValue(rowData.getCell(6));
if(cellValue == null){ if(cellValue == null){
...@@ -743,18 +909,54 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -743,18 +909,54 @@ public class CitImportExcelServiceImpl extends BaseService {
citSalaryAdvanceList.add(citSalaryAdvance); citSalaryAdvanceList.add(citSalaryAdvance);
} }
//判断导入的方式
String msg = "追加导入成功";
if (EnumTbImportType.CoverImport.getCode().equals(importType)) {
//覆盖导入要删除原有的该操作人在当前期间导入的数据,且更改之前导入的日志记录状态
msg = "覆盖导入成功";
CitSalaryAdvanceExample example = new CitSalaryAdvanceExample();
CitSalaryAdvanceExample.Criteria criteria = example.createCriteria();
criteria.andCreatedByEqualTo(authUserHelper.getCurrentAuditor().get());
criteria.andPeriodEqualTo(period);
citSalaryAdvanceMapper.deleteByExample(example);
updateImportLog(1);
}
int insertBatchNum = citSalaryAdvanceMapper.insertBatch(citSalaryAdvanceList); int insertBatchNum = citSalaryAdvanceMapper.insertBatch(citSalaryAdvanceList);
CitDataImportLog citDataImportLog = generalCitDataImportLog("", "", "",
EnumCitImportType.SalaryAdvance.getCode(), period / 100, //循环遍历成功导入的数据,组装日志记录实体并放入集合
0, period % 100, for (Map.Entry<String, Integer> entry : companySuccessMap.entrySet()) {
"", "预提重分类数据源", true); String[] split = entry.getKey().split(",");
citDataImportLog.setRecordSize(insertBatchNum); CitDataImportLog citDataImportLog = generalCitDataImportLog(split[0], split[1], split[2],
citDataImportLog.setErrorMsg("追加导入成功"); EnumCitImportType.SalaryAdvance.getCode(), period / 100,
0, period % 100,
split[3], "预提重分类数据源", true);
citDataImportLog.setRecordSize(entry.getValue());
citDataImportLog.setErrorMsg(msg);
citDataImportLogList.add(citDataImportLog);
}
for (Map.Entry<String, Integer> entry : companyFailMap.entrySet()) {
String[] split = entry.getKey().split(",");
CitDataImportLog citDataImportLogError = generalCitDataImportLog(split[0], split[1], split[2],
EnumCitImportType.SalaryAdvance.getCode(), period / 100,
0, period % 100,
split[3], "预提重分类数据源", false);
citDataImportLogError.setRecordSize(entry.getValue());
citDataImportLogError.setErrorMsg(ErrorMessageCN.DoNotSelectCompany);
citDataImportLogList.add(citDataImportLogError);
}
for (Map.Entry<String, Integer> entry : noCompanyMap.entrySet()) {
CitDataImportLog citDataImportLogError = generalCitDataImportLog(entry.getKey(), "", "",
EnumCitImportType.SalaryAdvance.getCode(), 0,
0, 0,
"", "预提重分类数据源", false);
citDataImportLogError.setRecordSize(entry.getValue());
citDataImportLogError.setErrorMsg(ErrorMessageCN.NoCompanyError);
citDataImportLogList.add(citDataImportLogError);
}
if (EnumTbImportType.CoverImport.getCode().equals(importType)) { if (EnumTbImportType.CoverImport.getCode().equals(importType)) {
citDataImportLog.setErrorMsg("覆盖导入成功");
updateImportLog(1); updateImportLog(1);
} }
citDataImportLogList.add(citDataImportLog);
addDataImportLog(citDataImportLogList); addDataImportLog(citDataImportLogList);
return null; return null;
} }
......
...@@ -106,5 +106,5 @@ public interface CitBalanceSheetPrcAdjustMapper extends MyMapper { ...@@ -106,5 +106,5 @@ public interface CitBalanceSheetPrcAdjustMapper extends MyMapper {
*/ */
int updateByPrimaryKey(CitBalanceSheetPrcAdjust record); int updateByPrimaryKey(CitBalanceSheetPrcAdjust record);
int insertBatch(List<CitBalanceSheetPrcAdjust> citBalanceSheetPrcAdjustList); int insertBatch(List<CitBalanceSheetPrcAdjust> citBsPrcAdjustList);
} }
\ No newline at end of file
...@@ -106,5 +106,5 @@ public interface CitJournalEntryAdjustMapper extends MyMapper { ...@@ -106,5 +106,5 @@ public interface CitJournalEntryAdjustMapper extends MyMapper {
*/ */
int updateByPrimaryKey(CitJournalEntryAdjust record); int updateByPrimaryKey(CitJournalEntryAdjust record);
int insertBatch(List<CitJournalEntryAdjust> citJournalEntryAdjusts); int insertBatch(List<CitJournalEntryAdjust> citJournalAdjustList);
} }
\ No newline at end of file
...@@ -5,7 +5,6 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -5,7 +5,6 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyMapper; import pwc.taxtech.atms.MyMapper;
import pwc.taxtech.atms.entity.CitJournalEntryAdjust;
import pwc.taxtech.atms.entity.CitTrialBalance; import pwc.taxtech.atms.entity.CitTrialBalance;
import pwc.taxtech.atms.entity.CitTrialBalanceExample; import pwc.taxtech.atms.entity.CitTrialBalanceExample;
......
...@@ -122,6 +122,17 @@ public class CitBalanceSheetPrcAdjust extends BaseEntity implements Serializable ...@@ -122,6 +122,17 @@ public class CitBalanceSheetPrcAdjust extends BaseEntity implements Serializable
*/ */
private BigDecimal begBal; private BigDecimal begBal;
/**
* Database Column Remarks:
* 创建人
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_balance_sheet_prc_adjust.create_by
*
* @mbg.generated
*/
private String createBy;
/** /**
* Database Column Remarks: * Database Column Remarks:
* 创建时间 * 创建时间
...@@ -392,6 +403,30 @@ public class CitBalanceSheetPrcAdjust extends BaseEntity implements Serializable ...@@ -392,6 +403,30 @@ public class CitBalanceSheetPrcAdjust extends BaseEntity implements Serializable
this.begBal = begBal; this.begBal = begBal;
} }
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_balance_sheet_prc_adjust.create_by
*
* @return the value of cit_balance_sheet_prc_adjust.create_by
*
* @mbg.generated
*/
public String getCreateBy() {
return createBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_balance_sheet_prc_adjust.create_by
*
* @param createBy the value for cit_balance_sheet_prc_adjust.create_by
*
* @mbg.generated
*/
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_balance_sheet_prc_adjust.create_time * This method returns the value of the database column cit_balance_sheet_prc_adjust.create_time
...@@ -462,6 +497,7 @@ public class CitBalanceSheetPrcAdjust extends BaseEntity implements Serializable ...@@ -462,6 +497,7 @@ public class CitBalanceSheetPrcAdjust extends BaseEntity implements Serializable
sb.append(", itemName=").append(itemName); sb.append(", itemName=").append(itemName);
sb.append(", endBal=").append(endBal); sb.append(", endBal=").append(endBal);
sb.append(", begBal=").append(begBal); sb.append(", begBal=").append(begBal);
sb.append(", createBy=").append(createBy);
sb.append(", createTime=").append(createTime); sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
sb.append("]"); sb.append("]");
......
...@@ -836,6 +836,76 @@ public class CitBalanceSheetPrcAdjustExample { ...@@ -836,6 +836,76 @@ public class CitBalanceSheetPrcAdjustExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreateByIsNull() {
addCriterion("create_by is null");
return (Criteria) this;
}
public Criteria andCreateByIsNotNull() {
addCriterion("create_by is not null");
return (Criteria) this;
}
public Criteria andCreateByEqualTo(String value) {
addCriterion("create_by =", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotEqualTo(String value) {
addCriterion("create_by <>", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByGreaterThan(String value) {
addCriterion("create_by >", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByGreaterThanOrEqualTo(String value) {
addCriterion("create_by >=", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLessThan(String value) {
addCriterion("create_by <", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLessThanOrEqualTo(String value) {
addCriterion("create_by <=", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLike(String value) {
addCriterion("create_by like", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotLike(String value) {
addCriterion("create_by not like", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByIn(List<String> values) {
addCriterion("create_by in", values, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotIn(List<String> values) {
addCriterion("create_by not in", values, "createBy");
return (Criteria) this;
}
public Criteria andCreateByBetween(String value1, String value2) {
addCriterion("create_by between", value1, value2, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotBetween(String value1, String value2) {
addCriterion("create_by not between", value1, value2, "createBy");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() { public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null"); addCriterion("create_time is null");
return (Criteria) this; return (Criteria) this;
......
...@@ -45,6 +45,17 @@ public class CitJournalEntryAdjust extends BaseEntity implements Serializable { ...@@ -45,6 +45,17 @@ public class CitJournalEntryAdjust extends BaseEntity implements Serializable {
*/ */
private String projectId; private String projectId;
/**
* Database Column Remarks:
* 期间
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_journal_entry_adjust.period
*
* @mbg.generated
*/
private Integer period;
/** /**
* Database Column Remarks: * Database Column Remarks:
* 数据日期 * 数据日期
...@@ -160,11 +171,11 @@ public class CitJournalEntryAdjust extends BaseEntity implements Serializable { ...@@ -160,11 +171,11 @@ public class CitJournalEntryAdjust extends BaseEntity implements Serializable {
* 会计期间 yyyymm * 会计期间 yyyymm
* *
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_journal_entry_adjust.period * This field corresponds to the database column cit_journal_entry_adjust.account_period
* *
* @mbg.generated * @mbg.generated
*/ */
private Integer period; private Integer accountPeriod;
/** /**
* Database Column Remarks: * Database Column Remarks:
...@@ -444,6 +455,30 @@ public class CitJournalEntryAdjust extends BaseEntity implements Serializable { ...@@ -444,6 +455,30 @@ public class CitJournalEntryAdjust extends BaseEntity implements Serializable {
this.projectId = projectId == null ? null : projectId.trim(); this.projectId = projectId == null ? null : projectId.trim();
} }
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_journal_entry_adjust.period
*
* @return the value of cit_journal_entry_adjust.period
*
* @mbg.generated
*/
public Integer getPeriod() {
return period;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_journal_entry_adjust.period
*
* @param period the value for cit_journal_entry_adjust.period
*
* @mbg.generated
*/
public void setPeriod(Integer period) {
this.period = period;
}
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_journal_entry_adjust.date * This method returns the value of the database column cit_journal_entry_adjust.date
...@@ -686,26 +721,26 @@ public class CitJournalEntryAdjust extends BaseEntity implements Serializable { ...@@ -686,26 +721,26 @@ public class CitJournalEntryAdjust extends BaseEntity implements Serializable {
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_journal_entry_adjust.period * This method returns the value of the database column cit_journal_entry_adjust.account_period
* *
* @return the value of cit_journal_entry_adjust.period * @return the value of cit_journal_entry_adjust.account_period
* *
* @mbg.generated * @mbg.generated
*/ */
public Integer getPeriod() { public Integer getAccountPeriod() {
return period; return accountPeriod;
} }
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_journal_entry_adjust.period * This method sets the value of the database column cit_journal_entry_adjust.account_period
* *
* @param period the value for cit_journal_entry_adjust.period * @param accountPeriod the value for cit_journal_entry_adjust.account_period
* *
* @mbg.generated * @mbg.generated
*/ */
public void setPeriod(Integer period) { public void setAccountPeriod(Integer accountPeriod) {
this.period = period; this.accountPeriod = accountPeriod;
} }
/** /**
...@@ -1155,6 +1190,7 @@ public class CitJournalEntryAdjust extends BaseEntity implements Serializable { ...@@ -1155,6 +1190,7 @@ public class CitJournalEntryAdjust extends BaseEntity implements Serializable {
sb.append(", id=").append(id); sb.append(", id=").append(id);
sb.append(", organizationId=").append(organizationId); sb.append(", organizationId=").append(organizationId);
sb.append(", projectId=").append(projectId); sb.append(", projectId=").append(projectId);
sb.append(", period=").append(period);
sb.append(", date=").append(date); sb.append(", date=").append(date);
sb.append(", source=").append(source); sb.append(", source=").append(source);
sb.append(", ledgerId=").append(ledgerId); sb.append(", ledgerId=").append(ledgerId);
...@@ -1165,7 +1201,7 @@ public class CitJournalEntryAdjust extends BaseEntity implements Serializable { ...@@ -1165,7 +1201,7 @@ public class CitJournalEntryAdjust extends BaseEntity implements Serializable {
sb.append(", lineNum=").append(lineNum); sb.append(", lineNum=").append(lineNum);
sb.append(", approvalStatus=").append(approvalStatus); sb.append(", approvalStatus=").append(approvalStatus);
sb.append(", postedStatus=").append(postedStatus); sb.append(", postedStatus=").append(postedStatus);
sb.append(", period=").append(period); sb.append(", accountPeriod=").append(accountPeriod);
sb.append(", accountingDate=").append(accountingDate); sb.append(", accountingDate=").append(accountingDate);
sb.append(", journalSource=").append(journalSource); sb.append(", journalSource=").append(journalSource);
sb.append(", category=").append(category); sb.append(", category=").append(category);
......
...@@ -396,6 +396,66 @@ public class CitJournalEntryAdjustExample { ...@@ -396,6 +396,66 @@ public class CitJournalEntryAdjustExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPeriodIsNull() {
addCriterion("period is null");
return (Criteria) this;
}
public Criteria andPeriodIsNotNull() {
addCriterion("period is not null");
return (Criteria) this;
}
public Criteria andPeriodEqualTo(Integer value) {
addCriterion("period =", value, "period");
return (Criteria) this;
}
public Criteria andPeriodNotEqualTo(Integer value) {
addCriterion("period <>", value, "period");
return (Criteria) this;
}
public Criteria andPeriodGreaterThan(Integer value) {
addCriterion("period >", value, "period");
return (Criteria) this;
}
public Criteria andPeriodGreaterThanOrEqualTo(Integer value) {
addCriterion("period >=", value, "period");
return (Criteria) this;
}
public Criteria andPeriodLessThan(Integer value) {
addCriterion("period <", value, "period");
return (Criteria) this;
}
public Criteria andPeriodLessThanOrEqualTo(Integer value) {
addCriterion("period <=", value, "period");
return (Criteria) this;
}
public Criteria andPeriodIn(List<Integer> values) {
addCriterion("period in", values, "period");
return (Criteria) this;
}
public Criteria andPeriodNotIn(List<Integer> values) {
addCriterion("period not in", values, "period");
return (Criteria) this;
}
public Criteria andPeriodBetween(Integer value1, Integer value2) {
addCriterion("period between", value1, value2, "period");
return (Criteria) this;
}
public Criteria andPeriodNotBetween(Integer value1, Integer value2) {
addCriterion("period not between", value1, value2, "period");
return (Criteria) this;
}
public Criteria andDateIsNull() { public Criteria andDateIsNull() {
addCriterion("date is null"); addCriterion("date is null");
return (Criteria) this; return (Criteria) this;
...@@ -1086,63 +1146,63 @@ public class CitJournalEntryAdjustExample { ...@@ -1086,63 +1146,63 @@ public class CitJournalEntryAdjustExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPeriodIsNull() { public Criteria andAccountPeriodIsNull() {
addCriterion("period is null"); addCriterion("account_period is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPeriodIsNotNull() { public Criteria andAccountPeriodIsNotNull() {
addCriterion("period is not null"); addCriterion("account_period is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPeriodEqualTo(Integer value) { public Criteria andAccountPeriodEqualTo(Integer value) {
addCriterion("period =", value, "period"); addCriterion("account_period =", value, "accountPeriod");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPeriodNotEqualTo(Integer value) { public Criteria andAccountPeriodNotEqualTo(Integer value) {
addCriterion("period <>", value, "period"); addCriterion("account_period <>", value, "accountPeriod");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPeriodGreaterThan(Integer value) { public Criteria andAccountPeriodGreaterThan(Integer value) {
addCriterion("period >", value, "period"); addCriterion("account_period >", value, "accountPeriod");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPeriodGreaterThanOrEqualTo(Integer value) { public Criteria andAccountPeriodGreaterThanOrEqualTo(Integer value) {
addCriterion("period >=", value, "period"); addCriterion("account_period >=", value, "accountPeriod");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPeriodLessThan(Integer value) { public Criteria andAccountPeriodLessThan(Integer value) {
addCriterion("period <", value, "period"); addCriterion("account_period <", value, "accountPeriod");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPeriodLessThanOrEqualTo(Integer value) { public Criteria andAccountPeriodLessThanOrEqualTo(Integer value) {
addCriterion("period <=", value, "period"); addCriterion("account_period <=", value, "accountPeriod");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPeriodIn(List<Integer> values) { public Criteria andAccountPeriodIn(List<Integer> values) {
addCriterion("period in", values, "period"); addCriterion("account_period in", values, "accountPeriod");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPeriodNotIn(List<Integer> values) { public Criteria andAccountPeriodNotIn(List<Integer> values) {
addCriterion("period not in", values, "period"); addCriterion("account_period not in", values, "accountPeriod");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPeriodBetween(Integer value1, Integer value2) { public Criteria andAccountPeriodBetween(Integer value1, Integer value2) {
addCriterion("period between", value1, value2, "period"); addCriterion("account_period between", value1, value2, "accountPeriod");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPeriodNotBetween(Integer value1, Integer value2) { public Criteria andAccountPeriodNotBetween(Integer value1, Integer value2) {
addCriterion("period not between", value1, value2, "period"); addCriterion("account_period not between", value1, value2, "accountPeriod");
return (Criteria) this; return (Criteria) this;
} }
......
...@@ -122,6 +122,17 @@ public class CitProfitPrcAdjust extends BaseEntity implements Serializable { ...@@ -122,6 +122,17 @@ public class CitProfitPrcAdjust extends BaseEntity implements Serializable {
*/ */
private BigDecimal ytdAmt; private BigDecimal ytdAmt;
/**
* Database Column Remarks:
* 创建人
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_profit_prc_adjust.create_by
*
* @mbg.generated
*/
private String createBy;
/** /**
* Database Column Remarks: * Database Column Remarks:
* 创建时间 * 创建时间
...@@ -392,6 +403,30 @@ public class CitProfitPrcAdjust extends BaseEntity implements Serializable { ...@@ -392,6 +403,30 @@ public class CitProfitPrcAdjust extends BaseEntity implements Serializable {
this.ytdAmt = ytdAmt; this.ytdAmt = ytdAmt;
} }
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_profit_prc_adjust.create_by
*
* @return the value of cit_profit_prc_adjust.create_by
*
* @mbg.generated
*/
public String getCreateBy() {
return createBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_profit_prc_adjust.create_by
*
* @param createBy the value for cit_profit_prc_adjust.create_by
*
* @mbg.generated
*/
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_profit_prc_adjust.create_time * This method returns the value of the database column cit_profit_prc_adjust.create_time
...@@ -462,6 +497,7 @@ public class CitProfitPrcAdjust extends BaseEntity implements Serializable { ...@@ -462,6 +497,7 @@ public class CitProfitPrcAdjust extends BaseEntity implements Serializable {
sb.append(", itemName=").append(itemName); sb.append(", itemName=").append(itemName);
sb.append(", periodAmt=").append(periodAmt); sb.append(", periodAmt=").append(periodAmt);
sb.append(", ytdAmt=").append(ytdAmt); sb.append(", ytdAmt=").append(ytdAmt);
sb.append(", createBy=").append(createBy);
sb.append(", createTime=").append(createTime); sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
sb.append("]"); sb.append("]");
......
...@@ -836,6 +836,76 @@ public class CitProfitPrcAdjustExample { ...@@ -836,6 +836,76 @@ public class CitProfitPrcAdjustExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreateByIsNull() {
addCriterion("create_by is null");
return (Criteria) this;
}
public Criteria andCreateByIsNotNull() {
addCriterion("create_by is not null");
return (Criteria) this;
}
public Criteria andCreateByEqualTo(String value) {
addCriterion("create_by =", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotEqualTo(String value) {
addCriterion("create_by <>", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByGreaterThan(String value) {
addCriterion("create_by >", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByGreaterThanOrEqualTo(String value) {
addCriterion("create_by >=", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLessThan(String value) {
addCriterion("create_by <", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLessThanOrEqualTo(String value) {
addCriterion("create_by <=", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLike(String value) {
addCriterion("create_by like", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotLike(String value) {
addCriterion("create_by not like", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByIn(List<String> values) {
addCriterion("create_by in", values, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotIn(List<String> values) {
addCriterion("create_by not in", values, "createBy");
return (Criteria) this;
}
public Criteria andCreateByBetween(String value1, String value2) {
addCriterion("create_by between", value1, value2, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotBetween(String value1, String value2) {
addCriterion("create_by not between", value1, value2, "createBy");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() { public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null"); addCriterion("create_time is null");
return (Criteria) this; return (Criteria) this;
......
...@@ -133,6 +133,15 @@ public class CitTrialBalance extends BaseEntity implements Serializable { ...@@ -133,6 +133,15 @@ public class CitTrialBalance extends BaseEntity implements Serializable {
*/ */
private BigDecimal endingBalance; private BigDecimal endingBalance;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_trial_balance.create_by
*
* @mbg.generated
*/
private String createBy;
/** /**
* Database Column Remarks: * Database Column Remarks:
* 创建时间 * 创建时间
...@@ -427,6 +436,30 @@ public class CitTrialBalance extends BaseEntity implements Serializable { ...@@ -427,6 +436,30 @@ public class CitTrialBalance extends BaseEntity implements Serializable {
this.endingBalance = endingBalance; this.endingBalance = endingBalance;
} }
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_trial_balance.create_by
*
* @return the value of cit_trial_balance.create_by
*
* @mbg.generated
*/
public String getCreateBy() {
return createBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_trial_balance.create_by
*
* @param createBy the value for cit_trial_balance.create_by
*
* @mbg.generated
*/
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_trial_balance.create_time * This method returns the value of the database column cit_trial_balance.create_time
...@@ -498,6 +531,7 @@ public class CitTrialBalance extends BaseEntity implements Serializable { ...@@ -498,6 +531,7 @@ public class CitTrialBalance extends BaseEntity implements Serializable {
sb.append(", accountPeriod=").append(accountPeriod); sb.append(", accountPeriod=").append(accountPeriod);
sb.append(", beginningBalance=").append(beginningBalance); sb.append(", beginningBalance=").append(beginningBalance);
sb.append(", endingBalance=").append(endingBalance); sb.append(", endingBalance=").append(endingBalance);
sb.append(", createBy=").append(createBy);
sb.append(", createTime=").append(createTime); sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
sb.append("]"); sb.append("]");
......
...@@ -906,6 +906,76 @@ public class CitTrialBalanceExample { ...@@ -906,6 +906,76 @@ public class CitTrialBalanceExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreateByIsNull() {
addCriterion("create_by is null");
return (Criteria) this;
}
public Criteria andCreateByIsNotNull() {
addCriterion("create_by is not null");
return (Criteria) this;
}
public Criteria andCreateByEqualTo(String value) {
addCriterion("create_by =", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotEqualTo(String value) {
addCriterion("create_by <>", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByGreaterThan(String value) {
addCriterion("create_by >", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByGreaterThanOrEqualTo(String value) {
addCriterion("create_by >=", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLessThan(String value) {
addCriterion("create_by <", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLessThanOrEqualTo(String value) {
addCriterion("create_by <=", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByLike(String value) {
addCriterion("create_by like", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotLike(String value) {
addCriterion("create_by not like", value, "createBy");
return (Criteria) this;
}
public Criteria andCreateByIn(List<String> values) {
addCriterion("create_by in", values, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotIn(List<String> values) {
addCriterion("create_by not in", values, "createBy");
return (Criteria) this;
}
public Criteria andCreateByBetween(String value1, String value2) {
addCriterion("create_by between", value1, value2, "createBy");
return (Criteria) this;
}
public Criteria andCreateByNotBetween(String value1, String value2) {
addCriterion("create_by not between", value1, value2, "createBy");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() { public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null"); addCriterion("create_time is null");
return (Criteria) this; return (Criteria) this;
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<result column="item_name" jdbcType="VARCHAR" property="itemName" /> <result column="item_name" jdbcType="VARCHAR" property="itemName" />
<result column="end_bal" jdbcType="DECIMAL" property="endBal" /> <result column="end_bal" jdbcType="DECIMAL" property="endBal" />
<result column="beg_bal" jdbcType="DECIMAL" property="begBal" /> <result column="beg_bal" jdbcType="DECIMAL" property="begBal" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap> </resultMap>
...@@ -91,7 +92,7 @@ ...@@ -91,7 +92,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
id, organization_id, project_id, period, date, source, tms_period, item_name, end_bal, id, organization_id, project_id, period, date, source, tms_period, item_name, end_bal,
beg_bal, create_time, update_time beg_bal, create_by, create_time, update_time
</sql> </sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.entity.CitBalanceSheetPrcAdjustExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="pwc.taxtech.atms.entity.CitBalanceSheetPrcAdjustExample" resultMap="BaseResultMap">
<!-- <!--
...@@ -147,13 +148,13 @@ ...@@ -147,13 +148,13 @@
insert into cit_balance_sheet_prc_adjust (id, organization_id, project_id, insert into cit_balance_sheet_prc_adjust (id, organization_id, project_id,
period, date, source, period, date, source,
tms_period, item_name, end_bal, tms_period, item_name, end_bal,
beg_bal, create_time, update_time beg_bal, create_by, create_time,
) update_time)
values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR},
#{period,jdbcType=INTEGER}, #{date,jdbcType=TIMESTAMP}, #{source,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER}, #{date,jdbcType=TIMESTAMP}, #{source,jdbcType=VARCHAR},
#{tmsPeriod,jdbcType=INTEGER}, #{itemName,jdbcType=VARCHAR}, #{endBal,jdbcType=DECIMAL}, #{tmsPeriod,jdbcType=INTEGER}, #{itemName,jdbcType=VARCHAR}, #{endBal,jdbcType=DECIMAL},
#{begBal,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} #{begBal,jdbcType=DECIMAL}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
) #{updateTime,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.CitBalanceSheetPrcAdjust"> <insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.CitBalanceSheetPrcAdjust">
<!-- <!--
...@@ -192,6 +193,9 @@ ...@@ -192,6 +193,9 @@
<if test="begBal != null"> <if test="begBal != null">
beg_bal, beg_bal,
</if> </if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null"> <if test="createTime != null">
create_time, create_time,
</if> </if>
...@@ -230,6 +234,9 @@ ...@@ -230,6 +234,9 @@
<if test="begBal != null"> <if test="begBal != null">
#{begBal,jdbcType=DECIMAL}, #{begBal,jdbcType=DECIMAL},
</if> </if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null"> <if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -285,6 +292,9 @@ ...@@ -285,6 +292,9 @@
<if test="record.begBal != null"> <if test="record.begBal != null">
beg_bal = #{record.begBal,jdbcType=DECIMAL}, beg_bal = #{record.begBal,jdbcType=DECIMAL},
</if> </if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null"> <if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -312,6 +322,7 @@ ...@@ -312,6 +322,7 @@
item_name = #{record.itemName,jdbcType=VARCHAR}, item_name = #{record.itemName,jdbcType=VARCHAR},
end_bal = #{record.endBal,jdbcType=DECIMAL}, end_bal = #{record.endBal,jdbcType=DECIMAL},
beg_bal = #{record.begBal,jdbcType=DECIMAL}, beg_bal = #{record.begBal,jdbcType=DECIMAL},
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP} update_time = #{record.updateTime,jdbcType=TIMESTAMP}
<if test="_parameter != null"> <if test="_parameter != null">
...@@ -352,6 +363,9 @@ ...@@ -352,6 +363,9 @@
<if test="begBal != null"> <if test="begBal != null">
beg_bal = #{begBal,jdbcType=DECIMAL}, beg_bal = #{begBal,jdbcType=DECIMAL},
</if> </if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null"> <if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -376,6 +390,7 @@ ...@@ -376,6 +390,7 @@
item_name = #{itemName,jdbcType=VARCHAR}, item_name = #{itemName,jdbcType=VARCHAR},
end_bal = #{endBal,jdbcType=DECIMAL}, end_bal = #{endBal,jdbcType=DECIMAL},
beg_bal = #{begBal,jdbcType=DECIMAL}, beg_bal = #{begBal,jdbcType=DECIMAL},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP} update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
<result column="organization_id" jdbcType="VARCHAR" property="organizationId" /> <result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
<result column="project_id" jdbcType="VARCHAR" property="projectId" /> <result column="project_id" jdbcType="VARCHAR" property="projectId" />
<result column="period" jdbcType="INTEGER" property="period" />
<result column="date" jdbcType="TIMESTAMP" property="date" /> <result column="date" jdbcType="TIMESTAMP" property="date" />
<result column="source" jdbcType="VARCHAR" property="source" /> <result column="source" jdbcType="VARCHAR" property="source" />
<result column="ledger_id" jdbcType="VARCHAR" property="ledgerId" /> <result column="ledger_id" jdbcType="VARCHAR" property="ledgerId" />
...@@ -19,7 +20,7 @@ ...@@ -19,7 +20,7 @@
<result column="line_num" jdbcType="VARCHAR" property="lineNum" /> <result column="line_num" jdbcType="VARCHAR" property="lineNum" />
<result column="approval_status" jdbcType="VARCHAR" property="approvalStatus" /> <result column="approval_status" jdbcType="VARCHAR" property="approvalStatus" />
<result column="posted_status" jdbcType="VARCHAR" property="postedStatus" /> <result column="posted_status" jdbcType="VARCHAR" property="postedStatus" />
<result column="period" jdbcType="INTEGER" property="period" /> <result column="account_period" jdbcType="INTEGER" property="accountPeriod" />
<result column="accounting_date" jdbcType="TIMESTAMP" property="accountingDate" /> <result column="accounting_date" jdbcType="TIMESTAMP" property="accountingDate" />
<result column="journal_source" jdbcType="VARCHAR" property="journalSource" /> <result column="journal_source" jdbcType="VARCHAR" property="journalSource" />
<result column="category" jdbcType="VARCHAR" property="category" /> <result column="category" jdbcType="VARCHAR" property="category" />
...@@ -110,8 +111,8 @@ ...@@ -110,8 +111,8 @@
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
id, organization_id, project_id, date, source, ledger_id, ledger_name, currency_code, id, organization_id, project_id, period, date, source, ledger_id, ledger_name, currency_code,
status, header_id, line_num, approval_status, posted_status, period, accounting_date, status, header_id, line_num, approval_status, posted_status, account_period, accounting_date,
journal_source, category, name, voucher_num, description, segment1, segment3, segment1_name, journal_source, category, name, voucher_num, description, segment1, segment3, segment1_name,
segment3_name, accounted_dr, accounted_cr, created_by, created_date, late_updated_by, segment3_name, accounted_dr, accounted_cr, created_by, created_date, late_updated_by,
late_updated_date, create_time, update_time late_updated_date, create_time, update_time
...@@ -168,27 +169,29 @@ ...@@ -168,27 +169,29 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
insert into cit_journal_entry_adjust (id, organization_id, project_id, insert into cit_journal_entry_adjust (id, organization_id, project_id,
date, source, ledger_id, period, date, source,
ledger_name, currency_code, status, ledger_id, ledger_name, currency_code,
header_id, line_num, approval_status, status, header_id, line_num,
posted_status, period, accounting_date, approval_status, posted_status, account_period,
journal_source, category, name, accounting_date, journal_source, category,
voucher_num, description, segment1, name, voucher_num, description,
segment3, segment1_name, segment3_name, segment1, segment3, segment1_name,
accounted_dr, accounted_cr, created_by, segment3_name, accounted_dr, accounted_cr,
created_date, late_updated_by, late_updated_date, created_by, created_date, late_updated_by,
create_time, update_time) late_updated_date, create_time, update_time
)
values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR},
#{date,jdbcType=TIMESTAMP}, #{source,jdbcType=VARCHAR}, #{ledgerId,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER}, #{date,jdbcType=TIMESTAMP}, #{source,jdbcType=VARCHAR},
#{ledgerName,jdbcType=VARCHAR}, #{currencyCode,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{ledgerId,jdbcType=VARCHAR}, #{ledgerName,jdbcType=VARCHAR}, #{currencyCode,jdbcType=VARCHAR},
#{headerId,jdbcType=VARCHAR}, #{lineNum,jdbcType=VARCHAR}, #{approvalStatus,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{headerId,jdbcType=VARCHAR}, #{lineNum,jdbcType=VARCHAR},
#{postedStatus,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER}, #{accountingDate,jdbcType=TIMESTAMP}, #{approvalStatus,jdbcType=VARCHAR}, #{postedStatus,jdbcType=VARCHAR}, #{accountPeriod,jdbcType=INTEGER},
#{journalSource,jdbcType=VARCHAR}, #{category,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{accountingDate,jdbcType=TIMESTAMP}, #{journalSource,jdbcType=VARCHAR}, #{category,jdbcType=VARCHAR},
#{voucherNum,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{segment1,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{voucherNum,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
#{segment3,jdbcType=VARCHAR}, #{segment1Name,jdbcType=VARCHAR}, #{segment3Name,jdbcType=VARCHAR}, #{segment1,jdbcType=VARCHAR}, #{segment3,jdbcType=VARCHAR}, #{segment1Name,jdbcType=VARCHAR},
#{accountedDr,jdbcType=DECIMAL}, #{accountedCr,jdbcType=DECIMAL}, #{createdBy,jdbcType=VARCHAR}, #{segment3Name,jdbcType=VARCHAR}, #{accountedDr,jdbcType=DECIMAL}, #{accountedCr,jdbcType=DECIMAL},
#{createdDate,jdbcType=TIMESTAMP}, #{lateUpdatedBy,jdbcType=VARCHAR}, #{lateUpdatedDate,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=VARCHAR}, #{createdDate,jdbcType=TIMESTAMP}, #{lateUpdatedBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) #{lateUpdatedDate,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert> </insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.CitJournalEntryAdjust"> <insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.CitJournalEntryAdjust">
<!-- <!--
...@@ -206,6 +209,9 @@ ...@@ -206,6 +209,9 @@
<if test="projectId != null"> <if test="projectId != null">
project_id, project_id,
</if> </if>
<if test="period != null">
period,
</if>
<if test="date != null"> <if test="date != null">
date, date,
</if> </if>
...@@ -236,8 +242,8 @@ ...@@ -236,8 +242,8 @@
<if test="postedStatus != null"> <if test="postedStatus != null">
posted_status, posted_status,
</if> </if>
<if test="period != null"> <if test="accountPeriod != null">
period, account_period,
</if> </if>
<if test="accountingDate != null"> <if test="accountingDate != null">
accounting_date, accounting_date,
...@@ -304,6 +310,9 @@ ...@@ -304,6 +310,9 @@
<if test="projectId != null"> <if test="projectId != null">
#{projectId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR},
</if> </if>
<if test="period != null">
#{period,jdbcType=INTEGER},
</if>
<if test="date != null"> <if test="date != null">
#{date,jdbcType=TIMESTAMP}, #{date,jdbcType=TIMESTAMP},
</if> </if>
...@@ -334,8 +343,8 @@ ...@@ -334,8 +343,8 @@
<if test="postedStatus != null"> <if test="postedStatus != null">
#{postedStatus,jdbcType=VARCHAR}, #{postedStatus,jdbcType=VARCHAR},
</if> </if>
<if test="period != null"> <if test="accountPeriod != null">
#{period,jdbcType=INTEGER}, #{accountPeriod,jdbcType=INTEGER},
</if> </if>
<if test="accountingDate != null"> <if test="accountingDate != null">
#{accountingDate,jdbcType=TIMESTAMP}, #{accountingDate,jdbcType=TIMESTAMP},
...@@ -419,6 +428,9 @@ ...@@ -419,6 +428,9 @@
<if test="record.projectId != null"> <if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR},
</if> </if>
<if test="record.period != null">
period = #{record.period,jdbcType=INTEGER},
</if>
<if test="record.date != null"> <if test="record.date != null">
date = #{record.date,jdbcType=TIMESTAMP}, date = #{record.date,jdbcType=TIMESTAMP},
</if> </if>
...@@ -449,8 +461,8 @@ ...@@ -449,8 +461,8 @@
<if test="record.postedStatus != null"> <if test="record.postedStatus != null">
posted_status = #{record.postedStatus,jdbcType=VARCHAR}, posted_status = #{record.postedStatus,jdbcType=VARCHAR},
</if> </if>
<if test="record.period != null"> <if test="record.accountPeriod != null">
period = #{record.period,jdbcType=INTEGER}, account_period = #{record.accountPeriod,jdbcType=INTEGER},
</if> </if>
<if test="record.accountingDate != null"> <if test="record.accountingDate != null">
accounting_date = #{record.accountingDate,jdbcType=TIMESTAMP}, accounting_date = #{record.accountingDate,jdbcType=TIMESTAMP},
...@@ -520,6 +532,7 @@ ...@@ -520,6 +532,7 @@
set id = #{record.id,jdbcType=BIGINT}, set id = #{record.id,jdbcType=BIGINT},
organization_id = #{record.organizationId,jdbcType=VARCHAR}, organization_id = #{record.organizationId,jdbcType=VARCHAR},
project_id = #{record.projectId,jdbcType=VARCHAR}, project_id = #{record.projectId,jdbcType=VARCHAR},
period = #{record.period,jdbcType=INTEGER},
date = #{record.date,jdbcType=TIMESTAMP}, date = #{record.date,jdbcType=TIMESTAMP},
source = #{record.source,jdbcType=VARCHAR}, source = #{record.source,jdbcType=VARCHAR},
ledger_id = #{record.ledgerId,jdbcType=VARCHAR}, ledger_id = #{record.ledgerId,jdbcType=VARCHAR},
...@@ -530,7 +543,7 @@ ...@@ -530,7 +543,7 @@
line_num = #{record.lineNum,jdbcType=VARCHAR}, line_num = #{record.lineNum,jdbcType=VARCHAR},
approval_status = #{record.approvalStatus,jdbcType=VARCHAR}, approval_status = #{record.approvalStatus,jdbcType=VARCHAR},
posted_status = #{record.postedStatus,jdbcType=VARCHAR}, posted_status = #{record.postedStatus,jdbcType=VARCHAR},
period = #{record.period,jdbcType=INTEGER}, account_period = #{record.accountPeriod,jdbcType=INTEGER},
accounting_date = #{record.accountingDate,jdbcType=TIMESTAMP}, accounting_date = #{record.accountingDate,jdbcType=TIMESTAMP},
journal_source = #{record.journalSource,jdbcType=VARCHAR}, journal_source = #{record.journalSource,jdbcType=VARCHAR},
category = #{record.category,jdbcType=VARCHAR}, category = #{record.category,jdbcType=VARCHAR},
...@@ -566,6 +579,9 @@ ...@@ -566,6 +579,9 @@
<if test="projectId != null"> <if test="projectId != null">
project_id = #{projectId,jdbcType=VARCHAR}, project_id = #{projectId,jdbcType=VARCHAR},
</if> </if>
<if test="period != null">
period = #{period,jdbcType=INTEGER},
</if>
<if test="date != null"> <if test="date != null">
date = #{date,jdbcType=TIMESTAMP}, date = #{date,jdbcType=TIMESTAMP},
</if> </if>
...@@ -596,8 +612,8 @@ ...@@ -596,8 +612,8 @@
<if test="postedStatus != null"> <if test="postedStatus != null">
posted_status = #{postedStatus,jdbcType=VARCHAR}, posted_status = #{postedStatus,jdbcType=VARCHAR},
</if> </if>
<if test="period != null"> <if test="accountPeriod != null">
period = #{period,jdbcType=INTEGER}, account_period = #{accountPeriod,jdbcType=INTEGER},
</if> </if>
<if test="accountingDate != null"> <if test="accountingDate != null">
accounting_date = #{accountingDate,jdbcType=TIMESTAMP}, accounting_date = #{accountingDate,jdbcType=TIMESTAMP},
...@@ -664,6 +680,7 @@ ...@@ -664,6 +680,7 @@
update cit_journal_entry_adjust update cit_journal_entry_adjust
set organization_id = #{organizationId,jdbcType=VARCHAR}, set organization_id = #{organizationId,jdbcType=VARCHAR},
project_id = #{projectId,jdbcType=VARCHAR}, project_id = #{projectId,jdbcType=VARCHAR},
period = #{period,jdbcType=INTEGER},
date = #{date,jdbcType=TIMESTAMP}, date = #{date,jdbcType=TIMESTAMP},
source = #{source,jdbcType=VARCHAR}, source = #{source,jdbcType=VARCHAR},
ledger_id = #{ledgerId,jdbcType=VARCHAR}, ledger_id = #{ledgerId,jdbcType=VARCHAR},
...@@ -674,7 +691,7 @@ ...@@ -674,7 +691,7 @@
line_num = #{lineNum,jdbcType=VARCHAR}, line_num = #{lineNum,jdbcType=VARCHAR},
approval_status = #{approvalStatus,jdbcType=VARCHAR}, approval_status = #{approvalStatus,jdbcType=VARCHAR},
posted_status = #{postedStatus,jdbcType=VARCHAR}, posted_status = #{postedStatus,jdbcType=VARCHAR},
period = #{period,jdbcType=INTEGER}, account_period = #{accountPeriod,jdbcType=INTEGER},
accounting_date = #{accountingDate,jdbcType=TIMESTAMP}, accounting_date = #{accountingDate,jdbcType=TIMESTAMP},
journal_source = #{journalSource,jdbcType=VARCHAR}, journal_source = #{journalSource,jdbcType=VARCHAR},
category = #{category,jdbcType=VARCHAR}, category = #{category,jdbcType=VARCHAR},
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<result column="item_name" jdbcType="VARCHAR" property="itemName" /> <result column="item_name" jdbcType="VARCHAR" property="itemName" />
<result column="period_amt" jdbcType="DECIMAL" property="periodAmt" /> <result column="period_amt" jdbcType="DECIMAL" property="periodAmt" />
<result column="ytd_amt" jdbcType="DECIMAL" property="ytdAmt" /> <result column="ytd_amt" jdbcType="DECIMAL" property="ytdAmt" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap> </resultMap>
...@@ -91,7 +92,7 @@ ...@@ -91,7 +92,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
id, organization_id, project_id, period, date, source, tms_period, item_name, period_amt, id, organization_id, project_id, period, date, source, tms_period, item_name, period_amt,
ytd_amt, create_time, update_time ytd_amt, create_by, create_time, update_time
</sql> </sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.entity.CitProfitPrcAdjustExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="pwc.taxtech.atms.entity.CitProfitPrcAdjustExample" resultMap="BaseResultMap">
<!-- <!--
...@@ -147,13 +148,13 @@ ...@@ -147,13 +148,13 @@
insert into cit_profit_prc_adjust (id, organization_id, project_id, insert into cit_profit_prc_adjust (id, organization_id, project_id,
period, date, source, period, date, source,
tms_period, item_name, period_amt, tms_period, item_name, period_amt,
ytd_amt, create_time, update_time ytd_amt, create_by, create_time,
) update_time)
values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR},
#{period,jdbcType=INTEGER}, #{date,jdbcType=TIMESTAMP}, #{source,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER}, #{date,jdbcType=TIMESTAMP}, #{source,jdbcType=VARCHAR},
#{tmsPeriod,jdbcType=INTEGER}, #{itemName,jdbcType=VARCHAR}, #{periodAmt,jdbcType=DECIMAL}, #{tmsPeriod,jdbcType=INTEGER}, #{itemName,jdbcType=VARCHAR}, #{periodAmt,jdbcType=DECIMAL},
#{ytdAmt,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} #{ytdAmt,jdbcType=DECIMAL}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
) #{updateTime,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.CitProfitPrcAdjust"> <insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.CitProfitPrcAdjust">
<!-- <!--
...@@ -192,6 +193,9 @@ ...@@ -192,6 +193,9 @@
<if test="ytdAmt != null"> <if test="ytdAmt != null">
ytd_amt, ytd_amt,
</if> </if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null"> <if test="createTime != null">
create_time, create_time,
</if> </if>
...@@ -230,6 +234,9 @@ ...@@ -230,6 +234,9 @@
<if test="ytdAmt != null"> <if test="ytdAmt != null">
#{ytdAmt,jdbcType=DECIMAL}, #{ytdAmt,jdbcType=DECIMAL},
</if> </if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null"> <if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -285,6 +292,9 @@ ...@@ -285,6 +292,9 @@
<if test="record.ytdAmt != null"> <if test="record.ytdAmt != null">
ytd_amt = #{record.ytdAmt,jdbcType=DECIMAL}, ytd_amt = #{record.ytdAmt,jdbcType=DECIMAL},
</if> </if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null"> <if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -312,6 +322,7 @@ ...@@ -312,6 +322,7 @@
item_name = #{record.itemName,jdbcType=VARCHAR}, item_name = #{record.itemName,jdbcType=VARCHAR},
period_amt = #{record.periodAmt,jdbcType=DECIMAL}, period_amt = #{record.periodAmt,jdbcType=DECIMAL},
ytd_amt = #{record.ytdAmt,jdbcType=DECIMAL}, ytd_amt = #{record.ytdAmt,jdbcType=DECIMAL},
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP} update_time = #{record.updateTime,jdbcType=TIMESTAMP}
<if test="_parameter != null"> <if test="_parameter != null">
...@@ -352,6 +363,9 @@ ...@@ -352,6 +363,9 @@
<if test="ytdAmt != null"> <if test="ytdAmt != null">
ytd_amt = #{ytdAmt,jdbcType=DECIMAL}, ytd_amt = #{ytdAmt,jdbcType=DECIMAL},
</if> </if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null"> <if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -376,6 +390,7 @@ ...@@ -376,6 +390,7 @@
item_name = #{itemName,jdbcType=VARCHAR}, item_name = #{itemName,jdbcType=VARCHAR},
period_amt = #{periodAmt,jdbcType=DECIMAL}, period_amt = #{periodAmt,jdbcType=DECIMAL},
ytd_amt = #{ytdAmt,jdbcType=DECIMAL}, ytd_amt = #{ytdAmt,jdbcType=DECIMAL},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP} update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<result column="account_period" jdbcType="INTEGER" property="accountPeriod" /> <result column="account_period" jdbcType="INTEGER" property="accountPeriod" />
<result column="beginning_balance" jdbcType="DECIMAL" property="beginningBalance" /> <result column="beginning_balance" jdbcType="DECIMAL" property="beginningBalance" />
<result column="ending_balance" jdbcType="DECIMAL" property="endingBalance" /> <result column="ending_balance" jdbcType="DECIMAL" property="endingBalance" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap> </resultMap>
...@@ -92,7 +93,7 @@ ...@@ -92,7 +93,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
id, organization_id, project_id, date, source, period, account_code, account_description, id, organization_id, project_id, date, source, period, account_code, account_description,
account_period, beginning_balance, ending_balance, create_time, update_time account_period, beginning_balance, ending_balance, create_by, create_time, update_time
</sql> </sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.entity.CitTrialBalanceExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="pwc.taxtech.atms.entity.CitTrialBalanceExample" resultMap="BaseResultMap">
<!-- <!--
...@@ -148,13 +149,13 @@ ...@@ -148,13 +149,13 @@
insert into cit_trial_balance (id, organization_id, project_id, insert into cit_trial_balance (id, organization_id, project_id,
date, source, period, date, source, period,
account_code, account_description, account_period, account_code, account_description, account_period,
beginning_balance, ending_balance, create_time, beginning_balance, ending_balance, create_by,
update_time) create_time, update_time)
values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR},
#{date,jdbcType=TIMESTAMP}, #{source,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER}, #{date,jdbcType=TIMESTAMP}, #{source,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER},
#{accountCode,jdbcType=VARCHAR}, #{accountDescription,jdbcType=VARCHAR}, #{accountPeriod,jdbcType=INTEGER}, #{accountCode,jdbcType=VARCHAR}, #{accountDescription,jdbcType=VARCHAR}, #{accountPeriod,jdbcType=INTEGER},
#{beginningBalance,jdbcType=DECIMAL}, #{endingBalance,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{beginningBalance,jdbcType=DECIMAL}, #{endingBalance,jdbcType=DECIMAL}, #{createBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}) #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.CitTrialBalance"> <insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.CitTrialBalance">
<!-- <!--
...@@ -196,6 +197,9 @@ ...@@ -196,6 +197,9 @@
<if test="endingBalance != null"> <if test="endingBalance != null">
ending_balance, ending_balance,
</if> </if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null"> <if test="createTime != null">
create_time, create_time,
</if> </if>
...@@ -237,6 +241,9 @@ ...@@ -237,6 +241,9 @@
<if test="endingBalance != null"> <if test="endingBalance != null">
#{endingBalance,jdbcType=DECIMAL}, #{endingBalance,jdbcType=DECIMAL},
</if> </if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null"> <if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -295,6 +302,9 @@ ...@@ -295,6 +302,9 @@
<if test="record.endingBalance != null"> <if test="record.endingBalance != null">
ending_balance = #{record.endingBalance,jdbcType=DECIMAL}, ending_balance = #{record.endingBalance,jdbcType=DECIMAL},
</if> </if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null"> <if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -323,6 +333,7 @@ ...@@ -323,6 +333,7 @@
account_period = #{record.accountPeriod,jdbcType=INTEGER}, account_period = #{record.accountPeriod,jdbcType=INTEGER},
beginning_balance = #{record.beginningBalance,jdbcType=DECIMAL}, beginning_balance = #{record.beginningBalance,jdbcType=DECIMAL},
ending_balance = #{record.endingBalance,jdbcType=DECIMAL}, ending_balance = #{record.endingBalance,jdbcType=DECIMAL},
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP} update_time = #{record.updateTime,jdbcType=TIMESTAMP}
<if test="_parameter != null"> <if test="_parameter != null">
...@@ -366,6 +377,9 @@ ...@@ -366,6 +377,9 @@
<if test="endingBalance != null"> <if test="endingBalance != null">
ending_balance = #{endingBalance,jdbcType=DECIMAL}, ending_balance = #{endingBalance,jdbcType=DECIMAL},
</if> </if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null"> <if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
</if> </if>
...@@ -391,6 +405,7 @@ ...@@ -391,6 +405,7 @@
account_period = #{accountPeriod,jdbcType=INTEGER}, account_period = #{accountPeriod,jdbcType=INTEGER},
beginning_balance = #{beginningBalance,jdbcType=DECIMAL}, beginning_balance = #{beginningBalance,jdbcType=DECIMAL},
ending_balance = #{endingBalance,jdbcType=DECIMAL}, ending_balance = #{endingBalance,jdbcType=DECIMAL},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP} update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
......
...@@ -48,6 +48,10 @@ ...@@ -48,6 +48,10 @@
<when test="item.begBal != null">#{item.begBal,jdbcType=DECIMAL},</when> <when test="item.begBal != null">#{item.begBal,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise> <otherwise>0,</otherwise>
</choose> </choose>
<choose>
<when test="item.createBy != null">#{item.createdBy,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose> <choose>
<when test="item.createTime != null">#{item.createTime,jdbcType=TIMESTAMP},</when> <when test="item.createTime != null">#{item.createTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise> <otherwise>CURRENT_TIMESTAMP,</otherwise>
......
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
<when test="item.projectId != null">#{item.projectId,jdbcType=VARCHAR},</when> <when test="item.projectId != null">#{item.projectId,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise> <otherwise>'',</otherwise>
</choose> </choose>
<choose>
<when test="item.period != null">#{item.period,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose> <choose>
<when test="item.date != null">#{item.date,jdbcType=TIMESTAMP},</when> <when test="item.date != null">#{item.date,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise> <otherwise>CURRENT_TIMESTAMP,</otherwise>
...@@ -61,7 +65,7 @@ ...@@ -61,7 +65,7 @@
<otherwise>'',</otherwise> <otherwise>'',</otherwise>
</choose> </choose>
<choose> <choose>
<when test="item.period != null">#{item.period,jdbcType=INTEGER},</when> <when test="item.accountPeriod != null">#{item.accountPeriod,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise> <otherwise>0,</otherwise>
</choose> </choose>
<choose> <choose>
......
...@@ -48,6 +48,10 @@ ...@@ -48,6 +48,10 @@
<when test="item.ytdAmt != null">#{item.ytdAmt,jdbcType=DECIMAL},</when> <when test="item.ytdAmt != null">#{item.ytdAmt,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise> <otherwise>0,</otherwise>
</choose> </choose>
<choose>
<when test="item.createBy != null">#{item.createdBy,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose> <choose>
<when test="item.createTime != null">#{item.createTime,jdbcType=TIMESTAMP},</when> <when test="item.createTime != null">#{item.createTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise> <otherwise>CURRENT_TIMESTAMP,</otherwise>
......
...@@ -53,6 +53,10 @@ ...@@ -53,6 +53,10 @@
<when test="item.endingBalance != null">#{item.endingBalance,jdbcType=DECIMAL},</when> <when test="item.endingBalance != null">#{item.endingBalance,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise> <otherwise>0,</otherwise>
</choose> </choose>
<choose>
<when test="item.createBy != null">#{item.createdBy,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose> <choose>
<when test="item.createTime != null">#{item.createTime,jdbcType=TIMESTAMP},</when> <when test="item.createTime != null">#{item.createTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise> <otherwise>CURRENT_TIMESTAMP,</otherwise>
......
...@@ -86,5 +86,7 @@ ...@@ -86,5 +86,7 @@
"CitTrialBalanceImport": "试算平衡表导入-CIT", "CitTrialBalanceImport": "试算平衡表导入-CIT",
"CitSalaryAdvanceImport": "预提重分类数据源导入-CIT", "CitSalaryAdvanceImport": "预提重分类数据源导入-CIT",
"CitEAMAssetsDisposalImport": "EAM资产处置导入-CIT", "CitEAMAssetsDisposalImport": "EAM资产处置导入-CIT",
"CitDraftAccountMappingImport": "底稿&科目Mapping表导入-CIT" "CitDraftAccountMappingImport": "底稿&科目Mapping表导入-CIT",
"PleaseSelectOrganization": "请选择机构!",
"PleaseSelectPeriod": "请选择期间!"
} }
\ No newline at end of file
...@@ -92,6 +92,8 @@ ...@@ -92,6 +92,8 @@
"CitSalaryAdvanceImport": "预提重分类数据源导入-CIT", "CitSalaryAdvanceImport": "预提重分类数据源导入-CIT",
"CitEAMAssetsDisposalImport": "EAM资产处置导入-CIT", "CitEAMAssetsDisposalImport": "EAM资产处置导入-CIT",
"CitDraftAccountMappingImport": "底稿&科目Mapping表导入-CIT", "CitDraftAccountMappingImport": "底稿&科目Mapping表导入-CIT",
"PleaseSelectOrganization": "请选择机构!",
"PleaseSelectPeriod": "请选择期间!",
"BuyDateType": "日期错误", "BuyDateType": "日期错误",
"AssetNumberType": "资产编号错误", "AssetNumberType": "资产编号错误",
"AssetGroupNameType": "资产类别错误", "AssetGroupNameType": "资产类别错误",
......
commonModule.controller('importCitBalanceSheetPrcAdjustCon', ['$scope', '$log', '$translate', '$timeout', '$q', '$interval' commonModule.controller('importCitBalanceSheetPrcAdjustCon', ['$scope', '$log', '$translate', '$timeout', '$q',
, 'apiInterceptor', 'Upload', 'citImportDataService', 'SweetAlert', 'uiGridConstants', '$uibModal' 'apiInterceptor', 'Upload', 'citImportDataService', 'SweetAlert', 'vatSessionService', 'enums',
, 'vatSessionService', 'enums', 'vatOperationLogService','templateService', 'vatOperationLogService', 'templateService', 'orgService',
function ($scope, $log, $translate, $timeout, $q, $interval function ($scope, $log, $translate, $timeout, $q, apiInterceptor, Upload, citImportDataService, SweetAlert,
, apiInterceptor, Upload, citImportDataService, SweetAlert, uiGridConstants, $uibModal vatSessionService, enums, vatOperationLogService, templateService, orgService) {
, vatSessionService, enums, vatOperationLogService,templateService) {
'use strict'; 'use strict';
// $anchorScroll.yOffset=55; // $anchorScroll.yOffset=55;
// $location.hash('top'); // $location.hash('top');
...@@ -18,7 +17,7 @@ ...@@ -18,7 +17,7 @@
$scope.isSelectPeriod = true; $scope.isSelectPeriod = true;
$scope.isShowImportTotalBtn = true; $scope.isShowImportTotalBtn = true;
$scope.projectID = vatSessionService.project.id; $scope.projectID = vatSessionService.project.id;
$scope.importEnum = { Import: 0, CoverImport: 1, AddImport: 2 }; //导入方式 $scope.importEnum = {Import: 0, CoverImport: 1, AddImport: 2}; //导入方式
$scope.showTotalSecondRow = false; $scope.showTotalSecondRow = false;
var date = new Date(); var date = new Date();
...@@ -27,14 +26,13 @@ ...@@ -27,14 +26,13 @@
$scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1); $scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1);
$scope.startDate = new Date(year - 20, 1, 1); $scope.startDate = new Date(year - 20, 1, 1);
$scope.endDate = new Date(year + 20, 1, 1); $scope.endDate = new Date(year + 20, 1, 1);
$scope.viewMode = 1; $scope.viewMode = 2;
$scope.dateFormat = $translate.instant('dateFormat4YearMonth'); $scope.dateFormat = $translate.instant('dateFormat4Year');
$scope.importExcelFile = null; $scope.importExcelFile = null;
$scope.UploadPeriodTime = null; $scope.UploadPeriodTime = null;
//写日志 //写日志
var logDto = { var logDto = {
ID: '', ID: '',
...@@ -136,13 +134,23 @@ ...@@ -136,13 +134,23 @@
} }
var period = $scope.UploadPeriodTime; var period = $scope.UploadPeriodTime;
if(period == null){
SweetAlert.warning($translate.instant('PleaseSelectPeriod'));
return;
}
if($scope.checkedCompanyCodeList.length == 0){
SweetAlert.warning($translate.instant('PleaseSelectOrganization'));
return;
}
var orgIds = JSON.stringify($scope.checkedCompanyCodeList);
Upload.upload({ Upload.upload({
url: uploadUrl, url: uploadUrl,
data: { data: {
periodDate : period, orgIds : orgIds,
importType : importType, periodDate: period,
importFileType : constant.citImportFileType.BalanceSheetPrcAdjust importType: importType,
importFileType: constant.citImportFileType.BalanceSheetPrcAdjust
}, },
file: impExl, file: impExl,
headers: { headers: {
...@@ -153,7 +161,7 @@ ...@@ -153,7 +161,7 @@
}, },
__RequestVerificationToken: token, __RequestVerificationToken: token,
withCredentials: true withCredentials: true
}).then(function(resp) { }).then(function (resp) {
$('#busy-indicator-container').hide(); $('#busy-indicator-container').hide();
deferred.resolve(); deferred.resolve();
if (resp.data) { if (resp.data) {
...@@ -163,7 +171,7 @@ ...@@ -163,7 +171,7 @@
} else { } else {
if (resp.message && resp.message.length > 0) { if (resp.message && resp.message.length > 0) {
SweetAlert.warning($translate.instant(resp.resultMsg)); SweetAlert.warning($translate.instant(resp.resultMsg));
}else{ } else {
SweetAlert.error($translate.instant('ImportFailed')); SweetAlert.error($translate.instant('ImportFailed'));
} }
logDto.UpdateState = $translate.instant('ImportFail'); logDto.UpdateState = $translate.instant('ImportFail');
...@@ -193,10 +201,9 @@ ...@@ -193,10 +201,9 @@
var getGridHeight = function () { var getGridHeight = function () {
if ($scope.isLoadComplete) { if ($scope.isLoadComplete) {
return { height: ($('.balance-ouput-grid-wrapper').height()) + "px" }; return {height: ($('.balance-ouput-grid-wrapper').height()) + "px"};
} } else {
else { return {height: 0 + "px"};
return { height: 0 + "px" };
} }
}; };
...@@ -355,16 +362,15 @@ ...@@ -355,16 +362,15 @@
var setButtonWrapStyle = function () { var setButtonWrapStyle = function () {
if ($scope.fileName) { if ($scope.fileName) {
return { width: "100%" }; return {width: "100%"};
} }
}; };
var setGridStyle = function () { var setGridStyle = function () {
if ($scope.showTotalSecondRow) { if ($scope.showTotalSecondRow) {
return { 'margin-top': '60px' } return {'margin-top': '60px'}
} } else {
else { return {'margin-top': '55px'}
return { 'margin-top': '55px' }
} }
}; };
...@@ -383,6 +389,14 @@ ...@@ -383,6 +389,14 @@
ele1.datepicker("setDate", $scope.selectedDate); ele1.datepicker("setDate", $scope.selectedDate);
}; };
$scope.initCompanyList = function () {
orgService.getOrgListByUserId().success(function (data) {
if (data) {
$scope.companyList = data;
}
});
};
$scope.downloadTemplate = function () { $scope.downloadTemplate = function () {
debugger; debugger;
templateService.citDownloadTemplate(constant.citImportFileType.BalanceSheetPrcAdjust).success(function (data, status, headers) { templateService.citDownloadTemplate(constant.citImportFileType.BalanceSheetPrcAdjust).success(function (data, status, headers) {
......
...@@ -8,6 +8,29 @@ ...@@ -8,6 +8,29 @@
<form class="form-inline" id="navigationForm" name="navigationForm"> <form class="form-inline" id="navigationForm" name="navigationForm">
<div class="form-group" ng-style="setButtonWrapStyle()"> <div class="form-group" ng-style="setButtonWrapStyle()">
<div class="import-wrapper"> <div class="import-wrapper">
<span class="text-bold" translate="SelectedOrganization"></span>:
<div class="dropdown" style="margin-left:10px">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 250px;">
{{checkedCompanyTypeList ? ((checkedCompanyTypeList)|limitString:maxTitleLength):('PleaseSelect' | translate)}}
<span class="caret" style="float: right "></span>
</button>
<ul class="dropdown-menu" style="width: 250px;" aria-labelledby="dropdownMenu1">
<li><input type="checkbox" ng-model="selectedAll" ng-change="selectAll()"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px" checked>
<span style="margin-left:5px;float: left;">全选</span></li>
<li role="separator" class="divider" style="height: 1px;margin: 9px 0;
overflow: hidden;background-color: #e5e5e5;"></li>
<li ng-repeat="i in companyList">
<div class="checkbox-custom checkbox-default">
<input type="checkbox" ng-model="i.checked" ng-change="selectOne()"
ng-checked="selectedOne"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px">
<span style="margin-left:5px;text-align: left;">{{i.name}}</span>
</div>
</li>
</ul>
</div>
<span class="text-bold" translate="InvoiceQJ"></span>: <span class="text-bold" translate="InvoiceQJ"></span>:
<div class="period-picker" style="margin-left:10px"> <div class="period-picker" style="margin-left:10px">
<input type="text" id="periodDatepicker" class="datepicker imp-subheader" style="width:120px;" <input type="text" id="periodDatepicker" class="datepicker imp-subheader" style="width:120px;"
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
$scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1); $scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1);
$scope.startDate = new Date(year - 20, 1, 1); $scope.startDate = new Date(year - 20, 1, 1);
$scope.endDate = new Date(year + 20, 1, 1); $scope.endDate = new Date(year + 20, 1, 1);
$scope.viewMode = 1; $scope.viewMode = 2;
$scope.dateFormat = $translate.instant('dateFormat4YearMonth'); $scope.dateFormat = $translate.instant('dateFormat4Year');
$scope.importExcelFile = null; $scope.importExcelFile = null;
$scope.UploadPeriodTime = null; $scope.UploadPeriodTime = null;
...@@ -136,6 +136,10 @@ ...@@ -136,6 +136,10 @@
} }
var period = $scope.UploadPeriodTime; var period = $scope.UploadPeriodTime;
if(period == null){
SweetAlert.warning($translate.instant('PleaseSelectPeriod'));
return;
}
Upload.upload({ Upload.upload({
url: uploadUrl, url: uploadUrl,
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
$scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1); $scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1);
$scope.startDate = new Date(year - 20, 1, 1); $scope.startDate = new Date(year - 20, 1, 1);
$scope.endDate = new Date(year + 20, 1, 1); $scope.endDate = new Date(year + 20, 1, 1);
$scope.viewMode = 1; $scope.viewMode = 2;
$scope.dateFormat = $translate.instant('dateFormat4YearMonth'); $scope.dateFormat = $translate.instant('dateFormat4Year');
$scope.importExcelFile = null; $scope.importExcelFile = null;
$scope.UploadPeriodTime = null; $scope.UploadPeriodTime = null;
...@@ -136,6 +136,10 @@ ...@@ -136,6 +136,10 @@
} }
var period = $scope.UploadPeriodTime; var period = $scope.UploadPeriodTime;
if(period == null){
SweetAlert.warning($translate.instant('PleaseSelectPeriod'));
return;
}
Upload.upload({ Upload.upload({
url: uploadUrl, url: uploadUrl,
......
commonModule.controller('importCitJournalAdjustController', ['$scope', '$log', '$translate', '$timeout', '$q', '$interval' commonModule.controller('importCitJournalAdjustController', ['$scope', '$log', '$translate', '$timeout', '$q'
, 'apiInterceptor', 'Upload', 'citImportDataService', 'SweetAlert', 'uiGridConstants', '$uibModal' , 'apiInterceptor', 'Upload', 'citImportDataService', 'SweetAlert', 'vatSessionService', 'enums',
, 'vatSessionService', 'enums', 'vatOperationLogService','templateService', 'vatOperationLogService','templateService','orgService',
function ($scope, $log, $translate, $timeout, $q, $interval function ($scope, $log, $translate, $timeout, $q, apiInterceptor, Upload, citImportDataService, SweetAlert
, apiInterceptor, Upload, citImportDataService, SweetAlert, uiGridConstants, $uibModal , vatSessionService, enums, vatOperationLogService, templateService, orgService) {
, vatSessionService, enums, vatOperationLogService, templateService) {
'use strict'; 'use strict';
// $anchorScroll.yOffset=55; // $anchorScroll.yOffset=55;
// $location.hash('top'); // $location.hash('top');
...@@ -27,12 +26,17 @@ ...@@ -27,12 +26,17 @@
$scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1); $scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1);
$scope.startDate = new Date(year - 20, 1, 1); $scope.startDate = new Date(year - 20, 1, 1);
$scope.endDate = new Date(year + 20, 1, 1); $scope.endDate = new Date(year + 20, 1, 1);
$scope.viewMode = 1; $scope.viewMode = 2;
$scope.dateFormat = $translate.instant('dateFormat4YearMonth'); $scope.dateFormat = $translate.instant('dateFormat4Year');
$scope.importExcelFile = null; $scope.importExcelFile = null;
$scope.UploadPeriodTime = null; $scope.UploadPeriodTime = null;
$scope.companyList = [];
$scope.checkedCompanyList = [];
$scope.checkedCompanyCodeList = [];
$scope.checkedCompanyTypeList = "";
//写日志 //写日志
...@@ -136,10 +140,22 @@ ...@@ -136,10 +140,22 @@
} }
var period = $scope.UploadPeriodTime; var period = $scope.UploadPeriodTime;
if(period == null){
SweetAlert.warning($translate.instant('PleaseSelectPeriod'));
return;
}
if($scope.checkedCompanyCodeList.length == 0){
SweetAlert.warning($translate.instant('PleaseSelectOrganization'));
return;
}
var orgIds = JSON.stringify($scope.checkedCompanyCodeList);
Upload.upload({ Upload.upload({
url: uploadUrl, url: uploadUrl,
data: { data: {
orgIds : orgIds,
periodDate : period, periodDate : period,
importType : importType, importType : importType,
importFileType : constant.citImportFileType.JournalAdjust importFileType : constant.citImportFileType.JournalAdjust
...@@ -154,14 +170,17 @@ ...@@ -154,14 +170,17 @@
__RequestVerificationToken: token, __RequestVerificationToken: token,
withCredentials: true withCredentials: true
}).then(function(resp) { }).then(function(resp) {
debugger;
$('#busy-indicator-container').hide(); $('#busy-indicator-container').hide();
deferred.resolve(); deferred.resolve();
if (resp.data) { if (resp.result) {
debugger;
logDto.UpdateState = $translate.instant('ImportSuccess'); logDto.UpdateState = $translate.instant('ImportSuccess');
vatOperationLogService.addOperationLog(logDto); vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess')); SweetAlert.success($translate.instant('ImportSuccess'));
} else { } else {
if (resp.message && resp.message.length > 0) { debugger;
if (resp.resultMsg && resp.resultMsg.length > 0) {
SweetAlert.warning($translate.instant(resp.resultMsg)); SweetAlert.warning($translate.instant(resp.resultMsg));
}else{ }else{
SweetAlert.error($translate.instant('ImportFailed')); SweetAlert.error($translate.instant('ImportFailed'));
...@@ -384,6 +403,60 @@ debugger; ...@@ -384,6 +403,60 @@ debugger;
ele1.datepicker("setDate", $scope.selectedDate); ele1.datepicker("setDate", $scope.selectedDate);
}; };
var initCompanyList = function () {
orgService.getOrgListByUserId().success(function (data) {
if (data) {
$scope.companyList = data;
}
});
};
$scope.selectOne = function () {
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList , function (i) {
var index = $scope.checkedCompanyList.indexOf(i.id);
if(i.checked && index === -1) {
$scope.checkedCompanyList.push(i);
} else if (!i.checked && index !== -1){
$scope.checkedCompanyList.splice(index, 1);
}
});
$scope.selectedAll = $scope.companyList.length === $scope.checkedCompanyList.length;
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name+";";
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList);
};
$scope.selectAll = function () {
if($scope.selectedAll) {
$scope.selectedOne = true;
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) {
$scope.checkedCompanyList.push(i);
i.checked = true;
})
}else {
$scope.selectedOne = false;
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) {
i.checked = false;
})
}
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name;
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList);
};
$scope.downloadTemplate = function () { $scope.downloadTemplate = function () {
debugger; debugger;
templateService.citDownloadTemplate(constant.citImportFileType.JournalAdjust).success(function (data, status, headers) { templateService.citDownloadTemplate(constant.citImportFileType.JournalAdjust).success(function (data, status, headers) {
...@@ -428,6 +501,7 @@ debugger; ...@@ -428,6 +501,7 @@ debugger;
$scope.setGridStyle = setGridStyle; $scope.setGridStyle = setGridStyle;
getUserPermission(); getUserPermission();
initCompanyList();
loadImportInfoDataGrid(); loadImportInfoDataGrid();
initDatePicker(); initDatePicker();
......
...@@ -8,6 +8,29 @@ ...@@ -8,6 +8,29 @@
<form class="form-inline" id="navigationForm" name="navigationForm"> <form class="form-inline" id="navigationForm" name="navigationForm">
<div class="form-group" ng-style="setButtonWrapStyle()"> <div class="form-group" ng-style="setButtonWrapStyle()">
<div class="import-wrapper"> <div class="import-wrapper">
<span class="text-bold" translate="SelectedOrganization"></span>:
<div class="dropdown" style="margin-left:10px">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 250px;">
{{checkedCompanyTypeList ? ((checkedCompanyTypeList)|limitString:maxTitleLength):('PleaseSelect' | translate)}}
<span class="caret" style="float: right "></span>
</button>
<ul class="dropdown-menu" style="width: 250px;" aria-labelledby="dropdownMenu1">
<li><input type="checkbox" ng-model="selectedAll" ng-change="selectAll()"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px" checked>
<span style="margin-left:5px;float: left;">全选</span></li>
<li role="separator" class="divider" style="height: 1px;margin: 9px 0;
overflow: hidden;background-color: #e5e5e5;"></li>
<li ng-repeat="i in companyList">
<div class="checkbox-custom checkbox-default">
<input type="checkbox" ng-model="i.checked" ng-change="selectOne()"
ng-checked="selectedOne"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px">
<span style="margin-left:5px;text-align: left;">{{i.name}}</span>
</div>
</li>
</ul>
</div>
<span class="text-bold" translate="InvoiceQJ"></span>: <span class="text-bold" translate="InvoiceQJ"></span>:
<div class="period-picker" style="margin-left:10px"> <div class="period-picker" style="margin-left:10px">
<input type="text" id="periodDatepicker" class="datepicker imp-subheader" style="width:120px;" <input type="text" id="periodDatepicker" class="datepicker imp-subheader" style="width:120px;"
......
commonModule.controller('importCitProfitPrcAdjustCon', ['$scope', '$log', '$translate', '$timeout', '$q', '$interval' commonModule.controller('importCitProfitPrcAdjustCon', ['$scope', '$log', '$translate', '$timeout', '$q',
, 'apiInterceptor', 'Upload', 'citImportDataService', 'SweetAlert', 'uiGridConstants', '$uibModal' 'apiInterceptor', 'Upload', 'citImportDataService', 'SweetAlert', 'vatSessionService', 'enums',
, 'vatSessionService', 'enums', 'vatOperationLogService','templateService', 'vatOperationLogService','templateService','orgService',
function ($scope, $log, $translate, $timeout, $q, $interval function ($scope, $log, $translate, $timeout, $q, apiInterceptor, Upload, citImportDataService, SweetAlert
, apiInterceptor, Upload, citImportDataService, SweetAlert, uiGridConstants, $uibModal , vatSessionService, enums, vatOperationLogService, templateService, orgService) {
, vatSessionService, enums, vatOperationLogService, templateService) {
'use strict'; 'use strict';
// $anchorScroll.yOffset=55; // $anchorScroll.yOffset=55;
// $location.hash('top'); // $location.hash('top');
...@@ -27,13 +26,16 @@ ...@@ -27,13 +26,16 @@
$scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1); $scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1);
$scope.startDate = new Date(year - 20, 1, 1); $scope.startDate = new Date(year - 20, 1, 1);
$scope.endDate = new Date(year + 20, 1, 1); $scope.endDate = new Date(year + 20, 1, 1);
$scope.viewMode = 1; $scope.viewMode = 2;
$scope.dateFormat = $translate.instant('dateFormat4YearMonth'); $scope.dateFormat = $translate.instant('dateFormat4Year');
$scope.importExcelFile = null; $scope.importExcelFile = null;
$scope.UploadPeriodTime = null; $scope.UploadPeriodTime = null;
$scope.companyList = [];
$scope.checkedCompanyList = [];
$scope.checkedCompanyCodeList = [];
$scope.checkedCompanyTypeList = "";
//写日志 //写日志
var logDto = { var logDto = {
...@@ -136,10 +138,20 @@ ...@@ -136,10 +138,20 @@
} }
var period = $scope.UploadPeriodTime; var period = $scope.UploadPeriodTime;
if(period == null){
SweetAlert.warning($translate.instant('PleaseSelectPeriod'));
return;
}
if($scope.checkedCompanyCodeList.length == 0){
SweetAlert.warning($translate.instant('PleaseSelectOrganization'));
return;
}
var orgIds = JSON.stringify($scope.checkedCompanyCodeList);
Upload.upload({ Upload.upload({
url: uploadUrl, url: uploadUrl,
data: { data: {
orgIds : orgIds,
periodDate : period, periodDate : period,
importType : importType, importType : importType,
importFileType : constant.citImportFileType.ProfitPrcAdjust importFileType : constant.citImportFileType.ProfitPrcAdjust
...@@ -383,6 +395,60 @@ ...@@ -383,6 +395,60 @@
ele1.datepicker("setDate", $scope.selectedDate); ele1.datepicker("setDate", $scope.selectedDate);
}; };
var initCompanyList = function () {
orgService.getOrgListByUserId().success(function (data) {
if (data) {
$scope.companyList = data;
}
});
};
$scope.selectOne = function () {
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList , function (i) {
var index = $scope.checkedCompanyList.indexOf(i.id);
if(i.checked && index === -1) {
$scope.checkedCompanyList.push(i);
} else if (!i.checked && index !== -1){
$scope.checkedCompanyList.splice(index, 1);
}
});
$scope.selectedAll = $scope.companyList.length === $scope.checkedCompanyList.length;
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name+";";
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList);
};
$scope.selectAll = function () {
if($scope.selectedAll) {
$scope.selectedOne = true;
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) {
$scope.checkedCompanyList.push(i);
i.checked = true;
})
}else {
$scope.selectedOne = false;
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) {
i.checked = false;
})
}
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name;
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList);
};
$scope.downloadTemplate = function () { $scope.downloadTemplate = function () {
debugger; debugger;
templateService.citDownloadTemplate(constant.citImportFileType.ProfitPrcAdjust).success(function (data, status, headers) { templateService.citDownloadTemplate(constant.citImportFileType.ProfitPrcAdjust).success(function (data, status, headers) {
...@@ -427,6 +493,7 @@ ...@@ -427,6 +493,7 @@
$scope.setGridStyle = setGridStyle; $scope.setGridStyle = setGridStyle;
getUserPermission(); getUserPermission();
initCompanyList();
loadImportInfoDataGrid(); loadImportInfoDataGrid();
initDatePicker(); initDatePicker();
......
...@@ -8,6 +8,29 @@ ...@@ -8,6 +8,29 @@
<form class="form-inline" id="navigationForm" name="navigationForm"> <form class="form-inline" id="navigationForm" name="navigationForm">
<div class="form-group" ng-style="setButtonWrapStyle()"> <div class="form-group" ng-style="setButtonWrapStyle()">
<div class="import-wrapper"> <div class="import-wrapper">
<span class="text-bold" translate="SelectedOrganization"></span>:
<div class="dropdown" style="margin-left:10px">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 250px;">
{{checkedCompanyTypeList ? ((checkedCompanyTypeList)|limitString:maxTitleLength):('PleaseSelect' | translate)}}
<span class="caret" style="float: right "></span>
</button>
<ul class="dropdown-menu" style="width: 250px;" aria-labelledby="dropdownMenu1">
<li><input type="checkbox" ng-model="selectedAll" ng-change="selectAll()"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px" checked>
<span style="margin-left:5px;float: left;">全选</span></li>
<li role="separator" class="divider" style="height: 1px;margin: 9px 0;
overflow: hidden;background-color: #e5e5e5;"></li>
<li ng-repeat="i in companyList">
<div class="checkbox-custom checkbox-default">
<input type="checkbox" ng-model="i.checked" ng-change="selectOne()"
ng-checked="selectedOne"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px">
<span style="margin-left:5px;text-align: left;">{{i.name}}</span>
</div>
</li>
</ul>
</div>
<span class="text-bold" translate="InvoiceQJ"></span>: <span class="text-bold" translate="InvoiceQJ"></span>:
<div class="period-picker" style="margin-left:10px"> <div class="period-picker" style="margin-left:10px">
<input type="text" id="periodDatepicker" class="datepicker imp-subheader" style="width:120px;" <input type="text" id="periodDatepicker" class="datepicker imp-subheader" style="width:120px;"
......
commonModule.controller('importCitSalaryAdvanceCon', ['$scope', '$log', '$translate', '$timeout', '$q', '$interval' commonModule.controller('importCitSalaryAdvanceCon', ['$scope', '$log', '$translate', '$timeout', '$q'
, 'apiInterceptor', 'Upload', 'citImportDataService', 'SweetAlert', 'uiGridConstants', '$uibModal' , 'apiInterceptor', 'Upload', 'citImportDataService', 'SweetAlert', 'vatSessionService', 'enums',
, 'vatSessionService', 'enums', 'vatOperationLogService','templateService', 'vatOperationLogService','templateService','orgService',
function ($scope, $log, $translate, $timeout, $q, $interval function ($scope, $log, $translate, $timeout, $q, apiInterceptor, Upload, citImportDataService, SweetAlert
, apiInterceptor, Upload, citImportDataService, SweetAlert, uiGridConstants, $uibModal , vatSessionService, enums, vatOperationLogService, templateService, orgService) {
, vatSessionService, enums, vatOperationLogService, templateService) {
'use strict'; 'use strict';
// $anchorScroll.yOffset=55; // $anchorScroll.yOffset=55;
// $location.hash('top'); // $location.hash('top');
...@@ -27,12 +26,16 @@ ...@@ -27,12 +26,16 @@
$scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1); $scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1);
$scope.startDate = new Date(year - 20, 1, 1); $scope.startDate = new Date(year - 20, 1, 1);
$scope.endDate = new Date(year + 20, 1, 1); $scope.endDate = new Date(year + 20, 1, 1);
$scope.viewMode = 1; $scope.viewMode = 2;
$scope.dateFormat = $translate.instant('dateFormat4YearMonth'); $scope.dateFormat = $translate.instant('dateFormat4Year');
$scope.importExcelFile = null; $scope.importExcelFile = null;
$scope.UploadPeriodTime = null; $scope.UploadPeriodTime = null;
$scope.companyList = [];
$scope.checkedCompanyList = [];
$scope.checkedCompanyCodeList = [];
$scope.checkedCompanyTypeList = "";
//写日志 //写日志
...@@ -136,10 +139,20 @@ ...@@ -136,10 +139,20 @@
} }
var period = $scope.UploadPeriodTime; var period = $scope.UploadPeriodTime;
if(period == null){
SweetAlert.warning($translate.instant('PleaseSelectPeriod'));
return;
}
if($scope.checkedCompanyCodeList.length == 0){
SweetAlert.warning($translate.instant('PleaseSelectOrganization'));
return;
}
var orgIds = JSON.stringify($scope.checkedCompanyCodeList);
Upload.upload({ Upload.upload({
url: uploadUrl, url: uploadUrl,
data: { data: {
orgIds : orgIds,
periodDate : period, periodDate : period,
importType : importType, importType : importType,
importFileType : constant.citImportFileType.SalaryAdvance importFileType : constant.citImportFileType.SalaryAdvance
...@@ -383,6 +396,60 @@ ...@@ -383,6 +396,60 @@
ele1.datepicker("setDate", $scope.selectedDate); ele1.datepicker("setDate", $scope.selectedDate);
}; };
var initCompanyList = function () {
orgService.getOrgListByUserId().success(function (data) {
if (data) {
$scope.companyList = data;
}
});
};
$scope.selectOne = function () {
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList , function (i) {
var index = $scope.checkedCompanyList.indexOf(i.id);
if(i.checked && index === -1) {
$scope.checkedCompanyList.push(i);
} else if (!i.checked && index !== -1){
$scope.checkedCompanyList.splice(index, 1);
}
});
$scope.selectedAll = $scope.companyList.length === $scope.checkedCompanyList.length;
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name+";";
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList);
};
$scope.selectAll = function () {
if($scope.selectedAll) {
$scope.selectedOne = true;
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) {
$scope.checkedCompanyList.push(i);
i.checked = true;
})
}else {
$scope.selectedOne = false;
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) {
i.checked = false;
})
}
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name;
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList);
};
$scope.downloadTemplate = function () { $scope.downloadTemplate = function () {
debugger; debugger;
templateService.citDownloadTemplate(constant.citImportFileType.SalaryAdvance).success(function (data, status, headers) { templateService.citDownloadTemplate(constant.citImportFileType.SalaryAdvance).success(function (data, status, headers) {
...@@ -427,6 +494,7 @@ ...@@ -427,6 +494,7 @@
$scope.setGridStyle = setGridStyle; $scope.setGridStyle = setGridStyle;
getUserPermission(); getUserPermission();
initCompanyList();
loadImportInfoDataGrid(); loadImportInfoDataGrid();
initDatePicker(); initDatePicker();
......
...@@ -8,6 +8,29 @@ ...@@ -8,6 +8,29 @@
<form class="form-inline" id="navigationForm" name="navigationForm"> <form class="form-inline" id="navigationForm" name="navigationForm">
<div class="form-group" ng-style="setButtonWrapStyle()"> <div class="form-group" ng-style="setButtonWrapStyle()">
<div class="import-wrapper"> <div class="import-wrapper">
<span class="text-bold" translate="SelectedOrganization"></span>:
<div class="dropdown" style="margin-left:10px">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 250px;">
{{checkedCompanyTypeList ? ((checkedCompanyTypeList)|limitString:maxTitleLength):('PleaseSelect' | translate)}}
<span class="caret" style="float: right "></span>
</button>
<ul class="dropdown-menu" style="width: 250px;" aria-labelledby="dropdownMenu1">
<li><input type="checkbox" ng-model="selectedAll" ng-change="selectAll()"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px" checked>
<span style="margin-left:5px;float: left;">全选</span></li>
<li role="separator" class="divider" style="height: 1px;margin: 9px 0;
overflow: hidden;background-color: #e5e5e5;"></li>
<li ng-repeat="i in companyList">
<div class="checkbox-custom checkbox-default">
<input type="checkbox" ng-model="i.checked" ng-change="selectOne()"
ng-checked="selectedOne"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px">
<span style="margin-left:5px;text-align: left;">{{i.name}}</span>
</div>
</li>
</ul>
</div>
<span class="text-bold" translate="InvoiceQJ"></span>: <span class="text-bold" translate="InvoiceQJ"></span>:
<div class="period-picker" style="margin-left:10px"> <div class="period-picker" style="margin-left:10px">
<input type="text" id="periodDatepicker" class="datepicker imp-subheader" style="width:120px;" <input type="text" id="periodDatepicker" class="datepicker imp-subheader" style="width:120px;"
......
commonModule.controller('importCitTrialBalanceController', ['$scope', '$log', '$translate', '$timeout', '$q', '$interval' commonModule.controller('importCitTrialBalanceController', ['$scope', '$log', '$translate', '$timeout', '$q'
, 'apiInterceptor', 'Upload', 'citImportDataService', 'SweetAlert', 'uiGridConstants', '$uibModal' , 'apiInterceptor', 'Upload', 'citImportDataService', 'SweetAlert', 'vatSessionService', 'enums',
, 'vatSessionService', 'enums', 'vatOperationLogService','templateService', 'vatOperationLogService','templateService','orgService',
function ($scope, $log, $translate, $timeout, $q, $interval function ($scope, $log, $translate, $timeout, $q
, apiInterceptor, Upload, citImportDataService, SweetAlert, uiGridConstants, $uibModal , apiInterceptor, Upload, citImportDataService, SweetAlert
, vatSessionService, enums, vatOperationLogService, templateService) { , vatSessionService, enums, vatOperationLogService, templateService, orgService) {
'use strict'; 'use strict';
// $anchorScroll.yOffset=55; // $anchorScroll.yOffset=55;
// $location.hash('top'); // $location.hash('top');
...@@ -27,12 +27,16 @@ ...@@ -27,12 +27,16 @@
$scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1); $scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1);
$scope.startDate = new Date(year - 20, 1, 1); $scope.startDate = new Date(year - 20, 1, 1);
$scope.endDate = new Date(year + 20, 1, 1); $scope.endDate = new Date(year + 20, 1, 1);
$scope.viewMode = 1; $scope.viewMode = 2;
$scope.dateFormat = $translate.instant('dateFormat4YearMonth'); $scope.dateFormat = $translate.instant('dateFormat4Year');
$scope.importExcelFile = null; $scope.importExcelFile = null;
$scope.UploadPeriodTime = null; $scope.UploadPeriodTime = null;
$scope.companyList = [];
$scope.checkedCompanyList = [];
$scope.checkedCompanyCodeList = [];
$scope.checkedCompanyTypeList = "";
//写日志 //写日志
...@@ -136,10 +140,20 @@ ...@@ -136,10 +140,20 @@
} }
var period = $scope.UploadPeriodTime; var period = $scope.UploadPeriodTime;
if(period == null){
SweetAlert.warning($translate.instant('PleaseSelectPeriod'));
return;
}
if($scope.checkedCompanyCodeList.length == 0){
SweetAlert.warning($translate.instant('PleaseSelectOrganization'));
return;
}
var orgIds = JSON.stringify($scope.checkedCompanyCodeList);
Upload.upload({ Upload.upload({
url: uploadUrl, url: uploadUrl,
data: { data: {
orgIds : orgIds,
periodDate : period, periodDate : period,
importType : importType, importType : importType,
importFileType : constant.citImportFileType.TrialBalance importFileType : constant.citImportFileType.TrialBalance
...@@ -383,6 +397,60 @@ ...@@ -383,6 +397,60 @@
ele1.datepicker("setDate", $scope.selectedDate); ele1.datepicker("setDate", $scope.selectedDate);
}; };
var initCompanyList = function () {
orgService.getOrgListByUserId().success(function (data) {
if (data) {
$scope.companyList = data;
}
});
};
$scope.selectOne = function () {
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList , function (i) {
var index = $scope.checkedCompanyList.indexOf(i.id);
if(i.checked && index === -1) {
$scope.checkedCompanyList.push(i);
} else if (!i.checked && index !== -1){
$scope.checkedCompanyList.splice(index, 1);
}
});
$scope.selectedAll = $scope.companyList.length === $scope.checkedCompanyList.length;
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name+";";
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList);
};
$scope.selectAll = function () {
if($scope.selectedAll) {
$scope.selectedOne = true;
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) {
$scope.checkedCompanyList.push(i);
i.checked = true;
})
}else {
$scope.selectedOne = false;
$scope.checkedCompanyList = [];
angular.forEach($scope.companyList, function (i, index) {
i.checked = false;
})
}
$scope.checkedCompanyTypeList = "";
$scope.checkedCompanyCodeList = [];
angular.forEach($scope.checkedCompanyList,function (i) {
$scope.checkedCompanyTypeList += i.name;
$scope.checkedCompanyCodeList.push(i.id);
});
console.log($scope.checkedCompanyList);
};
$scope.downloadTemplate = function () { $scope.downloadTemplate = function () {
debugger; debugger;
templateService.citDownloadTemplate(constant.citImportFileType.TrialBalance).success(function (data, status, headers) { templateService.citDownloadTemplate(constant.citImportFileType.TrialBalance).success(function (data, status, headers) {
...@@ -427,6 +495,7 @@ ...@@ -427,6 +495,7 @@
$scope.setGridStyle = setGridStyle; $scope.setGridStyle = setGridStyle;
getUserPermission(); getUserPermission();
initCompanyList();
loadImportInfoDataGrid(); loadImportInfoDataGrid();
initDatePicker(); initDatePicker();
......
...@@ -8,6 +8,29 @@ ...@@ -8,6 +8,29 @@
<form class="form-inline" id="navigationForm" name="navigationForm"> <form class="form-inline" id="navigationForm" name="navigationForm">
<div class="form-group" ng-style="setButtonWrapStyle()"> <div class="form-group" ng-style="setButtonWrapStyle()">
<div class="import-wrapper"> <div class="import-wrapper">
<span class="text-bold" translate="SelectedOrganization"></span>:
<div class="dropdown" style="margin-left:10px">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 250px;">
{{checkedCompanyTypeList ? ((checkedCompanyTypeList)|limitString:maxTitleLength):('PleaseSelect' | translate)}}
<span class="caret" style="float: right "></span>
</button>
<ul class="dropdown-menu" style="width: 250px;" aria-labelledby="dropdownMenu1">
<li><input type="checkbox" ng-model="selectedAll" ng-change="selectAll()"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px" checked>
<span style="margin-left:5px;float: left;">全选</span></li>
<li role="separator" class="divider" style="height: 1px;margin: 9px 0;
overflow: hidden;background-color: #e5e5e5;"></li>
<li ng-repeat="i in companyList">
<div class="checkbox-custom checkbox-default">
<input type="checkbox" ng-model="i.checked" ng-change="selectOne()"
ng-checked="selectedOne"
style="float: left;margin-left: 10px; margin-top: 7px; width: 15px">
<span style="margin-left:5px;text-align: left;">{{i.name}}</span>
</div>
</li>
</ul>
</div>
<span class="text-bold" translate="InvoiceQJ"></span>: <span class="text-bold" translate="InvoiceQJ"></span>:
<div class="period-picker" style="margin-left:10px"> <div class="period-picker" style="margin-left:10px">
<input type="text" id="periodDatepicker" class="datepicker imp-subheader" style="width:120px;" <input type="text" id="periodDatepicker" class="datepicker imp-subheader" style="width:120px;"
......
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