|
@@ -81,25 +81,13 @@ public class EquWarrantyProviderServiceImpl extends ServiceImpl<EquWarrantyProvi
|
|
|
String phone = row.getCell(6) == null ? "" : row.getCell(6).toString().trim();
|
|
|
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)){
|
|
|
- if (StringUtil.isScience(code)){
|
|
|
- BigDecimal formatAccount = new BigDecimal(code);
|
|
|
- code = formatAccount.setScale(0,BigDecimal.ROUND_HALF_UP).toPlainString();
|
|
|
- }else {
|
|
|
- code = StringUtil.formatDecimal(code);
|
|
|
- }
|
|
|
- }else {
|
|
|
+ if (StringUtils.isBlank(code)){
|
|
|
stringBuilder.append("保修商编号必填");
|
|
|
}
|
|
|
if (StringUtils.isBlank(name)){
|
|
|
stringBuilder.append("保修商名称必填");
|
|
|
}
|
|
|
- if (StringUtils.isNotBlank(zuscc)){
|
|
|
- if (StringUtil.isScience(zuscc)){
|
|
|
- BigDecimal formatAccount = new BigDecimal(zuscc);
|
|
|
- zuscc = formatAccount.setScale(0,BigDecimal.ROUND_HALF_UP).toPlainString();
|
|
|
- }
|
|
|
- }else {
|
|
|
+ if (StringUtils.isBlank(zuscc)){
|
|
|
stringBuilder.append("统一社会信用代码必填");
|
|
|
}
|
|
|
boolean containFactory = factorys.contains(factory);
|
|
@@ -122,17 +110,6 @@ public class EquWarrantyProviderServiceImpl extends ServiceImpl<EquWarrantyProvi
|
|
|
stringBuilder.append("表格中当前工厂下已存在该统一社会信用代码,不可重复录入");
|
|
|
}
|
|
|
}
|
|
|
- if (StringUtils.isNotBlank(phone)){
|
|
|
- if (StringUtil.isScience(phone)){
|
|
|
- BigDecimal formatPhone = new BigDecimal(phone);
|
|
|
- phone = formatPhone.setScale(0,BigDecimal.ROUND_HALF_UP).toPlainString();
|
|
|
- }
|
|
|
- }
|
|
|
- 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());
|
|
|
factoryId = resultList.get(0).getId();
|
|
@@ -149,6 +126,10 @@ public class EquWarrantyProviderServiceImpl extends ServiceImpl<EquWarrantyProvi
|
|
|
}
|
|
|
//当前用户所属工厂、【统一社会信用代码】作唯一校验
|
|
|
if (StringUtils.isNotBlank(zuscc)){
|
|
|
+ if (StringUtil.isScience(zuscc)){
|
|
|
+ BigDecimal formatAccount = new BigDecimal(zuscc);
|
|
|
+ zuscc = formatAccount.setScale(0,BigDecimal.ROUND_HALF_UP).toPlainString();
|
|
|
+ }
|
|
|
QueryWrapper<EquWarrantyProviderDo> entity = new QueryWrapper<EquWarrantyProviderDo>().eq("DELETED", 0).eq("ZUSCC",zuscc).eq("TENANTID",factoryId).last("limit 1");
|
|
|
EquWarrantyProviderDo providerZusccDo = equWarrantyProviderService.getOne(entity);
|
|
|
if (providerZusccDo!= null){
|
|
@@ -158,12 +139,30 @@ public class EquWarrantyProviderServiceImpl extends ServiceImpl<EquWarrantyProvi
|
|
|
}else {
|
|
|
stringBuilder.append("所属工厂必填");
|
|
|
}
|
|
|
- if (StringUtils.isNotBlank(dept)){
|
|
|
- deptId = commonDao.getIdByFactoryIdAndDept(factoryId,dept);
|
|
|
- }
|
|
|
if (StringUtil.isNotBlank(stringBuilder)) {
|
|
|
allStrBuilder.append("第").append(i + 1).append("行").append(stringBuilder).append("<br>");
|
|
|
}else {
|
|
|
+ //处理数据
|
|
|
+ if (StringUtil.isScience(code)){
|
|
|
+ BigDecimal formatAccount = new BigDecimal(code);
|
|
|
+ code = formatAccount.setScale(0,BigDecimal.ROUND_HALF_UP).toPlainString();
|
|
|
+ }else {
|
|
|
+ code = StringUtil.formatDecimal(code);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(phone)){
|
|
|
+ if (StringUtil.isScience(phone)){
|
|
|
+ BigDecimal formatPhone = new BigDecimal(phone);
|
|
|
+ phone = formatPhone.setScale(0,BigDecimal.ROUND_HALF_UP).toPlainString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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(dept)){
|
|
|
+ deptId = commonDao.getIdByFactoryIdAndDept(factoryId,dept);
|
|
|
+ }
|
|
|
equWarrantyProviderDo.setId(SecurityUtil.getUUID())
|
|
|
.setWarrantyprovidercode(code)
|
|
|
.setWarrantyprovider(name)
|