|
|
@@ -61,15 +61,13 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
|
|
|
DocBaseDTO docBaseDTO = new DocBaseDTO();
|
|
|
|
|
|
String bk_code = RegexpUtils.replaceSpecCharacter(bankinformation.getBk_bankcode());
|
|
|
- String code = pushMaxnubmer(bk_code, bankinformation.getId());
|
|
|
+ String code = null;
|
|
|
|
|
|
- String bktion = bankinformationMapper.selectBankcode(bankinformation.getBk_bankcode() ,BaseContextHolder.getCompanyId());
|
|
|
+ int bktion = bankinformationMapper.selectBankcode(bankinformation.getBk_bankcode() ,bankinformation.getId());
|
|
|
//先判断ID,再判断编号
|
|
|
if (bankinformation.getId() == 0)
|
|
|
{
|
|
|
- if (bktion != null){
|
|
|
- throw new BizException(500, BizExceptionCode.ACCOUNT_EXISTS.getMessage());
|
|
|
- }
|
|
|
+ code = pushMaxnubmer(bk_code, bankinformation.getId());
|
|
|
bankinformation.setBk_thisamount(bankinformation.getBk_beginamount());
|
|
|
bankinformation.setBk_bankcode(code);
|
|
|
bankinformationMapper.insertSelective(bankinformation);
|
|
|
@@ -103,15 +101,13 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Long id = bankinformationMapper.selectBankId(bankinformation.getBk_bankcode(), BaseContextHolder.getCompanyId());
|
|
|
- if (bktion != null){
|
|
|
- if (id.equals(bankinformation.getId())){
|
|
|
+// Long id = bankinformationMapper.selectBankId(bankinformation.getBk_bankcode(), BaseContextHolder.getCompanyId());
|
|
|
+ if (bktion > 0){
|
|
|
bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
|
|
|
messageLogService.update(docBaseDTO);
|
|
|
- }else {
|
|
|
- throw new BizException(500, BizExceptionCode.ACCOUNT_EXISTS.getMessage());
|
|
|
- }
|
|
|
}else {
|
|
|
+ code = pushMaxnubmer(bk_code, bankinformation.getId());
|
|
|
+ bankinformation.setBk_bankcode(code);
|
|
|
bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
|
|
|
messageLogService.update(docBaseDTO);
|
|
|
}
|