Commit 20f532c7 authored by 韩桐桐's avatar 韩桐桐

feat(设备代码):添加设备代码的唯一性校验接口

parent 3a23461b
...@@ -292,4 +292,18 @@ public class CommonController extends BaseController { ...@@ -292,4 +292,18 @@ public class CommonController extends BaseController {
} }
/**
* 校验EQUCODE的唯一性
* @param equCode EQUCODE
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/checkUniquenessOfEQUCODE")
@ApiOperation(httpMethod = "GET", value = "校验EQUCODE的唯一性", notes = "校验EQUCODE的唯一性")
public ResponseModel<Object> checkUniquenessOfEQUCODE(String equCode) {
Boolean bool = commonService.checkUniquenessOfEQUCODE(equCode);
return ResponseHelper.buildResponse(bool);
}
} }
...@@ -62,4 +62,6 @@ public interface ICommonService { ...@@ -62,4 +62,6 @@ public interface ICommonService {
* @param bizType 业务类型: notice-告知类, register-登记类 * @param bizType 业务类型: notice-告知类, register-登记类
*/ */
List<LinkedHashMap> getReceiveUnitTree(String bizType); List<LinkedHashMap> getReceiveUnitTree(String bizType);
Boolean checkUniquenessOfEQUCODE(String equCode);
} }
...@@ -34,9 +34,11 @@ import com.yeejoin.amos.boot.module.jg.biz.utils.JsonUtils; ...@@ -34,9 +34,11 @@ import com.yeejoin.amos.boot.module.jg.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils; import com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils;
import com.yeejoin.amos.boot.module.jg.flc.api.fegin.PrivilegeFeginService; import com.yeejoin.amos.boot.module.jg.flc.api.fegin.PrivilegeFeginService;
import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory; import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory;
import com.yeejoin.amos.boot.module.ymt.api.entity.RegistrationInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.RegistrationInfoMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
...@@ -163,6 +165,9 @@ public class CommonServiceImpl implements ICommonService { ...@@ -163,6 +165,9 @@ public class CommonServiceImpl implements ICommonService {
private static final String GMBG_PAGE_ID = "jgRegistrationInfo"; private static final String GMBG_PAGE_ID = "jgRegistrationInfo";
@Autowired @Autowired
RegistrationInfoMapper tzsJgRegistrationInfoMapper;
@Autowired
private IJgInstallationNoticeService iJgInstallationNoticeService; private IJgInstallationNoticeService iJgInstallationNoticeService;
@Autowired @Autowired
...@@ -322,6 +327,19 @@ public class CommonServiceImpl implements ICommonService { ...@@ -322,6 +327,19 @@ public class CommonServiceImpl implements ICommonService {
return !ObjectUtils.isEmpty(result) ? result : creatReceiveUnitTree(bizType); return !ObjectUtils.isEmpty(result) ? result : creatReceiveUnitTree(bizType);
} }
/**
* 验EQUCODE的唯一性
* @param equCode
* @return
*/
@Override
public Boolean checkUniquenessOfEQUCODE(String equCode) {
LambdaQueryWrapper<RegistrationInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(RegistrationInfo::getEquCode, equCode);
Integer count = tzsJgRegistrationInfoMapper.selectCount(wrapper);
return count > 0;
}
@Override @Override
public List<LinkedHashMap> getTree(ReginParams reginParams) { public List<LinkedHashMap> getTree(ReginParams reginParams) {
......
...@@ -578,7 +578,7 @@ ...@@ -578,7 +578,7 @@
<w:sz w:val="24"/> <w:sz w:val="24"/>
<w:lang w:val="en-US" w:eastAsia="zh-CN"/> <w:lang w:val="en-US" w:eastAsia="zh-CN"/>
</w:rPr> </w:rPr>
<w:t>设备注册代码</w:t> <w:t>设备代码</w:t>
</w:r> </w:r>
</w:p> </w:p>
</w:tc> </w:tc>
......
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