|
|
@@ -113,11 +113,10 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
|
|
|
throw new BizException(BizExceptionCode.EMPTY_DATA);
|
|
|
}
|
|
|
Vendor main = vendorListDTO.getMain();
|
|
|
- String code = null;
|
|
|
main.setCompanyId(BaseContextHolder.getCompanyId());
|
|
|
List<Vendorcontact> items = vendorListDTO.getItems();
|
|
|
+ String code = pushMaxnubmer(main.getVe_code(), main.getId());
|
|
|
if(main.getId() == 0){
|
|
|
- code = pushMaxnubmer(main.getVe_code(), main.getId());
|
|
|
int count = getMapper().getCountByCode(code, companyId);
|
|
|
if(count > 0){
|
|
|
throw new BizException(BizExceptionCode.REPEAT_NAME);
|
|
|
@@ -150,9 +149,10 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
|
|
|
//记录LOG
|
|
|
messageLogService.save(generateMsgObj(mainId, code));
|
|
|
}else{
|
|
|
- code = main.getVe_code();
|
|
|
+ main.setVe_code(code);
|
|
|
Long mainId = main.getId();
|
|
|
Vendor oldVendor = getMapper().selectByPrimaryKey(main.getId());
|
|
|
+
|
|
|
int count = getMapper().getCountByCode(code, companyId);
|
|
|
if (!code.equals(oldVendor.getVe_code())){
|
|
|
if (count > 0){
|