|
|
@@ -2752,23 +2752,23 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
|
|
|
@Override
|
|
|
public boolean checkLimit(InputAddTask in) {
|
|
|
- // true 返回错误,flase可以正常添加
|
|
|
TOrderNewBo orderNewBo = tOrderNewMapper.getOrderNewDetail(in.getOrderNo());
|
|
|
- if (orderNewBo.getUserType()==3){
|
|
|
+ if (orderNewBo == null) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (orderNewBo.getUserType() == 3) {
|
|
|
+ //如果是限定项目订单,则需要判断限定项目是否是开单人的私有或者签单限定
|
|
|
List<OutRestrictProject> outRestrictProjects = restrictProjectMapper.selectByUid(orderNewBo.getBuyerId());
|
|
|
- for (OutRestrictProject e : outRestrictProjects) {
|
|
|
- //找到配合的项目
|
|
|
- if (e.getPid().equals(in.getCommodityId())){
|
|
|
- //是私有或者签单
|
|
|
- if (e.getType()==1||e.getType()==2){
|
|
|
- if (e.getAid().equals(TokenManager.getAdminId())){
|
|
|
+ if (outRestrictProjects != null) {
|
|
|
+ for (OutRestrictProject e : outRestrictProjects) {
|
|
|
+ if (e.getPid().equals(in.getCommodityId())) {
|
|
|
+ if ((e.getType() == 1 || e.getType() == 2) && e.getAid().equals(TokenManager.getAdminId())) {
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
- //非限定直接可以发起
|
|
|
+ } else {
|
|
|
return false;
|
|
|
}
|
|
|
return true;
|