Commit 72b666bb by 唐功亮

【修改】 修改 统一社会信用代码 唯一性校验

parent e5a1f880
...@@ -49,8 +49,8 @@ public interface TycpdmFirmDao extends BaseMapper<TycpdmFirmEntity> { ...@@ -49,8 +49,8 @@ public interface TycpdmFirmDao extends BaseMapper<TycpdmFirmEntity> {
@Select("select count(1) from tycpdm_firm where firmName=#{firmname} and logout_flag=1") @Select("select count(1) from tycpdm_firm where firmName=#{firmname} and logout_flag=1")
int selectByIdFirmNameSC(@Param("firmname") String firmname); int selectByIdFirmNameSC(@Param("firmname") String firmname);
@Select("select count(1) from tycpdm_firm where certificateCode=#{certificateCode} and logout_flag=1") @Select("select count(1) from tycpdm_firm where certificateCode=#{certificateCode} and logout_flag=1 and f_id<>#{fId}")
int selectByIdCertificateCode(@Param("certificateCode") String certificateCode); int selectByIdCertificateCode(@Param("certificateCode") String certificateCode,@Param("fId") String fId);
@Select("select count(1) from firm where firm_name=#{firmname} and (logout_flag=2 or logout_flag=0)") @Select("select count(1) from firm where firm_name=#{firmname} and (logout_flag=2 or logout_flag=0)")
int selectByIdFirmNameXTSC(@Param("firmname")String firmname); int selectByIdFirmNameXTSC(@Param("firmname")String firmname);
......
...@@ -323,7 +323,8 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm ...@@ -323,7 +323,8 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm
if (!AlgorithmUtils.checkUSCC(certificateCode.toString())){ if (!AlgorithmUtils.checkUSCC(certificateCode.toString())){
throw new RRException("统一社会信用代码输入错误"); throw new RRException("统一社会信用代码输入错误");
} }
if(tycpdmFirmDao.selectByIdCertificateCode(String.valueOf(certificateCode))>0){
if(tycpdmFirmDao.selectByIdCertificateCode(String.valueOf(certificateCode),String.valueOf(body.get("fid")))>0){
throw new RRException("统一社会信用代码已存在"); throw new RRException("统一社会信用代码已存在");
} }
//写入死值 //写入死值
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment