|
@@ -1,8 +1,13 @@
|
|
|
package org.springblade.meter.service.impl;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
|
+import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.meter.entity.MeterMidPayItemContract;
|
|
|
+import org.springblade.meter.entity.MeterTreeContract;
|
|
|
import org.springblade.meter.mapper.MidPayItemContractMapper;
|
|
|
import org.springblade.meter.service.MidPayItemContractService;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -11,4 +16,19 @@ import org.springframework.stereotype.Service;
|
|
|
@AllArgsConstructor
|
|
|
public class MidPayItemContractServiceImpl extends BaseServiceImpl<MidPayItemContractMapper, MeterMidPayItemContract> implements MidPayItemContractService {
|
|
|
|
|
|
+ @Override
|
|
|
+ public void sort(String ids) {
|
|
|
+ if (StringUtils.isNotBlank(ids)) {
|
|
|
+ String[] split = ids.split(",");
|
|
|
+ int sort = 1;
|
|
|
+ for (String id : split) {
|
|
|
+ this.update(Wrappers.<MeterMidPayItemContract>lambdaUpdate()
|
|
|
+ .set(MeterMidPayItemContract::getSort, sort++)
|
|
|
+ .eq(MeterMidPayItemContract::getId, id)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ throw new ServiceException("请传入ids");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|