Merge branch 'dev' into 'uat'
Dev See merge request eshop/biz_service_ebtp_project!61
This commit is contained in:
@ -21,8 +21,12 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@Service
|
||||
public class CheckUtil {
|
||||
@Value("${check.porject.value}")
|
||||
private String checkValue;//"= {"\t","\n","\r","<",">","|","\\","?",":","*","\""}
|
||||
@Value("${check.porject.name-value}")
|
||||
private String nameCheckValue;//"= {"\t","\n","\r","<",">","|","\\","?",":","*","\""}
|
||||
|
||||
@Value("${check.porject.num-value}")
|
||||
private String numCheckValue;//"= {"\t","\n","\r","<",">","|","\\","?",":","*","\""}
|
||||
|
||||
@Value("${check.porject.length}") // = 200;
|
||||
private int checkLengh;
|
||||
@Value("${check.porject.checkBoolen}") // = 200;
|
||||
@ -30,10 +34,11 @@ public class CheckUtil {
|
||||
|
||||
//zhqbin 20220428 update 增加对委托项目名称\t\r\n字符校验
|
||||
public void checkEntrust(PurpImplementSendVO implementSendVO) {
|
||||
log.error("---------对"+checkValue+"..等字符---------------校验非法字符----------------------------");
|
||||
log.error("---------对"+nameCheckValue+"..等字符---------------名称校验非法字符----------------------------");
|
||||
log.error("---------对"+numCheckValue+"..等字符---------------编号校验非法字符----------------------------");
|
||||
if(implementSendVO.getPurpImplementName()!=null){
|
||||
log.error("------------------------校验非法字符----------------------------项目名称:"+implementSendVO.getPurpImplementName());
|
||||
check(implementSendVO.getPurpImplementName());
|
||||
check(implementSendVO.getPurpImplementName(),nameCheckValue);
|
||||
// Map<String, Object> resultMap = new HashMap<>()
|
||||
};
|
||||
if(implementSendVO.getPurpBaseInfoVoList()!=null){
|
||||
@ -41,8 +46,8 @@ public class CheckUtil {
|
||||
sectionList.forEach(s->{
|
||||
log.error("------------------------校验非法字符----------------------------标段名称:"+s.getPurpName());
|
||||
log.error("------------------------校验非法字符----------------------------标段编号:"+s.getPurpNo());
|
||||
this.check(s.getPurpName());
|
||||
this.check(s.getPurpNo());
|
||||
this.check(s.getPurpName(),nameCheckValue);
|
||||
this.check(s.getPurpNo(),numCheckValue);
|
||||
this.checkBdNameLengh("标段名称+标段编号",s.getPurpName()+s.getPurpNo());
|
||||
});
|
||||
}
|
||||
@ -53,7 +58,7 @@ public class CheckUtil {
|
||||
if(map.get("projectRecord")!=null){
|
||||
ProjectRecord record = (ProjectRecord)map.get("projectRecord");
|
||||
log.error("------------------------校验非法字符----------------------------项目名称:"+record.getProjectName());
|
||||
check(record.getProjectName());
|
||||
check(record.getProjectName(),nameCheckValue);
|
||||
// Map<String, Object> resultMap = new HashMap<>()
|
||||
};
|
||||
if(map.get("sectionList")!=null){
|
||||
@ -61,14 +66,20 @@ public class CheckUtil {
|
||||
sectionList.forEach(s->{
|
||||
log.error("------------------------校验非法字符----------------------------标段名称:"+s.getBidSectName());
|
||||
log.error("------------------------校验非法字符----------------------------标段编号:"+s.getBidSectBizNum());
|
||||
this.check(s.getBidSectName());
|
||||
this.check(s.getBidSectBizNum());
|
||||
this.check(s.getBidSectName(),nameCheckValue);
|
||||
this.check(s.getBidSectBizNum(),numCheckValue);
|
||||
this.checkBdNameLengh("标段名称+标段编号",s.getBidSectName()+s.getBidSectBizNum());
|
||||
});
|
||||
}
|
||||
}
|
||||
public void checkName(String s){
|
||||
this.check(s,nameCheckValue);
|
||||
}
|
||||
public void checkNum(String s){
|
||||
this.check(s,numCheckValue);
|
||||
}
|
||||
|
||||
public void check(String s) {
|
||||
public void check(String s,String checkValue) {
|
||||
//< > | \ / ? : * "
|
||||
if (s!=null&&s instanceof String&&checkBoolen) {
|
||||
log.info("----------校验参数--------"+s);
|
||||
|
@ -229,7 +229,7 @@ public class ProjectEntrustInquiryServiceImpl extends BaseServiceImpl<ProjectEnt
|
||||
private void checkInquiryVO(InquiryVO inquiryVO){
|
||||
|
||||
//zhqbin 20220506 inset 校验项目名称非法字符
|
||||
checkUtil.check(inquiryVO.getTitle());
|
||||
checkUtil.checkName(inquiryVO.getTitle());
|
||||
checkUtil.checkBdNameLengh("询价但标题与单号",inquiryVO.getTitle()+inquiryVO.getInquiryNo());
|
||||
//询价单ID
|
||||
if(StringUtils.isEmpty(inquiryVO.getInquiryId())){
|
||||
|
@ -49,7 +49,7 @@ public class ProjectRecordController{
|
||||
@PostMapping("")
|
||||
@PreAuthorize("hasAnyAuthority('ebtp-purchase','ebtp-agency-project-manager')")
|
||||
public BaseResponse<Boolean> insert(@ApiParam(value = "对象数据", required = true) @RequestBody @Valid ProjectRecordVO projectRecord){
|
||||
checkUtil.check(projectRecord.getProjectName());
|
||||
checkUtil.checkName(projectRecord.getProjectName());
|
||||
boolean save = projectRecordService.save(projectRecord);
|
||||
|
||||
return BaseResponse.success(save);
|
||||
@ -67,7 +67,7 @@ public class ProjectRecordController{
|
||||
@PreAuthorize("hasAnyAuthority('ebtp-purchase','ebtp-agency-project-manager')")
|
||||
public BaseResponse<Boolean> update(
|
||||
@ApiParam(value = "对象数据", required = true) @RequestBody ProjectRecordVO projectRecord){
|
||||
checkUtil.check(projectRecord.getProjectName());
|
||||
checkUtil.checkName(projectRecord.getProjectName());
|
||||
return BaseResponse.success(projectRecordService.updateProject(projectRecord));
|
||||
}
|
||||
|
||||
|
@ -47,8 +47,8 @@ public class ProjectSectionController{
|
||||
@PostMapping("")
|
||||
@PreAuthorize("hasAnyAuthority('ebtp-purchase','ebtp-agency-project-manager')")
|
||||
public BaseResponse<Boolean> insert(@ApiParam(value = "对象数据", required = true) @RequestBody @Valid ProjectSectionVO projectSection){
|
||||
checkUtil.check(projectSection.getBidSectName());
|
||||
checkUtil.check(projectSection.getBidSectBizNum());
|
||||
checkUtil.checkName(projectSection.getBidSectName());
|
||||
checkUtil.checkNum(projectSection.getBidSectBizNum());
|
||||
boolean save = projectSectionService.save(projectSection);
|
||||
|
||||
return BaseResponse.success(save);
|
||||
@ -65,8 +65,8 @@ public class ProjectSectionController{
|
||||
@PutMapping("")
|
||||
@PreAuthorize("hasAnyAuthority('ebtp-purchase','ebtp-agency-project-manager')")
|
||||
public BaseResponse<Boolean> update(@ApiParam(value = "对象数据", required = true) @RequestBody ProjectSectionVO projectSection){
|
||||
checkUtil.check(projectSection.getBidSectName());
|
||||
checkUtil.check(projectSection.getBidSectBizNum());
|
||||
checkUtil.checkName(projectSection.getBidSectName());
|
||||
checkUtil.checkNum(projectSection.getBidSectBizNum());
|
||||
return BaseResponse.success(projectSectionService.update(projectSection));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user