批量更新车辆信息
This commit is contained in:
parent
85fd98c283
commit
830bb3404d
@ -303,4 +303,14 @@ public class CarInfoController {
|
|||||||
carInfoService.updateCarQrCode(param);
|
carInfoService.updateCarQrCode(param);
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "批量更新车辆信息", notes = "批量更新车辆信息", httpMethod = "POST")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
|
||||||
|
})
|
||||||
|
@PostMapping(value = "/editAllCar")
|
||||||
|
public Result editAllCar(@ApiIgnore @RequestBody Map<String, Object> param) {
|
||||||
|
carInfoService.editAllCar(param);
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,4 +47,6 @@ public interface ICarInfoService extends IService<CarInfo> {
|
|||||||
void editCarInfoForHikvision(CarInfo carInfo, CarInfo old);
|
void editCarInfoForHikvision(CarInfo carInfo, CarInfo old);
|
||||||
|
|
||||||
void updateCarQrCode(Map<String, Object> param);
|
void updateCarQrCode(Map<String, Object> param);
|
||||||
|
|
||||||
|
void editAllCar(Map<String, Object> param);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,6 +39,7 @@ import org.apache.commons.collections.MapUtils;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -432,4 +433,19 @@ public class CarInfoServiceImpl extends ServiceImpl<CarInfoMapper, CarInfo> impl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(propagation = Propagation.NOT_SUPPORTED)
|
||||||
|
public void editAllCar(Map<String, Object> param) {
|
||||||
|
String projectSn = MapUtils.getString(param, Cts.PROJECT_SN);
|
||||||
|
List<CarInfo> carInfos = carInfoMapper.selectList(new LambdaQueryWrapper<CarInfo>()
|
||||||
|
.eq(CarInfo::getProjectSn, projectSn));
|
||||||
|
for (CarInfo carInfo : carInfos) {
|
||||||
|
try {
|
||||||
|
editCarInfo(carInfo);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user