Commit 355c5d38 authored by zhkwei's avatar zhkwei

CIT数据导入功能模块改bug

parent f09cd069
......@@ -31,7 +31,7 @@ public class CitImportExcelController {
@RequestMapping(value = "/citImportExcel", method = RequestMethod.POST)
public @ResponseBody
OperationResultDto citImportExcel(@RequestParam MultipartFile file, @RequestParam String orgIds,
OperationResultDto citImportExcel(@RequestParam MultipartFile file, @RequestParam(required = false) String orgIds,
@RequestParam String periodDate,
@RequestParam Integer importType,
@RequestParam Integer importFileType){
......
......@@ -25,6 +25,7 @@ import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class CitImportExcelServiceImpl extends BaseService {
......@@ -537,7 +538,7 @@ public class CitImportExcelServiceImpl extends BaseService {
List<CitDataImportLog> citDataImportLogList = new ArrayList<>();
// Integer period = CitCommonUtil.getPeriod();
String companyName = CitCommonUtil.getValue(sheet.getRow(5).getCell(1)).toString();
List<Organization> organizations = getOrganizationByName(companyName);
List<Organization> organizations = getOrganizationByName(companyName).stream().filter(r->r.getCode()!=null&&!("".equals(r.getCode()))).collect(Collectors.toList());
String companyCode = "";
String orgId = "";
String taxPayerId = "";
......@@ -547,6 +548,7 @@ public class CitImportExcelServiceImpl extends BaseService {
if(!orgList.contains(orgId)){
saveResult.setResult(false);
saveResult.setData(false);
saveResult.setResultMsg(ErrorMessageCN.DoNotSelectCompany);
return saveResult;
}
......@@ -556,6 +558,7 @@ public class CitImportExcelServiceImpl extends BaseService {
}else{
saveResult.setResult(false);
saveResult.setData(false);
saveResult.setResultMsg(ErrorMessageCN.NoCompanyError);
return saveResult;
}
......@@ -592,7 +595,6 @@ public class CitImportExcelServiceImpl extends BaseService {
citDataImportLogList.add(citDataImportLogError);
continue;
}
System.out.println(cellValue);
citBSPrcAdjust.setBegBal(new BigDecimal(cellValue.toString().replace(",","")));
......@@ -888,7 +890,7 @@ public class CitImportExcelServiceImpl extends BaseService {
citDataImportLogList.add(citDataImportLogError);
continue;
}
String companyCode = cellValueCode.toString();
String companyCode = cellValueCode.toString().replace(".0","");
//根据code(主体)获取机构相关信息
List<Organization> organizations = getOrganizationByCode(companyCode);
String companyName = "";
......@@ -969,7 +971,9 @@ public class CitImportExcelServiceImpl extends BaseService {
citSalaryAdvanceMapper.deleteByExample(example);
updateImportLog(EnumCitImportType.SalaryAdvance.getCode());
}
int insertBatchNum = citSalaryAdvanceMapper.insertBatch(citSalaryAdvanceList);
if(citSalaryAdvanceList.size()>0){
int insertBatchNum = citSalaryAdvanceMapper.insertBatch(citSalaryAdvanceList);
}
//循环遍历成功导入的数据,组装日志记录实体并放入集合
for (Map.Entry<String, Integer> entry : companySuccessMap.entrySet()) {
......
......@@ -106,5 +106,5 @@ public interface CitSalaryAdvanceMapper extends MyMapper {
*/
int updateByPrimaryKey(CitSalaryAdvance record);
int insertBatch(List<CitSalaryAdvance> citSalaryAdvanceList);
int insertBatch(List<CitSalaryAdvance> list);
}
\ No newline at end of file
......@@ -49,7 +49,7 @@
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.createBy != null">#{item.createdBy,jdbcType=VARCHAR},</when>
<when test="item.createBy != null">#{item.createBy,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
......
......@@ -49,7 +49,7 @@
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.createBy != null">#{item.createdBy,jdbcType=VARCHAR},</when>
<when test="item.createBy != null">#{item.createBy,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
......
......@@ -29,8 +29,8 @@
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.poNo != null">#{item.poNo,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
<when test="item.poNo != null">#{item.poNo,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.poSubjectCode != null">#{item.poSubjectCode,jdbcType=VARCHAR},</when>
......
......@@ -170,16 +170,22 @@
}).then(function (resp) {
$('#busy-indicator-container').hide();
deferred.resolve();
if (resp.data) {
if (resp.data || resp.result) {
logDto.UpdateState = $translate.instant('ImportSuccess');
vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess'));
} else {
if (resp.message && resp.message.length > 0) {
SweetAlert.warning($translate.instant(resp.message));
} else {
SweetAlert.error($translate.instant('ImportFailed'));
}
if (resp.resultMsg && resp.resultMsg.length > 0) {
SweetAlert.warning($translate.instant(resp.resultMsg));
} else {
SweetAlert.error($translate.instant('ImportFailed'));
}
logDto.UpdateState = $translate.instant('ImportFail');
vatOperationLogService.addOperationLog(logDto);
}
......@@ -395,7 +401,7 @@
ele1.datepicker("setDate", $scope.selectedDate);
};
$scope.initCompanyList = function () {
var initCompanyList = function () {
orgService.getOrgListByUserId().success(function (data) {
if (data) {
$scope.companyList = data;
......@@ -494,6 +500,7 @@
$scope.setGridStyle = setGridStyle;
getUserPermission();
initCompanyList();
loadImportInfoDataGrid();
initDatePicker();
......
......@@ -162,7 +162,7 @@
}).then(function(resp) {
$('#busy-indicator-container').hide();
deferred.resolve();
if (resp.data) {
if (resp.data || resp.result) {
logDto.UpdateState = $translate.instant('ImportSuccess');
vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess'));
......
......@@ -161,7 +161,7 @@
}).then(function(resp) {
$('#busy-indicator-container').hide();
deferred.resolve();
if (resp.data) {
if (resp.data || resp.result) {
logDto.UpdateState = $translate.instant('ImportSuccess');
vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess'));
......
......@@ -170,7 +170,7 @@
}).then(function(resp) {
$('#busy-indicator-container').hide();
deferred.resolve();
if (resp.data) {
if (resp.data || resp.result) {
logDto.UpdateState = $translate.instant('ImportSuccess');
vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess'));
......
......@@ -171,7 +171,7 @@
}).then(function(resp) {
$('#busy-indicator-container').hide();
deferred.resolve();
if (resp.data) {
if (resp.data || resp.result) {
logDto.UpdateState = $translate.instant('ImportSuccess');
vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess'));
......
......@@ -173,7 +173,7 @@
}).then(function(resp) {
$('#busy-indicator-container').hide();
deferred.resolve();
if (resp.data) {
if (resp.data || resp.result) {
logDto.UpdateState = $translate.instant('ImportSuccess');
vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess'));
......
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