...
|
...
|
@@ -8,6 +8,7 @@ import java.util.List; |
|
|
import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import com.yoho.ufo.exception.PlatformException;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
...
|
...
|
@@ -77,9 +78,18 @@ public class RefundRecordServiceImpl implements IRefundRecordService, IBusinessE |
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int softDelete(String ids) {
|
|
|
public int softDelete(String ids) throws PlatformException {
|
|
|
String opName = new UserHelper().getUserName();
|
|
|
List<Integer> idList = exchangeIntegerArray(ids);
|
|
|
List<RefundRecord> records = refundRecordMapper.selectByIds(idList);
|
|
|
if (records.isEmpty()) {
|
|
|
throw new PlatformException("记录不存在!", 400);
|
|
|
}
|
|
|
for (RefundRecord r : records) {
|
|
|
if (!StringUtils.equals(r.getSponsorName(), opName)) {
|
|
|
throw new PlatformException("不能删除其他人发起的退款!", 400);
|
|
|
}
|
|
|
}
|
|
|
return refundRecordMapper.softDelete(idList, opName);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -125,12 +135,15 @@ public class RefundRecordServiceImpl implements IRefundRecordService, IBusinessE |
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int update(RefundRecordReq req) {
|
|
|
public int update(RefundRecordReq req) throws PlatformException {
|
|
|
RefundRecord oldRecord = refundRecordMapper.selectByPrimaryKey(req.getId());
|
|
|
if(null == oldRecord) {
|
|
|
return 0;
|
|
|
}
|
|
|
String opName = new UserHelper().getUserName();
|
|
|
if (!StringUtils.equals(oldRecord.getSponsorName(), opName)) {
|
|
|
throw new PlatformException("不能更新其他人发起的退款!", 400);
|
|
|
}
|
|
|
RefundRecord record = new RefundRecord();
|
|
|
record.setId(req.getId());
|
|
|
record.setCreateDate(StringUtils.isEmpty(req.getCreateDate()) ? null : DateUtil.getTimeSecondsFromStr(req.getCreateDate() + " 00:00:00", "yyyy/MM/dd HH:mm:ss"));
|
...
|
...
|
|