|
|
@ -97,11 +97,6 @@ public class PointsRuleServiceImpl extends BaseServiceImpl<PointsRuleDao, Points |
|
|
|
if (checkRuleCode.getCode() == ErrorCode.INTERNAL_SERVER_ERROR) { |
|
|
|
return checkRuleCode; |
|
|
|
} |
|
|
|
// 判断所选动作是否重复
|
|
|
|
Result checkBehaviorCode = this.checkBehaviorCodeIsExist(dto.getBehaviorCode()); |
|
|
|
if (checkBehaviorCode.getCode() == ErrorCode.INTERNAL_SERVER_ERROR) { |
|
|
|
return checkBehaviorCode; |
|
|
|
} |
|
|
|
|
|
|
|
PointsRuleEntity entity = ConvertUtils.sourceToTarget(dto, PointsRuleEntity.class); |
|
|
|
insert(entity); |
|
|
@ -137,13 +132,6 @@ public class PointsRuleServiceImpl extends BaseServiceImpl<PointsRuleDao, Points |
|
|
|
return checkRuleCode; |
|
|
|
} |
|
|
|
} |
|
|
|
// 判断本次修改操作是否修改了动作编码, 如果改动了,查询新的动作编码是否在表中已存在
|
|
|
|
if (!(queryEntity.getBehaviorCode().equals(dto.getBehaviorCode()))) { |
|
|
|
Result checkBehaviorCode = this.checkBehaviorCodeIsExist(dto.getBehaviorCode()); |
|
|
|
if (checkBehaviorCode.getCode() == ErrorCode.INTERNAL_SERVER_ERROR) { |
|
|
|
return checkBehaviorCode; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
PointsRuleEntity entity = ConvertUtils.sourceToTarget(dto, PointsRuleEntity.class); |
|
|
|
updateById(entity); |
|
|
@ -217,19 +205,4 @@ public class PointsRuleServiceImpl extends BaseServiceImpl<PointsRuleDao, Points |
|
|
|
} |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description: 查询积动作是否存在 |
|
|
|
* @Param: [behaviorCode] |
|
|
|
* @return: com.elink.esua.epdc.commons.tools.utils.Result |
|
|
|
* @Author: zy |
|
|
|
* @Date: 2020-05-08 |
|
|
|
*/ |
|
|
|
private Result checkBehaviorCodeIsExist(String behaviorCode) { |
|
|
|
int behaviorCodeNum = baseDao.selectBehaviorCodeDoestItExist(behaviorCode); |
|
|
|
if (behaviorCodeNum > NumConstant.ZERO) { |
|
|
|
return new Result().error("动作已存在,请选择其他动作"); |
|
|
|
} |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
} |
|
|
|