bug:物料分类编码导入失败调试

release
WangQi 2 years ago
parent d98cb5dc64
commit 3e843f0c70
  1. 11
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/taxcodematch/controller/SdenergyTaxCodeMatchController.java
  2. 3
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/taxcodematch/dao/SdenergyTaxCodeMatchDao.java
  3. 3
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/taxcodematch/service/SdenergyTaxCodeMatchService.java
  4. 3
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/taxcodematch/service/impl/SdenergyTaxCodeMatchServiceImpl.java

@ -9,7 +9,6 @@ import com.dxhy.order.baseservice.module.taxclass.service.TaxClassCodeService;
import com.dxhy.order.constant.OrderInfoContentEnum;
import com.dxhy.order.consumer.modules.taxcodematch.emum.SdenergyTaxCodeMatchEnum;
import com.dxhy.order.consumer.modules.taxcodematch.entity.SdenergyTaxCodeMatch;
import com.dxhy.order.consumer.modules.taxcodematch.entity.SdenergyTaxCodeMathchImport;
import com.dxhy.order.consumer.modules.taxcodematch.model.dto.SdenergyTaxCodeMatchDTO;
import com.dxhy.order.consumer.modules.taxcodematch.model.dto.SdenergyTaxCodeMatchDeleteDTO;
import com.dxhy.order.consumer.modules.taxcodematch.service.SdenergyTaxCodeMatchService;
@ -133,7 +132,7 @@ public class SdenergyTaxCodeMatchController {
for (SdenergyTaxCodeMatchEnum flowStatus : SdenergyTaxCodeMatchEnum.values()) {
headToProperty.put(flowStatus.getKey(), flowStatus.getValue());
}
ExcelReadContext context = new ExcelReadContext(SdenergyTaxCodeMathchImport.class, headToProperty, false);
ExcelReadContext context = new ExcelReadContext(SdenergyTaxCodeMatch.class, headToProperty, false);
if (StringUtils.isBlank(file.getOriginalFilename())) {
context.setFilePrefix(".xlsx");
} else {
@ -141,9 +140,9 @@ public class SdenergyTaxCodeMatchController {
}
ExcelReadHandle handle = new ExcelReadHandle(context);
List<SdenergyTaxCodeMathchImport> uploadList = new ArrayList<>();
List<SdenergyTaxCodeMatch> uploadList = new ArrayList<>();
try {
uploadList = handle.readFromExcel(file.getInputStream(), SdenergyTaxCodeMathchImport.class);
uploadList = handle.readFromExcel(file.getInputStream(), SdenergyTaxCodeMatch.class);
} catch (ExcelReadException e) {
log.error("{},导入物料分类编码异常", LOGGER_MSG, e);
return R.error("导入物料分类编码异常,请重新上传");
@ -156,12 +155,12 @@ public class SdenergyTaxCodeMatchController {
}
List<Map<String,String>> errorMsgList = Lists.newArrayList();
int resultIndex = 2;
Map<String, List<SdenergyTaxCodeMathchImport>> collect = uploadList.stream().collect(Collectors.groupingBy(t -> t.getSsflbm()));
Map<String, List<SdenergyTaxCodeMatch>> collect = uploadList.stream().collect(Collectors.groupingBy(t -> t.getSsflbm()));
List<String> collect1 = collect.keySet().stream().filter(t -> collect.get(t).size() > 1).collect(Collectors.toList());
if(!collect1.isEmpty()){
return R.error("导入物料分类编码异常,物料分类编码存在重复项,请检查");
}
for (SdenergyTaxCodeMathchImport taxCodeMatch : uploadList) {
for (SdenergyTaxCodeMatch taxCodeMatch : uploadList) {
resultIndex++;
String wlflbm = taxCodeMatch.getWlflbm();
if(StringUtils.isNotBlank(wlflbm)){

@ -1,7 +1,6 @@
package com.dxhy.order.consumer.modules.taxcodematch.dao;
import com.dxhy.order.consumer.modules.taxcodematch.entity.SdenergyTaxCodeMatch;
import com.dxhy.order.consumer.modules.taxcodematch.entity.SdenergyTaxCodeMathchImport;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -78,6 +77,6 @@ public interface SdenergyTaxCodeMatchDao {
* @param id
* @return
*/
int batchInsert(List<SdenergyTaxCodeMathchImport> id);
int batchInsert(List<SdenergyTaxCodeMatch> id);
}

@ -1,7 +1,6 @@
package com.dxhy.order.consumer.modules.taxcodematch.service;
import com.dxhy.order.consumer.modules.taxcodematch.entity.SdenergyTaxCodeMatch;
import com.dxhy.order.consumer.modules.taxcodematch.entity.SdenergyTaxCodeMathchImport;
import com.dxhy.order.consumer.modules.taxcodematch.model.dto.SdenergyTaxCodeMatchDTO;
import com.dxhy.order.model.PageUtils;
@ -60,7 +59,7 @@ public interface SdenergyTaxCodeMatchService {
boolean deleteById(Long id);
int upload(List<SdenergyTaxCodeMathchImport> list);
int upload(List<SdenergyTaxCodeMatch> list);
SdenergyTaxCodeMatch queryByWlflbm(String wlflbm);

@ -3,7 +3,6 @@ package com.dxhy.order.consumer.modules.taxcodematch.service.impl;
import com.dxhy.order.baseservice.module.commodity.model.CommodityCodeEntity;
import com.dxhy.order.consumer.modules.taxcodematch.entity.SdenergyTaxCodeMatch;
import com.dxhy.order.consumer.modules.taxcodematch.dao.SdenergyTaxCodeMatchDao;
import com.dxhy.order.consumer.modules.taxcodematch.entity.SdenergyTaxCodeMathchImport;
import com.dxhy.order.consumer.modules.taxcodematch.model.dto.SdenergyTaxCodeMatchDTO;
import com.dxhy.order.consumer.modules.taxcodematch.service.SdenergyTaxCodeMatchService;
import com.dxhy.order.model.PageUtils;
@ -118,7 +117,7 @@ public class SdenergyTaxCodeMatchServiceImpl implements SdenergyTaxCodeMatchServ
*/
@Override
@Transactional
public int upload(List<SdenergyTaxCodeMathchImport> list) {
public int upload(List<SdenergyTaxCodeMatch> list) {
return this.sdenergyTaxCodeMatchDao.batchInsert(list);
}

Loading…
Cancel
Save