|
@@ -10,6 +10,7 @@ import com.rongwei.bscommon.sys.utils.ExceptionUtils;
|
|
|
import com.rongwei.bscommon.sys.utils.StringUtil;
|
|
|
import com.rongwei.bsentity.domain.EquWarrantyProviderDo;
|
|
|
import com.rongwei.rwadmincommon.system.domain.*;
|
|
|
+import com.rongwei.rwadmincommon.system.service.SysDictService;
|
|
|
import com.rongwei.rwadmincommon.system.vo.SysOrganizationVo;
|
|
|
import com.rongwei.rwcommon.base.R;
|
|
|
import com.rongwei.rwcommon.utils.SecurityUtil;
|
|
@@ -43,11 +44,15 @@ public class EquWarrantyProviderServiceImpl extends ServiceImpl<EquWarrantyProvi
|
|
|
@Autowired
|
|
|
private EquWarrantyProviderService equWarrantyProviderService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SysDictService sysDictService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private CommonDao commonDao;
|
|
|
|
|
|
@Override
|
|
|
public R importEquWarrantyProvider(MultipartFile file) {
|
|
|
+ List<SysDictDo> ynByType = sysDictService.getDictsByType("srm_yn");
|
|
|
try {
|
|
|
// 查询所有工厂数据
|
|
|
List<SysOrganizationVo> factoryList = commonDao.getAllFactoryNameAndId();
|
|
@@ -77,7 +82,12 @@ public class EquWarrantyProviderServiceImpl extends ServiceImpl<EquWarrantyProvi
|
|
|
String factory = row.getCell(7) == null ? "" : row.getCell(7).toString().trim();
|
|
|
String dept = row.getCell(8) == null ? "" : row.getCell(8).toString().trim();
|
|
|
if (StringUtils.isNotBlank(code)){
|
|
|
- code = StringUtil.formatDecimal(code);
|
|
|
+ if (StringUtil.isScience(code)){
|
|
|
+ BigDecimal formatAccount = new BigDecimal(code);
|
|
|
+ code = formatAccount.setScale(0,BigDecimal.ROUND_HALF_UP).toPlainString();
|
|
|
+ }else {
|
|
|
+ code = StringUtil.formatDecimal(code);
|
|
|
+ }
|
|
|
}else {
|
|
|
stringBuilder.append("保修商编号必填");
|
|
|
}
|
|
@@ -118,9 +128,10 @@ public class EquWarrantyProviderServiceImpl extends ServiceImpl<EquWarrantyProvi
|
|
|
phone = formatPhone.setScale(0,BigDecimal.ROUND_HALF_UP).toPlainString();
|
|
|
}
|
|
|
}
|
|
|
- SysDictDo sysDictDo = commonDao.getDictValueByNameAndType(isPrivately,"srm_yn");
|
|
|
- if (sysDictDo!= null){
|
|
|
- isPrivately = sysDictDo.getValue();
|
|
|
+ if (org.apache.commons.lang.StringUtils.isNotBlank(isPrivately)) {
|
|
|
+ String isPrivatelyDictName = isPrivately;
|
|
|
+ isPrivately = ynByType.stream().filter(dictDo -> isPrivatelyDictName.contains(dictDo.getName()))
|
|
|
+ .map(SysDictDo::getValue).collect(Collectors.joining(","));
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(factory)){
|
|
|
List<SysOrganizationVo> resultList = factoryList.stream().filter(p -> p.getFullname().equals(factory)).collect(Collectors.toList());
|