|
@@ -17,6 +17,7 @@ import com.gree.mall.manager.exception.RemoteServiceException;
|
|
|
import com.gree.mall.manager.plus.entity.*;
|
|
|
import com.gree.mall.manager.plus.service.*;
|
|
|
import com.gree.mall.manager.utils.RedisUtil;
|
|
|
+import com.gree.mall.manager.utils.StringUtil;
|
|
|
import com.gree.mall.manager.utils.excel.ExcelUtils;
|
|
|
import com.gree.mall.manager.zfire.bean.ZfireParamBean;
|
|
|
import com.gree.mall.manager.zfire.util.FieldUtils;
|
|
@@ -232,12 +233,15 @@ public class SysDictCompanyLogic {
|
|
|
.eq(SysDictTypeCompany::getOpen, true)
|
|
|
.oneOpt()
|
|
|
.orElseThrow(() -> new RemoteServiceException("暂不开放该字典类型配置"));
|
|
|
- checkRepeatDictCode(param.getDictType(), param.getDictValue(), param.getCompanyWechatId());
|
|
|
+ checkRepeatDictCode(param.getDictType(), param.getDictValue(), param.getCompanyWechatId(),param.getDictCode());
|
|
|
if(adminUser != null) {
|
|
|
param.setCompanyName(adminUser.getCompanyName());
|
|
|
param.setCompanyWechatId(adminUser.getCompanyWechatId());
|
|
|
}
|
|
|
- param.setDictCode(IdWorker.getIdStr());
|
|
|
+ if (StringUtil.isEmpty(param.getDictCode())) {
|
|
|
+ param.setDictCode(IdWorker.getIdStr());
|
|
|
+ }
|
|
|
+
|
|
|
sysDictCompanyService.save(param);
|
|
|
}
|
|
|
|
|
@@ -266,10 +270,12 @@ public class SysDictCompanyLogic {
|
|
|
sysDictCompanyService.updateById(param);
|
|
|
}
|
|
|
|
|
|
- private void checkRepeatDictCode(String dictType, String value, String companyWechatId) {
|
|
|
+ private void checkRepeatDictCode(String dictType, String value, String companyWechatId,String code) {
|
|
|
Integer count = sysDictCompanyService.lambdaQuery()
|
|
|
.eq(SysDictCompany::getDictType, dictType)
|
|
|
.eq(SysDictCompany::getDictValue, value)
|
|
|
+ .eq(SysDictCompany::getDictValue, value)
|
|
|
+ .eq(!StringUtil.isEmpty(code),SysDictCompany::getDictCode, code)
|
|
|
.eq(SysDictCompany::getCompanyWechatId, companyWechatId)
|
|
|
.count();
|
|
|
if (count > 0) {
|