Commit 2c77ebfc authored by zhkwei's avatar zhkwei

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

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